idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,419,404
public void outputLineAction(OutputEvent ev) {<NEW_LINE>File pom;<NEW_LINE>if (loc == null) {<NEW_LINE>pom = new File(config.getExecutionDirectory(), "pom.xml");<NEW_LINE>} else {<NEW_LINE>pom = FileUtilities.convertStringToFile(loc);<NEW_LINE>}<NEW_LINE>FileObject <MASK><NEW_LINE>if (pomFO == null) {<NEW_LINE>LOG.log(Level.WARNING, "no such file: {0}", pom);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DataObject pomDO;<NEW_LINE>try {<NEW_LINE>pomDO = DataObject.find(pomFO);<NEW_LINE>} catch (DataObjectNotFoundException x) {<NEW_LINE>LOG.log(Level.INFO, null, x);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LineCookie lc = pomDO.getLookup().lookup(LineCookie.class);<NEW_LINE>if (lc == null) {<NEW_LINE>LOG.log(Level.WARNING, "no LineCookie in {0}", pom);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>lc.getLineSet().getOriginal(line - 1).show(ShowOpenType.REUSE, ShowVisibilityType.FOCUS, column - 1);<NEW_LINE>} catch (IndexOutOfBoundsException x) {<NEW_LINE>LOG.log(Level.WARNING, "no such line {0} in {1}: {2}", new Object[] { line, pom, x });<NEW_LINE>}<NEW_LINE>}
pomFO = FileUtil.toFileObject(pom);
1,020,420
CompletableFuture<List<LogSegmentMetadata>> purgeLogSegmentsOlderThanTimestamp(final long minTimestampToKeep) {<NEW_LINE>if (minTimestampToKeep >= Utils.nowInMillis()) {<NEW_LINE>return FutureUtils.exception(new IllegalArgumentException("Invalid timestamp " + minTimestampToKeep + " to purge logs for " + getFullyQualifiedName()));<NEW_LINE>}<NEW_LINE>return getCachedLogSegmentsAfterFirstFullFetch(LogSegmentMetadata.COMPARATOR).thenCompose(new Function<List<LogSegmentMetadata>, CompletableFuture<List<LogSegmentMetadata>>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public CompletableFuture<List<LogSegmentMetadata>> apply(List<LogSegmentMetadata> logSegments) {<NEW_LINE>List<LogSegmentMetadata> purgeList = new ArrayList<LogSegmentMetadata>(logSegments.size());<NEW_LINE>int numCandidates = getNumCandidateLogSegmentsToPurge(logSegments);<NEW_LINE>for (int iterator = 0; iterator < numCandidates; iterator++) {<NEW_LINE>LogSegmentMetadata <MASK><NEW_LINE>// When application explicitly truncates segments; timestamp based purge is<NEW_LINE>// only used to cleanup log segments that have been marked for truncation<NEW_LINE>if ((l.isTruncated() || !conf.getExplicitTruncationByApplication()) && !l.isInProgress() && (l.getCompletionTime() < minTimestampToKeep)) {<NEW_LINE>purgeList.add(l);<NEW_LINE>} else {<NEW_LINE>// stop truncating log segments if we find either an inprogress or a partially<NEW_LINE>// truncated log segment<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.info("Deleting log segments older than {} for {} : {}", minTimestampToKeep, getFullyQualifiedName(), purgeList);<NEW_LINE>return deleteLogSegments(purgeList);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
l = logSegments.get(iterator);
1,026,457
public void loadSubclasses() throws Exception {<NEW_LINE>ClassLoader classLoader = Thread.currentThread().getContextClassLoader();<NEW_LINE>String packageName = PACKAGE.replace(".", "/");<NEW_LINE>URL <MASK><NEW_LINE>if (packageURL.getProtocol().equals("jar")) {<NEW_LINE>String jarFileName = URLDecoder.decode(packageURL.getFile(), "UTF-8");<NEW_LINE>jarFileName = jarFileName.substring(5, jarFileName.indexOf("!"));<NEW_LINE>JarFile jar = new JarFile(jarFileName);<NEW_LINE>Enumeration<JarEntry> jarEntries = jar.entries();<NEW_LINE>while (jarEntries.hasMoreElements()) {<NEW_LINE>String clazz = jarEntries.nextElement().getName();<NEW_LINE>if (clazz.startsWith(packageName) && clazz.length() > packageName.length() + 5) {<NEW_LINE>// remove ".class"<NEW_LINE>clazz = clazz.substring(0, clazz.length() - 6);<NEW_LINE>// convert to canonical name<NEW_LINE>clazz = clazz.replace("/", ".");<NEW_LINE>loadClass(Class.forName(clazz));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jar.close();<NEW_LINE>} else {<NEW_LINE>URI uri = new URI(packageURL.toString());<NEW_LINE>File folder = new File(uri.getPath());<NEW_LINE>File[] content = folder.listFiles();<NEW_LINE>for (File file : content) {<NEW_LINE>// remove ".class"<NEW_LINE>String clazz = file.getName().substring(0, file.getName().length() - 6);<NEW_LINE>loadClass(Class.forName(PACKAGE + "." + clazz));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
packageURL = classLoader.getResource(packageName);
1,801,572
protected void addSupportingElement(Element el) {<NEW_LINE>el = (Element) DOMUtils.getDomElement(el);<NEW_LINE>if (lastSupportingTokenElement != null) {<NEW_LINE>insertAfter(el, lastSupportingTokenElement);<NEW_LINE>} else if (lastDerivedKeyElement != null) {<NEW_LINE>insertAfter(el, lastDerivedKeyElement);<NEW_LINE>} else if (lastEncryptedKeyElement != null) {<NEW_LINE>LOG.log(Level.FINEST, "element = " + el + " topDownElement = " + topDownElement);<NEW_LINE>insertAfter(el, lastEncryptedKeyElement);<NEW_LINE>} else if (topDownElement != null) {<NEW_LINE>insertAfter(el, topDownElement);<NEW_LINE>} else if (bottomUpElement != null) {<NEW_LINE>el = (Element) DOMUtils.getDomElement(el);<NEW_LINE>secHeader.getSecurityHeader().insertBefore(el, bottomUpElement);<NEW_LINE>} else {<NEW_LINE>el = (<MASK><NEW_LINE>secHeader.getSecurityHeader().appendChild(el);<NEW_LINE>}<NEW_LINE>lastSupportingTokenElement = el;<NEW_LINE>}
Element) DOMUtils.getDomElement(el);
1,756,033
public GetMLTaskRunsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetMLTaskRunsResult getMLTaskRunsResult = new GetMLTaskRunsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getMLTaskRunsResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("TaskRuns", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getMLTaskRunsResult.setTaskRuns(new ListUnmarshaller<TaskRun>(TaskRunJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getMLTaskRunsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getMLTaskRunsResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
168,376
private String storageOverhead(Map<Integer, Integer> finalNodeToOverhead) {<NEW_LINE>double maxOverhead = Double.MIN_VALUE;<NEW_LINE>PartitionBalance pb = new PartitionBalance(currentCluster, currentStoreDefs);<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("Per-node store-overhead:").append(Utils.NEWLINE);<NEW_LINE>DecimalFormat doubleDf = new DecimalFormat("####.##");<NEW_LINE>for (int nodeId : finalCluster.getNodeIds()) {<NEW_LINE>Node node = finalCluster.getNodeById(nodeId);<NEW_LINE>String nodeTag = "Node " + String.format("%4d", nodeId) + " (" <MASK><NEW_LINE>int initialLoad = 0;<NEW_LINE>if (currentCluster.getNodeIds().contains(nodeId)) {<NEW_LINE>initialLoad = pb.getNaryPartitionCount(nodeId);<NEW_LINE>}<NEW_LINE>int toLoad = 0;<NEW_LINE>if (finalNodeToOverhead.containsKey(nodeId)) {<NEW_LINE>toLoad = finalNodeToOverhead.get(nodeId);<NEW_LINE>}<NEW_LINE>double overhead = (initialLoad + toLoad) / (double) initialLoad;<NEW_LINE>if (initialLoad > 0 && maxOverhead < overhead) {<NEW_LINE>maxOverhead = overhead;<NEW_LINE>}<NEW_LINE>String loadTag = String.format("%6d", initialLoad) + " + " + String.format("%6d", toLoad) + " -> " + String.format("%6d", initialLoad + toLoad) + " (" + doubleDf.format(overhead) + " X)";<NEW_LINE>sb.append(nodeTag + " : " + loadTag).append(Utils.NEWLINE);<NEW_LINE>}<NEW_LINE>sb.append(Utils.NEWLINE).append("**** Max per-node storage overhead: " + doubleDf.format(maxOverhead) + " X.").append(Utils.NEWLINE);<NEW_LINE>return (sb.toString());<NEW_LINE>}
+ node.getHost() + ")";
757,934
private void loadNode112() {<NEW_LINE>UaObjectTypeNode node = new UaObjectTypeNode(this.context, Identifiers.OperationLimitsType, new QualifiedName(0, "OperationLimitsType"), new LocalizedText("en", "OperationLimitsType"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), false);<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerRead.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerHistoryReadData.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerHistoryReadEvents.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerWrite.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerHistoryUpdateData.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerHistoryUpdateEvents.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerMethodCall.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerBrowse.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerRegisterNodes.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerTranslateBrowsePathsToNodeIds.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerNodeManagement.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxMonitoredItemsPerCall.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasSubtype, Identifiers.FolderType.expanded(), false));<NEW_LINE><MASK><NEW_LINE>}
this.nodeManager.addNode(node);
880,086
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>// Get Session Info<NEW_LINE>WebSessionCtx wsc = WebSessionCtx.get(request);<NEW_LINE>WWindowStatus ws = WWindowStatus.get(request);<NEW_LINE>if (// ws can be null for Login<NEW_LINE>wsc == null || ws == null)<NEW_LINE>;<NEW_LINE>// Get Parameter<NEW_LINE>String formName = WebUtil.getParameter(request, FIELD_FORM);<NEW_LINE>String fieldName = WebUtil.getParameter(request, FIELD_NAME);<NEW_LINE>String fieldValue = WebUtil.getParameter(request, FIELD_VALUE);<NEW_LINE>String locationValue = WebUtil.getParameter(request, LOCATION_VALUE);<NEW_LINE>log.info("doPost - Form=" + formName + " - Field=" + fieldName + " - Value=" + fieldValue + " - Location=" + locationValue);<NEW_LINE>// Document<NEW_LINE>WebDoc doc = createPage(wsc, ws, formName, fieldName, fieldValue, locationValue);<NEW_LINE>// The Form<NEW_LINE>form fu = new form(request.getRequestURI());<NEW_LINE>fu.setName(FORM_NAME);<NEW_LINE>fu.addElement(new input(input.TYPE_HIDDEN, FIELD_FORM, "y"));<NEW_LINE>fu.addElement(new input(input.TYPE_HIDDEN, FIELD_NAME, "y"));<NEW_LINE>fu.addElement(new input(input.TYPE_HIDDEN, FIELD_VALUE, "y"));<NEW_LINE>fu.addElement(new input(input.TYPE_HIDDEN, LOCATION_VALUE, locationValue));<NEW_LINE>doc.getBody().addElement(fu);<NEW_LINE>// log.trace(log.l1_User, "WFieldUpdate=" + doc.toString());<NEW_LINE>// Answer<NEW_LINE>WebUtil.createResponse(request, response, <MASK><NEW_LINE>}
this, null, doc, false);
1,556,690
public void onFrameResolutionChanged(int videoWidth, int videoHeight, int rotation) {<NEW_LINE>if (rendererEvents != null) {<NEW_LINE>rendererEvents.onFrameResolutionChanged(videoWidth, videoHeight, rotation);<NEW_LINE>}<NEW_LINE>textureRotation = rotation;<NEW_LINE>int rotatedWidth, rotatedHeight;<NEW_LINE>if (rotateTextureWithScreen) {<NEW_LINE>if (isCamera) {<NEW_LINE>onRotationChanged();<NEW_LINE>}<NEW_LINE>if (useCameraRotation) {<NEW_LINE>rotatedWidth = screenRotation == 0 ? videoHeight : videoWidth;<NEW_LINE>rotatedHeight = screenRotation == 0 ? videoWidth : videoHeight;<NEW_LINE>} else {<NEW_LINE>rotatedWidth = textureRotation == 0 || textureRotation == 180 || textureRotation == -180 ? videoWidth : videoHeight;<NEW_LINE>rotatedHeight = textureRotation == 0 || textureRotation == 180 || <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (isCamera) {<NEW_LINE>eglRenderer.setRotation(-OrientationHelper.cameraRotation);<NEW_LINE>}<NEW_LINE>rotation -= OrientationHelper.cameraOrientation;<NEW_LINE>rotatedWidth = rotation == 0 || rotation == 180 || rotation == -180 ? videoWidth : videoHeight;<NEW_LINE>rotatedHeight = rotation == 0 || rotation == 180 || rotation == -180 ? videoHeight : videoWidth;<NEW_LINE>}<NEW_LINE>// run immediately if possible for ui thread tests<NEW_LINE>synchronized (eglRenderer.layoutLock) {<NEW_LINE>if (updateScreenRunnable != null) {<NEW_LINE>AndroidUtilities.cancelRunOnUIThread(updateScreenRunnable);<NEW_LINE>}<NEW_LINE>postOrRun(updateScreenRunnable = () -> {<NEW_LINE>updateScreenRunnable = null;<NEW_LINE>this.videoWidth = videoWidth;<NEW_LINE>this.videoHeight = videoHeight;<NEW_LINE>rotatedFrameWidth = rotatedWidth;<NEW_LINE>rotatedFrameHeight = rotatedHeight;<NEW_LINE>updateSurfaceSize();<NEW_LINE>requestLayout();<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
textureRotation == -180 ? videoHeight : videoWidth;
198,939
public void marshall(DataSourceConfiguration dataSourceConfiguration, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (dataSourceConfiguration == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(dataSourceConfiguration.getS3Configuration(), S3CONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceConfiguration.getSharePointConfiguration(), SHAREPOINTCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceConfiguration.getDatabaseConfiguration(), DATABASECONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceConfiguration.getSalesforceConfiguration(), SALESFORCECONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceConfiguration.getOneDriveConfiguration(), ONEDRIVECONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceConfiguration.getServiceNowConfiguration(), SERVICENOWCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceConfiguration.getConfluenceConfiguration(), CONFLUENCECONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceConfiguration.getGoogleDriveConfiguration(), GOOGLEDRIVECONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceConfiguration.getWebCrawlerConfiguration(), WEBCRAWLERCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceConfiguration.getWorkDocsConfiguration(), WORKDOCSCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(dataSourceConfiguration.getFsxConfiguration(), FSXCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
dataSourceConfiguration.getSlackConfiguration(), SLACKCONFIGURATION_BINDING);
149,535
public USD unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>USD uSD = new USD();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Dollars", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>uSD.setDollars(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Cents", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>uSD.setCents(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("TenthFractionsOfACent", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>uSD.setTenthFractionsOfACent(context.getUnmarshaller(Integer.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return uSD;<NEW_LINE>}
class).unmarshall(context));
612,946
private String parseMember(ShapeId parent, Set<String> required, Set<String> defined, Set<String> remaining) {<NEW_LINE>// Parse optional member traits.<NEW_LINE>List<TraitEntry> memberTraits = parseDocsAndTraits();<NEW_LINE>SourceLocation memberLocation = currentLocation();<NEW_LINE>String memberName = ParserUtils.parseIdentifier(this);<NEW_LINE>if (defined.contains(memberName)) {<NEW_LINE>// This is a duplicate member name.<NEW_LINE>throw syntax("Duplicate member of " + parent + ": '" + memberName + '\'');<NEW_LINE>}<NEW_LINE>defined.add(memberName);<NEW_LINE>remaining.remove(memberName);<NEW_LINE>// Only enforce "allowedMembers" if it isn't empty.<NEW_LINE>if (!required.isEmpty() && !required.contains(memberName)) {<NEW_LINE>throw syntax("Unexpected member of " + parent + ": '" + memberName + '\'');<NEW_LINE>}<NEW_LINE>ws();<NEW_LINE>expect(':');<NEW_LINE>ws();<NEW_LINE>ShapeId memberId = parent.withMember(memberName);<NEW_LINE>MemberShape.Builder memberBuilder = MemberShape.builder().id(memberId).source(memberLocation);<NEW_LINE>String target = ParserUtils.parseShapeId(this);<NEW_LINE>modelFile.onShape(memberBuilder);<NEW_LINE>modelFile.<MASK><NEW_LINE>addTraits(memberId, memberTraits);<NEW_LINE>return memberName;<NEW_LINE>}
addForwardReference(target, memberBuilder::target);
223,970
public Answer Destroy(DestroyCommand cmd) {<NEW_LINE>TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.SIMULATOR_DB);<NEW_LINE>try {<NEW_LINE>txn.start();<NEW_LINE>MockVolumeVO volume = _mockVolumeDao.findByStoragePathAndType(cmd.getVolume().getPath());<NEW_LINE>if (volume != null) {<NEW_LINE>_mockVolumeDao.remove(volume.getId());<NEW_LINE>}<NEW_LINE>if (cmd.getVmName() != null) {<NEW_LINE>MockVm vm = _mockVMDao.findByVmName(cmd.getVmName());<NEW_LINE>if (vm != null) {<NEW_LINE>_mockVMDao.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>txn.commit();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>txn.rollback();<NEW_LINE>throw new CloudRuntimeException("Error when destroying volume " + cmd.getVolume().getPath(), ex);<NEW_LINE>} finally {<NEW_LINE>txn.close();<NEW_LINE>txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);<NEW_LINE>txn.close();<NEW_LINE>}<NEW_LINE>return new Answer(cmd);<NEW_LINE>}
remove(vm.getId());
838,476
public void performAction() {<NEW_LINE>File outputDir;<NEW_LINE>try {<NEW_LINE>Case currentCase = Case.getCurrentCaseThrows();<NEW_LINE>outputDir = new File(currentCase.getOutputDirectory());<NEW_LINE>if (outputDir.exists()) {<NEW_LINE>try {<NEW_LINE>Desktop.getDesktop().open(outputDir);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.SEVERE, String.format("Failed to open output folder %s", outputDir), ex);<NEW_LINE>NotifyDescriptor descriptor = new NotifyDescriptor.Message(NbBundle.getMessage(this.getClass(), "OpenOutputFolder.CouldNotOpenOutputFolder", outputDir.getAbsolutePath()), NotifyDescriptor.ERROR_MESSAGE);<NEW_LINE>DialogDisplayer.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>NotifyDescriptor descriptor = new NotifyDescriptor.Message(NbBundle.getMessage(this.getClass(), "OpenOutputFolder.error1", outputDir.getAbsolutePath()), NotifyDescriptor.ERROR_MESSAGE);<NEW_LINE>DialogDisplayer.getDefault().notify(descriptor);<NEW_LINE>}<NEW_LINE>} catch (NoCurrentCaseException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.SEVERE, "OpenOutputFolderAction enabled with no current case", ex);<NEW_LINE>JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), NbBundle.getMessage(this.getClass(), "OpenOutputFolder.noCaseOpen"));<NEW_LINE>}<NEW_LINE>}
getDefault().notify(descriptor);
833,397
public boolean visit(ForStatement node) {<NEW_LINE>List<Expression> initializers = node.initializers();<NEW_LINE>if (!initializers.isEmpty())<NEW_LINE>this.wrapIndexes.add(this.tm.firstIndexIn(initializers.get(0), -1));<NEW_LINE>if (node.getExpression() != null)<NEW_LINE>this.wrapIndexes.add(this.tm.firstIndexIn(node.getExpression(), -1));<NEW_LINE>List<Expression> updaters = node.updaters();<NEW_LINE>if (!updaters.isEmpty())<NEW_LINE>this.wrapIndexes.add(this.tm.firstIndexIn(updaters.get(0), -1));<NEW_LINE>if (!this.wrapIndexes.isEmpty()) {<NEW_LINE>this.wrapParentIndex = this.tm.firstIndexIn(node, TokenNameLPAREN);<NEW_LINE>this.wrapGroupEnd = this.tm.firstIndexBefore(<MASK><NEW_LINE>handleWrap(this.options.alignment_for_expressions_in_for_loop_header);<NEW_LINE>}<NEW_LINE>if (this.options.keep_simple_for_body_on_same_line)<NEW_LINE>handleSimpleLoop(node.getBody(), this.options.alignment_for_compact_loop);<NEW_LINE>return true;<NEW_LINE>}
node.getBody(), TokenNameRPAREN);
1,285,737
public static <T> T compatibleCast(Object value, Class<T> type) {<NEW_LINE>if (value == null || type == null || type.isAssignableFrom(value.getClass())) {<NEW_LINE>return (T) value;<NEW_LINE>}<NEW_LINE>if (value instanceof Number) {<NEW_LINE>Number number = (Number) value;<NEW_LINE>if (type == int.class || type == Integer.class) {<NEW_LINE>return (T) (Integer) number.intValue();<NEW_LINE>}<NEW_LINE>if (type == long.class || type == Long.class) {<NEW_LINE>return (T) <MASK><NEW_LINE>}<NEW_LINE>if (type == double.class || type == Double.class) {<NEW_LINE>return (T) (Double) number.doubleValue();<NEW_LINE>}<NEW_LINE>if (type == float.class || type == Float.class) {<NEW_LINE>return (T) (Float) number.floatValue();<NEW_LINE>}<NEW_LINE>if (type == byte.class || type == Byte.class) {<NEW_LINE>return (T) (Byte) number.byteValue();<NEW_LINE>}<NEW_LINE>if (type == short.class || type == Short.class) {<NEW_LINE>return (T) (Short) number.shortValue();<NEW_LINE>}<NEW_LINE>if (type == BigInteger.class) {<NEW_LINE>return (T) BigInteger.valueOf(number.longValue());<NEW_LINE>}<NEW_LINE>if (type == BigDecimal.class) {<NEW_LINE>return (T) BigDecimal.valueOf(number.doubleValue());<NEW_LINE>}<NEW_LINE>if (type == Date.class) {<NEW_LINE>return (T) new Date(number.longValue());<NEW_LINE>}<NEW_LINE>if (type == Boolean.class) {<NEW_LINE>return (T) (Boolean) (number.doubleValue() != 0.0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (value instanceof String) {<NEW_LINE>String str = (String) value;<NEW_LINE>if (type == Boolean.class) {<NEW_LINE>return (T) (Boolean) !str.isEmpty();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (T) value;<NEW_LINE>}
(Long) number.longValue();
52,408
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {<NEW_LINE>// If a new column was selected then change the key used to map from mCards to the column TextView<NEW_LINE>// Timber.i("NoteEditor:: onItemSelected() fired on mNoteTypeSpinner");<NEW_LINE>long oldModelId = getCol().getModels().current().getLong("id");<NEW_LINE>@NonNull<NEW_LINE>Long newId = mAllModelIds.get(pos);<NEW_LINE>Timber.i("Changing note type to '%d", newId);<NEW_LINE>if (oldModelId != newId) {<NEW_LINE>Model model = getCol().getModels().get(newId);<NEW_LINE>if (model == null) {<NEW_LINE>Timber.w("New model %s not found, not changing note type", newId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>getCol().getModels().setCurrent(model);<NEW_LINE>Deck currentDeck = getCol().getDecks().current();<NEW_LINE>currentDeck.put("mid", newId);<NEW_LINE>getCol().getDecks().save(currentDeck);<NEW_LINE>// Update deck<NEW_LINE>if (!getCol().get_config("addToCur", true)) {<NEW_LINE>mCurrentDid = model.<MASK><NEW_LINE>}<NEW_LINE>refreshNoteData(FieldChangeType.changeFieldCount(shouldReplaceNewlines()));<NEW_LINE>setDuplicateFieldStyles();<NEW_LINE>mDeckSpinnerSelection.updateDeckPosition(mCurrentDid);<NEW_LINE>}<NEW_LINE>}
optLong("did", Consts.DEFAULT_DECK_ID);
266,923
final ListTranscriptionJobsResult executeListTranscriptionJobs(ListTranscriptionJobsRequest listTranscriptionJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTranscriptionJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTranscriptionJobsRequest> request = null;<NEW_LINE>Response<ListTranscriptionJobsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ListTranscriptionJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTranscriptionJobsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Transcribe");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTranscriptionJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTranscriptionJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTranscriptionJobsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,413,692
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>personaIDLabel = new javax.swing.JLabel();<NEW_LINE>viewButton = new javax.swing.JButton();<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(personaIDLabel, org.openide.util.NbBundle.getMessage(PersonaPanel.class, "PersonaPanel.personaIDLabel.text"));<NEW_LINE>gridBagConstraints = <MASK><NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);<NEW_LINE>add(personaIDLabel, gridBagConstraints);<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(viewButton, org.openide.util.NbBundle.getMessage(PersonaPanel.class, "PersonaPanel.viewButton.text"));<NEW_LINE>viewButton.setMargin(new java.awt.Insets(0, 5, 0, 5));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);<NEW_LINE>add(viewButton, gridBagConstraints);<NEW_LINE>}
new java.awt.GridBagConstraints();
1,323,385
public void serialize(Geometry geom, JsonGenerator gen, SerializerProvider serializers) throws IOException, JsonProcessingException {<NEW_LINE>gen.writeStartObject();<NEW_LINE>gen.writeFieldName("type");<NEW_LINE>gen.writeString(geom.getClass().getSimpleName());<NEW_LINE>if (geom instanceof Point) {<NEW_LINE>Point v = (Point) geom;<NEW_LINE>gen.writeFieldName("coordinates");<NEW_LINE>write(gen, v.getCoordinate());<NEW_LINE>} else if (geom instanceof Polygon) {<NEW_LINE>gen.writeFieldName("coordinates");<NEW_LINE>write(gen, (Polygon) geom);<NEW_LINE>} else if (geom instanceof LineString) {<NEW_LINE>LineString v = (LineString) geom;<NEW_LINE>gen.writeFieldName("coordinates");<NEW_LINE>write(gen, v.getCoordinateSequence());<NEW_LINE>} else if (geom instanceof MultiPoint) {<NEW_LINE>MultiPoint v = (MultiPoint) geom;<NEW_LINE>gen.writeFieldName("coordinates");<NEW_LINE>write(<MASK><NEW_LINE>} else if (geom instanceof MultiLineString) {<NEW_LINE>MultiLineString v = (MultiLineString) geom;<NEW_LINE>gen.writeFieldName("coordinates");<NEW_LINE>gen.writeStartArray();<NEW_LINE>for (int i = 0; i < v.getNumGeometries(); i++) {<NEW_LINE>write(gen, v.getGeometryN(i).getCoordinates());<NEW_LINE>}<NEW_LINE>gen.writeEndArray();<NEW_LINE>} else if (geom instanceof MultiPolygon) {<NEW_LINE>MultiPolygon v = (MultiPolygon) geom;<NEW_LINE>gen.writeFieldName("coordinates");<NEW_LINE>gen.writeStartArray();<NEW_LINE>for (int i = 0; i < v.getNumGeometries(); i++) {<NEW_LINE>write(gen, (Polygon) v.getGeometryN(i));<NEW_LINE>}<NEW_LINE>gen.writeEndArray();<NEW_LINE>} else if (geom instanceof GeometryCollection) {<NEW_LINE>GeometryCollection v = (GeometryCollection) geom;<NEW_LINE>gen.writeFieldName("geometries");<NEW_LINE>gen.writeStartArray();<NEW_LINE>for (int i = 0; i < v.getNumGeometries(); i++) {<NEW_LINE>serialize(v.getGeometryN(i), gen, serializers);<NEW_LINE>}<NEW_LINE>gen.writeEndArray();<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("unknown: " + geom);<NEW_LINE>}<NEW_LINE>gen.writeEndObject();<NEW_LINE>}
gen, v.getCoordinates());
1,497,166
public int countByItemAndRelationshipType(Context context, Item item, RelationshipType relationshipType, boolean isLeft) throws SQLException {<NEW_LINE>CriteriaBuilder criteriaBuilder = getCriteriaBuilder(context);<NEW_LINE>CriteriaQuery criteriaQuery = getCriteriaQuery(criteriaBuilder, Relationship.class);<NEW_LINE>Root<Relationship> relationshipRoot = criteriaQuery.from(Relationship.class);<NEW_LINE>criteriaQuery.select(relationshipRoot);<NEW_LINE>if (isLeft) {<NEW_LINE>criteriaQuery.where(criteriaBuilder.equal(relationshipRoot.get(Relationship_.relationshipType), relationshipType), criteriaBuilder.equal(relationshipRoot.get(Relationship_.leftItem), item));<NEW_LINE>} else {<NEW_LINE>criteriaQuery.where(criteriaBuilder.equal(relationshipRoot.get(Relationship_.relationshipType), relationshipType), criteriaBuilder.equal(relationshipRoot.get(<MASK><NEW_LINE>}<NEW_LINE>return count(context, criteriaQuery, criteriaBuilder, relationshipRoot);<NEW_LINE>}
Relationship_.rightItem), item));
1,287,334
public ListAccessPoliciesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListAccessPoliciesResult listAccessPoliciesResult = new ListAccessPoliciesResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listAccessPoliciesResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("accessPolicySummaries", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listAccessPoliciesResult.setAccessPolicySummaries(new ListUnmarshaller<AccessPolicySummary>(AccessPolicySummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listAccessPoliciesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listAccessPoliciesResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,200,548
public void combine(CRFClassifier<IN> crf, double weight) {<NEW_LINE>Timing timer = new Timing();<NEW_LINE>// Check the CRFClassifiers are compatible<NEW_LINE>if (!this.pad.equals(crf.pad)) {<NEW_LINE>throw new RuntimeException("Incompatible CRFClassifier: pad does not match");<NEW_LINE>}<NEW_LINE>if (this.windowSize != crf.windowSize) {<NEW_LINE>throw new RuntimeException("Incompatible CRFClassifier: windowSize does not match");<NEW_LINE>}<NEW_LINE>if (this.labelIndices.size() != crf.labelIndices.size()) {<NEW_LINE>// Should match since this should be same as the windowSize<NEW_LINE>throw new RuntimeException("Incompatible CRFClassifier: labelIndices length does not match");<NEW_LINE>}<NEW_LINE>this.classIndex.addAll(crf.classIndex.objectsList());<NEW_LINE>// Combine weights of the other classifier with this classifier,<NEW_LINE>// weighing the other classifier's weights by weight<NEW_LINE>// First merge the feature indices<NEW_LINE>int oldNumFeatures1 = this.featureIndex.size();<NEW_LINE>int oldNumFeatures2 = crf.featureIndex.size();<NEW_LINE><MASK><NEW_LINE>int oldNumWeights2 = crf.getNumWeights();<NEW_LINE>this.featureIndex.addAll(crf.featureIndex.objectsList());<NEW_LINE>this.knownLCWords.addAll(crf.knownLCWords);<NEW_LINE>assert (weights.length == oldNumFeatures1);<NEW_LINE>// Combine weights of this classifier with other classifier<NEW_LINE>for (int i = 0; i < labelIndices.size(); i++) {<NEW_LINE>this.labelIndices.get(i).addAll(crf.labelIndices.get(i).objectsList());<NEW_LINE>}<NEW_LINE>log.info("Combining weights: will automatically match labelIndices");<NEW_LINE>combineWeights(crf, weight);<NEW_LINE>int numFeatures = featureIndex.size();<NEW_LINE>int numWeights = getNumWeights();<NEW_LINE>long elapsedMs = timer.stop();<NEW_LINE>log.info("numFeatures: orig1=" + oldNumFeatures1 + ", orig2=" + oldNumFeatures2 + ", combined=" + numFeatures);<NEW_LINE>log.info("numWeights: orig1=" + oldNumWeights1 + ", orig2=" + oldNumWeights2 + ", combined=" + numWeights);<NEW_LINE>log.info("Time to combine CRFClassifier: " + Timing.toSecondsString(elapsedMs) + " seconds");<NEW_LINE>}
int oldNumWeights1 = this.getNumWeights();
752,721
public void testBasicConstraints() throws Exception {<NEW_LINE>FieldValidatedBean b = new FieldValidatedBean();<NEW_LINE>b.notNull = null;<NEW_LINE>assertViolations(ivValidator.validate(b), NotNull.class);<NEW_LINE>b = new FieldValidatedBean();<NEW_LINE>b.email = "bob@bogus.com";<NEW_LINE>assertViolations(ivValidator.validate(b), Email.class);<NEW_LINE>b = new FieldValidatedBean();<NEW_LINE>b.future = Instant.now().minusSeconds(5);<NEW_LINE>assertViolations(ivValidator.validate(b), Future.class);<NEW_LINE>b = new FieldValidatedBean();<NEW_LINE>b.max100 = 101;<NEW_LINE>assertViolations(ivValidator.validate(b), Max.class);<NEW_LINE>b = new FieldValidatedBean();<NEW_LINE>b.min5 = 3;<NEW_LINE>assertViolations(ivValidator.validate(b), Min.class);<NEW_LINE>b = new FieldValidatedBean();<NEW_LINE>b.negative = 1;<NEW_LINE>assertViolations(ivValidator.validate(b), Negative.class);<NEW_LINE>b = new FieldValidatedBean();<NEW_LINE>b.negativeOrZero = 1;<NEW_LINE>assertViolations(ivValidator.validate(b), NegativeOrZero.class);<NEW_LINE>b = new FieldValidatedBean();<NEW_LINE>b.notNull = null;<NEW_LINE>assertViolations(ivValidator.validate(b), NotNull.class);<NEW_LINE>b = new FieldValidatedBean();<NEW_LINE>b.<MASK><NEW_LINE>assertViolations(ivValidator.validate(b), Past.class);<NEW_LINE>b = new FieldValidatedBean();<NEW_LINE>b.positive = -1;<NEW_LINE>assertViolations(ivValidator.validate(b), Positive.class);<NEW_LINE>b = new FieldValidatedBean();<NEW_LINE>b.positiveOrZero = -1;<NEW_LINE>assertViolations(ivValidator.validate(b), PositiveOrZero.class);<NEW_LINE>b = new FieldValidatedBean();<NEW_LINE>b.size3to5 = "ab";<NEW_LINE>assertViolations(ivValidator.validate(b), Size.class);<NEW_LINE>b = new FieldValidatedBean();<NEW_LINE>b.size3to5 = "abcdefg";<NEW_LINE>b.past = Year.of(2222);<NEW_LINE>assertViolations(ivValidator.validate(b), Size.class, Past.class);<NEW_LINE>b = new FieldValidatedBean();<NEW_LINE>b.validBean.positive = -1;<NEW_LINE>assertViolations(ivValidator.validate(b), Positive.class);<NEW_LINE>}
past = Year.of(2222);
867,268
static PayableDocument toPayableDocument(@NonNull final InvoiceRow row, @NonNull final List<PaymentDocument> paymentDocuments, @NonNull final MoneyService moneyService, @NonNull final InvoiceProcessingServiceCompanyService invoiceProcessingServiceCompanyService) {<NEW_LINE>// NOTE: assuming InvoiceRow amounts are already CreditMemo adjusted,<NEW_LINE>// BUT they are not Sales/Purchase sign adjusted.<NEW_LINE>// So we will have to do this bellow.<NEW_LINE>final Money openAmt = moneyService.toMoney(row.getOpenAmt());<NEW_LINE>final Money discountAmt = moneyService.toMoney(row.getDiscountAmt());<NEW_LINE>final CurrencyId currencyId = openAmt.getCurrencyId();<NEW_LINE>@Nullable<NEW_LINE>final Amount serviceFeeAmt = row.getServiceFeeAmt();<NEW_LINE>@Nullable<NEW_LINE>final InvoiceProcessingFeeCalculation invoiceProcessingFeeCalculation;<NEW_LINE>if (serviceFeeAmt != null && !serviceFeeAmt.isZero()) {<NEW_LINE>final InvoiceProcessingContext invoiceProcessingContext = extractInvoiceProcessingContext(row, paymentDocuments, invoiceProcessingServiceCompanyService);<NEW_LINE>invoiceProcessingFeeCalculation = invoiceProcessingServiceCompanyService.createFeeCalculationForPayment(InvoiceProcessingFeeWithPrecalculatedAmountRequest.builder().orgId(row.getClientAndOrgId().getOrgId()).paymentDate(invoiceProcessingContext.getPaymentDate()).customerId(row.getBPartnerId()).invoiceId(row.getInvoiceId()).feeAmountIncludingTax(serviceFeeAmt).serviceCompanyBPartnerId(invoiceProcessingContext.getServiceCompanyId()).build()).orElseThrow(() -> new AdempiereException("Cannot find Invoice Processing Service Company for the selected Payment"));<NEW_LINE>} else {<NEW_LINE>invoiceProcessingFeeCalculation = null;<NEW_LINE>}<NEW_LINE>final Money invoiceProcessingFee = invoiceProcessingFeeCalculation != null ? moneyService.toMoney(invoiceProcessingFeeCalculation.getFeeAmountIncludingTax()) : Money.zero(currencyId);<NEW_LINE>final Money payAmt = openAmt.subtract<MASK><NEW_LINE>final SOTrx soTrx = row.getDocBaseType().getSoTrx();<NEW_LINE>return PayableDocument.builder().invoiceId(row.getInvoiceId()).bpartnerId(row.getBPartnerId()).documentNo(row.getDocumentNo()).soTrx(soTrx).creditMemo(row.getDocBaseType().isCreditMemo()).openAmt(openAmt.negateIf(soTrx.isPurchase())).amountsToAllocate(AllocationAmounts.builder().payAmt(payAmt).discountAmt(discountAmt).invoiceProcessingFee(invoiceProcessingFee).build().convertToRealAmounts(row.getInvoiceAmtMultiplier())).invoiceProcessingFeeCalculation(invoiceProcessingFeeCalculation).date(row.getDateInvoiced()).clientAndOrgId(row.getClientAndOrgId()).currencyConversionTypeId(row.getCurrencyConversionTypeId()).build();<NEW_LINE>}
(discountAmt).subtract(invoiceProcessingFee);
1,555,040
final GetContentResult executeGetContent(GetContentRequest getContentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getContentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetContentRequest> request = null;<NEW_LINE>Response<GetContentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetContentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getContentRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Wisdom");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetContent");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetContentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetContentResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
113,122
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AccessAnalyzer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,639,225
Forwardable<EDGE_VIEW, Order.Asc> iterateBufferedViews(Encoding.Edge.Thing encoding, IID[] lookahead) {<NEW_LINE>ConcurrentNavigableMap<EDGE_VIEW, ThingEdgeImpl.Buffered> result;<NEW_LINE>InfixIID.Thing infixIID = infixIID(encoding, lookahead);<NEW_LINE>if (lookahead.length == encoding.lookAhead()) {<NEW_LINE>return (result = edges.get(infixIID)) != null ? iterateSorted(result.keySet(), ASC) : emptySorted();<NEW_LINE>}<NEW_LINE>assert lookahead.length < encoding.lookAhead();<NEW_LINE>Set<InfixIID.Thing> iids = new HashSet<>();<NEW_LINE>iids.add(infixIID);<NEW_LINE>for (int i = lookahead.length; i < encoding.lookAhead() && !iids.isEmpty(); i++) {<NEW_LINE>Set<InfixIID.Thing> <MASK><NEW_LINE>for (InfixIID.Thing iid : iids) {<NEW_LINE>Set<InfixIID.Thing> someNewIIDs = infixes.get(iid);<NEW_LINE>if (someNewIIDs != null)<NEW_LINE>newIIDs.addAll(someNewIIDs);<NEW_LINE>}<NEW_LINE>iids = newIIDs;<NEW_LINE>}<NEW_LINE>return iterate(iids).mergeMap(iid -> {<NEW_LINE>ConcurrentNavigableMap<EDGE_VIEW, ThingEdgeImpl.Buffered> res;<NEW_LINE>return (res = edges.get(iid)) != null ? iterateSorted(res.keySet(), ASC) : emptySorted();<NEW_LINE>}, ASC);<NEW_LINE>}
newIIDs = new HashSet<>();
298,537
public static DescribeInstancesResponse unmarshall(DescribeInstancesResponse describeInstancesResponse, UnmarshallerContext context) {<NEW_LINE>describeInstancesResponse.setRequestId(context.stringValue("DescribeInstancesResponse.RequestId"));<NEW_LINE>describeInstancesResponse.setTotalCount(context.integerValue("DescribeInstancesResponse.TotalCount"));<NEW_LINE>List<Instance> instances = new ArrayList<Instance>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeInstancesResponse.Instances.Length"); i++) {<NEW_LINE>Instance instance = new Instance();<NEW_LINE>instance.setInstanceId(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].InstanceId"));<NEW_LINE>instance.setRegionId(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].RegionId"));<NEW_LINE>instance.setZoneId(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].ZoneId"));<NEW_LINE>instance.setHsmStatus(context.integerValue("DescribeInstancesResponse.Instances[" + i + "].HsmStatus"));<NEW_LINE>instance.setHsmOem(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].HsmOem"));<NEW_LINE>instance.setHsmDeviceType(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].HsmDeviceType"));<NEW_LINE>instance.setVpcId(context.stringValue<MASK><NEW_LINE>instance.setVswitchId(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].VswitchId"));<NEW_LINE>instance.setIp(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].Ip"));<NEW_LINE>instance.setRemark(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].Remark"));<NEW_LINE>instance.setExpiredTime(context.longValue("DescribeInstancesResponse.Instances[" + i + "].ExpiredTime"));<NEW_LINE>instance.setCreateTime(context.longValue("DescribeInstancesResponse.Instances[" + i + "].CreateTime"));<NEW_LINE>List<String> whiteList = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < context.lengthValue("DescribeInstancesResponse.Instances[" + i + "].WhiteList.Length"); j++) {<NEW_LINE>whiteList.add(context.stringValue("DescribeInstancesResponse.Instances[" + i + "].WhiteList[" + j + "]"));<NEW_LINE>}<NEW_LINE>instance.setWhiteList(whiteList);<NEW_LINE>instances.add(instance);<NEW_LINE>}<NEW_LINE>describeInstancesResponse.setInstances(instances);<NEW_LINE>return describeInstancesResponse;<NEW_LINE>}
("DescribeInstancesResponse.Instances[" + i + "].VpcId"));
1,765,977
public Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String serverName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (serverName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2019-06-01-preview";<NEW_LINE>return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, serverName, this.client.getSubscriptionId(), apiVersion, context)).subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
1,395,606
protected void doExecute(Task task, MultiSearchTemplateRequest request, ActionListener<MultiSearchTemplateResponse> listener) {<NEW_LINE>List<Integer> originalSlots = new ArrayList<>();<NEW_LINE>MultiSearchRequest multiSearchRequest = new MultiSearchRequest();<NEW_LINE>multiSearchRequest.indicesOptions(request.indicesOptions());<NEW_LINE>if (request.maxConcurrentSearchRequests() != 0) {<NEW_LINE>multiSearchRequest.maxConcurrentSearchRequests(request.maxConcurrentSearchRequests());<NEW_LINE>}<NEW_LINE>MultiSearchTemplateResponse.Item[] items = new MultiSearchTemplateResponse.Item[request.requests().size()];<NEW_LINE>for (int i = 0; i < items.length; i++) {<NEW_LINE>SearchTemplateRequest searchTemplateRequest = request.requests().get(i);<NEW_LINE>SearchTemplateResponse searchTemplateResponse = new SearchTemplateResponse();<NEW_LINE>SearchRequest searchRequest;<NEW_LINE>try {<NEW_LINE>searchRequest = convert(searchTemplateRequest, searchTemplateResponse, scriptService, xContentRegistry);<NEW_LINE>} catch (Exception e) {<NEW_LINE>items[i] = new <MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>items[i] = new MultiSearchTemplateResponse.Item(searchTemplateResponse, null);<NEW_LINE>if (searchRequest != null) {<NEW_LINE>multiSearchRequest.add(searchRequest);<NEW_LINE>originalSlots.add(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>client.multiSearch(multiSearchRequest, ActionListener.wrap(r -> {<NEW_LINE>for (int i = 0; i < r.getResponses().length; i++) {<NEW_LINE>MultiSearchResponse.Item item = r.getResponses()[i];<NEW_LINE>int originalSlot = originalSlots.get(i);<NEW_LINE>if (item.isFailure()) {<NEW_LINE>items[originalSlot] = new MultiSearchTemplateResponse.Item(null, item.getFailure());<NEW_LINE>} else {<NEW_LINE>items[originalSlot].getResponse().setResponse(item.getResponse());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>listener.onResponse(new MultiSearchTemplateResponse(items, r.getTook().millis()));<NEW_LINE>}, listener::onFailure));<NEW_LINE>}
MultiSearchTemplateResponse.Item(null, e);
210,610
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>super.onViewCreated(view, savedInstanceState);<NEW_LINE>Context context = getContext();<NEW_LINE>prefs = PreferenceManager.getDefaultSharedPreferences(mActivity);<NEW_LINE>prefsNoBackup = mActivity.getSharedPreferences("nobackup", Context.MODE_PRIVATE);<NEW_LINE>mRememberKeyfile = prefs.getBoolean(getString(R.string.keyfile_key), getResources().getBoolean(R.bool.keyfile_default));<NEW_LINE>confirmButton = (Button) view.findViewById(R.id.pass_ok);<NEW_LINE>passwordView = (EditText) view.<MASK><NEW_LINE>biometricOpen = (Button) view.findViewById(R.id.open_biometric);<NEW_LINE>biometricClear = (Button) view.findViewById(R.id.clear_biometric);<NEW_LINE>divider3 = view.findViewById(R.id.divider3);<NEW_LINE>biometricCheck = (CheckBox) view.findViewById(R.id.save_password);<NEW_LINE>biometricOpen.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>biometricLogin();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>biometricClear.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>clearStoredCredentials();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
findViewById(R.id.password);
20,365
public static FileArgument from(List<Value> lv, boolean isFolder, Reason reason) {<NEW_LINE>if (lv.size() < 2)<NEW_LINE>throw new InternalExpressionException("File functions require path and type as first two arguments");<NEW_LINE>String origtype = lv.get(1).getString().toLowerCase(Locale.ROOT);<NEW_LINE>boolean shared = origtype.startsWith("shared_");<NEW_LINE>// len(shared_)<NEW_LINE>String typeString = shared ? <MASK><NEW_LINE>Type type = Type.of.get(typeString);<NEW_LINE>Pair<String, String> resource = recognizeResource(lv.get(0).getString(), isFolder, type);<NEW_LINE>if (type == null)<NEW_LINE>throw new InternalExpressionException("Unsupported file type: " + origtype);<NEW_LINE>if (type == Type.FOLDER && !isFolder)<NEW_LINE>throw new InternalExpressionException("Folder types are no supported for this IO function");<NEW_LINE>return new FileArgument(resource.getLeft(), type, resource.getRight(), isFolder, shared, reason);<NEW_LINE>}
origtype.substring(7) : origtype;
1,836,516
public static QueryOrderIdByPayIdResponse unmarshall(QueryOrderIdByPayIdResponse queryOrderIdByPayIdResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryOrderIdByPayIdResponse.setRequestId(_ctx.stringValue("QueryOrderIdByPayIdResponse.RequestId"));<NEW_LINE>queryOrderIdByPayIdResponse.setCode(_ctx.stringValue("QueryOrderIdByPayIdResponse.Code"));<NEW_LINE>queryOrderIdByPayIdResponse.setMessage(_ctx.stringValue("QueryOrderIdByPayIdResponse.Message"));<NEW_LINE>List<LmOrderIdsItem> lmOrderIds = new ArrayList<LmOrderIdsItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryOrderIdByPayIdResponse.LmOrderIds.Length"); i++) {<NEW_LINE>LmOrderIdsItem lmOrderIdsItem = new LmOrderIdsItem();<NEW_LINE>lmOrderIdsItem.setLmOrderId(_ctx.longValue<MASK><NEW_LINE>lmOrderIds.add(lmOrderIdsItem);<NEW_LINE>}<NEW_LINE>queryOrderIdByPayIdResponse.setLmOrderIds(lmOrderIds);<NEW_LINE>return queryOrderIdByPayIdResponse;<NEW_LINE>}
("QueryOrderIdByPayIdResponse.LmOrderIds[" + i + "].LmOrderId"));
1,834,211
public void buildOptions(UIDL uidl) {<NEW_LINE>select.clear();<NEW_LINE>firstValueIsTemporaryNullItem = false;<NEW_LINE>if (isNullSelectionAllowed() && !isNullSelectionItemAvailable()) {<NEW_LINE>// can't unselect last item in singleselect mode<NEW_LINE>select.addItem("", (String) null);<NEW_LINE>}<NEW_LINE>boolean selected = false;<NEW_LINE>for (final Object child : uidl) {<NEW_LINE><MASK><NEW_LINE>select.addItem(optionUidl.getStringAttribute("caption"), optionUidl.getStringAttribute("key"));<NEW_LINE>if (optionUidl.hasAttribute("selected")) {<NEW_LINE>select.setItemSelected(select.getItemCount() - 1, true);<NEW_LINE>selected = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!selected && !isNullSelectionAllowed()) {<NEW_LINE>// null-select not allowed, but value not selected yet; add null and<NEW_LINE>// remove when something is selected<NEW_LINE>select.insertItem("", (String) null, 0);<NEW_LINE>select.setItemSelected(0, true);<NEW_LINE>firstValueIsTemporaryNullItem = true;<NEW_LINE>}<NEW_LINE>}
final UIDL optionUidl = (UIDL) child;
714,745
protected R createRecord(Data key, Object value, long expiryTime, long now, boolean disableWriteThrough, int completionId, UUID origin) {<NEW_LINE>R record = createRecord(value, now, expiryTime);<NEW_LINE>try {<NEW_LINE>doPutRecord(key, record, origin, true);<NEW_LINE>} catch (Throwable error) {<NEW_LINE>onCreateRecordError(key, value, expiryTime, now, disableWriteThrough, completionId, origin, record, error);<NEW_LINE>throw ExceptionUtil.rethrow(error);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (!disableWriteThrough) {<NEW_LINE>writeThroughCache(key, value);<NEW_LINE>}<NEW_LINE>} catch (Throwable error) {<NEW_LINE>// Writing to `CacheWriter` failed, so we should revert entry (remove added record).<NEW_LINE>final R removed = records.remove(key);<NEW_LINE>if (removed != null) {<NEW_LINE>compositeCacheRSMutationObserver.onRemove(<MASK><NEW_LINE>}<NEW_LINE>// Disposing key/value/record should be handled inside `onCreateRecordWithExpiryError`.<NEW_LINE>onCreateRecordError(key, value, expiryTime, now, disableWriteThrough, completionId, origin, record, error);<NEW_LINE>throw ExceptionUtil.rethrow(error);<NEW_LINE>}<NEW_LINE>if (isEventsEnabled()) {<NEW_LINE>publishEvent(createCacheCreatedEvent(toEventData(key), toEventData(value), expiryTime, origin, completionId));<NEW_LINE>}<NEW_LINE>return record;<NEW_LINE>}
key, removed.getValue());
1,472,836
static synchronized void addHighlight(Document document, int startOffset, int endOffset, AttributeSet attributeSet) {<NEW_LINE>List<WeakReference<SemanticHighlightsLayer>> layers = cache.get(document);<NEW_LINE>List<WeakReference<SemanticHighlightsLayer>> newLayers = new ArrayList<WeakReference<SemanticHighlightsLayer>>();<NEW_LINE>boolean remove = true;<NEW_LINE>if (layers != null) {<NEW_LINE>Iterator<WeakReference<SemanticHighlightsLayer>> it = layers.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>WeakReference<SemanticHighlightsLayer> weakReference = it.next();<NEW_LINE>SemanticHighlightsLayer layer = weakReference.get();<NEW_LINE>if (layer == null)<NEW_LINE>continue;<NEW_LINE>remove = false;<NEW_LINE>synchronized (layer) {<NEW_LINE>if (layer.offsetsBag1 == null)<NEW_LINE>layer.offsetsBag1 = new OffsetsBag(document);<NEW_LINE>layer.offsetsBag1.<MASK><NEW_LINE>}<NEW_LINE>newLayers.add(weakReference);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (remove) {<NEW_LINE>cache.remove(document);<NEW_LINE>ColorsASTEvaluator.unregister(document);<NEW_LINE>DeclarationASTEvaluator.unregister(document);<NEW_LINE>ContextASTEvaluator.unregister(document);<NEW_LINE>UsagesASTEvaluator.unregister(document);<NEW_LINE>} else<NEW_LINE>cache.put(document, newLayers);<NEW_LINE>}
addHighlight(startOffset, endOffset, attributeSet);
38,084
public static void computeTowerHanoiWrapper(TimedExecutor executor, int numRings) throws Exception {<NEW_LINE>List<Deque<Integer>> pegs = new ArrayList<>();<NEW_LINE>for (int i = 0; i < NUM_PEGS; i++) {<NEW_LINE>pegs.add(new LinkedList<>());<NEW_LINE>}<NEW_LINE>for (int i = numRings; i >= 1; --i) {<NEW_LINE>pegs.get(0).addFirst(i);<NEW_LINE>}<NEW_LINE>List<List<Integer>> result = executor.run(() -> computeTowerHanoi(numRings));<NEW_LINE>for (List<Integer> operation : result) {<NEW_LINE>int <MASK><NEW_LINE>int toPeg = operation.get(1);<NEW_LINE>if (!pegs.get(toPeg).isEmpty() && pegs.get(fromPeg).getFirst() >= pegs.get(toPeg).getFirst()) {<NEW_LINE>throw new TestFailure("Illegal move from " + String.valueOf(pegs.get(fromPeg).getFirst()) + " to " + String.valueOf(pegs.get(toPeg).getFirst()));<NEW_LINE>}<NEW_LINE>pegs.get(toPeg).addFirst(pegs.get(fromPeg).removeFirst());<NEW_LINE>}<NEW_LINE>List<Deque<Integer>> expectedPegs1 = new ArrayList<>();<NEW_LINE>for (int i = 0; i < NUM_PEGS; i++) {<NEW_LINE>expectedPegs1.add(new LinkedList<Integer>());<NEW_LINE>}<NEW_LINE>for (int i = numRings; i >= 1; --i) {<NEW_LINE>expectedPegs1.get(1).addFirst(i);<NEW_LINE>}<NEW_LINE>List<Deque<Integer>> expectedPegs2 = new ArrayList<>();<NEW_LINE>for (int i = 0; i < NUM_PEGS; i++) {<NEW_LINE>expectedPegs2.add(new LinkedList<Integer>());<NEW_LINE>}<NEW_LINE>for (int i = numRings; i >= 1; --i) {<NEW_LINE>expectedPegs2.get(2).addFirst(i);<NEW_LINE>}<NEW_LINE>if (!pegs.equals(expectedPegs1) && !pegs.equals(expectedPegs2)) {<NEW_LINE>throw new TestFailure("Pegs doesn't place in the right configuration");<NEW_LINE>}<NEW_LINE>}
fromPeg = operation.get(0);
1,664,849
public void begin() throws ResourceException {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "begin", new Object<MASK><NEW_LINE>ResourceException re;<NEW_LINE>synchronized (ivMC) {<NEW_LINE>re = ivStateManager.isValid(StateManager.LT_BEGIN);<NEW_LINE>if (re == null) {<NEW_LINE>try {<NEW_LINE>prevAutoCommit = ivMC.getAutoCommit();<NEW_LINE>ivMC.setAutoCommit(false);<NEW_LINE>} catch (SQLException sqle) {<NEW_LINE>throw new ResourceException(sqle.getMessage());<NEW_LINE>}<NEW_LINE>ivStateManager.transtate = StateManager.LOCAL_TRANSACTION_ACTIVE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (re != null) {<NEW_LINE>if (tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "Cannot start local transaction: " + re.getMessage());<NEW_LINE>if (// 138037<NEW_LINE>tc.isEntryEnabled())<NEW_LINE>// 138037<NEW_LINE>Tr.exit(tc, "begin", "Exception");<NEW_LINE>throw re;<NEW_LINE>}<NEW_LINE>if (tc.isEventEnabled())<NEW_LINE>Tr.event(tc, "SpiLocalTransaction started. ManagedConnection state is " + ivMC.getTransactionStateAsString());<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "begin");<NEW_LINE>}
[] { this, ivMC });
1,833,883
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Permanent permanent = game.getPermanent(source.getSourceId());<NEW_LINE>if (controller != null && permanent != null) {<NEW_LINE>ChoiceImpl chooseAbility = new ChoiceImpl();<NEW_LINE>chooseAbility.setMessage("Choose an ability to remove (default is flying)");<NEW_LINE>Set<String> choice = new LinkedHashSet<>();<NEW_LINE>choice.add("Flying");<NEW_LINE>choice.add("First strike");<NEW_LINE>choice.add("Trample");<NEW_LINE>chooseAbility.setChoices(choice);<NEW_LINE>// since the player can't pick "no ability", let's default to the first option<NEW_LINE><MASK><NEW_LINE>if (controller.choose(Outcome.UnboostCreature, chooseAbility, game)) {<NEW_LINE>String chosenAbility = chooseAbility.getChoice();<NEW_LINE>if (chosenAbility.equals("First strike")) {<NEW_LINE>ability = FirstStrikeAbility.getInstance();<NEW_LINE>} else if (chosenAbility.equals("Trample")) {<NEW_LINE>ability = TrampleAbility.getInstance();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>game.informPlayers(controller.getLogName() + " has chosen " + ability.getRule());<NEW_LINE>ContinuousEffect effect = new LoseAbilityTargetEffect(ability, Duration.EndOfTurn);<NEW_LINE>game.addEffect(effect, source);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
Ability ability = FlyingAbility.getInstance();
250,203
public void changeStateForChildPlanItemInstance(PlanItemInstanceEntity planItemInstanceEntity) {<NEW_LINE>// terminate all child plan items not yet in an end state of the case itself (same way as with a stage for instance)<NEW_LINE>// if they would be completed, the history will contain completed plan item instances although they never "truly" completed<NEW_LINE>// specially important for cases supporting reactivation<NEW_LINE>// if the plan item implements the specific behavior interface for ending, invoke it, otherwise use the default one which is terminate, regardless,<NEW_LINE>// if the case got completed or terminated<NEW_LINE>Object behavior = planItemInstanceEntity.getPlanItem().getBehavior();<NEW_LINE>if (behavior instanceof OnParentEndDependantActivityBehavior) {<NEW_LINE>// if the specific behavior is implemented, invoke it<NEW_LINE>((OnParentEndDependantActivityBehavior) behavior).onParentEnd(commandContext, <MASK><NEW_LINE>} else {<NEW_LINE>// use default behavior, if the interface is not implemented<NEW_LINE>CommandContextUtil.getAgenda(commandContext).planTerminatePlanItemInstanceOperation(planItemInstanceEntity, null, null);<NEW_LINE>}<NEW_LINE>}
planItemInstanceEntity, PlanItemTransition.COMPLETE, null);
208,680
/*<NEW_LINE>* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<NEW_LINE>*<NEW_LINE>* Interface.<NEW_LINE>*<NEW_LINE>* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<NEW_LINE>*/<NEW_LINE>public void execute(JobExecutionContext context) throws JobExecutionException {<NEW_LINE>JobDataMap data = context.getMergedJobDataMap();<NEW_LINE>String command = data.getString(PROP_COMMAND);<NEW_LINE>String parameters = data.getString(PROP_PARAMETERS);<NEW_LINE>if (parameters == null) {<NEW_LINE>parameters = "";<NEW_LINE>}<NEW_LINE>boolean wait = true;<NEW_LINE>if (data.containsKey(PROP_WAIT_FOR_PROCESS)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>boolean consumeStreams = false;<NEW_LINE>if (data.containsKey(PROP_CONSUME_STREAMS)) {<NEW_LINE>consumeStreams = data.getBooleanValue(PROP_CONSUME_STREAMS);<NEW_LINE>}<NEW_LINE>Integer exitCode = this.runNativeCommand(command, parameters, wait, consumeStreams);<NEW_LINE>context.setResult(exitCode);<NEW_LINE>}
wait = data.getBooleanValue(PROP_WAIT_FOR_PROCESS);
94,718
public List<I_C_Invoice_Clearing_Alloc> retrieveOpenClearingAllocs(final I_C_Flatrate_DataEntry dataEntry) {<NEW_LINE><MASK><NEW_LINE>final String trxName = getTrxName(dataEntry);<NEW_LINE>final I_C_Period period = dataEntry.getC_Period();<NEW_LINE>final Timestamp startDate = period.getStartDate();<NEW_LINE>final Timestamp endDate = period.getEndDate();<NEW_LINE>final String wc = " COALESCE (" + I_C_Invoice_Clearing_Alloc.COLUMNNAME_C_Flatrate_DataEntry_ID + ",0)=0 AND " + I_C_Invoice_Clearing_Alloc.COLUMNNAME_C_Flatrate_Term_ID + "=? AND " + "EXISTS (" + " select 1 from " + I_C_Invoice_Candidate.Table_Name + " ic " + " where " + " ic." + I_C_Invoice_Candidate.COLUMNNAME_C_Invoice_Candidate_ID + "=" + I_C_Invoice_Clearing_Alloc.Table_Name + "." + I_C_Invoice_Clearing_Alloc.COLUMNNAME_C_Invoice_Cand_ToClear_ID + " and ic." + I_C_Invoice_Candidate.COLUMNNAME_DateOrdered + ">=?" + " and ic." + I_C_Invoice_Candidate.COLUMNNAME_DateOrdered + "<=?" + ") ";<NEW_LINE>return new Query(ctx, I_C_Invoice_Clearing_Alloc.Table_Name, wc, trxName).setParameters(dataEntry.getC_Flatrate_Term_ID(), startDate, endDate).setClient_ID().setOnlyActiveRecords(true).setOrderBy(I_C_Invoice_Clearing_Alloc.COLUMNNAME_C_Invoice_Clearing_Alloc_ID).list(I_C_Invoice_Clearing_Alloc.class);<NEW_LINE>}
final Properties ctx = getCtx(dataEntry);
1,730,301
static ImmutableMap<String, BuildOptions> applyAndValidate(BuildOptions buildOptions, StarlarkDefinedConfigTransition starlarkTransition, StructImpl attrObject, EventHandler handler) throws InterruptedException {<NEW_LINE>try {<NEW_LINE>checkForDenylistedOptions(starlarkTransition);<NEW_LINE>// TODO(waltl): Consider building this once and using it across different split transitions,<NEW_LINE>// or reusing BuildOptionDetails.<NEW_LINE>ImmutableMap<String, OptionInfo> optionInfoMap = OptionInfo.buildMapFrom(buildOptions);<NEW_LINE>Dict<String, Object> settings = buildSettings(buildOptions, optionInfoMap, starlarkTransition);<NEW_LINE>ImmutableMap.Builder<String, BuildOptions> splitBuildOptions = ImmutableMap.builder();<NEW_LINE>ImmutableMap<String, Map<String, Object>> transitions = starlarkTransition.<MASK><NEW_LINE>if (transitions == null) {<NEW_LINE>// errors reported to handler<NEW_LINE>return null;<NEW_LINE>} else if (transitions.isEmpty()) {<NEW_LINE>// The transition produced a no-op.<NEW_LINE>return ImmutableMap.of(PATCH_TRANSITION_KEY, buildOptions);<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, Map<String, Object>> entry : transitions.entrySet()) {<NEW_LINE>Map<String, Object> newValues = handleImplicitPlatformChange(entry.getValue());<NEW_LINE>BuildOptions transitionedOptions = applyTransition(buildOptions, newValues, optionInfoMap, starlarkTransition);<NEW_LINE>splitBuildOptions.put(entry.getKey(), transitionedOptions);<NEW_LINE>}<NEW_LINE>return splitBuildOptions.build();<NEW_LINE>} catch (ValidationException ex) {<NEW_LINE>handler.handle(Event.error(starlarkTransition.getLocation(), ex.getMessage()));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
evaluate(settings, attrObject, handler);
102,167
private static PathEntry createPathEntry(String mainPath, String altPathOrFolder) {<NEW_LINE>if (mainPath == null || mainPath.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (mainPath.toLowerCase().endsWith(".jar")) {<NEW_LINE>return createPathEntryJar(mainPath, altPathOrFolder);<NEW_LINE>}<NEW_LINE>if (mainPath.toLowerCase().startsWith("http://") || mainPath.toLowerCase().startsWith("https://")) {<NEW_LINE>return createPathEntryHttp(mainPath, altPathOrFolder);<NEW_LINE>}<NEW_LINE>if (mainPath.indexOf(":") > 4) {<NEW_LINE>String[] parts = mainPath.split(":");<NEW_LINE>mainPath = "http://" + parts[0];<NEW_LINE>if (parts.length > 1) {<NEW_LINE>return createPathEntryHttp(mainPath + "/" + parts[1], altPathOrFolder);<NEW_LINE>} else {<NEW_LINE>return createPathEntryHttp(mainPath, altPathOrFolder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>URL pathURL = <MASK><NEW_LINE>if (pathURL == null) {<NEW_LINE>return createPathEntryClass(mainPath, altPathOrFolder);<NEW_LINE>}<NEW_LINE>return new PathEntry(mainPath, altPathOrFolder, pathURL);<NEW_LINE>}
Commons.makeURL(mainPath, altPathOrFolder);
1,146,801
private PPOrderLineRow createRowForBOMLine(final I_PP_Order_BOMLine bomLine, final boolean readOnly, final List<I_PP_Order_Qty> ppOrderQtys) {<NEW_LINE>final PPOrderLineType lineType;<NEW_LINE>final String packingInfo;<NEW_LINE>final Quantity qtyPlan;<NEW_LINE>final Quantity qtyProcessedIssuedOrReceived;<NEW_LINE>final BOMComponentType componentType = BOMComponentType.ofCode(bomLine.getComponentType());<NEW_LINE>final OrderBOMLineQuantities bomLineQtys = ppOrderBOMBL.getQuantities(bomLine);<NEW_LINE>if (componentType.isByOrCoProduct()) {<NEW_LINE>lineType = PPOrderLineType.BOMLine_ByCoProduct;<NEW_LINE>packingInfo = computePackingInfo(bomLine);<NEW_LINE>qtyPlan = bomLineQtys.getQtyRequired_NegateBecauseIsCOProduct();<NEW_LINE>qtyProcessedIssuedOrReceived = bomLineQtys.getQtyIssuedOrReceived_NegateBecauseIsCOProduct();<NEW_LINE>} else {<NEW_LINE>final ProductId productId = ProductId.ofRepoId(bomLine.getM_Product_ID());<NEW_LINE>lineType = productBL.isStocked(productId) ? PPOrderLineType.BOMLine_Component : PPOrderLineType.BOMLine_Component_Service;<NEW_LINE>// we don't know the packing info for what will be issued.<NEW_LINE>packingInfo = null;<NEW_LINE>qtyPlan = bomLineQtys.getQtyRequired();<NEW_LINE>qtyProcessedIssuedOrReceived = bomLineQtys.getQtyIssuedOrReceived();<NEW_LINE>}<NEW_LINE>final ImmutableList<PPOrderLineRow> includedRows = createIncludedRowsForPPOrderQtys(ppOrderQtys, readOnly);<NEW_LINE>return PPOrderLineRow.builderForPPOrderBomLine().ppOrderBomLine(bomLine).type(lineType).packingInfoOrNull(packingInfo).qtyPlan(qtyPlan).qtyProcessedIssuedOrReceived(qtyProcessedIssuedOrReceived).attributesProvider(asiAttributesProvider).processed(readOnly).<MASK><NEW_LINE>}
includedRows(includedRows).build();
639,756
public int compare(Contentlet w1, Contentlet w2) {<NEW_LINE>try {<NEW_LINE>Object value1 = PropertyUtils.getSimpleProperty(w1, orderField);<NEW_LINE>Object value2 = PropertyUtils.getSimpleProperty(w2, orderField);<NEW_LINE>int ret = 0;<NEW_LINE>if (value1 == null || value2 == null) {<NEW_LINE>return ret;<NEW_LINE>} else if (value1 instanceof Integer) {<NEW_LINE>ret = ((Integer) value1).compareTo((Integer) value2);<NEW_LINE>} else if (value1 instanceof Long) {<NEW_LINE>ret = ((Long) value1).compareTo((Long) value2);<NEW_LINE>} else if (value1 instanceof Date) {<NEW_LINE>ret = ((Date) value1).compareTo((Date) value2);<NEW_LINE>} else if (value1 instanceof String) {<NEW_LINE>ret = ((String) value1)<MASK><NEW_LINE>} else if (value1 instanceof Float) {<NEW_LINE>ret = ((Float) value1).compareTo((Float) value2);<NEW_LINE>} else if (value1 instanceof Boolean) {<NEW_LINE>ret = ((Boolean) value1).compareTo((Boolean) value2);<NEW_LINE>}<NEW_LINE>if (orderType.equals("asc")) {<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>return ret * -1;<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
.compareTo((String) value2);
505,772
private void remember(IType type, ReferenceBinding typeBinding) {<NEW_LINE>if (((CompilationUnit) type.getCompilationUnit()).isOpen()) {<NEW_LINE>try {<NEW_LINE>IGenericType genericType = (IGenericType) ((JavaElement) type).getElementInfo();<NEW_LINE>remember(genericType, typeBinding);<NEW_LINE>} catch (JavaModelException e) {<NEW_LINE>// cannot happen since element is open<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (typeBinding == null)<NEW_LINE>return;<NEW_LINE>boolean isAnonymous = false;<NEW_LINE>try {<NEW_LINE>isAnonymous = type.isAnonymous();<NEW_LINE>} catch (JavaModelException jme) {<NEW_LINE>// Ignore<NEW_LINE>}<NEW_LINE>if (typeBinding instanceof SourceTypeBinding) {<NEW_LINE>TypeDeclaration typeDeclaration = ((SourceTypeBinding) typeBinding).scope.referenceType();<NEW_LINE>// simple super class name<NEW_LINE>char[] superclassName = null;<NEW_LINE>TypeReference superclass;<NEW_LINE>if ((typeDeclaration.bits & ASTNode.IsAnonymousType) != 0) {<NEW_LINE>superclass = typeDeclaration.allocation.type;<NEW_LINE>} else {<NEW_LINE>superclass = typeDeclaration.superclass;<NEW_LINE>}<NEW_LINE>if (superclass != null) {<NEW_LINE>char[][] typeName = superclass.getTypeName();<NEW_LINE>superclassName = typeName == null ? null : typeName[typeName.length - 1];<NEW_LINE>}<NEW_LINE>// simple super interface names<NEW_LINE>char[][] superInterfaceNames = null;<NEW_LINE>TypeReference[] superInterfaces = typeDeclaration.superInterfaces;<NEW_LINE>if (superInterfaces != null) {<NEW_LINE>int length = superInterfaces.length;<NEW_LINE>superInterfaceNames <MASK><NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>TypeReference superInterface = superInterfaces[i];<NEW_LINE>char[][] typeName = superInterface.getTypeName();<NEW_LINE>superInterfaceNames[i] = typeName[typeName.length - 1];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>HierarchyType hierarchyType = new HierarchyType(type, typeDeclaration.name, typeDeclaration.binding.modifiers, superclassName, superInterfaceNames, isAnonymous);<NEW_LINE>remember(hierarchyType, typeDeclaration.binding);<NEW_LINE>} else {<NEW_LINE>HierarchyType hierarchyType = new HierarchyType(type, typeBinding.sourceName(), typeBinding.modifiers, typeBinding.superclass().sourceName(), new char[][] { typeBinding.superInterfaces()[0].sourceName() }, isAnonymous);<NEW_LINE>remember(hierarchyType, typeBinding);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new char[length][];
872,690
private void attachToSession(@Nonnull XDebugSessionImpl session) {<NEW_LINE>for (XDebugView view : myViews.values()) {<NEW_LINE>attachViewToSession(session, view);<NEW_LINE>}<NEW_LINE>XDebugTabLayouter layouter = session.getDebugProcess().createTabLayouter();<NEW_LINE>Content consoleContent = layouter.registerConsoleContent(myUi, myConsole);<NEW_LINE>attachNotificationTo(consoleContent);<NEW_LINE>layouter.registerAdditionalContent(myUi);<NEW_LINE>RunContentBuilder.addAdditionalConsoleEditorActions(myConsole, consoleContent);<NEW_LINE>if (ApplicationManager.getApplication().isUnitTestMode()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DefaultActionGroup leftToolbar = new DefaultActionGroup();<NEW_LINE>if (myEnvironment != null) {<NEW_LINE>leftToolbar.add(ActionManager.getInstance().getAction(IdeActions.ACTION_RERUN));<NEW_LINE>List<AnAction> additionalRestartActions = session.getRestartActions();<NEW_LINE>if (!additionalRestartActions.isEmpty()) {<NEW_LINE>leftToolbar.addAll(additionalRestartActions);<NEW_LINE>leftToolbar.addSeparator();<NEW_LINE>}<NEW_LINE>leftToolbar.addAll(session.getExtraActions());<NEW_LINE>}<NEW_LINE>leftToolbar.addAll(getCustomizedActionGroup(XDebuggerActions.TOOL_WINDOW_LEFT_TOOLBAR_GROUP));<NEW_LINE>for (AnAction action : session.getExtraStopActions()) {<NEW_LINE>leftToolbar.add(action, new Constraints(Anchor.AFTER, IdeActions.ACTION_STOP_PROGRAM));<NEW_LINE>}<NEW_LINE>// group.addSeparator();<NEW_LINE>// addAction(group, DebuggerActions.EXPORT_THREADS);<NEW_LINE>leftToolbar.addSeparator();<NEW_LINE>leftToolbar.add(myUi.getOptions().getLayoutActions());<NEW_LINE>final AnAction[] commonSettings = myUi.getOptions().getSettingsActionsList();<NEW_LINE>DefaultActionGroup settings = new DefaultActionGroup(ActionsBundle<MASK><NEW_LINE>settings.getTemplatePresentation().setIcon(myUi.getOptions().getSettingsActions().getTemplatePresentation().getIcon());<NEW_LINE>settings.addAll(commonSettings);<NEW_LINE>leftToolbar.add(settings);<NEW_LINE>leftToolbar.addSeparator();<NEW_LINE>leftToolbar.add(PinToolwindowTabAction.getPinAction());<NEW_LINE>DefaultActionGroup topToolbar = new DefaultActionGroup();<NEW_LINE>topToolbar.addAll(getCustomizedActionGroup(XDebuggerActions.TOOL_WINDOW_TOP_TOOLBAR_GROUP));<NEW_LINE>session.getDebugProcess().registerAdditionalActions(leftToolbar, topToolbar, settings);<NEW_LINE>myUi.getOptions().setLeftToolbar(leftToolbar, ActionPlaces.DEBUGGER_TOOLBAR);<NEW_LINE>myUi.getOptions().setTopToolbar(topToolbar, ActionPlaces.DEBUGGER_TOOLBAR);<NEW_LINE>if (myEnvironment != null) {<NEW_LINE>initLogConsoles(myEnvironment.getRunProfile(), myRunContentDescriptor, myConsole);<NEW_LINE>}<NEW_LINE>}
.message("group.XDebugger.settings.text"), true);
156,193
public static ListDelegatedServicesForAccountResponse unmarshall(ListDelegatedServicesForAccountResponse listDelegatedServicesForAccountResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDelegatedServicesForAccountResponse.setRequestId(_ctx.stringValue("ListDelegatedServicesForAccountResponse.RequestId"));<NEW_LINE>List<DelegatedService> delegatedServices = new ArrayList<DelegatedService>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDelegatedServicesForAccountResponse.DelegatedServices.Length"); i++) {<NEW_LINE>DelegatedService delegatedService = new DelegatedService();<NEW_LINE>delegatedService.setDelegationEnabledTime(_ctx.stringValue("ListDelegatedServicesForAccountResponse.DelegatedServices[" + i + "].DelegationEnabledTime"));<NEW_LINE>delegatedService.setServicePrincipal(_ctx.stringValue<MASK><NEW_LINE>delegatedServices.add(delegatedService);<NEW_LINE>}<NEW_LINE>listDelegatedServicesForAccountResponse.setDelegatedServices(delegatedServices);<NEW_LINE>return listDelegatedServicesForAccountResponse;<NEW_LINE>}
("ListDelegatedServicesForAccountResponse.DelegatedServices[" + i + "].ServicePrincipal"));
736,088
public void read(org.apache.thrift.protocol.TProtocol iprot, getMetrics_result struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TField schemeField;<NEW_LINE>iprot.readStructBegin();<NEW_LINE>while (true) {<NEW_LINE>schemeField = iprot.readFieldBegin();<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(schemeField.id) {<NEW_LINE>case // SUCCESS<NEW_LINE>0:<NEW_LINE>if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TList _list280 = iprot.readListBegin();<NEW_LINE>struct.success = new ArrayList<MetricInfo>(_list280.size);<NEW_LINE>MetricInfo _elem281;<NEW_LINE>for (int _i282 = 0; _i282 < _list280.size; ++_i282) {<NEW_LINE>_elem281 = new MetricInfo();<NEW_LINE>_elem281.read(iprot);<NEW_LINE>struct.success.add(_elem281);<NEW_LINE>}<NEW_LINE>iprot.readListEnd();<NEW_LINE>}<NEW_LINE>struct.set_success_isSet(true);<NEW_LINE>} else {<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);<NEW_LINE>}<NEW_LINE>iprot.readFieldEnd();<NEW_LINE>}<NEW_LINE>iprot.readStructEnd();<NEW_LINE>struct.validate();<NEW_LINE>}
skip(iprot, schemeField.type);
728,988
public RequestRetryOptions convert(@NonNull StorageRetry storageRetry) {<NEW_LINE>RetryOptionsProvider.RetryMode retryMode = storageRetry.getMode();<NEW_LINE>if (EXPONENTIAL == retryMode) {<NEW_LINE>RetryOptionsProvider.RetryOptions.<MASK><NEW_LINE>if (exponential != null && exponential.getMaxRetries() != null) {<NEW_LINE>return new RequestRetryOptions(RetryPolicyType.EXPONENTIAL, exponential.getMaxRetries(), storageRetry.getTryTimeout(), exponential.getBaseDelay(), exponential.getMaxDelay(), storageRetry.getSecondaryHost());<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("The max-retries is not set, skip the convert.");<NEW_LINE>}<NEW_LINE>} else if (FIXED == retryMode) {<NEW_LINE>RetryOptionsProvider.RetryOptions.FixedRetryOptions fixed = storageRetry.getFixed();<NEW_LINE>if (fixed != null && fixed.getMaxRetries() != null) {<NEW_LINE>return new RequestRetryOptions(RetryPolicyType.FIXED, fixed.getMaxRetries(), storageRetry.getTryTimeout(), fixed.getDelay(), fixed.getDelay(), storageRetry.getSecondaryHost());<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("The max-retries is not set, skip the convert.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
ExponentialRetryOptions exponential = storageRetry.getExponential();
545,473
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String epl = "@public create window MyWindowFour#keepall as select * from SupportBean;\n" + "insert into MyWindowFour select * from SupportBean;";<NEW_LINE>env.compileDeploy(epl, path);<NEW_LINE>env.sendEventBean(new SupportBean("E1", 10));<NEW_LINE>env.sendEventBean(new SupportBean("E2", 20));<NEW_LINE>env.sendEventBean(new SupportBean("E3", 30));<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>env.sendEventBean(new SupportBean("E1", 11));<NEW_LINE>env.sendEventBean(new SupportBean("E1", 12));<NEW_LINE>EPCompiled qc = env.compileFAF("select first(intPrimitive) as f, window(intPrimitive) as w, last(intPrimitive) as l from MyWindowFour as s", path);<NEW_LINE>EPFireAndForgetPreparedQuery q = env.runtime().getFireAndForgetService().prepareQuery(qc);<NEW_LINE>EPAssertionUtil.assertPropsPerRow(q.execute().getArray(), "f,w,l".split(","), new Object[][] { { 10, intArray(10, 20, 30, 31, 11, 12), 12 } });<NEW_LINE>env.sendEventBean(new SupportBean("E1", 13));<NEW_LINE>EPAssertionUtil.assertPropsPerRow(q.execute().getArray(), "f,w,l".split(","), new Object[][] { { 10, intArray(10, 20, 30, 31, 11, 12, 13), 13 } });<NEW_LINE>env.milestone(1);<NEW_LINE>qc = env.compileFAF("select theString as s, first(intPrimitive) as f, window(intPrimitive) as w, last(intPrimitive) as l from MyWindowFour as s group by theString order by theString asc", path);<NEW_LINE>q = env.runtime().getFireAndForgetService().prepareQuery(qc);<NEW_LINE>Object[][] expected = new Object[][] { { "E1", 10, intArray(10, 11, 12, 13), 13 }, { "E2", 20, intArray(20), 20 }, { "E3", 30, intArray(30, 31), 31 } };<NEW_LINE>EPAssertionUtil.assertPropsPerRow(q.execute().getArray(), "s,f,w,l".split(","), expected);<NEW_LINE>EPAssertionUtil.assertPropsPerRow(q.execute().getArray(), "s,f,w,l".split(","), expected);<NEW_LINE>env.undeployAll();<NEW_LINE>}
new SupportBean("E3", 31));
1,665,680
protected boolean checkParameter(TypeMirror argType, TypeMirror varTypeArg) {<NEW_LINE>if (argType == null || varTypeArg == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Types types = getImplementation().getHelper().getCompilationController().getTypes();<NEW_LINE>if (argType.getKind() != TypeKind.TYPEVAR && varTypeArg.getKind() != TypeKind.TYPEVAR && (argType instanceof ReferenceType) && (varTypeArg instanceof ReferenceType)) {<NEW_LINE>return checkIsAssignable(getImplementation().getHelper().getCompilationController().<MASK><NEW_LINE>}<NEW_LINE>if (varTypeArg.getKind() == TypeKind.WILDCARD) {<NEW_LINE>return handleWildCard(argType, (WildcardType) varTypeArg, types);<NEW_LINE>}<NEW_LINE>if (argType.getKind() == TypeKind.TYPEVAR && varTypeArg.getKind() == TypeKind.TYPEVAR) {<NEW_LINE>return handleBothTypeVars(argType, varTypeArg, types);<NEW_LINE>}<NEW_LINE>if (varTypeArg.getKind() != TypeKind.TYPEVAR && argType.getKind() == TypeKind.TYPEVAR) {<NEW_LINE>return handleBeanTypeVar(argType, varTypeArg, types);<NEW_LINE>}<NEW_LINE>if (argType.getKind() != TypeKind.TYPEVAR && varTypeArg.getKind() == TypeKind.TYPEVAR) {<NEW_LINE>return handleRequiredTypeVar(argType, varTypeArg, types);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getTypes(), argType, varTypeArg);
1,000,962
protected void parse() {<NEW_LINE>proxyIp = getString(PROXY_IP, "localhost");<NEW_LINE>determineProxyIpAnyLocalAddress();<NEW_LINE>proxyPort = getInt(PROXY_PORT, 8080);<NEW_LINE>reverseProxyIp = getString(REVERSE_PROXY_IP, "localhost");<NEW_LINE>if (reverseProxyIp.equalsIgnoreCase("localhost") || reverseProxyIp.equalsIgnoreCase("127.0.0.1")) {<NEW_LINE>try {<NEW_LINE>reverseProxyIp = InetAddress.getLocalHost().getHostAddress();<NEW_LINE>} catch (UnknownHostException e1) {<NEW_LINE>logger.error(e1.getMessage(), e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reverseProxyHttpPort = getInt(REVERSE_PROXY_HTTP_PORT, 80);<NEW_LINE>reverseProxyHttpsPort = getInt(REVERSE_PROXY_HTTPS_PORT, 443);<NEW_LINE>useReverseProxy = getInt(USE_REVERSE_PROXY, 0);<NEW_LINE>removeUnsupportedEncodings = getBoolean(REMOVE_UNSUPPORTED_ENCODINGS, true);<NEW_LINE>alwaysDecodeGzip = getBoolean(ALWAYS_DECODE_GZIP, true);<NEW_LINE>loadSecurityProtocolsEnabled();<NEW_LINE><MASK><NEW_LINE>}
behindNat = getBoolean(PROXY_BEHIND_NAT, false);
534,682
private void createAndSetSpecifiedPermission() {<NEW_LINE>Permission newPermission = this.createSpecifiedPermission();<NEW_LINE>if (newPermission != null) {<NEW_LINE>file.setPermission(FTPFile.USER_ACCESS, FTPFile.READ_PERMISSION, newPermission.getUser().implies(Permission.Action.read));<NEW_LINE>file.setPermission(FTPFile.USER_ACCESS, FTPFile.WRITE_PERMISSION, newPermission.getUser().implies(Permission.Action.write));<NEW_LINE>file.setPermission(FTPFile.USER_ACCESS, FTPFile.EXECUTE_PERMISSION, newPermission.getUser().implies(Permission.Action.execute));<NEW_LINE>file.setPermission(FTPFile.GROUP_ACCESS, FTPFile.READ_PERMISSION, newPermission.getUser().implies(Permission.Action.read));<NEW_LINE>file.setPermission(FTPFile.GROUP_ACCESS, FTPFile.WRITE_PERMISSION, newPermission.getUser().implies(Permission.Action.write));<NEW_LINE>file.setPermission(FTPFile.GROUP_ACCESS, FTPFile.EXECUTE_PERMISSION, newPermission.getUser().implies(Permission.Action.execute));<NEW_LINE>file.setPermission(FTPFile.WORLD_ACCESS, FTPFile.READ_PERMISSION, newPermission.getUser().implies<MASK><NEW_LINE>file.setPermission(FTPFile.WORLD_ACCESS, FTPFile.WRITE_PERMISSION, newPermission.getUser().implies(Permission.Action.write));<NEW_LINE>file.setPermission(FTPFile.WORLD_ACCESS, FTPFile.EXECUTE_PERMISSION, newPermission.getUser().implies(Permission.Action.execute));<NEW_LINE>}<NEW_LINE>}
(Permission.Action.read));
174,511
private static void updateRecord(@NonNull final I_PP_Order_Cost record, @NonNull final PPOrderCost from) {<NEW_LINE>record.setIsActive(true);<NEW_LINE>record.setPP_Order_Cost_TrxType(from.getTrxType().getCode());<NEW_LINE>final CostSegmentAndElement costSegmentAndElement = from.getCostSegmentAndElement();<NEW_LINE>record.setAD_Org_ID(costSegmentAndElement.getOrgId().getRepoId());<NEW_LINE>record.setC_AcctSchema_ID(costSegmentAndElement.<MASK><NEW_LINE>record.setM_CostType_ID(costSegmentAndElement.getCostTypeId().getRepoId());<NEW_LINE>record.setM_Product_ID(costSegmentAndElement.getProductId().getRepoId());<NEW_LINE>record.setM_AttributeSetInstance_ID(costSegmentAndElement.getAttributeSetInstanceId().getRepoId());<NEW_LINE>record.setM_CostElement_ID(costSegmentAndElement.getCostElementId().getRepoId());<NEW_LINE>final CostPrice price = from.getPrice();<NEW_LINE>record.setCurrentCostPrice(price.getOwnCostPrice().getValue());<NEW_LINE>record.setCurrentCostPriceLL(price.getComponentsCostPrice().getValue());<NEW_LINE>record.setCumulatedAmt(from.getAccumulatedAmount().getValue());<NEW_LINE>record.setC_UOM_ID(from.getAccumulatedQty().getUomId().getRepoId());<NEW_LINE>record.setCumulatedQty(from.getAccumulatedQty().toBigDecimal());<NEW_LINE>record.setPostCalculationAmt(from.getPostCalculationAmount().getValue());<NEW_LINE>if (from.getTrxType().isCoProduct() && from.getCoProductCostDistributionPercent() != null) {<NEW_LINE>record.setCostDistributionPercent(from.getCoProductCostDistributionPercent().toBigDecimal());<NEW_LINE>} else {<NEW_LINE>record.setCostDistributionPercent(null);<NEW_LINE>}<NEW_LINE>}
getAcctSchemaId().getRepoId());
959,793
public static void performMigration(final Context ctx, final Geocache cache, final Waypoint w, final Runnable actionAfterMigration) {<NEW_LINE>if (!needsMigration(w)) {<NEW_LINE>actionAfterMigration.run();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final CalculatedCoordinateMigrator mig <MASK><NEW_LINE>SimpleDialog.ofContext(ctx).setTitle(TextParam.id(R.string.calccoord_migrate_title)).setMessage(TextParam.text(mig.getMigrationInformationMarkup()).setMarkdown(true)).setPositiveButton(TextParam.id(R.string.calccoord_migrate_migrate)).setNegativeButton(TextParam.id(R.string.calccoord_migrate_cancel)).setNeutralButton(TextParam.id(R.string.calccoord_migrate_dismiss)).show((v, i) -> {<NEW_LINE>w.setUserNote(w.getUserNote() + "\n" + LocalizationUtils.getString(R.string.calccoord_migrate_migrate_usernote_praefix) + ":" + mig.getMigrationData().getMigrationNotes());<NEW_LINE>for (Map.Entry<String, String> newVar : mig.getNewCacheVariables().entrySet()) {<NEW_LINE>cache.getVariables().addVariable(newVar.getKey(), newVar.getValue());<NEW_LINE>}<NEW_LINE>cache.getVariables().saveState();<NEW_LINE>final CalculatedCoordinate cc = new CalculatedCoordinate();<NEW_LINE>cc.setType(mig.getMigrationData().getType());<NEW_LINE>cc.setLatitudePattern(mig.getMigrationData().getLatPattern());<NEW_LINE>cc.setLongitudePattern(mig.getMigrationData().getLonPattern());<NEW_LINE>w.setCalcStateConfig(cc.toConfig());<NEW_LINE>cache.addOrChangeWaypoint(w, true);<NEW_LINE>actionAfterMigration.run();<NEW_LINE>}, (v, i) -> {<NEW_LINE>actionAfterMigration.run();<NEW_LINE>}, (v, i) -> {<NEW_LINE>// dismiss calculated coordinate data<NEW_LINE>w.setUserNote(w.getUserNote() + "\n" + LocalizationUtils.getString(R.string.calccoord_migrate_dismiss_usernote_praefix) + ":" + mig.getMigrationData().getMigrationNotes());<NEW_LINE>w.setCalcStateConfig(null);<NEW_LINE>cache.addOrChangeWaypoint(w, true);<NEW_LINE>actionAfterMigration.run();<NEW_LINE>});<NEW_LINE>}
= new CalculatedCoordinateMigrator(cache, w);
975,738
public DeckCardLists importDeck(String fileName, StringBuilder errorMessages, boolean saveAutoFixedFile) {<NEW_LINE>File f = new File(fileName);<NEW_LINE>DeckCardLists deckList = new DeckCardLists();<NEW_LINE>if (!f.exists()) {<NEW_LINE>logger.<MASK><NEW_LINE>return deckList;<NEW_LINE>}<NEW_LINE>sbMessage.setLength(0);<NEW_LINE>try {<NEW_LINE>try (FileReader reader = new FileReader(f)) {<NEW_LINE>try {<NEW_LINE>JsonObject json = JsonParser.parseReader(reader).getAsJsonObject();<NEW_LINE>readJson(json, deckList);<NEW_LINE>if (sbMessage.length() > 0) {<NEW_LINE>if (errorMessages != null) {<NEW_LINE>// normal output for user<NEW_LINE>errorMessages.append(sbMessage);<NEW_LINE>} else {<NEW_LINE>// fatal error<NEW_LINE>logger.fatal(sbMessage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (JsonParseException ex) {<NEW_LINE>logger.fatal("Can't parse json-deck: " + fileName, ex);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.fatal(null, ex);<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.fatal(null, ex);<NEW_LINE>}<NEW_LINE>return deckList;<NEW_LINE>}
warn("Deckfile " + fileName + " not found.");
755,937
final DescribeDatasetResult executeDescribeDataset(DescribeDatasetRequest describeDatasetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDatasetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDatasetRequest> request = null;<NEW_LINE>Response<DescribeDatasetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDatasetRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "LookoutVision");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDataset");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDatasetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDatasetResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(describeDatasetRequest));
1,612,267
protected JavaType _narrow(Class<?> subclass) {<NEW_LINE>if (_class == subclass) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>// Should we check that there is a sub-class relationship?<NEW_LINE>// 15-Jan-2016, tatu: Almost yes, but there are some complications with<NEW_LINE>// placeholder values (`Void`, `NoClass`), so cannot quite do yet.<NEW_LINE>// TODO: fix in 2.9<NEW_LINE>if (!_class.isAssignableFrom(subclass)) {<NEW_LINE>return new SimpleType(subclass, _bindings, this, _superInterfaces, _valueHandler, _typeHandler, _asStatic);<NEW_LINE>}<NEW_LINE>// Otherwise, stitch together the hierarchy. First, super-class<NEW_LINE>Class<?> next = subclass.getSuperclass();<NEW_LINE>if (next == _class) {<NEW_LINE>// straight up parent class? Great.<NEW_LINE>return new SimpleType(subclass, _bindings, this, _superInterfaces, _valueHandler, _typeHandler, _asStatic);<NEW_LINE>}<NEW_LINE>if ((next != null) && _class.isAssignableFrom(next)) {<NEW_LINE>JavaType superb = _narrow(next);<NEW_LINE>return new SimpleType(subclass, _bindings, superb, null, _valueHandler, _typeHandler, _asStatic);<NEW_LINE>}<NEW_LINE>// if not found, try a super-interface<NEW_LINE>Class<?>[<MASK><NEW_LINE>for (Class<?> iface : nextI) {<NEW_LINE>if (iface == _class) {<NEW_LINE>// directly implemented<NEW_LINE>return new SimpleType(subclass, _bindings, null, new JavaType[] { this }, _valueHandler, _typeHandler, _asStatic);<NEW_LINE>}<NEW_LINE>if (_class.isAssignableFrom(iface)) {<NEW_LINE>// indirect, so recurse<NEW_LINE>JavaType superb = _narrow(iface);<NEW_LINE>return new SimpleType(subclass, _bindings, null, new JavaType[] { superb }, _valueHandler, _typeHandler, _asStatic);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// should not get here but...<NEW_LINE>throw new IllegalArgumentException("Internal error: Cannot resolve sub-type for Class " + subclass.getName() + " to " + _class.getName());<NEW_LINE>}
] nextI = subclass.getInterfaces();
640,216
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see com.fasterxml.jackson.databind.ser.std.StdSerializer#serialize(java.lang.Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>@SuppressWarnings("null")<NEW_LINE>public void serialize(PagedModel<?> value, JsonGenerator jgen, SerializerProvider provider) throws IOException {<NEW_LINE>//<NEW_LINE>CollectionJson<?> //<NEW_LINE>collectionJson = //<NEW_LINE>new CollectionJson<>().//<NEW_LINE>withVersion(//<NEW_LINE>"1.0").//<NEW_LINE>withHref(//<NEW_LINE>value.getRequiredLink(IanaLinkRelations.SELF).getHref()).//<NEW_LINE>withLinks(//<NEW_LINE>value.getLinks().without(IanaLinkRelations.SELF)).//<NEW_LINE>withItems(//<NEW_LINE>resourcesToCollectionJsonItems(value)).//<NEW_LINE>withQueries(findQueries(value)).withTemplate(findTemplate(value));<NEW_LINE>CollectionJsonDocument<?> doc <MASK><NEW_LINE>provider.findValueSerializer(CollectionJsonDocument.class, property).serialize(doc, jgen, provider);<NEW_LINE>}
= new CollectionJsonDocument<>(collectionJson);
668,053
public Mutable add(HttpFields fields) {<NEW_LINE>if (_fields == null)<NEW_LINE>_fields = new HttpField[fields.size() + 4];<NEW_LINE>else if (_size + fields.size() >= _fields.length)<NEW_LINE>_fields = Arrays.copyOf(_fields, _size + fields.size() + 4);<NEW_LINE>if (fields.size() == 0)<NEW_LINE>return this;<NEW_LINE>if (fields instanceof Immutable) {<NEW_LINE>Immutable b = (Immutable) fields;<NEW_LINE>System.arraycopy(b._fields, 0, _fields, _size, b._fields.length);<NEW_LINE>_size += b._fields.length;<NEW_LINE>} else if (fields instanceof Mutable) {<NEW_LINE>Mutable b = (Mutable) fields;<NEW_LINE>System.arraycopy(b._fields, 0, _fields, _size, b._size);<NEW_LINE>_size += b._size;<NEW_LINE>} else {<NEW_LINE>for (HttpField f : fields<MASK><NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
) _fields[_size++] = f;
164,005
private void scriptStep() throws IOException {<NEW_LINE>FileReference scriptReference = fileReference("script", step);<NEW_LINE>RemoteFile scriptFile = prepareRemoteFile(scriptReference, false);<NEW_LINE>List<String> files = step.getListOrEmpty("files", String.class);<NEW_LINE>List<RemoteFile> filesFiles = files.stream().map(r -> fileReference("file", r)).map(r -> prepareRemoteFile(r, false, localWorkingDirectory())<MASK><NEW_LINE>CommandRunnerConfiguration configuration = CommandRunnerConfiguration.builder().workingDirectory(localWorkingDirectory()).env(pc.parameters(step.getNestedOrGetEmpty("env"), (key, value) -> value)).addDownload(DownloadConfig.of(scriptFile, 0777)).addAllDownload(filesFiles).addAllCommand(scriptFile.localPath()).addAllCommand(pc.parameters(step, "args")).build();<NEW_LINE>addStep("Script", configuration);<NEW_LINE>}
).collect(toList());
1,628,612
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()<NEW_LINE>*/<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>@Override<NEW_LINE>public void initializeDefaultPreferences() {<NEW_LINE>IEclipsePreferences prefs = DefaultScope.INSTANCE.getNode(CorePlugin.PLUGIN_ID);<NEW_LINE>prefs.putBoolean(ICorePreferenceConstants.PREF_SHOW_SYSTEM_JOBS, ICorePreferenceConstants.DEFAULT_DEBUG_MODE);<NEW_LINE>prefs.put(ICorePreferenceConstants.PREF_DEBUG_LEVEL, IdeLog.StatusLevel.ERROR.toString());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>prefs.// $NON-NLS-1$<NEW_LINE>put(// $NON-NLS-1$<NEW_LINE>ICorePreferenceConstants.PREF_WEB_FILES, "*.js;*.htm;*.html;*.xhtm;*.xhtml;*.css;*.xml;*.xsl;*.xslt;*.fla;*.gif;*.jpg;*.jpeg;*.php;*.asp;*.jsp;*.png;*.as;*.sdoc;*.swf;*.shtml;*.txt;*.aspx;*.asmx;");<NEW_LINE>try {<NEW_LINE>prefs.flush();<NEW_LINE>} catch (BackingStoreException e) {<NEW_LINE>IdeLog.logError(CorePlugin.getDefault(), e);<NEW_LINE>}<NEW_LINE>// Migrate auto-refresh pref to Eclipse's<NEW_LINE>prefs = InstanceScope.INSTANCE.getNode(CorePlugin.PLUGIN_ID);<NEW_LINE>boolean migrated = prefs.getBoolean(MIGRATED_AUTO_REFRESH, false);<NEW_LINE>if (!migrated) {<NEW_LINE>// by default, turn on auto refresh<NEW_LINE>ResourcesPlugin.getPlugin().getPluginPreferences().setValue(ResourcesPlugin.PREF_AUTO_REFRESH, ICorePreferenceConstants.DEFAULT_AUTO_REFRESH_PROJECTS);<NEW_LINE>// Listen for user changing auto-refresh value, when they do, don't automatically turn it on for them<NEW_LINE>// anymore<NEW_LINE>ResourcesPlugin.getPlugin().getPluginPreferences().addPropertyChangeListener(new Preferences.IPropertyChangeListener() {<NEW_LINE><NEW_LINE>public void propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent event) {<NEW_LINE>if (ResourcesPlugin.PREF_AUTO_REFRESH.equals(event.getProperty())) {<NEW_LINE>IEclipsePreferences ourPrefs = InstanceScope.INSTANCE.getNode(CorePlugin.PLUGIN_ID);<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>ourPrefs.flush();<NEW_LINE>} catch (BackingStoreException e) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IdeLog.// $NON-NLS-1$<NEW_LINE>logError(// $NON-NLS-1$<NEW_LINE>CorePlugin.getDefault(), // $NON-NLS-1$<NEW_LINE>"Failed to store boolean to avoid overriding auto-refresh setting", e);<NEW_LINE>}<NEW_LINE>ResourcesPlugin.getPlugin().getPluginPreferences().removePropertyChangeListener(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
ourPrefs.putBoolean(MIGRATED_AUTO_REFRESH, true);
1,545,498
protected // abstract in superclass.<NEW_LINE>void apply(Font font) {<NEW_LINE>Globals.getSettings().setBooleanSetting(Settings.Bool.GENERIC_TEXT_EDITOR, genericEditorCheck.isSelected());<NEW_LINE>Globals.getSettings().setBooleanSetting(Settings.Bool.<MASK><NEW_LINE>Globals.getSettings().setBooleanSetting(Settings.Bool.AUTO_INDENT, autoIndentCheck.isSelected());<NEW_LINE>Globals.getSettings().setCaretBlinkRate((Integer) blinkRateSpinSelector.getValue());<NEW_LINE>Globals.getSettings().setEditorTabSize(tabSizeSelector.getValue());<NEW_LINE>bgChanger.save();<NEW_LINE>fgChanger.save();<NEW_LINE>textSelChanger.save();<NEW_LINE>caretChanger.save();<NEW_LINE>lhChanger.save();<NEW_LINE>if (syntaxStylesAction) {<NEW_LINE>for (int i = 0; i < syntaxStyleIndex.length; i++) {<NEW_LINE>Globals.getSettings().setEditorSyntaxStyleByPosition(syntaxStyleIndex[i], new SyntaxStyle(samples[i].getForeground(), italic[i].isSelected(), bold[i].isSelected()));<NEW_LINE>}<NEW_LINE>// reset<NEW_LINE>syntaxStylesAction = false;<NEW_LINE>}<NEW_LINE>Globals.getSettings().setEditorFont(font);<NEW_LINE>for (int i = 0; i < popupGuidanceOptions.length; i++) {<NEW_LINE>if (popupGuidanceOptions[i].isSelected()) {<NEW_LINE>if (i == 0) {<NEW_LINE>Globals.getSettings().setBooleanSetting(Settings.Bool.POPUP_INSTRUCTION_GUIDANCE, false);<NEW_LINE>} else {<NEW_LINE>Globals.getSettings().setBooleanSetting(Settings.Bool.POPUP_INSTRUCTION_GUIDANCE, true);<NEW_LINE>Globals.getSettings().setEditorPopupPrefixLength(i);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
EDITOR_CURRENT_LINE_HIGHLIGHTING, lineHighlightCheck.isSelected());
240,179
public List<String> listWithAppliedProcessing(String person) throws Exception {<NEW_LINE>EntityManager em = this.entityManagerContainer().get(Meeting.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Meeting> root = <MASK><NEW_LINE>Date date = new Date();<NEW_LINE>Predicate p = cb.equal(root.get(Meeting_.applicant), person);<NEW_LINE>p = cb.and(p, cb.notEqual(root.get(Meeting_.manualCompleted), true));<NEW_LINE>p = cb.and(p, cb.lessThanOrEqualTo(root.get(Meeting_.startTime), date));<NEW_LINE>p = cb.and(p, cb.greaterThanOrEqualTo(root.get(Meeting_.completedTime), date));<NEW_LINE>cq.select(root.get(Meeting_.id)).where(p);<NEW_LINE>return em.createQuery(cq).getResultList();<NEW_LINE>}
cq.from(Meeting.class);
1,258,048
public WriteFilesResult<DestinationT> expand(PCollection<UserT> input) {<NEW_LINE>Write.Builder<DestinationT, UserT> resolvedSpec = new AutoValue_FileIO_Write.Builder<>();<NEW_LINE>resolvedSpec.setDynamic(getDynamic());<NEW_LINE>checkArgument(getSinkFn() != null, ".via() is required");<NEW_LINE><MASK><NEW_LINE>checkArgument(getOutputFn() != null, "outputFn should have been set by .via()");<NEW_LINE>resolvedSpec.setOutputFn(getOutputFn());<NEW_LINE>// Resolve destinationFn<NEW_LINE>if (getDynamic()) {<NEW_LINE>checkArgument(getDestinationFn() != null, "when using writeDynamic(), .by() is required");<NEW_LINE>resolvedSpec.setDestinationFn(getDestinationFn());<NEW_LINE>resolvedSpec.setDestinationCoder(resolveDestinationCoder(input));<NEW_LINE>} else {<NEW_LINE>checkArgument(getDestinationFn() == null, ".by() requires writeDynamic()");<NEW_LINE>checkArgument(getDestinationCoder() == null, ".withDestinationCoder() requires writeDynamic()");<NEW_LINE>resolvedSpec.setDestinationFn(fn(SerializableFunctions.constant(null)));<NEW_LINE>resolvedSpec.setDestinationCoder((Coder) VoidCoder.of());<NEW_LINE>}<NEW_LINE>resolvedSpec.setFileNamingFn(resolveFileNamingFn());<NEW_LINE>resolvedSpec.setEmptyWindowDestination(getEmptyWindowDestination());<NEW_LINE>if (getTempDirectory() == null) {<NEW_LINE>checkArgument(getOutputDirectory() != null, "must specify either .withTempDirectory() or .to()");<NEW_LINE>resolvedSpec.setTempDirectory(getOutputDirectory());<NEW_LINE>} else {<NEW_LINE>resolvedSpec.setTempDirectory(getTempDirectory());<NEW_LINE>}<NEW_LINE>resolvedSpec.setCompression(getCompression());<NEW_LINE>resolvedSpec.setNumShards(getNumShards());<NEW_LINE>resolvedSpec.setSharding(getSharding());<NEW_LINE>resolvedSpec.setIgnoreWindowing(getIgnoreWindowing());<NEW_LINE>resolvedSpec.setNoSpilling(getNoSpilling());<NEW_LINE>Write<DestinationT, UserT> resolved = resolvedSpec.build();<NEW_LINE>WriteFiles<UserT, DestinationT, ?> writeFiles = WriteFiles.to(new ViaFileBasedSink<>(resolved)).withSideInputs(Lists.newArrayList(resolved.getAllSideInputs()));<NEW_LINE>if (getNumShards() != null) {<NEW_LINE>writeFiles = writeFiles.withNumShards(getNumShards());<NEW_LINE>} else if (getSharding() != null) {<NEW_LINE>writeFiles = writeFiles.withSharding(getSharding());<NEW_LINE>} else {<NEW_LINE>writeFiles = writeFiles.withRunnerDeterminedSharding();<NEW_LINE>}<NEW_LINE>if (!getIgnoreWindowing()) {<NEW_LINE>writeFiles = writeFiles.withWindowedWrites();<NEW_LINE>}<NEW_LINE>if (getNoSpilling()) {<NEW_LINE>writeFiles = writeFiles.withNoSpilling();<NEW_LINE>}<NEW_LINE>return input.apply(writeFiles);<NEW_LINE>}
resolvedSpec.setSinkFn(getSinkFn());
236,269
final DeleteOrganizationConformancePackResult executeDeleteOrganizationConformancePack(DeleteOrganizationConformancePackRequest deleteOrganizationConformancePackRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteOrganizationConformancePackRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteOrganizationConformancePackRequest> request = null;<NEW_LINE>Response<DeleteOrganizationConformancePackResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteOrganizationConformancePackRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteOrganizationConformancePackRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Config Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteOrganizationConformancePack");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteOrganizationConformancePackResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteOrganizationConformancePackResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,193,812
public Map<String, Object> upload(@RequestAttribute SysSite site, @SessionAttribute SysUser admin, MultipartFile imgFile, HttpServletRequest request) {<NEW_LINE>Map<String, Object> map = new HashMap<>();<NEW_LINE>map.put(CommonConstants.ERROR, 0);<NEW_LINE>if (null != imgFile && !imgFile.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>String suffix = CmsFileUtils.getSuffix(originalName);<NEW_LINE>if (ArrayUtils.contains(UeditorAdminController.ALLOW_FILES, suffix)) {<NEW_LINE>String fileName = CmsFileUtils.getUploadFileName(suffix);<NEW_LINE>String filePath = siteComponent.getWebFilePath(site, fileName);<NEW_LINE>try {<NEW_LINE>CmsFileUtils.upload(imgFile, filePath);<NEW_LINE>FileSize fileSize = CmsFileUtils.getFileSize(filePath, suffix);<NEW_LINE>logUploadService.save(new LogUpload(site.getId(), admin.getId(), LogLoginService.CHANNEL_WEB_MANAGER, originalName, CmsFileUtils.getFileType(suffix), imgFile.getSize(), fileSize.getWidth(), fileSize.getHeight(), RequestUtils.getIpAddress(request), CommonUtils.getDate(), fileName));<NEW_LINE>map.put(RESULT_URL, site.getSitePath() + fileName);<NEW_LINE>return map;<NEW_LINE>} catch (IllegalStateException | IOException e) {<NEW_LINE>map.put(CommonConstants.MESSAGE, e.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>map.put(CommonConstants.MESSAGE, "unsafe file");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>map.put(CommonConstants.MESSAGE, "no file");<NEW_LINE>}<NEW_LINE>map.put(CommonConstants.ERROR, 1);<NEW_LINE>return map;<NEW_LINE>}
String originalName = imgFile.getOriginalFilename();
636,451
public double[][] chooseInitialMeans(Relation<? extends NumberVector> relation, int k, NumberVectorDistance<?> distance) {<NEW_LINE>if (relation.size() < k) {<NEW_LINE>throw new AbortException("Database has less than k objects.");<NEW_LINE>}<NEW_LINE>// Ugly cast; but better than code duplication.<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Relation<O> rel = (Relation<O>) relation;<NEW_LINE>// Get a distance query<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final PrimitiveDistance<? super O> distF = (PrimitiveDistance<? super O>) distance;<NEW_LINE>final DistanceQuery<O> distQ = new QueryBuilder<>(rel, distF).distanceQuery();<NEW_LINE>DBIDs medids = chooseInitialMedoids(k, rel.getDBIDs(), distQ);<NEW_LINE>double[][] medoids = new double[k][];<NEW_LINE>DBIDIter iter = medids.iter();<NEW_LINE>for (int i = 0; i < k; i++, iter.advance()) {<NEW_LINE>medoids[i] = relation.<MASK><NEW_LINE>}<NEW_LINE>return medoids;<NEW_LINE>}
get(iter).toArray();
1,047,732
public void select(Tool tool) {<NEW_LINE>unselect();<NEW_LINE>if (tool == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Connect events<NEW_LINE>ArrayList<ToolEventHandler> handlers = new ArrayList<>();<NEW_LINE>for (ToolEventListener toolListener : tool.getListeners()) {<NEW_LINE>if (toolListener instanceof NodeClickEventListener) {<NEW_LINE>NodeClickEventHandler h = new NodeClickEventHandler(toolListener);<NEW_LINE>h.select();<NEW_LINE>handlers.add(h);<NEW_LINE>} else if (toolListener instanceof NodePressingEventListener) {<NEW_LINE>NodePressingEventHandler h = new NodePressingEventHandler(toolListener);<NEW_LINE>h.select();<NEW_LINE>handlers.add(h);<NEW_LINE>} else if (toolListener instanceof MouseClickEventListener) {<NEW_LINE>MouseClickEventHandler h = new MouseClickEventHandler(toolListener);<NEW_LINE>h.select();<NEW_LINE>handlers.add(h);<NEW_LINE>} else if (toolListener instanceof NodePressAndDraggingEventListener) {<NEW_LINE>NodePressAndDraggingEventHandler h = new NodePressAndDraggingEventHandler(toolListener);<NEW_LINE>h.select();<NEW_LINE>handlers.add(h);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("The ToolEventListener " + toolListener.getClass(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>currentHandlers = handlers.toArray(new ToolEventHandler[0]);<NEW_LINE>switch(tool.getSelectionType()) {<NEW_LINE>case NONE:<NEW_LINE>VizController.getInstance().getSelectionManager().disableSelection();<NEW_LINE>break;<NEW_LINE>case SELECTION:<NEW_LINE>VizController.getInstance().getSelectionManager().blockSelection(true);<NEW_LINE>VizController.getInstance().getSelectionManager().setDraggingEnable(false);<NEW_LINE>break;<NEW_LINE>case SELECTION_AND_DRAGGING:<NEW_LINE>VizController.getInstance().getSelectionManager().blockSelection(true);<NEW_LINE>VizController.getInstance().getSelectionManager().setDraggingEnable(true);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>currentTool = tool;<NEW_LINE>currentTool.select();<NEW_LINE>}
).getSimpleName() + " cannot be recognized");
1,611,118
public static // OPEN_PAREN | CLOSE_PAREN | OPEN_BRACKET | CLOSE_BRACKET | normal_text<NEW_LINE>boolean no_math_content(PsiBuilder b, int l) {<NEW_LINE>if (!recursion_guard_(b, l, "no_math_content"))<NEW_LINE>return false;<NEW_LINE>boolean r;<NEW_LINE>Marker m = enter_section_(b, l, _NONE_, NO_MATH_CONTENT, "<no math content>");<NEW_LINE>r = raw_text(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = <MASK><NEW_LINE>if (!r)<NEW_LINE>r = comment(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = environment(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = pseudocode_block(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = math_environment(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, COMMAND_IFNEXTCHAR);<NEW_LINE>if (!r)<NEW_LINE>r = commands(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = group(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, OPEN_PAREN);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, CLOSE_PAREN);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, OPEN_BRACKET);<NEW_LINE>if (!r)<NEW_LINE>r = consumeToken(b, CLOSE_BRACKET);<NEW_LINE>if (!r)<NEW_LINE>r = normal_text(b, l + 1);<NEW_LINE>exit_section_(b, l, m, r, false, null);<NEW_LINE>return r;<NEW_LINE>}
magic_comment(b, l + 1);
351,924
public InstanceInformationFilter unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InstanceInformationFilter instanceInformationFilter = new InstanceInformationFilter();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("key", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>instanceInformationFilter.setKey(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("valueSet", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>instanceInformationFilter.setValueSet(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return instanceInformationFilter;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,564,947
RequestMetadata createRequest(MethodDescriptor methodDescriptor, Invocation invocation, Integer timeout) {<NEW_LINE>final String methodName = RpcUtils.getMethodName(invocation);<NEW_LINE>Objects.requireNonNull(methodDescriptor, "MethodDescriptor not found for" + methodName + " params:" + Arrays.toString(invocation.getCompatibleParamSignatures()));<NEW_LINE>final RequestMetadata meta = new RequestMetadata();<NEW_LINE>final URL url = getUrl();<NEW_LINE>if (methodDescriptor instanceof PackableMethod) {<NEW_LINE>meta.packableMethod = (PackableMethod) methodDescriptor;<NEW_LINE>} else {<NEW_LINE>meta.packableMethod = ReflectionPackableMethod.init(methodDescriptor, url);<NEW_LINE>}<NEW_LINE>meta.method = methodDescriptor;<NEW_LINE>meta.scheme = getSchemeFromUrl(url);<NEW_LINE>// TODO read compressor from config<NEW_LINE>meta.compressor = Compressor.NONE;<NEW_LINE>meta.cancellationContext = RpcContext.getCancellationContext();<NEW_LINE>meta.address = url.getAddress();<NEW_LINE>meta.service = url.getPath();<NEW_LINE>meta.group = url.getGroup();<NEW_LINE>meta.version = url.getVersion();<NEW_LINE>meta.acceptEncoding = acceptEncodings;<NEW_LINE>if (timeout != null) {<NEW_LINE>meta.timeout = timeout + "m";<NEW_LINE>}<NEW_LINE>final Map<String, Object> objectAttachments = invocation.getObjectAttachments();<NEW_LINE>if (objectAttachments != null) {<NEW_LINE>String application = (String) <MASK><NEW_LINE>if (application == null) {<NEW_LINE>application = (String) objectAttachments.get(CommonConstants.REMOTE_APPLICATION_KEY);<NEW_LINE>}<NEW_LINE>meta.application = application;<NEW_LINE>meta.attachments = objectAttachments;<NEW_LINE>}<NEW_LINE>return meta;<NEW_LINE>}
objectAttachments.get(CommonConstants.APPLICATION_KEY);
1,448,158
protected BeanDefinitionBuilder parseHandler(Element element, ParserContext parserContext) {<NEW_LINE>final BeanDefinitionBuilder selectorBuilder = BeanDefinitionBuilder.genericBeanDefinition();<NEW_LINE>selectorBuilder.getBeanDefinition(<MASK><NEW_LINE>this.configureXPathExpression(element, selectorBuilder, parserContext);<NEW_LINE>if (element.hasAttribute("match-value")) {<NEW_LINE>selectorBuilder.addConstructorArgValue(element.getAttribute("match-value"));<NEW_LINE>String matchType = element.getAttribute("match-type");<NEW_LINE>if ("exact".equals(matchType)) {<NEW_LINE>selectorBuilder.getBeanDefinition().setBeanClass(StringValueTestXPathMessageSelector.class);<NEW_LINE>} else if ("case-insensitive".equals(matchType)) {<NEW_LINE>selectorBuilder.getBeanDefinition().setBeanClass(StringValueTestXPathMessageSelector.class);<NEW_LINE>selectorBuilder.addPropertyValue("caseSensitive", false);<NEW_LINE>} else if ("regex".equals(matchType)) {<NEW_LINE>selectorBuilder.getBeanDefinition().setBeanClass(RegexTestXPathMessageSelector.class);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(FilterFactoryBean.class);<NEW_LINE>builder.addPropertyValue("targetObject", selectorBuilder.getBeanDefinition());<NEW_LINE>IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "discard-channel");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "throw-exception-on-rejection");<NEW_LINE>IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "send-timeout");<NEW_LINE>return builder;<NEW_LINE>}
).setBeanClass(BooleanTestXPathMessageSelector.class);
1,740,720
protected void loadNextFromTo() {<NEW_LINE>long begin = profilingEnabled ? System.nanoTime() : 0;<NEW_LINE>try {<NEW_LINE>edgeToUpdate = null;<NEW_LINE>this.currentTo = null;<NEW_LINE>if (!toIterator.hasNext()) {<NEW_LINE>toIterator = toList.iterator();<NEW_LINE>if (!fromIter.hasNext()) {<NEW_LINE>finished = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>currentFrom = fromIter.hasNext() ? asVertex(fromIter.next()) : null;<NEW_LINE>}<NEW_LINE>if (toIterator.hasNext() || (toList.size() > 0 && fromIter.hasNext())) {<NEW_LINE>if (currentFrom == null) {<NEW_LINE>if (!fromIter.hasNext()) {<NEW_LINE>finished = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Object obj = toIterator.next();<NEW_LINE>currentTo = asVertex(obj);<NEW_LINE>if (currentTo == null) {<NEW_LINE>throw new OCommandExecutionException("Invalid TO vertex for edge");<NEW_LINE>}<NEW_LINE>if (isUpsert()) {<NEW_LINE>OEdge existingEdge = getExistingEdge(currentFrom, currentTo);<NEW_LINE>if (existingEdge != null) {<NEW_LINE>edgeToUpdate = existingEdge;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>this.currentTo = null;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (profilingEnabled) {<NEW_LINE>cost += (<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
System.nanoTime() - begin);
1,317,517
public static void unzip(InputStream is, Path targetDir) throws IOException {<NEW_LINE>targetDir = targetDir.toAbsolutePath();<NEW_LINE>try (ZipInputStream zipIn = new ZipInputStream(is)) {<NEW_LINE>for (ZipEntry ze; (ze = zipIn.getNextEntry()) != null; ) {<NEW_LINE>Path resolvedPath = targetDir.resolve(ze.getName()).normalize();<NEW_LINE>if (!resolvedPath.startsWith(targetDir)) {<NEW_LINE>// see: https://snyk.io/research/zip-slip-vulnerability<NEW_LINE>throw new RuntimeException(<MASK><NEW_LINE>}<NEW_LINE>if (ze.isDirectory()) {<NEW_LINE>Files.createDirectories(resolvedPath);<NEW_LINE>} else {<NEW_LINE>Path dir = resolvedPath.getParent();<NEW_LINE>assert dir != null : "null parent: " + resolvedPath;<NEW_LINE>Files.createDirectories(dir);<NEW_LINE>Files.copy(zipIn, resolvedPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"Entry with an illegal path: " + ze.getName());
1,553,502
public DBClusterMember unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DBClusterMember dBClusterMember = new DBClusterMember();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 3;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return dBClusterMember;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("DBInstanceIdentifier", targetDepth)) {<NEW_LINE>dBClusterMember.setDBInstanceIdentifier(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("IsClusterWriter", targetDepth)) {<NEW_LINE>dBClusterMember.setIsClusterWriter(BooleanStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("DBClusterParameterGroupStatus", targetDepth)) {<NEW_LINE>dBClusterMember.setDBClusterParameterGroupStatus(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("PromotionTier", targetDepth)) {<NEW_LINE>dBClusterMember.setPromotionTier(IntegerStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return dBClusterMember;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
1,291,458
protected static ParameterValueProvider parseParamValueProvider(Element parameterElement) {<NEW_LINE>// LIST<NEW_LINE>if ("list".equals(parameterElement.getTagName())) {<NEW_LINE>List<ParameterValueProvider> providerList = new ArrayList<>();<NEW_LINE>for (Element element : parameterElement.elements()) {<NEW_LINE>// parse nested provider<NEW_LINE>providerList.add(parseParamValueProvider(element));<NEW_LINE>}<NEW_LINE>return new ListValueProvider(providerList);<NEW_LINE>}<NEW_LINE>// MAP<NEW_LINE>if ("map".equals(parameterElement.getTagName())) {<NEW_LINE>TreeMap<ParameterValueProvider, ParameterValueProvider> providerMap = new TreeMap<>();<NEW_LINE>for (Element entryElement : parameterElement.elements("entry")) {<NEW_LINE>// entry must provide key<NEW_LINE>String keyAttribute = entryElement.attribute("key");<NEW_LINE>if (keyAttribute == null || keyAttribute.isEmpty()) {<NEW_LINE>throw new BpmnParseException("Missing attribute 'key' for 'entry' element", entryElement);<NEW_LINE>}<NEW_LINE>// parse nested provider<NEW_LINE>providerMap.put(new ElValueProvider(getExpressionManager().createExpression(keyAttribute<MASK><NEW_LINE>}<NEW_LINE>return new MapValueProvider(providerMap);<NEW_LINE>}<NEW_LINE>// SCRIPT<NEW_LINE>if ("script".equals(parameterElement.getTagName())) {<NEW_LINE>ExecutableScript executableScript = parseCamundaScript(parameterElement);<NEW_LINE>if (executableScript != null) {<NEW_LINE>return new ScriptValueProvider(executableScript);<NEW_LINE>} else {<NEW_LINE>return new NullValueProvider();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String textContent = parameterElement.getText().trim();<NEW_LINE>if (!textContent.isEmpty()) {<NEW_LINE>// EL<NEW_LINE>return new ElValueProvider(getExpressionManager().createExpression(textContent));<NEW_LINE>} else {<NEW_LINE>// NULL value<NEW_LINE>return new NullValueProvider();<NEW_LINE>}<NEW_LINE>}
)), parseNestedParamValueProvider(entryElement));
1,094,669
final long[] begLen(long len, int err) {<NEW_LINE>long beg = isBeginless ? 0 : RubyNumeric.num2long(this.begin);<NEW_LINE>long end = isEndless ? -1 : <MASK><NEW_LINE>if (beg < 0) {<NEW_LINE>beg += len;<NEW_LINE>if (beg < 0) {<NEW_LINE>if (err != 0) {<NEW_LINE>throw getRuntime().newRangeError(beg + ".." + (isExclusive ? "." : "") + end + " out of range");<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (err == 0 || err == 2) {<NEW_LINE>if (beg > len) {<NEW_LINE>if (err != 0) {<NEW_LINE>throw getRuntime().newRangeError(beg + ".." + (isExclusive ? "." : "") + end + " out of range");<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (end > len) {<NEW_LINE>end = len;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (end < 0) {<NEW_LINE>end += len;<NEW_LINE>}<NEW_LINE>if (!isExclusive || isEndless) {<NEW_LINE>end++;<NEW_LINE>}<NEW_LINE>len = end - beg;<NEW_LINE>if (len < 0) {<NEW_LINE>len = 0;<NEW_LINE>}<NEW_LINE>return new long[] { beg, len };<NEW_LINE>}
RubyNumeric.num2long(this.end);
29,058
private Bundle handleLegacyPermissions(Map<String, PermissionsResponse> result) {<NEW_LINE>PermissionsResponse accessFineLocation = result.get(Manifest.permission.ACCESS_FINE_LOCATION);<NEW_LINE>PermissionsResponse accessCoarseLocation = result.<MASK><NEW_LINE>PermissionsResponse backgroundLocation = result.get(Manifest.permission.ACCESS_BACKGROUND_LOCATION);<NEW_LINE>Objects.requireNonNull(accessFineLocation);<NEW_LINE>Objects.requireNonNull(accessCoarseLocation);<NEW_LINE>Objects.requireNonNull(backgroundLocation);<NEW_LINE>PermissionsStatus status = PermissionsStatus.UNDETERMINED;<NEW_LINE>String accuracy = "none";<NEW_LINE>boolean canAskAgain = accessCoarseLocation.getCanAskAgain() && accessFineLocation.getCanAskAgain();<NEW_LINE>if (accessFineLocation.getStatus() == PermissionsStatus.GRANTED) {<NEW_LINE>accuracy = "fine";<NEW_LINE>status = PermissionsStatus.GRANTED;<NEW_LINE>} else if (accessCoarseLocation.getStatus() == PermissionsStatus.GRANTED) {<NEW_LINE>accuracy = "coarse";<NEW_LINE>status = PermissionsStatus.GRANTED;<NEW_LINE>} else if (accessFineLocation.getStatus() == PermissionsStatus.DENIED && accessCoarseLocation.getStatus() == PermissionsStatus.DENIED) {<NEW_LINE>status = PermissionsStatus.DENIED;<NEW_LINE>}<NEW_LINE>Bundle resultBundle = new Bundle();<NEW_LINE>resultBundle.putString(PermissionsResponse.STATUS_KEY, status.getStatus());<NEW_LINE>resultBundle.putString(PermissionsResponse.EXPIRES_KEY, PermissionsResponse.PERMISSION_EXPIRES_NEVER);<NEW_LINE>resultBundle.putBoolean(PermissionsResponse.CAN_ASK_AGAIN_KEY, canAskAgain);<NEW_LINE>resultBundle.putBoolean(PermissionsResponse.GRANTED_KEY, status == PermissionsStatus.GRANTED);<NEW_LINE>Bundle androidBundle = new Bundle();<NEW_LINE>androidBundle.putString("accuracy", accuracy);<NEW_LINE>resultBundle.putBundle("android", androidBundle);<NEW_LINE>return resultBundle;<NEW_LINE>}
get(Manifest.permission.ACCESS_COARSE_LOCATION);
468,515
public void onBindViewHolder(ViewHolder holder, int position) {<NEW_LINE>if (getItemViewType(position) == TYPE_FOOTER) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>super.onBindViewHolder(holder, position);<NEW_LINE>AppInfo info = mAppList.get(position);<NEW_LINE>if (mFrom == null) {<NEW_LINE>GlideUtils.loadInstalledPackageIcon(mContext, info.packageName, holder.iconView, android.R.drawable.sym_def_app_icon);<NEW_LINE>} else {<NEW_LINE>GlideUtils.loadPackageIconFromApkFile(mContext, info.path, holder.iconView, android.R.drawable.sym_def_app_icon);<NEW_LINE>}<NEW_LINE>holder.nameView.setText(String.format("%s: %s%s", info.name, info.version, info.splitApk ? " [S]" : ""));<NEW_LINE>if (isIndexSelected(position)) {<NEW_LINE>holder.iconView.setAlpha(1f);<NEW_LINE>holder.appCheckView.setImageResource(R.drawable.ic_check);<NEW_LINE>} else {<NEW_LINE>holder.iconView.setAlpha(0.65f);<NEW_LINE>holder.appCheckView.setImageResource(R.drawable.ic_no_check);<NEW_LINE>}<NEW_LINE>if (info.cloneCount > 0) {<NEW_LINE>holder.labelView.setVisibility(View.VISIBLE);<NEW_LINE>holder.labelView.setText(info.cloneCount + 1 + "");<NEW_LINE>} else {<NEW_LINE>holder.labelView.setVisibility(View.INVISIBLE);<NEW_LINE>}<NEW_LINE>holder.itemView.setOnClickListener(v -> {<NEW_LINE><MASK><NEW_LINE>});<NEW_LINE>}
mItemEventListener.onItemClick(info, position);
1,233,232
public void msg(Msg msg, String fromPort) {<NEW_LINE>if (msg.isPureNack()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (msg.getByte("Cmd") == 0x69 || msg.getByte("Cmd") == 0x6a) {<NEW_LINE>// If the flag is "ACK/NACK", a record response<NEW_LINE>// will follow, so we do nothing here.<NEW_LINE>// If its "NACK", there are none<NEW_LINE>if (msg.getByte("ACK/NACK") == 0x15) {<NEW_LINE>logger.debug("got all link records.");<NEW_LINE>done();<NEW_LINE>}<NEW_LINE>} else if (msg.getByte("Cmd") == 0x57) {<NEW_LINE>// we got the link record response<NEW_LINE>updateModemDB(msg.getAddress("LinkAddr"), m_port, msg);<NEW_LINE>m_port.writeMessage(Msg.s_makeMessage("GetNextALLLinkRecord"));<NEW_LINE>}<NEW_LINE>} catch (FieldException e) {<NEW_LINE><MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.debug("got IO exception handling link records {}", e);<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>logger.debug("got exception requesting link records {}", e);<NEW_LINE>}<NEW_LINE>}
logger.debug("bad field handling link records {}", e);
128,174
final GetSigningCertificateResult executeGetSigningCertificate(GetSigningCertificateRequest getSigningCertificateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getSigningCertificateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetSigningCertificateRequest> request = null;<NEW_LINE>Response<GetSigningCertificateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetSigningCertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getSigningCertificateRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Cognito Identity Provider");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetSigningCertificateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetSigningCertificateResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetSigningCertificate");
610,424
public void onActivityCreated(Bundle savedInstanceState) {<NEW_LINE>super.onActivityCreated(savedInstanceState);<NEW_LINE>backgroundService.getValue().attach(requireActivity());<NEW_LINE>// Add event listeners<NEW_LINE>EditText searchBar = getActivity().findViewById(R.id.search_bar);<NEW_LINE>searchBar.addTextChangedListener(this);<NEW_LINE>searchBar.setOnEditorActionListener(this);<NEW_LINE>// Set up result fragment<NEW_LINE>RowsSupportFragment rowsSupportFragment = (RowsSupportFragment) getChildFragmentManager().findFragmentById(R.id.results_frame);<NEW_LINE>rowsSupportFragment.setAdapter(searchProvider.getResultsAdapter());<NEW_LINE>rowsSupportFragment.setOnItemViewSelectedListener(mSelectedListener);<NEW_LINE>mSelectedListener.registerListener((itemViewHolder, item, rowViewHolder, row) -> {<NEW_LINE>if (!(item instanceof BaseRowItem)) {<NEW_LINE>backgroundService.getValue().clearBackgrounds();<NEW_LINE>} else {<NEW_LINE>BaseRowItem rowItem = (BaseRowItem) item;<NEW_LINE>backgroundService.getValue().setBackground(rowItem.getSearchHint());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Create click listener<NEW_LINE>rowsSupportFragment.setOnItemViewClickedListener((itemViewHolder, item, rowViewHolder, row) -> {<NEW_LINE>if (!(item instanceof BaseRowItem))<NEW_LINE>return;<NEW_LINE>ItemLauncher.launch((BaseRowItem) item, (ItemRowAdapter) ((ListRow) row).getAdapter(), ((BaseRowItem) item).<MASK><NEW_LINE>});<NEW_LINE>}
getIndex(), getActivity());
323,264
public void marshall(User user, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (user == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(user.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getUsername(), USERNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getEmailAddress(), EMAILADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getGivenName(), GIVENNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getSurname(), SURNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getOrganizationId(), ORGANIZATIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getRootFolderId(), ROOTFOLDERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getRecycleBinFolderId(), RECYCLEBINFOLDERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getType(), TYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getCreatedTimestamp(), CREATEDTIMESTAMP_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getModifiedTimestamp(), MODIFIEDTIMESTAMP_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(user.getLocale(), LOCALE_BINDING);<NEW_LINE>protocolMarshaller.marshall(user.getStorage(), STORAGE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
user.getTimeZoneId(), TIMEZONEID_BINDING);
1,220,014
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>this.getDialog().setCanceledOnTouchOutside(true);<NEW_LINE>View rootView = inflater.inflate(R.layout.dialog_fragment_contacts_call, container);<NEW_LINE>RL_contacts_call_name = (RelativeLayout) rootView.findViewById(R.id.RL_contacts_call_name);<NEW_LINE>TV_contacts_call_name = (TextView) rootView.<MASK><NEW_LINE>RL_contacts_call_name.setBackgroundColor(ThemeManager.getInstance().getThemeMainColor(getActivity()));<NEW_LINE>But_contacts_call_call = (MyDiaryButton) rootView.findViewById(R.id.But_contacts_call_call);<NEW_LINE>But_contacts_call_call.setOnClickListener(this);<NEW_LINE>But_contacts_call_cancel = (MyDiaryButton) rootView.findViewById(R.id.But_contacts_call_cancel);<NEW_LINE>But_contacts_call_cancel.setOnClickListener(this);<NEW_LINE>return rootView;<NEW_LINE>}
findViewById(R.id.TV_contacts_call_name);
4,597
public final void reportInputMethodSubtypes(@NonNull InputMethodManager inputMethodManager, @NonNull String imeId, @NonNull List<KeyboardAddOnAndBuilder> builders) {<NEW_LINE>List<InputMethodSubtype> subtypes = new ArrayList<>();<NEW_LINE>for (KeyboardAddOnAndBuilder builder : builders) {<NEW_LINE>Logger.d("reportInputMethodSubtypes", "reportInputMethodSubtypes for %s with locale %s", builder.getId(<MASK><NEW_LINE>final String locale = builder.getKeyboardLocale();<NEW_LINE>if (TextUtils.isEmpty(locale))<NEW_LINE>continue;<NEW_LINE>InputMethodSubtype subtype = createSubtype(locale, builder.getId());<NEW_LINE>Logger.d("reportInputMethodSubtypes", "created subtype for %s with hash %s", builder.getId(), subtype);<NEW_LINE>subtypes.add(subtype);<NEW_LINE>}<NEW_LINE>inputMethodManager.setAdditionalInputMethodSubtypes(imeId, subtypes.toArray(new InputMethodSubtype[0]));<NEW_LINE>}
), builder.getKeyboardLocale());
168,098
protected String encode(Date theValue) {<NEW_LINE>if (theValue == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>GregorianCalendar cal;<NEW_LINE>if (myTimeZoneZulu) {<NEW_LINE>cal = new GregorianCalendar(getTimeZone("GMT"));<NEW_LINE>} else if (myTimeZone != null) {<NEW_LINE>cal = new GregorianCalendar(myTimeZone);<NEW_LINE>} else {<NEW_LINE>cal = new GregorianCalendar();<NEW_LINE>}<NEW_LINE>cal.setTime(theValue);<NEW_LINE>StringBuilder b = new StringBuilder();<NEW_LINE>leftPadWithZeros(cal.get(Calendar.YEAR), 4, b);<NEW_LINE>if (myPrecision.ordinal() > TemporalPrecisionEnum.YEAR.ordinal()) {<NEW_LINE>b.append('-');<NEW_LINE>leftPadWithZeros(cal.get(Calendar.MONTH) + 1, 2, b);<NEW_LINE>if (myPrecision.ordinal() > TemporalPrecisionEnum.MONTH.ordinal()) {<NEW_LINE>b.append('-');<NEW_LINE>leftPadWithZeros(cal.get(Calendar.DATE), 2, b);<NEW_LINE>if (myPrecision.ordinal() > TemporalPrecisionEnum.DAY.ordinal()) {<NEW_LINE>b.append('T');<NEW_LINE>leftPadWithZeros(cal.get(Calendar.HOUR_OF_DAY), 2, b);<NEW_LINE>b.append(':');<NEW_LINE>leftPadWithZeros(cal.get(Calendar.MINUTE), 2, b);<NEW_LINE>if (myPrecision.ordinal() > TemporalPrecisionEnum.MINUTE.ordinal()) {<NEW_LINE>b.append(':');<NEW_LINE>leftPadWithZeros(cal.get(Calendar.SECOND), 2, b);<NEW_LINE>if (myPrecision.ordinal() > TemporalPrecisionEnum.SECOND.ordinal()) {<NEW_LINE>b.append('.');<NEW_LINE>b.append(myFractionalSeconds);<NEW_LINE>for (int i = myFractionalSeconds.length(); i < 3; i++) {<NEW_LINE>b.append('0');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (myTimeZoneZulu) {<NEW_LINE>b.append('Z');<NEW_LINE>} else if (myTimeZone != null) {<NEW_LINE>int offset = myTimeZone.getOffset(theValue.getTime());<NEW_LINE>if (offset >= 0) {<NEW_LINE>b.append('+');<NEW_LINE>} else {<NEW_LINE>b.append('-');<NEW_LINE>offset = Math.abs(offset);<NEW_LINE>}<NEW_LINE>int hoursOffset = (int) (offset / DateUtils.MILLIS_PER_HOUR);<NEW_LINE>leftPadWithZeros(hoursOffset, 2, b);<NEW_LINE>b.append(':');<NEW_LINE>int minutesOffset = (int) (offset % DateUtils.MILLIS_PER_HOUR);<NEW_LINE>minutesOffset = (int<MASK><NEW_LINE>leftPadWithZeros(minutesOffset, 2, b);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return b.toString();<NEW_LINE>}
) (minutesOffset / DateUtils.MILLIS_PER_MINUTE);
1,835,237
public static boolean addLinks(Spannable text, int mask, ColorStateList linkColor, ColorStateList bgColor, QMUIOnSpanClickListener l) {<NEW_LINE>if (mask == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>URLSpan[] old = text.getSpans(0, text.<MASK><NEW_LINE>for (int i = old.length - 1; i >= 0; i--) {<NEW_LINE>text.removeSpan(old[i]);<NEW_LINE>}<NEW_LINE>ArrayList<LinkSpec> links = new ArrayList<>();<NEW_LINE>if ((mask & WEB_URLS) != 0) {<NEW_LINE>gatherLinks(links, text, sWebUrlMatcher.getPattern(), new String[] { "http://", "https://", "rtsp://" }, sUrlMatchFilter, null);<NEW_LINE>}<NEW_LINE>if ((mask & EMAIL_ADDRESSES) != 0) {<NEW_LINE>gatherLinks(links, text, Patterns.EMAIL_ADDRESS, new String[] { "mailto:" }, null, null);<NEW_LINE>}<NEW_LINE>if ((mask & PHONE_NUMBERS) != 0) {<NEW_LINE>gatherPhoneLinks(links, text, WECHAT_PHONE, new Pattern[] { NOT_PHONE }, new String[] { "tel:" }, sPhoneNumberMatchFilter, sPhoneNumberTransformFilter);<NEW_LINE>}<NEW_LINE>if ((mask & MAP_ADDRESSES) != 0) {<NEW_LINE>gatherMapLinks(links, text);<NEW_LINE>}<NEW_LINE>pruneOverlaps(links);<NEW_LINE>if (links.size() == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (LinkSpec link : links) {<NEW_LINE>applyLink(link.url, link.start, link.end, text, linkColor, bgColor, l);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
length(), URLSpan.class);
1,320,001
synchronized public int encodeIntoByteBuffer(final ByteBuffer buffer) {<NEW_LINE>final long maxValue = getMaxValue();<NEW_LINE>final int relevantLength = countsArrayIndex(maxValue) + 1;<NEW_LINE>if (buffer.capacity() < getNeededByteBufferCapacity(relevantLength)) {<NEW_LINE>throw new ArrayIndexOutOfBoundsException("buffer does not have capacity for " + getNeededByteBufferCapacity(relevantLength) + " bytes");<NEW_LINE>}<NEW_LINE>int initialPosition = buffer.position();<NEW_LINE>buffer.putInt(getEncodingCookie());<NEW_LINE>// Placeholder for payload length in bytes.<NEW_LINE>buffer.putInt(0);<NEW_LINE>buffer.putInt(getNormalizingIndexOffset());<NEW_LINE>buffer.putInt(numberOfSignificantValueDigits);<NEW_LINE>buffer.putLong(lowestDiscernibleValue);<NEW_LINE>buffer.putLong(highestTrackableValue);<NEW_LINE><MASK><NEW_LINE>int payloadStartPosition = buffer.position();<NEW_LINE>fillBufferFromCountsArray(buffer);<NEW_LINE>// Record the payload length<NEW_LINE>buffer.putInt(initialPosition + 4, buffer.position() - payloadStartPosition);<NEW_LINE>return buffer.position() - initialPosition;<NEW_LINE>}
buffer.putDouble(getIntegerToDoubleValueConversionRatio());
1,051,150
public List<OrderItem> readBatchOrderItems(int start, int count, List<OrderStatus> statuses) {<NEW_LINE>CriteriaBuilder builder = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<OrderItem> criteria = builder.createQuery(OrderItem.class);<NEW_LINE>Root<OrderImpl> order = criteria.from(OrderImpl.class);<NEW_LINE>Join<Order, OrderItem> orderItems = order.join("orderItems");<NEW_LINE>criteria.select(orderItems);<NEW_LINE>List<Predicate> restrictions = new ArrayList<>();<NEW_LINE>criteria.where(restrictions.toArray(new Predicate[restrictions.size()]));<NEW_LINE>if (CollectionUtils.isNotEmpty(statuses)) {<NEW_LINE>// We only want results that match the orders with the correct status<NEW_LINE>ArrayList<String> statusStrings <MASK><NEW_LINE>for (OrderStatus status : statuses) {<NEW_LINE>statusStrings.add(status.getType());<NEW_LINE>}<NEW_LINE>criteria.where(order.get("status").as(String.class).in(statusStrings));<NEW_LINE>}<NEW_LINE>TypedQuery<OrderItem> query = em.createQuery(criteria);<NEW_LINE>query.setFirstResult(start);<NEW_LINE>query.setMaxResults(count);<NEW_LINE>query.setHint(QueryHints.HINT_CACHEABLE, true);<NEW_LINE>query.setHint(QueryHints.HINT_CACHE_REGION, "query.Order");<NEW_LINE>return query.getResultList();<NEW_LINE>}
= new ArrayList<String>();
1,778,455
private void add(String attributeName, ImmutableList.Builder<String> valuePath, TabularData tds) {<NEW_LINE>// @see TabularData#keySet JavaDoc:<NEW_LINE>// "Set<List<?>>" but is declared as a {@code Set<?>} for<NEW_LINE>// compatibility reasons. The returned set can be used to iterate<NEW_LINE>// over the keys."<NEW_LINE>Set<List<?>> keys = (Set<List<?>>) tds.keySet();<NEW_LINE>for (List<?> key : keys) {<NEW_LINE>// ie: attributeName=LastGcInfo.Par Survivor Space<NEW_LINE>// i haven't seen this be smaller or larger than List<1>, but<NEW_LINE>// might as well loop it.<NEW_LINE>CompositeData compositeData = tds.<MASK><NEW_LINE>String attributeName2 = Joiner.on('.').join(key);<NEW_LINE>add(attributeName, newValuePath(valuePath, attributeName2), compositeData);<NEW_LINE>}<NEW_LINE>}
get(key.toArray());
1,407,924
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('var') create constant variable string MYVAR = '.*abc.*';\n" + "@name('s0') select * from SupportBean(theString regexp MYVAR);\n" + "" + "@name('ctx') create context MyContext start SupportBean_S0 as s0;\n" + "@name('s1') context MyContext select * from SupportBean(theString regexp context.s0.p00);\n" + "" + "@name('s2') select * from pattern[s0=SupportBean_S0 -> every SupportBean(theString regexp s0.p00)];\n" + "" + "@name('s3') select * from SupportBean(theString regexp '.*' || 'abc' || '.*');\n";<NEW_LINE>env.compileDeploy(epl);<NEW_LINE>EPDeployment deployment = env.deployment().getDeployment(env.deploymentId("s0"));<NEW_LINE>Set<String> statementNames = new LinkedHashSet<>();<NEW_LINE>for (EPStatement stmt : deployment.getStatements()) {<NEW_LINE>if (stmt.getName().startsWith("s")) {<NEW_LINE>stmt.addListener(env.listenerNew());<NEW_LINE>statementNames.add(stmt.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportBean_S0(1, ".*abc.*"));<NEW_LINE>sendSBAssert(env, "xabsx", statementNames, false);<NEW_LINE>sendSBAssert(env, "xabcx", statementNames, true);<NEW_LINE>if (hasFilterIndexPlanAdvanced(env)) {<NEW_LINE>Map<String, FilterItem> filters = SupportFilterServiceHelper.getFilterSvcAllStmtForTypeSingleFilter(env.runtime(), "SupportBean");<NEW_LINE>FilterItem <MASK><NEW_LINE>for (String name : statementNames) {<NEW_LINE>FilterItem sn = filters.get(name);<NEW_LINE>assertEquals(FilterOperator.REBOOL, sn.getOp());<NEW_LINE>assertNotNull(s0.getOptionalValue());<NEW_LINE>assertNotNull(s0.getIndex());<NEW_LINE>assertSame(s0.getIndex(), sn.getIndex());<NEW_LINE>assertSame(s0.getOptionalValue(), sn.getOptionalValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>env.undeployAll();<NEW_LINE>}
s0 = filters.get("s0");
1,083,830
public Object evaluate(@Nullable String value, BeanExpressionContext beanExpressionContext) throws BeansException {<NEW_LINE>if (!StringUtils.hasLength(value)) {<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Expression expr = this.expressionCache.get(value);<NEW_LINE>if (expr == null) {<NEW_LINE>expr = this.expressionParser.parseExpression(value, this.beanExpressionParserContext);<NEW_LINE>this.expressionCache.put(value, expr);<NEW_LINE>}<NEW_LINE>StandardEvaluationContext sec = this.evaluationCache.get(beanExpressionContext);<NEW_LINE>if (sec == null) {<NEW_LINE>sec = new StandardEvaluationContext(beanExpressionContext);<NEW_LINE>sec.addPropertyAccessor(new BeanExpressionContextAccessor());<NEW_LINE>sec.addPropertyAccessor(new BeanFactoryAccessor());<NEW_LINE>sec.addPropertyAccessor(new MapAccessor());<NEW_LINE>sec.addPropertyAccessor(new EnvironmentAccessor());<NEW_LINE>sec.setBeanResolver(new BeanFactoryResolver(beanExpressionContext.getBeanFactory()));<NEW_LINE>sec.setTypeLocator(new StandardTypeLocator(beanExpressionContext.getBeanFactory().getBeanClassLoader()));<NEW_LINE>sec.setTypeConverter(new StandardTypeConverter(() -> {<NEW_LINE>ConversionService cs = beanExpressionContext.getBeanFactory().getConversionService();<NEW_LINE>return (cs != null ? cs : DefaultConversionService.getSharedInstance());<NEW_LINE>}));<NEW_LINE>customizeEvaluationContext(sec);<NEW_LINE>this.evaluationCache.put(beanExpressionContext, sec);<NEW_LINE>}<NEW_LINE>return expr.getValue(sec);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new BeanExpressionException("Expression parsing failed", ex);
1,015,080
private void initComponents() {<NEW_LINE>Font labelEstimatedFont = new Font(Font.SANS_SERIF, Font.PLAIN, 12);<NEW_LINE>navigationButtons = new NavigationButtons(getBackend(), 1.0, (int) getBackend().getSettings().getJogFeedRate());<NEW_LINE>buttonUpdateSettingsX = new JButton(Localization.getString("platform.plugin.setupwizard.update"));<NEW_LINE>labelEstimatedStepsX = new JLabel("0 steps/mm");<NEW_LINE>labelEstimatedStepsX.setFont(labelEstimatedFont);<NEW_LINE>labelPositionX = new JLabel(" 0.0 mm", JLabel.RIGHT);<NEW_LINE>textFieldMeasuredX = new JTextField("0.0");<NEW_LINE>textFieldMeasuredX.addKeyListener(createKeyListener(Axis.X, labelEstimatedStepsX));<NEW_LINE>textFieldSettingStepsX = new JTextField("0.0");<NEW_LINE>textFieldSettingStepsX.addKeyListener(createKeyListenerChangeSetting());<NEW_LINE>buttonUpdateSettingsX.setEnabled(false);<NEW_LINE>buttonUpdateSettingsX.addActionListener(createListenerUpdateSetting(Axis.X, textFieldSettingStepsX));<NEW_LINE>buttonUpdateSettingsY = new JButton(Localization.getString("platform.plugin.setupwizard.update"));<NEW_LINE>labelEstimatedStepsY = new JLabel(Localization.getString("platform.plugin.setupwizard.calibration.setting"));<NEW_LINE>labelEstimatedStepsY.setFont(labelEstimatedFont);<NEW_LINE>labelPositionY = new JLabel(" 0.0 mm", JLabel.RIGHT);<NEW_LINE>textFieldMeasuredY = new JTextField("0.0");<NEW_LINE>textFieldMeasuredY.addKeyListener(createKeyListener(Axis.Y, labelEstimatedStepsY));<NEW_LINE>textFieldSettingStepsY = new JTextField("0.0");<NEW_LINE>textFieldSettingStepsY.addKeyListener(createKeyListenerChangeSetting());<NEW_LINE>buttonUpdateSettingsY.setEnabled(false);<NEW_LINE>buttonUpdateSettingsY.addActionListener(createListenerUpdateSetting(Axis.Y, textFieldSettingStepsY));<NEW_LINE>buttonUpdateSettingsZ = new JButton(Localization.getString("platform.plugin.setupwizard.update"));<NEW_LINE>labelEstimatedStepsZ = new JLabel("0 steps/mm");<NEW_LINE>labelEstimatedStepsZ.setFont(labelEstimatedFont);<NEW_LINE>labelPositionZ = new JLabel(" 0.0 mm", JLabel.RIGHT);<NEW_LINE>textFieldMeasuredZ = new JTextField("0.0");<NEW_LINE>textFieldMeasuredZ.addKeyListener(createKeyListener(Axis.Z, labelEstimatedStepsZ));<NEW_LINE>textFieldSettingStepsZ = new JTextField("0.0");<NEW_LINE><MASK><NEW_LINE>buttonUpdateSettingsZ.setEnabled(false);<NEW_LINE>buttonUpdateSettingsZ.addActionListener(createListenerUpdateSetting(Axis.Z, textFieldSettingStepsZ));<NEW_LINE>}
textFieldSettingStepsZ.addKeyListener(createKeyListenerChangeSetting());
1,023,862
final BatchDeleteBuildsResult executeBatchDeleteBuilds(BatchDeleteBuildsRequest batchDeleteBuildsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchDeleteBuildsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchDeleteBuildsRequest> request = null;<NEW_LINE>Response<BatchDeleteBuildsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchDeleteBuildsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(batchDeleteBuildsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CodeBuild");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchDeleteBuilds");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchDeleteBuildsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchDeleteBuildsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
955,071
private boolean detectPreviewDocument(Mat inputRgba) {<NEW_LINE>ArrayList<MatOfPoint> contours = findContours(inputRgba);<NEW_LINE>Quadrilateral quad = getQuadrilateral(contours, inputRgba.size());<NEW_LINE>mPreviewPoints = null;<NEW_LINE>mPreviewSize = inputRgba.size();<NEW_LINE>if (quad != null) {<NEW_LINE>Point[] rescaledPoints = new Point[4];<NEW_LINE>double ratio = inputRgba<MASK><NEW_LINE>for (int i = 0; i < 4; i++) {<NEW_LINE>int x = Double.valueOf(quad.getPoints()[i].x * ratio).intValue();<NEW_LINE>int y = Double.valueOf(quad.getPoints()[i].y * ratio).intValue();<NEW_LINE>if (mBugRotate) {<NEW_LINE>rescaledPoints[(i + 2) % 4] = new Point(Math.abs(x - mPreviewSize.width), Math.abs(y - mPreviewSize.height));<NEW_LINE>} else {<NEW_LINE>rescaledPoints[i] = new Point(x, y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mPreviewPoints = rescaledPoints;<NEW_LINE>drawDocumentBox(mPreviewPoints, mPreviewSize);<NEW_LINE>Log.d(TAG, quad.getPoints()[0].toString() + " , " + quad.getPoints()[1].toString() + " , " + quad.getPoints()[2].toString() + " , " + quad.getPoints()[3].toString());<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>mMainActivity.getHUD().clear();<NEW_LINE>mMainActivity.invalidateHUD();<NEW_LINE>return false;<NEW_LINE>}
.size().height / 500;
547,008
private AdImageId retrieveLogoImageId(@NonNull final OrgId adOrgId) {<NEW_LINE>//<NEW_LINE>// Get Logo from Organization's BPartner<NEW_LINE>// task FRESH-356: get logo also from organization's bpartner if is set<NEW_LINE>final Properties ctx = Env.getCtx();<NEW_LINE>final I_AD_Org org = orgsRepo.getById(adOrgId);<NEW_LINE>if (org != null) {<NEW_LINE>final I_C_BPartner orgBPartner = bpartnerOrgBL.retrieveLinkedBPartner(org);<NEW_LINE>if (orgBPartner != null) {<NEW_LINE>final AdImageId orgBPartnerLogoId = AdImageId.ofRepoIdOrNull(orgBPartner.getLogo_ID());<NEW_LINE>if (orgBPartnerLogoId != null) {<NEW_LINE>return orgBPartnerLogoId;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Get Org Logo<NEW_LINE>final OrgInfo orgInfo = orgsRepo.getOrgInfoById(adOrgId);<NEW_LINE>final AdImageId logoImageId = orgInfo.getImagesMap().<MASK><NEW_LINE>if (logoImageId != null) {<NEW_LINE>return logoImageId;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Get Tenant level Logo<NEW_LINE>final ClientId adClientId = orgInfo.getClientId();<NEW_LINE>final I_AD_ClientInfo clientInfo = clientsRepo.retrieveClientInfo(ctx, adClientId.getRepoId());<NEW_LINE>AdImageId clientLogoId = AdImageId.ofRepoIdOrNull(clientInfo.getLogoReport_ID());<NEW_LINE>if (clientLogoId == null) {<NEW_LINE>clientLogoId = AdImageId.ofRepoIdOrNull(clientInfo.getLogo_ID());<NEW_LINE>}<NEW_LINE>return clientLogoId;<NEW_LINE>}
getLogoId().orElse(null);