idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
978,045
public StartMedicalTranscriptionJobResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StartMedicalTranscriptionJobResult startMedicalTranscriptionJobResult = new StartMedicalTranscriptionJobResult();<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 startMedicalTranscriptionJobResult;<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("MedicalTranscriptionJob", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startMedicalTranscriptionJobResult.setMedicalTranscriptionJob(MedicalTranscriptionJobJsonUnmarshaller.getInstance<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 startMedicalTranscriptionJobResult;<NEW_LINE>}
().unmarshall(context));
1,272,679
public Node call() {<NEW_LINE>Node node = null;<NEW_LINE>Map<String, Object> params = new HashMap<>();<NEW_LINE>String cypher = buildCypher(entry.getKey().getUri(), entry.getKey().getGraphUri(), params);<NEW_LINE>Result result = txInThread.execute(cypher, params);<NEW_LINE>if (result.hasNext()) {<NEW_LINE>node = (Node) result.next().get("n");<NEW_LINE>if (result.hasNext()) {<NEW_LINE>String props = "{uri: " + entry.getKey().getUri() + (entry.getKey().getGraphUri() == null ? "}" : ", graphUri: " + entry.getKey().getGraphUri() + "}");<NEW_LINE>throw new IllegalStateException("There are multiple matching nodes for the given properties " + props);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (node == null) {<NEW_LINE><MASK><NEW_LINE>node.setProperty("uri", entry.getKey().getUri());<NEW_LINE>if (entry.getKey().getGraphUri() != null) {<NEW_LINE>node.setProperty("graphUri", entry.getKey().getGraphUri());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return node;<NEW_LINE>}
node = txInThread.createNode(RESOURCE);
857,735
public Thumb[] scrapeExtraFanart() {<NEW_LINE>String urlOfCurrentPage = document.location();<NEW_LINE>if (urlOfCurrentPage != null && urlOfCurrentPage.contains("moviepages")) {<NEW_LINE>urlOfCurrentPage = urlOfCurrentPage.replaceFirst(Pattern.quote("http://en.caribbeancompr.com/eng/moviepages/"), "");<NEW_LINE>String movieID = urlOfCurrentPage.replaceFirst(Pattern<MASK><NEW_LINE>if (urlOfCurrentPage.length() > 1) {<NEW_LINE>Thumb[] extraFanartThumbs = new Thumb[3];<NEW_LINE>for (int i = 1; i < 4; i++) {<NEW_LINE>String extraThumbURL = "http://en.caribbeancompr.com/moviepages/" + movieID + "/images/l/00" + i + ".jpg";<NEW_LINE>try {<NEW_LINE>Thumb extraFanartThumb = new Thumb(extraThumbURL);<NEW_LINE>extraFanartThumbs[i - 1] = extraFanartThumb;<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return new Thumb[0];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return extraFanartThumbs;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Thumb[0];<NEW_LINE>}
.quote("/index.html"), "");
1,564,312
void addGroup(RelationshipGroupRecord groupRecord, StripedLatches latches) {<NEW_LINE>// One long for the type + "has external degrees" bits<NEW_LINE>// One long for the next pointer<NEW_LINE>// One long for the groupId<NEW_LINE>// N longs for the count slots<NEW_LINE>int slotsForCounts = slotsForDegrees(groupRecord);<NEW_LINE>long groupIndex = nextGroupLocation.getAndAdd(NUM_GROUP_DATA_FIELDS + slotsForCounts);<NEW_LINE>groupCache.set(groupIndex, buildGroup(groupRecord));<NEW_LINE>groupCache.set(groupIndex + 2, groupRecord.getId());<NEW_LINE>long owningNode = groupRecord.getOwningNode();<NEW_LINE>long existingGroupIndex;<NEW_LINE>try (LatchResource latch = latches.acquire(owningNode)) {<NEW_LINE>existingGroupIndex = nodeCache.get(owningNode);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>groupCache.set(groupIndex + 1, existingGroupIndex);<NEW_LINE>}
nodeCache.set(owningNode, groupIndex);
1,163,470
private void emitLiteralEnum(TsEnumModel enumModel, boolean exportKeyword, boolean declareKeyword) {<NEW_LINE>writeNewLine();<NEW_LINE>emitComments(enumModel.getComments());<NEW_LINE>final <MASK><NEW_LINE>final String constText = enumModel.isNonConstEnum() ? "" : "const ";<NEW_LINE>writeIndentedLine(exportKeyword, declareText + constText + "enum " + enumModel.getName().getSimpleName() + " {");<NEW_LINE>indent++;<NEW_LINE>for (EnumMemberModel member : enumModel.getMembers()) {<NEW_LINE>emitComments(member.getComments());<NEW_LINE>final Object value = member.getEnumValue();<NEW_LINE>final String initializer = value != null ? " = " + (value instanceof String ? quote((String) value, settings) : String.valueOf(value)) : "";<NEW_LINE>writeIndentedLine(member.getPropertyName() + initializer + ",");<NEW_LINE>}<NEW_LINE>indent--;<NEW_LINE>writeIndentedLine("}");<NEW_LINE>}
String declareText = declareKeyword ? "declare " : "";
1,234,106
public static String upload(final String string) throws IOException {<NEW_LINE>final URL url = new URL(BIN_URL);<NEW_LINE>final HttpURLConnection connection = <MASK><NEW_LINE>connection.setRequestMethod("POST");<NEW_LINE>connection.setRequestProperty("User-Agent", USER_AGENT);<NEW_LINE>connection.setDoOutput(true);<NEW_LINE>try (DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream())) {<NEW_LINE>outputStream.write(string.getBytes());<NEW_LINE>outputStream.flush();<NEW_LINE>}<NEW_LINE>StringBuilder response;<NEW_LINE>try (BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {<NEW_LINE>response = new StringBuilder();<NEW_LINE>String inputLine;<NEW_LINE>while ((inputLine = in.readLine()) != null) {<NEW_LINE>response.append(inputLine);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Matcher matcher = PATTERN.matcher(response.toString());<NEW_LINE>if (matcher.matches()) {<NEW_LINE>return "https://hastebin.com/" + matcher.group(1);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Couldn't read response!");<NEW_LINE>}<NEW_LINE>}
(HttpURLConnection) url.openConnection();
20,468
protected void onBeforeArrayLoad(int opcode) {<NEW_LINE>Type arrtype = TypeUtils.getArrayType(opcode);<NEW_LINE>Type <MASK><NEW_LINE>if (locationTypeMismatch(loc, arrtype, retType))<NEW_LINE>return;<NEW_LINE>addExtraTypeInfo(om.getSelfParameter(), Type.getObjectType(className));<NEW_LINE>addExtraTypeInfo(om.getTargetInstanceParameter(), arrtype);<NEW_LINE>if (where == Where.AFTER) {<NEW_LINE>addExtraTypeInfo(om.getReturnParameter(), retType);<NEW_LINE>}<NEW_LINE>ValidationResult vr = validateArguments(om, actionArgTypes, new Type[] { Type.INT_TYPE });<NEW_LINE>if (vr.isValid()) {<NEW_LINE>if (!vr.isAny()) {<NEW_LINE>asm.dup2();<NEW_LINE>argsIndex[INDEX_PTR] = storeAsNew();<NEW_LINE>argsIndex[INSTANCE_PTR] = storeAsNew();<NEW_LINE>}<NEW_LINE>Label l = levelCheckBefore(om, bcn.getClassName(true));<NEW_LINE>if (where == Where.BEFORE) {<NEW_LINE>loadArguments(localVarArg(vr.getArgIdx(INDEX_PTR), Type.INT_TYPE, argsIndex[INDEX_PTR]), localVarArg(om.getTargetInstanceParameter(), Constants.OBJECT_TYPE, argsIndex[INSTANCE_PTR]), constArg(om.getClassNameParameter(), className.replace('/', '.')), constArg(om.getMethodParameter(), getName(om.isMethodFqn())), selfArg(om.getSelfParameter(), Type.getObjectType(className)));<NEW_LINE>invokeBTraceAction(asm, om);<NEW_LINE>}<NEW_LINE>if (l != null) {<NEW_LINE>mv.visitLabel(l);<NEW_LINE>insertFrameSameStack(l);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
retType = TypeUtils.getElementType(opcode);
1,786,565
public void call(SourceUnit source, GeneratorContext context, ClassNode classNode) throws CompilationFailedException {<NEW_LINE><MASK><NEW_LINE>List<ClassNode> classNodes = source.getAST().getClasses();<NEW_LINE>ClassNode mainClassNode = MainClass.get(classNodes);<NEW_LINE>// Additional auto configuration<NEW_LINE>for (CompilerAutoConfiguration autoConfiguration : GroovyCompiler.this.compilerAutoConfigurations) {<NEW_LINE>if (classNodes.stream().anyMatch(autoConfiguration::matches)) {<NEW_LINE>if (GroovyCompiler.this.configuration.isGuessImports()) {<NEW_LINE>autoConfiguration.applyImports(importCustomizer);<NEW_LINE>importCustomizer.call(source, context, classNode);<NEW_LINE>}<NEW_LINE>if (classNode.equals(mainClassNode)) {<NEW_LINE>autoConfiguration.applyToMainClass(GroovyCompiler.this.loader, GroovyCompiler.this.configuration, context, source, classNode);<NEW_LINE>}<NEW_LINE>autoConfiguration.apply(GroovyCompiler.this.loader, GroovyCompiler.this.configuration, context, source, classNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>importCustomizer.call(source, context, classNode);<NEW_LINE>}
ImportCustomizer importCustomizer = new SmartImportCustomizer(source);
906,473
public void write(JmeExporter ex) throws IOException {<NEW_LINE>OutputCapsule capsule = ex.getCapsule(this);<NEW_LINE>capsule.write(wheelSpatial, "wheelSpatial", null);<NEW_LINE>capsule.write(frontWheel, "frontWheel", false);<NEW_LINE>capsule.write(location, "wheelLocation", new Vector3f());<NEW_LINE>capsule.write(direction<MASK><NEW_LINE>capsule.write(axle, "wheelAxle", new Vector3f());<NEW_LINE>capsule.write(suspensionStiffness, "suspensionStiffness", 20.0f);<NEW_LINE>capsule.write(wheelsDampingRelaxation, "wheelsDampingRelaxation", 2.3f);<NEW_LINE>capsule.write(wheelsDampingCompression, "wheelsDampingCompression", 4.4f);<NEW_LINE>capsule.write(frictionSlip, "frictionSlip", 10.5f);<NEW_LINE>capsule.write(rollInfluence, "rollInfluence", 1.0f);<NEW_LINE>capsule.write(maxSuspensionTravelCm, "maxSuspensionTravelCm", 500f);<NEW_LINE>capsule.write(maxSuspensionForce, "maxSuspensionForce", 6000f);<NEW_LINE>capsule.write(radius, "wheelRadius", 0.5f);<NEW_LINE>capsule.write(restLength, "restLength", 1f);<NEW_LINE>}
, "wheelDirection", new Vector3f());
165,540
private void ensureLayout(@Nonnull EditorView view, BidiRun run, int line) {<NEW_LINE>if (isReal()) {<NEW_LINE>view.getTextLayoutCache().onChunkAccess(this);<NEW_LINE>}<NEW_LINE>if (fragments != null)<NEW_LINE>return;<NEW_LINE>assert isReal();<NEW_LINE><MASK><NEW_LINE>int lineStartOffset = view.getEditor().getDocument().getLineStartOffset(line);<NEW_LINE>int start = lineStartOffset + startOffset;<NEW_LINE>int end = lineStartOffset + endOffset;<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("Text layout for " + view.getEditor().getVirtualFile() + " (" + start + "-" + end + ")");<NEW_LINE>IterationState it = new IterationState(view.getEditor(), start, end, null, false, true, false, false);<NEW_LINE>FontFallbackIterator ffi = new FontFallbackIterator().setPreferredFonts(view.getEditor().getColorsScheme().getFontPreferences()).setFontRenderContext(view.getFontRenderContext());<NEW_LINE>char[] chars = CharArrayUtil.fromSequence(view.getEditor().getDocument().getImmutableCharSequence(), start, end);<NEW_LINE>int currentFontType = 0;<NEW_LINE>ColorValue currentColor = null;<NEW_LINE>int currentStart = start;<NEW_LINE>while (!it.atEnd()) {<NEW_LINE>int fontType = it.getMergedAttributes().getFontType();<NEW_LINE>ColorValue color = it.getMergedAttributes().getForegroundColor();<NEW_LINE>if (fontType != currentFontType || !color.equals(currentColor)) {<NEW_LINE>int tokenStart = it.getStartOffset();<NEW_LINE>if (tokenStart > currentStart) {<NEW_LINE>addFragments(run, this, chars, currentStart - start, tokenStart - start, view.getTabFragment(), ffi);<NEW_LINE>}<NEW_LINE>currentStart = tokenStart;<NEW_LINE>currentColor = color;<NEW_LINE>ffi.setFontStyle(currentFontType = fontType);<NEW_LINE>}<NEW_LINE>it.advance();<NEW_LINE>}<NEW_LINE>if (end > currentStart) {<NEW_LINE>addFragments(run, this, chars, currentStart - start, end - start, view.getTabFragment(), ffi);<NEW_LINE>}<NEW_LINE>view.getSizeManager().textLayoutPerformed(start, end);<NEW_LINE>assert !fragments.isEmpty();<NEW_LINE>}
fragments = new ArrayList<>();
1,275,095
public FeedOperation read() throws Exception {<NEW_LINE>int read = readExact(in, prefix);<NEW_LINE>if (read != prefix.length) {<NEW_LINE>return FeedOperation.INVALID;<NEW_LINE>}<NEW_LINE>ByteBuffer header = ByteBuffer.wrap(prefix);<NEW_LINE>int sz = header.getInt();<NEW_LINE>int type = header.getInt();<NEW_LINE>long hash = header.getLong();<NEW_LINE>byte[] blob = new byte[sz];<NEW_LINE>read = readExact(in, blob);<NEW_LINE>if (read != blob.length) {<NEW_LINE>throw new IllegalArgumentException("Underflow, failed reading " + blob.length + "bytes. Got " + read);<NEW_LINE>}<NEW_LINE>long computedHash = VespaV1Destination.hash(blob, blob.length);<NEW_LINE>if (computedHash != hash) {<NEW_LINE>throw new IllegalArgumentException(<MASK><NEW_LINE>}<NEW_LINE>GrowableByteBuffer buf = GrowableByteBuffer.wrap(blob);<NEW_LINE>String condition = buf.getUtf8String();<NEW_LINE>DocumentDeserializer deser = DocumentDeserializerFactory.createHead(mgr, buf);<NEW_LINE>TestAndSetCondition testAndSetCondition = condition.isEmpty() ? TestAndSetCondition.NOT_PRESENT_CONDITION : new TestAndSetCondition(condition);<NEW_LINE>if (type == DOCUMENT) {<NEW_LINE>return new LazyDocumentOperation(deser, testAndSetCondition);<NEW_LINE>} else if (type == UPDATE) {<NEW_LINE>return new LazyUpdateOperation(deser, testAndSetCondition);<NEW_LINE>} else if (type == REMOVE) {<NEW_LINE>return new RemoveFeedOperation(new DocumentId(deser), testAndSetCondition);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown operation " + type);<NEW_LINE>}<NEW_LINE>}
"Hash mismatch, expected " + hash + ", got " + computedHash);
1,558,075
public com.amazonaws.services.simpleworkflow.model.WorkflowExecutionAlreadyStartedException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.simpleworkflow.model.WorkflowExecutionAlreadyStartedException workflowExecutionAlreadyStartedException = new com.amazonaws.services.simpleworkflow.model.WorkflowExecutionAlreadyStartedException(null);<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>} 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 workflowExecutionAlreadyStartedException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,333,000
protected CommonAppListFilterViewModel.ListModelLoader onCreateListModelLoader() {<NEW_LINE>return index -> {<NEW_LINE>ThanosManager thanos = ThanosManager.from(getApplicationContext());<NEW_LINE>if (!thanos.isServiceInstalled()) {<NEW_LINE>return Lists.newArrayListWithCapacity(0);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>List<PackageSet> packageSets = pm.getAllPackageSets(true);<NEW_LINE>List<AppListModel> res = new ArrayList<>();<NEW_LINE>String prebuiltBadgeStr = getString(R.string.title_package_prebuilt_set);<NEW_LINE>CollectionUtils.consumeRemaining(packageSets, packageSet -> {<NEW_LINE>AppInfo appInfo = new AppInfo();<NEW_LINE>appInfo.setPkgName(packageSet.getId());<NEW_LINE>appInfo.setObj(packageSet.getId());<NEW_LINE>appInfo.setIconDrawable(R.drawable.module_common_ic_nothing);<NEW_LINE>appInfo.setAppLabel(packageSet.getLabel());<NEW_LINE>appInfo.setArg3(packageSet.getCreateAt());<NEW_LINE>appInfo.setSelected(packageSet.isPrebuilt());<NEW_LINE>int count = packageSet.getPackageCount();<NEW_LINE>appInfo.setArg1(count);<NEW_LINE>res.add(new AppListModel(appInfo, packageSet.isPrebuilt() ? prebuiltBadgeStr : null, null, getString(R.string.title_package_count_set, String.valueOf(count))));<NEW_LINE>});<NEW_LINE>// Sort by time.<NEW_LINE>res.sort((o1, o2) -> -Long.compare(o1.appInfo.getArg3(), o2.appInfo.getArg3()));<NEW_LINE>return res;<NEW_LINE>};<NEW_LINE>}
PackageManager pm = thanos.getPkgManager();
893,885
public static ListenableFuture<?> toWhenHasSplitQueueSpaceFuture(Set<InternalNode> blockedNodes, List<RemoteTask> existingTasks, long weightSpaceThreshold) {<NEW_LINE>if (blockedNodes.isEmpty()) {<NEW_LINE>return immediateFuture(null);<NEW_LINE>}<NEW_LINE>Map<String, RemoteTask> nodeToTaskMap = new HashMap<>();<NEW_LINE>for (RemoteTask task : existingTasks) {<NEW_LINE>nodeToTaskMap.put(task.getNodeId(), task);<NEW_LINE>}<NEW_LINE>List<ListenableFuture<?>> blockedFutures = blockedNodes.stream().map(InternalNode::getNodeIdentifier).map(nodeToTaskMap::get).filter(Objects::nonNull).map(remoteTask -> remoteTask.whenSplitQueueHasSpace(weightSpaceThreshold)<MASK><NEW_LINE>if (blockedFutures.isEmpty()) {<NEW_LINE>return immediateFuture(null);<NEW_LINE>}<NEW_LINE>return whenAnyCompleteCancelOthers(blockedFutures);<NEW_LINE>}
).collect(toImmutableList());
1,370,496
public static PendingMessages parse(List<?> xpendingOutput) {<NEW_LINE>LettuceAssert.notNull(xpendingOutput, "XPENDING output must not be null");<NEW_LINE>LettuceAssert.isTrue(xpendingOutput.size() == 4, "XPENDING output must have exactly four output elements");<NEW_LINE>Long count = (Long) xpendingOutput.get(0);<NEW_LINE>String from = (String) xpendingOutput.get(1);<NEW_LINE>String to = (String) xpendingOutput.get(2);<NEW_LINE>Range<String> messageIdRange = Range.create(from, to);<NEW_LINE>Collection<Object> consumerMessageCounts = (Collection) xpendingOutput.get(3);<NEW_LINE>Map<String, Long> counts = new LinkedHashMap<>();<NEW_LINE>for (Object element : consumerMessageCounts) {<NEW_LINE>LettuceAssert.isTrue(element instanceof List, "Consumer message counts must be a List");<NEW_LINE>List<Object> messageCount = (List) element;<NEW_LINE>counts.put((String) messageCount.get(0), (Long) messageCount.get(1));<NEW_LINE>}<NEW_LINE>return new PendingMessages(count, messageIdRange<MASK><NEW_LINE>}
, Collections.unmodifiableMap(counts));
180,859
public synchronized void mute(TrackType muteType) {<NEW_LINE>MediaElement sink = passThru;<NEW_LINE>if (!elements.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>if (!elements.containsKey(sinkId)) {<NEW_LINE>throw new OpenViduException(Code.MEDIA_ENDPOINT_ERROR_CODE, "This endpoint (" + getEndpointName() + ") has no media element with id " + sinkId + " (should've been connected to the internal ep)");<NEW_LINE>}<NEW_LINE>sink = elements.get(sinkId);<NEW_LINE>} else {<NEW_LINE>log.debug("Will mute connection of WebRTC and PassThrough (no other elems)");<NEW_LINE>}<NEW_LINE>switch(muteType) {<NEW_LINE>case ALL:<NEW_LINE>internalSinkDisconnect(this.getEndpoint(), sink, false);<NEW_LINE>break;<NEW_LINE>case AUDIO:<NEW_LINE>internalSinkDisconnect(this.getEndpoint(), sink, MediaType.AUDIO, false);<NEW_LINE>break;<NEW_LINE>case VIDEO:<NEW_LINE>internalSinkDisconnect(this.getEndpoint(), sink, MediaType.VIDEO, false);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
String sinkId = elementIds.peekLast();
1,419,831
ASTNode clone0(AST target) {<NEW_LINE>SingleVariableDeclaration result = new SingleVariableDeclaration(target);<NEW_LINE>result.setSourceRange(<MASK><NEW_LINE>if (this.ast.apiLevel == AST.JLS2_INTERNAL) {<NEW_LINE>result.setModifiers(getModifiers());<NEW_LINE>} else {<NEW_LINE>result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers()));<NEW_LINE>result.setVarargs(isVarargs());<NEW_LINE>}<NEW_LINE>result.setType((Type) getType().clone(target));<NEW_LINE>if (this.ast.apiLevel >= AST.JLS8_INTERNAL) {<NEW_LINE>result.varargsAnnotations().addAll(ASTNode.copySubtrees(target, varargsAnnotations()));<NEW_LINE>}<NEW_LINE>result.setName((SimpleName) getName().clone(target));<NEW_LINE>if (this.ast.apiLevel >= AST.JLS8_INTERNAL) {<NEW_LINE>result.extraDimensions().addAll(ASTNode.copySubtrees(target, this.extraDimensions()));<NEW_LINE>} else {<NEW_LINE>result.internalSetExtraDimensions(getExtraDimensions());<NEW_LINE>}<NEW_LINE>result.setInitializer((Expression) ASTNode.copySubtree(target, getInitializer()));<NEW_LINE>return result;<NEW_LINE>}
getStartPosition(), getLength());
958,592
protected void handleAddSubscriptionToTxn(CommandAddSubscriptionToTxn command) {<NEW_LINE>final TxnID txnID = new TxnID(command.getTxnidMostBits(), command.getTxnidLeastBits());<NEW_LINE>final long requestId = command.getRequestId();<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Receive add published partition to txn request {} from {} with txnId {}", requestId, remoteAddress, txnID);<NEW_LINE>}<NEW_LINE>final TransactionCoordinatorID tcId = TransactionCoordinatorID.get(command.getTxnidMostBits());<NEW_LINE>if (!checkTransactionEnableAndSendError(requestId)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TransactionMetadataStoreService transactionMetadataStoreService = service<MASK><NEW_LINE>transactionMetadataStoreService.addAckedPartitionToTxn(txnID, MLTransactionMetadataStore.subscriptionToTxnSubscription(command.getSubscriptionsList())).whenComplete(((v, ex) -> {<NEW_LINE>if (ex == null) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Send response success for add published partition to txn request {}", requestId);<NEW_LINE>}<NEW_LINE>ctx.writeAndFlush(Commands.newAddSubscriptionToTxnResponse(requestId, txnID.getLeastSigBits(), txnID.getMostSigBits()));<NEW_LINE>} else {<NEW_LINE>ex = handleTxnException(ex, BaseCommand.Type.ADD_SUBSCRIPTION_TO_TXN.name(), requestId);<NEW_LINE>ctx.writeAndFlush(Commands.newAddSubscriptionToTxnResponse(requestId, txnID.getMostSigBits(), BrokerServiceException.getClientErrorCode(ex), ex.getMessage()));<NEW_LINE>transactionMetadataStoreService.handleOpFail(ex, tcId);<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>}
.pulsar().getTransactionMetadataStoreService();
842,092
final AssociateSoftwareTokenResult executeAssociateSoftwareToken(AssociateSoftwareTokenRequest associateSoftwareTokenRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateSoftwareTokenRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateSoftwareTokenRequest> request = null;<NEW_LINE>Response<AssociateSoftwareTokenResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateSoftwareTokenRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(associateSoftwareTokenRequest));<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<AssociateSoftwareTokenResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssociateSoftwareTokenResultJsonUnmarshaller());<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, "AssociateSoftwareToken");
1,555,085
public DataMatchResult verify(QueryObjectBundle control, QueryObjectBundle test, Optional<QueryResult<Void>> controlQueryResult, Optional<QueryResult<Void>> testQueryResult, ChecksumQueryContext controlChecksumQueryContext, ChecksumQueryContext testChecksumQueryContext) {<NEW_LINE>List<Column> controlColumns = getColumns(getHelperAction(), typeManager, control.getObjectName());<NEW_LINE>List<Column> testColumns = getColumns(getHelperAction(), typeManager, test.getObjectName());<NEW_LINE>Query controlChecksumQuery = checksumValidator.generateChecksumQuery(control.getObjectName(), controlColumns);<NEW_LINE>Query testChecksumQuery = checksumValidator.generateChecksumQuery(test.getObjectName(), testColumns);<NEW_LINE>controlChecksumQueryContext.setChecksumQuery(formatSql(controlChecksumQuery));<NEW_LINE>testChecksumQueryContext.setChecksumQuery(formatSql(testChecksumQuery));<NEW_LINE>QueryResult<ChecksumResult> controlChecksum = callAndConsume(() -> getHelperAction().execute(controlChecksumQuery, CONTROL_CHECKSUM, ChecksumResult::fromResultSet), stats -> stats.getQueryStats().map(QueryStats::getQueryId)<MASK><NEW_LINE>QueryResult<ChecksumResult> testChecksum = callAndConsume(() -> getHelperAction().execute(testChecksumQuery, TEST_CHECKSUM, ChecksumResult::fromResultSet), stats -> stats.getQueryStats().map(QueryStats::getQueryId).ifPresent(testChecksumQueryContext::setChecksumQueryId));<NEW_LINE>return match(checksumValidator, controlColumns, testColumns, getOnlyElement(controlChecksum.getResults()), getOnlyElement(testChecksum.getResults()));<NEW_LINE>}
.ifPresent(controlChecksumQueryContext::setChecksumQueryId));
1,209,817
public void transfer() throws Exception {<NEW_LINE>cursor = srcDB.openCursor(null, null);<NEW_LINE>DatabaseEntry keyEntry = new DatabaseEntry();<NEW_LINE>DatabaseEntry valueEntry = new DatabaseEntry();<NEW_LINE>VersionedSerializer<byte[]> versionedSerializer = new VersionedSerializer<byte[]>(new IdentitySerializer());<NEW_LINE>List<Versioned<byte[]>> vals;<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>int scanCount = 0;<NEW_LINE>int keyCount = 0;<NEW_LINE>while (cursor.getNext(keyEntry, valueEntry, LockMode.READ_UNCOMMITTED) == OperationStatus.SUCCESS) {<NEW_LINE>keyCount++;<NEW_LINE>vals = StoreBinaryFormat.fromByteArray(valueEntry.getData());<NEW_LINE>for (Versioned<byte[]> val : vals) {<NEW_LINE>OperationStatus putStatus = dstDB.put(null, keyEntry, new DatabaseEntry(versionedSerializer.toBytes(val)));<NEW_LINE>if (OperationStatus.SUCCESS != putStatus) {<NEW_LINE>String errorStr = "Put failed with " + putStatus + " for key" + BdbConvertData.writeAsciiString(keyEntry.getData());<NEW_LINE>logger.error(errorStr);<NEW_LINE>throw new Exception(errorStr);<NEW_LINE>}<NEW_LINE>scanCount++;<NEW_LINE>}<NEW_LINE>if (scanCount % 1000000 == 0)<NEW_LINE>logger.info("Reverted " + scanCount + " entries in " + (System.currentTimeMillis() - startTime) / 1000 + " secs");<NEW_LINE>}<NEW_LINE>logger.info("Reverted " + scanCount + " entries and " + keyCount + " keys in " + (System.currentTimeMillis() <MASK><NEW_LINE>}
- startTime) / 1000 + " secs");
151,779
ActionResult<Wo> execute(String id, String path0, JsonElement jsonElement) throws Exception {<NEW_LINE>Callable<ActionResult<Wo>> callable = new Callable<ActionResult<Wo>>() {<NEW_LINE><NEW_LINE>public ActionResult<Wo> call() throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>ApplicationDict dict = emc.find(id, ApplicationDict.class);<NEW_LINE>if (null == dict) {<NEW_LINE>throw new ExceptionEntityNotExist(id, ApplicationDict.class);<NEW_LINE>}<NEW_LINE>update(business, dict, jsonElement, path0);<NEW_LINE>emc.commit();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.<MASK><NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return ProcessPlatformExecutorFactory.get(id).submit(callable).get(300, TimeUnit.SECONDS);<NEW_LINE>}
setId(dict.getId());
1,753,781
Object doCached(PolyglotLanguageContext languageContext, Object receiver, Object[] args, @CachedLibrary("receiver") InteropLibrary iterators, @Cached PolyglotToHostNode toHost, @Cached BranchProfile error, @Cached BranchProfile stop) {<NEW_LINE>TriState lastHasNext = (TriState) args[ARGUMENT_OFFSET];<NEW_LINE>try {<NEW_LINE>Object next = iterators.getIteratorNextElement(receiver);<NEW_LINE>if (lastHasNext == TriState.FALSE) {<NEW_LINE>error.enter();<NEW_LINE>throw PolyglotInteropErrors.iteratorConcurrentlyModified(languageContext, receiver, cache.valueType);<NEW_LINE>}<NEW_LINE>return toHost.execute(languageContext, next, <MASK><NEW_LINE>} catch (StopIterationException e) {<NEW_LINE>stop.enter();<NEW_LINE>if (lastHasNext == TriState.TRUE) {<NEW_LINE>throw PolyglotInteropErrors.iteratorConcurrentlyModified(languageContext, receiver, cache.valueType);<NEW_LINE>} else {<NEW_LINE>throw PolyglotInteropErrors.stopIteration(languageContext, receiver, cache.valueType);<NEW_LINE>}<NEW_LINE>} catch (UnsupportedMessageException e) {<NEW_LINE>error.enter();<NEW_LINE>throw PolyglotInteropErrors.iteratorElementUnreadable(languageContext, receiver, cache.valueType);<NEW_LINE>}<NEW_LINE>}
cache.valueClass, cache.valueType);
316,214
private Intent createOpenFileIntent(OCFile file) {<NEW_LINE>String storagePath = file.getStoragePath();<NEW_LINE>Uri fileUri = getFileUri(file, MainApp.getAppContext().getResources().getStringArray(R.array.ms_office_extensions));<NEW_LINE>Intent openFileWithIntent = null;<NEW_LINE>int lastIndexOfDot = storagePath.lastIndexOf('.');<NEW_LINE>if (lastIndexOfDot >= 0) {<NEW_LINE>String fileExt = storagePath.substring(lastIndexOfDot + 1);<NEW_LINE>String guessedMimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExt);<NEW_LINE>if (guessedMimeType != null) {<NEW_LINE>openFileWithIntent <MASK><NEW_LINE>openFileWithIntent.setDataAndType(fileUri, guessedMimeType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (openFileWithIntent == null) {<NEW_LINE>openFileWithIntent = createIntentFromFile(storagePath);<NEW_LINE>}<NEW_LINE>if (openFileWithIntent == null) {<NEW_LINE>openFileWithIntent = new Intent(Intent.ACTION_VIEW);<NEW_LINE>openFileWithIntent.setDataAndType(fileUri, file.getMimeType());<NEW_LINE>}<NEW_LINE>openFileWithIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);<NEW_LINE>return openFileWithIntent;<NEW_LINE>}
= new Intent(Intent.ACTION_VIEW);
1,300,311
public void finishMessageSending() {<NEW_LINE>for (int i = 0; i < fragNum; ++i) {<NEW_LINE>long bytesWriten = cacheOut[i].bytesWriten();<NEW_LINE>cacheOut[i].finishSetting();<NEW_LINE>cacheOut[i].writeLong(0, bytesWriten - SIZE_OF_LONG);<NEW_LINE>if (bytesWriten == SIZE_OF_LONG) {<NEW_LINE>logger.debug(<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (i == fragId) {<NEW_LINE>nextIncomingMessageStore.digest(cacheOut[i].getVector());<NEW_LINE>logger.info("In final step, Frag [{}] digest msg to self of size: {}", fragId, bytesWriten);<NEW_LINE>} else {<NEW_LINE>grapeMessager.sendToFragment(i, cacheOut[i].getVector());<NEW_LINE>logger.info("In final step, Frag [{}] send msg to [{}] of size: {}", fragId, i, bytesWriten);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if (maxSuperStep > 0) {<NEW_LINE>// grapeMessager.ForceContinue();<NEW_LINE>// maxSuperStep -= 1;<NEW_LINE>// }<NEW_LINE>// logger.debug("[Unused res] {}", unused);<NEW_LINE>// logger.debug("adaptor hasNext {}, grape hasNext{}", adaptorHasNext, grapeHasNext);<NEW_LINE>// logger.debug("adaptor next {}, grape next {}", adaptorNext, grapeNext);<NEW_LINE>// logger.debug("adaptor neighbor {}, grape neighbor {}", adaptorNeighbor,<NEW_LINE>// grapeNeighbor);<NEW_LINE>}
"[Finish msg] sending skip msg from {} -> {}, since msg size: {}", fragId, i, bytesWriten);
1,848,533
public Executor createExecutor(ExecutionContext context, int index) {<NEW_LINE>Executor ret;<NEW_LINE>RelCollation collation = sourceNode.getRelCollation();<NEW_LINE>if (mergeSort) {<NEW_LINE>List<RelFieldCollation> sortList = collation.getFieldCollations();<NEW_LINE>List<OrderByOption> orderBys = ExecUtils.convertFrom(sortList);<NEW_LINE>ret = new SortMergeExchangeExec(context, sourceNode.getRelatedId(), supplier, pagesSerdeFactory.createPagesSerde(types), orderBys, types);<NEW_LINE>} else {<NEW_LINE>if (exchangeClient == null) {<NEW_LINE>memoryPool = MemoryPoolUtils.createOperatorTmpTablePool("Exchange@" + System.identityHashCode(this), context.getMemoryPool());<NEW_LINE>exchangeClient = supplier.get(new RecordMemSystemListener(memoryPool.getMemoryAllocatorCtx()), context);<NEW_LINE>}<NEW_LINE>ret = new ExchangeExec(context, sourceNode.getRelatedId(), exchangeClient, memoryPool, pagesSerdeFactory.createPagesSerde(types), types);<NEW_LINE>}<NEW_LINE>ret.setId(sourceNode.getRelatedId());<NEW_LINE>if (context.getRuntimeStatistics() != null) {<NEW_LINE>RuntimeStatHelper.<MASK><NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
registerStatForExec(sourceNode, ret, context);
898,256
public int compare(CtElement o1, CtElement o2) {<NEW_LINE>if (!o1.getPosition().isValidPosition() && !o2.getPosition().isValidPosition()) {<NEW_LINE>return o1.equals(o2) ? 0 : ((o1.hashCode() < o2.hashCode()) ? -1 : 1);<NEW_LINE>}<NEW_LINE>if (!o1.getPosition().isValidPosition()) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>if (!o2.getPosition().isValidPosition()) {<NEW_LINE>// ensures that compare(x,y) = - compare(y,x)<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>int pos1 = o1.getPosition().getSourceStart();<NEW_LINE>int pos2 = o2.getPosition().getSourceStart();<NEW_LINE>if (pos1 == pos2) {<NEW_LINE>int pos3 = o1.getPosition().getSourceEnd();<NEW_LINE>int pos4 = o2.getPosition().getSourceEnd();<NEW_LINE>if (pos3 == pos4) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>return (pos3 < pos4) ? -1 : 1;<NEW_LINE>}<NEW_LINE>return (pos1 <MASK><NEW_LINE>}
< pos2) ? -1 : 1;
507,167
// Private methods ---------------------------------------------------------<NEW_LINE>private static boolean doOpen(FileObject fo, int offset, String search) {<NEW_LINE>try {<NEW_LINE>DataObject od = DataObject.find(fo);<NEW_LINE>EditorCookie ec = od.getCookie(EditorCookie.class);<NEW_LINE>LineCookie lc = od.getCookie(LineCookie.class);<NEW_LINE>// If the caller hasn't specified an offset, and the document is<NEW_LINE>// already open, don't jump to a particular line!<NEW_LINE>if (ec != null && offset == -1 && ec.getDocument() != null && search == null) {<NEW_LINE>ec.open();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Simple text search if no known offset (e.g. broken/unparseable source)<NEW_LINE>if ((search != null) && (offset == -1)) {<NEW_LINE>StyledDocument doc = NbDocument.getDocument(od);<NEW_LINE>try {<NEW_LINE>String text = doc.getText(0, doc.getLength());<NEW_LINE>int caretDelta = search.indexOf('^');<NEW_LINE>if (caretDelta != -1) {<NEW_LINE>search = search.substring(0, caretDelta) + search.substring(caretDelta + 1);<NEW_LINE>} else {<NEW_LINE>caretDelta = 0;<NEW_LINE>}<NEW_LINE>offset = text.indexOf(search);<NEW_LINE>if (offset != -1) {<NEW_LINE>offset += caretDelta;<NEW_LINE>}<NEW_LINE>} catch (BadLocationException ble) {<NEW_LINE>LOG.log(Level.WARNING, null, ble);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return NbDocument.openDocument(od, offset, Line.ShowOpenType.OPEN, Line.ShowVisibilityType.FOCUS);<NEW_LINE>} catch (IOException e) {<NEW_LINE>ErrorManager.getDefault().<MASK><NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
notify(ErrorManager.INFORMATIONAL, e);
1,087,337
// Waits until the cluster is available<NEW_LINE>public static void waitForClusterReady(RedshiftClient redshiftClient, String clusterId) {<NEW_LINE>Boolean clusterReady = false;<NEW_LINE>String clusterReadyStr = "";<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>DescribeClustersRequest clustersRequest = DescribeClustersRequest.builder().clusterIdentifier(clusterId).build();<NEW_LINE>// Loop until the cluster is ready<NEW_LINE>while (!clusterReady) {<NEW_LINE>DescribeClustersResponse clusterResponse = redshiftClient.describeClusters(clustersRequest);<NEW_LINE>List<Cluster> clusterList = clusterResponse.clusters();<NEW_LINE>for (Cluster cluster : clusterList) {<NEW_LINE>clusterReadyStr = cluster.clusterStatus();<NEW_LINE>if (clusterReadyStr.contains("available"))<NEW_LINE>clusterReady = true;<NEW_LINE>else {<NEW_LINE>System.out.print(".");<NEW_LINE>Thread.sleep(sleepTime * 1000);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("Cluster is available!");<NEW_LINE>} catch (RedshiftException | InterruptedException e) {<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
System.out.println("Waiting for cluster to become available.");
397,974
public static void main(String[] args) {<NEW_LINE>Logo.print(true);<NEW_LINE>System.out.println("Scouter Batch Agent Version " + Version.getServerFullVersion());<NEW_LINE>Logger.println("A01", "Scouter Batch Agent Version " + Version.getServerFullVersion());<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>UdpLocalServer.getInstance();<NEW_LINE>TcpRequestMgr.getInstance();<NEW_LINE>File exit = new File(SysJMX.getProcessPID() + ".scouter");<NEW_LINE>try {<NEW_LINE>exit.createNewFile();<NEW_LINE>} catch (Exception e) {<NEW_LINE>String tmp = System.getProperty("user.home", "/tmp");<NEW_LINE>exit = new File(tmp, SysJMX.getProcessPID() + ".scouter.run");<NEW_LINE>try {<NEW_LINE>exit.createNewFile();<NEW_LINE>} catch (Exception k) {<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>exit.deleteOnExit();<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>long currentTime;<NEW_LINE>LogMonitor.getInstance();<NEW_LINE>StatusSender statusSender = new StatusSender();<NEW_LINE>while (true) {<NEW_LINE>currentTime = System.currentTimeMillis();<NEW_LINE>if ((currentTime - startTime) >= 10000) {<NEW_LINE>UdpLocalAgent.sendUdpPackToServer(getObjectPack());<NEW_LINE>startTime = currentTime;<NEW_LINE>}<NEW_LINE>if (exit.exists() == false) {<NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>statusSender.sendBatchService(currentTime);<NEW_LINE>ThreadUtil.sleep(1000);<NEW_LINE>}<NEW_LINE>} catch (Throwable th) {<NEW_LINE>Logger.println("E001", "Abnormal stop:" + th.getMessage(), th);<NEW_LINE>}<NEW_LINE>}
ReqestHandlingProxy.load(ReqestHandlingProxy.class);
1,831,988
private static void outputConfigurationToLog(final PwmApplication pwmApplication) {<NEW_LINE>final Instant startTime = Instant.now();<NEW_LINE>final Function<Map.Entry<String, String>, String> valueFormatter = entry -> {<NEW_LINE>final String spacedValue = entry.getValue(<MASK><NEW_LINE>return " " + entry.getKey() + "\n " + spacedValue + "\n";<NEW_LINE>};<NEW_LINE>final StoredConfiguration storedConfiguration = pwmApplication.getConfig().getStoredConfiguration();<NEW_LINE>final List<StoredConfigKey> keys = CollectionUtil.iteratorToStream(storedConfiguration.keys()).collect(Collectors.toList());<NEW_LINE>final Map<String, String> debugStrings = StoredConfigurationUtil.makeDebugMap(storedConfiguration, keys, PwmConstants.DEFAULT_LOCALE);<NEW_LINE>LOGGER.trace(() -> "--begin current configuration output--");<NEW_LINE>final long itemCount = debugStrings.entrySet().stream().map(valueFormatter).map(s -> (Supplier<CharSequence>) () -> s).peek(LOGGER::trace).count();<NEW_LINE>LOGGER.trace(() -> "--end current configuration output of " + itemCount + " items --", () -> TimeDuration.fromCurrent(startTime));<NEW_LINE>}
).replace("\n", "\n ");
1,262,460
static void validateIdentifierField(int fieldId, Map<Integer, Types.NestedField> idToField, Map<Integer, Integer> idToParent) {<NEW_LINE>Types.NestedField <MASK><NEW_LINE>Preconditions.checkArgument(field != null, "Cannot add fieldId %s as an identifier field: field does not exist", fieldId);<NEW_LINE>Preconditions.checkArgument(field.type().isPrimitiveType(), "Cannot add field %s as an identifier field: not a primitive type field", field.name());<NEW_LINE>Preconditions.checkArgument(field.isRequired(), "Cannot add field %s as an identifier field: not a required field", field.name());<NEW_LINE>Preconditions.checkArgument(!Types.DoubleType.get().equals(field.type()) && !Types.FloatType.get().equals(field.type()), "Cannot add field %s as an identifier field: must not be float or double field", field.name());<NEW_LINE>// check whether the nested field is in a chain of struct fields<NEW_LINE>Integer parentId = idToParent.get(field.fieldId());<NEW_LINE>while (parentId != null) {<NEW_LINE>Types.NestedField parent = idToField.get(parentId);<NEW_LINE>Preconditions.checkArgument(parent.type().isStructType(), "Cannot add field %s as an identifier field: must not be nested in %s", field.name(), parent);<NEW_LINE>parentId = idToParent.get(parent.fieldId());<NEW_LINE>}<NEW_LINE>}
field = idToField.get(fieldId);
1,779,789
public Set<K> keySet() {<NEW_LINE>return new AbstractSet<K>() {<NEW_LINE><NEW_LINE>final List<String> keys = data.getPropertyKeys();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Iterator<K> iterator() {<NEW_LINE>return new Iterator<K>() {<NEW_LINE><NEW_LINE>final Iterator<String<MASK><NEW_LINE><NEW_LINE>String lastEncodedKey;<NEW_LINE><NEW_LINE>public boolean hasNext() {<NEW_LINE>return it.hasNext();<NEW_LINE>}<NEW_LINE><NEW_LINE>public K next() {<NEW_LINE>lastEncodedKey = it.next();<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>K toReturn = (K) keyCoder.decode(state, StringQuoter.split(StringQuoter.quote(lastEncodedKey)));<NEW_LINE>return toReturn;<NEW_LINE>}<NEW_LINE><NEW_LINE>public void remove() {<NEW_LINE>Splittable.NULL.assign(data, lastEncodedKey);<NEW_LINE>reified.setReified(lastEncodedKey, null);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int size() {<NEW_LINE>return keys.size();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
> it = keys.iterator();
1,461,832
public void marshall(UpdateComponentData updateComponentData, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (updateComponentData == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(updateComponentData.getBindingProperties(), BINDINGPROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateComponentData.getChildren(), CHILDREN_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateComponentData.getCollectionProperties(), COLLECTIONPROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateComponentData.getComponentType(), COMPONENTTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(updateComponentData.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateComponentData.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateComponentData.getOverrides(), OVERRIDES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateComponentData.getProperties(), PROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateComponentData.getSchemaVersion(), SCHEMAVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateComponentData.getSourceId(), SOURCEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(updateComponentData.getVariants(), VARIANTS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
updateComponentData.getEvents(), EVENTS_BINDING);
1,266,271
public void run() {<NEW_LINE>SelectionManager manager = VizController.getInstance().getSelectionManager();<NEW_LINE>if (manager.isSelectionEnabled()) {<NEW_LINE>if (manager.isRectangleSelection()) {<NEW_LINE>configureLink.setVisible(false);<NEW_LINE>statusLabel.setText(NbBundle.getMessage(SelectionBar.class, "SelectionBar.statusLabel.rectangleSelection"));<NEW_LINE>} else if (manager.isDirectMouseSelection()) {<NEW_LINE>configureLink.setVisible(true);<NEW_LINE>statusLabel.setText(NbBundle.getMessage(SelectionBar.class, "SelectionBar.statusLabel.mouseSelection"));<NEW_LINE>} else if (manager.isDraggingEnabled()) {<NEW_LINE>configureLink.setVisible(true);<NEW_LINE>statusLabel.setText(NbBundle.getMessage<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>configureLink.setVisible(false);<NEW_LINE>statusLabel.setText(NbBundle.getMessage(SelectionBar.class, "SelectionBar.statusLabel.noSelection"));<NEW_LINE>}<NEW_LINE>}
(SelectionBar.class, "SelectionBar.statusLabel.dragging"));
83,435
protected void layoutPeer() {<NEW_LINE>if (getActivity() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!superPeerMode) {<NEW_LINE>// called by Codename One EDT to position the native component.<NEW_LINE>activity.runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>if (layoutWrapper != null) {<NEW_LINE>if (v.getVisibility() == View.VISIBLE) {<NEW_LINE>RelativeLayout.LayoutParams layoutParams = layoutWrapper.createMyLayoutParams(AndroidImplementation.AndroidPeer.this.getAbsoluteX(), AndroidImplementation.AndroidPeer.this.getAbsoluteY(), AndroidImplementation.AndroidPeer.this.getWidth(), AndroidImplementation.AndroidPeer.this.getHeight());<NEW_LINE>layoutWrapper.setLayoutParams(layoutParams);<NEW_LINE>if (AndroidImplementation.this.relativeLayout != null) {<NEW_LINE>AndroidImplementation<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
.this.relativeLayout.requestLayout();
389,522
protected void addVars(CodegenModel m, Map<String, Schema> properties, List<String> required, Map<String, Schema> allProperties, List<String> allRequired) {<NEW_LINE>m.hasRequired = false;<NEW_LINE>if (properties != null && !properties.isEmpty()) {<NEW_LINE>m.hasVars = true;<NEW_LINE>Set<String> mandatory = required == null ? Collections.emptySet() : new TreeSet<>(required);<NEW_LINE>// update "vars" without parent's properties (all, required)<NEW_LINE>addVars(m, m.vars, properties, mandatory);<NEW_LINE>m.allMandatory = m.mandatory = mandatory;<NEW_LINE>} else {<NEW_LINE>m.emptyVars = true;<NEW_LINE>m.hasVars = false;<NEW_LINE>m.hasEnums = false;<NEW_LINE>}<NEW_LINE>if (allProperties != null) {<NEW_LINE>Set<String> allMandatory = allRequired == null ? Collections.emptySet() <MASK><NEW_LINE>// update "vars" with parent's properties (all, required)<NEW_LINE>addVars(m, m.allVars, allProperties, allMandatory);<NEW_LINE>m.allMandatory = allMandatory;<NEW_LINE>} else {<NEW_LINE>// without parent, allVars and vars are the same<NEW_LINE>m.allVars = m.vars;<NEW_LINE>m.allMandatory = m.mandatory;<NEW_LINE>}<NEW_LINE>// loop through list to update property name with toVarName<NEW_LINE>Set<String> renamedMandatory = new ConcurrentSkipListSet<>();<NEW_LINE>Iterator<String> mandatoryIterator = m.mandatory.iterator();<NEW_LINE>while (mandatoryIterator.hasNext()) {<NEW_LINE>renamedMandatory.add(toVarName(mandatoryIterator.next()));<NEW_LINE>}<NEW_LINE>m.mandatory = renamedMandatory;<NEW_LINE>Set<String> renamedAllMandatory = new ConcurrentSkipListSet<>();<NEW_LINE>Iterator<String> allMandatoryIterator = m.allMandatory.iterator();<NEW_LINE>while (allMandatoryIterator.hasNext()) {<NEW_LINE>renamedAllMandatory.add(toVarName(allMandatoryIterator.next()));<NEW_LINE>}<NEW_LINE>m.allMandatory = renamedAllMandatory;<NEW_LINE>}
: new TreeSet<>(allRequired);
377,990
public void updateTracks(PyramidDiscrete<I> pyramid, D[] derivX, D[] derivY) {<NEW_LINE>this.imageWidth = pyramid.getInputWidth();<NEW_LINE>this.imageHeight = pyramid.getInputWidth();<NEW_LINE>this.tracksDropped.clear();<NEW_LINE>this.tracksSpawned.clear();<NEW_LINE>if (frameID == -1)<NEW_LINE>associate.initializeAssociator(imageWidth, imageHeight);<NEW_LINE>frameID++;<NEW_LINE>// System.out.println("frame: "+frameID+" active "+tracksActive.size+" all "+tracksAll.size);<NEW_LINE>// Run the KLT tracker<NEW_LINE>trackerKlt.setInputs(pyramid, derivX, derivY);<NEW_LINE>// TODO add forwards-backwards validation<NEW_LINE>for (int i = tracksActive.size() - 1; i >= 0; i--) {<NEW_LINE>HybridTrack<TD> <MASK><NEW_LINE>if (!trackerKlt.performTracking(track.trackKlt)) {<NEW_LINE>// The track got dropped by KLT but will still be around as an inactive track<NEW_LINE>tracksActive.removeSwap(i);<NEW_LINE>tracksInactive.add(track);<NEW_LINE>} else {<NEW_LINE>track.lastSeenFrameID = frameID;<NEW_LINE>track.pixel.setTo(track.trackKlt.x, track.trackKlt.y);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
track = tracksActive.get(i);
982,261
protected void initFormPanel(boolean searchAndReplace) {<NEW_LINE>formPanel = new SearchFormPanel();<NEW_LINE>formPanel.addRow(lblTextToFind, cboxTextToFind.getComponent(), true);<NEW_LINE>JPanel hintAndButtonPanel = initHintAndButtonPanel();<NEW_LINE>formPanel.addRow(new JLabel(), hintAndButtonPanel);<NEW_LINE>initContainingTextOptionsRow(searchAndReplace);<NEW_LINE>if (searchAndReplace) {<NEW_LINE>formPanel.addRow(lblReplacement, cboxReplacement, true);<NEW_LINE>}<NEW_LINE>formPanel.addSeparator();<NEW_LINE>formPanel.addRow(<MASK><NEW_LINE>initScopeOptionsRow(searchAndReplace);<NEW_LINE>formPanel.addSeparator();<NEW_LINE>formPanel.addRow(lblFileNamePattern, cboxFileNamePattern.getComponent());<NEW_LINE>formPanel.addRow(new JLabel(), lblFileNameHint);<NEW_LINE>formPanel.addRow(new JLabel(), scopeSettingsPanel.getFileNameComponent());<NEW_LINE>formPanel.addEmptyLine();<NEW_LINE>}
lblScope, cboxScope.getComponent());
201,455
private void findResourceMethods(Object theProvider) {<NEW_LINE>ourLog.debug("Scanning type for RESTful methods: {}", theProvider.getClass());<NEW_LINE>int count = 0;<NEW_LINE>Class<?> clazz = theProvider.getClass();<NEW_LINE>Class<?> supertype = clazz.getSuperclass();<NEW_LINE>while (!Object.class.equals(supertype)) {<NEW_LINE><MASK><NEW_LINE>count += findResourceMethodsOnInterfaces(theProvider, supertype.getInterfaces());<NEW_LINE>supertype = supertype.getSuperclass();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>count += findResourceMethods(theProvider, clazz);<NEW_LINE>count += findResourceMethodsOnInterfaces(theProvider, clazz.getInterfaces());<NEW_LINE>} catch (ConfigurationException e) {<NEW_LINE>throw new ConfigurationException(Msg.code(288) + "Failure scanning class " + clazz.getSimpleName() + ": " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>if (count == 0) {<NEW_LINE>throw new ConfigurationException(Msg.code(289) + "Did not find any annotated RESTful methods on provider class " + theProvider.getClass().getName());<NEW_LINE>}<NEW_LINE>}
count += findResourceMethods(theProvider, supertype);
1,331,802
protected void read(CompoundTag compound, boolean clientPacket) {<NEW_LINE>boolean overStressedBefore = overStressed;<NEW_LINE>clearKineticInformation();<NEW_LINE>// DO NOT READ kinetic information when placed after movement<NEW_LINE>if (wasMoved) {<NEW_LINE>super.read(compound, clientPacket);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>speed = compound.getFloat("Speed");<NEW_LINE>if (compound.contains("Source"))<NEW_LINE>source = NbtUtils.readBlockPos(compound.getCompound("Source"));<NEW_LINE>if (compound.contains("Network")) {<NEW_LINE>CompoundTag networkTag = compound.getCompound("Network");<NEW_LINE>network = networkTag.getLong("Id");<NEW_LINE>stress = networkTag.getFloat("Stress");<NEW_LINE>capacity = networkTag.getFloat("Capacity");<NEW_LINE>networkSize = networkTag.getInt("Size");<NEW_LINE>lastStressApplied = networkTag.getFloat("AddedStress");<NEW_LINE>lastCapacityProvided = networkTag.getFloat("AddedCapacity");<NEW_LINE>overStressed = capacity <MASK><NEW_LINE>}<NEW_LINE>super.read(compound, clientPacket);<NEW_LINE>if (clientPacket && overStressedBefore != overStressed && speed != 0)<NEW_LINE>effects.triggerOverStressedEffect();<NEW_LINE>if (clientPacket)<NEW_LINE>DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> InstancedRenderDispatcher.enqueueUpdate(this));<NEW_LINE>}
< stress && StressImpact.isEnabled();
430,745
protected void drawLineWithText(Canvas canvas, int startX, int startY, int endX, int endY, int endPointSpace) {<NEW_LINE>if (startX == endX && startY == endY) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (startX > endX) {<NEW_LINE>int tempX = startX;<NEW_LINE>startX = endX;<NEW_LINE>endX = tempX;<NEW_LINE>}<NEW_LINE>if (startY > endY) {<NEW_LINE>int tempY = startY;<NEW_LINE>startY = endY;<NEW_LINE>endY = tempY;<NEW_LINE>}<NEW_LINE>if (startX == endX) {<NEW_LINE>drawLineWithEndPoint(canvas, startX, startY + endPointSpace, endX, endY - endPointSpace);<NEW_LINE>String text = px2dip(endY - startY, true);<NEW_LINE>drawText(canvas, text, startX + textLineDistance, startY + (endY - startY) / 2 <MASK><NEW_LINE>} else if (startY == endY) {<NEW_LINE>drawLineWithEndPoint(canvas, startX + endPointSpace, startY, endX - endPointSpace, endY);<NEW_LINE>String text = px2dip(endX - startX, true);<NEW_LINE>drawText(canvas, text, startX + (endX - startX) / 2 - getTextWidth(text) / 2, startY - textLineDistance);<NEW_LINE>}<NEW_LINE>}
+ getTextHeight(text) / 2);
1,772,097
public <T extends ImageBase<T>> SimpleImageSequence<T> load(String fileName, ImageType<T> imageType) {<NEW_LINE>URL url = UtilIO.ensureURL(fileName);<NEW_LINE>if (url == null)<NEW_LINE>throw new RuntimeException("Can't open " + fileName);<NEW_LINE>String protocol = url.getProtocol();<NEW_LINE>// See if it's a directory and then assume it's an image sequence<NEW_LINE>if (protocol.equals("file")) {<NEW_LINE>File f = new File(url.getFile());<NEW_LINE>if (f.isDirectory())<NEW_LINE>return new LoadFileImageSequence<>(imageType, url.getFile(), null);<NEW_LINE>}<NEW_LINE>String lowerName = fileName.toLowerCase();<NEW_LINE>InputStream stream = null;<NEW_LINE>try {<NEW_LINE>stream = url.openStream();<NEW_LINE>// Use built in movie readers for these file types<NEW_LINE>if (lowerName.endsWith("mjpeg") || lowerName.endsWith("mjpg")) {<NEW_LINE>VideoMjpegCodec codec = new VideoMjpegCodec();<NEW_LINE>List<byte[]> data = codec.read(stream);<NEW_LINE>return new JpegByteImageSequence<>(imageType, data, false);<NEW_LINE>} else if (lowerName.endsWith("mpng")) {<NEW_LINE>return new ImageStreamSequence<>(stream, true, imageType);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (ffmpeg != null) {<NEW_LINE>return ffmpeg.load(fileName, imageType);<NEW_LINE>}<NEW_LINE>} catch (UnsatisfiedLinkError e) {<NEW_LINE>// Trying to run on an architecture it doesn't have a binary for.<NEW_LINE>ffmpeg = null;<NEW_LINE>} catch (RuntimeException ignore) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (jcodec != null) {<NEW_LINE>SimpleImageSequence<T> sequence = jcodec.load(fileName, imageType);<NEW_LINE>System.<MASK><NEW_LINE>return sequence;<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>System.err.println("JCodec Error: " + e.getMessage());<NEW_LINE>}<NEW_LINE>System.err.println("No working codec found for file: " + fileName);<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.println("Error opening. " + e.getMessage());<NEW_LINE>return null;<NEW_LINE>} finally {<NEW_LINE>if (stream != null) {<NEW_LINE>try {<NEW_LINE>stream.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.println("Failed to close stream. " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
err.println("WARNING: Using JCodec to read movie files as a last resort. " + "Great that it works, but it's very slow. Might want to look at alternatives.");
801,169
public boolean isMessageSimilar(String message) {<NEW_LINE>// raw message includes {i} params<NEW_LINE>String raw = get();<NEW_LINE>List<String> parts = new ArrayList<>();<NEW_LINE>int iLast = 0;<NEW_LINE>int iClose = 0;<NEW_LINE>while (iClose < raw.length()) {<NEW_LINE>int iOpen = <MASK><NEW_LINE>if (iOpen < 0) {<NEW_LINE>parts.add(raw.substring(iLast));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>iClose = raw.indexOf('}', iOpen);<NEW_LINE>if (iClose < 0) {<NEW_LINE>parts.add(raw.substring(iLast));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (isInt(raw.substring(iOpen + 1, iClose))) {<NEW_LINE>parts.add(raw.substring(iLast, iOpen));<NEW_LINE>iLast = iClose + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int i = 0;<NEW_LINE>for (String part : parts) {<NEW_LINE>if (message.indexOf(part, i) < 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>i += part.length();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
raw.indexOf('{', iClose);
1,277,034
public static ArrayList<HttpCookie> parseRawCookie(String rawCookie) {<NEW_LINE>String[] rawCookieParams = rawCookie.split(";");<NEW_LINE>ArrayList<HttpCookie> cookies = new ArrayList<HttpCookie>();<NEW_LINE>for (String rawCookieParam : rawCookieParams) {<NEW_LINE>String[] rawCookieNameAndValue = rawCookieParam.split("=");<NEW_LINE>if (rawCookieNameAndValue.length != 2)<NEW_LINE>continue;<NEW_LINE>String cookieName = rawCookieNameAndValue[0].trim();<NEW_LINE>String cookieValue = rawCookieNameAndValue[1].trim();<NEW_LINE>HttpCookie cookie;<NEW_LINE>try {<NEW_LINE>cookie <MASK><NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>Logger.error("Invalid cookie. name=" + cookieName + ":" + cookieValue);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (int i = 1; i < rawCookieParams.length; i++) {<NEW_LINE>String[] rawCookieParamNameAndValue = rawCookieParams[i].trim().split("=");<NEW_LINE>String paramName = rawCookieParamNameAndValue[0].trim();<NEW_LINE>if (paramName.equalsIgnoreCase("secure"))<NEW_LINE>cookie.setSecure(true);<NEW_LINE>else {<NEW_LINE>// attribute not a flag or missing value.<NEW_LINE>if (rawCookieParamNameAndValue.length == 2) {<NEW_LINE>String paramValue = rawCookieParamNameAndValue[1].trim();<NEW_LINE>if (paramName.equalsIgnoreCase("max-age")) {<NEW_LINE>long maxAge = Long.parseLong(paramValue);<NEW_LINE>cookie.setMaxAge(maxAge);<NEW_LINE>} else if (paramName.equalsIgnoreCase("domain"))<NEW_LINE>cookie.setDomain(paramValue);<NEW_LINE>else if (paramName.equalsIgnoreCase("path"))<NEW_LINE>cookie.setPath(paramValue);<NEW_LINE>else if (paramName.equalsIgnoreCase("comment"))<NEW_LINE>cookie.setComment(paramValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cookies.add(cookie);<NEW_LINE>}<NEW_LINE>return cookies;<NEW_LINE>}
= new HttpCookie(cookieName, cookieValue);
1,848,869
private void verifySelection() {<NEW_LINE>logger.debug("--- Verifying selection ---");<NEW_LINE>OWLSelectionModel selectionModel = getOWLSelectionModel();<NEW_LINE>OWLClass lastSelectedClass = selectionModel.getLastSelectedClass();<NEW_LINE>logger.debug("Last selected class: {}", lastSelectedClass);<NEW_LINE>OWLObjectProperty lastSelectedObjectProperty = selectionModel.getLastSelectedObjectProperty();<NEW_LINE>logger.debug("Last selected object property: {}", lastSelectedObjectProperty);<NEW_LINE>OWLDataProperty lastSelectedDataProperty = selectionModel.getLastSelectedDataProperty();<NEW_LINE>logger.debug("Last selected data property: {}", lastSelectedDataProperty);<NEW_LINE>OWLAnnotationProperty lastSelectedAnnotationProperty = selectionModel.getLastSelectedAnnotationProperty();<NEW_LINE>logger.debug("Last selected annotation property: " + lastSelectedAnnotationProperty);<NEW_LINE>OWLNamedIndividual lastSelectedIndividual = selectionModel.getLastSelectedIndividual();<NEW_LINE><MASK><NEW_LINE>OWLDatatype lastSelectedDatatype = selectionModel.getLastSelectedDatatype();<NEW_LINE>logger.debug("Last selected datatype: {}", lastSelectedDatatype);<NEW_LINE>OWLEntity selectedEntity = selectionModel.getSelectedEntity();<NEW_LINE>logger.debug("Last selected entity: {}", selectedEntity);<NEW_LINE>verifySelection(CollectionFactory.createSet(lastSelectedClass, lastSelectedDataProperty, lastSelectedObjectProperty, lastSelectedAnnotationProperty, lastSelectedIndividual, lastSelectedDatatype, selectedEntity));<NEW_LINE>logger.debug("---------------------------");<NEW_LINE>}
logger.debug("Last selected individual: {}", lastSelectedIndividual);
1,381,471
private static void trackFiredRule(Rule firedRule, HttpServletRequest req) {<NEW_LINE>FiredRulesList firedRulesRequest = (FiredRulesList) req.getAttribute(WebKeys.RULES_ENGINE_FIRE_LIST);<NEW_LINE>HttpSession <MASK><NEW_LINE>FiredRulesList firedRulesSession = (session == null) ? new FiredRulesList() : (FiredRulesList) session.getAttribute(WebKeys.RULES_ENGINE_FIRE_LIST);<NEW_LINE>if (!UtilMethods.isSet(firedRulesRequest)) {<NEW_LINE>firedRulesRequest = new FiredRulesList();<NEW_LINE>req.setAttribute(WebKeys.RULES_ENGINE_FIRE_LIST, firedRulesRequest);<NEW_LINE>}<NEW_LINE>if (!UtilMethods.isSet(firedRulesSession)) {<NEW_LINE>firedRulesSession = new FiredRulesList();<NEW_LINE>if (session != null)<NEW_LINE>session.setAttribute(WebKeys.RULES_ENGINE_FIRE_LIST, firedRulesSession);<NEW_LINE>}<NEW_LINE>Date now = new Date();<NEW_LINE>FiredRule ruleFired = new FiredRule(now, firedRule);<NEW_LINE>firedRulesRequest.add(ruleFired);<NEW_LINE>firedRulesSession.add(ruleFired);<NEW_LINE>}
session = req.getSession(false);
1,582,089
protected String doIt() throws Exception {<NEW_LINE>// Instance current Payment Selection<NEW_LINE>if (getRecord_ID() > 0) {<NEW_LINE>// Already exists<NEW_LINE>paymentSelection = new MPaySelection(getCtx(), getRecord_ID(), get_TrxName());<NEW_LINE>seqNo = paymentSelection.getLastLineNo();<NEW_LINE>} else {<NEW_LINE>// Is a new Payment Selection<NEW_LINE>paymentSelection = new MPaySelection(getCtx(), 0, get_TrxName());<NEW_LINE>paymentSelection.setC_BankAccount_ID(getBankAccountId());<NEW_LINE>paymentSelection.setDateDoc(getDateDoc());<NEW_LINE>paymentSelection.setPayDate(getPayDate());<NEW_LINE>if (getDocTypeTargetId() > 0)<NEW_LINE>paymentSelection.setC_DocType_ID(getDocTypeTargetId());<NEW_LINE>MUser user = MUser.get(getCtx(), getAD_User_ID());<NEW_LINE>String userName = "";<NEW_LINE>if (user != null)<NEW_LINE>userName = user.getName();<NEW_LINE>// Set description<NEW_LINE>paymentSelection.setDescription(Msg.getMsg(Env.getCtx(), "VPaySelect") + " - " + userName + " - " + DisplayType.getDateFormat(DisplayType.Date).format(getPayDate()));<NEW_LINE>// Save<NEW_LINE>paymentSelection.saveEx();<NEW_LINE>isNew = true;<NEW_LINE>}<NEW_LINE>// Loop for keys<NEW_LINE>for (Integer key : getSelectionKeys()) {<NEW_LINE>// get values from result set<NEW_LINE>int C_Invoice_ID = key;<NEW_LINE>int C_InvoicePaySchedule_ID = getSelectionAsInt(key, "INV_C_InvoicePaySchedule_ID");<NEW_LINE>String PaymentRule = getSelectionAsString(key, "INV_PaymentRule");<NEW_LINE>BigDecimal <MASK><NEW_LINE>BigDecimal OpenAmt = getSelectionAsBigDecimal(key, "INV_OpenAmt");<NEW_LINE>BigDecimal PayAmt = getSelectionAsBigDecimal(key, "INV_PayAmt");<NEW_LINE>BigDecimal DiscountAmt = getSelectionAsBigDecimal(key, "INV_DiscountAmt");<NEW_LINE>seqNo += 10;<NEW_LINE>MPaySelectionLine line = new MPaySelectionLine(paymentSelection, seqNo, PaymentRule);<NEW_LINE>// Add Order<NEW_LINE>line.setInvoice(C_Invoice_ID, C_InvoicePaySchedule_ID, AmtSource, OpenAmt, PayAmt, DiscountAmt);<NEW_LINE>// Save<NEW_LINE>line.saveEx();<NEW_LINE>}<NEW_LINE>// For new<NEW_LINE>if (isNew) {<NEW_LINE>// Load Record<NEW_LINE>paymentSelection.load(get_TrxName());<NEW_LINE>// Process Selection<NEW_LINE>if (!paymentSelection.processIt(MPaySelection.DOCACTION_Complete)) {<NEW_LINE>throw new AdempiereException("@Error@ " + paymentSelection.getProcessMsg());<NEW_LINE>}<NEW_LINE>//<NEW_LINE>paymentSelection.saveEx();<NEW_LINE>// Notify<NEW_LINE>return paymentSelection.getDescription();<NEW_LINE>}<NEW_LINE>// Default Ok<NEW_LINE>return "@OK@";<NEW_LINE>}
AmtSource = getSelectionAsBigDecimal(key, "INV_AmtSource");
165,987
private void createScrollDelegate(Context context, AttributeSet attrs, int defStyle) {<NEW_LINE>if (attrs != null) {<NEW_LINE>TypedArray a = context.obtainStyledAttributes(attrs, R.<MASK><NEW_LINE>mThumbDrawable = a.getDrawable(R.styleable.CustomScrollView_android_fastScrollThumbDrawable);<NEW_LINE>if (mThumbDrawable == null) {<NEW_LINE>mThumbDrawable = getResources().getDrawable(R.drawable.scrollbar_thumb, getContext().getTheme());<NEW_LINE>}<NEW_LINE>mIsAlwaysVisible = a.getBoolean(R.styleable.CustomScrollView_android_fastScrollAlwaysVisible, false);<NEW_LINE>mThumbDynamicHeight = a.getBoolean(R.styleable.CustomScrollView_dynamicHeight, true);<NEW_LINE>mSize = a.getDimensionPixelSize(R.styleable.CustomScrollView_android_scrollbarSize, getResources().getDimensionPixelSize(R.dimen.scrollbarWidth));<NEW_LINE>a.recycle();<NEW_LINE>}<NEW_LINE>setVerticalScrollBarEnabled(false);<NEW_LINE>mScrollCache = new ScrollAnimator(this);<NEW_LINE>mThumbRect = new Rect(0, 0, mSize, mSize);<NEW_LINE>setThumbDrawable(mThumbDrawable);<NEW_LINE>setAlwaysVisible(mIsAlwaysVisible);<NEW_LINE>setThumbSize(mSize, mSize);<NEW_LINE>setThumbDynamicHeight(mThumbDynamicHeight);<NEW_LINE>}
styleable.CustomScrollView, 0, defStyle);
694,674
public static boolean checkVersion(String groupId, String artifactId, String separator, boolean logWarnings, Class cls) {<NEW_LINE>try {<NEW_LINE>String javacppVersion = getVersion();<NEW_LINE>String version = getVersion(groupId, artifactId, cls);<NEW_LINE>if (version == null) {<NEW_LINE>if (logWarnings && isLoadLibraries()) {<NEW_LINE>logger.warn("Version of " + groupId + ":" + artifactId + " could not be found.");<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String[] <MASK><NEW_LINE>String[] versions = version.split(separator);<NEW_LINE>int n = versions.length - (versions[versions.length - 1].equals("SNAPSHOT") ? 2 : 1);<NEW_LINE>boolean matches = versions[n].equals(javacppVersions[0]);<NEW_LINE>if (!matches && logWarnings && isLoadLibraries()) {<NEW_LINE>logger.warn("Versions of org.bytedeco:javacpp:" + javacppVersion + " and " + groupId + ":" + artifactId + ":" + version + " do not match.");<NEW_LINE>}<NEW_LINE>return matches;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>if (logWarnings && isLoadLibraries()) {<NEW_LINE>logger.warn("Unable to load properties : " + ex.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
javacppVersions = javacppVersion.split(separator);
628,483
public void createGetterForField(AccessLevel level, JavacNode fieldNode, JavacNode source, boolean whineIfExists, boolean lazy, List<JCAnnotation> onMethod) {<NEW_LINE>if (fieldNode.getKind() != Kind.FIELD) {<NEW_LINE>source.addError(GETTER_NODE_NOT_SUPPORTED_ERR);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JCVariableDecl fieldDecl = (JCVariableDecl) fieldNode.get();<NEW_LINE>if (lazy) {<NEW_LINE>if ((fieldDecl.mods.flags & Flags.PRIVATE) == 0 || (fieldDecl.mods.flags & Flags.FINAL) == 0) {<NEW_LINE>source.addError("'lazy' requires the field to be private and final.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ((fieldDecl.mods.flags & Flags.TRANSIENT) != 0) {<NEW_LINE>source.addError("'lazy' is not supported on transient fields.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fieldDecl.init == null) {<NEW_LINE>source.addError("'lazy' requires field initialization.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>AnnotationValues<Accessors> accessors = getAccessorsForField(fieldNode);<NEW_LINE>String methodName = toGetterName(fieldNode, accessors);<NEW_LINE>if (methodName == null) {<NEW_LINE>source.addWarning("Not generating getter for this field: It does not fit your @Accessors prefix list.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (String altName : toAllGetterNames(fieldNode, accessors)) {<NEW_LINE>switch(methodExists(altName, fieldNode, false, 0)) {<NEW_LINE>case EXISTS_BY_LOMBOK:<NEW_LINE>return;<NEW_LINE>case EXISTS_BY_USER:<NEW_LINE>if (whineIfExists) {<NEW_LINE>String altNameExpl = "";<NEW_LINE>if (!altName.equals(methodName))<NEW_LINE>altNameExpl = String.format(" (%s)", altName);<NEW_LINE>source.addWarning(String.format<MASK><NEW_LINE>}<NEW_LINE>return;<NEW_LINE>default:<NEW_LINE>case NOT_EXISTS:<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long access = toJavacModifier(level) | (fieldDecl.mods.flags & Flags.STATIC);<NEW_LINE>injectMethod(fieldNode.up(), createGetter(access, fieldNode, fieldNode.getTreeMaker(), source, lazy, onMethod));<NEW_LINE>}
("Not generating %s(): A method with that name already exists%s", methodName, altNameExpl));
759,786
public static void init(BiConsumer<Block, RenderType> consumer) {<NEW_LINE>consumer.accept(ModBlocks.defaultAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.<MASK><NEW_LINE>consumer.accept(ModBlocks.plainsAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.mountainAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.fungalAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.swampAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.desertAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.taigaAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.mesaAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.mossyAltar, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.ghostRail, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.solidVines, RenderType.cutout());<NEW_LINE>consumer.accept(ModBlocks.corporeaCrystalCube, RenderType.translucent());<NEW_LINE>consumer.accept(ModBlocks.manaGlass, RenderType.translucent());<NEW_LINE>consumer.accept(ModFluffBlocks.managlassPane, RenderType.translucent());<NEW_LINE>consumer.accept(ModBlocks.elfGlass, RenderType.translucent());<NEW_LINE>consumer.accept(ModFluffBlocks.alfglassPane, RenderType.translucent());<NEW_LINE>consumer.accept(ModBlocks.bifrost, RenderType.translucent());<NEW_LINE>consumer.accept(ModFluffBlocks.bifrostPane, RenderType.translucent());<NEW_LINE>consumer.accept(ModBlocks.bifrostPerm, RenderType.translucent());<NEW_LINE>consumer.accept(ModBlocks.prism, RenderType.translucent());<NEW_LINE>consumer.accept(ModBlocks.starfield, RenderType.cutoutMipped());<NEW_LINE>consumer.accept(ModBlocks.abstrusePlatform, RenderType.translucent());<NEW_LINE>consumer.accept(ModBlocks.infrangiblePlatform, RenderType.translucent());<NEW_LINE>consumer.accept(ModBlocks.spectralPlatform, RenderType.translucent());<NEW_LINE>Registry.BLOCK.stream().filter(b -> Registry.BLOCK.getKey(b).getNamespace().equals(LibMisc.MOD_ID)).forEach(b -> {<NEW_LINE>if (b instanceof BlockFloatingFlower || b instanceof FlowerBlock || b instanceof TallFlowerBlock || b instanceof BlockModMushroom) {<NEW_LINE>consumer.accept(b, RenderType.cutout());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
forestAltar, RenderType.cutout());
1,189,483
public static void main(String[] args) {<NEW_LINE>if (args.length < 1) {<NEW_LINE>System.out.println("Please specify a SSM OpsItem ID value. You can obtain this value using the AWS Console.");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>// snippet-start:[ssm.Java1.get_ops.main]<NEW_LINE>// Get the OpsItem ID value<NEW_LINE>String opsID = args[0];<NEW_LINE>// Create the AWSSimpleSystemsManagement client object<NEW_LINE>AWSSimpleSystemsManagement ssm = AWSSimpleSystemsManagementClientBuilder.standard().withRegion(Regions.DEFAULT_REGION).build();<NEW_LINE>try {<NEW_LINE>GetOpsItemRequest opsRequest = new GetOpsItemRequest();<NEW_LINE>opsRequest.setOpsItemId(opsID);<NEW_LINE>GetOpsItemResult opsResults = ssm.getOpsItem(opsRequest);<NEW_LINE>OpsItem item = opsResults.getOpsItem();<NEW_LINE>System.out.println(item.getTitle());<NEW_LINE>System.out.<MASK><NEW_LINE>System.out.println(item.getSource());<NEW_LINE>} catch (AmazonServiceException e) {<NEW_LINE>e.getStackTrace();<NEW_LINE>}<NEW_LINE>// snippet-end:[ssm.Java1.get_ops.main]<NEW_LINE>}
println(item.getDescription());
1,258,766
public void testContextInfoExactMatchDisableDefault() throws Exception {<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "**** >>>>> server configuration thresholds for - <global - slow : 5s , hung : 10s> <timing - Slow : 120s , hung : 120s>");<NEW_LINE>server.setServerConfigurationFile("contextInfoPattern/server_timing_7.xml");<NEW_LINE>server.waitForStringInLog("CWWKG0017I", 30000);<NEW_LINE>server.setMarkToEndOfLog();<NEW_LINE>// Should sleep and not hit hung request threshold since the context info specific settings<NEW_LINE>// are longer than the global defaults.<NEW_LINE>long startTime = System.nanoTime();<NEW_LINE>createRequests(12000, 1);<NEW_LINE>long elapsedSeconds = TimeUnit.SECONDS.convert(System.nanoTime() - startTime, TimeUnit.NANOSECONDS);<NEW_LINE>assertTrue("Test did not run long enough (elapsedSeconds)", elapsedSeconds >= 12);<NEW_LINE>// Make sure we didn't get any hung request messages<NEW_LINE>assertTrue("Test should not have found any slow request messages", fetchSlowRequestWarningsCount() == 0);<NEW_LINE>assertTrue("Test should not have found any hung request messages", fetchHungRequestWarningsCount() == 0);<NEW_LINE>// OK now test the opposite - that we do timeout because we matched the context info specific<NEW_LINE>// settings.<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "**** >>>>> server configuration thresholds for - <global - slow : 120s , hung : 120s> <timing - Slow : 5s , hung : 10s>");<NEW_LINE>server.setServerConfigurationFile("contextInfoPattern/server_timing_8.xml");<NEW_LINE>server.waitForStringInLog("CWWKG0017I", 30000);<NEW_LINE>server.setMarkToEndOfLog();<NEW_LINE>// Should sleep and not hit hung request threshold since the context info specific settings<NEW_LINE>// are longer than the global defaults.<NEW_LINE>startTime = System.nanoTime();<NEW_LINE>createRequests(12000, 1);<NEW_LINE>elapsedSeconds = TimeUnit.SECONDS.convert(System.nanoTime(<MASK><NEW_LINE>assertTrue("Test did not run long enough (elapsedSeconds)", elapsedSeconds >= 12);<NEW_LINE>// Make sure we had some hung request messages<NEW_LINE>assertTrue("Test should have found slow request messages", fetchSlowRequestWarningsCount() > 0);<NEW_LINE>assertTrue("Test should have found hung request messages", fetchHungRequestWarningsCount() > 0);<NEW_LINE>CommonTasks.writeLogMsg(Level.INFO, "***** Testcase testContextInfoExactMatchDisableDefault pass *****");<NEW_LINE>}
) - startTime, TimeUnit.NANOSECONDS);
951,334
public List<LimitOrder> openOrders() {<NEW_LINE>Map<String, List<Map<String, String>>> map = exmo.userOpenOrders(signatureCreator, apiKey, exchange.getNonceFactory());<NEW_LINE>List<LimitOrder> openOrders = new ArrayList<>();<NEW_LINE>for (String market : map.keySet()) {<NEW_LINE>CurrencyPair currencyPair = adaptMarket(market);<NEW_LINE>for (Map<String, String> order : map.get(market)) {<NEW_LINE>Order.OrderType <MASK><NEW_LINE>BigDecimal amount = new BigDecimal(order.get("quantity"));<NEW_LINE>String id = order.get("order_id");<NEW_LINE>BigDecimal price = new BigDecimal(order.get("price"));<NEW_LINE>Date created = DateUtils.fromUnixTime(Long.valueOf(order.get("created")));<NEW_LINE>openOrders.add(new LimitOrder(type, amount, currencyPair, id, created, price));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return openOrders;<NEW_LINE>}
type = ExmoAdapters.adaptOrderType(order);
631,610
private ContentValues toContentValues(final DepictedItem depictedItem) {<NEW_LINE>final List<String> namesOfCommonsCategories = new ArrayList<>();<NEW_LINE>for (final CategoryItem category : depictedItem.getCommonsCategories()) {<NEW_LINE>namesOfCommonsCategories.add(category.getName());<NEW_LINE>}<NEW_LINE>final List<String> descriptionsOfCommonsCategories = new ArrayList<>();<NEW_LINE>for (final CategoryItem category : depictedItem.getCommonsCategories()) {<NEW_LINE>descriptionsOfCommonsCategories.add(category.getDescription());<NEW_LINE>}<NEW_LINE>final List<String> thumbnailsOfCommonsCategories = new ArrayList<>();<NEW_LINE>for (final CategoryItem category : depictedItem.getCommonsCategories()) {<NEW_LINE>thumbnailsOfCommonsCategories.add(category.getThumbnail());<NEW_LINE>}<NEW_LINE>final ContentValues cv = new ContentValues();<NEW_LINE>cv.put(Table.COLUMN_NAME, depictedItem.getName());<NEW_LINE>cv.put(Table.COLUMN_DESCRIPTION, depictedItem.getDescription());<NEW_LINE>cv.put(Table.COLUMN_IMAGE, depictedItem.getImageUrl());<NEW_LINE>cv.put(Table.COLUMN_INSTANCE_LIST, ArrayToString(depictedItem.getInstanceOfs()));<NEW_LINE>cv.put(Table.COLUMN_CATEGORIES_NAME_LIST, ArrayToString(namesOfCommonsCategories));<NEW_LINE>cv.put(Table.COLUMN_CATEGORIES_DESCRIPTION_LIST, ArrayToString(descriptionsOfCommonsCategories));<NEW_LINE>cv.put(Table<MASK><NEW_LINE>cv.put(Table.COLUMN_IS_SELECTED, depictedItem.isSelected());<NEW_LINE>cv.put(Table.COLUMN_ID, depictedItem.getId());<NEW_LINE>return cv;<NEW_LINE>}
.COLUMN_CATEGORIES_THUMBNAIL_LIST, ArrayToString(thumbnailsOfCommonsCategories));
677,723
protected void afterObjectNew(String desc) {<NEW_LINE>if (loc.getWhere() == Where.AFTER) {<NEW_LINE>String extName = desc.replace('/', '.');<NEW_LINE>if (matches(loc.getClazz(), extName)) {<NEW_LINE>Type instType = Type.getObjectType(desc);<NEW_LINE>addExtraTypeInfo(om.getSelfParameter(), Type.getObjectType(className));<NEW_LINE>addExtraTypeInfo(om.getReturnParameter(), instType);<NEW_LINE>ValidationResult vr = validateArguments(om, actionArgTypes, new Type[] { Constants.STRING_TYPE });<NEW_LINE>if (vr.isValid()) {<NEW_LINE>int returnValIndex = -1;<NEW_LINE>Label l = levelCheck(om, bcn.getClassName(true));<NEW_LINE>if (om.getReturnParameter() != -1) {<NEW_LINE>asm.dupValue(instType);<NEW_LINE>returnValIndex = storeAsNew();<NEW_LINE>}<NEW_LINE>loadArguments(constArg(vr.getArgIdx(0), extName), localVarArg(om.getReturnParameter(), instType, returnValIndex), constArg(om.getClassNameParameter(), className.replace('/', '.')), constArg(om.getMethodParameter(), getName(om.isMethodFqn())), selfArg(om.getSelfParameter(), <MASK><NEW_LINE>invokeBTraceAction(asm, om);<NEW_LINE>if (l != null) {<NEW_LINE>mv.visitLabel(l);<NEW_LINE>insertFrameSameStack(l);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Type.getObjectType(className)));
244,642
public static void splitV3CommandExecutableForV4(final Connection con) throws Exception {<NEW_LINE>try (PreparedStatement commandsQuery = con.prepareStatement(V3_COMMAND_EXECUTABLE_QUERY);<NEW_LINE>PreparedStatement insertCommandArgument = con.prepareStatement(V4_COMMAND_ARGUMENT_SQL);<NEW_LINE>ResultSet rs = commandsQuery.executeQuery()) {<NEW_LINE>while (rs.next()) {<NEW_LINE>final long commandId = rs.getLong(V3_COMMAND_ID_INDEX);<NEW_LINE>final String executable = rs.getString(V3_COMMAND_EXECUTABLE_INDEX);<NEW_LINE>final String[] arguments = StringUtils.splitByWholeSeparator(executable, null);<NEW_LINE>if (arguments.length > 0) {<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < arguments.length; i++) {<NEW_LINE>insertCommandArgument.setString(V4_COMMAND_ARGUMENT_INDEX, arguments[i]);<NEW_LINE>insertCommandArgument.setInt(V4_COMMAND_ARGUMENT_ORDER_INDEX, i);<NEW_LINE>insertCommandArgument.executeUpdate();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
insertCommandArgument.setLong(V4_COMMAND_ID_INDEX, commandId);
397,127
public static void renderOrderA(Graphics2D g2, double scale, List<PointIndex2D_F64> points) {<NEW_LINE>g2.setStroke(new BasicStroke(5));<NEW_LINE>Color[] colorsSquare = new Color[4];<NEW_LINE>colorsSquare[0] = new Color(0, 255, 0);<NEW_LINE>colorsSquare[1] = new Color(100, 180, 0);<NEW_LINE>colorsSquare[2] = new Color(160, 140, 0);<NEW_LINE>colorsSquare[3] = new Color(0, 140, 100);<NEW_LINE>Line2D.Double line = new Line2D.Double();<NEW_LINE>for (int i = 1; i + 6 < points.size(); i += 4) {<NEW_LINE>Point2D_F64 p0 = points.get(i).p;<NEW_LINE>Point2D_F64 p1 = points.get(i + 6).p;<NEW_LINE>double fraction = i / ((double) points.size() - 2);<NEW_LINE>int red = (int) (0xFF * fraction) + (int) (0x00 * (1 - fraction));<NEW_LINE>int green = 0x00;<NEW_LINE>int blue = (int) (0x00 * fraction) + (int) (0xff * (1 - fraction));<NEW_LINE>int lineRGB = red << 16 | green << 8 | blue;<NEW_LINE>line.setLine(scale * p0.x, scale * p0.y, scale * p1.x, scale * p1.y);<NEW_LINE>g2.setColor(new Color(lineRGB));<NEW_LINE>g2.draw(line);<NEW_LINE>}<NEW_LINE>for (int i = 0; i + 3 < points.size(); i += 4) {<NEW_LINE>Point2D_F64 p0 = points.get(i).p;<NEW_LINE>Point2D_F64 p1 = points.get(i + 1).p;<NEW_LINE>Point2D_F64 p2 = points.get(i + 2).p;<NEW_LINE>Point2D_F64 p3 = points.get(i + 3).p;<NEW_LINE>line.setLine(scale * p0.x, scale * p0.y, scale * p1.<MASK><NEW_LINE>g2.setColor(colorsSquare[0]);<NEW_LINE>g2.draw(line);<NEW_LINE>line.setLine(scale * p1.x, scale * p1.y, scale * p2.x, scale * p2.y);<NEW_LINE>g2.setColor(colorsSquare[1]);<NEW_LINE>g2.draw(line);<NEW_LINE>line.setLine(scale * p2.x, scale * p2.y, scale * p3.x, scale * p3.y);<NEW_LINE>g2.setColor(colorsSquare[2]);<NEW_LINE>g2.draw(line);<NEW_LINE>line.setLine(scale * p3.x, scale * p3.y, scale * p0.x, scale * p0.y);<NEW_LINE>g2.setColor(colorsSquare[3]);<NEW_LINE>g2.draw(line);<NEW_LINE>}<NEW_LINE>}
x, scale * p1.y);
770,389
private static void uploadProduct(String tableName, String productIndex) {<NEW_LINE>try {<NEW_LINE>// Add a book.<NEW_LINE>Map<String, AttributeValue> item = new HashMap<String, AttributeValue>();<NEW_LINE>item.put("Id", new AttributeValue().withN(productIndex));<NEW_LINE>item.put("Title", new AttributeValue().withS<MASK><NEW_LINE>item.put("ISBN", new AttributeValue().withS("111-1111111111"));<NEW_LINE>item.put("Authors", new AttributeValue().withSS(Arrays.asList("Author1")));<NEW_LINE>item.put("Price", new AttributeValue().withN("2"));<NEW_LINE>item.put("Dimensions", new AttributeValue().withS("8.5 x 11.0 x 0.5"));<NEW_LINE>item.put("PageCount", new AttributeValue().withN("500"));<NEW_LINE>item.put("InPublication", new AttributeValue().withBOOL(true));<NEW_LINE>item.put("ProductCategory", new AttributeValue().withS("Book"));<NEW_LINE>PutItemRequest itemRequest = new PutItemRequest().withTableName(tableName).withItem(item);<NEW_LINE>client.putItem(itemRequest);<NEW_LINE>item.clear();<NEW_LINE>} catch (AmazonServiceException ase) {<NEW_LINE>System.err.println("Failed to create item " + productIndex + " in " + tableName);<NEW_LINE>}<NEW_LINE>}
("Book " + productIndex + " Title"));
1,499,750
public static void main(String[] arg) {<NEW_LINE>if (arg.length != 1 && arg.length != 2) {<NEW_LINE>System.err.println("Usage - java " + Password.class.getName() + " [<user>] <password>");<NEW_LINE>System.err.println("If the password is ?, the user will be prompted for the password");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>String p = arg[arg.length == 1 ? 0 : 1];<NEW_LINE><MASK><NEW_LINE>System.err.println(pw.toString());<NEW_LINE>System.err.println(obfuscate(pw.toString()));<NEW_LINE>System.err.println(Credential.MD5.digest(p));<NEW_LINE>if (arg.length == 2)<NEW_LINE>System.err.println(Credential.Crypt.crypt(arg[0], pw.toString()));<NEW_LINE>System.exit(0);<NEW_LINE>}
Password pw = new Password(p);
504,078
public com.amazonaws.services.devopsguru.model.ConflictException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.devopsguru.model.ConflictException conflictException = new com.amazonaws.services.devopsguru.model.ConflictException(null);<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 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("ResourceId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>conflictException.setResourceId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ResourceType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>conflictException.setResourceType(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 conflictException;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
794,040
private void initTypeName() {<NEW_LINE>this.importsResolver = new ImportsTypeStringResolver(protoclass().declaringType().orNull(), getDeclaringType());<NEW_LINE>this.importsResolver.hierarchyTraversalForUnresolvedTypes(protoclass().environment().round(), this.containingType.extendedClasses(), this.containingType.implementedInterfaces(), this.containingType.unresolvedYetArguments);<NEW_LINE>TypeStringProvider provider = new TypeStringProvider(reporter, element, returnType, importsResolver, protoclass().constitution().generics().vars(), null);<NEW_LINE>provider.sourceExtractionCache = containingType;<NEW_LINE>provider.forAttribute = true;<NEW_LINE>provider.processNestedTypeUseAnnotations = true;<NEW_LINE>provider.process();<NEW_LINE>this.hasSomeUnresolvedTypes = provider.hasSomeUnresovedTypes();<NEW_LINE>this.rawTypeName = provider.rawTypeName();<NEW_LINE>this<MASK><NEW_LINE>this.typeParameters = provider.typeParameters();<NEW_LINE>this.hasTypeVariables = provider.hasTypeVariables;<NEW_LINE>this.nullElements = provider.nullElements;<NEW_LINE>if (provider.nullableTypeAnnotation) {<NEW_LINE>this.nullability = NullabilityAnnotationInfo.forTypeUse();<NEW_LINE>}<NEW_LINE>}
.returnTypeName = provider.returnTypeName();
56,871
private void doPopulatePerson(PersonAccount personObject, Map<String, Object> userInfoProps, Set<String> requestPropNames) {<NEW_LINE>System.out.println(CLASS_NAME + " <doPopulatePerson>, entry, personObject: \n" + personObject.toString());<NEW_LINE>System.out.println(" userInfoProps: " + userInfoProps.toString());<NEW_LINE>System.out.println(" requestPropNames: " + requestPropNames.toString());<NEW_LINE>for (String propName : requestPropNames) {<NEW_LINE>Object propValue = userInfoProps.get(propName);<NEW_LINE>if (propValue != null) {<NEW_LINE>if (propValue instanceof String) {<NEW_LINE>personObject.set(propName, propValue);<NEW_LINE>} else if (propValue instanceof List<?> && !((List<?>) propValue).isEmpty()) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>System.out.println(CLASS_NAME + " un-supported property value type: " + requestPropNames.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println(CLASS_NAME + " <doPopulatePerson>, exit, personObject: \n" + personObject.toString());<NEW_LINE>}
personObject.set(propName, propValue);
858,467
public static void printMap(int loglevel, Map m) {<NEW_LINE>if (debug) {<NEW_LINE>String timestr = "";<NEW_LINE>String[] data = getTraceElements();<NEW_LINE>if (debugging(data[0], loglevel)) {<NEW_LINE>if (timing) {<NEW_LINE>long now = System.currentTimeMillis();<NEW_LINE>timestr = "{" + (now - last) + "} ";<NEW_LINE>last = now;<NEW_LINE>}<NEW_LINE>Iterator i = m.keySet().iterator();<NEW_LINE>String[] lines = new String[m.size()];<NEW_LINE>int j = 0;<NEW_LINE>while (i.hasNext()) {<NEW_LINE><MASK><NEW_LINE>lines[j++] = "\t\t- " + key + " => " + m.get(key);<NEW_LINE>}<NEW_LINE>_print(m.getClass(), loglevel, data[0] + "." + data[1] + "()" + data[2], timestr, "Map:", lines);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Object key = i.next();
873,866
public static GalenActionMutateArguments parse(String[] args) {<NEW_LINE>args = ArgumentsUtils.processSystemProperties(args);<NEW_LINE>Options options = new Options();<NEW_LINE>options.addOption("i", "include", true, "Tags for sections that should be included in test run");<NEW_LINE>options.addOption("e", "exclude", true, "Tags for sections that should be excluded from test run");<NEW_LINE>options.addOption("u", "url", true, "Initial test url");<NEW_LINE>options.addOption("s", "size", true, "Browser window size");<NEW_LINE>options.addOption("o", "offset", true, "Offset for each mutation (default 5)");<NEW_LINE>options.addOption("h", "htmlreport", true, "Path for html output report");<NEW_LINE>options.addOption("j", "jsonreport", true, "Path for json report");<NEW_LINE>options.addOption("g", "testngreport", true, "Path for testng xml report");<NEW_LINE>options.addOption("x", "junitreport", true, "Path for junit xml report");<NEW_LINE>options.addOption("J", "javascript", true, "JavaScript code that should be executed before checking layout");<NEW_LINE>options.addOption("c", "config", true, "Path to config");<NEW_LINE>CommandLineParser parser = new PosixParser();<NEW_LINE>CommandLine cmd;<NEW_LINE>try {<NEW_LINE>cmd = parser.parse(options, args);<NEW_LINE>} catch (MissingArgumentException e) {<NEW_LINE>throw new IllegalArgumentException("Missing value for " + e.getOption().getLongOpt(), e);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>GalenActionMutateArguments arguments = new GalenActionMutateArguments();<NEW_LINE>arguments.setUrl(cmd.getOptionValue("u"));<NEW_LINE>arguments.setScreenSize(GalenUtils.readSize(cmd.getOptionValue("s")));<NEW_LINE>arguments.setJavascript(cmd.getOptionValue("J"));<NEW_LINE>arguments.setHtmlReport(cmd.getOptionValue("h"));<NEW_LINE>arguments.setJsonReport(cmd.getOptionValue("j"));<NEW_LINE>arguments.setTestngReport(cmd.getOptionValue("g"));<NEW_LINE>arguments.setJunitReport(cmd.getOptionValue("x"));<NEW_LINE>arguments.setIncludedTags(convertTags(<MASK><NEW_LINE>arguments.setExcludedTags(convertTags(cmd.getOptionValue("e")));<NEW_LINE>arguments.setPaths(asList(cmd.getArgs()));<NEW_LINE>arguments.setConfig(cmd.getOptionValue("c"));<NEW_LINE>arguments.getMutationOptions().setPositionOffset(Integer.parseInt(cmd.getOptionValue("o", "5")));<NEW_LINE>if (arguments.getPaths().isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("Missing spec files");<NEW_LINE>}<NEW_LINE>return arguments;<NEW_LINE>}
cmd.getOptionValue("i")));
1,428,815
private boolean tryParseTimeZoneNumericUTCOffset() {<NEW_LINE>Matcher matcher = createMatch(patternTimeZoneNumericUTCOffset, rest, true);<NEW_LINE>if (matcher.matches()) {<NEW_LINE>offsetSign = group(rest, matcher, 1);<NEW_LINE>offsetHour = group(rest, matcher, 2);<NEW_LINE>offsetMinute = group(rest, matcher, 4);<NEW_LINE>offsetSecond = <MASK><NEW_LINE>offsetFraction = group(rest, matcher, 6);<NEW_LINE>timeZoneNumericUTCOffset = Strings.substring(context, rest, matcher.start(1), matcher.end(3) != -1 ? matcher.end(3) : Strings.length(rest));<NEW_LINE>if (offsetHour == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// differentiate between "-08" and "-08:00" here!<NEW_LINE>move(offsetMinute != null ? matcher.end(3) : matcher.end(2));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
group(rest, matcher, 5);
715,191
public void configure(B http) throws Exception {<NEW_LINE>OAuth2AuthorizationRequestRedirectFilter authorizationRequestFilter;<NEW_LINE>if (this.authorizationEndpointConfig.authorizationRequestResolver != null) {<NEW_LINE>authorizationRequestFilter = new OAuth2AuthorizationRequestRedirectFilter(this.authorizationEndpointConfig.authorizationRequestResolver);<NEW_LINE>} else {<NEW_LINE>String authorizationRequestBaseUri = this.authorizationEndpointConfig.authorizationRequestBaseUri;<NEW_LINE>if (authorizationRequestBaseUri == null) {<NEW_LINE>authorizationRequestBaseUri = OAuth2AuthorizationRequestRedirectFilter.DEFAULT_AUTHORIZATION_REQUEST_BASE_URI;<NEW_LINE>}<NEW_LINE>authorizationRequestFilter = new OAuth2AuthorizationRequestRedirectFilter(OAuth2ClientConfigurerUtils.getClientRegistrationRepository(this.getBuilder()), authorizationRequestBaseUri);<NEW_LINE>}<NEW_LINE>if (this.authorizationEndpointConfig.authorizationRequestRepository != null) {<NEW_LINE>authorizationRequestFilter.<MASK><NEW_LINE>}<NEW_LINE>RequestCache requestCache = http.getSharedObject(RequestCache.class);<NEW_LINE>if (requestCache != null) {<NEW_LINE>authorizationRequestFilter.setRequestCache(requestCache);<NEW_LINE>}<NEW_LINE>http.addFilter(this.postProcess(authorizationRequestFilter));<NEW_LINE>OAuth2LoginAuthenticationFilter authenticationFilter = this.getAuthenticationFilter();<NEW_LINE>if (this.redirectionEndpointConfig.authorizationResponseBaseUri != null) {<NEW_LINE>authenticationFilter.setFilterProcessesUrl(this.redirectionEndpointConfig.authorizationResponseBaseUri);<NEW_LINE>}<NEW_LINE>if (this.authorizationEndpointConfig.authorizationRequestRepository != null) {<NEW_LINE>authenticationFilter.setAuthorizationRequestRepository(this.authorizationEndpointConfig.authorizationRequestRepository);<NEW_LINE>}<NEW_LINE>super.configure(http);<NEW_LINE>}
setAuthorizationRequestRepository(this.authorizationEndpointConfig.authorizationRequestRepository);
915,901
private void defineRecordTypeNode(BLangRecordTypeNode recordTypeNode) {<NEW_LINE>BRecordType recordType = (BRecordType) recordTypeNode.symbol.type;<NEW_LINE>recordTypeNode.setBType(recordType);<NEW_LINE>// Define all the fields<NEW_LINE>resolveFields(recordType, recordTypeNode);<NEW_LINE>resolveFieldsIncluded(recordType, recordTypeNode);<NEW_LINE>recordType.sealed = recordTypeNode.sealed;<NEW_LINE>if (recordTypeNode.sealed && recordTypeNode.restFieldType != null) {<NEW_LINE>dlog.error(recordTypeNode.restFieldType.pos, DiagnosticErrorCode.REST_FIELD_NOT_ALLOWED_IN_CLOSED_RECORDS);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<BType> fieldTypes = new ArrayList<>(recordType.fields.size());<NEW_LINE>for (BField field : recordType.fields.values()) {<NEW_LINE>BType type = field.type;<NEW_LINE>fieldTypes.add(type);<NEW_LINE>}<NEW_LINE>if (recordTypeNode.restFieldType == null) {<NEW_LINE>symResolver.markParameterizedType(recordType, fieldTypes);<NEW_LINE>if (recordTypeNode.sealed) {<NEW_LINE>recordType.restFieldType = symTable.noType;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>recordType.restFieldType = symTable.anydataType;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>recordType.restFieldType = symResolver.<MASK><NEW_LINE>fieldTypes.add(recordType.restFieldType);<NEW_LINE>symResolver.markParameterizedType(recordType, fieldTypes);<NEW_LINE>}
resolveTypeNode(recordTypeNode.restFieldType, env);
723,856
public static Object unpod(Pod.Value o) {<NEW_LINE>switch(o.getValCase()) {<NEW_LINE>case FLOAT32:<NEW_LINE>return o.getFloat32();<NEW_LINE>case FLOAT64:<NEW_LINE>return o.getFloat64();<NEW_LINE>case UINT:<NEW_LINE>return UnsignedLong.fromLongBits(o.getUint());<NEW_LINE>case SINT:<NEW_LINE>return o.getSint();<NEW_LINE>case UINT8:<NEW_LINE>return o.getUint8();<NEW_LINE>case SINT8:<NEW_LINE>return o.getSint8();<NEW_LINE>case UINT16:<NEW_LINE>return o.getUint16();<NEW_LINE>case SINT16:<NEW_LINE>return o.getSint16();<NEW_LINE>case UINT32:<NEW_LINE>return o.getUint32() & 0xFFFFFFFFL;<NEW_LINE>case SINT32:<NEW_LINE>return o.getSint32();<NEW_LINE>case UINT64:<NEW_LINE>return UnsignedLong.fromLongBits(o.getUint64());<NEW_LINE>case SINT64:<NEW_LINE>return o.getSint64();<NEW_LINE>case BOOL:<NEW_LINE>return o.getBool();<NEW_LINE>case STRING:<NEW_LINE>return o.getString();<NEW_LINE>case UINT8_ARRAY:<NEW_LINE>return o.getUint8Array();<NEW_LINE>case FLOAT32_ARRAY:<NEW_LINE>Pod.Float32Array a = o.getFloat32Array();<NEW_LINE>float[] result = new <MASK><NEW_LINE>for (int i = 0; i < result.length; i++) {<NEW_LINE>result[i] = a.getVal(i);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>default:<NEW_LINE>// TODO handle other arrays<NEW_LINE>throw new UnsupportedOperationException("Cannot unpod: " + o);<NEW_LINE>}<NEW_LINE>}
float[a.getValCount()];
1,413,192
private static Object wrap(final Object obj, final Object homeGlobal, final boolean jsonCompatible) {<NEW_LINE>if (obj instanceof ScriptObject) {<NEW_LINE>if (!(homeGlobal instanceof Global)) {<NEW_LINE>return obj;<NEW_LINE>}<NEW_LINE>final ScriptObject sobj = (ScriptObject) obj;<NEW_LINE>final Global global = (Global) homeGlobal;<NEW_LINE>final ScriptObjectMirror mirror = new ScriptObjectMirror(sobj, global, jsonCompatible);<NEW_LINE>if (jsonCompatible && sobj.isArray()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return mirror;<NEW_LINE>} else if (obj instanceof ConsString) {<NEW_LINE>return obj.toString();<NEW_LINE>} else if (jsonCompatible && obj instanceof ScriptObjectMirror) {<NEW_LINE>// Since choosing JSON compatible representation is an explicit decision on user's part, if we're asked to<NEW_LINE>// wrap a mirror that was not JSON compatible, explicitly create its compatible counterpart following the<NEW_LINE>// principle of least surprise.<NEW_LINE>return ((ScriptObjectMirror) obj).asJSONCompatible();<NEW_LINE>}<NEW_LINE>return obj;<NEW_LINE>}
return new JSONListAdapter(mirror, global);
341,967
public void visitClass(final ClassNode node) {<NEW_LINE>this.classNode = node;<NEW_LINE>// GRECLIPSE add -- GROOVY-5106<NEW_LINE>checkForDuplicateInterfaces(node);<NEW_LINE>// GRECLIPSE end<NEW_LINE>if (classNode.isInterface() || Traits.isTrait(node)) {<NEW_LINE>// maybe possible to have this true in joint compilation mode<NEW_LINE>// interfaces have no constructors, but this code expects one,<NEW_LINE>// so create a dummy and don't add it to the class node<NEW_LINE>ConstructorNode dummy <MASK><NEW_LINE>addInitialization(node, dummy);<NEW_LINE>node.visitContents(this);<NEW_LINE>if (classNode.getNodeMetaData(ClassNodeSkip.class) == null) {<NEW_LINE>classNode.setNodeMetaData(ClassNodeSkip.class, true);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>addDefaultParameterMethods(node);<NEW_LINE>addDefaultParameterConstructors(node);<NEW_LINE>final String classInternalName = BytecodeHelper.getClassInternalName(node);<NEW_LINE>addStaticMetaClassField(node, classInternalName);<NEW_LINE>boolean knownSpecialCase = node.isDerivedFrom(ClassHelper.GSTRING_TYPE) || node.isDerivedFrom(ClassHelper.GROOVY_OBJECT_SUPPORT_TYPE);<NEW_LINE>addFastPathHelperFieldsAndHelperMethod(node, classInternalName, knownSpecialCase);<NEW_LINE>if (!knownSpecialCase)<NEW_LINE>addGroovyObjectInterfaceAndMethods(node, classInternalName);<NEW_LINE>addDefaultConstructor(node);<NEW_LINE>addInitialization(node);<NEW_LINE>checkReturnInObjectInitializer(node.getObjectInitializerStatements());<NEW_LINE>node.getObjectInitializerStatements().clear();<NEW_LINE>node.visitContents(this);<NEW_LINE>checkForDuplicateMethods(node);<NEW_LINE>addCovariantMethods(node);<NEW_LINE>checkFinalVariables(node);<NEW_LINE>}
= new ConstructorNode(0, null);
1,340,007
public static Documentation parseSection(@NonNull final String html, @NonNull final URL url) {<NEW_LINE>final String ref = url.getRef();<NEW_LINE>if (ref != null && !ref.isEmpty()) {<NEW_LINE>// NOI18N<NEW_LINE>final Pattern p = Pattern.compile("<h(\\d)\\s+id\\s*=\\s*[\"']" + Pattern.quote(ref) + "[\"']");<NEW_LINE>final Matcher m = p.matcher(html);<NEW_LINE>if (m.find()) {<NEW_LINE>try {<NEW_LINE>final int start = m.start();<NEW_LINE>final int headerType = Integer.parseInt(m.group(1));<NEW_LINE>int end = m.end();<NEW_LINE>do {<NEW_LINE>// NOI18N<NEW_LINE>end = html.indexOf("<h", end + 1);<NEW_LINE>if (end < 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (html.charAt(end + 2) - '0' <= headerType) {<NEW_LINE>// NOI18N<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} while (true);<NEW_LINE>return Documentation.create(html.substring(start, end < 0 ? html.length<MASK><NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.// NOI18N<NEW_LINE>log(// NOI18N<NEW_LINE>Level.WARNING, "Wrong documentation header: {0}", m.group(0));<NEW_LINE>// pass<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Documentation.create(html, url);<NEW_LINE>}
() : end), url);
800,564
private void attemptCompositeUniqueSpProcessing(@Nonnull SearchParameterMap theParams, RequestDetails theRequest) {<NEW_LINE>// Since we're going to remove elements below<NEW_LINE>theParams.values().forEach(nextAndList -> ensureSubListsAreWritable(nextAndList));<NEW_LINE>List<RuntimeSearchParam> activeUniqueSearchParams = mySearchParamRegistry.getActiveComboSearchParams(myResourceName, theParams.keySet());<NEW_LINE>if (activeUniqueSearchParams.size() > 0) {<NEW_LINE>Validate.isTrue(activeUniqueSearchParams.get(0).getComboSearchParamType() == ComboSearchParamType.UNIQUE, "Non unique combo parameters are not supported with the legacy search builder");<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(myResourceName);<NEW_LINE>sb.append("?");<NEW_LINE>boolean first = true;<NEW_LINE>ArrayList<String> keys = new ArrayList<>(theParams.keySet());<NEW_LINE>Collections.sort(keys);<NEW_LINE>for (String nextParamName : keys) {<NEW_LINE>List<List<IQueryParameterType>> nextValues = theParams.get(nextParamName);<NEW_LINE>nextParamName = UrlUtil.escapeUrlParam(nextParamName);<NEW_LINE>if (nextValues.get(0).size() != 1) {<NEW_LINE>sb = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// Reference params are only eligible for using a composite index if they<NEW_LINE>// are qualified<NEW_LINE>RuntimeSearchParam nextParamDef = mySearchParamRegistry.getActiveSearchParam(myResourceName, nextParamName);<NEW_LINE>if (nextParamDef.getParamType() == RestSearchParameterTypeEnum.REFERENCE) {<NEW_LINE>ReferenceParam param = (ReferenceParam) nextValues.get(0).get(0);<NEW_LINE>if (isBlank(param.getResourceType())) {<NEW_LINE>sb = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<? extends IQueryParameterType> nextAnd = nextValues.remove(0);<NEW_LINE>IQueryParameterType nextOr = nextAnd.remove(0);<NEW_LINE>String <MASK><NEW_LINE>nextOrValue = UrlUtil.escapeUrlParam(nextOrValue);<NEW_LINE>if (first) {<NEW_LINE>first = false;<NEW_LINE>} else {<NEW_LINE>sb.append('&');<NEW_LINE>}<NEW_LINE>sb.append(nextParamName).append('=').append(nextOrValue);<NEW_LINE>}<NEW_LINE>if (sb != null) {<NEW_LINE>String indexString = sb.toString();<NEW_LINE>ourLog.debug("Checking for unique index for query: {}", indexString);<NEW_LINE>// Interceptor broadcast: JPA_PERFTRACE_INFO<NEW_LINE>StorageProcessingMessage msg = new StorageProcessingMessage().setMessage("Using unique index for query for search: " + indexString);<NEW_LINE>HookParams params = new HookParams().add(RequestDetails.class, theRequest).addIfMatchesType(ServletRequestDetails.class, theRequest).add(StorageProcessingMessage.class, msg);<NEW_LINE>CompositeInterceptorBroadcaster.doCallHooks(myInterceptorBroadcaster, theRequest, Pointcut.JPA_PERFTRACE_INFO, params);<NEW_LINE>addPredicateCompositeStringUnique(theParams, indexString, myRequestPartitionId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
nextOrValue = nextOr.getValueAsQueryToken(myContext);
1,416,882
public void mergeChildren(Path source, Path target, CopyOption... options) throws IOException {<NEW_LINE>Path resolvedSource = resolve(source);<NEW_LINE>Path resolvedTarget = resolve(target);<NEW_LINE>walkFileTree(resolvedSource, new FileVisitor<Path>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {<NEW_LINE>Path relative = resolvedSource.relativize(dir);<NEW_LINE>Path destDir = resolvedTarget.resolve(relative);<NEW_LINE>if (!Files.exists(destDir)) {<NEW_LINE>// Short circuit any copying<NEW_LINE>Files.<MASK><NEW_LINE>return FileVisitResult.SKIP_SUBTREE;<NEW_LINE>}<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {<NEW_LINE>if (!attrs.isDirectory()) {<NEW_LINE>Path relative = resolvedSource.relativize(file);<NEW_LINE>Files.move(file, resolvedTarget.resolve(relative), options);<NEW_LINE>}<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult visitFileFailed(Path file, IOException exc) {<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {<NEW_LINE>if (!dir.equals(resolvedSource)) {<NEW_LINE>Files.deleteIfExists(dir);<NEW_LINE>}<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
move(dir, destDir, options);
1,517,579
private void writeChaptersChunks(WrapOutputStream wos) throws IOException {<NEW_LINE>byte[] allContents = contents.toByteArray();<NEW_LINE>byte[] zero16 = new byte[16];<NEW_LINE>Arrays.fill(zero16, 0, zero16.length, (byte) 0);<NEW_LINE>// write each package of content<NEW_LINE>int startPos = 0;<NEW_LINE>int len = 0;<NEW_LINE>int left = 0;<NEW_LINE>int chunkCnt = 0;<NEW_LINE>ByteArrayOutputStream bos = new ByteArrayOutputStream(DEFAULT_CHUNK_INIT_SIZE + 256);<NEW_LINE>List<byte[]> chunkRbList = new <MASK><NEW_LINE>while (startPos < allContents.length) {<NEW_LINE>left = allContents.length - startPos;<NEW_LINE>len = Math.min(DEFAULT_CHUNK_INIT_SIZE, left);<NEW_LINE>bos.reset();<NEW_LINE>DeflaterOutputStream zos = new DeflaterOutputStream(bos);<NEW_LINE>zos.write(allContents, startPos, len);<NEW_LINE>zos.close();<NEW_LINE>byte[] chunk = bos.toByteArray();<NEW_LINE>byte[] rb = UmdUtils.genRandomBytes(4);<NEW_LINE>wos.writeByte('$');<NEW_LINE>// 4 random<NEW_LINE>wos.writeBytes(rb);<NEW_LINE>chunkRbList.add(rb);<NEW_LINE>wos.writeInt(chunk.length + 9);<NEW_LINE>wos.write(chunk);<NEW_LINE>// end of each chunk<NEW_LINE>wos.writeBytes('#', 0xF1, 0, 0, 0x15);<NEW_LINE>wos.write(zero16);<NEW_LINE>startPos += len;<NEW_LINE>chunkCnt++;<NEW_LINE>}<NEW_LINE>// end of all chunks<NEW_LINE>wos.writeBytes('#', 0x81, 0, 0x01, 0x09);<NEW_LINE>// random numbers<NEW_LINE>wos.writeBytes(0, 0, 0, 0);<NEW_LINE>wos.write('$');<NEW_LINE>// random numbers<NEW_LINE>wos.writeBytes(0, 0, 0, 0);<NEW_LINE>wos.writeInt(chunkCnt * 4 + 9);<NEW_LINE>for (int i = chunkCnt - 1; i >= 0; i--) {<NEW_LINE>// random. They are as the same as random numbers in the begin of each chunk<NEW_LINE>// use desc order to output these random<NEW_LINE>wos.writeBytes(chunkRbList.get(i));<NEW_LINE>}<NEW_LINE>}
ArrayList<byte[]>();
1,371,521
private static OutputEventArguments convertToOutputEventArguments(String message, String category, DebugAdapterContext context) {<NEW_LINE>Matcher matcher = STACKTRACE_PATTERN.matcher(message);<NEW_LINE>if (matcher.find()) {<NEW_LINE>String methodField = matcher.group(1);<NEW_LINE>String locationField = matcher.<MASK><NEW_LINE>String fullyQualifiedName = methodField.substring(0, methodField.lastIndexOf("."));<NEW_LINE>String packageName = fullyQualifiedName.lastIndexOf(".") > -1 ? fullyQualifiedName.substring(0, fullyQualifiedName.lastIndexOf(".")) : "";<NEW_LINE>String[] locations = locationField.split(":");<NEW_LINE>String sourceName = locations[0];<NEW_LINE>int lineNumber = Integer.parseInt(locations[1]);<NEW_LINE>String sourcePath = StringUtils.isBlank(packageName) ? sourceName : packageName.replace('.', File.separatorChar) + File.separatorChar + sourceName;<NEW_LINE>Source source = null;<NEW_LINE>try {<NEW_LINE>source = NbSourceProvider.convertDebuggerSourceToClient(fullyQualifiedName, sourceName, sourcePath, context);<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>// do nothing.<NEW_LINE>}<NEW_LINE>OutputEventArguments args = new OutputEventArguments();<NEW_LINE>args.setCategory(category);<NEW_LINE>args.setOutput(message);<NEW_LINE>args.setSource(source);<NEW_LINE>args.setLine(lineNumber);<NEW_LINE>return args;<NEW_LINE>}<NEW_LINE>OutputEventArguments args = new OutputEventArguments();<NEW_LINE>args.setCategory(category);<NEW_LINE>args.setOutput(message);<NEW_LINE>return args;<NEW_LINE>}
group(matcher.groupCount());
1,302,711
public static void jacobian_Control3(DMatrixRMaj L_full, double[] beta, DMatrixRMaj A) {<NEW_LINE>// @formatter:off<NEW_LINE>int indexA = 0;<NEW_LINE>double b0 = beta[0], b1 = beta[1], b2 = beta[2];<NEW_LINE>final double[] ld = L_full.data;<NEW_LINE>for (int i = 0; i < 3; i++) {<NEW_LINE>int li = L_full.numCols * i;<NEW_LINE>A.data[indexA++] = 2 * ld[li + 0] * b0 + ld[li + 1] * b1 + <MASK><NEW_LINE>A.data[indexA++] = ld[li + 1] * b0 + 2 * ld[li + 3] * b1 + ld[li + 4] * b2;<NEW_LINE>A.data[indexA++] = ld[li + 2] * b0 + ld[li + 4] * b1 + 2 * ld[li + 5] * b2;<NEW_LINE>}<NEW_LINE>// @formatter:on<NEW_LINE>}
ld[li + 2] * b2;
704,554
private List<Point2D> routeUpwardLoop(LayoutLocationMap<FGVertex, FGEdge> layoutToGridMap, Vertex2dFactory vertex2dFactory, Vertex2d start, Vertex2d end, DecompilerBlock loop) {<NEW_LINE>Set<FGVertex> loopVertices = loop.getVertices();<NEW_LINE>FGVertex rightmostLoopVertex = getRightmostVertex(layoutToGridMap, vertex2dFactory, loopVertices);<NEW_LINE>int startRow = start.rowIndex;<NEW_LINE>int endRow = end.rowIndex;<NEW_LINE>int startColumn = Math.min(start.columnIndex, end.columnIndex);<NEW_LINE>int endColumn = Math.max(<MASK><NEW_LINE>Column rightmostLoopColumn = layoutToGridMap.col(rightmostLoopVertex);<NEW_LINE>endColumn = Math.max(endColumn, rightmostLoopColumn.index);<NEW_LINE>// Look for any vertices that are no part of the loop, but are placed inside<NEW_LINE>// of the loop bounds. This can happen in a graph when the decompiler uses<NEW_LINE>// goto statements. Use the loop's rightmost vertex to establish the loops<NEW_LINE>// right edge and then use that to check for any stray non-loop vertices.<NEW_LINE>List<Vertex2d> interlopers = getVerticesInBounds(vertex2dFactory, startRow, endRow, startColumn, endColumn);<NEW_LINE>// place the right x position to the right of the rightmost vertex, not<NEW_LINE>// extending past the next column<NEW_LINE>FGVertex rightmostVertex = getRightmostVertex(interlopers);<NEW_LINE>Column rightmostColumn = layoutToGridMap.col(rightmostVertex);<NEW_LINE>Column nextColumn = layoutToGridMap.nextColumn(rightmostColumn);<NEW_LINE>Vertex2d rightmostV2d = vertex2dFactory.get(rightmostVertex);<NEW_LINE>// the padding used for these two lines is somewhat arbitrary and may be changed<NEW_LINE>double rightSide = rightmostV2d.getRight() + GraphViewerUtils.EXTRA_LAYOUT_COLUMN_SPACING;<NEW_LINE>double x = Math.min(rightSide, nextColumn.x - GraphViewerUtils.EXTRA_LAYOUT_COLUMN_SPACING_CONDENSED);<NEW_LINE>List<Point2D> articulations = routeLoopEdge(start, end, x);<NEW_LINE>return articulations;<NEW_LINE>}
start.columnIndex, end.columnIndex);
661,705
public static void asyncHttpRequest(String url, List<String> headers, Map<String, String> paramValues, Callback<String> callback, String method) throws Exception {<NEW_LINE>Query query = Query.newInstance().initParams(paramValues);<NEW_LINE>query.addParam(FieldsConstants.ENCODING, ENCODING);<NEW_LINE>query.addParam(FieldsConstants.NOFIX, NOFIX);<NEW_LINE>Header header = Header.newInstance();<NEW_LINE>if (CollectionUtils.isNotEmpty(headers)) {<NEW_LINE>header.addAll(headers);<NEW_LINE>}<NEW_LINE>header.addParam(HttpHeaderConsts.ACCEPT_CHARSET, "UTF-8");<NEW_LINE>AuthHeaderUtil.addIdentityToHeader(header);<NEW_LINE>switch(method) {<NEW_LINE>case HttpMethod.GET:<NEW_LINE>ASYNC_REST_TEMPLATE.get(url, header, query, String.class, callback);<NEW_LINE>break;<NEW_LINE>case HttpMethod.POST:<NEW_LINE>ASYNC_REST_TEMPLATE.postForm(url, header, <MASK><NEW_LINE>break;<NEW_LINE>case HttpMethod.PUT:<NEW_LINE>ASYNC_REST_TEMPLATE.putForm(url, header, paramValues, String.class, callback);<NEW_LINE>break;<NEW_LINE>case HttpMethod.DELETE:<NEW_LINE>ASYNC_REST_TEMPLATE.delete(url, header, query, String.class, callback);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new RuntimeException("not supported method:" + method);<NEW_LINE>}<NEW_LINE>}
paramValues, String.class, callback);
1,459,656
public void startListening(Project project, J2eeModuleProvider j2eeProvider) {<NEW_LINE>synchronized (this) {<NEW_LINE>if (compileListeners.containsKey(j2eeProvider)) {<NEW_LINE>// this is due to EAR childs :(<NEW_LINE>if (j2eeProvider instanceof J2eeApplicationProvider) {<NEW_LINE>stopListening(project, j2eeProvider);<NEW_LINE>} else {<NEW_LINE>LOGGER.log(Level.FINE, "Already listening on {0}", j2eeProvider);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<J2eeModuleProvider> providers = new ArrayList<>(4);<NEW_LINE>providers.add(j2eeProvider);<NEW_LINE>if (j2eeProvider instanceof J2eeApplicationProvider) {<NEW_LINE>Collections.addAll(providers, ((J2eeApplicationProvider<MASK><NEW_LINE>}<NEW_LINE>// get all binary urls<NEW_LINE>List<URL> urls = new ArrayList<>();<NEW_LINE>for (J2eeModuleProvider provider : providers) {<NEW_LINE>for (FileObject file : provider.getSourceFileMap().getSourceRoots()) {<NEW_LINE>URL url = URLMapper.findURL(file, URLMapper.EXTERNAL);<NEW_LINE>if (url != null) {<NEW_LINE>urls.add(url);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// register CLASS listener<NEW_LINE>CompileOnSaveListener listener = new CompileOnSaveListener(project, j2eeProvider, urls);<NEW_LINE>for (URL url : urls) {<NEW_LINE>BuildArtifactMapper.addArtifactsUpdatedListener(url, listener);<NEW_LINE>}<NEW_LINE>compileListeners.put(j2eeProvider, listener);<NEW_LINE>// register WEB listener<NEW_LINE>J2eeModuleProvider.DeployOnSaveSupport support = j2eeProvider.getDeployOnSaveSupport();<NEW_LINE>if (support != null) {<NEW_LINE>CopyOnSaveListener copyListener = new CopyOnSaveListener(project, j2eeProvider);<NEW_LINE>support.addArtifactListener(copyListener);<NEW_LINE>copyListeners.put(j2eeProvider, copyListener);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
) j2eeProvider).getChildModuleProviders());
700,300
public void createControl(Composite composite) {<NEW_LINE>controlModifyListener = new ControlsListener();<NEW_LINE>Composite addrGroup = new Composite(composite, SWT.NONE);<NEW_LINE>addrGroup.setLayout(new GridLayout(1, false));<NEW_LINE>addrGroup.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>UIUtils.createControlLabel(addrGroup, OracleUIMessages.dialog_connection_connection_type_group);<NEW_LINE>connectionTypeFolder = new TabFolder(addrGroup, SWT.TOP | SWT.MULTI);<NEW_LINE>connectionTypeFolder.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>createBasicConnectionControls(connectionTypeFolder);<NEW_LINE>createTNSConnectionControls(connectionTypeFolder);<NEW_LINE>createCustomConnectionControls(connectionTypeFolder);<NEW_LINE>connectionTypeFolder.setSelection(connectionType.ordinal());<NEW_LINE>connectionTypeFolder.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>connectionType = (OracleConstants.ConnectionType) connectionTypeFolder.getSelection()[0].getData();<NEW_LINE>site.getActiveDataSource().getConnectionConfiguration().setProviderProperty(OracleConstants.PROP_CONNECTION_TYPE, connectionType.name());<NEW_LINE>updateUI();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>createAuthPanel(addrGroup, 1);<NEW_LINE>Composite bottomControls = UIUtils.createPlaceholder(addrGroup, 3);<NEW_LINE>bottomControls.setLayoutData(<MASK><NEW_LINE>if (!DBWorkbench.getPlatform().getApplication().hasProductFeature(DBConstants.PRODUCT_FEATURE_SIMPLE_DATABASE_ADMINISTRATION)) {<NEW_LINE>createClientHomeGroup(bottomControls);<NEW_LINE>}<NEW_LINE>createDriverPanel(addrGroup);<NEW_LINE>setControl(addrGroup);<NEW_LINE>}
new GridData(GridData.FILL_HORIZONTAL));
1,029,075
final ModifyCacheParameterGroupResult executeModifyCacheParameterGroup(ModifyCacheParameterGroupRequest modifyCacheParameterGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyCacheParameterGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyCacheParameterGroupRequest> request = null;<NEW_LINE>Response<ModifyCacheParameterGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyCacheParameterGroupRequestMarshaller().marshall(super.beforeMarshalling(modifyCacheParameterGroupRequest));<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, "ElastiCache");<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>StaxResponseHandler<ModifyCacheParameterGroupResult> responseHandler = new StaxResponseHandler<ModifyCacheParameterGroupResult>(new ModifyCacheParameterGroupResultStaxUnmarshaller());<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, "ModifyCacheParameterGroup");
925,475
public void onrequest(HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "p", required = false) String p) {<NEW_LINE>Payload payload = new Payload(request, response);<NEW_LINE>payload.setPattern("/afx/worker/");<NEW_LINE>String finalURI = payload.getFinalURI();<NEW_LINE>Optional<String> optional = Optional.ofNullable(payload.getRequestURI()).filter(e -> e.endsWith("resource.afx"));<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>finalURI = payload.param("path");<NEW_LINE>}<NEW_LINE>if (finalURI.matches(".*\\.(asc|asciidoc|ad|adoc|md|markdown)$")) {<NEW_LINE>if (controller.getIncludeAsciidocResource()) {<NEW_LINE>payload.write(String.format("link:%s[]", finalURI));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (finalURI.startsWith("//")) {<NEW_LINE>finalURI = finalURI.replace("//", "http://");<NEW_LINE>}<NEW_LINE>if (finalURI.startsWith("http://") || finalURI.startsWith("https://")) {<NEW_LINE>String data = "";<NEW_LINE>try {<NEW_LINE>data = restTemplate.<MASK><NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.warn("resource not found or not readable: {}", finalURI);<NEW_LINE>}<NEW_LINE>payload.write(data);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>Path found = directoryService.findPathInWorkdirOrLookup(IOHelper.getPath(finalURI));<NEW_LINE>if (Objects.nonNull(found)) {<NEW_LINE>fileService.processFile(request, response, found);<NEW_LINE>} else {<NEW_LINE>Path path = directoryService.findPathInPublic(finalURI);<NEW_LINE>fileService.processFile(request, response, path);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>commonResource.processPayload(payload);<NEW_LINE>}
getForObject(finalURI, String.class);
1,074,059
public RequestFuture requestFuture(Request request) throws NacosException {<NEW_LINE>Payload grpcRequest = GrpcUtils.convert(request);<NEW_LINE>final ListenableFuture<Payload> requestFuture = grpcFutureServiceStub.request(grpcRequest);<NEW_LINE>return new RequestFuture() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isDone() {<NEW_LINE>return requestFuture.isDone();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Response get() throws Exception {<NEW_LINE>Payload grpcResponse = requestFuture.get();<NEW_LINE>Response response = (Response) GrpcUtils.parse(grpcResponse);<NEW_LINE>if (response instanceof ErrorResponse) {<NEW_LINE>throw new NacosException(response.getErrorCode(), response.getMessage());<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Response get(long timeout) throws Exception {<NEW_LINE>Payload grpcResponse = requestFuture.<MASK><NEW_LINE>Response response = (Response) GrpcUtils.parse(grpcResponse);<NEW_LINE>if (response instanceof ErrorResponse) {<NEW_LINE>throw new NacosException(response.getErrorCode(), response.getMessage());<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
get(timeout, TimeUnit.MILLISECONDS);
256,901
private List<PHPDocVarTypeTag> findMethodParams(String description, int startOfDescription) {<NEW_LINE>List<PHPDocVarTypeTag> result = new ArrayList();<NEW_LINE>int position = startOfDescription;<NEW_LINE>ParametersExtractor parametersExtractor = ParametersExtractorImpl.create();<NEW_LINE>String parameters = parametersExtractor.extract(description);<NEW_LINE>position += parametersExtractor.getPosition();<NEW_LINE>if (parameters.length() > 0) {<NEW_LINE>// NOI18N<NEW_LINE>String[] tokens = parameters.split("[,]+");<NEW_LINE>String paramName;<NEW_LINE>for (String token : tokens) {<NEW_LINE>paramName = getVaribleName(token.trim());<NEW_LINE>if (paramName != null) {<NEW_LINE>int startOfParamName = findStartOfDocNode(description, startOfDescription, paramName, position);<NEW_LINE>if (startOfParamName != -1) {<NEW_LINE>PHPDocNode paramNameNode = new PHPDocNode(startOfParamName, startOfParamName + paramName.length(), paramName);<NEW_LINE>List<PHPDocTypeNode> types = token.trim().indexOf(' ') > -1 ? findTypes(token, position, description, startOfDescription) : Collections.EMPTY_LIST;<NEW_LINE>result.add(new PHPDocVarTypeTag(position, startOfParamName + paramName.length(), PHPDocTag.Type.PARAM<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>position = position + token.length() + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
, token, types, paramNameNode));
1,834,556
public ApiResponse<List<InvoiceInfo>> billingGetInvoiceHeadersWithHttpInfo() throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/billing/invoices";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new <MASK><NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "text/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<List<InvoiceInfo>> localVarReturnType = new GenericType<List<InvoiceInfo>>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
HashMap<String, String>();
1,290,439
private boolean updateDisplayText(ListCell<T> cell, T item, boolean empty) {<NEW_LINE>if (empty) {<NEW_LINE>// create empty cell<NEW_LINE>if (cell == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>cell.setGraphic(null);<NEW_LINE>cell.setText(null);<NEW_LINE>return true;<NEW_LINE>} else if (item instanceof Node) {<NEW_LINE><MASK><NEW_LINE>Node newNode = (Node) item;<NEW_LINE>// create a node from the selected node of the listview<NEW_LINE>// using JFXComboBox {@link #nodeConverterProperty() NodeConverter})<NEW_LINE>NodeConverter<T> nc = this.getNodeConverter();<NEW_LINE>Node node = nc == null ? null : nc.toNode(item);<NEW_LINE>if (currentNode == null || !currentNode.equals(newNode)) {<NEW_LINE>cell.setText(null);<NEW_LINE>cell.setGraphic(node == null ? newNode : node);<NEW_LINE>}<NEW_LINE>return node == null;<NEW_LINE>} else {<NEW_LINE>// run item through StringConverter if it isn't null<NEW_LINE>StringConverter<T> c = this.getConverter();<NEW_LINE>String s = item == null ? this.getPromptText() : (c == null ? item.toString() : c.toString(item));<NEW_LINE>cell.setText(s);<NEW_LINE>cell.setGraphic(null);<NEW_LINE>return s == null || s.isEmpty();<NEW_LINE>}<NEW_LINE>}
Node currentNode = cell.getGraphic();
190,996
private Map<String, Integer> assignAttrIds(int attrTypeId) {<NEW_LINE>// Attrs are special, since they can be defined within a declare-styleable. Those are sorted<NEW_LINE>// after top-level definitions.<NEW_LINE>if (!innerClasses.containsKey(ResourceType.ATTR)) {<NEW_LINE>return ImmutableMap.of();<NEW_LINE>}<NEW_LINE>Map<String, Integer> attrToId = Maps.newLinkedHashMapWithExpectedSize(innerClasses.get(ResourceType.ATTR).size());<NEW_LINE>// After assigning public IDs, we count up monotonically, so we don't need to track additional<NEW_LINE>// assignedIds to avoid collisions (use an ImmutableSet to ensure we don't add more).<NEW_LINE>Set<Integer> assignedIds = ImmutableSet.of();<NEW_LINE>Set<String> inlineAttrs = new LinkedHashSet<>();<NEW_LINE>Set<String> styleablesWithInlineAttrs = new TreeSet<>();<NEW_LINE>for (Map.Entry<String, Map<String, Boolean>> styleableAttrEntry : styleableAttrs.entrySet()) {<NEW_LINE>Map<String, Boolean> attrs = styleableAttrEntry.getValue();<NEW_LINE>for (Map.Entry<String, Boolean> attrEntry : attrs.entrySet()) {<NEW_LINE>if (attrEntry.getValue()) {<NEW_LINE>inlineAttrs.add(attrEntry.getKey());<NEW_LINE>styleablesWithInlineAttrs.add(styleableAttrEntry.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int nextId = nextFreeId(getInitialIdForTypeId(attrTypeId), assignedIds);<NEW_LINE>// Technically, aapt assigns based on declaration order, but the merge should have sorted<NEW_LINE>// the non-inline attributes, so assigning by sorted order is the same.<NEW_LINE>SortedMap<String, ?> sortedAttrs = innerClasses.get(ResourceType.ATTR);<NEW_LINE>for (String attr : sortedAttrs.keySet()) {<NEW_LINE>if (!inlineAttrs.contains(attr) && !attrToId.containsKey(attr)) {<NEW_LINE>attrToId.put(attr, nextId);<NEW_LINE>nextId = nextFreeId(nextId + 1, assignedIds);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String styleable : styleablesWithInlineAttrs) {<NEW_LINE>Map<String, Boolean> attrs = styleableAttrs.get(styleable);<NEW_LINE>for (Map.Entry<String, Boolean> attrEntry : attrs.entrySet()) {<NEW_LINE>if (attrEntry.getValue() && !attrToId.containsKey(attrEntry.getKey())) {<NEW_LINE>attrToId.put(attrEntry.getKey(), nextId);<NEW_LINE>nextId = <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ImmutableMap.copyOf(attrToId);<NEW_LINE>}
nextFreeId(nextId + 1, assignedIds);
1,643,387
protected String doIt() throws Exception {<NEW_LINE>if (migration == null || migration.getAD_Migration_ID() <= 0) {<NEW_LINE>throw new AdempiereException("@NotFound@ @AD_Migration_ID@");<NEW_LINE>}<NEW_LINE>final SingletonMigrationLoggerContext migrationCtx = new SingletonMigrationLoggerContext(migration);<NEW_LINE>migrationCtx.setGenerateComments(false);<NEW_LINE>final IMigrationLogger migrationLogger = <MASK><NEW_LINE>final Iterator<I_AD_Table> tables = retrieveTablesWithEntityType();<NEW_LINE>for (final I_AD_Table table : IteratorUtils.asIterable(tables)) {<NEW_LINE>final Iterator<PO> records = retrieveRecordsForEntityType(table, entityType);<NEW_LINE>for (final PO record : IteratorUtils.asIterable(records)) {<NEW_LINE>DB.saveConstraints();<NEW_LINE>DB.getConstraints().addAllowedTrxNamePrefix("POSave");<NEW_LINE>try {<NEW_LINE>migrationLogger.logMigration(migrationCtx, record, record.getPOInfo(), X_AD_MigrationStep.ACTION_Insert);<NEW_LINE>logDependents(migrationCtx, migrationLogger, record);<NEW_LINE>} finally {<NEW_LINE>DB.restoreConstraints();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>migration.setIsDeferredConstraints(true);<NEW_LINE>InterfaceWrapperHelper.save(migration);<NEW_LINE>return "OK";<NEW_LINE>}
Services.get(IMigrationLogger.class);
517,980
public VertexLabel readVertexLabel(HugeGraph graph, BackendEntry backendEntry) {<NEW_LINE>if (backendEntry == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TextBackendEntry entry = this.convertEntry(backendEntry);<NEW_LINE>Id id = readId(entry.id());<NEW_LINE>String name = JsonUtil.fromJson(entry.column(HugeKeys<MASK><NEW_LINE>String idStrategy = entry.column(HugeKeys.ID_STRATEGY);<NEW_LINE>String properties = entry.column(HugeKeys.PROPERTIES);<NEW_LINE>String primaryKeys = entry.column(HugeKeys.PRIMARY_KEYS);<NEW_LINE>String nullableKeys = entry.column(HugeKeys.NULLABLE_KEYS);<NEW_LINE>String indexLabels = entry.column(HugeKeys.INDEX_LABELS);<NEW_LINE>String enableLabelIndex = entry.column(HugeKeys.ENABLE_LABEL_INDEX);<NEW_LINE>String status = entry.column(HugeKeys.STATUS);<NEW_LINE>VertexLabel vertexLabel = new VertexLabel(graph, id, name);<NEW_LINE>vertexLabel.idStrategy(JsonUtil.fromJson(idStrategy, IdStrategy.class));<NEW_LINE>vertexLabel.properties(readIds(properties));<NEW_LINE>vertexLabel.primaryKeys(readIds(primaryKeys));<NEW_LINE>vertexLabel.nullableKeys(readIds(nullableKeys));<NEW_LINE>vertexLabel.addIndexLabels(readIds(indexLabels));<NEW_LINE>vertexLabel.enableLabelIndex(JsonUtil.fromJson(enableLabelIndex, Boolean.class));<NEW_LINE>readUserdata(vertexLabel, entry);<NEW_LINE>vertexLabel.status(JsonUtil.fromJson(status, SchemaStatus.class));<NEW_LINE>return vertexLabel;<NEW_LINE>}
.NAME), String.class);
681,292
private void addCreateNewImageProposal(final JavaContentAssistInvocationContext javaContext, ArrayList<ICompletionProposal> proposals, String prefix, int offset, int length) {<NEW_LINE>final IContainer parent = UmletPluginUtils.getCompilationUnitParent(javaContext.getCompilationUnit());<NEW_LINE>if (parent == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// no empty files<NEW_LINE>if (prefix.length() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final IFile uxfFile = parent.getFile(new Path("doc-files/" + prefix + ".uxf"));<NEW_LINE>if (uxfFile.exists()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>proposals.add(new ReplacementProposal("Create and link new Umlet diagram doc-files/" + prefix + ".uxf", "<img src=\"doc-files/" + prefix + ".png\" alt=\"\">", offset, length) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void apply(IDocument document) {<NEW_LINE>super.apply(document);<NEW_LINE>try {<NEW_LINE>// create doc-files folder<NEW_LINE>IFolder docFiles = parent.<MASK><NEW_LINE>if (!docFiles.exists()) {<NEW_LINE>docFiles.create(true, true, null);<NEW_LINE>}<NEW_LINE>// create image file<NEW_LINE>{<NEW_LINE>InputStream stream = null;<NEW_LINE>try {<NEW_LINE>stream = NewWizard.openContentStream();<NEW_LINE>uxfFile.create(stream, true, null);<NEW_LINE>stream.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>// ignore<NEW_LINE>} finally {<NEW_LINE>if (stream != null) {<NEW_LINE>try {<NEW_LINE>stream.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>// swallow<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// open editor<NEW_LINE>IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();<NEW_LINE>IDE.openEditor(page, uxfFile, true);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}.setAutoInsertable(false));<NEW_LINE>}
getFolder(new Path("doc-files"));
1,463,368
public String createUpdateQuery(KunderaQuery kunderaQuery) {<NEW_LINE><MASK><NEW_LINE>MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(metadata.getPersistenceUnit());<NEW_LINE>CQLTranslator translator = new CQLTranslator();<NEW_LINE>String update_Query = translator.UPDATE_QUERY;<NEW_LINE>String tableName = metadata.getTableName();<NEW_LINE>update_Query = StringUtils.replace(update_Query, CQLTranslator.COLUMN_FAMILY, translator.ensureCase(new StringBuilder(), tableName, false).toString());<NEW_LINE>StringBuilder builder = new StringBuilder(update_Query);<NEW_LINE>Object ttlColumns = ((CassandraClientBase) persistenceDelegeator.getClient(metadata)).getTtlValues().get(metadata.getTableName());<NEW_LINE>if ((ttlColumns != null && ttlColumns instanceof Integer) || this.ttl != null) {<NEW_LINE>int ttl = this.ttl != null ? this.ttl : ((Integer) ttlColumns).intValue();<NEW_LINE>if (ttl != 0) {<NEW_LINE>builder.append(" USING TTL ");<NEW_LINE>builder.append(ttl);<NEW_LINE>builder.append(" ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.append(CQLTranslator.ADD_SET_CLAUSE);<NEW_LINE>for (UpdateClause updateClause : kunderaQuery.getUpdateClauseQueue()) {<NEW_LINE>String property = updateClause.getProperty();<NEW_LINE>String jpaColumnName = getColumnName(metadata, property);<NEW_LINE>Object value = updateClause.getValue();<NEW_LINE>translator.buildSetClause(metadata, builder, jpaColumnName, value);<NEW_LINE>}<NEW_LINE>builder.delete(builder.lastIndexOf(CQLTranslator.COMMA_STR), builder.length());<NEW_LINE>builder.append(CQLTranslator.ADD_WHERE_CLAUSE);<NEW_LINE>Class compoundKeyClass = metadata.getIdAttribute().getBindableJavaType();<NEW_LINE>EmbeddableType compoundKey = null;<NEW_LINE>String idColumn;<NEW_LINE>if (metaModel.isEmbeddable(compoundKeyClass)) {<NEW_LINE>compoundKey = metaModel.embeddable(compoundKeyClass);<NEW_LINE>idColumn = ((AbstractAttribute) metadata.getIdAttribute()).getJPAColumnName();<NEW_LINE>} else {<NEW_LINE>idColumn = ((AbstractAttribute) metadata.getIdAttribute()).getJPAColumnName();<NEW_LINE>}<NEW_LINE>onCondition(metadata, metaModel, compoundKey, idColumn, builder, false, translator, false);<NEW_LINE>return builder.toString();<NEW_LINE>}
EntityMetadata metadata = kunderaQuery.getEntityMetadata();
1,725,004
public static UnSubscribeRequestHeader buildHeader(Map<String, Object> headerParam) {<NEW_LINE>UnSubscribeRequestHeader header = new UnSubscribeRequestHeader();<NEW_LINE>header.setCode(MapUtils.getString(headerParam, ProtocolKey.REQUEST_CODE));<NEW_LINE>header.setVersion(ProtocolVersion.get(MapUtils.getString(headerParam, ProtocolKey.VERSION)));<NEW_LINE>String lan = StringUtils.isBlank(MapUtils.getString(headerParam, ProtocolKey.LANGUAGE)) ? Constants.LANGUAGE_JAVA : MapUtils.getString(headerParam, ProtocolKey.LANGUAGE);<NEW_LINE>header.setLanguage(lan);<NEW_LINE>header.setEnv(MapUtils.getString(headerParam, ProtocolKey.ClientInstanceKey.ENV));<NEW_LINE>header.setIdc(MapUtils.getString(headerParam, ProtocolKey.ClientInstanceKey.IDC));<NEW_LINE>header.setSys(MapUtils.getString(headerParam, ProtocolKey.ClientInstanceKey.SYS));<NEW_LINE>header.setPid(MapUtils.getString(headerParam, ProtocolKey.ClientInstanceKey.PID));<NEW_LINE>header.setIp(MapUtils.getString(headerParam, ProtocolKey.ClientInstanceKey.IP));<NEW_LINE>header.setUsername(MapUtils.getString(headerParam, ProtocolKey.ClientInstanceKey.USERNAME));<NEW_LINE>header.setPasswd(MapUtils.getString(headerParam<MASK><NEW_LINE>return header;<NEW_LINE>}
, ProtocolKey.ClientInstanceKey.PASSWD));
1,407,255
final RemoveNotificationChannelResult executeRemoveNotificationChannel(RemoveNotificationChannelRequest removeNotificationChannelRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(removeNotificationChannelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RemoveNotificationChannelRequest> request = null;<NEW_LINE>Response<RemoveNotificationChannelResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RemoveNotificationChannelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(removeNotificationChannelRequest));<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, "DevOps Guru");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RemoveNotificationChannel");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RemoveNotificationChannelResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RemoveNotificationChannelResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig);
684,453
private IQualityInvoiceLineGroup createQualityInvoiceLineGroup_WithholdingAmount() {<NEW_LINE>final ILagerKonfQualityBasedConfig config = getQualityBasedConfig();<NEW_LINE>if (config.getOverallNumberOfInvoicings() < 2) {<NEW_LINE>logger.debug("Nothing to do as ILagerKonfQualityBasedConfig {} has OverallNumberOfInvoicings = {}", new Object[] { config, config.getOverallNumberOfInvoicings() });<NEW_LINE>// nothing to do<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final IInvoicingItem withholdingItem = config.getWithholdingProduct();<NEW_LINE>final BigDecimal withholdingBaseAmount = getTotalInvoiceableAmount();<NEW_LINE>final I_M_Product withholdingProduct = withholdingItem.getM_Product();<NEW_LINE>final I_C_UOM withholdingPriceUOM = withholdingItem.getC_UOM();<NEW_LINE>final BigDecimal withholdingAmount;<NEW_LINE>final String labelToUse;<NEW_LINE>if (qualityBasedInvoicingBL.isLastInspection(_qiOrder)) {<NEW_LINE>withholdingAmount = _qiOrder.getAlreadyInvoicedNetSum();<NEW_LINE>// task 08947: the amount was already correct, just use this label<NEW_LINE>labelToUse = "Akonto-Netto";<NEW_LINE>} else {<NEW_LINE>final BigDecimal withholdingPercent = config.getWithholdingPercent();<NEW_LINE>withholdingAmount = // will be fixed when pricing result is created<NEW_LINE>withholdingBaseAmount.multiply(withholdingPercent).// will be fixed when pricing result is created<NEW_LINE>divide(// will be fixed when pricing result is created<NEW_LINE>Env.ONEHUNDRED, // will be fixed when pricing result is created<NEW_LINE>12, RoundingMode.HALF_UP);<NEW_LINE>labelToUse = "Einbehalt " + withholdingPercent.setScale(0, RoundingMode.HALF_UP) + "%";<NEW_LINE>}<NEW_LINE>// Invoice Line Group<NEW_LINE>final QualityInvoiceLineGroup invoiceLineGroup = new QualityInvoiceLineGroup(QualityInvoiceLineGroupType.Withholding);<NEW_LINE>//<NEW_LINE>// Detail: Withholding base<NEW_LINE>{<NEW_LINE>final QualityInvoiceLine detail = new QualityInvoiceLine();<NEW_LINE>invoiceLineGroup.addDetailBefore(detail);<NEW_LINE>detail.setDisplayed(false);<NEW_LINE>// TRL<NEW_LINE>detail.setProductName("Withholding base");<NEW_LINE>detail.setQty(Quantity.of(ONE, withholdingPriceUOM));<NEW_LINE>detail.setM_Product(withholdingProduct);<NEW_LINE>// Pricing<NEW_LINE>final IPricingContext pricingCtx = createPricingContext(detail);<NEW_LINE>final IPricingResult pricingResult = createPricingResult(pricingCtx, withholdingBaseAmount, withholdingPriceUOM);<NEW_LINE>detail.setPrice(pricingResult);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Withholding<NEW_LINE>{<NEW_LINE>final QualityInvoiceLine overridingDetail = new QualityInvoiceLine();<NEW_LINE>invoiceLineGroup.setInvoiceableLineOverride(overridingDetail);<NEW_LINE>overridingDetail.setDisplayed(true);<NEW_LINE>overridingDetail.setProductName(labelToUse);<NEW_LINE>overridingDetail.setM_Product(withholdingProduct);<NEW_LINE>overridingDetail.setQty(Quantity.of(ONE, withholdingPriceUOM));<NEW_LINE>}<NEW_LINE>{<NEW_LINE>final QualityInvoiceLine invoiceableLine = new QualityInvoiceLine();<NEW_LINE>invoiceLineGroup.setInvoiceableLine(invoiceableLine);<NEW_LINE>invoiceableLine.setDisplayed(true);<NEW_LINE>invoiceableLine.setM_Product(withholdingProduct);<NEW_LINE>invoiceableLine.setQty(Quantity<MASK><NEW_LINE>// Pricing<NEW_LINE>final IPricingContext pricingCtx = createPricingContext(invoiceableLine);<NEW_LINE>final IPricingResult pricingResult = createPricingResult(pricingCtx, withholdingAmount.negate(), withholdingPriceUOM);<NEW_LINE>invoiceableLine.setPrice(pricingResult);<NEW_LINE>}<NEW_LINE>addCreatedInvoiceLineGroup(invoiceLineGroup);<NEW_LINE>return invoiceLineGroup;<NEW_LINE>}
.of(ONE, withholdingPriceUOM));
1,450,821
// transactionNames is passed in empty, and populated synchronously by this method<NEW_LINE>private ListenableFuture<?> rollupTransactionSummaryFromChildren(RollupParams rollup, AggregateQuery query, Collection<String> childAgentRollupIds, Multimap<String, String> transactionNames) throws Exception {<NEW_LINE>Map<String, ListenableFuture<ResultSet>> futures = getRowsForSummaryRollupFromChildren(query, childAgentRollupIds, summaryTable, true);<NEW_LINE>Map<String, MutableSummary> summaries = new HashMap<>();<NEW_LINE>for (Map.Entry<String, ListenableFuture<ResultSet>> entry : futures.entrySet()) {<NEW_LINE>String childAgentRollupId = entry.getKey();<NEW_LINE>ResultSet results = entry.getValue().get();<NEW_LINE>for (Row row : results) {<NEW_LINE>String transactionName = mergeRowIntoSummaries(row, summaries);<NEW_LINE>transactionNames.put(transactionName, childAgentRollupId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>}
insertTransactionSummaries(rollup, query, summaries);
335,835
public CloseableIterator<E> createIterator(int skip, int take) {<NEW_LINE>try {<NEW_LINE>StatementListener listener = configuration.getStatementListener();<NEW_LINE>listener.beforeExecuteQuery(statement, sql, boundParameters);<NEW_LINE>ResultSet results = statement.executeQuery();<NEW_LINE>listener.afterExecuteQuery(statement);<NEW_LINE>// read the result meta data<NEW_LINE>ResultSetMetaData metadata = results.getMetaData();<NEW_LINE>// map of entity column names to attributes<NEW_LINE>Map<String, Attribute<E, ?>> map = new HashMap<>();<NEW_LINE>for (Attribute<E, ?> attribute : type.getAttributes()) {<NEW_LINE>map.put(attribute.getName().toLowerCase(Locale.ROOT), attribute);<NEW_LINE>}<NEW_LINE>Set<Attribute<E, ?>> <MASK><NEW_LINE>for (int i = 0; i < metadata.getColumnCount(); i++) {<NEW_LINE>String name = metadata.getColumnName(i + 1);<NEW_LINE>Attribute<E, ?> attribute = map.get(name.toLowerCase(Locale.ROOT));<NEW_LINE>if (attribute != null) {<NEW_LINE>attributes.add(attribute);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Attribute[] array = Attributes.toArray(attributes, new Predicate<Attribute<E, ?>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean test(Attribute<E, ?> value) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>EntityResultReader<E, S> entityReader = new EntityResultReader<>(reader, array);<NEW_LINE>return new ResultSetIterator<>(entityReader, results, null, true, true);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new PersistenceException(e);<NEW_LINE>}<NEW_LINE>}
attributes = new LinkedHashSet<>();
232,912
public void run(FlowTrigger trigger, Map data) {<NEW_LINE>String hostUuid = getAvailableHostUuidForOperation();<NEW_LINE>if (hostUuid == null) {<NEW_LINE>trigger.next();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HostVO hvo = dbf.<MASK><NEW_LINE>DeleteVolumeBitsOnPrimaryStorageMsg dmsg = new DeleteVolumeBitsOnPrimaryStorageMsg();<NEW_LINE>dmsg.setFolder(true);<NEW_LINE>dmsg.setHypervisorType(hvo.getHypervisorType());<NEW_LINE>dmsg.setInstallPath(new File(msg.getInstallPath()).getParent());<NEW_LINE>dmsg.setPrimaryStorageUuid(msg.getPrimaryStorageUuid());<NEW_LINE>bus.makeTargetServiceIdByResourceUuid(dmsg, PrimaryStorageConstant.SERVICE_ID, msg.getPrimaryStorageUuid());<NEW_LINE>bus.send(dmsg, new CloudBusCallBack(trigger) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(MessageReply reply) {<NEW_LINE>if (reply.isSuccess()) {<NEW_LINE>trigger.next();<NEW_LINE>} else {<NEW_LINE>trigger.fail(reply.getError());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
findByUuid(hostUuid, HostVO.class);
1,521,217
private void doRebase(final Rebase rebase) {<NEW_LINE>final HgProgressSupport supp = this;<NEW_LINE>OutputLogger logger = getLogger();<NEW_LINE>try {<NEW_LINE>logger.<MASK><NEW_LINE>logger.outputInRed(Bundle.MSG_Rebase_Title_Sep());<NEW_LINE>logger.output(Bundle.MSG_Rebase_Started());<NEW_LINE>HgUtils.runWithoutIndexing(new Callable<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void call() throws Exception {<NEW_LINE>RebaseAction.doRebase(root, rebase.getRevisionBase(), rebase.getRevisionSource(), rebase.getRevisionDest(), supp);<NEW_LINE>supp.setDisplayName(Bundle.MSG_RebaseAction_progress_refreshingFiles());<NEW_LINE>HgUtils.forceStatusRefresh(root);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}, root);<NEW_LINE>} catch (HgException.HgCommandCanceledException ex) {<NEW_LINE>// canceled by user, do nothing<NEW_LINE>} catch (HgException ex) {<NEW_LINE>HgUtils.notifyException(ex);<NEW_LINE>}<NEW_LINE>logger.outputInRed(Bundle.MSG_Rebase_Finished());<NEW_LINE>// NOI18N<NEW_LINE>logger.output("");<NEW_LINE>}
outputInRed(Bundle.MSG_Rebase_Title());