idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
995,401
void showDBPopulationProgressDialog(CancellationProgressTask<?> task) {<NEW_LINE>currentDialog = new ProgressDialog(task);<NEW_LINE>currentDialog.initModality(Modality.NONE);<NEW_LINE>currentDialog.setTitle(Bundle.PromptDialogManager_progressDialog_title());<NEW_LINE>setDialogIcons(currentDialog);<NEW_LINE>currentDialog.headerTextProperty().bind(task.titleProperty());<NEW_LINE>DialogPane dialogPane = currentDialog.getDialogPane();<NEW_LINE>// override autosizing which fails for some reason<NEW_LINE>dialogPane.setPrefSize(400, 200);<NEW_LINE>// co-ordinate task cancelation and dialog hiding.<NEW_LINE>task.setOnCancelled(cancelled -> currentDialog.close());<NEW_LINE>task.setOnSucceeded(succeeded -> currentDialog.close());<NEW_LINE>task.setOnFailed(<MASK><NEW_LINE>dialogPane.getButtonTypes().setAll(ButtonType.CANCEL);<NEW_LINE>final Node cancelButton = dialogPane.lookupButton(ButtonType.CANCEL);<NEW_LINE>cancelButton.disableProperty().bind(task.cancellableProperty().not());<NEW_LINE>currentDialog.setOnCloseRequest(closeRequest -> {<NEW_LINE>if (task.isRunning()) {<NEW_LINE>closeRequest.consume();<NEW_LINE>}<NEW_LINE>if (task.isCancellable() && task.isCancelRequested() == false) {<NEW_LINE>task.requestCancel();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>currentDialog.show();<NEW_LINE>}
failed -> currentDialog.close());
1,850,825
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see javax.resource.spi.XATerminator#prepare(javax.transaction.xa.Xid)<NEW_LINE>*/<NEW_LINE>public int prepare(Xid xid) throws XAException {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "prepare", xid);<NEW_LINE>final JCATranWrapper txWrapper;<NEW_LINE>try {<NEW_LINE>validateXid(xid);<NEW_LINE>// Get the wrapper adding an association in the process<NEW_LINE>txWrapper = getTxWrapper(xid, true);<NEW_LINE>} catch (XAException e) {<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "prepare", new Object[] { "caught XAException", e });<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>final int result;<NEW_LINE>try {<NEW_LINE>result = txWrapper.prepare(this);<NEW_LINE>} catch (XAException e) {<NEW_LINE>TxExecutionContextHandler.removeAssociation(txWrapper);<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "prepare", new Object<MASK><NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>TxExecutionContextHandler.removeAssociation(txWrapper);<NEW_LINE>if (tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "prepare", result);<NEW_LINE>return result;<NEW_LINE>}
[] { "prepare threw XAException", e });
805,682
private void informSubstrings(ParserRuleContext ctx, String name, boolean fakeChild, Splitter splitter) {<NEW_LINE>String text = getSourceText(ctx);<NEW_LINE>String path = inform(ctx, name, text, fakeChild);<NEW_LINE>Set<Range> ranges = analyzer.getRequiredInformRanges(path);<NEW_LINE>if (ranges.size() > 4) {<NEW_LINE>// Benchmarks showed this to be the breakeven point. (see below)<NEW_LINE>List<Pair<Integer, Integer>> splitList = splitter.createSplitList(text);<NEW_LINE>for (Range range : ranges) {<NEW_LINE>String value = splitter.getSplitRange(text, splitList, range);<NEW_LINE>if (value != null) {<NEW_LINE>inform(ctx, ctx, name + range, value, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (Range range : ranges) {<NEW_LINE>String value = splitter.getSplitRange(text, range);<NEW_LINE>if (value != null) {<NEW_LINE>inform(ctx, ctx, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
name + range, value, true);
1,833,461
public ActorFuture<Void> transitionTo(final PartitionTransitionContext context, final long term, final Role targetRole) {<NEW_LINE>final var currentRole = context.getCurrentRole();<NEW_LINE>final var concurrencyControl = context.getConcurrencyControl();<NEW_LINE>if (shouldInstallOnTransition(targetRole, currentRole) || (context.getStreamProcessor() == null && targetRole != Role.INACTIVE)) {<NEW_LINE>final StreamProcessor streamProcessor = streamProcessorCreator.apply(context, targetRole);<NEW_LINE>context.setStreamProcessor(streamProcessor);<NEW_LINE>final ActorFuture<Void> openFuture = streamProcessor.openAsync<MASK><NEW_LINE>final ActorFuture<Void> future = concurrencyControl.createFuture();<NEW_LINE>openFuture.onComplete((nothing, err) -> {<NEW_LINE>if (err == null) {<NEW_LINE>// Have to pause/resume it here in case the state changed after streamProcessor was<NEW_LINE>// created<NEW_LINE>if (!context.shouldProcess()) {<NEW_LINE>streamProcessor.pauseProcessing();<NEW_LINE>} else {<NEW_LINE>streamProcessor.resumeProcessing();<NEW_LINE>}<NEW_LINE>context.getComponentHealthMonitor().registerComponent(streamProcessor.getName(), streamProcessor);<NEW_LINE>future.complete(null);<NEW_LINE>} else {<NEW_LINE>future.completeExceptionally(err);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return future;<NEW_LINE>}<NEW_LINE>return concurrencyControl.createCompletedFuture();<NEW_LINE>}
(!context.shouldProcess());
1,628,977
public void start(Environment env) throws IOException {<NEW_LINE>try {<NEW_LINE>parseCommandLine();<NEW_LINE>if (Strings.isNullOrEmpty(commandName)) {<NEW_LINE>StringWriter msg = new StringWriter();<NEW_LINE><MASK><NEW_LINE>throw new UnloggedFailure(1, msg.toString());<NEW_LINE>}<NEW_LINE>BaseCommand cmd = getCommand();<NEW_LINE>if (getName().isEmpty()) {<NEW_LINE>cmd.setName(commandName);<NEW_LINE>} else {<NEW_LINE>cmd.setName(getName() + " " + commandName);<NEW_LINE>}<NEW_LINE>cmd.setArguments(args.toArray(new String[args.size()]));<NEW_LINE>provideStateTo(cmd);<NEW_LINE>// atomicCmd.set(cmd);<NEW_LINE>cmd.start(env);<NEW_LINE>} catch (UnloggedFailure e) {<NEW_LINE>String msg = e.getMessage();<NEW_LINE>if (!msg.endsWith("\n")) {<NEW_LINE>msg += "\n";<NEW_LINE>}<NEW_LINE>err.write(msg.getBytes(Charsets.UTF_8));<NEW_LINE>err.flush();<NEW_LINE>exit.onExit(e.exitCode);<NEW_LINE>}<NEW_LINE>}
msg.write(usage());
1,630,802
private void addOLCand0(@NonNull final OLCand candidate) {<NEW_LINE>if (currentOrderLine == null) {<NEW_LINE>currentOrderLine = newOrderLine(candidate);<NEW_LINE>}<NEW_LINE>currentOrderLine.setM_Warehouse_ID(WarehouseId.toRepoId(candidate.getWarehouseId()));<NEW_LINE>currentOrderLine.setM_Warehouse_Dest_ID(WarehouseId.toRepoId(candidate.getWarehouseDestId()));<NEW_LINE>// 08626: Propagate ProductDescription to C_OrderLine<NEW_LINE>currentOrderLine.setProductDescription(candidate.getProductDescription());<NEW_LINE>currentOrderLine.setLine(candidate.getLine());<NEW_LINE>currentOrderLine.setExternalId(candidate.getExternalLineId());<NEW_LINE>//<NEW_LINE>// Quantity<NEW_LINE>{<NEW_LINE>final Quantity currentQty = Quantitys.create(currentOrderLine.getQtyEntered(), UomId.ofRepoId(currentOrderLine.getC_UOM_ID()));<NEW_LINE>final Quantity newQtyEntered = Quantitys.add(UOMConversionContext.of(candidate.getM_Product_ID()), <MASK><NEW_LINE>currentOrderLine.setQtyEntered(newQtyEntered.toBigDecimal());<NEW_LINE>currentOrderLine.setQtyItemCapacity(Quantitys.toBigDecimalOrNull(candidate.getQtyItemCapacityEff()));<NEW_LINE>final BigDecimal qtyOrdered = orderLineBL.convertQtyEnteredToStockUOM(currentOrderLine).toBigDecimal();<NEW_LINE>currentOrderLine.setQtyOrdered(qtyOrdered);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Prices<NEW_LINE>{<NEW_LINE>currentOrderLine.setInvoicableQtyBasedOn(candidate.getInvoicableQtyBasedOn().getRecordString());<NEW_LINE>currentOrderLine.setIsManualPrice(candidate.isManualPrice());<NEW_LINE>if (candidate.isManualPrice()) {<NEW_LINE>currentOrderLine.setPriceEntered(candidate.getPriceActual());<NEW_LINE>} else {<NEW_LINE>// leave it to the pricing engine<NEW_LINE>}<NEW_LINE>currentOrderLine.setIsManualDiscount(candidate.isManualDiscount());<NEW_LINE>if (candidate.isManualDiscount()) {<NEW_LINE>currentOrderLine.setDiscount(candidate.getDiscount());<NEW_LINE>}<NEW_LINE>if (candidate.isManualPrice() || candidate.isManualDiscount()) {<NEW_LINE>// FIXME: use price list's precision<NEW_LINE>final CurrencyId currencyId = CurrencyId.ofRepoIdOrNull(candidate.getC_Currency_ID());<NEW_LINE>final CurrencyPrecision stdPrecision = currencyId != null ? currencyDAO.getStdPrecision(currencyId) : ICurrencyDAO.DEFAULT_PRECISION;<NEW_LINE>orderLineBL.updatePriceActual(currentOrderLine, stdPrecision);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Attach the olCand's IProductPriceAttributeAware to the new order line, so that the rest of the system can know if it is supposed to guess an ASI and PIIP or not (task 08839)<NEW_LINE>{<NEW_LINE>final IAttributeSetInstanceAware orderLineASIAware = attributeSetInstanceAwareFactoryService.createOrNull(currentOrderLine);<NEW_LINE>Check.assumeNotNull(orderLineASIAware, "We can allways obtain a not-null ASI aware for C_OrderLine {} ", currentOrderLine);<NEW_LINE>attributePricingBL.setDynAttrProductPriceAttributeAware(orderLineASIAware, candidate);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Fire listeners<NEW_LINE>olCandListeners.onOrderLineCreated(candidate, currentOrderLine);<NEW_LINE>//<NEW_LINE>// Save the current order line<NEW_LINE>InterfaceWrapperHelper.save(currentOrderLine);<NEW_LINE>// Establishing a "real" link with FK-constraints between order candidate and order line (03472)<NEW_LINE>createOla(candidate, currentOrderLine);<NEW_LINE>final OrderLineGroup orderLineGroup = candidate.getOrderLineGroup();<NEW_LINE>if (orderLineGroup != null && !Check.isBlank(orderLineGroup.getGroupKey())) {<NEW_LINE>final OrderLineId orderLineId = OrderLineId.ofRepoId(currentOrderLine.getC_OrderLine_ID());<NEW_LINE>if (currentOrderLine.isGroupCompensationLine() || orderLineGroup.isGroupMainItem()) {<NEW_LINE>primaryOrderLineToGroup.put(orderLineId, orderLineGroup);<NEW_LINE>}<NEW_LINE>groupsToOrderLines.put(orderLineGroup.getGroupKey(), orderLineId);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>orderLines.put(currentOrderLine.getC_OrderLine_ID(), currentOrderLine);<NEW_LINE>candidates.add(candidate);<NEW_LINE>}
currentQty, candidate.getQty());
1,648,046
public int nextInterval() throws IOException {<NEW_LINE>lead = null;<NEW_LINE>// first, find a matching interval beyond the current start<NEW_LINE>while (this.proximityQueue.size() == minShouldMatch && proximityQueue.top().start() == start) {<NEW_LINE><MASK><NEW_LINE>if (it != null && it.nextInterval() != IntervalIterator.NO_MORE_INTERVALS) {<NEW_LINE>backgroundQueue.add(it);<NEW_LINE>IntervalIterator next = backgroundQueue.pop();<NEW_LINE>// it's just been added!<NEW_LINE>assert next != null;<NEW_LINE>proximityQueue.add(next);<NEW_LINE>updateRightExtreme(next);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.proximityQueue.size() < minShouldMatch)<NEW_LINE>return start = end = IntervalIterator.NO_MORE_INTERVALS;<NEW_LINE>// then, minimize it<NEW_LINE>do {<NEW_LINE>onMatch.onMatch();<NEW_LINE>start = proximityQueue.top().start();<NEW_LINE>end = queueEnd;<NEW_LINE>slop = width();<NEW_LINE>for (IntervalIterator it : proximityQueue) {<NEW_LINE>slop -= it.width();<NEW_LINE>}<NEW_LINE>if (proximityQueue.top().end() == end) {<NEW_LINE>return start;<NEW_LINE>}<NEW_LINE>lead = proximityQueue.pop();<NEW_LINE>if (lead != null) {<NEW_LINE>if (lead.nextInterval() != NO_MORE_INTERVALS) {<NEW_LINE>backgroundQueue.add(lead);<NEW_LINE>}<NEW_LINE>IntervalIterator next = backgroundQueue.pop();<NEW_LINE>if (next != null) {<NEW_LINE>proximityQueue.add(next);<NEW_LINE>updateRightExtreme(next);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} while (this.proximityQueue.size() == minShouldMatch && end == queueEnd);<NEW_LINE>return start;<NEW_LINE>}
IntervalIterator it = proximityQueue.pop();
201,359
public Model<Label> train(Dataset<Label> examples, Map<String, Provenance> runProvenance, int invocationCount) {<NEW_LINE>if (examples.getOutputInfo().getUnknownCount() > 0) {<NEW_LINE>throw new IllegalArgumentException("The supplied Dataset contained unknown Outputs, and this Trainer is supervised.");<NEW_LINE>}<NEW_LINE>ImmutableOutputInfo<Label> labelInfos = examples.getOutputIDInfo();<NEW_LINE>ImmutableFeatureMap featureInfos = examples.getFeatureIDMap();<NEW_LINE>Map<Integer, Map<Integer, Double>> labelWeights = new HashMap<>();<NEW_LINE>for (Pair<Integer, Label> label : labelInfos) {<NEW_LINE>labelWeights.put(label.getA(), new HashMap<>());<NEW_LINE>}<NEW_LINE>for (Example<Label> ex : examples) {<NEW_LINE>int idx = labelInfos.getID(ex.getOutput());<NEW_LINE>Map<Integer, Double> featureMap = labelWeights.get(idx);<NEW_LINE><MASK><NEW_LINE>for (Feature feat : ex) {<NEW_LINE>if (feat.getValue() < 0.0) {<NEW_LINE>throw new IllegalStateException("Multinomial Naive Bayes requires non-negative features. Found feature " + feat.toString());<NEW_LINE>}<NEW_LINE>featureMap.merge(featureInfos.getID(feat.getName()), curWeight * feat.getValue(), Double::sum);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (invocationCount != INCREMENT_INVOCATION_COUNT) {<NEW_LINE>setInvocationCount(invocationCount);<NEW_LINE>}<NEW_LINE>TrainerProvenance trainerProvenance = getProvenance();<NEW_LINE>ModelProvenance provenance = new ModelProvenance(MultinomialNaiveBayesModel.class.getName(), OffsetDateTime.now(), examples.getProvenance(), trainerProvenance, runProvenance);<NEW_LINE>trainInvocationCount++;<NEW_LINE>SparseVector[] labelVectors = new SparseVector[labelInfos.size()];<NEW_LINE>for (int i = 0; i < labelInfos.size(); i++) {<NEW_LINE>SparseVector sv = SparseVector.createSparseVector(featureInfos.size(), labelWeights.get(i));<NEW_LINE>double unsmoothedZ = sv.oneNorm();<NEW_LINE>sv.foreachInPlace(d -> Math.log((d + alpha) / (unsmoothedZ + (featureInfos.size() * alpha))));<NEW_LINE>labelVectors[i] = sv;<NEW_LINE>}<NEW_LINE>DenseSparseMatrix labelWordProbs = DenseSparseMatrix.createFromSparseVectors(labelVectors);<NEW_LINE>return new MultinomialNaiveBayesModel("", provenance, featureInfos, labelInfos, labelWordProbs, alpha);<NEW_LINE>}
double curWeight = ex.getWeight();
1,509,828
public final void update(EventBean[] newData, EventBean[] oldData) {<NEW_LINE>AgentInstanceContext agentInstanceContext = agentInstanceViewFactoryContext.getAgentInstanceContext();<NEW_LINE>agentInstanceContext.getAuditProvider().view(newData, oldData, agentInstanceContext, factory);<NEW_LINE>agentInstanceContext.getInstrumentationProvider().qViewProcessIRStream(factory, newData, oldData);<NEW_LINE>long timestamp = -1;<NEW_LINE>// add data points to the window<NEW_LINE>// we don't care about removed data from a prior view<NEW_LINE>if (newData != null) {<NEW_LINE>for (int i = 0; i < newData.length; i++) {<NEW_LINE>timestamp = getLongValue(newData[i]);<NEW_LINE>timeWindow.add(timestamp, newData[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Remove from the window any events that have an older timestamp then the last event's timestamp<NEW_LINE>ArrayDeque<EventBean> expired = null;<NEW_LINE>if (timestamp != -1) {<NEW_LINE>expired = timeWindow.expireEvents(timestamp - timePeriodProvide.deltaSubtract(timestamp, null, true, agentInstanceViewFactoryContext) + 1);<NEW_LINE>}<NEW_LINE>EventBean[] oldDataUpdate = null;<NEW_LINE>if ((expired != null) && (!expired.isEmpty())) {<NEW_LINE>oldDataUpdate = expired.toArray(new EventBean[expired.size()]);<NEW_LINE>}<NEW_LINE>if ((oldData != null) && (agentInstanceViewFactoryContext.isRemoveStream())) {<NEW_LINE>for (EventBean anOldData : oldData) {<NEW_LINE>timeWindow.remove(anOldData);<NEW_LINE>}<NEW_LINE>if (oldDataUpdate == null) {<NEW_LINE>oldDataUpdate = oldData;<NEW_LINE>} else {<NEW_LINE>oldDataUpdate = CollectionUtil.addArrayWithSetSemantics(oldData, oldDataUpdate);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (viewUpdatedCollection != null) {<NEW_LINE>viewUpdatedCollection.update(newData, oldDataUpdate);<NEW_LINE>}<NEW_LINE>// If there are child views, fireStatementStopped update method<NEW_LINE>if (child != null) {<NEW_LINE>agentInstanceContext.getInstrumentationProvider().qViewIndicate(factory, newData, oldDataUpdate);<NEW_LINE>child.update(newData, oldDataUpdate);<NEW_LINE>agentInstanceContext<MASK><NEW_LINE>}<NEW_LINE>agentInstanceContext.getInstrumentationProvider().aViewProcessIRStream();<NEW_LINE>}
.getInstrumentationProvider().aViewIndicate();
393,317
private void initDefaultRoutes(Router router) {<NEW_LINE>router.add(GET, "/", RootTask.class);<NEW_LINE>router.add(GET, "", RootRedirectTask.class);<NEW_LINE>router.add(POST, "/reset", ResetTask.class);<NEW_LINE>router.add(GET, "/mappings", GetAllStubMappingsTask.class);<NEW_LINE>router.add(POST, "/mappings", CreateStubMappingTask.class);<NEW_LINE>router.add(DELETE, "/mappings", ResetStubMappingsTask.class);<NEW_LINE>// Deprecated<NEW_LINE>router.add(POST, "/mappings/new", OldCreateStubMappingTask.class);<NEW_LINE>// Deprecated<NEW_LINE>router.add(POST, "/mappings/remove", OldRemoveStubMappingTask.class);<NEW_LINE>// Deprecated<NEW_LINE>router.add(POST, "/mappings/edit", OldEditStubMappingTask.class);<NEW_LINE>router.add(POST, "/mappings/save", SaveMappingsTask.class);<NEW_LINE>router.add(POST, "/mappings/reset", ResetToDefaultMappingsTask.class);<NEW_LINE>router.add(GET, "/mappings/{id}", GetStubMappingTask.class);<NEW_LINE>router.add(PUT, "/mappings/{id}", EditStubMappingTask.class);<NEW_LINE>router.add(DELETE, "/mappings/{id}", RemoveStubMappingTask.class);<NEW_LINE>router.add(POST, "/mappings/find-by-metadata", FindStubMappingsByMetadataTask.class);<NEW_LINE>router.add(POST, "/mappings/remove-by-metadata", RemoveStubMappingsByMetadataTask.class);<NEW_LINE>router.add(POST, "/mappings/import", ImportStubMappingsTask.class);<NEW_LINE>router.add(GET, "/files", GetAllStubFilesTask.class);<NEW_LINE>router.add(PUT, "/files/**", EditStubFileTask.class);<NEW_LINE>router.add(DELETE, "/files/**", DeleteStubFileTask.class);<NEW_LINE>router.add(GET, "/scenarios", GetAllScenariosTask.class);<NEW_LINE>router.add(POST, "/scenarios/reset", ResetScenariosTask.class);<NEW_LINE>router.add(GET, "/requests", GetAllRequestsTask.class);<NEW_LINE>router.add(DELETE, "/requests", ResetRequestsTask.class);<NEW_LINE>// Deprecated<NEW_LINE>router.add(POST, "/requests/reset", OldResetRequestsTask.class);<NEW_LINE>router.add(POST, "/requests/count", GetRequestCountTask.class);<NEW_LINE>router.add(POST, "/requests/find", FindRequestsTask.class);<NEW_LINE>router.add(GET, "/requests/unmatched", FindUnmatchedRequestsTask.class);<NEW_LINE>router.add(GET, "/requests/unmatched/near-misses", FindNearMissesForUnmatchedTask.class);<NEW_LINE>router.add(GET, "/requests/{id}", GetServedStubTask.class);<NEW_LINE>router.add(DELETE, "/requests/{id}", RemoveServeEventTask.class);<NEW_LINE>router.add(POST, "/requests/remove", RemoveServeEventsByRequestPatternTask.class);<NEW_LINE>router.add(<MASK><NEW_LINE>router.add(POST, "/recordings/snapshot", SnapshotTask.class);<NEW_LINE>router.add(POST, "/recordings/start", StartRecordingTask.class);<NEW_LINE>router.add(POST, "/recordings/stop", StopRecordingTask.class);<NEW_LINE>router.add(GET, "/recordings/status", GetRecordingStatusTask.class);<NEW_LINE>router.add(GET, "/recorder", GetRecordingsIndexTask.class);<NEW_LINE>router.add(POST, "/near-misses/request", FindNearMissesForRequestTask.class);<NEW_LINE>router.add(POST, "/near-misses/request-pattern", FindNearMissesForRequestPatternTask.class);<NEW_LINE>router.add(GET, "/settings", GetGlobalSettingsTask.class);<NEW_LINE>router.add(PUT, "/settings", GlobalSettingsUpdateTask.class);<NEW_LINE>router.add(POST, "/settings", GlobalSettingsUpdateTask.class);<NEW_LINE>router.add(PATCH, "/settings/extended", PatchExtendedSettingsTask.class);<NEW_LINE>router.add(POST, "/shutdown", ShutdownServerTask.class);<NEW_LINE>router.add(GET, "/docs/swagger", GetSwaggerSpecTask.class);<NEW_LINE>router.add(GET, "/docs", GetDocIndexTask.class);<NEW_LINE>router.add(GET, "/certs/wiremock-ca.crt", GetCaCertTask.class);<NEW_LINE>}
POST, "/requests/remove-by-metadata", RemoveServeEventsByStubMetadataTask.class);
463,304
public void createResourceContent(String repositoryUrl, String commitMessage, String content) throws SourceConnectorException {<NEW_LINE>try {<NEW_LINE>String b64Content = Base64.encodeBase64String(content.getBytes(StandardCharsets.UTF_8));<NEW_LINE>GitHubResource resource = resolver.resolve(repositoryUrl);<NEW_LINE>GitHubCreateFileRequest requestBody = new GitHubCreateFileRequest();<NEW_LINE>requestBody.setMessage(commitMessage);<NEW_LINE>requestBody.setContent(b64Content);<NEW_LINE>requestBody.setBranch(resource.getBranch());<NEW_LINE>String createContentUrl = this.endpoint("/repos/:org/:repo/contents/:path").bind("org", resource.getOrganization()).bind("repo", resource.getRepository()).bind("path", resource.getResourcePath()).toString();<NEW_LINE>HttpRequestWithBody request = Unirest.put(createContentUrl).header("Content-Type", "application/json; charset=utf-8");<NEW_LINE>addSecurityTo(request);<NEW_LINE>HttpResponse<InputStream> response = request.body(requestBody).asBinary();<NEW_LINE>if (response.getStatus() != 201) {<NEW_LINE>throw new UnirestException("Unexpected response from GitHub: " + response.getStatus() + "::" + response.getStatusText());<NEW_LINE>}<NEW_LINE>} catch (UnirestException e) {<NEW_LINE>logger.error("Error creating Github resource content.", e);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new SourceConnectorException("Error creating Github resource content.", e);
456,251
public void restoreFromSnapshot(@Nonnull Object key0, @Nonnull Object value) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Object key = ((BroadcastKey<Object>) key0).key();<NEW_LINE>if (PARTITION_COUNTS_SNAPSHOT_KEY.equals(key)) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, Integer> partitionCounts = (Map<String, Integer>) value;<NEW_LINE>for (Entry<String, Integer> partitionCountEntry : partitionCounts.entrySet()) {<NEW_LINE>String topicName = partitionCountEntry.getKey();<NEW_LINE>int partitionCount = partitionCountEntry.getValue();<NEW_LINE>int topicIndex = topics.indexOf(topicName);<NEW_LINE>assert topicIndex >= 0;<NEW_LINE>handleNewPartitions(topicIndex, partitionCount, true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>TopicPartition topicPartition = (TopicPartition) key;<NEW_LINE>long[] value1 = (long[]) value;<NEW_LINE>long offset = value1[0];<NEW_LINE>long watermark = value1[1];<NEW_LINE>if (!offsets.containsKey(topicPartition.topic())) {<NEW_LINE>getLogger().warning("Offset for topic '" + <MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int topicIndex = topics.indexOf(topicPartition.topic());<NEW_LINE>assert topicIndex >= 0;<NEW_LINE>handleNewPartitions(topicIndex, topicPartition.partition() + 1, true);<NEW_LINE>if (!handledByThisProcessor(topicIndex, topicPartition.partition())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long[] topicOffsets = offsets.get(topicPartition.topic());<NEW_LINE>assert topicOffsets[topicPartition.partition()] < 0 : "duplicate offset for topicPartition '" + topicPartition + "' restored, offset1=" + topicOffsets[topicPartition.partition()] + ", offset2=" + offset;<NEW_LINE>topicOffsets[topicPartition.partition()] = offset;<NEW_LINE>consumer.seek(topicPartition, offset + 1);<NEW_LINE>Integer partitionIndex = currentAssignment.get(topicPartition);<NEW_LINE>assert partitionIndex != null;<NEW_LINE>eventTimeMapper.restoreWatermark(partitionIndex, watermark);<NEW_LINE>}<NEW_LINE>}
topicPartition.topic() + "' is restored from the snapshot, but the topic is not supposed to be read, ignoring");
1,193,779
public Object saveState(FacesContext context) {<NEW_LINE>UIViewRoot root = context.getViewRoot();<NEW_LINE>if (root != null && root.initialStateMarked()) {<NEW_LINE>if (stateMap != null) {<NEW_LINE>Object[] values = new Object[1];<NEW_LINE>values[0] = UIComponentBase.saveAttachedState(context, stateMap);<NEW_LINE>return values;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>Object[] values = new Object[2];<NEW_LINE>values[0] = <MASK><NEW_LINE>// If the UIViewRoot instance was not marked with initial state, that means<NEW_LINE>// we need to save the bindingsMap as well because it will not be restored<NEW_LINE>// like with PSS, because in that case the view is built again using<NEW_LINE>// facelets algorithm.<NEW_LINE>values[1] = UIComponentBase.saveAttachedState(context, bindingsMap);<NEW_LINE>return values;<NEW_LINE>}<NEW_LINE>}
UIComponentBase.saveAttachedState(context, stateMap);
1,550,926
public void execute(EditorAdaptor editorAdaptor) throws CommandExecutionException {<NEW_LINE>Register reg = editorAdaptor.getRegisterManager().getRegister(registerName);<NEW_LINE>String text = reg.getContent().getText();<NEW_LINE>text = VimUtils.replaceNewLines(text, editorAdaptor.getConfiguration().getNewLine());<NEW_LINE>if (text.length() > 0) {<NEW_LINE>TextContent content = editorAdaptor.getModelContent();<NEW_LINE>// Delete Eclipse selection contents, for example when completing a function's arguments.<NEW_LINE>Selection currentSelection = editorAdaptor.getSelection();<NEW_LINE>if (currentSelection.getModelLength() > 0) {<NEW_LINE>content.replace(currentSelection.getLeftBound().getModelOffset(), currentSelection.getModelLength(), "");<NEW_LINE>}<NEW_LINE>int offset = editorAdaptor.getCursorService().getPosition().getModelOffset();<NEW_LINE>// different from PasteOperation! it does length() - 1<NEW_LINE>int position = offset + text.length();<NEW_LINE>content.<MASK><NEW_LINE>Position destination = editorAdaptor.getCursorService().newPositionForModelOffset(position);<NEW_LINE>editorAdaptor.setPosition(destination, StickyColumnPolicy.ON_CHANGE);<NEW_LINE>}<NEW_LINE>}
replace(offset, 0, text);
1,591,049
public void actionPerformed(ActionEvent e) {<NEW_LINE>JTextComponent target = getTextComponent(e);<NEW_LINE>if (target != null && target.getDocument() instanceof SyntaxDocument) {<NEW_LINE>SyntaxDocument sDoc = (SyntaxDocument) target.getDocument();<NEW_LINE>int dot = target.getCaretPosition();<NEW_LINE>Token token = sDoc.getTokenAt(dot);<NEW_LINE>if (token != null) {<NEW_LINE>String abbriv = ActionUtils.getTokenStringAt(sDoc, dot);<NEW_LINE>if (completions.containsKey(abbriv)) {<NEW_LINE>String completed = completions.get(abbriv);<NEW_LINE>if (completed.indexOf('|') >= 0) {<NEW_LINE>int ofst = completed.length() - completed.indexOf('|') - 1;<NEW_LINE>sDoc.replaceToken(token, completed<MASK><NEW_LINE>target.setCaretPosition(target.getCaretPosition() - ofst);<NEW_LINE>} else {<NEW_LINE>sDoc.replaceToken(token, completed);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.replace("|", ""));
1,316,543
public AssignTapePoolResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AssignTapePoolResult assignTapePoolResult = new AssignTapePoolResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return assignTapePoolResult;<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("TapeARN", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>assignTapePoolResult.setTapeARN(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 assignTapePoolResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,188,474
public Mat run(Mat inputMat, ImageBlob imageBlob) {<NEW_LINE>int origin_w = inputMat.width();<NEW_LINE>int origin_h = inputMat.height();<NEW_LINE>imageBlob.getReshapeInfo().put("resize", new int[] { origin_w, origin_h });<NEW_LINE>int im_size_max = Math.max(origin_w, origin_h);<NEW_LINE>int im_size_min = Math.min(origin_w, origin_h);<NEW_LINE>float scale = (float) (short_size) / (float) (im_size_min);<NEW_LINE>if (max_size > 0) {<NEW_LINE>if (Math.round(scale * im_size_max) > max_size) {<NEW_LINE>scale = (float) (max_size<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>int width = Math.round(scale * origin_w);<NEW_LINE>int height = Math.round(scale * origin_h);<NEW_LINE>Size sz = new Size(width, height);<NEW_LINE>Imgproc.resize(inputMat, inputMat, sz, 0, 0, interpMap.get(interp));<NEW_LINE>imageBlob.setNewImageSize(inputMat.height(), 2);<NEW_LINE>imageBlob.setNewImageSize(inputMat.width(), 3);<NEW_LINE>imageBlob.setScale(scale);<NEW_LINE>return inputMat;<NEW_LINE>}
) / (float) (im_size_max);
997,445
public UpdateDomainConfigurationResult updateDomainConfiguration(UpdateDomainConfigurationRequest updateDomainConfigurationRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateDomainConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UpdateDomainConfigurationRequest> request = null;<NEW_LINE>Response<UpdateDomainConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateDomainConfigurationRequestMarshaller().marshall(updateDomainConfigurationRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<UpdateDomainConfigurationResult, JsonUnmarshallerContext> unmarshaller = new UpdateDomainConfigurationResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<UpdateDomainConfigurationResult> responseHandler = new JsonResponseHandler<UpdateDomainConfigurationResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,091,032
private FastBuildState updateBuild(BlazeContext context, Label label, FastBuildParameters buildParameters, @Nullable FastBuildState existingBuildState) {<NEW_LINE>context.output(FastBuildLogOutput.keyValue("label", label.toString()));<NEW_LINE>if (existingBuildState != null && !existingBuildState.newBuildOutput().isDone()) {<NEW_LINE>// Don't start a new build if an existing one is still running.<NEW_LINE>context.output(FastBuildLogOutput.keyValue("reused_existing_build_future", "true"));<NEW_LINE>return existingBuildState;<NEW_LINE>}<NEW_LINE>BuildOutput completedBuildOutput = getCompletedBuild(existingBuildState);<NEW_LINE>ChangedSources changedSources = ChangedSources.fullCompile();<NEW_LINE>if (completedBuildOutput != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (changedSources.needsFullCompile()) {<NEW_LINE>File compileDirectory = getCompilerOutputDirectory(existingBuildState);<NEW_LINE>ListenableFuture<BuildOutput> newBuildOutput = buildDeployJarAsync(context, label, buildParameters);<NEW_LINE>changedFilesManager.newBuild(label, newBuildOutput);<NEW_LINE>return FastBuildState.create(newBuildOutput, compileDirectory, buildParameters);<NEW_LINE>} else {<NEW_LINE>existingBuildState = existingBuildState.withCompletedBuildOutput(completedBuildOutput);<NEW_LINE>return performIncrementalCompilation(context, label, existingBuildState, changedSources.changedSources());<NEW_LINE>}<NEW_LINE>}
changedSources = changedFilesManager.getAndResetChangedSources(label);
417,691
private Mono<Response<Flux<ByteBuffer>>> refreshWithResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (workspaceName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (integrationRuntimeName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-06-01-preview";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.refresh(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, workspaceName, integrationRuntimeName, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
1,680,235
protected void addAllProductOptionsToModel(Map<String, Object> newModelVars, Product product) {<NEW_LINE>List<ProductOptionXref> productOptionXrefs = ListUtils.emptyIfNull(product.getProductOptionXrefs());<NEW_LINE>List<ProductOptionDTO> dtos = new ArrayList<>();<NEW_LINE>for (ProductOptionXref optionXref : productOptionXrefs) {<NEW_LINE>ProductOptionDTO dto = new ProductOptionDTO();<NEW_LINE>ProductOption productOption = optionXref.getProductOption();<NEW_LINE>dto.setId(productOption.getId());<NEW_LINE>dto.setType(productOption.getType().getType());<NEW_LINE>Map<Long, String> values = new HashMap<>();<NEW_LINE>Map<Long, Double> priceAdjustments = new HashMap<>();<NEW_LINE>for (ProductOptionValue value : productOption.getAllowedValues()) {<NEW_LINE>values.put(value.getId(), value.getAttributeValue());<NEW_LINE><MASK><NEW_LINE>Double priceAdjustmentValue = (priceAdjustment != null) ? priceAdjustment.doubleValue() : null;<NEW_LINE>priceAdjustments.put(value.getId(), priceAdjustmentValue);<NEW_LINE>}<NEW_LINE>dto.setValues(values);<NEW_LINE>dto.setPriceAdjustments(priceAdjustments);<NEW_LINE>dtos.add(dto);<NEW_LINE>}<NEW_LINE>writeJSONToModel(newModelVars, "allProductOptions", dtos);<NEW_LINE>}
Money priceAdjustment = value.getPriceAdjustment();
1,234,658
final DeleteReceiptRuleResult executeDeleteReceiptRule(DeleteReceiptRuleRequest deleteReceiptRuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteReceiptRuleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteReceiptRuleRequest> request = null;<NEW_LINE>Response<DeleteReceiptRuleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteReceiptRuleRequestMarshaller().marshall(super.beforeMarshalling(deleteReceiptRuleRequest));<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, "SES");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteReceiptRule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteReceiptRuleResult> responseHandler = new StaxResponseHandler<DeleteReceiptRuleResult>(new DeleteReceiptRuleResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
266,813
public void registerProtocol(Protocol protocol, List<Integer> supportedClientVersion, int serverVersion) {<NEW_LINE>// Register the protocol's handlers<NEW_LINE>protocol.initialize();<NEW_LINE>// Clear cache as this may make new routes.<NEW_LINE>if (!pathCache.isEmpty()) {<NEW_LINE>pathCache.clear();<NEW_LINE>}<NEW_LINE>protocols.put(protocol.getClass(), protocol);<NEW_LINE>for (int clientVersion : supportedClientVersion) {<NEW_LINE>// Throw an error if supported client version = server version<NEW_LINE>Preconditions.checkArgument(clientVersion != serverVersion);<NEW_LINE>Int2ObjectMap<Protocol> protocolMap = registryMap.computeIfAbsent(clientVersion, s -> <MASK><NEW_LINE>protocolMap.put(serverVersion, protocol);<NEW_LINE>}<NEW_LINE>if (Via.getPlatform().isPluginEnabled()) {<NEW_LINE>protocol.register(Via.getManager().getProviders());<NEW_LINE>refreshVersions();<NEW_LINE>} else {<NEW_LINE>registerList.add(protocol);<NEW_LINE>}<NEW_LINE>if (protocol.hasMappingDataToLoad()) {<NEW_LINE>if (mappingLoaderExecutor != null) {<NEW_LINE>// Submit mapping data loading<NEW_LINE>addMappingLoaderFuture(protocol.getClass(), protocol::loadMappingData);<NEW_LINE>} else {<NEW_LINE>// Late protocol adding - just do it on the current thread<NEW_LINE>protocol.loadMappingData();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
new Int2ObjectOpenHashMap<>(2));
1,120,150
private Paint createPaint() {<NEW_LINE>Paint paint = new Paint();<NEW_LINE>paint.setAntiAlias(true);<NEW_LINE><MASK><NEW_LINE>paint.setStrokeWidth(this.paintStrokeWidth);<NEW_LINE>paint.setStrokeCap(this.lineCap);<NEW_LINE>// fixed<NEW_LINE>paint.setStrokeJoin(Paint.Join.MITER);<NEW_LINE>// for Text<NEW_LINE>if (this.mode == Mode.TEXT) {<NEW_LINE>paint.setTypeface(this.fontFamily);<NEW_LINE>paint.setTextSize(this.fontSize);<NEW_LINE>paint.setTextAlign(this.textAlign);<NEW_LINE>paint.setStrokeWidth(0F);<NEW_LINE>}<NEW_LINE>if (this.mode == Mode.ERASER) {<NEW_LINE>// Eraser<NEW_LINE>paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));<NEW_LINE>paint.setARGB(0, 0, 0, 0);<NEW_LINE>// paint.setColor(this.baseColor);<NEW_LINE>// paint.setShadowLayer(this.blur, 0F, 0F, this.baseColor);<NEW_LINE>} else {<NEW_LINE>// Otherwise<NEW_LINE>paint.setColor(this.paintStrokeColor);<NEW_LINE>paint.setShadowLayer(this.blur, 0F, 0F, this.paintStrokeColor);<NEW_LINE>paint.setAlpha(this.opacity);<NEW_LINE>paint.setPathEffect(this.drawPathEffect);<NEW_LINE>}<NEW_LINE>return paint;<NEW_LINE>}
paint.setStyle(this.paintStyle);
1,436,076
public ScrollResult scroll(String query, TimeRange range, int limit, int offset, List<String> fields, String filter, int batchSize) {<NEW_LINE>final Set<String> affectedIndices = determineAffectedIndices(range, filter);<NEW_LINE>final Set<String> indexWildcards = indexSetRegistry.getForIndices(affectedIndices).stream().map(IndexSet::getIndexWildcard).collect(Collectors.toSet());<NEW_LINE>final Sorting sorting = new Sorting("_doc", Sorting.Direction.ASC);<NEW_LINE>ScrollCommand.Builder scrollCommandBuilder = ScrollCommand.builder().query(query).range(range).offset(offset).fields(fields).filter(filter).sorting(sorting).indices(indexWildcards);<NEW_LINE>// limit > 0 instead of ScrollCommand.NO_LIMIT is a fix for #9817, the caller of this method are only in the legacy-API<NEW_LINE>scrollCommandBuilder = limit > 0 ? scrollCommandBuilder.limit(limit) : scrollCommandBuilder;<NEW_LINE>scrollCommandBuilder = batchSize != ScrollCommand.NO_BATCHSIZE ? scrollCommandBuilder.batchSize(batchSize) : scrollCommandBuilder;<NEW_LINE>final ScrollResult result = searchesAdapter.<MASK><NEW_LINE>recordEsMetrics(result.tookMs(), range);<NEW_LINE>return result;<NEW_LINE>}
scroll(scrollCommandBuilder.build());
920,313
private /*<NEW_LINE>* StackFrame frame = getFrame(insn); Operand[] out = frame.out(); Operand dup, dup2 = null, dupd, dupd2 = null; if (out ==<NEW_LINE>* null) { dupd = popImmediate(); dup = new Operand(insn, dupd.stackOrValue()); if (dword) { dupd2 = peek(); if (dupd2 ==<NEW_LINE>* DWORD_DUMMY) { pop(); dupd2 = dupd; } else { dupd2 = popImmediate(); } dup2 = new Operand(<MASK><NEW_LINE>* frame.out(dup, dup2); frame.in(dupd, dupd2); } else { frame.out(dup); frame.in(dupd); } } else { dupd = pop(); dup =<NEW_LINE>* out[0]; if (dword) { dupd2 = pop(); if (dupd2 == DWORD_DUMMY) dupd2 = dupd; dup2 = out[1]; frame.mergeIn(dupd, dupd2); }<NEW_LINE>* else { frame.mergeIn(dupd); } }<NEW_LINE>*/<NEW_LINE>void convertArrayLoadInsn(InsnNode insn) {<NEW_LINE>StackFrame frame = getFrame(insn);<NEW_LINE>Operand[] out = frame.out();<NEW_LINE>Operand opr;<NEW_LINE>if (out == null) {<NEW_LINE>Operand indx = popImmediate();<NEW_LINE>Operand base = popImmediate();<NEW_LINE>// We have a sample of totally broken code with a reference to a null array<NEW_LINE>// x = null[i]<NEW_LINE>// We silently fix this issue and return a null value<NEW_LINE>if (base.value == NullConstant.v()) {<NEW_LINE>opr = new Operand(insn, NullConstant.v());<NEW_LINE>frame.in(indx, base);<NEW_LINE>frame.out(opr);<NEW_LINE>} else {<NEW_LINE>ArrayRef ar = Jimple.v().newArrayRef(base.stackOrValue(), indx.stackOrValue());<NEW_LINE>indx.addBox(ar.getIndexBox());<NEW_LINE>base.addBox(ar.getBaseBox());<NEW_LINE>opr = new Operand(insn, ar);<NEW_LINE>frame.in(indx, base);<NEW_LINE>frame.boxes(ar.getIndexBox(), ar.getBaseBox());<NEW_LINE>frame.out(opr);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>opr = out[0];<NEW_LINE>frame.mergeIn(pop(), pop());<NEW_LINE>}<NEW_LINE>int op = insn.getOpcode();<NEW_LINE>if (op == DALOAD || op == LALOAD) {<NEW_LINE>pushDual(opr);<NEW_LINE>} else {<NEW_LINE>push(opr);<NEW_LINE>}<NEW_LINE>}
insn, dupd2.stackOrValue());
76,240
private void processOrphanModules() {<NEW_LINE>if (myProject.isDisposed())<NEW_LINE>return;<NEW_LINE>if (ExternalSystemDebugEnvironment.DEBUG_ORPHAN_MODULES_PROCESSING) {<NEW_LINE>LOG.info(String.format("Checking for orphan modules. External paths returned by external system: '%s'", myExternalModulePaths));<NEW_LINE>}<NEW_LINE>List<Module> orphanIdeModules = ContainerUtilRt.newArrayList();<NEW_LINE>String externalSystemIdAsString = myExternalSystemId.toString();<NEW_LINE>for (Module module : ModuleManager.getInstance(myProject).getModules()) {<NEW_LINE>String s = ExternalSystemApiUtil.getExtensionSystemOption(module, ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY);<NEW_LINE>String p = ExternalSystemApiUtil.getExtensionSystemOption(module, ExternalSystemConstants.LINKED_PROJECT_PATH_KEY);<NEW_LINE>if (ExternalSystemDebugEnvironment.DEBUG_ORPHAN_MODULES_PROCESSING) {<NEW_LINE>LOG.info(String.format("IDE module: EXTERNAL_SYSTEM_ID_KEY - '%s', LINKED_PROJECT_PATH_KEY - '%s'.", s, p));<NEW_LINE>}<NEW_LINE>if (externalSystemIdAsString.equals(s) && !myExternalModulePaths.contains(p)) {<NEW_LINE>orphanIdeModules.add(module);<NEW_LINE>if (ExternalSystemDebugEnvironment.DEBUG_ORPHAN_MODULES_PROCESSING) {<NEW_LINE>LOG.info<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!orphanIdeModules.isEmpty()) {<NEW_LINE>ruleOrphanModules(orphanIdeModules, myProject, myExternalSystemId);<NEW_LINE>}<NEW_LINE>}
(String.format("External paths doesn't contain IDE module LINKED_PROJECT_PATH_KEY anymore => add to orphan IDE modules."));
722,180
private Token parseOperator() throws ParseException {<NEW_LINE>int tokenStartIndex = currentColumnIndex;<NEW_LINE>StringBuilder tokenValue = new StringBuilder();<NEW_LINE>while (true) {<NEW_LINE>tokenValue.append((char) currentChar);<NEW_LINE>String tokenString = tokenValue.toString();<NEW_LINE>String possibleNextOperator = tokenString + (char) peekNextChar();<NEW_LINE>boolean possibleNextOperatorFound = (prefixOperatorAllowed() && operatorDictionary.hasPrefixOperator(possibleNextOperator)) || (postfixOperatorAllowed() && operatorDictionary.hasPostfixOperator(possibleNextOperator)) || (infixOperatorAllowed() && operatorDictionary.hasInfixOperator(possibleNextOperator));<NEW_LINE>consumeChar();<NEW_LINE>if (!possibleNextOperatorFound) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String tokenString = tokenValue.toString();<NEW_LINE>if (prefixOperatorAllowed() && operatorDictionary.hasPrefixOperator(tokenString)) {<NEW_LINE>OperatorIfc <MASK><NEW_LINE>return new Token(tokenStartIndex, tokenString, TokenType.PREFIX_OPERATOR, operator);<NEW_LINE>} else if (postfixOperatorAllowed() && operatorDictionary.hasPostfixOperator(tokenString)) {<NEW_LINE>OperatorIfc operator = operatorDictionary.getPostfixOperator(tokenString);<NEW_LINE>return new Token(tokenStartIndex, tokenString, TokenType.POSTFIX_OPERATOR, operator);<NEW_LINE>} else if (operatorDictionary.hasInfixOperator(tokenString)) {<NEW_LINE>OperatorIfc operator = operatorDictionary.getInfixOperator(tokenString);<NEW_LINE>return new Token(tokenStartIndex, tokenString, TokenType.INFIX_OPERATOR, operator);<NEW_LINE>}<NEW_LINE>throw new ParseException(tokenStartIndex, tokenStartIndex + tokenString.length() - 1, tokenString, "Undefined operator '" + tokenString + "'");<NEW_LINE>}
operator = operatorDictionary.getPrefixOperator(tokenString);
1,062,749
private void split(MAsset asset) {<NEW_LINE>asset.changeStatus(MAsset.A_ASSET_STATUS_Preservation, getDateDoc());<NEW_LINE>// Update Product Balance<NEW_LINE>MAssetProduct assetProduct = MAssetProduct.getCreate(getCtx(), getA_Asset_ID(), asset.getM_Product_ID(), asset.getM_AttributeSetInstance_ID(), get_TrxName());<NEW_LINE>assetProduct.setA_QTY_Current(BigDecimal.ZERO);<NEW_LINE>assetProduct.setAD_Org_ID(asset.getAD_Org_ID());<NEW_LINE>assetProduct.saveEx();<NEW_LINE>assetProduct.updateAsset(asset);<NEW_LINE>asset.setA_QTY_Current(BigDecimal.ZERO);<NEW_LINE>asset.setQty(BigDecimal.ZERO);<NEW_LINE>asset.saveEx();<NEW_LINE>MDepreciationWorkfile assetBalance = MDepreciationWorkfile.get(getCtx(), getA_Asset_ID(), getPostingType(), get_TrxName());<NEW_LINE>assetBalance.setA_Asset_Cost(BigDecimal.ZERO);<NEW_LINE>assetBalance.setA_Salvage_Value(BigDecimal.ZERO);<NEW_LINE><MASK><NEW_LINE>assetBalance.setA_Asset_Remaining(BigDecimal.ZERO);<NEW_LINE>assetBalance.setA_Accumulated_Depr_F(BigDecimal.ZERO);<NEW_LINE>assetBalance.setA_Asset_Remaining_F(BigDecimal.ZERO);<NEW_LINE>assetBalance.setIsDepreciated(false);<NEW_LINE>assetBalance.saveEx();<NEW_LINE>// Delete not processed expense entries<NEW_LINE>MDepreciationExp.getNotProcessedEntries(getCtx(), getA_Asset_ID(), getPostingType(), get_TrxName()).forEach(depreciation -> depreciation.deleteEx(false));<NEW_LINE>// Update Asset History<NEW_LINE>MAssetChange.createSplit(this, assetBalance);<NEW_LINE>}
assetBalance.setA_Accumulated_Depr(BigDecimal.ZERO);
1,753,684
private static XTextDocument selectDocumentDialog(List<XTextDocument> list, DialogService dialogService) {<NEW_LINE>class DocumentTitleViewModel {<NEW_LINE><NEW_LINE>private final XTextDocument xTextDocument;<NEW_LINE><NEW_LINE>private final String description;<NEW_LINE><NEW_LINE>public DocumentTitleViewModel(XTextDocument xTextDocument) {<NEW_LINE>this.xTextDocument = xTextDocument;<NEW_LINE>this.description = UnoTextDocument.getFrameTitle(xTextDocument).orElse("");<NEW_LINE>}<NEW_LINE><NEW_LINE>public XTextDocument getXtextDocument() {<NEW_LINE>return xTextDocument;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String toString() {<NEW_LINE>return description;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<DocumentTitleViewModel> viewModel = (list.stream().map(DocumentTitleViewModel::new).collect<MASK><NEW_LINE>// This whole method is part of a background task when<NEW_LINE>// auto-detecting instances, so we need to show dialog in FX<NEW_LINE>// thread<NEW_LINE>Optional<DocumentTitleViewModel> selectedDocument = (dialogService.showChoiceDialogAndWait(Localization.lang("Select document"), Localization.lang("Found documents:"), Localization.lang("Use selected document"), viewModel));<NEW_LINE>return (selectedDocument.map(DocumentTitleViewModel::getXtextDocument).orElse(null));<NEW_LINE>}
(Collectors.toList()));
1,478,928
/* (non-Javadoc)<NEW_LINE>* @see org.eclipse.ui.dialogs.FilteredItemsSelectionDialog#fillContentProvider(org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.AbstractContentProvider, org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter, org.eclipse.core.runtime.IProgressMonitor)<NEW_LINE>*/<NEW_LINE>protected void fillContentProvider(final AbstractContentProvider contentProvider, final ItemsFilter itemsFilter, final IProgressMonitor progressMonitor) throws CoreException {<NEW_LINE>final Spec spec = Activator.getSpecManager().getSpecLoaded();<NEW_LINE>// On the initial/welcome page, no spec is open.<NEW_LINE>if (spec != null) {<NEW_LINE>// Models<NEW_LINE>final Collection<Model> models = spec.getAdapter(TLCSpec.class).getModels().values();<NEW_LINE>for (final Model model : models) {<NEW_LINE>if (itemsFilter.isConsistentItem(model)) {<NEW_LINE>contentProvider.add(model, itemsFilter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Modules<NEW_LINE>final List<Module> modules = spec.getModules();<NEW_LINE>if (modules.size() > 0) {<NEW_LINE>contentProvider.add(modulesSep, itemsFilter);<NEW_LINE>for (Module module : modules) {<NEW_LINE>if (itemsFilter.isConsistentItem(module)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// All closed specs<NEW_LINE>if (toggleShowSpecAction.isChecked()) {<NEW_LINE>final Spec[] specs = Activator.getSpecManager().getRecentlyOpened();<NEW_LINE>if (specs.length > 0) {<NEW_LINE>contentProvider.add(specsSep, itemsFilter);<NEW_LINE>for (int i = 0; i < specs.length; i++) {<NEW_LINE>final Spec aSpec = specs[i];<NEW_LINE>if (!aSpec.equals(spec) && itemsFilter.isConsistentItem(aSpec)) {<NEW_LINE>contentProvider.add(aSpec, itemsFilter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
contentProvider.add(module, itemsFilter);
56,668
public void enterRoutePlanningModeGivenGpx(GPXFile gpxFile, ApplicationMode appMode, LatLon from, PointDescription fromName, boolean useIntermediatePointsByDefault, boolean showMenu, int menuState) {<NEW_LINE>settings.USE_INTERMEDIATE_POINTS_NAVIGATION.set(useIntermediatePointsByDefault);<NEW_LINE>TargetPointsHelper targets = app.getTargetPointsHelper();<NEW_LINE>ApplicationMode mode = appMode <MASK><NEW_LINE>app.getSettings().setApplicationMode(mode, false);<NEW_LINE>app.getRoutingHelper().setAppMode(mode);<NEW_LINE>initVoiceCommandPlayer(mode, showMenu);<NEW_LINE>// save application mode controls<NEW_LINE>settings.FOLLOW_THE_ROUTE.set(false);<NEW_LINE>app.getRoutingHelper().setFollowingMode(false);<NEW_LINE>app.getRoutingHelper().setRoutePlanningMode(true);<NEW_LINE>// reset start point<NEW_LINE>targets.setStartPoint(from, false, fromName);<NEW_LINE>// then set gpx<NEW_LINE>setGPXRouteParams(gpxFile);<NEW_LINE>// then update start and destination point<NEW_LINE>targets.updateRouteAndRefresh(true);<NEW_LINE>app.getMapViewTrackingUtilities().switchToRoutePlanningMode();<NEW_LINE>app.getOsmandMap().refreshMap(true);<NEW_LINE>if (targets.hasTooLongDistanceToNavigate()) {<NEW_LINE>app.showToastMessage(R.string.route_is_too_long_v2);<NEW_LINE>}<NEW_LINE>}
!= null ? appMode : getRouteMode();
692,142
public final void heredoc() throws RecognitionException, TokenStreamException {<NEW_LINE>returnAST = null;<NEW_LINE>ASTPair currentAST = new ASTPair();<NEW_LINE>AST heredoc_AST = null;<NEW_LINE>match(HERE_DOC_BEGIN);<NEW_LINE>{<NEW_LINE>switch(LA(1)) {<NEW_LINE>case HERE_DOC_CONTENT:<NEW_LINE>{<NEW_LINE>AST tmp293_AST = null;<NEW_LINE>tmp293_AST = astFactory.create(LT(1));<NEW_LINE>astFactory.addASTChild(currentAST, tmp293_AST);<NEW_LINE>match(HERE_DOC_CONTENT);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case HERE_DOC_BEFORE_EXPRESSION_SUBSTITUTION:<NEW_LINE>{<NEW_LINE>AST tmp294_AST = null;<NEW_LINE>tmp294_AST = astFactory.create(LT(1));<NEW_LINE>astFactory.makeASTRoot(currentAST, tmp294_AST);<NEW_LINE>match(HERE_DOC_BEFORE_EXPRESSION_SUBSTITUTION);<NEW_LINE>expression_substituation();<NEW_LINE>astFactory.addASTChild(currentAST, returnAST);<NEW_LINE>if (inputState.guessing == 0) {<NEW_LINE>tellLexerWeHaveFinishedParsingHeredocExpressionSubstituation();<NEW_LINE>}<NEW_LINE>{<NEW_LINE>_loop222: do {<NEW_LINE>if ((LA(1) == HERE_DOC_BETWEEN_EXPRESSION_SUBSTITUTION)) {<NEW_LINE>AST tmp295_AST = null;<NEW_LINE>tmp295_AST = astFactory.create(LT(1));<NEW_LINE>astFactory.addASTChild(currentAST, tmp295_AST);<NEW_LINE>match(HERE_DOC_BETWEEN_EXPRESSION_SUBSTITUTION);<NEW_LINE>expression_substituation();<NEW_LINE>astFactory.addASTChild(currentAST, returnAST);<NEW_LINE>if (inputState.guessing == 0) {<NEW_LINE>tellLexerWeHaveFinishedParsingHeredocExpressionSubstituation();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>break _loop222;<NEW_LINE>}<NEW_LINE>} while (true);<NEW_LINE>}<NEW_LINE>AST tmp296_AST = null;<NEW_LINE>tmp296_AST = astFactory.create(LT(1));<NEW_LINE>astFactory.addASTChild(currentAST, tmp296_AST);<NEW_LINE>match(HERE_DOC_AFTER_EXPRESSION_SUBSTITUTION);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new NoViableAltException(LT(1), getFilename());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>returnAST = heredoc_AST;<NEW_LINE>}
heredoc_AST = (AST) currentAST.root;
2,835
private <E> MetaResultSet createResultSet(Enumerable<E> enumerable, Class clazz, String... names) {<NEW_LINE>final List<ColumnMetaData> columns = new ArrayList<>();<NEW_LINE>final List<Field> fields = new ArrayList<>();<NEW_LINE>final List<String> fieldNames = new ArrayList<>();<NEW_LINE>for (String name : names) {<NEW_LINE>final int index = fields.size();<NEW_LINE>final String fieldName = AvaticaUtils.toCamelCase(name);<NEW_LINE>final Field field;<NEW_LINE>try {<NEW_LINE>field = clazz.getField(fieldName);<NEW_LINE>} catch (NoSuchFieldException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>columns.add(columnMetaData(name, index, field.getType(), false));<NEW_LINE>fields.add(field);<NEW_LINE>fieldNames.add(fieldName);<NEW_LINE>}<NEW_LINE>// noinspection unchecked<NEW_LINE>final Iterable<Object> iterable = (Iterable<Object>) (Iterable) enumerable;<NEW_LINE>return createResultSet(Collections.emptyMap(), columns, CursorFactory.record(clazz, fields, fieldNames), new Frame<MASK><NEW_LINE>}
(0, true, iterable));
307,502
protected void sendAuthnRequest(HttpFacade httpFacade, SAML2AuthnRequestBuilder authnRequestBuilder, BaseSAML2BindingBuilder binding) {<NEW_LINE>try {<NEW_LINE>MessageFactory messageFactory = MessageFactory.newInstance();<NEW_LINE>SOAPMessage message = messageFactory.createMessage();<NEW_LINE>SOAPEnvelope envelope = message.getSOAPPart().getEnvelope();<NEW_LINE>envelope.addNamespaceDeclaration(NS_PREFIX_SAML_ASSERTION, JBossSAMLURIConstants.ASSERTION_NSURI.get());<NEW_LINE>envelope.addNamespaceDeclaration(NS_PREFIX_SAML_PROTOCOL, JBossSAMLURIConstants.PROTOCOL_NSURI.get());<NEW_LINE>envelope.addNamespaceDeclaration(NS_PREFIX_PAOS_BINDING, JBossSAMLURIConstants.PAOS_BINDING.get());<NEW_LINE>envelope.addNamespaceDeclaration(NS_PREFIX_PROFILE_ECP, <MASK><NEW_LINE>createPaosRequestHeader(envelope);<NEW_LINE>createEcpRequestHeader(envelope);<NEW_LINE>SOAPBody body = envelope.getBody();<NEW_LINE>body.addDocument(binding.postBinding(authnRequestBuilder.toDocument()).getDocument());<NEW_LINE>message.writeTo(httpFacade.getResponse().getOutputStream());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Could not create AuthnRequest.", e);<NEW_LINE>}<NEW_LINE>}
JBossSAMLURIConstants.ECP_PROFILE.get());
1,195,837
protected void renderTransmissionDynamic(@Nonnull IConduit conduit, @Nonnull IConduitTexture tex, @Nullable Vector4f color, @Nonnull CollidableComponent component, float selfIllum) {<NEW_LINE>float filledRatio = ((GasConduit) conduit).getTank().getFilledRatio();<NEW_LINE>if (filledRatio <= 0 || !component.isDirectional()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TextureAtlasSprite sprite = tex.getSprite();<NEW_LINE>BoundingBox[] cubes = toCubes(component.bound);<NEW_LINE>for (BoundingBox cube : cubes) {<NEW_LINE>if (cube != null) {<NEW_LINE>float shrink = 1 / 128f;<NEW_LINE>EnumFacing componentDirection = component.getDirection();<NEW_LINE>float xLen = Math.abs(componentDirection.getFrontOffsetX()) == 1 ? 0 : shrink;<NEW_LINE>float yLen = Math.abs(componentDirection.getFrontOffsetY()) == 1 ? 0 : shrink;<NEW_LINE>float zLen = Math.abs(componentDirection.getFrontOffsetZ(<MASK><NEW_LINE>BoundingBox bb = cube.expand(-xLen, -yLen, -zLen);<NEW_LINE>drawDynamicSection(bb, sprite.getInterpolatedU(tex.getUv().x * 16), sprite.getInterpolatedU(tex.getUv().z * 16), sprite.getInterpolatedV(tex.getUv().y * 16), sprite.getInterpolatedV(tex.getUv().w * 16), color, componentDirection, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
)) == 1 ? 0 : shrink;
785,765
public void initJobHandlers() {<NEW_LINE>jobHandlers = new HashMap<>();<NEW_LINE>jobHandlers.put(TriggerTimerEventJobHandler.TYPE, new TriggerTimerEventJobHandler());<NEW_LINE>jobHandlers.put(AsyncActivatePlanItemInstanceJobHandler.TYPE, new AsyncActivatePlanItemInstanceJobHandler());<NEW_LINE>jobHandlers.put(AsyncInitializePlanModelJobHandler.TYPE, new AsyncInitializePlanModelJobHandler());<NEW_LINE>jobHandlers.put(CmmnHistoryCleanupJobHandler.TYPE, new CmmnHistoryCleanupJobHandler());<NEW_LINE>jobHandlers.put(ExternalWorkerTaskCompleteJobHandler.<MASK><NEW_LINE>addJobHandler(new ComputeDeleteHistoricCaseInstanceIdsJobHandler());<NEW_LINE>addJobHandler(new ComputeDeleteHistoricCaseInstanceStatusJobHandler());<NEW_LINE>addJobHandler(new DeleteHistoricCaseInstanceIdsJobHandler());<NEW_LINE>addJobHandler(new DeleteHistoricCaseInstanceIdsStatusJobHandler());<NEW_LINE>// if we have custom job handlers, register them<NEW_LINE>if (customJobHandlers != null) {<NEW_LINE>for (JobHandler customJobHandler : customJobHandlers) {<NEW_LINE>jobHandlers.put(customJobHandler.getType(), customJobHandler);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
TYPE, new ExternalWorkerTaskCompleteJobHandler(this));
1,283,387
protected mxRectangle revalidateState(mxCellState parentState, mxCellState state, double dx, double dy) {<NEW_LINE>mxRectangle dirty = null;<NEW_LINE>if (state != null) {<NEW_LINE>mxGraph graph = graphComponent.getGraph();<NEW_LINE>mxIGraphModel model = graph.getModel();<NEW_LINE>Object cell = state.getCell();<NEW_LINE>// Updates the edge terminal points and restores the<NEW_LINE>// (relative) positions of any (relative) children<NEW_LINE>state.setInvalid(true);<NEW_LINE>dirty = graph.getView(<MASK><NEW_LINE>// Moves selection vertices which are relative<NEW_LINE>mxGeometry geo = graph.getCellGeometry(cell);<NEW_LINE>if ((dx != 0 || dy != 0) && geo != null && geo.isRelative() && model.isVertex(cell) && (parentState == null || model.isVertex(parentState.getCell()) || deltas.get(state) != null)) {<NEW_LINE>state.setX(state.getX() + dx);<NEW_LINE>state.setY(state.getY() + dy);<NEW_LINE>// TODO: Check this change<NEW_LINE>dirty.setX(dirty.getX() + dx);<NEW_LINE>dirty.setY(dirty.getY() + dy);<NEW_LINE>graph.getView().updateLabelBounds(state);<NEW_LINE>}<NEW_LINE>int childCount = model.getChildCount(cell);<NEW_LINE>for (int i = 0; i < childCount; i++) {<NEW_LINE>mxRectangle tmp = revalidateState(state, graph.getView().getState(model.getChildAt(cell, i)), dx, dy);<NEW_LINE>if (dirty != null) {<NEW_LINE>dirty.add(tmp);<NEW_LINE>} else {<NEW_LINE>dirty = tmp;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return dirty;<NEW_LINE>}
).validatePoints(parentState, cell);
694,288
private void initModels() {<NEW_LINE>List<JSFConfigModel> mods = new LinkedList<JSFConfigModel>();<NEW_LINE>JSFConfigModel facesConfigMod = null;<NEW_LINE>FileObject facesConfig = getUnit().getApplicationFacesConfig();<NEW_LINE>if (facesConfig != null) {<NEW_LINE>facesConfigMod = createModel(facesConfig);<NEW_LINE>if (facesConfigMod != null) {<NEW_LINE>mods.add(facesConfigMod);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (FileObject fo : getUnit().getApplicationConfigurationResources()) {<NEW_LINE>JSFConfigModel model = createModel(fo);<NEW_LINE>if (model != null) {<NEW_LINE>mods.add(model);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setModelsVariable(mods, facesConfigMod);<NEW_LINE>// TODO: nobody seems to be listening and there is not property defined in JsfModel api class<NEW_LINE>// firing something anyway.<NEW_LINE>getChangeSupport().<MASK><NEW_LINE>}
firePropertyChange("model-changed", null, null);
225,064
public void onSensorChanged(SensorEvent se) {<NEW_LINE>if (se.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {<NEW_LINE>// Update mapping at sensor rate, values are inverted to be coherent with iOS<NEW_LINE>dspFaust.propagateAcc(0, <MASK><NEW_LINE>dspFaust.propagateAcc(1, -se.values[1]);<NEW_LINE>dspFaust.propagateAcc(2, -se.values[2]);<NEW_LINE>}<NEW_LINE>if (se.sensor.getType() == Sensor.TYPE_GYROSCOPE) {<NEW_LINE>// Update mapping at sensor rate<NEW_LINE>dspFaust.propagateGyr(0, se.values[0]);<NEW_LINE>dspFaust.propagateGyr(1, se.values[1]);<NEW_LINE>dspFaust.propagateGyr(2, se.values[2]);<NEW_LINE>}<NEW_LINE>}
-se.values[0]);
1,835,481
private void renderUserIcons(Graphics g, int iconId, String header, int cy, float alpha) {<NEW_LINE>Fonts.MEDIUMBOLD.drawString(x + (width - Fonts.MEDIUMBOLD.getWidth(header)) / 2, cy, header, COLOR_WHITE);<NEW_LINE>cy += Fonts.MEDIUMBOLD.getLineHeight() + usersPaddingY;<NEW_LINE>int iconSize = UserButton.getIconSize();<NEW_LINE>int paddingX = iconSize / 4;<NEW_LINE>int maxPerLine = UserButton.getWidth() / (iconSize + paddingX);<NEW_LINE>// start scroll area here<NEW_LINE>g.setClip((int) x, cy, width, height - (int) (cy - y));<NEW_LINE>int scrollOffset = ((userIcons.length - 1) / maxPerLine + 1) * (iconSize + usersPaddingY);<NEW_LINE>scrollOffset -= height - cy;<NEW_LINE>scrollOffset = Math.max(scrollOffset, 0);<NEW_LINE>scrolling.setMinMax(0, scrollOffset);<NEW_LINE>cy += -scrolling.getPosition();<NEW_LINE>for (int i = 0; i < userIcons.length; i += maxPerLine) {<NEW_LINE>// draw line-by-line<NEW_LINE>int n = Math.min(maxPerLine, userIcons.length - i);<NEW_LINE>int cx = (int) (x + usersStartX + (UserButton.getWidth() - iconSize * n - paddingX * (n - 1)) / 2);<NEW_LINE>for (int j = 0; j < n; j++) {<NEW_LINE>MenuButton button = userIcons[i + j];<NEW_LINE>button.<MASK><NEW_LINE>button.setY(cy + iconSize / 2);<NEW_LINE>if (cy < height) {<NEW_LINE>button.getImage().setAlpha((iconId == i + j) ? alpha : alpha * button.getHoverAlpha() * 0.9f);<NEW_LINE>button.getImage().draw(cx, cy);<NEW_LINE>}<NEW_LINE>cx += iconSize + paddingX;<NEW_LINE>}<NEW_LINE>cy += iconSize + usersPaddingY;<NEW_LINE>}<NEW_LINE>}
setX(cx + iconSize / 2);
1,482,420
public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {<NEW_LINE>List<IHyperlink> hyperlinks = new ArrayList<IHyperlink>();<NEW_LINE>try {<NEW_LINE>IDocument doc = textViewer.getDocument();<NEW_LINE>String scope = CommonEditorPlugin.getDefault().getDocumentScopeManager().getScopeAtOffset(textViewer, region.getOffset());<NEW_LINE>// Match scope against source.css<NEW_LINE>IScopeSelector selector = new ScopeSelector(ICSSConstants.CSS_SCOPE);<NEW_LINE>if (!selector.matches(scope)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>IRegion lineRegion = doc.getLineInformationOfOffset(region.getOffset());<NEW_LINE>String line = doc.get(lineRegion.getOffset(), lineRegion.getLength());<NEW_LINE>Matcher <MASK><NEW_LINE>if (!m.find()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Index index = getIndex();<NEW_LINE>if (index == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String htmlId = m.group().substring(1);<NEW_LINE>List<QueryResult> results = index.query(new String[] { ICSSIndexConstants.IDENTIFIER }, htmlId, SearchPattern.EXACT_MATCH | SearchPattern.CASE_SENSITIVE);<NEW_LINE>if (results == null || results.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int start = m.start() + lineRegion.getOffset();<NEW_LINE>int length = m.end() - m.start();<NEW_LINE>IRegion linkRegion = new Region(start, length);<NEW_LINE>for (QueryResult result : results) {<NEW_LINE>Set<String> documents = result.getDocuments();<NEW_LINE>if (documents == null || documents.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (String filepath : documents) {<NEW_LINE>// FIXME Don't suggest current file/occurrence<NEW_LINE>// FIXME Don't suggest usages in embedded CSS inside HTML<NEW_LINE>hyperlinks.add(new EditorSearchHyperlink(linkRegion, htmlId, new URI(filepath)));<NEW_LINE>if (!canShowMultipleHyperlinks) {<NEW_LINE>return new IHyperlink[] { hyperlinks.get(0) };<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>IdeLog.logError(CSSPlugin.getDefault(), e);<NEW_LINE>}<NEW_LINE>if (hyperlinks.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return hyperlinks.toArray(new IHyperlink[hyperlinks.size()]);<NEW_LINE>}
m = HTML_ID.matcher(line);
1,585,603
// when we cast yaml.load(fin)<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>public static Map<String, Object> loadFile(String fileName) {<NEW_LINE>Map<String, Object> props = new HashMap<>();<NEW_LINE>if (fileName == null) {<NEW_LINE>LOG.warning("Config file name cannot be null");<NEW_LINE>return props;<NEW_LINE>} else if (fileName.isEmpty()) {<NEW_LINE>LOG.warning("Config file name is empty");<NEW_LINE>return props;<NEW_LINE>} else {<NEW_LINE>// check if the file exists and also it is a regular file<NEW_LINE>Path <MASK><NEW_LINE>if (!Files.exists(path)) {<NEW_LINE>LOG.fine("Config file " + fileName + " does not exist");<NEW_LINE>return props;<NEW_LINE>}<NEW_LINE>if (!Files.isRegularFile(path)) {<NEW_LINE>LOG.warning("Config file " + fileName + " might be a directory.");<NEW_LINE>return props;<NEW_LINE>}<NEW_LINE>LOG.log(Level.FINE, "Reading config file {0}", fileName);<NEW_LINE>Map<String, Object> propsYaml = null;<NEW_LINE>try {<NEW_LINE>FileInputStream fin = new FileInputStream(new File(fileName));<NEW_LINE>try {<NEW_LINE>Yaml yaml = new Yaml(new SafeConstructor());<NEW_LINE>propsYaml = (Map<String, Object>) yaml.load(fin);<NEW_LINE>LOG.log(Level.FINE, "Successfully read config file {0}", fileName);<NEW_LINE>} finally {<NEW_LINE>fin.close();<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.log(Level.SEVERE, "Failed to load config file: " + fileName, e);<NEW_LINE>}<NEW_LINE>return propsYaml != null ? propsYaml : props;<NEW_LINE>}<NEW_LINE>}
path = Paths.get(fileName);
645,901
public LuaValue[] calculateSize(LuaValue[] p) {<NEW_LINE>int maxWidth = DimenUtil.dpiToPx((float) p[0].toDouble());<NEW_LINE>if (maxWidth < 0) {<NEW_LINE>if (MLSEngine.DEBUG) {<NEW_LINE>IllegalArgumentException e = new IllegalArgumentException("max width must be more than 0");<NEW_LINE>if (!Environment.hook(e, getGlobals())) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (lastSize == null) {<NEW_LINE>lastSize = new UDSize(globals, new Size());<NEW_LINE>lastSize.onJavaRef();<NEW_LINE>}<NEW_LINE>return varargsOf(lastSize);<NEW_LINE>}<NEW_LINE>if (layout != null && lastMaxWidth == maxWidth && !changeText && !changeSizePan) {<NEW_LINE>return varargsOf(lastSize);<NEW_LINE>}<NEW_LINE>if (lastSize == null) {<NEW_LINE>lastSize = new UDSize<MASK><NEW_LINE>lastSize.onJavaRef();<NEW_LINE>}<NEW_LINE>lastMaxWidth = maxWidth;<NEW_LINE>changeText = false;<NEW_LINE>changeSizePan = false;<NEW_LINE>if (sizeSpan != null) {<NEW_LINE>caculatePaint.setTextSize(sizeSpan.getSize());<NEW_LINE>}<NEW_LINE>layout = new StaticLayout(text, caculatePaint, maxWidth, Layout.Alignment.ALIGN_NORMAL, 1, 0, true);<NEW_LINE>int size = layout.getLineCount();<NEW_LINE>float r = 0;<NEW_LINE>float temp;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (r < (temp = layout.getLineWidth(i))) {<NEW_LINE>r = temp;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>float dp = DimenUtil.pxToDpi(r);<NEW_LINE>int w = (int) Math.ceil(dp);<NEW_LINE>int h = (int) Math.ceil(DimenUtil.pxToDpi(layout.getHeight()));<NEW_LINE>lastSize.setWidth(w);<NEW_LINE>lastSize.setHeight(h);<NEW_LINE>return varargsOf(lastSize);<NEW_LINE>}
(globals, new Size());
121,051
final StopReplicationTaskResult executeStopReplicationTask(StopReplicationTaskRequest stopReplicationTaskRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopReplicationTaskRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopReplicationTaskRequest> request = null;<NEW_LINE>Response<StopReplicationTaskResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StopReplicationTaskRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopReplicationTaskRequest));<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, "Database Migration Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopReplicationTask");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StopReplicationTaskResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopReplicationTaskResultJsonUnmarshaller());<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);
1,640,326
final GetPullRequestOverrideStateResult executeGetPullRequestOverrideState(GetPullRequestOverrideStateRequest getPullRequestOverrideStateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getPullRequestOverrideStateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetPullRequestOverrideStateRequest> request = null;<NEW_LINE>Response<GetPullRequestOverrideStateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetPullRequestOverrideStateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getPullRequestOverrideStateRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CodeCommit");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetPullRequestOverrideState");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetPullRequestOverrideStateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetPullRequestOverrideStateResultJsonUnmarshaller());<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>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,058,140
public okhttp3.Call subscribeForBotDetectionAlertsCall(BotDetectionAlertSubscriptionDTO botDetectionAlertSubscriptionDTO, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = botDetectionAlertSubscriptionDTO;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/alert-subscriptions/bot-detection";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String <MASK><NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
1,810,583
protected Tuple4<String[], String[], TypeInformation<?>[], String[]> prepareIoSchema(TableSchema dataSchema, Params params) {<NEW_LINE>ArrayList<String> tensorCols = new ArrayList<>();<NEW_LINE>ArrayList<TypeInformation<?>> tensorColTypes = new ArrayList<>();<NEW_LINE>String[] names = dataSchema.getFieldNames();<NEW_LINE>TypeInformation<?>[] types = dataSchema.getFieldTypes();<NEW_LINE>for (int i = 0; i < types.length; i++) {<NEW_LINE>if (AlinkTypes.TENSOR.equals(types[i]) || AlinkTypes.BOOL_TENSOR.equals(types[i]) || AlinkTypes.BYTE_TENSOR.equals(types[i]) || AlinkTypes.INT_TENSOR.equals(types[i]) || AlinkTypes.DOUBLE_TENSOR.equals(types[i]) || AlinkTypes.FLOAT_TENSOR.equals(types[i]) || AlinkTypes.LONG_TENSOR.equals(types[i]) || AlinkTypes.STRING_TENSOR.equals(types[i])) {<NEW_LINE>tensorCols.add(names[i]);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>String[] selectedCols = tensorCols.toArray(new String[0]);<NEW_LINE>TypeInformation<?>[] selectedColTypes = tensorColTypes.toArray(new TypeInformation<?>[0]);<NEW_LINE>return Tuple4.of(selectedCols, selectedCols, selectedColTypes, null);<NEW_LINE>}
tensorColTypes.add(Types.STRING);
705,780
public void marshall(OpsItemRelatedItemSummary opsItemRelatedItemSummary, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (opsItemRelatedItemSummary == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(opsItemRelatedItemSummary.getOpsItemId(), OPSITEMID_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemRelatedItemSummary.getAssociationId(), ASSOCIATIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemRelatedItemSummary.getResourceType(), RESOURCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(opsItemRelatedItemSummary.getResourceUri(), RESOURCEURI_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemRelatedItemSummary.getCreatedBy(), CREATEDBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemRelatedItemSummary.getCreatedTime(), CREATEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemRelatedItemSummary.getLastModifiedBy(), LASTMODIFIEDBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(opsItemRelatedItemSummary.getLastModifiedTime(), LASTMODIFIEDTIME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
opsItemRelatedItemSummary.getAssociationType(), ASSOCIATIONTYPE_BINDING);
626,649
public GenericRow decode(byte[] payload, int offset, int length, GenericRow destination) {<NEW_LINE>if (payload == null || payload.length == 0 || length == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>System.arraycopy(payload, SCHEMA_HASH_START_OFFSET + offset, _reusableMD5Bytes, 0, SCHEMA_HASH_LENGTH);<NEW_LINE>boolean schemaUpdateFailed = false;<NEW_LINE>org.apache.avro.Schema schema = _md5ToAvroSchemaMap.getSchema(_reusableMD5Bytes);<NEW_LINE>if (schema == null) {<NEW_LINE>// We will get here for the first row consumed in the segment, and every row that has a schema ID that is<NEW_LINE>// not yet in md5ToAvroSchemaMap.<NEW_LINE>synchronized (GLOBAL_SCHEMA_CACHE) {<NEW_LINE>final String hashKey = hex(_reusableMD5Bytes);<NEW_LINE>schema = GLOBAL_SCHEMA_CACHE.get(hashKey);<NEW_LINE>if (schema == null) {<NEW_LINE>// We will get here only if no partition of the table has populated the global schema cache.<NEW_LINE>// In that case, one of the consumers will fetch the schema and populate the cache, and the others<NEW_LINE>// should find it in the cache and po<NEW_LINE>final String schemaUri = "/id=" + hex(_reusableMD5Bytes);<NEW_LINE>try {<NEW_LINE>schema = fetchSchema(schemaUri);<NEW_LINE>GLOBAL_SCHEMA_CACHE.put(hashKey, schema);<NEW_LINE>_md5ToAvroSchemaMap.addSchema(_reusableMD5Bytes, schema);<NEW_LINE>} catch (Exception e) {<NEW_LINE>schema = _defaultAvroSchema;<NEW_LINE>LOGGER.error("Error fetching schema using url {}. Attempting to continue with previous schema", schemaUri, e);<NEW_LINE>schemaUpdateFailed = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>_md5ToAvroSchemaMap.addSchema(_reusableMD5Bytes, schema);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DatumReader<Record> reader = new GenericDatumReader<Record>(schema);<NEW_LINE>try {<NEW_LINE>GenericData.Record avroRecord = reader.read(null, _decoderFactory.createBinaryDecoder(payload, HEADER_LENGTH + offset, length - HEADER_LENGTH, null));<NEW_LINE>return _avroRecordExtractor.extract(avroRecord, destination);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error("Caught exception while reading message using schema {}{}", (schema == null ? "null" : schema.getName()), (schemaUpdateFailed ? "(possibly due to schema update failure)" : ""), e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
LOGGER.info("Found schema for {} in cache", hashKey);
321,777
private void populateDialog() throws CryptoException {<NEW_LINE>KeyInfo keyInfo = KeyPairUtil.getKeyInfo(privateKey);<NEW_LINE>jtfAlgorithm.setText(keyInfo.getAlgorithm());<NEW_LINE>Integer keyLength = keyInfo.getSize();<NEW_LINE>if (keyLength != null) {<NEW_LINE>jtfKeySize.setText(MessageFormat.format(res.getString("DViewPrivateKey.jtfKeySize.text"), "" + keyLength));<NEW_LINE>} else {<NEW_LINE>jtfKeySize.setText(MessageFormat.format(res.getString("DViewPrivateKey.jtfKeySize.text"), "?"));<NEW_LINE>}<NEW_LINE>jtfFormat.setText(privateKey.getFormat());<NEW_LINE>jtaEncoded.setText(new BigInteger(1, privateKey.getEncoded()).toString<MASK><NEW_LINE>jtaEncoded.setCaretPosition(0);<NEW_LINE>if ((privateKey instanceof RSAPrivateKey) || (privateKey instanceof DSAPrivateKey)) {<NEW_LINE>jbFields.setEnabled(true);<NEW_LINE>} else {<NEW_LINE>jbFields.setEnabled(false);<NEW_LINE>}<NEW_LINE>}
(16).toUpperCase());
301,273
public List<Comic> parseCategory(String html, int page) {<NEW_LINE>List<Comic> list = new LinkedList<>();<NEW_LINE>try {<NEW_LINE>String decodeJsonString = UicodeBackslashU.unicodeToCn(html).replace("\\/", "/");<NEW_LINE>JSONArray array = new JSONArray(decodeJsonString);<NEW_LINE>for (int i = 0; i != array.length(); ++i) {<NEW_LINE>try {<NEW_LINE>JSONObject object = array.getJSONObject(i);<NEW_LINE>if (object.optInt("hidden", 1) != 1) {<NEW_LINE>String cid = object.getString("id");<NEW_LINE>String <MASK><NEW_LINE>String cover = "http://images.dmzj1.com/".concat(object.getString("comic_cover"));<NEW_LINE>Long time = object.has("last_updatetime") ? object.getLong("last_updatetime") * 1000 : null;<NEW_LINE>String update = time == null ? null : new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).format(new Date(time));<NEW_LINE>String author = object.optString("comic_author");<NEW_LINE>list.add(new Comic(TYPE, cid, title, cover, update, author));<NEW_LINE>}<NEW_LINE>} catch (JSONException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (JSONException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}
title = object.getString("comic_name");
1,443,861
public void draw(BasinRecipe recipe, PoseStack matrixStack, double mouseX, double mouseY) {<NEW_LINE>if (type == PackingType.COMPACTING) {<NEW_LINE>super.draw(recipe, matrixStack, mouseX, mouseY);<NEW_LINE>} else {<NEW_LINE>NonNullList<Ingredient> ingredients2 = recipe.getIngredients();<NEW_LINE>int size = ingredients2.size();<NEW_LINE>int rows <MASK><NEW_LINE>for (int i = 0; i < size; i++) AllGuiTextures.JEI_SLOT.render(matrixStack, (rows == 2 ? 26 : 17) + (i % rows) * 19, 50 - (i / rows) * 19);<NEW_LINE>AllGuiTextures.JEI_SLOT.render(matrixStack, 141, 50);<NEW_LINE>AllGuiTextures.JEI_DOWN_ARROW.render(matrixStack, 136, 32);<NEW_LINE>AllGuiTextures.JEI_SHADOW.render(matrixStack, 81, 68);<NEW_LINE>}<NEW_LINE>HeatCondition requiredHeat = recipe.getRequiredHeat();<NEW_LINE>if (requiredHeat != HeatCondition.NONE)<NEW_LINE>heater.withHeat(requiredHeat.visualizeAsBlazeBurner()).draw(matrixStack, getBackground().getWidth() / 2 + 3, 55);<NEW_LINE>press.draw(matrixStack, getBackground().getWidth() / 2 + 3, 34);<NEW_LINE>}
= size == 4 ? 2 : 3;
1,045,694
final CreateOpsMetadataResult executeCreateOpsMetadata(CreateOpsMetadataRequest createOpsMetadataRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createOpsMetadataRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateOpsMetadataRequest> request = null;<NEW_LINE>Response<CreateOpsMetadataResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateOpsMetadataRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createOpsMetadataRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateOpsMetadata");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateOpsMetadataResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateOpsMetadataResultJsonUnmarshaller());<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.CLIENT_ENDPOINT, endpoint);
1,412,792
public void aggregate(ByteBuffer buf, int position, int startRow, int endRow) {<NEW_LINE>// Save position, limit and restore later instead of allocating a new ByteBuffer object<NEW_LINE>final int oldPosition = buf.position();<NEW_LINE>final int oldLimit = buf.limit();<NEW_LINE>try {<NEW_LINE>final long[] vector = selector.getLongVector();<NEW_LINE>final boolean[] nullVector = selector.getNullVector();<NEW_LINE>buf.limit(position + HyperLogLogCollector.getLatestNumBytesForDenseStorage());<NEW_LINE>buf.position(position);<NEW_LINE>final HyperLogLogCollector <MASK><NEW_LINE>for (int i = startRow; i < endRow; i++) {<NEW_LINE>if (NullHandling.replaceWithDefault() || nullVector == null || !nullVector[i]) {<NEW_LINE>LongCardinalityAggregatorColumnSelectorStrategy.addLongToCollector(collector, vector[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>buf.limit(oldLimit);<NEW_LINE>buf.position(oldPosition);<NEW_LINE>}<NEW_LINE>}
collector = HyperLogLogCollector.makeCollector(buf);
857,631
public void run() {<NEW_LINE>try {<NEW_LINE>logger.info("Policy [{}]: Running enrich policy", policyName);<NEW_LINE>task.setStatus(new ExecuteEnrichPolicyStatus(ExecuteEnrichPolicyStatus.PolicyPhases.RUNNING));<NEW_LINE>// Collect the source index information<NEW_LINE>final String[] sourceIndices = policy.getIndices().toArray(new String[0]);<NEW_LINE>logger.debug("Policy [{}]: Checking source indices [{}]", policyName, sourceIndices);<NEW_LINE>GetIndexRequest getIndexRequest = new <MASK><NEW_LINE>// This call does not set the origin to ensure that the user executing the policy has permission to access the source index<NEW_LINE>client.admin().indices().getIndex(getIndexRequest, listener.delegateFailure((l, getIndexResponse) -> {<NEW_LINE>try {<NEW_LINE>validateMappings(getIndexResponse);<NEW_LINE>prepareAndCreateEnrichIndex(toMappings(getIndexResponse));<NEW_LINE>} catch (Exception e) {<NEW_LINE>l.onFailure(e);<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>} catch (Exception e) {<NEW_LINE>listener.onFailure(e);<NEW_LINE>}<NEW_LINE>}
GetIndexRequest().indices(sourceIndices);
12,292
public com.amazonaws.services.shield.model.InvalidPaginationTokenException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.shield.model.InvalidPaginationTokenException invalidPaginationTokenException = new com.amazonaws.services.shield.model.InvalidPaginationTokenException(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>} 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 invalidPaginationTokenException;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
485,758
public // todo count1,count2 = could be the non-null values, intersection the values where both are non-null?<NEW_LINE>Stream<SimilarityResult> euclideanStream(@Name(value = "data", defaultValue = "null") Object rawData, @Name(value = "config", defaultValue = "{}") Map<String, Object> config) throws Exception {<NEW_LINE>ProcedureConfiguration configuration = ProcedureConfiguration.create(config);<NEW_LINE>Double skipValue = readSkipValue(configuration);<NEW_LINE>WeightedInput[] inputs = prepareWeights(rawData, configuration, skipValue);<NEW_LINE>if (inputs.length == 0) {<NEW_LINE>return Stream.empty();<NEW_LINE>}<NEW_LINE>long[] inputIds = SimilarityInput.extractInputIds(inputs);<NEW_LINE>int[] sourceIndexIds = indexesFor(inputIds, configuration, "sourceIds");<NEW_LINE>int[] targetIndexIds = indexesFor(inputIds, configuration, "targetIds");<NEW_LINE>SimilarityComputer<WeightedInput> computer = similarityComputer(skipValue, sourceIndexIds, targetIndexIds);<NEW_LINE>double similarityCutoff = similarityCutoff(configuration);<NEW_LINE>int topN = -getTopN(configuration);<NEW_LINE><MASK><NEW_LINE>return generateWeightedStream(configuration, inputs, sourceIndexIds, targetIndexIds, similarityCutoff, topN, topK, computer);<NEW_LINE>}
int topK = -getTopK(configuration);
643,406
public TransactGetItem unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TransactGetItem transactGetItem = new TransactGetItem();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Get", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>transactGetItem.setGet(GetJsonUnmarshaller.getInstance().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 transactGetItem;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
720,976
public JWSHeader convert(JoseHeader headers) {<NEW_LINE>JWSHeader.Builder builder = new JWSHeader.Builder(JWSAlgorithm.parse(headers.getAlgorithm<MASK><NEW_LINE>if (headers.getJwkSetUrl() != null) {<NEW_LINE>builder.jwkURL(convertAsURI(JoseHeaderNames.JKU, headers.getJwkSetUrl()));<NEW_LINE>}<NEW_LINE>Map<String, Object> jwk = headers.getJwk();<NEW_LINE>if (!CollectionUtils.isEmpty(jwk)) {<NEW_LINE>try {<NEW_LINE>builder.jwk(JWK.parse(jwk));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new JwtEncodingException(String.format(ENCODING_ERROR_MESSAGE_TEMPLATE, "Unable to convert '" + JoseHeaderNames.JWK + "' JOSE header"), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String keyId = headers.getKeyId();<NEW_LINE>if (StringUtils.hasText(keyId)) {<NEW_LINE>builder.keyID(keyId);<NEW_LINE>}<NEW_LINE>if (headers.getX509Url() != null) {<NEW_LINE>builder.x509CertURL(convertAsURI(JoseHeaderNames.X5U, headers.getX509Url()));<NEW_LINE>}<NEW_LINE>List<String> x509CertificateChain = headers.getX509CertificateChain();<NEW_LINE>if (!CollectionUtils.isEmpty(x509CertificateChain)) {<NEW_LINE>List<Base64> x5cList = new ArrayList<>();<NEW_LINE>x509CertificateChain.forEach((x5c) -> x5cList.add(new Base64(x5c)));<NEW_LINE>if (!x5cList.isEmpty()) {<NEW_LINE>builder.x509CertChain(x5cList);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String x509SHA1Thumbprint = headers.getX509SHA1Thumbprint();<NEW_LINE>if (StringUtils.hasText(x509SHA1Thumbprint)) {<NEW_LINE>builder.x509CertThumbprint(new Base64URL(x509SHA1Thumbprint));<NEW_LINE>}<NEW_LINE>String x509SHA256Thumbprint = headers.getX509SHA256Thumbprint();<NEW_LINE>if (StringUtils.hasText(x509SHA256Thumbprint)) {<NEW_LINE>builder.x509CertSHA256Thumbprint(new Base64URL(x509SHA256Thumbprint));<NEW_LINE>}<NEW_LINE>String type = headers.getType();<NEW_LINE>if (StringUtils.hasText(type)) {<NEW_LINE>builder.type(new JOSEObjectType(type));<NEW_LINE>}<NEW_LINE>String contentType = headers.getContentType();<NEW_LINE>if (StringUtils.hasText(contentType)) {<NEW_LINE>builder.contentType(contentType);<NEW_LINE>}<NEW_LINE>Set<String> critical = headers.getCritical();<NEW_LINE>if (!CollectionUtils.isEmpty(critical)) {<NEW_LINE>builder.criticalParams(critical);<NEW_LINE>}<NEW_LINE>Map<String, Object> customHeaders = new HashMap<>();<NEW_LINE>headers.getHeaders().forEach((name, value) -> {<NEW_LINE>if (!JWSHeader.getRegisteredParameterNames().contains(name)) {<NEW_LINE>customHeaders.put(name, value);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (!customHeaders.isEmpty()) {<NEW_LINE>builder.customParams(customHeaders);<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
().getName()));
1,356,958
public void beanRemoveInTransaction() throws javax.ejb.RemoveException {<NEW_LINE>// Current the method is already in a global tx - TX_Required.<NEW_LINE>SFLa ejb2 = null;<NEW_LINE>SFLaHome fhome2 = (SFLaHome) getSessionContext().getEJBLocalHome();<NEW_LINE>try {<NEW_LINE>ejb2 = fhome2.create();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new EJBException(" Caught unexpected " + t.<MASK><NEW_LINE>}<NEW_LINE>printMsg(BeanName, " in beanRemoveInTransaction: created SFRa bean = " + ejb2);<NEW_LINE>try {<NEW_LINE>if (ejb2 != null) {<NEW_LINE>// force ejb2 to enlist in the same tx as in this method call.<NEW_LINE>ejb2.getBooleanValue();<NEW_LINE>ejb2.remove();<NEW_LINE>printMsg(BeanName, " in beanRemoveInTransaction: ejb2.remove complete successfully; NOT GOOD.");<NEW_LINE>}<NEW_LINE>} catch (RemoveException re) {<NEW_LINE>// See ejb 2.0 spec 7.6 pg 79<NEW_LINE>throw re;<NEW_LINE>} catch (EJBException ejbe) {<NEW_LINE>throw ejbe;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new EJBException(" Caught unexpected " + t.getClass().getName());<NEW_LINE>}<NEW_LINE>}
getClass().getName());
77,721
final DescribeGeofenceCollectionResult executeDescribeGeofenceCollection(DescribeGeofenceCollectionRequest describeGeofenceCollectionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeGeofenceCollectionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeGeofenceCollectionRequest> request = null;<NEW_LINE>Response<DescribeGeofenceCollectionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeGeofenceCollectionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeGeofenceCollectionRequest));<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, "Location");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeGeofenceCollection");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "geofencing.";<NEW_LINE>String resolvedHostPrefix = String.format("geofencing.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeGeofenceCollectionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeGeofenceCollectionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
responseHandler, executionContext, null, endpointTraitHost);
914,059
public void writeExcel() throws IOException {<NEW_LINE>Workbook workbook = new XSSFWorkbook();<NEW_LINE>try {<NEW_LINE>Sheet sheet = workbook.createSheet("Persons");<NEW_LINE>sheet.setColumnWidth(0, 6000);<NEW_LINE>sheet.setColumnWidth(1, 4000);<NEW_LINE>Row header = sheet.createRow(0);<NEW_LINE>CellStyle headerStyle = workbook.createCellStyle();<NEW_LINE>headerStyle.setFillForegroundColor(IndexedColors.LIGHT_BLUE.getIndex());<NEW_LINE>headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);<NEW_LINE>XSSFFont font = ((XSSFWorkbook) workbook).createFont();<NEW_LINE>font.setFontName("Arial");<NEW_LINE>font.setFontHeightInPoints((short) 16);<NEW_LINE>font.setBold(true);<NEW_LINE>headerStyle.setFont(font);<NEW_LINE>Cell headerCell = header.createCell(0);<NEW_LINE>headerCell.setCellValue("Name");<NEW_LINE>headerCell.setCellStyle(headerStyle);<NEW_LINE>headerCell = header.createCell(1);<NEW_LINE>headerCell.setCellValue("Age");<NEW_LINE>headerCell.setCellStyle(headerStyle);<NEW_LINE>CellStyle style = workbook.createCellStyle();<NEW_LINE>style.setWrapText(true);<NEW_LINE>Row row = sheet.createRow(2);<NEW_LINE>Cell cell = row.createCell(0);<NEW_LINE>cell.setCellValue("John Smith");<NEW_LINE>cell.setCellStyle(style);<NEW_LINE><MASK><NEW_LINE>cell.setCellValue(20);<NEW_LINE>cell.setCellStyle(style);<NEW_LINE>File currDir = new File(".");<NEW_LINE>String path = currDir.getAbsolutePath();<NEW_LINE>String fileLocation = path.substring(0, path.length() - 1) + "temp.xlsx";<NEW_LINE>FileOutputStream outputStream = new FileOutputStream(fileLocation);<NEW_LINE>workbook.write(outputStream);<NEW_LINE>} finally {<NEW_LINE>if (workbook != null) {<NEW_LINE>workbook.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
cell = row.createCell(1);
210,472
BlazeWorkspace build(BlazeRuntime runtime, PackageFactory packageFactory, SubscriberExceptionHandler eventBusExceptionHandler) throws AbruptExitException {<NEW_LINE>// Set default values if none are set.<NEW_LINE>if (skyframeExecutorFactory == null) {<NEW_LINE>skyframeExecutorFactory = new SequencedSkyframeExecutorFactory();<NEW_LINE>}<NEW_LINE>if (perCommandSyscallCache == null) {<NEW_LINE>perCommandSyscallCache = createPerBuildSyscallCache();<NEW_LINE>}<NEW_LINE>SkyframeExecutor skyframeExecutor = skyframeExecutorFactory.create(packageFactory, runtime.getFileSystem(), directories, runtime.getActionKeyContext(), workspaceStatusActionFactory, diffAwarenessFactories.build(), skyFunctions.buildOrThrow(), perCommandSyscallCache, skyframeExecutorRepositoryHelpersHolder, skyKeyStateReceiver == null ? SkyframeExecutor.SkyKeyStateReceiver.NULL_INSTANCE : <MASK><NEW_LINE>return new BlazeWorkspace(runtime, directories, skyframeExecutor, eventBusExceptionHandler, workspaceStatusActionFactory, binTools, allocationTracker, perCommandSyscallCache);<NEW_LINE>}
skyKeyStateReceiver, runtime.getBugReporter());
1,676,272
final DeleteApplicationOutputResult executeDeleteApplicationOutput(DeleteApplicationOutputRequest deleteApplicationOutputRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteApplicationOutputRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteApplicationOutputRequest> request = null;<NEW_LINE>Response<DeleteApplicationOutputResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteApplicationOutputRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteApplicationOutputRequest));<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, "Kinesis Analytics V2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteApplicationOutput");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteApplicationOutputResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteApplicationOutputResultJsonUnmarshaller());<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);
494,112
public void paintInstance(InstancePainter painter) {<NEW_LINE>final <MASK><NEW_LINE>final var facing = painter.getAttributeValue(StdAttr.FACING);<NEW_LINE>painter.drawBounds();<NEW_LINE>final var bds = painter.getBounds();<NEW_LINE>g.setColor(Color.GRAY);<NEW_LINE>int x0;<NEW_LINE>int y0;<NEW_LINE>int halign;<NEW_LINE>if (facing == Direction.WEST) {<NEW_LINE>x0 = bds.getX() + bds.getWidth() - 3;<NEW_LINE>y0 = bds.getY() + 15;<NEW_LINE>halign = GraphicsUtil.H_RIGHT;<NEW_LINE>} else if (facing == Direction.NORTH) {<NEW_LINE>x0 = bds.getX() + 10;<NEW_LINE>y0 = bds.getY() + bds.getHeight() - 2;<NEW_LINE>halign = GraphicsUtil.H_CENTER;<NEW_LINE>} else if (facing == Direction.SOUTH) {<NEW_LINE>x0 = bds.getX() + 10;<NEW_LINE>y0 = bds.getY() + 12;<NEW_LINE>halign = GraphicsUtil.H_CENTER;<NEW_LINE>} else {<NEW_LINE>x0 = bds.getX() + 3;<NEW_LINE>y0 = bds.getY() + 15;<NEW_LINE>halign = GraphicsUtil.H_LEFT;<NEW_LINE>}<NEW_LINE>GraphicsUtil.drawText(g, "0", x0, y0, halign, GraphicsUtil.V_BASELINE);<NEW_LINE>g.setColor(Color.BLACK);<NEW_LINE>GraphicsUtil.drawCenteredText(g, "Pri", bds.getX() + bds.getWidth() / 2, bds.getY() + bds.getHeight() / 2);<NEW_LINE>painter.drawPorts();<NEW_LINE>}
var g = painter.getGraphics();
649,535
private SWTSkinObject createImageLabel2(SWTSkinProperties properties, final String sConfigID, SWTSkinObject parentSkinObject) {<NEW_LINE>Composite createOn;<NEW_LINE>if (parentSkinObject == null) {<NEW_LINE>createOn = skinComposite;<NEW_LINE>} else {<NEW_LINE>createOn = (Composite) parentSkinObject.getControl();<NEW_LINE>}<NEW_LINE>final Canvas drawable = new <MASK><NEW_LINE>drawable.setVisible(false);<NEW_LINE>final ImageLoader imageLoader = getImageLoader(properties);<NEW_LINE>Image image = imageLoader.getImage(sConfigID);<NEW_LINE>if (ImageLoader.isRealImage(image)) {<NEW_LINE>imageLoader.releaseImage(sConfigID);<NEW_LINE>image = imageLoader.getImage(sConfigID + ".image");<NEW_LINE>drawable.addDisposeListener(new DisposeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetDisposed(DisposeEvent e) {<NEW_LINE>imageLoader.releaseImage(sConfigID + ".image");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>drawable.addDisposeListener(new DisposeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetDisposed(DisposeEvent e) {<NEW_LINE>imageLoader.releaseImage(sConfigID);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>drawable.setData("image", image);<NEW_LINE>SWTSkinObjectBasic skinObject = new SWTSkinObjectBasic(this, properties, drawable, sConfigID, sConfigID, "image", parentSkinObject);<NEW_LINE>addToControlMap(skinObject);<NEW_LINE>ontopImages.add(skinObject);<NEW_LINE>return skinObject;<NEW_LINE>}
Canvas(createOn, SWT.NO_BACKGROUND);
1,651,498
public void serialize(SerializationContext context, NestedSet<?> obj, CodedOutputStream codedOut) throws SerializationException, IOException {<NEW_LINE>context.serialize(obj.getOrder(), codedOut);<NEW_LINE>if (obj.isEmpty()) {<NEW_LINE>// If the NestedSet is empty, it needs to be assigned to the EMPTY_CHILDREN constant on<NEW_LINE>// deserialization.<NEW_LINE>codedOut.writeEnumNoTag(NestedSetSize.EMPTY.ordinal());<NEW_LINE>} else if (obj.isSingleton()) {<NEW_LINE>// If the NestedSet is a singleton, we serialize directly as an optimization.<NEW_LINE>codedOut.writeEnumNoTag(<MASK><NEW_LINE>context.serialize(obj.getChildren(), codedOut);<NEW_LINE>} else {<NEW_LINE>codedOut.writeEnumNoTag(NestedSetSize.NONLEAF.ordinal());<NEW_LINE>codedOut.writeInt32NoTag(obj.getApproxDepth());<NEW_LINE>FingerprintComputationResult fingerprintComputationResult = nestedSetStore.computeFingerprintAndStore((Object[]) obj.getChildren(), context);<NEW_LINE>context.addFutureToBlockWritingOn(fingerprintComputationResult.writeStatus());<NEW_LINE>codedOut.writeByteArrayNoTag(fingerprintComputationResult.fingerprint().toByteArray());<NEW_LINE>}<NEW_LINE>interner.put(new EqualsWrapper(obj), obj);<NEW_LINE>}
NestedSetSize.LEAF.ordinal());
1,017,143
protected void genWriteAttr(Property a, String varName) throws IOException {<NEW_LINE>boolean isScalar = a.isScalar();<NEW_LINE>String dtdName = a.dtdName;<NEW_LINE>String namespace = a.getNamespace();<NEW_LINE>comment(dtdName + " is an attribute with namespace " + namespace);<NEW_LINE>if (!isScalar) {<NEW_LINE>gen("if (" + varName + " != null) ");<NEW_LINE>begin();<NEW_LINE>}<NEW_LINE>if (namespace != null && !namespace.equals(getDefaultNamespace()) && !namespace.equals("http://www.w3.org/XML/1998/namespace")) {<NEW_LINE><MASK><NEW_LINE>outWrite(" ");<NEW_LINE>jw.writeEol("out.write((String)namespaceMap.get(", JavaUtil.instanceFrom("String", namespace), "))");<NEW_LINE>jw.writeEol("out.write(\":", dtdName, "='\")");<NEW_LINE>} else {<NEW_LINE>jw.writeEol("out.write(\" ", dtdName, "='\")");<NEW_LINE>}<NEW_LINE>genWriteType(a, varName, true);<NEW_LINE>gen("out.write(\"'\")");<NEW_LINE>eolNoI18N();<NEW_LINE>if (!isScalar) {<NEW_LINE>end();<NEW_LINE>}<NEW_LINE>}
dtdName = SchemaRep.removePrefix(dtdName);
838,883
public static void vertical7(Kernel1D_S32 kernel, GrayS16 src, GrayI16 dst) {<NEW_LINE>final short[] dataSrc = src.data;<NEW_LINE>final short[] dataDst = dst.data;<NEW_LINE>final int k1 = kernel.data[0];<NEW_LINE>final int k2 = kernel.data[1];<NEW_LINE>final int k3 = kernel.data[2];<NEW_LINE>final int k4 = kernel.data[3];<NEW_LINE>final int k5 = kernel.data[4];<NEW_LINE>final int k6 = kernel.data[5];<NEW_LINE>final int k7 = kernel.data[6];<NEW_LINE>final int radius = kernel.getRadius();<NEW_LINE>final int imgWidth = dst.getWidth();<NEW_LINE>final int imgHeight = dst.getHeight();<NEW_LINE>final int yEnd = imgHeight - radius;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(radius, yEnd, y -> {<NEW_LINE>for (int y = radius; y < yEnd; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>int i = src.startIndex + (y - radius) * src.stride;<NEW_LINE>final int iEnd = i + imgWidth;<NEW_LINE>for (; i < iEnd; i++) {<NEW_LINE>int indexSrc = i;<NEW_LINE>int total = (dataSrc[indexSrc]) * k1;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k2;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k3;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k4;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k5;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += (dataSrc[indexSrc]) * k6;<NEW_LINE>indexSrc += src.stride;<NEW_LINE>total += <MASK><NEW_LINE>dataDst[indexDst++] = (short) total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
(dataSrc[indexSrc]) * k7;
84,984
static String printTemplate(Template template) {<NEW_LINE>int[] columnWidths = new int[] { TABLE_WIDTH };<NEW_LINE>List<String> templateProperty = new ArrayList<String>();<NEW_LINE>templateProperty.add(template.getUID());<NEW_LINE>String titleRow = Utils.getRow(columnWidths, templateProperty);<NEW_LINE>List<String> templateContent <MASK><NEW_LINE>columnWidths = new int[] { COLUMN_PROPERTY, COLUMN_PROPERTY_VALUE };<NEW_LINE>templateProperty.set(0, UID);<NEW_LINE>templateProperty.add(template.getUID());<NEW_LINE>templateContent.add(Utils.getRow(columnWidths, templateProperty));<NEW_LINE>if (template.getLabel() != null) {<NEW_LINE>templateProperty.set(0, LABEL);<NEW_LINE>templateProperty.set(1, template.getLabel());<NEW_LINE>templateContent.add(Utils.getRow(columnWidths, templateProperty));<NEW_LINE>}<NEW_LINE>if (template.getDescription() != null) {<NEW_LINE>templateProperty.set(0, DESCRIPTION);<NEW_LINE>templateProperty.set(1, template.getDescription());<NEW_LINE>templateContent.add(Utils.getRow(columnWidths, templateProperty));<NEW_LINE>}<NEW_LINE>templateProperty.set(0, VISIBILITY);<NEW_LINE>templateProperty.set(1, template.getVisibility().toString());<NEW_LINE>templateContent.add(Utils.getRow(columnWidths, templateProperty));<NEW_LINE>templateProperty.set(0, TAGS);<NEW_LINE>templateProperty.set(1, getTagsRecord(template.getTags()));<NEW_LINE>templateContent.add(Utils.getRow(columnWidths, templateProperty));<NEW_LINE>if (template instanceof RuleTemplate) {<NEW_LINE>templateContent.addAll(collectRecords(columnWidths, CONFIGURATION_DESCRIPTIONS, getConfigurationDescriptionRecords(((RuleTemplate) template).getConfigurationDescriptions())));<NEW_LINE>templateContent.addAll(collectRecords(columnWidths, TRIGGERS, ((RuleTemplate) template).getTriggers()));<NEW_LINE>templateContent.addAll(collectRecords(columnWidths, CONDITIONS, ((RuleTemplate) template).getConditions()));<NEW_LINE>templateContent.addAll(collectRecords(columnWidths, ACTIONS, ((RuleTemplate) template).getActions()));<NEW_LINE>}<NEW_LINE>return Utils.getTableContent(TABLE_WIDTH, columnWidths, templateContent, titleRow);<NEW_LINE>}
= new ArrayList<String>();
397,648
public FlowTemplateFilter unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>FlowTemplateFilter flowTemplateFilter = new FlowTemplateFilter();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>flowTemplateFilter.setName(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("value", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>flowTemplateFilter.setValue(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return flowTemplateFilter;<NEW_LINE>}
class).unmarshall(context));
1,845,410
private void loadNode449() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Open_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Open_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Open_InputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Open_InputArguments, Identifiers.HasProperty, Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_Open.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>Mode</Name><DataType><Identifier>i=3</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
812,383
private List<Wo> list(Business business, Wi wi) throws Exception {<NEW_LINE>List<Wo> wos = new ArrayList<>();<NEW_LINE>if (StringUtils.isEmpty(wi.getKey())) {<NEW_LINE>return wos;<NEW_LINE>}<NEW_LINE>List<String> groupIds = business.expendGroupRoleToGroup(wi.getGroupList(), wi.getRoleList());<NEW_LINE>String str = StringUtils.lowerCase(StringTools.escapeSqlLikeKey(wi.getKey()));<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Group.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Group> root = cq.from(Group.class);<NEW_LINE>Predicate p = cb.like(cb.lower(root.get(Group_.name)), "%" + <MASK><NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Group_.unique)), "%" + str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Group_.pinyin)), str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Group_.pinyinInitial)), str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>p = cb.or(p, cb.like(cb.lower(root.get(Group_.distinguishedName)), str + "%", StringTools.SQL_ESCAPE_CHAR));<NEW_LINE>if (ListTools.isNotEmpty(groupIds)) {<NEW_LINE>p = cb.and(p, root.get(Group_.id).in(groupIds));<NEW_LINE>}<NEW_LINE>List<String> ids = em.createQuery(cq.select(root.get(Group_.id)).where(p)).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>List<Group> os = business.entityManagerContainer().list(Group.class, ids);<NEW_LINE>wos = Wo.copier.copy(os);<NEW_LINE>wos = business.group().sort(wos);<NEW_LINE>return wos;<NEW_LINE>}
str + "%", StringTools.SQL_ESCAPE_CHAR);
964,965
public static void horizontal(GrayF64 src, GrayF64 dst) {<NEW_LINE>if (src.width < dst.width)<NEW_LINE>throw new IllegalArgumentException("src width must be >= dst width");<NEW_LINE>if (src.height != dst.height)<NEW_LINE>throw new IllegalArgumentException("src height must equal dst height");<NEW_LINE>float scale = src.width / (float) dst.width;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, dst.height, y -> {<NEW_LINE>for (int y = 0; y < dst.height; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>for (int x = 0; x < dst.width - 1; x++, indexDst++) {<NEW_LINE>float srcX0 = x * scale;<NEW_LINE>float srcX1 = (x + 1) * scale;<NEW_LINE>int isrcX0 = (int) srcX0;<NEW_LINE>int isrcX1 = (int) srcX1;<NEW_LINE>int index = src.getIndex(isrcX0, y);<NEW_LINE>// compute value of overlapped region<NEW_LINE>float startWeight = (1.0f - (srcX0 - isrcX0));<NEW_LINE>double start <MASK><NEW_LINE>double middle = 0;<NEW_LINE>for (int i = isrcX0 + 1; i < isrcX1; i++) {<NEW_LINE>middle += src.data[index++];<NEW_LINE>}<NEW_LINE>float endWeight = (srcX1 % 1);<NEW_LINE>double end = src.data[index];<NEW_LINE>dst.data[indexDst] = (start * startWeight + middle + end * endWeight) / scale;<NEW_LINE>}<NEW_LINE>// handle the last area as a special case<NEW_LINE>int x = dst.width - 1;<NEW_LINE>float srcX0 = x * scale;<NEW_LINE>int isrcX0 = (int) srcX0;<NEW_LINE>int isrcX1 = src.width - 1;<NEW_LINE>int index = src.getIndex(isrcX0, y);<NEW_LINE>// compute value of overlapped region<NEW_LINE>float startWeight = (1.0f - (srcX0 - isrcX0));<NEW_LINE>double start = src.data[index++];<NEW_LINE>double middle = 0;<NEW_LINE>for (int i = isrcX0 + 1; i < isrcX1; i++) {<NEW_LINE>middle += src.data[index++];<NEW_LINE>}<NEW_LINE>double end = isrcX1 != isrcX0 ? src.data[index] : 0;<NEW_LINE>dst.data[indexDst] = (start * startWeight + middle + end) / scale;<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
= src.data[index++];
601,446
final ListMailboxPermissionsResult executeListMailboxPermissions(ListMailboxPermissionsRequest listMailboxPermissionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listMailboxPermissionsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListMailboxPermissionsRequest> request = null;<NEW_LINE>Response<ListMailboxPermissionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListMailboxPermissionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listMailboxPermissionsRequest));<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, "WorkMail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListMailboxPermissions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListMailboxPermissionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListMailboxPermissionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,280,625
public static Map<String, Long> queryDbGroupDataSize(String schema, List<GroupDetailInfoExRecord> groupRecords) {<NEW_LINE>Map<String, Long> groupDataSizeMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);<NEW_LINE>groupRecords.stream().collect(Collectors.groupingBy(x -> x.storageInstId)).forEach((storageInstId, groups) -> {<NEW_LINE>Map<String, String> phyDbToGroup = groups.stream().map(x -> Pair.of(x.getPhyDbName().toLowerCase(), x.groupName)).collect(Collectors.toMap(Pair::getKey, Pair::getValue));<NEW_LINE>List<String> phyDbList = groups.stream().map(x -> x.getPhyDbName()).collect(Collectors.toList());<NEW_LINE>String anchorPhyDb = phyDbList.get(0);<NEW_LINE>String sql = genDbGroupSQL(phyDbList);<NEW_LINE>// PhyDbName, DataSizeKB<NEW_LINE>List<List<Object>> rows = queryGroupByPhyDb(schema, anchorPhyDb, sql);<NEW_LINE>for (List<Object> row : rows) {<NEW_LINE>String phyDbName = (String) row.get(0);<NEW_LINE>long dataSizeKB = ((BigDecimal) row.get(1)).longValue();<NEW_LINE>String groupName = phyDbToGroup.get(phyDbName);<NEW_LINE>groupDataSizeMap.merge(groupName, <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>return groupDataSizeMap;<NEW_LINE>}
dataSizeKB * 1024, Long::sum);
238,431
private void checkIfIsoAttachable(String isoUuid) {<NEW_LINE>String psUuid = getSelfInventory().getRootVolume().getPrimaryStorageUuid();<NEW_LINE>String sql = "select count(i)" + " from ImageCacheVO i" + " where i.primaryStorageUuid = :psUuid" + " and i.imageUuid = :isoUuid";<NEW_LINE>TypedQuery<Long> q = dbf.getEntityManager().createQuery(sql, Long.class);<NEW_LINE>q.setParameter("psUuid", psUuid);<NEW_LINE>q.setParameter("isoUuid", isoUuid);<NEW_LINE><MASK><NEW_LINE>if (count > 0) {<NEW_LINE>// on the same primary storage<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PrimaryStorageVO psvo = dbf.getEntityManager().find(PrimaryStorageVO.class, psUuid);<NEW_LINE>PrimaryStorageType type = PrimaryStorageType.valueOf(psvo.getType());<NEW_LINE>List<String> bsUuids = type.findBackupStorage(psUuid);<NEW_LINE>if (!bsUuids.isEmpty()) {<NEW_LINE>sql = "select count(bs)" + " from BackupStorageVO bs, ImageBackupStorageRefVO ref" + " where bs.uuid = ref.backupStorageUuid" + " and ref.imageUuid = :imgUuid" + " and bs.uuid in (:bsUuids)";<NEW_LINE>q = dbf.getEntityManager().createQuery(sql, Long.class);<NEW_LINE>q.setParameter("imgUuid", isoUuid);<NEW_LINE>q.setParameter("bsUuids", bsUuids);<NEW_LINE>count = q.getSingleResult();<NEW_LINE>if (count > 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new OperationFailureException(operr("the ISO[uuid:%s] is on backup storage that is not compatible of the primary storage[uuid:%s]" + " where the VM[name:%s, uuid:%s] is on", isoUuid, psUuid, self.getName(), self.getUuid()));<NEW_LINE>}
Long count = q.getSingleResult();
301,015
private List<Step> toSteps(Scenario scenario, List<KarateParser.StepContext> list) {<NEW_LINE>List<Step> steps = new ArrayList(list.size());<NEW_LINE>int index = 0;<NEW_LINE>for (KarateParser.StepContext sc : list) {<NEW_LINE>Step step = scenario == null ? new Step(feature, index++) : new Step(scenario, index++);<NEW_LINE>step.setComments(collectComments(sc));<NEW_LINE>steps.add(step);<NEW_LINE>int stepLine = sc.line().getStart().getLine();<NEW_LINE>step.setLine(stepLine);<NEW_LINE>step.setPrefix(sc.prefix().getText().trim());<NEW_LINE>step.setText(sc.line().getText().trim());<NEW_LINE>if (sc.docString() != null) {<NEW_LINE>String raw = sc.docString().getText();<NEW_LINE>step.setDocString(fixDocString(raw));<NEW_LINE>step.setEndLine(stepLine + StringUtils.countLineFeeds(raw));<NEW_LINE>} else if (sc.table() != null) {<NEW_LINE>Table table = <MASK><NEW_LINE>step.setTable(table);<NEW_LINE>step.setEndLine(stepLine + StringUtils.countLineFeeds(sc.table().getText()));<NEW_LINE>} else {<NEW_LINE>step.setEndLine(stepLine);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return steps;<NEW_LINE>}
toTable(sc.table());
1,047,078
public void marshall(SendEmailRequest sendEmailRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (sendEmailRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(sendEmailRequest.getFromEmailAddress(), FROMEMAILADDRESS_BINDING);<NEW_LINE>protocolMarshaller.marshall(sendEmailRequest.getDestination(), DESTINATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(sendEmailRequest.getReplyToAddresses(), REPLYTOADDRESSES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(sendEmailRequest.getContent(), CONTENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(sendEmailRequest.getEmailTags(), EMAILTAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(sendEmailRequest.getConfigurationSetName(), CONFIGURATIONSETNAME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
sendEmailRequest.getFeedbackForwardingEmailAddress(), FEEDBACKFORWARDINGEMAILADDRESS_BINDING);
1,188,803
public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject sourceObject = source.getSourceObject(game);<NEW_LINE>if (player == null || sourceObject == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Card card = player.getLibrary().getFromTop(game);<NEW_LINE>if (card == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// exile and look<NEW_LINE>UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter());<NEW_LINE>if (player.moveCardsToExile(card, source, game, false, exileZoneId, sourceObject.getIdName() + " (" + player.getName() + ")")) {<NEW_LINE>card.turnFaceDown(source, game, source.getControllerId());<NEW_LINE>player.lookAtCards(player.getName() + " - " + card.getIdName() + " - " + CardUtil.sdf.format(System.currentTimeMillis()), card, game);<NEW_LINE>}<NEW_LINE>// create token<NEW_LINE>Set<MageObjectReference> tokenObjs = new HashSet<>();<NEW_LINE>CreateTokenEffect effect = new CreateTokenEffect(new UginTheIneffableToken());<NEW_LINE>effect.apply(game, source);<NEW_LINE>// with return ability<NEW_LINE>for (UUID addedTokenId : effect.getLastAddedTokenIds()) {<NEW_LINE>// display referenced exiled face-down card on token<NEW_LINE>SimpleStaticAbility sa = new SimpleStaticAbility(Zone.BATTLEFIELD, new InfoEffect("Referenced object: " + card.getId().toString().substring(0, 3)));<NEW_LINE>GainAbilityTargetEffect gainAbilityEffect = new <MASK><NEW_LINE>gainAbilityEffect.setTargetPointer(new FixedTarget(addedTokenId));<NEW_LINE>game.addEffect(gainAbilityEffect, source);<NEW_LINE>// look at face-down card in exile<NEW_LINE>UginTheIneffableLookAtFaceDownEffect lookAtEffect = new UginTheIneffableLookAtFaceDownEffect();<NEW_LINE>lookAtEffect.setTargetPointer(new FixedTarget(card.getId(), game));<NEW_LINE>game.addEffect(lookAtEffect, source);<NEW_LINE>tokenObjs.add(new MageObjectReference(addedTokenId, game));<NEW_LINE>game.addDelayedTriggeredAbility(new UginTheIneffableDelayedTriggeredAbility(tokenObjs, new MageObjectReference(card, game)), source);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
GainAbilityTargetEffect(sa, Duration.WhileOnBattlefield);
511,506
private TIFFDirectory readLinkedIFDs(final ImageInputStream input) throws IOException {<NEW_LINE>long ifdOffset = readOffset(input);<NEW_LINE>List<IFD> <MASK><NEW_LINE>// Read linked IFDs<NEW_LINE>while (ifdOffset != 0) {<NEW_LINE>try {<NEW_LINE>if ((inputLength > 0 && ifdOffset >= inputLength) || !isValidOffset(input, ifdOffset) || !parsedIFDs.add(ifdOffset)) {<NEW_LINE>// TODO: Issue warning<NEW_LINE>if (DEBUG) {<NEW_LINE>System.err.println("Bad IFD offset: " + ifdOffset);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>ifds.add(readIFD(input, ifdOffset, VALID_TOP_LEVEL_IFDS));<NEW_LINE>ifdOffset = readOffset(input);<NEW_LINE>} catch (EOFException eof) {<NEW_LINE>// catch EOF here as missing EOF marker<NEW_LINE>ifdOffset = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new TIFFDirectory(ifds);<NEW_LINE>}
ifds = new ArrayList<>();
1,452,275
public static void main(String[] args) throws Exception {<NEW_LINE>String BASE_DIR = System.getProperty("user.dir");<NEW_LINE>String inputfilepath = BASE_DIR + "/sample-docs/sample-docx.docx";<NEW_LINE>boolean saveImages = true;<NEW_LINE>boolean saveResultingDoc = true;<NEW_LINE>String outputfilepath = BASE_DIR + "/OUT_ConvertEmbeddedImageToLinked.docx";<NEW_LINE>// Open a document from the file system<NEW_LINE>// Load the Package<NEW_LINE>WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new java.io.File(inputfilepath));<NEW_LINE>// Change the rels to TargetMode="External"<NEW_LINE>// Fetch rels part<NEW_LINE>MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();<NEW_LINE>RelationshipsPart relsPart = documentPart.getRelationshipsPart();<NEW_LINE>Relationships rels = relsPart.getRelationships();<NEW_LINE>List<Relationship> relsList = rels.getRelationship();<NEW_LINE>// For each image rel<NEW_LINE>for (Relationship r : relsList) {<NEW_LINE>System.out.println(r.getTargetMode());<NEW_LINE>if (r.getType().equals(Namespaces.IMAGE) && (r.getTargetMode() == null || r.getTargetMode().equalsIgnoreCase("internal"))) {<NEW_LINE>String target = r.getTarget();<NEW_LINE>System.out.println("target: " + target);<NEW_LINE>if (saveImages) {<NEW_LINE>// Save the image as a file in the specified location<NEW_LINE>File f = new File(BASE_DIR + "/" + target);<NEW_LINE>if (f.exists()) {<NEW_LINE>System.out.println("Overwriting existing object: " + f.getPath());<NEW_LINE>} else if (!f.getParentFile().exists()) {<NEW_LINE>System.out.println("creating " + f.getParentFile().getAbsolutePath());<NEW_LINE>f.getParentFile().mkdirs();<NEW_LINE>// f = new File(BASE_DIR + "/" + target);<NEW_LINE>}<NEW_LINE>Part p = relsPart.getPart(r);<NEW_LINE>FileOutputStream fos = new FileOutputStream(f);<NEW_LINE>((BinaryPart) p).writeDataToOutputStream(fos);<NEW_LINE>fos.close();<NEW_LINE>}<NEW_LINE>// .. externalise - after getPart!<NEW_LINE>r.setTargetMode("External");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Change r:embed to r:link<NEW_LINE>org.docx4j.wml.Document wmlDocumentEl = (org.docx4j.wml<MASK><NEW_LINE>Body body = wmlDocumentEl.getBody();<NEW_LINE>SingleTraversalUtilVisitorCallback imageVisitor = new SingleTraversalUtilVisitorCallback(new TraversalUtilBlipVisitor());<NEW_LINE>imageVisitor.walkJAXBElements(body);<NEW_LINE>// Save it<NEW_LINE>if (saveResultingDoc) {<NEW_LINE>SaveToZipFile saver = new SaveToZipFile(wordMLPackage);<NEW_LINE>saver.save(outputfilepath);<NEW_LINE>}<NEW_LINE>}
.Document) documentPart.getJaxbElement();
1,410,400
private void updatePanel() {<NEW_LINE><MASK><NEW_LINE>// set the number of files and the number of functions<NEW_LINE>numFunctionsField.setText(Integer.toString(patternReader.getNumFuncs()));<NEW_LINE>numFilesField.setText(Integer.toString(patternReader.getNumFiles()));<NEW_LINE>// set the gathering info fields<NEW_LINE>DataGatheringParams params = patternReader.getDataGatheringParams();<NEW_LINE>firstInstructionsField.setText(Integer.toString(params.getNumFirstInstructions()));<NEW_LINE>preInstructionsField.setText(Integer.toString(params.getNumPreInstructions()));<NEW_LINE>returnInstructionsField.setText(Integer.toString(params.getNumReturnInstructions()));<NEW_LINE>firstBytesField.setText(Integer.toString(params.getNumFirstBytes()));<NEW_LINE>preBytesField.setText(Integer.toString(params.getNumPreBytes()));<NEW_LINE>returnBytesField.setText(Integer.toString(params.getNumReturnBytes()));<NEW_LINE>// update context register info<NEW_LINE>tabbedPane.removeTabAt(CONTEXT_REGISTER_PANEL_INDEX);<NEW_LINE>contextRegisterPanel = new ContextRegisterPanelBuilder(patternReader.getContextRegisterExtent().toString());<NEW_LINE>tabbedPane.insertTab(CONTEXT_REGISTER_TITLE, null, contextRegisterPanel.buildContextRegisterPanel(), null, CONTEXT_REGISTER_PANEL_INDEX);<NEW_LINE>// update the tree of first instructions<NEW_LINE>firstInstPanel.setFsReaderAndUpdateExtent(patternReader);<NEW_LINE>// update the tree of pre instructions<NEW_LINE>preInstPanel.setFsReaderAndUpdateExtent(patternReader);<NEW_LINE>// update the tree of return instructions<NEW_LINE>returnInstPanel.setFsReaderAndUpdateExtent(patternReader);<NEW_LINE>// enable the analyze sequence buttons<NEW_LINE>// these should only be null if no xml has been loaded (i.e. on startup, or if the user selected<NEW_LINE>// a directory with no xml files)<NEW_LINE>if (!firstInstPanel.isTreeEmpty()) {<NEW_LINE>firstInstPanel.enablePercentageFilterButtons(true);<NEW_LINE>}<NEW_LINE>if (!preInstPanel.isTreeEmpty()) {<NEW_LINE>preInstPanel.enablePercentageFilterButtons(true);<NEW_LINE>}<NEW_LINE>// update the first bytes panel<NEW_LINE>firstBytesPanel.setFsReader(patternReader);<NEW_LINE>firstBytesPanel.enableLengthFilterButtons(true);<NEW_LINE>// update the pre bytes panel<NEW_LINE>preBytesPanel.setFsReader(patternReader);<NEW_LINE>preBytesPanel.enableLengthFilterButtons(true);<NEW_LINE>// update the return bytes panel<NEW_LINE>returnBytesPanel.setFsReader(patternReader);<NEW_LINE>returnBytesPanel.enableLengthFilterButtons(true);<NEW_LINE>// update the alignment information<NEW_LINE>alignmentPanel.resetModulus();<NEW_LINE>alignmentPanel.updateExtentAndClearFilter(patternReader.getContextRegisterExtent());<NEW_LINE>alignmentPanel.setFsReader(patternReader);<NEW_LINE>alignmentPanel.updateAlignmentPanel();<NEW_LINE>// enable or disable the context register filter buttons<NEW_LINE>boolean shouldBeOn = (!patternReader.getContextRegisterExtent().getContextRegisters().isEmpty());<NEW_LINE>firstInstPanel.enableFilterButtons(shouldBeOn);<NEW_LINE>preInstPanel.enableFilterButtons(shouldBeOn);<NEW_LINE>alignmentPanel.enableFilterButtons(shouldBeOn);<NEW_LINE>firstBytesPanel.enableFilterButtons(shouldBeOn);<NEW_LINE>preBytesPanel.enableFilterButtons(shouldBeOn);<NEW_LINE>returnInstPanel.enableFilterButtons(shouldBeOn);<NEW_LINE>returnBytesPanel.enableFilterButtons(shouldBeOn);<NEW_LINE>// restore the selected tab<NEW_LINE>tabbedPane.setSelectedIndex(selectedTab);<NEW_LINE>// clear any patterns in the clipboard<NEW_LINE>plugin.clearPatterns();<NEW_LINE>clipboard.updateClipboard();<NEW_LINE>return;<NEW_LINE>}
int selectedTab = tabbedPane.getSelectedIndex();
1,215,623
public void addSendMetric(DispatchProfile currentRecord, String proxyClusterId) {<NEW_LINE>Map<String, String> dimensions = new HashMap<>();<NEW_LINE>dimensions.put(SdkMetricItem.KEY_NODE_ID, this.nodeId);<NEW_LINE>dimensions.put(SdkMetricItem.KEY_NODE_IP, this.nodeIp);<NEW_LINE>// metric<NEW_LINE>fillInlongId(currentRecord, dimensions);<NEW_LINE>dimensions.put(SdkMetricItem.KEY_SINK_ID, proxyClusterId);<NEW_LINE>long msgTime = currentRecord.getDispatchTime();<NEW_LINE><MASK><NEW_LINE>dimensions.put(SdkMetricItem.KEY_MESSAGE_TIME, String.valueOf(auditFormatTime));<NEW_LINE>SdkMetricItem metricItem = this.getMetricItemSet().findMetricItem(dimensions);<NEW_LINE>long count = currentRecord.getCount();<NEW_LINE>long size = currentRecord.getSize();<NEW_LINE>metricItem.sendCount.addAndGet(count);<NEW_LINE>metricItem.sendSize.addAndGet(size);<NEW_LINE>// LOG.info("addSendMetric,bid:{},count:{},metric:{}",<NEW_LINE>// bid, currentRecord.getCount(), JSON.toJSONString(metricItemSet.getItemMap()));<NEW_LINE>}
long auditFormatTime = msgTime - msgTime % auditFormatInterval;
828,244
private ByteBuffer writeBigPackageToBuffer(byte[] data, ByteBuffer buffer) {<NEW_LINE>int srcPos;<NEW_LINE>byte[] singlePacket;<NEW_LINE>singlePacket = new byte[MySQLPacket.MAX_PACKET_SIZE + MySQLPacket.PACKET_HEADER_SIZE];<NEW_LINE>System.arraycopy(data, 0, singlePacket, 0, MySQLPacket.MAX_PACKET_SIZE + MySQLPacket.PACKET_HEADER_SIZE);<NEW_LINE>srcPos = MySQLPacket.MAX_PACKET_SIZE + MySQLPacket.PACKET_HEADER_SIZE;<NEW_LINE>int length = data.length;<NEW_LINE>length -= (MySQLPacket.MAX_PACKET_SIZE + MySQLPacket.PACKET_HEADER_SIZE);<NEW_LINE>ByteUtil.writeUB3(singlePacket, MySQLPacket.MAX_PACKET_SIZE);<NEW_LINE>byte packetId = data[3];<NEW_LINE>singlePacket[3] = packetId;<NEW_LINE>buffer = writeToBuffer(singlePacket, buffer);<NEW_LINE>while (length >= MySQLPacket.MAX_PACKET_SIZE) {<NEW_LINE>singlePacket = new byte[<MASK><NEW_LINE>ByteUtil.writeUB3(singlePacket, MySQLPacket.MAX_PACKET_SIZE);<NEW_LINE>singlePacket[3] = ++packetId;<NEW_LINE>if (this instanceof ShardingService) {<NEW_LINE>singlePacket[3] = (byte) ((ShardingService) this).nextPacketId();<NEW_LINE>}<NEW_LINE>System.arraycopy(data, srcPos, singlePacket, MySQLPacket.PACKET_HEADER_SIZE, MySQLPacket.MAX_PACKET_SIZE);<NEW_LINE>srcPos += MySQLPacket.MAX_PACKET_SIZE;<NEW_LINE>length -= MySQLPacket.MAX_PACKET_SIZE;<NEW_LINE>buffer = writeToBuffer(singlePacket, buffer);<NEW_LINE>}<NEW_LINE>singlePacket = new byte[length + MySQLPacket.PACKET_HEADER_SIZE];<NEW_LINE>ByteUtil.writeUB3(singlePacket, length);<NEW_LINE>singlePacket[3] = ++packetId;<NEW_LINE>if (this instanceof ShardingService) {<NEW_LINE>singlePacket[3] = (byte) ((ShardingService) this).nextPacketId();<NEW_LINE>}<NEW_LINE>System.arraycopy(data, srcPos, singlePacket, MySQLPacket.PACKET_HEADER_SIZE, length);<NEW_LINE>buffer = writeToBuffer(singlePacket, buffer);<NEW_LINE>return buffer;<NEW_LINE>}
MySQLPacket.MAX_PACKET_SIZE + MySQLPacket.PACKET_HEADER_SIZE];
316,694
public void visitTag(Tag parseTag, IParseDictionary parseDictionary) throws LogParseException {<NEW_LINE>String currentMethod = null;<NEW_LINE>String holder = null;<NEW_LINE>List<Tag> allChildren = parseTag.getChildren();<NEW_LINE>for (Tag child : allChildren) {<NEW_LINE>String tagName = child.getName();<NEW_LINE>Map<String, String> attrs = child.getAttributes();<NEW_LINE>switch(tagName) {<NEW_LINE>case TAG_METHOD:<NEW_LINE>{<NEW_LINE>currentMethod = attrs.get(ATTR_NAME);<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// changes member context<NEW_LINE>case TAG_CALL:<NEW_LINE>{<NEW_LINE>String methodID = attrs.get(ATTR_METHOD);<NEW_LINE>Tag methodTag = parseDictionary.getMethod(methodID);<NEW_LINE>Map<String, String> methodTagAttributes = methodTag.getAttributes();<NEW_LINE>currentMethod = methodTagAttributes.get(ATTR_NAME);<NEW_LINE>holder = methodTagAttributes.get(ATTR_HOLDER);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case TAG_INTRINSIC:<NEW_LINE>{<NEW_LINE>if (holder != null && currentMethod != null) {<NEW_LINE>Tag klassTag = parseDictionary.getKlass(holder);<NEW_LINE>String intrinsic = child.getAttributes().get(ATTR_ID);<NEW_LINE>if (klassTag != null) {<NEW_LINE>String fqName = klassTag.getAttributes().get(ATTR_NAME).replace(C_SLASH, C_DOT) + C_DOT + currentMethod;<NEW_LINE>result.put(fqName, intrinsic);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>holder = null;<NEW_LINE>currentMethod = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case TAG_PHASE:<NEW_LINE>{<NEW_LINE>String phaseName = attrs.get(ATTR_NAME);<NEW_LINE>if (S_PARSE_HIR.equals(phaseName)) {<NEW_LINE>visitTag(child, parseDictionary);<NEW_LINE>} else {<NEW_LINE>logger.warn("Don't know how to handle phase {}", phaseName);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case // nested parse from inlining<NEW_LINE>TAG_PARSE:<NEW_LINE>{<NEW_LINE>visitTag(child, parseDictionary);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>handleOther(child);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
holder = attrs.get(ATTR_HOLDER);
1,449,497
private static void buildComplexCriteria(Map<String, String> dbColToObjectAttribute, ComplexCriteria criteriaToBuildOut, StringBuilder queryToAppendTo, String conditionToAppend, List<Object> params) {<NEW_LINE>List<Criteria<MASK><NEW_LINE>boolean first = true;<NEW_LINE>boolean open = false;<NEW_LINE>for (Criteria criteria : cs) {<NEW_LINE>if (criteria instanceof SimpleCriteria) {<NEW_LINE>if (!first) {<NEW_LINE>queryToAppendTo.append(" " + criteriaToBuildOut.getPreceedingOperator(criteria) + " ");<NEW_LINE>queryToAppendTo.append("(" + (conditionToAppend != null ? conditionToAppend + " AND " : ""));<NEW_LINE>open = true;<NEW_LINE>}<NEW_LINE>String att = dbColToObjectAttribute.get(((SimpleCriteria) criteria).getAttribute()) != null ? dbColToObjectAttribute.get(((SimpleCriteria) criteria).getAttribute()) : ((SimpleCriteria) criteria).getAttribute();<NEW_LINE>queryToAppendTo.append(att + " " + ((SimpleCriteria) criteria).getOperator() + " ?");<NEW_LINE>if (open) {<NEW_LINE>queryToAppendTo.append(")");<NEW_LINE>open = false;<NEW_LINE>}<NEW_LINE>params.add(((SimpleCriteria) criteria).getValue());<NEW_LINE>} else if (criteria instanceof ComplexCriteria) {<NEW_LINE>if (!first) {<NEW_LINE>queryToAppendTo.append(" " + criteriaToBuildOut.getPreceedingOperator(criteria) + " ");<NEW_LINE>}<NEW_LINE>queryToAppendTo.append(" (" + (conditionToAppend != null ? conditionToAppend + " AND " : ""));<NEW_LINE>buildComplexCriteria(dbColToObjectAttribute, (ComplexCriteria) criteria, queryToAppendTo, conditionToAppend, params);<NEW_LINE>queryToAppendTo.append(") ");<NEW_LINE>}<NEW_LINE>first = false;<NEW_LINE>}<NEW_LINE>}
> cs = criteriaToBuildOut.getCriteria();
375,073
File close(long hash) {<NEW_LINE>if (hasher.getValue() != hash) {<NEW_LINE>throw new RuntimeException("xxhash from content (" + currentHash + ") is not equal to xxhash in request (" + hash + ")");<NEW_LINE>}<NEW_LINE>File file = new File(fileReferenceDir, fileName);<NEW_LINE>try {<NEW_LINE>// Unpack if necessary<NEW_LINE>if (fileType == FileReferenceData.Type.compressed) {<NEW_LINE>File decompressedDir = Files.createTempDirectory(tmpDir.toPath(), "archive").toFile();<NEW_LINE>CompressedFileReference.decompress(inprogressFile, decompressedDir);<NEW_LINE>moveFileToDestination(decompressedDir, fileReferenceDir);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>Files.createDirectories(fileReferenceDir.toPath());<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.log(Level.SEVERE, "Failed creating directory (" + fileReferenceDir.toPath() + "): " + e.getMessage(), e);<NEW_LINE>throw new RuntimeException("Failed creating directory (" + fileReferenceDir.toPath() + "): ", e);<NEW_LINE>}<NEW_LINE>log.log(Level.FINE, () -> "Uncompressed file, moving to " + file.getAbsolutePath());<NEW_LINE>moveFileToDestination(inprogressFile, file);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.log(Level.SEVERE, "Failed writing file: " + <MASK><NEW_LINE>throw new RuntimeException("Failed writing file: ", e);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>Files.deleteIfExists(inprogressFile.toPath());<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.log(Level.SEVERE, "Failed deleting " + inprogressFile.getAbsolutePath() + ": " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return file;<NEW_LINE>}
e.getMessage(), e);
1,805,224
public static void main(String[] args) throws Exception {<NEW_LINE>if (args.length != 1) {<NEW_LINE>throw new RuntimeException("Specify topology name");<NEW_LINE>}<NEW_LINE>TopologyBuilder builder = new TopologyBuilder();<NEW_LINE>builder.setSpout("word"<MASK><NEW_LINE>builder.setBolt("count", new CountBolt(), 2).shuffleGrouping("word");<NEW_LINE>Config conf = new Config();<NEW_LINE>conf.setDebug(true);<NEW_LINE>// Put an arbitrary large number here if you don't want to slow the topology down<NEW_LINE>conf.setMaxSpoutPending(1000 * 1000 * 1000);<NEW_LINE>// To enable acking, we need to setEnableAcking true<NEW_LINE>conf.setTopologyReliabilityMode(Config.TopologyReliabilityMode.ATLEAST_ONCE);<NEW_LINE>conf.put(Config.TOPOLOGY_WORKER_CHILDOPTS, "-XX:+HeapDumpOnOutOfMemoryError");<NEW_LINE>// Set the task hook<NEW_LINE>List<String> taskHooks = new LinkedList<>();<NEW_LINE>taskHooks.add("org.apache.heron.examples.TaskHookTopology$TestTaskHook");<NEW_LINE>conf.setAutoTaskHooks(taskHooks);<NEW_LINE>// component resource configuration<NEW_LINE>conf.setComponentRam("word", ByteAmount.fromMegabytes(512));<NEW_LINE>conf.setComponentRam("count", ByteAmount.fromMegabytes(512));<NEW_LINE>// container resource configuration<NEW_LINE>conf.setContainerDiskRequested(ByteAmount.fromGigabytes(2));<NEW_LINE>conf.setContainerRamRequested(ByteAmount.fromGigabytes(3));<NEW_LINE>conf.setContainerCpuRequested(3);<NEW_LINE>conf.setNumStmgrs(2);<NEW_LINE>HeronSubmitter.submitTopology(args[0], conf, builder.createTopology());<NEW_LINE>}
, new AckingTestWordSpout(), 2);
1,726,302
private void declare(AncestorChain<Identifier> id, ScopeTree<S> scope) {<NEW_LINE>String symbolName = id.node.getName();<NEW_LINE>ScopeTree<S> declScope = hoist(id, scope);<NEW_LINE>for (ScopeTree<S> s = scope; s != declScope; s = s.outer) {<NEW_LINE>if (s.type != ScopeType.CATCH) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>AncestorChain<CatchStmt> cs = s.inScope.get(0).cast(CatchStmt.class);<NEW_LINE>AncestorChain<Declaration> ex = cs.child(cs.node.getException());<NEW_LINE>Identifier exId = ex.node.getIdentifier();<NEW_LINE>if (symbolName.equals(exId.getName())) {<NEW_LINE>listener.splitInitialization(id, declScope.scopeImpl, ex.child(exId), s.scopeImpl);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ScopeTree<S> maskedScope = definingSite(symbolName, declScope);<NEW_LINE>declScope.declared.add(symbolName);<NEW_LINE>listener.declaration(id, declScope.scopeImpl);<NEW_LINE>if (// Not a function declaration or a var declaration like<NEW_LINE>maskedScope != null && // var x = function x() { ... };<NEW_LINE>!(id.parent.node instanceof FunctionConstructor && symbolName.equals(nameAssignedTo(id.parent)))) {<NEW_LINE>if (maskedScope == scope) {<NEW_LINE>listener.<MASK><NEW_LINE>} else {<NEW_LINE>listener.masked(id, declScope.scopeImpl, scopeImpl(maskedScope));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
duplicate(id, declScope.scopeImpl);
175,230
public boolean deleteBackup(final Long backupId) {<NEW_LINE>final BackupVO backup = backupDao.findByIdIncludingRemoved(backupId);<NEW_LINE>if (backup == null) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>final Long vmId = backup.getVmId();<NEW_LINE>final VMInstanceVO vm = vmInstanceDao.findByIdIncludingRemoved(vmId);<NEW_LINE>if (vm == null) {<NEW_LINE>throw new CloudRuntimeException("VM " + vmId + " does not exist");<NEW_LINE>}<NEW_LINE>validateForZone(vm.getDataCenterId());<NEW_LINE>accountManager.checkAccess(CallContext.current().getCallingAccount(), null, true, vm);<NEW_LINE>final BackupOffering offering = backupOfferingDao.findByIdIncludingRemoved(vm.getBackupOfferingId());<NEW_LINE>if (offering == null) {<NEW_LINE>throw new CloudRuntimeException("VM backup offering ID " + vm.getBackupOfferingId() + " does not exist");<NEW_LINE>}<NEW_LINE>List<Backup> backupsForVm = backupDao.listByVmId(vm.getDataCenterId(), vmId);<NEW_LINE>if (CollectionUtils.isNotEmpty(backupsForVm)) {<NEW_LINE>backupsForVm = backupsForVm.stream().filter(vmBackup -> vmBackup.getId() != backupId).collect(Collectors.toList());<NEW_LINE>if (backupsForVm.size() <= 0 && vm.getRemoved() != null) {<NEW_LINE>removeVMFromBackupOffering(vmId, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final BackupProvider backupProvider = getBackupProvider(offering.getProvider());<NEW_LINE>boolean result = backupProvider.deleteBackup(backup);<NEW_LINE>if (result) {<NEW_LINE>return backupDao.remove(backup.getId());<NEW_LINE>}<NEW_LINE>throw new CloudRuntimeException("Failed to delete the backup");<NEW_LINE>}
CloudRuntimeException("Backup " + backupId + " does not exist");
500,715
public InternalAggregation[] buildAggregations(long[] owningBucketOrds) throws IOException {<NEW_LINE>int numClusters = collector.finalNumBuckets();<NEW_LINE>long[] bucketOrdsToCollect = new long[numClusters];<NEW_LINE>for (int i = 0; i < numClusters; i++) {<NEW_LINE>bucketOrdsToCollect[i] = i;<NEW_LINE>}<NEW_LINE>InternalAggregations[] subAggregationResults = buildSubAggsForBuckets(bucketOrdsToCollect);<NEW_LINE>List<InternalVariableWidthHistogram.Bucket> buckets = new ArrayList<>(numClusters);<NEW_LINE>for (int bucketOrd = 0; bucketOrd < numClusters; bucketOrd++) {<NEW_LINE>buckets.add(collector.buildBucket(<MASK><NEW_LINE>}<NEW_LINE>Function<List<InternalVariableWidthHistogram.Bucket>, InternalAggregation> resultBuilder = bucketsToFormat -> {<NEW_LINE>// The contract of the histogram aggregation is that shards must return<NEW_LINE>// buckets ordered by centroid in ascending order<NEW_LINE>CollectionUtil.introSort(bucketsToFormat, BucketOrder.key(true).comparator());<NEW_LINE>InternalVariableWidthHistogram.EmptyBucketInfo emptyBucketInfo = new InternalVariableWidthHistogram.EmptyBucketInfo(buildEmptySubAggregations());<NEW_LINE>return new InternalVariableWidthHistogram(name, bucketsToFormat, emptyBucketInfo, numBuckets, formatter, metadata());<NEW_LINE>};<NEW_LINE>return new InternalAggregation[] { resultBuilder.apply(buckets) };<NEW_LINE>}
bucketOrd, subAggregationResults[bucketOrd]));
759,672
public void decodeSelectionRowKeys(FacesContext context, DataTable table) {<NEW_LINE>Set<String> rowKeys = null;<NEW_LINE>ValueExpression selectionVE = table.getValueExpression(DataTableBase.PropertyKeys.selection.name());<NEW_LINE>if (selectionVE != null) {<NEW_LINE>Object selection = selectionVE.getValue(context.getELContext());<NEW_LINE>if (selection != null) {<NEW_LINE>rowKeys = new HashSet<>();<NEW_LINE>if (table.isSingleSelectionMode()) {<NEW_LINE>rowKeys.add(table.getRowKey(selection));<NEW_LINE>} else {<NEW_LINE>Class<?> clazz = selection.getClass();<NEW_LINE>boolean isArray = clazz != null && clazz.isArray();<NEW_LINE>if (clazz != null && !isArray && !List.class.isAssignableFrom(clazz)) {<NEW_LINE>throw new FacesException(<MASK><NEW_LINE>}<NEW_LINE>List<Object> selectionTmp = isArray ? Arrays.asList((Object[]) selection) : (List<Object>) selection;<NEW_LINE>for (int i = 0; i < selectionTmp.size(); i++) {<NEW_LINE>Object o = selectionTmp.get(i);<NEW_LINE>rowKeys.add(table.getRowKey(o));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>table.setSelectedRowKeys(rowKeys);<NEW_LINE>}
"Multiple selection reference must be an Array or a List for datatable " + table.getClientId());
122,459
public static void bind(Class<?> c) {<NEW_LINE>Library library = c.getAnnotation(Library.class);<NEW_LINE>if (library != null) {<NEW_LINE>Runtime.loadLibrary(library);<NEW_LINE>}<NEW_LINE>for (Method method : c.getDeclaredMethods()) {<NEW_LINE>Bridge bridge = method.getAnnotation(Bridge.class);<NEW_LINE>if (bridge != null && !bridge.dynamic() && !VM.isBridgeMethodBound(method)) {<NEW_LINE>long f = Runtime.resolveBridge(library, bridge, method);<NEW_LINE>if (f != 0L) {<NEW_LINE>VM.bindBridgeMethod(method, f);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>GlobalValue globalValue = method.getAnnotation(GlobalValue.class);<NEW_LINE>if (globalValue != null && !VM.isBridgeMethodBound(method)) {<NEW_LINE>long f = Runtime.<MASK><NEW_LINE>if (f != 0L) {<NEW_LINE>VM.bindBridgeMethod(method, f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
resolveGlobalValue(library, globalValue, method);
823,024
protected void updateToolbar(int verticalOffset) {<NEW_LINE>float absOffset = Math.abs(verticalOffset);<NEW_LINE>float totalScrollRange = appBar.getTotalScrollRange();<NEW_LINE>boolean collapsed = totalScrollRange > 0 && Math.abs(verticalOffset) == totalScrollRange;<NEW_LINE>float alpha = ColorUtilities.getProportionalAlpha(0, totalScrollRange * 0.75f, absOffset);<NEW_LINE>float inverseAlpha = 1.0f - ColorUtilities.getProportionalAlpha(0, totalScrollRange, absOffset);<NEW_LINE>int defaultLinksColor = ContextCompat.getColor(app, getToolbarLinksColor());<NEW_LINE>int activeLinksColor = ColorUtilities.getActiveButtonsAndLinksTextColor(app, nightMode);<NEW_LINE>int headerBgColor = ContextCompat.getColor(app, getHeaderBgColorId());<NEW_LINE>int activeColor = ColorUtilities.getActiveColor(app, nightMode);<NEW_LINE>View header = mainView.findViewById(R.id.header);<NEW_LINE>header.setAlpha(alpha);<NEW_LINE>ImageView icBack = mainView.findViewById(R.id.button_back);<NEW_LINE>ImageView icInfo = mainView.findViewById(R.id.button_help);<NEW_LINE>int iconsColor = ColorUtilities.getProportionalColorMix(defaultLinksColor, activeLinksColor, 0, totalScrollRange, Math.abs(verticalOffset));<NEW_LINE>icBack.setColorFilter(iconsColor);<NEW_LINE>icInfo.setColorFilter(iconsColor);<NEW_LINE>TextView tvTitle = mainView.findViewById(R.id.toolbar_title);<NEW_LINE>tvTitle.setTextColor(activeLinksColor);<NEW_LINE>tvTitle.setText(getHeader());<NEW_LINE>tvTitle.setAlpha(inverseAlpha);<NEW_LINE>int toolbarColor = ColorUtilities.getProportionalColorMix(headerBgColor, activeColor, 0, totalScrollRange, Math.abs(verticalOffset));<NEW_LINE>appBar.setBackgroundColor(toolbarColor);<NEW_LINE>Dialog dialog = getDialog();<NEW_LINE>if (Build.VERSION.SDK_INT >= 21 && dialog != null && dialog.getWindow() != null) {<NEW_LINE><MASK><NEW_LINE>window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);<NEW_LINE>window.setStatusBarColor(toolbarColor);<NEW_LINE>if (Build.VERSION.SDK_INT >= 23 && !nightMode) {<NEW_LINE>window.getDecorView().setSystemUiVisibility(collapsed ? mainView.getSystemUiVisibility() & ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR : mainView.getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>View shadow = mainView.findViewById(R.id.shadowView);<NEW_LINE>shadow.setAlpha(inverseAlpha);<NEW_LINE>}
Window window = dialog.getWindow();
1,302,640
public static DescribeLiveRealtimeDeliveryAccResponse unmarshall(DescribeLiveRealtimeDeliveryAccResponse describeLiveRealtimeDeliveryAccResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeLiveRealtimeDeliveryAccResponse.setRequestId(_ctx.stringValue("DescribeLiveRealtimeDeliveryAccResponse.RequestId"));<NEW_LINE>List<AccData> realTimeDeliveryAccData <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeLiveRealtimeDeliveryAccResponse.RealTimeDeliveryAccData.Length"); i++) {<NEW_LINE>AccData accData = new AccData();<NEW_LINE>accData.setTimeStamp(_ctx.stringValue("DescribeLiveRealtimeDeliveryAccResponse.RealTimeDeliveryAccData[" + i + "].TimeStamp"));<NEW_LINE>accData.setFailedNum(_ctx.integerValue("DescribeLiveRealtimeDeliveryAccResponse.RealTimeDeliveryAccData[" + i + "].FailedNum"));<NEW_LINE>accData.setSuccessNum(_ctx.integerValue("DescribeLiveRealtimeDeliveryAccResponse.RealTimeDeliveryAccData[" + i + "].SuccessNum"));<NEW_LINE>realTimeDeliveryAccData.add(accData);<NEW_LINE>}<NEW_LINE>describeLiveRealtimeDeliveryAccResponse.setRealTimeDeliveryAccData(realTimeDeliveryAccData);<NEW_LINE>return describeLiveRealtimeDeliveryAccResponse;<NEW_LINE>}
= new ArrayList<AccData>();
413,406
public void marshall(ParameterDefinition parameterDefinition, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (parameterDefinition == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getAllowedPattern(), ALLOWEDPATTERN_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getAllowedValues(), ALLOWEDVALUES_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getConstraintDescription(), CONSTRAINTDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getDefaultValue(), DEFAULTVALUE_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getMaxLength(), MAXLENGTH_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getMaxValue(), MAXVALUE_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getMinLength(), MINLENGTH_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getMinValue(), MINVALUE_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getNoEcho(), NOECHO_BINDING);<NEW_LINE>protocolMarshaller.marshall(parameterDefinition.getReferencedByResources(), REFERENCEDBYRESOURCES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
parameterDefinition.getType(), TYPE_BINDING);
362,332
public Void execute(CommandContext commandContext) {<NEW_LINE>final Incident incident = commandContext.getIncidentManager().findIncidentById(incidentId);<NEW_LINE>EnsureUtil.ensureNotNull(NotFoundException.class, "Cannot find an incident with id '" + incidentId + "'", "incident", incident);<NEW_LINE>if (incident.getIncidentType().equals("failedJob") || incident.getIncidentType().equals("failedExternalTask")) {<NEW_LINE>throw new BadUserRequestException("Cannot resolve an incident of type " + incident.getIncidentType());<NEW_LINE>}<NEW_LINE>EnsureUtil.ensureNotNull(BadUserRequestException.class, "", "executionId", incident.getExecutionId());<NEW_LINE>ExecutionEntity execution = commandContext.getExecutionManager().<MASK><NEW_LINE>EnsureUtil.ensureNotNull(BadUserRequestException.class, "Cannot find an execution for an incident with id '" + incidentId + "'", "execution", execution);<NEW_LINE>for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {<NEW_LINE>checker.checkUpdateProcessInstance(execution);<NEW_LINE>}<NEW_LINE>commandContext.getOperationLogManager().logProcessInstanceOperation(UserOperationLogEntry.OPERATION_TYPE_RESOLVE, execution.getProcessInstanceId(), execution.getProcessDefinitionId(), null, Collections.singletonList(new PropertyChange("incidentId", null, incidentId)));<NEW_LINE>execution.resolveIncident(incidentId);<NEW_LINE>return null;<NEW_LINE>}
findExecutionById(incident.getExecutionId());
464,834
private static // relation.<NEW_LINE>boolean relate(Envelope envelope_a, Envelope envelope_b, SpatialReference sr, int relation, ProgressTracker progress_tracker) {<NEW_LINE>if (envelope_a.isEmpty() || envelope_b.isEmpty()) {<NEW_LINE>if (relation == Relation.disjoint)<NEW_LINE>// Always true<NEW_LINE>return true;<NEW_LINE>// Always false<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Envelope2D env_a = new Envelope2D(), env_b = new Envelope2D(), env_merged = new Envelope2D();<NEW_LINE>envelope_a.queryEnvelope2D(env_a);<NEW_LINE>envelope_b.queryEnvelope2D(env_b);<NEW_LINE>env_merged.setCoords(env_a);<NEW_LINE>env_merged.merge(env_b);<NEW_LINE>double tolerance = InternalUtils.calculateToleranceFromGeometry(sr, env_merged, false);<NEW_LINE>switch(relation) {<NEW_LINE>case Relation.disjoint:<NEW_LINE>return envelopeDisjointEnvelope_(env_a, env_b, tolerance, progress_tracker);<NEW_LINE>case Relation.within:<NEW_LINE>return envelopeContainsEnvelope_(env_b, env_a, tolerance, progress_tracker);<NEW_LINE>case Relation.contains:<NEW_LINE>return envelopeContainsEnvelope_(env_a, env_b, tolerance, progress_tracker);<NEW_LINE>case Relation.equals:<NEW_LINE>return envelopeEqualsEnvelope_(env_a, env_b, tolerance, progress_tracker);<NEW_LINE>case Relation.touches:<NEW_LINE>return envelopeTouchesEnvelope_(env_a, env_b, tolerance, progress_tracker);<NEW_LINE>case Relation.overlaps:<NEW_LINE>return envelopeOverlapsEnvelope_(env_a, env_b, tolerance, progress_tracker);<NEW_LINE>case Relation.crosses:<NEW_LINE>return envelopeCrossesEnvelope_(<MASK><NEW_LINE>default:<NEW_LINE>// warning fix<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
env_a, env_b, tolerance, progress_tracker);