idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,179,899
@Produces({ "application/rdf+xml", "text/plain", "text/turtle", "text/n3", "application/trig", "application/ld+json", "application/n-quads", "text/x-turtlestar", "application/x-trigstar" })<NEW_LINE>public Response exportOnto(@Context DatabaseManagementService gds, @PathParam("dbname") String dbNameParam, @QueryParam("format") String format, @HeaderParam("accept") String acceptHeaderParam) {<NEW_LINE>return Response.ok().entity((StreamingOutput) outputStream -> {<NEW_LINE>GraphDatabaseService neo4j = gds.database(dbNameParam);<NEW_LINE>RDFWriter writer = startRdfWriter(getFormat(acceptHeaderParam, format), outputStream);<NEW_LINE>writer.handleNamespace("owl", OWL.NAMESPACE);<NEW_LINE>writer.handleNamespace("rdfs", RDFS.NAMESPACE);<NEW_LINE>try (Transaction tx = neo4j.beginTx()) {<NEW_LINE>GraphConfig gc = getGraphConfig(tx);<NEW_LINE>ExportProcessor proc;<NEW_LINE>if (gc == null || gc.getHandleVocabUris() == GRAPHCONF_VOC_URI_IGNORE || gc.getHandleVocabUris() == GRAPHCONF_VOC_URI_MAP) {<NEW_LINE>proc = new LPGToRDFProcesssor(neo4j, tx, gc, null, false, false);<NEW_LINE>} else {<NEW_LINE>proc = new LPGRDFToRDFProcesssor(neo4j, tx, gc, isRdfStarSerialisation(writer.getRDFFormat()));<NEW_LINE>}<NEW_LINE>proc.streamLocalImplicitOntology(<MASK><NEW_LINE>endRDFWriter(writer);<NEW_LINE>} catch (Exception e) {<NEW_LINE>handleSerialisationError(outputStream, e, acceptHeaderParam, format);<NEW_LINE>}<NEW_LINE>}).build();<NEW_LINE>}
).forEach(writer::handleStatement);
1,801,260
private boolean isElegibleAccessorMethod(Element element) {<NEW_LINE>if (element.getKind() != ElementKind.METHOD) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (element.getModifiers().contains(Modifier.STATIC)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (NonAttributeMirror.isPresent(element)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String simpleName = element.getSimpleName().toString();<NEW_LINE>switch(simpleName) {<NEW_LINE>case HASH_CODE_METHOD:<NEW_LINE>case TO_STRING_METHOD:<NEW_LINE>return false;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>if (!type.style().toBuilder().isEmpty() && !type.style().strictBuilder() && simpleName.equals(type.names().toBuilder()) && element.getModifiers().contains(Modifier.ABSTRACT)) {<NEW_LINE>// When we enable toBuilder generation, then matching abstract toBuilder declarations<NEW_LINE>// will not be considered accessors. Any other name signature conficts is up to the user to resolve<NEW_LINE>// Note: this is not the full check if to builder will be actually generated (isGenerateToBuilder)<NEW_LINE>// but it's good enough for this stage when we don't know all attribute set<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String definitionType = element.getEnclosingElement().toString();<NEW_LINE>return !definitionType.equals(Object.class.getName()) && !definitionType.equals(Proto.ORDINAL_VALUE_INTERFACE_TYPE) && !<MASK><NEW_LINE>}
definitionType.equals(Proto.PARCELABLE_INTERFACE_TYPE);
1,030,296
private void addTitleAndDescriptionForSnippet(SnippetElement snippet, Composite itemComposite, MouseListener mouseListener) {<NEW_LINE>imageLabel = new Label(itemComposite, SWT.NONE);<NEW_LINE>imageLabel.setLayoutData(GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).create());<NEW_LINE>imageLabel.setImage(getSnippetImage(true));<NEW_LINE>imageLabel.addMouseListener(mouseListener);<NEW_LINE>textComposite = new Composite(itemComposite, SWT.NONE);<NEW_LINE>textComposite.setLayout(GridLayoutFactory.fillDefaults().spacing(3, 0).numColumns(2).create());<NEW_LINE>textComposite.setLayoutData(GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).grab(true, false).create());<NEW_LINE>textComposite.addMouseListener(mouseListener);<NEW_LINE>titleLabel = new CLabel(textComposite, SWT.NONE);<NEW_LINE>titleLabel.setText(snippet.getDisplayName());<NEW_LINE>titleLabel.setLayoutData(GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).grab(false, false).create());<NEW_LINE>titleLabel.addMouseListener(mouseListener);<NEW_LINE>descLabel = new CLabel(textComposite, SWT.NONE);<NEW_LINE>String descText = snippet.getDescription();<NEW_LINE>if (descText == null || StringUtil.isEmpty(descText)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>descText = descriptionReplacePattern.matcher(snippet.getExpansion()).replaceAll(" ");<NEW_LINE>}<NEW_LINE>descLabel.setText(descText);<NEW_LINE>descLabel.setLayoutData(GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).grab(true<MASK><NEW_LINE>descLabel.addMouseListener(mouseListener);<NEW_LINE>addDragDropForSnippet();<NEW_LINE>}
, false).create());
1,110,729
private TableUpdateDetails unsafeAssignTableToWriterThread(int tudKeyIndex, CharSequence tableNameUtf16) {<NEW_LINE>unsafeCalcThreadLoad();<NEW_LINE>long leastLoad = Long.MAX_VALUE;<NEW_LINE>int threadId = 0;<NEW_LINE>for (int i = 0, n = loadByWriterThread.length; i < n; i++) {<NEW_LINE>if (loadByWriterThread[i] < leastLoad) {<NEW_LINE>leastLoad = loadByWriterThread[i];<NEW_LINE>threadId = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final TableUpdateDetails tableUpdateDetails = new // get writer here to avoid constructing<NEW_LINE>TableUpdateDetails(// get writer here to avoid constructing<NEW_LINE>configuration, // get writer here to avoid constructing<NEW_LINE>engine, // object instance and potentially leaking memory if<NEW_LINE>// writer allocation fails<NEW_LINE>engine.getWriter(securityContext, tableNameUtf16<MASK><NEW_LINE>tableUpdateDetailsUtf16.putAt(tudKeyIndex, tableUpdateDetails.getTableNameUtf16(), tableUpdateDetails);<NEW_LINE>LOG.info().$("assigned ").$(tableNameUtf16).$(" to thread ").$(threadId).$();<NEW_LINE>return tableUpdateDetails;<NEW_LINE>}
, "tcpIlp"), threadId, netIoJobs);
1,802,851
private void checkNewShortcut(int a, int b) {<NEW_LINE>checkNodeId(a);<NEW_LINE>checkNodeId(b);<NEW_LINE>if (getLevel(a) >= storage.getNodes() || getLevel(a) < 0)<NEW_LINE>throw new IllegalArgumentException("Invalid level for node " + a + ": " + getLevel<MASK><NEW_LINE>if (a != b && getLevel(a) == getLevel(b))<NEW_LINE>throw new IllegalArgumentException("Different nodes must not have the same level, got levels " + getLevel(a) + " and " + getLevel(b) + " for nodes " + a + " and " + b);<NEW_LINE>if (a != b && getLevel(a) > getLevel(b))<NEW_LINE>throw new IllegalArgumentException("The level of nodeA must be smaller than the level of nodeB, but got: " + getLevel(a) + " and " + getLevel(b) + ". When inserting shortcut: " + a + "-" + b);<NEW_LINE>if (storage.getShortcuts() > 0) {<NEW_LINE>int prevNodeA = storage.getNodeA(storage.toShortcutPointer(storage.getShortcuts() - 1));<NEW_LINE>int prevLevelA = getLevel(prevNodeA);<NEW_LINE>if (getLevel(a) < prevLevelA) {<NEW_LINE>throw new IllegalArgumentException("Invalid level for node " + a + ": " + getLevel(a) + ". The level " + "must be equal to or larger than the lower level node of the previous shortcut (node: " + prevNodeA + ", level: " + prevLevelA + ")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(a) + ". Node a must" + " be assigned a valid level before we add shortcuts a->b or a<-b");
1,515,367
/*<NEW_LINE>* Generate artificial tangent for un-textured face<NEW_LINE>*/<NEW_LINE>static void generateTB(Vec3f v0, Vec3f v1, Vec3f v2, Vec3f[] ntb) {<NEW_LINE>MeshTempState instance = MeshTempState.getInstance();<NEW_LINE>Vec3f a = instance.vec3f1;<NEW_LINE>a.sub(v1, v0);<NEW_LINE>Vec3f b = instance.vec3f2;<NEW_LINE>b.sub(v2, v0);<NEW_LINE>if (a.dot(a) > b.dot(b)) {<NEW_LINE>ntb[1].set(a);<NEW_LINE>// TODO: make sure each triangle area (size) will be considered<NEW_LINE>ntb[1].normalize();<NEW_LINE>ntb[2].cross(ntb[0], ntb[1]);<NEW_LINE>} else {<NEW_LINE>ntb<MASK><NEW_LINE>// TODO: make sure each triangle area (size) will be considered<NEW_LINE>ntb[2].normalize();<NEW_LINE>ntb[1].cross(ntb[2], ntb[0]);<NEW_LINE>}<NEW_LINE>}
[2].set(b);
1,362,524
public Response withSynchronization(final EntitlementCallCompletionCallback<T> callback, final long timeoutSec, final boolean callCompletion, final CallContext callContext) throws SubscriptionApiException, AccountApiException, EntitlementApiException {<NEW_LINE>final CompletionUserRequestEntitlement waiter;<NEW_LINE>if (callCompletion) {<NEW_LINE>// Retrieve the tags for the ACCOUNT object to correctly implement callCompletion in the simple use-cases.<NEW_LINE>// In reality, this is much more complex though and not all scenarii are supported (e.g. entitlement plugin could add some tags on the fly).<NEW_LINE>final List<Tag> accountTags = tagUserApi.getTagsForAccountType(callContext.getAccountId(), ObjectType.ACCOUNT, false, callContext);<NEW_LINE>waiter = new CompletionUserRequestEntitlement(callContext.getUserToken(), accountTags);<NEW_LINE>} else {<NEW_LINE>waiter = null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (waiter != null) {<NEW_LINE>killbillHandler.registerCompletionUserRequestWaiter(waiter);<NEW_LINE>}<NEW_LINE>final T <MASK><NEW_LINE>if (waiter != null && callback.isImmOperation()) {<NEW_LINE>waiter.waitForCompletion(timeoutSec * 1000);<NEW_LINE>}<NEW_LINE>return callback.doResponseOk(operationValue);<NEW_LINE>} catch (final InterruptedException e) {<NEW_LINE>return Response.status(Status.INTERNAL_SERVER_ERROR).build();<NEW_LINE>} catch (final CatalogApiException e) {<NEW_LINE>throw new EntitlementApiException(e);<NEW_LINE>} catch (final TimeoutException e) {<NEW_LINE>return Response.status(408).build();<NEW_LINE>} finally {<NEW_LINE>if (waiter != null) {<NEW_LINE>killbillHandler.unregisterCompletionUserRequestWaiter(waiter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
operationValue = callback.doOperation(callContext);
685,037
public static ListConfigItemsResponse unmarshall(ListConfigItemsResponse listConfigItemsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listConfigItemsResponse.setRequestId(_ctx.stringValue("ListConfigItemsResponse.RequestId"));<NEW_LINE>listConfigItemsResponse.setCode(_ctx.stringValue("ListConfigItemsResponse.Code"));<NEW_LINE>listConfigItemsResponse.setHttpStatusCode(_ctx.integerValue("ListConfigItemsResponse.HttpStatusCode"));<NEW_LINE>listConfigItemsResponse.setMessage(_ctx.stringValue("ListConfigItemsResponse.Message"));<NEW_LINE>List<String> params = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListConfigItemsResponse.Params.Length"); i++) {<NEW_LINE>params.add(_ctx.stringValue("ListConfigItemsResponse.Params[" + i + "]"));<NEW_LINE>}<NEW_LINE>listConfigItemsResponse.setParams(params);<NEW_LINE>List<ConfigItem> data = new ArrayList<ConfigItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListConfigItemsResponse.Data.Length"); i++) {<NEW_LINE>ConfigItem configItem = new ConfigItem();<NEW_LINE>configItem.setObjectId(_ctx.stringValue("ListConfigItemsResponse.Data[" + i + "].ObjectId"));<NEW_LINE>configItem.setValue(_ctx.stringValue<MASK><NEW_LINE>configItem.setObjectType(_ctx.stringValue("ListConfigItemsResponse.Data[" + i + "].ObjectType"));<NEW_LINE>configItem.setInstanceId(_ctx.stringValue("ListConfigItemsResponse.Data[" + i + "].InstanceId"));<NEW_LINE>configItem.setName(_ctx.stringValue("ListConfigItemsResponse.Data[" + i + "].Name"));<NEW_LINE>data.add(configItem);<NEW_LINE>}<NEW_LINE>listConfigItemsResponse.setData(data);<NEW_LINE>return listConfigItemsResponse;<NEW_LINE>}
("ListConfigItemsResponse.Data[" + i + "].Value"));
605,846
protected void addDecorators(CustomResourceInfo config, TypeDef def, Optional<String> specReplicasPath, Optional<String> statusReplicasPath, Optional<String> labelSelectorPath) {<NEW_LINE>final String name = config.crdName();<NEW_LINE>final String version = config.version();<NEW_LINE>resources.decorate(new AddCustomResourceDefinitionResourceDecorator(name, config.group(), config.kind(), config.scope().value(), config.shortNames(), config.plural(), config.singular()));<NEW_LINE>resources.decorate(new AddCustomResourceDefinitionVersionDecorator(name, version));<NEW_LINE>resources.decorate(new AddSchemaToCustomResourceDefinitionVersionDecorator(name, version, JsonSchema.from(def, "kind", "apiVersion", "metadata")));<NEW_LINE>specReplicasPath.ifPresent(path -> {<NEW_LINE>resources.decorate(new AddSubresourcesDecorator(name, version));<NEW_LINE>resources.decorate(new AddSpecReplicasPathDecorator(name, version, path));<NEW_LINE>});<NEW_LINE>statusReplicasPath.ifPresent(path -> {<NEW_LINE>resources.decorate(new AddSubresourcesDecorator(name, version));<NEW_LINE>resources.decorate(new AddStatusReplicasPathDecorator(name, version, path));<NEW_LINE>});<NEW_LINE>labelSelectorPath.ifPresent(path -> {<NEW_LINE>resources.decorate(new AddSubresourcesDecorator(name, version));<NEW_LINE>resources.decorate(new AddLabelSelectorPathDecorator(name, version, path));<NEW_LINE>});<NEW_LINE>if (config.statusClassName().isPresent()) {<NEW_LINE>resources.decorate(new AddSubresourcesDecorator(name, version));<NEW_LINE>resources.decorate(new AddStatusSubresourceDecorator(name, version));<NEW_LINE>}<NEW_LINE>resources.decorate(new SetServedVersionDecorator(name, version, config.served()));<NEW_LINE>resources.decorate(new SetStorageVersionDecorator(name, version, config.storage()));<NEW_LINE>resources.decorate(new EnsureSingleStorageVersionDecorator(name));<NEW_LINE>resources.<MASK><NEW_LINE>resources.decorate(new SortPrinterColumnsDecorator(name, version));<NEW_LINE>}
decorate(new PromoteSingleVersionAttributesDecorator(name));
287,799
public Map<Integer, Double> labelCounts() {<NEW_LINE>Map<Integer, Double> ret = new HashMap<>();<NEW_LINE>if (labels == null)<NEW_LINE>return ret;<NEW_LINE>long nTensors = labels.tensorsAlongDimension(1);<NEW_LINE>for (int i = 0; i < nTensors; i++) {<NEW_LINE>INDArray row = labels.tensorAlongDimension(i, 1);<NEW_LINE>INDArray javaRow = labels.tensorAlongDimension(i, 1);<NEW_LINE>int maxIdx = Nd4j.<MASK><NEW_LINE>int maxIdxJava = Nd4j.getBlasWrapper().iamax(javaRow);<NEW_LINE>if (maxIdx < 0)<NEW_LINE>throw new IllegalStateException("Please check the iamax implementation for " + Nd4j.getBlasWrapper().getClass().getName());<NEW_LINE>if (ret.get(maxIdx) == null)<NEW_LINE>ret.put(maxIdx, 1.0);<NEW_LINE>else<NEW_LINE>ret.put(maxIdx, ret.get(maxIdx) + 1.0);<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
getBlasWrapper().iamax(row);
1,251,878
protected Object doWork() {<NEW_LINE>validateArguments();<NEW_LINE>resolveIntervals();<NEW_LINE>// read in count files, validate they contain specified subset of intervals, and output<NEW_LINE>// count files for these intervals to temporary files<NEW_LINE>final List<File> intervalSubsetReadCountFiles = writeIntervalSubsetReadCountFiles();<NEW_LINE>final String script = (runMode == <MASK><NEW_LINE>// call python inference code<NEW_LINE>final PythonScriptExecutor executor = new PythonScriptExecutor(true);<NEW_LINE>ProcessOutput pythonProcessOutput = executor.executeScriptAndGetOutput(new Resource(script, GermlineCNVCaller.class), null, composePythonArguments(intervalSubsetReadCountFiles, STARTING_SEED));<NEW_LINE>if (pythonProcessOutput.getExitValue() != 0) {<NEW_LINE>// We restart once if the inference diverged<NEW_LINE>if (pythonProcessOutput.getExitValue() == DIVERGED_INFERENCE_EXIT_CODE) {<NEW_LINE>final Random generator = new Random(STARTING_SEED);<NEW_LINE>final int nextGCNVSeed = generator.nextInt();<NEW_LINE>logger.info("The inference failed to converge and will be restarted once with a different random seed.");<NEW_LINE>pythonProcessOutput = executor.executeScriptAndGetOutput(new Resource(script, GermlineCNVCaller.class), null, composePythonArguments(intervalSubsetReadCountFiles, nextGCNVSeed));<NEW_LINE>} else {<NEW_LINE>throw executor.getScriptException(executor.getExceptionMessageFromScriptError(pythonProcessOutput));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pythonProcessOutput.getExitValue() != 0) {<NEW_LINE>if (pythonProcessOutput.getExitValue() == DIVERGED_INFERENCE_EXIT_CODE) {<NEW_LINE>logger.info("The inference failed to converge twice. We suggest checking if input count or karyotype" + " values or other inputs are abnormal (an example of abnormality is a count file containing mostly zeros).");<NEW_LINE>}<NEW_LINE>throw executor.getScriptException(executor.getExceptionMessageFromScriptError(pythonProcessOutput));<NEW_LINE>}<NEW_LINE>logger.info(String.format("%s complete.", getClass().getSimpleName()));<NEW_LINE>return null;<NEW_LINE>}
RunMode.COHORT) ? COHORT_DENOISING_CALLING_PYTHON_SCRIPT : CASE_SAMPLE_CALLING_PYTHON_SCRIPT;
1,452,774
private void testHashSTint() {<NEW_LINE>StdOut.println("HashSTint test");<NEW_LINE>HashSETint hashSTint = new HashSETint(5);<NEW_LINE>hashSTint.add(5);<NEW_LINE>hashSTint.add(1);<NEW_LINE>hashSTint.add(9);<NEW_LINE>hashSTint.add(2);<NEW_LINE>hashSTint.add(0);<NEW_LINE>hashSTint.add(99);<NEW_LINE>hashSTint.add(-1);<NEW_LINE>hashSTint.add(-2);<NEW_LINE>hashSTint.add(3);<NEW_LINE>hashSTint.add(-5);<NEW_LINE>StdOut.println("Keys() test");<NEW_LINE>for (Integer key : hashSTint.keys()) {<NEW_LINE>StdOut.print(key + " ");<NEW_LINE>}<NEW_LINE>StdOut.println("\nExpected: -5 -2 -1 0 1 2 3 5 9 99");<NEW_LINE><MASK><NEW_LINE>StdOut.println("\nContains 0: " + hashSTint.contains(0) + " Expected: true");<NEW_LINE>StdOut.println("Contains 100: " + hashSTint.contains(100) + " Expected: false");<NEW_LINE>// Test delete()<NEW_LINE>StdOut.println("\nDelete key 2");<NEW_LINE>hashSTint.delete(2);<NEW_LINE>StdOut.println(hashSTint);<NEW_LINE>StdOut.println("\nDelete key 99");<NEW_LINE>hashSTint.delete(99);<NEW_LINE>StdOut.println(hashSTint);<NEW_LINE>StdOut.println("\nDelete key -5");<NEW_LINE>hashSTint.delete(-5);<NEW_LINE>StdOut.println(hashSTint);<NEW_LINE>}
StdOut.println("\ntoString() test: " + hashSTint);
1,028,204
void createToolWindowContent(ToolWindow toolWindow) {<NEW_LINE>// Create runner UI layout<NEW_LINE>RunnerLayoutUi.Factory factory = <MASK><NEW_LINE>RunnerLayoutUi layoutUi = factory.create("", "", "session", project);<NEW_LINE>layoutUi.getOptions().setMoveToGridActionEnabled(false).setMinimizeActionEnabled(false);<NEW_LINE>Content console = layoutUi.createContent(BlazeConsoleToolWindowFactory.ID, consoleView.getComponent(), "", null, null);<NEW_LINE>console.setCloseable(false);<NEW_LINE>layoutUi.addContent(console, 0, PlaceInGrid.right, false);<NEW_LINE>// Adding actions<NEW_LINE>DefaultActionGroup group = new DefaultActionGroup();<NEW_LINE>layoutUi.getOptions().setLeftToolbar(group, TOOLBAR_ACTION_PLACE);<NEW_LINE>// Initializing prev and next occurrences actions<NEW_LINE>OccurenceNavigator navigator = fromConsoleView(consoleView);<NEW_LINE>CommonActionsManager actionsManager = CommonActionsManager.getInstance();<NEW_LINE>AnAction prevAction = actionsManager.createPrevOccurenceAction(navigator);<NEW_LINE>prevAction.getTemplatePresentation().setText(navigator.getPreviousOccurenceActionName());<NEW_LINE>AnAction nextAction = actionsManager.createNextOccurenceAction(navigator);<NEW_LINE>nextAction.getTemplatePresentation().setText(navigator.getNextOccurenceActionName());<NEW_LINE>group.addAll(prevAction, nextAction);<NEW_LINE>AnAction[] consoleActions = consoleView.createConsoleActions();<NEW_LINE>for (AnAction action : consoleActions) {<NEW_LINE>if (!shouldIgnoreAction(action)) {<NEW_LINE>group.add(action);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>group.add(new StopAction());<NEW_LINE>JComponent layoutComponent = layoutUi.getComponent();<NEW_LINE>layoutComponent.setFocusTraversalPolicyProvider(true);<NEW_LINE>layoutComponent.setFocusTraversalPolicy(new LayoutFocusTraversalPolicy() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Component getDefaultComponent(Container container) {<NEW_LINE>if (container.equals(layoutComponent)) {<NEW_LINE>return consoleView.getPreferredFocusableComponent();<NEW_LINE>}<NEW_LINE>return super.getDefaultComponent(container);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Content content = ContentFactory.SERVICE.getInstance().createContent(layoutComponent, null, true);<NEW_LINE>content.setCloseable(false);<NEW_LINE>content.setDisposer(this);<NEW_LINE>toolWindow.getContentManager().addContent(content);<NEW_LINE>}
RunnerLayoutUi.Factory.getInstance(project);
111,160
private RelatedTerm createRelatedTerm(Term term1, Term term2) throws GlossaryAuthorFVTCheckedException, InvalidParameterException, PropertyServerException, UserNotAuthorizedException {<NEW_LINE>RelatedTerm relatedterm = new RelatedTerm();<NEW_LINE>relatedterm.setDescription("ddd");<NEW_LINE>relatedterm.setExpression("Ex");<NEW_LINE>relatedterm.setSource("source");<NEW_LINE>relatedterm.setSteward("Stew");<NEW_LINE>relatedterm.getEnd1().setNodeGuid(term1.getSystemAttributes().getGUID());<NEW_LINE>relatedterm.getEnd2().setNodeGuid(term2.<MASK><NEW_LINE>ResolvableType resolvableType = ResolvableType.forClassWithGenerics(SubjectAreaOMASAPIResponse.class, RelatedTerm.class);<NEW_LINE>ParameterizedTypeReference<GenericResponse<RelatedTerm>> type = ParameterizedTypeReference.forType(resolvableType.getType());<NEW_LINE>RelatedTerm createdRelatedTerm = glossaryAuthorViewRelationshipsClient.createRel(this.userId, relatedterm, type, RELATED_TERM);<NEW_LINE>FVTUtils.validateRelationship(createdRelatedTerm);<NEW_LINE>FVTUtils.checkEnds(relatedterm, createdRelatedTerm, "RelatedTerm", "create");<NEW_LINE>return createdRelatedTerm;<NEW_LINE>}
getSystemAttributes().getGUID());
1,319,595
List<Future<?>> store(List<String> agentRollupIds, String fullTextSha1, String fullText) throws Exception {<NEW_LINE>// relying on agent side to rate limit (re-)sending the same full text<NEW_LINE>List<Future<?>> futures = new ArrayList<>();<NEW_LINE>for (String agentRollupId : agentRollupIds) {<NEW_LINE>BoundStatement boundStatement = insertCheckV2PS.bind();<NEW_LINE>int i = 0;<NEW_LINE>boundStatement.setString(i++, agentRollupId);<NEW_LINE>boundStatement<MASK><NEW_LINE>boundStatement.setInt(i++, getTTL());<NEW_LINE>futures.add(session.writeAsync(boundStatement));<NEW_LINE>}<NEW_LINE>if (!rateLimiter.tryAcquire(fullTextSha1)) {<NEW_LINE>return futures;<NEW_LINE>}<NEW_LINE>ListenableFuture<?> future2;<NEW_LINE>try {<NEW_LINE>future2 = storeInternal(fullTextSha1, fullText);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>rateLimiter.release(fullTextSha1);<NEW_LINE>throw t;<NEW_LINE>}<NEW_LINE>futures.add(MoreFutures.onFailure(future2, () -> rateLimiter.release(fullTextSha1)));<NEW_LINE>return futures;<NEW_LINE>}
.setString(i++, fullTextSha1);
202,861
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Glue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
221,350
public void symlink(Object from, Object to, StarlarkThread thread) throws RepositoryFunctionException, EvalException, InterruptedException {<NEW_LINE>StarlarkPath fromPath = getPath("symlink()", from);<NEW_LINE>StarlarkPath toPath = getPath("symlink()", to);<NEW_LINE>WorkspaceRuleEvent w = WorkspaceRuleEvent.newSymlinkEvent(fromPath.toString(), toPath.toString(), rule.getLabel().toString(), thread.getCallerLocation());<NEW_LINE>env.getListener().post(w);<NEW_LINE>try {<NEW_LINE>checkInOutputDirectory("write", toPath);<NEW_LINE>makeDirectories(toPath.getPath());<NEW_LINE>toPath.getPath().createSymbolicLink(fromPath.getPath());<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RepositoryFunctionException(new IOException("Could not create symlink from " + fromPath + " to " + toPath + ": " + e.getMessage(), e), Transience.TRANSIENT);<NEW_LINE>} catch (InvalidPathException e) {<NEW_LINE>throw new RepositoryFunctionException(Starlark.errorf("Could not create %s: %s", toPath, e.getMessage<MASK><NEW_LINE>}<NEW_LINE>}
()), Transience.PERSISTENT);
129,117
protected String load(final Session<?> session, final Path directory) throws BackgroundException {<NEW_LINE>final Path parent = this.toEncrypted(session, directory.getParent().attributes().getDirectoryId(), directory.getParent());<NEW_LINE>final <MASK><NEW_LINE>final String ciphertextName = this.toEncrypted(session, parent.attributes().getDirectoryId(), cleartextName, EnumSet.of(Path.Type.directory));<NEW_LINE>final Path metadataParent = new Path(parent, ciphertextName, EnumSet.of(Path.Type.directory));<NEW_LINE>// Read directory id from file<NEW_LINE>try {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Read directory ID for folder %s from %s", directory, ciphertextName));<NEW_LINE>}<NEW_LINE>final Path metadataFile = new Path(metadataParent, CryptoDirectoryV7Provider.DIRECTORY_METADATAFILE, EnumSet.of(Path.Type.file, Path.Type.encrypted));<NEW_LINE>return new ContentReader(session).read(metadataFile);<NEW_LINE>} catch (NotfoundException e) {<NEW_LINE>log.warn(String.format("Missing directory ID for folder %s", directory));<NEW_LINE>return random.random();<NEW_LINE>}<NEW_LINE>}
String cleartextName = directory.getName();
1,750,455
public okhttp3.Call fakeOuterCompositeSerializeCall(OuterComposite body, final ApiCallback _callback) throws ApiException {<NEW_LINE>String basePath = null;<NEW_LINE>// Operation Servers<NEW_LINE>String[] localBasePaths = new String[] {};<NEW_LINE>// Determine Base Path to Use<NEW_LINE>if (localCustomBaseUrl != null) {<NEW_LINE>basePath = localCustomBaseUrl;<NEW_LINE>} else if (localBasePaths.length > 0) {<NEW_LINE>basePath = localBasePaths[localHostIndex];<NEW_LINE>} else {<NEW_LINE>basePath = null;<NEW_LINE>}<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/fake/outer/composite";<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 <MASK><NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "*/*" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>if (localVarContentType != null) {<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
HashMap<String, String>();
46,738
public void run(RegressionEnvironment env) {<NEW_LINE>String text = "module test.test1;\n" + "create schema MyTypeOne(col1 string, col2 int);" + "create window MyWindowOne#keepall as select * from MyTypeOne;" + "insert into MyWindowOne select * from MyTypeOne;";<NEW_LINE>env.compileDeploy(text).undeployAll();<NEW_LINE>env.compileDeploy(text).undeployAll();<NEW_LINE>text = "module test.test1;\n" + "create schema MyTypeOne(col1 string, col2 int, col3 long);" + "create window MyWindowOne#keepall as select * from MyTypeOne;" + "insert into MyWindowOne select * from MyTypeOne;";<NEW_LINE>env.<MASK><NEW_LINE>assertEquals(0, SupportFilterServiceHelper.getFilterSvcCountApprox(env));<NEW_LINE>// test on-merge<NEW_LINE>String moduleString = "@Name('S0') create window MyWindow#unique(intPrimitive) as SupportBean;\n" + "@Name('S1') on MyWindow insert into SecondStream select *;\n" + "@Name('S2') on SecondStream merge MyWindow when matched then insert into ThirdStream select * then delete\n";<NEW_LINE>EPCompiled compiled = env.compile(moduleString);<NEW_LINE>env.deploy(compiled).undeployAll().deploy(compiled).undeployAll();<NEW_LINE>// test table<NEW_LINE>String moduleTableOne = "create table MyTable(c0 string, c1 string)";<NEW_LINE>env.compileDeploy(moduleTableOne).undeployAll();<NEW_LINE>String moduleTableTwo = "create table MyTable(c0 string, c1 string, c2 string)";<NEW_LINE>env.compileDeploy(moduleTableTwo).undeployAll();<NEW_LINE>}
compileDeploy(text).undeployAll();
1,036,672
final GetInvitationsCountResult executeGetInvitationsCount(GetInvitationsCountRequest getInvitationsCountRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getInvitationsCountRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetInvitationsCountRequest> request = null;<NEW_LINE>Response<GetInvitationsCountResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetInvitationsCountRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getInvitationsCountRequest));<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, "Macie2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetInvitationsCount");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetInvitationsCountResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetInvitationsCountResultJsonUnmarshaller());<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);
7,848
public void onCreate(Bundle savedInstanceState) {<NEW_LINE>SharedPreferences themePrefs = getSharedPreferences("THEME", 0);<NEW_LINE>Boolean isDark = themePrefs.getBoolean("isDark", false);<NEW_LINE>if (isDark)<NEW_LINE>setTheme(R.style.DarkTheme);<NEW_LINE>else<NEW_LINE>setTheme(R.style.AppTheme);<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>mStartButton = (FloatingActionButton) findViewById(R.id.inspectToggleButton);<NEW_LINE>mActivity = (ProgressBar) findViewById(R.id.inspectActivity);<NEW_LINE>TextView mDeviceName = (TextView) findViewById(R.id.deviceName);<NEW_LINE>mDeviceType = (TextView) findViewById(R.id.deviceType);<NEW_LINE>mDeviceOS = (TextView) findViewById(R.id.deviceOS);<NEW_LINE>mDeviceServices = (TextView) findViewById(R.id.deviceServices);<NEW_LINE>mFocusedScan = System.getCurrentTarget().hasOpenPorts();<NEW_LINE>mDeviceName.setText(System.getCurrentTarget().toString());<NEW_LINE>if (System.getCurrentTarget().getDeviceType() != null)<NEW_LINE>mDeviceType.setText(System.<MASK><NEW_LINE>if (System.getCurrentTarget().getDeviceOS() != null)<NEW_LINE>mDeviceOS.setText(System.getCurrentTarget().getDeviceOS());<NEW_LINE>empty = getText(R.string.unknown).toString();<NEW_LINE>// yep, we're on main thread here<NEW_LINE>write_services();<NEW_LINE>mStartButton.setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>if (mRunning) {<NEW_LINE>setStoppedState();<NEW_LINE>} else {<NEW_LINE>setStartedState();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mReceiver = new Receiver(System.getCurrentTarget());<NEW_LINE>}
getCurrentTarget().getDeviceType());
1,390,437
public void toHashTree(HashTree tree, List<MsTestElement> hashTree, MsParameter msParameter) {<NEW_LINE>ParameterConfig config = (ParameterConfig) msParameter;<NEW_LINE>final HashTree groupTree = tree.add(getThreadGroup());<NEW_LINE>if ((config != null && config.isEnableCookieShare()) || enableCookieShare) {<NEW_LINE>CookieManager cookieManager = new CookieManager();<NEW_LINE>cookieManager.setProperty(TestElement.TEST_CLASS, CookieManager.class.getName());<NEW_LINE>cookieManager.setProperty(TestElement.GUI_CLASS<MASK><NEW_LINE>cookieManager.setEnabled(true);<NEW_LINE>cookieManager.setName("CookieManager");<NEW_LINE>cookieManager.setClearEachIteration(false);<NEW_LINE>cookieManager.setControlledByThread(false);<NEW_LINE>groupTree.add(cookieManager);<NEW_LINE>}<NEW_LINE>if (CollectionUtils.isNotEmpty(hashTree)) {<NEW_LINE>for (MsTestElement el : hashTree) {<NEW_LINE>el.toHashTree(groupTree, el.getHashTree(), config);<NEW_LINE>}<NEW_LINE>if (!config.isOperating()) {<NEW_LINE>MsDebugSampler el = new MsDebugSampler();<NEW_LINE>el.setName(RunningParamKeys.RUNNING_DEBUG_SAMPLER_NAME);<NEW_LINE>el.toHashTree(groupTree, el.getHashTree(), config);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, SaveService.aliasToClass("CookiePanel"));
246,594
public InputIdentifier unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InputIdentifier inputIdentifier = new InputIdentifier();<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("iotEventsInputIdentifier", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inputIdentifier.setIotEventsInputIdentifier(IotEventsInputIdentifierJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("iotSiteWiseInputIdentifier", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inputIdentifier.setIotSiteWiseInputIdentifier(IotSiteWiseInputIdentifierJsonUnmarshaller.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 inputIdentifier;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,640,557
public MappeableContainer xor(MappeableBitmapContainer value2) {<NEW_LINE>int newCardinality = 0;<NEW_LINE>if (BufferUtil.isBackedBySimpleArray(this.bitmap) && BufferUtil.isBackedBySimpleArray(value2.bitmap)) {<NEW_LINE>long[] b = this.bitmap.array();<NEW_LINE>long[] v2 = value2.bitmap.array();<NEW_LINE>int len = this.bitmap.limit();<NEW_LINE>for (int k = 0; k < len; ++k) {<NEW_LINE>newCardinality += Long.bitCount(b[k] ^ v2[k]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int len = this.bitmap.limit();<NEW_LINE>for (int k = 0; k < len; ++k) {<NEW_LINE>newCardinality += Long.bitCount(this.bitmap.get(k) ^ value2.bitmap.get(k));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newCardinality > MappeableArrayContainer.DEFAULT_MAX_SIZE) {<NEW_LINE>final MappeableBitmapContainer answer = new MappeableBitmapContainer();<NEW_LINE>long[] bitArray <MASK><NEW_LINE>if (BufferUtil.isBackedBySimpleArray(this.bitmap) && BufferUtil.isBackedBySimpleArray(value2.bitmap)) {<NEW_LINE>long[] b = this.bitmap.array();<NEW_LINE>long[] v2 = value2.bitmap.array();<NEW_LINE>int len = answer.bitmap.limit();<NEW_LINE>for (int k = 0; k < len; ++k) {<NEW_LINE>bitArray[k] = b[k] ^ v2[k];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int len = answer.bitmap.limit();<NEW_LINE>for (int k = 0; k < len; ++k) {<NEW_LINE>bitArray[k] = this.bitmap.get(k) ^ value2.bitmap.get(k);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>answer.cardinality = newCardinality;<NEW_LINE>return answer;<NEW_LINE>}<NEW_LINE>final MappeableArrayContainer ac = new MappeableArrayContainer(newCardinality);<NEW_LINE>BufferUtil.fillArrayXOR(ac.content.array(), this.bitmap, value2.bitmap);<NEW_LINE>ac.cardinality = newCardinality;<NEW_LINE>return ac;<NEW_LINE>}
= answer.bitmap.array();
1,062,868
public void run() {<NEW_LINE>if (mLocatorTask.getLoadStatus() == LoadStatus.LOADED) {<NEW_LINE>// Call geocodeAsync passing in an address<NEW_LINE>final ListenableFuture<List<GeocodeResult>> geocodeResultListenableFuture = mLocatorTask.geocodeAsync(address, mAddressGeocodeParameters);<NEW_LINE>geocodeResultListenableFuture.addDoneListener(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>// Get the results of the async operation<NEW_LINE>List<GeocodeResult> geocodeResults = geocodeResultListenableFuture.get();<NEW_LINE>if (geocodeResults.size() > 0) {<NEW_LINE>displaySearchResult(geocodeResults.get(0));<NEW_LINE>} else {<NEW_LINE>Toast.makeText(getApplicationContext(), getString(R.string.location_not_found) + address, Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>} catch (InterruptedException | ExecutionException e) {<NEW_LINE>Log.e(TAG, "Geocode error: " + e.getMessage());<NEW_LINE>Toast.makeText(getApplicationContext(), getString(R.string.geo_locate_error), Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>mLocatorTask.retryLoadAsync();<NEW_LINE>}<NEW_LINE>}
Log.i(TAG, "Trying to reload locator task");
873,561
public Mono<Void> filter(@NonNull final ServerWebExchange exchange, @NonNull final WebFilterChain chain) {<NEW_LINE>MediaType mediaType = exchange.getRequest().getHeaders().getContentType();<NEW_LINE>if (MediaType.MULTIPART_FORM_DATA.isCompatibleWith(mediaType)) {<NEW_LINE>ServerRequest serverRequest = ServerRequest.create(exchange, messageReaders);<NEW_LINE>return serverRequest.bodyToMono(DataBuffer.class).flatMap(size -> {<NEW_LINE>if (size.capacity() > BYTES_PER_MB * fileMaxSize) {<NEW_LINE>ServerHttpResponse response = exchange.getResponse();<NEW_LINE>response.setStatusCode(HttpStatus.BAD_REQUEST);<NEW_LINE>Object error = ShenyuResultWrap.error(exchange, ShenyuResultEnum.PAYLOAD_TOO_LARGE);<NEW_LINE>return WebFluxResultUtils.result(exchange, error);<NEW_LINE>}<NEW_LINE>BodyInserter<Mono<DataBuffer>, ReactiveHttpOutputMessage> bodyInsert = BodyInserters.fromPublisher(Mono.just(size), DataBuffer.class);<NEW_LINE>HttpHeaders headers = new HttpHeaders();<NEW_LINE>headers.putAll(exchange.getRequest().getHeaders());<NEW_LINE><MASK><NEW_LINE>CachedBodyOutputMessage outputMessage = new CachedBodyOutputMessage(exchange, headers);<NEW_LINE>return bodyInsert.insert(outputMessage, new BodyInserterContext()).then(Mono.defer(() -> {<NEW_LINE>ServerHttpRequest decorator = decorate(exchange, outputMessage);<NEW_LINE>return chain.filter(exchange.mutate().request(decorator).build());<NEW_LINE>}));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return chain.filter(exchange);<NEW_LINE>}
headers.remove(HttpHeaders.CONTENT_LENGTH);
1,012,766
private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String namespaceName, String queueName, 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 (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (namespaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (queueName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter queueName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, namespaceName, queueName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
36,216
final AssociateRepositoryResult executeAssociateRepository(AssociateRepositoryRequest associateRepositoryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateRepositoryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateRepositoryRequest> request = null;<NEW_LINE>Response<AssociateRepositoryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateRepositoryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(associateRepositoryRequest));<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, "CodeGuru Reviewer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateRepository");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssociateRepositoryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>}
false), new AssociateRepositoryResultJsonUnmarshaller());
1,489,810
void process(Content dataSource, DataSourceIngestModuleProgress progressBar) {<NEW_LINE>this.dataSource = dataSource;<NEW_LINE>progressBar.progress(Bundle.ExtractZone_progress_Msg());<NEW_LINE>List<AbstractFile> zoneFiles = null;<NEW_LINE>try {<NEW_LINE>zoneFiles = currentCase.getServices().getFileManager().findFiles(dataSource, ZONE_IDENTIFIER_FILE);<NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE>addErrorMessage(Bundle.ExtractZone_process_errMsg_find());<NEW_LINE>// NON-NLS<NEW_LINE>LOG.log(Level.SEVERE, "Unable to find zone identifier files, exception thrown. ", ex);<NEW_LINE>}<NEW_LINE>if (zoneFiles == null || zoneFiles.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Set<Long> knownPathIDs = null;<NEW_LINE>try {<NEW_LINE>knownPathIDs = getPathIDsForType(TSK_WEB_DOWNLOAD);<NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE>addErrorMessage(Bundle.ExtractZone_process_errMsg());<NEW_LINE>// NON-NLS<NEW_LINE>LOG.log(Level.SEVERE, "Failed to build PathIDs List for TSK_WEB_DOWNLOAD", ex);<NEW_LINE>}<NEW_LINE>if (knownPathIDs == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Collection<BlackboardArtifact> associatedObjectArtifacts = new ArrayList<>();<NEW_LINE>Collection<BlackboardArtifact> downloadArtifacts = new ArrayList<>();<NEW_LINE>for (AbstractFile zoneFile : zoneFiles) {<NEW_LINE>if (context.dataSourceIngestIsCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>processZoneFile(<MASK><NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE>addErrorMessage(Bundle.ExtractZone_process_errMsg());<NEW_LINE>// NON-NLS<NEW_LINE>String message = String.format("Failed to process zone identifier file %s", zoneFile.getName());<NEW_LINE>LOG.log(Level.WARNING, message, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!context.dataSourceIngestIsCancelled()) {<NEW_LINE>postArtifacts(associatedObjectArtifacts);<NEW_LINE>postArtifacts(downloadArtifacts);<NEW_LINE>}<NEW_LINE>}
zoneFile, associatedObjectArtifacts, downloadArtifacts, knownPathIDs);
1,508,162
public char[][] read(IProgressMonitor monitor) {<NEW_LINE>// If there is currently a write in progress, return the contents that are about to be written to disk.<NEW_LINE>char[][] newContents;<NEW_LINE>synchronized (this.queueMutex) {<NEW_LINE>newContents = this.pendingWrite;<NEW_LINE>}<NEW_LINE>if (newContents != null) {<NEW_LINE>return newContents;<NEW_LINE>}<NEW_LINE>// Otherwise, read fresh contents from disk<NEW_LINE>try {<NEW_LINE>char[] savedIndexNames = org.eclipse.jdt.internal.compiler.util.Util.getFileCharContent(this.savedIndexNamesFile, null);<NEW_LINE>if (savedIndexNames.length > 0) {<NEW_LINE>char[][] names = CharOperation.splitOn('\n', savedIndexNames);<NEW_LINE>if (names.length > 1) {<NEW_LINE>// First line is DiskIndex signature + saved plugin working location (see writeSavedIndexNamesFile())<NEW_LINE>// $NON-NLS-1$<NEW_LINE>String savedSignature = DiskIndex.SIGNATURE + "+" <MASK><NEW_LINE>if (savedSignature.equals(new String(names[0])))<NEW_LINE>return names;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ignored) {<NEW_LINE>if (JobManager.VERBOSE)<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Util.verbose("Failed to read saved index file names");<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
+ this.javaPluginWorkingLocation.toOSString();
975,913
public void testSkipLastExecutionNoAutoPurge(PrintWriter out) throws Exception {<NEW_LINE>DBIncrementTask task = new DBIncrementTask("testSkipLastExecutionNoAutoPurge");<NEW_LINE>task.getExecutionProperties().put(AutoPurge.PROPERTY_NAME, AutoPurge.NEVER.toString());<NEW_LINE>Trigger trigger = new FixedRepeatTrigger(2, 30, 2);<NEW_LINE>TaskStatus<Integer> status = scheduler.schedule((Callable<Integer>) task, trigger);<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>throw new Exception("Task should not have done status " + done + " until it runs at least once.");<NEW_LINE>} catch (IllegalStateException x) {<NEW_LINE>}<NEW_LINE>status = pollForSkip(status.getTaskId());<NEW_LINE>if (!status.isDone())<NEW_LINE>throw new Exception("Task should be done after the final execution is skipped. " + status);<NEW_LINE>Date nextExecTime = status.getNextExecutionTime();<NEW_LINE>if (nextExecTime != null)<NEW_LINE>throw new Exception("No further executions should remain after final execution is skipped. " + status);<NEW_LINE>long delay = status.getDelay(TimeUnit.NANOSECONDS);<NEW_LINE>if (delay > 0)<NEW_LINE>throw new Exception("Delay must not be positive for completed task. " + status);<NEW_LINE>try {<NEW_LINE>Integer result = status.get();<NEW_LINE>throw new Exception("Task was not skipped. Instead: " + result);<NEW_LINE>} catch (SkippedException x) {<NEW_LINE>if (x.getCause() != null)<NEW_LINE>throw x;<NEW_LINE>}<NEW_LINE>if (status.cancel(true))<NEW_LINE>throw new Exception("Should not be able to cancel task that already skipped its final execution. " + status);<NEW_LINE>if (status.isCancelled())<NEW_LINE>throw new Exception("Task should not be canceled. " + status);<NEW_LINE>// Look for successfully completed task<NEW_LINE>String pattern = DBIncrementTask.class.getSimpleName() + "-testSkipLastExecutionNoAutoPurge";<NEW_LINE>List<TaskStatus<?>> successfulTasks = scheduler.findTaskStatus(pattern, '\\', TaskState.SUCCESSFUL, true, null, null);<NEW_LINE>if (successfulTasks.size() != 1 || successfulTasks.iterator().next().getTaskId() != status.getTaskId())<NEW_LINE>throw new Exception("Expecting task to show as SUCCESSFUL even though the final execution was skipped. Instead found: " + successfulTasks);<NEW_LINE>}
boolean done = status.isDone();
1,541,085
private void startServer(MonoSink<String> sink) {<NEW_LINE>server.createContext("/", ex -> {<NEW_LINE><MASK><NEW_LINE>rHeaders.set("Content-Type", "text/plain");<NEW_LINE>ex.sendResponseHeaders(200, 0);<NEW_LINE>if ("GET".equalsIgnoreCase(ex.getRequestMethod())) {<NEW_LINE>var params = splitQuery(ex.getRequestURI());<NEW_LINE>if (params.containsKey("code")) {<NEW_LINE>String responseMessage = "Authorization grant recieved. you can close this window";<NEW_LINE>writeResponse(ex, responseMessage);<NEW_LINE>sink.success(params.get("code"));<NEW_LINE>} else {<NEW_LINE>String error = params.get("error");<NEW_LINE>String errorMessage = error != null ? error : "No Errormessage provided";<NEW_LINE>String responseMessage = "No Authorization code received. Error: " + errorMessage;<NEW_LINE>writeResponse(ex, responseMessage);<NEW_LINE>sink.error(new IllegalStateException("No Code Received: " + errorMessage));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>server.start();<NEW_LINE>var port = server.getAddress().getPort();<NEW_LINE>log.info("Server started at http://localhost:" + port);<NEW_LINE>}
Headers rHeaders = ex.getResponseHeaders();
95,000
protected GraphQLOutputType toGraphQLUnion(String name, String description, AnnotatedType javaType, List<AnnotatedType> possibleJavaTypes, TypeMappingEnvironment env) {<NEW_LINE>BuildContext buildContext = env.buildContext;<NEW_LINE>OperationMapper operationMapper = env.operationMapper;<NEW_LINE>if (buildContext.typeCache.contains(name)) {<NEW_LINE>return new GraphQLTypeReference(name);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>GraphQLUnionType.Builder builder = newUnionType().name(name).description(description);<NEW_LINE>Set<String> seen = new HashSet<>(possibleJavaTypes.size());<NEW_LINE>possibleJavaTypes.forEach(possibleJavaType -> {<NEW_LINE>GraphQLNamedOutputType possibleType = (GraphQLNamedOutputType) operationMapper.toGraphQLType(possibleJavaType, env);<NEW_LINE>if (!seen.add(possibleType.getName())) {<NEW_LINE>throw new TypeMappingException("Duplicate possible type " + possibleType.getName() + " for union " + name);<NEW_LINE>}<NEW_LINE>if (possibleType instanceof GraphQLObjectType) {<NEW_LINE>builder.possibleType((GraphQLObjectType) possibleType);<NEW_LINE>} else if (possibleType instanceof GraphQLTypeReference) {<NEW_LINE>builder.possibleType((GraphQLTypeReference) possibleType);<NEW_LINE>} else {<NEW_LINE>throw new TypeMappingException(possibleType.getClass().getSimpleName() + " is not a valid GraphQL union member. Only object types can be unionized.");<NEW_LINE>}<NEW_LINE>buildContext.typeRegistry.registerCovariantType(name, possibleJavaType, possibleType);<NEW_LINE>});<NEW_LINE>builder.withDirective(Directives.mappedType(javaType));<NEW_LINE>buildContext.directiveBuilder.buildUnionTypeDirectives(javaType, buildContext.directiveBuilderParams()).forEach(directive -> builder.withDirective(operationMapper.toGraphQLDirective(directive, buildContext)));<NEW_LINE>builder.comparatorRegistry(buildContext.comparatorRegistry(javaType));<NEW_LINE>GraphQLUnionType union = builder.build();<NEW_LINE>buildContext.codeRegistry.typeResolver(union, buildContext.typeResolver);<NEW_LINE>return union;<NEW_LINE>}
buildContext.typeCache.register(name);
1,363,745
protected void storeConsumerMetadataTask(MetadataIdentifier consumerMetadataIdentifier, Map<String, String> serviceParameterMap) {<NEW_LINE>try {<NEW_LINE>if (logger.isInfoEnabled()) {<NEW_LINE>logger.info("store consumer metadata. Identifier : " + consumerMetadataIdentifier + "; definition: " + serviceParameterMap);<NEW_LINE>}<NEW_LINE>allMetadataReports.put(consumerMetadataIdentifier, serviceParameterMap);<NEW_LINE>failedReports.remove(consumerMetadataIdentifier);<NEW_LINE>Gson gson = new Gson();<NEW_LINE>String data = gson.toJson(serviceParameterMap);<NEW_LINE>doStoreConsumerMetadata(consumerMetadataIdentifier, data);<NEW_LINE>saveProperties(consumerMetadataIdentifier, data, true, !syncReport);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// retry again. If failed again, throw exception.<NEW_LINE>failedReports.put(consumerMetadataIdentifier, serviceParameterMap);<NEW_LINE>metadataReportRetry.startRetryTask();<NEW_LINE>logger.error("Failed to put consumer metadata " + consumerMetadataIdentifier + "; " + serviceParameterMap + ", cause: " + <MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
1,677,473
public Redirect remove(String key) {<NEW_LINE>Redirect r = null;<NEW_LINE>try {<NEW_LINE>r = getJdbcTemplate().queryForObject("SELECT str_group_id, int_type, str_destination_id, str_name, lng_creation_time " + "FROM redirect " + "WHERE pk_proc = ? " + "FOR UPDATE", new RowMapper<Redirect>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Redirect mapRow(ResultSet rs, int rowNum) throws SQLException {<NEW_LINE>return new Redirect(rs.getString("str_group_id"), RedirectType.forNumber(rs.getInt("int_type")), rs.getString("str_destination_id"), rs.getString("str_name"), rs.getLong("lng_creation_time"));<NEW_LINE>}<NEW_LINE>}, key);<NEW_LINE>} catch (EmptyResultDataAccessException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>getJdbcTemplate(<MASK><NEW_LINE>return r;<NEW_LINE>}
).update("DELETE FROM redirect WHERE pk_proc = ?", key);
1,338,442
public void run(RegressionEnvironment env) {<NEW_LINE>env.advanceTime(0);<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String contextExpr = "@public create context MyContext " + "initiated by @Now and pattern [every timer:interval(10)] terminated after 10 sec";<NEW_LINE>env.compileDeploy(contextExpr, path);<NEW_LINE>String[] fields = new String[] { "cnt" };<NEW_LINE>String streamExpr = "@name('s0') context MyContext " + "select count(*) as cnt from SupportBean output last when terminated";<NEW_LINE>env.compileDeploy(streamExpr, path).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.sendEventBean(new SupportBean("E2", 2));<NEW_LINE>env.milestone(0);<NEW_LINE>env.advanceTime(8000);<NEW_LINE>env.sendEventBean(new SupportBean("E3", 3));<NEW_LINE>env.milestone(1);<NEW_LINE>env.advanceTime(9999);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.advanceTime(10000);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 3L });<NEW_LINE>env.milestone(2);<NEW_LINE>env.sendEventBean(new SupportBean("E4", 4));<NEW_LINE>env.advanceTime(10100);<NEW_LINE>env.milestone(3);<NEW_LINE>env.sendEventBean(new SupportBean("E5", 5));<NEW_LINE>env.advanceTime(19999);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.advanceTime(20000);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 2L });<NEW_LINE>env.milestone(4);<NEW_LINE>env.advanceTime(30000);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 0L });<NEW_LINE>env.milestone(5);<NEW_LINE>env.sendEventBean(new SupportBean("E6", 6));<NEW_LINE>env.advanceTime(40000);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 1L });<NEW_LINE><MASK><NEW_LINE>env.undeployAll();<NEW_LINE>}
env.eplToModelCompileDeploy(streamExpr, path);
1,659,724
private static final void readConfig(InputStream in, PxAll all) throws IOException, JSONException {<NEW_LINE>String str = IOUtils.<MASK><NEW_LINE>JSONArray ja = new JSONArray(str);<NEW_LINE>for (int i = 0; i < ja.length(); i++) {<NEW_LINE>JSONObject jo = ja.getJSONObject(i);<NEW_LINE>if (jo == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String name = jo.getString("name");<NEW_LINE>if (TextUtils.isEmpty(name)) {<NEW_LINE>if (LOG) {<NEW_LINE>LogDebug.d(PLUGIN_TAG, "built-in plugins config: invalid item: name is empty, json=" + jo);<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>PluginInfo info = PluginInfo.buildFromBuiltInJson(jo);<NEW_LINE>if (!info.match()) {<NEW_LINE>if (LOG) {<NEW_LINE>LogDebug.e(PLUGIN_TAG, "built-in plugins config: mismatch item: " + info);<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (LOG) {<NEW_LINE>LogDebug.d(PLUGIN_TAG, "built-in plugins config: item: " + info);<NEW_LINE>}<NEW_LINE>if (LOG) {<NEW_LINE>Log.d(TAG_NO_PN, "add builtin plugin=" + info);<NEW_LINE>}<NEW_LINE>all.addBuiltin(info);<NEW_LINE>}<NEW_LINE>}
toString(in, Charsets.UTF_8);
318,305
public ActionAcceptance actionAcceptance(BalancingAction action, ClusterModel clusterModel) {<NEW_LINE>Broker sourceBroker = clusterModel.<MASK><NEW_LINE>Broker destinationBroker = clusterModel.broker(action.destinationBrokerId());<NEW_LINE>String sourceTopic = action.topic();<NEW_LINE>switch(action.balancingAction()) {<NEW_LINE>case INTER_BROKER_REPLICA_SWAP:<NEW_LINE>String destinationTopic = action.destinationTopic();<NEW_LINE>if (sourceTopic.equals(destinationTopic)) {<NEW_LINE>return ACCEPT;<NEW_LINE>}<NEW_LINE>// It is guaranteed that neither source nor destination brokers are excluded for replica moves.<NEW_LINE>boolean acceptSourceToDest = (isReplicaCountUnderBalanceUpperLimitAfterChange(sourceTopic, destinationBroker, ADD) && isReplicaCountAboveBalanceLowerLimitAfterChange(sourceTopic, sourceBroker, REMOVE));<NEW_LINE>return (acceptSourceToDest && isReplicaCountUnderBalanceUpperLimitAfterChange(destinationTopic, sourceBroker, ADD) && isReplicaCountAboveBalanceLowerLimitAfterChange(destinationTopic, destinationBroker, REMOVE)) ? ACCEPT : REPLICA_REJECT;<NEW_LINE>case LEADERSHIP_MOVEMENT:<NEW_LINE>return ACCEPT;<NEW_LINE>case INTER_BROKER_REPLICA_MOVEMENT:<NEW_LINE>return (isReplicaCountUnderBalanceUpperLimitAfterChange(sourceTopic, destinationBroker, ADD) && (isExcludedForReplicaMove(sourceBroker) || isReplicaCountAboveBalanceLowerLimitAfterChange(sourceTopic, sourceBroker, REMOVE))) ? ACCEPT : REPLICA_REJECT;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unsupported balancing action " + action.balancingAction() + " is provided.");<NEW_LINE>}<NEW_LINE>}
broker(action.sourceBrokerId());
1,029,212
public void plus(final Pair<String, AbstractVcs> pair) {<NEW_LINE>// does not support<NEW_LINE>if (pair.getSecond().getDiffProvider() == null)<NEW_LINE>return;<NEW_LINE>final <MASK><NEW_LINE>final AbstractVcs newVcs = pair.getSecond();<NEW_LINE>final VirtualFile root = getRootForPath(key);<NEW_LINE>if (root == null)<NEW_LINE>return;<NEW_LINE>final VcsRoot vcsRoot = new VcsRoot(newVcs, root);<NEW_LINE>synchronized (myLock) {<NEW_LINE>final Pair<VcsRoot, VcsRevisionNumber> value = myData.get(key);<NEW_LINE>if (value == null) {<NEW_LINE>final LazyRefreshingSelfQueue<String> queue = getQueue(vcsRoot);<NEW_LINE>myData.put(key, Pair.create(vcsRoot, NOT_LOADED));<NEW_LINE>queue.addRequest(key);<NEW_LINE>} else if (!value.getFirst().equals(vcsRoot)) {<NEW_LINE>switchVcs(value.getFirst(), vcsRoot, key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String key = pair.getFirst();
1,393,150
protected void encode(ChannelHandlerContext ctx, BaseModelRequest msg, ByteBuf out) {<NEW_LINE>if (msg instanceof ModelLoadModelRequest) {<NEW_LINE>out.writeByte('L');<NEW_LINE>ModelLoadModelRequest request = (ModelLoadModelRequest) msg;<NEW_LINE>byte[] buf = msg.getModelName().getBytes(StandardCharsets.UTF_8);<NEW_LINE>out.writeInt(buf.length);<NEW_LINE>out.writeBytes(buf);<NEW_LINE>buf = request.getModelPath().getBytes(StandardCharsets.UTF_8);<NEW_LINE>out.writeInt(buf.length);<NEW_LINE>out.writeBytes(buf);<NEW_LINE>int batchSize = request.getBatchSize();<NEW_LINE>if (batchSize <= 0) {<NEW_LINE>batchSize = 1;<NEW_LINE>}<NEW_LINE>out.writeInt(batchSize);<NEW_LINE>buf = request.getHandler().getBytes(StandardCharsets.UTF_8);<NEW_LINE><MASK><NEW_LINE>out.writeBytes(buf);<NEW_LINE>out.writeInt(request.getGpuId());<NEW_LINE>buf = request.getIoFileDescriptor().getBytes(StandardCharsets.UTF_8);<NEW_LINE>out.writeInt(buf.length);<NEW_LINE>out.writeBytes(buf);<NEW_LINE>} else if (msg instanceof ModelInferenceRequest) {<NEW_LINE>out.writeByte('I');<NEW_LINE>ModelInferenceRequest request = (ModelInferenceRequest) msg;<NEW_LINE>for (RequestInput input : request.getRequestBatch()) {<NEW_LINE>encodeRequest(input, out);<NEW_LINE>}<NEW_LINE>// End of List<NEW_LINE>out.writeInt(-1);<NEW_LINE>}<NEW_LINE>}
out.writeInt(buf.length);
543,367
// restoreEntity<NEW_LINE>@Override<NEW_LINE>public EntityDetail restoreEntity(String userId, String deletedEntityGUID) throws InvalidParameterException, RepositoryErrorException, EntityNotKnownException, EntityNotDeletedException, UserNotAuthorizedException {<NEW_LINE>final String methodName = "restoreEntity";<NEW_LINE>final String parameterName = "deletedEntityGUID";<NEW_LINE>super.manageInstanceParameterValidation(userId, deletedEntityGUID, parameterName, methodName);<NEW_LINE>EntityDetail entity;<NEW_LINE>try {<NEW_LINE>entity = graphStore.getEntityDetailFromStore(deletedEntityGUID);<NEW_LINE>repositoryValidator.validateEntityFromStore(repositoryName, deletedEntityGUID, entity, methodName);<NEW_LINE>repositoryValidator.validateEntityIsDeleted(repositoryName, entity, methodName);<NEW_LINE>} catch (EntityProxyOnlyException e) {<NEW_LINE>log.warn("{} entity wth GUID {} only a proxy", methodName, deletedEntityGUID);<NEW_LINE>throw new EntityNotKnownException(OMRSErrorCode.ENTITY_NOT_KNOWN.getMessageDefinition(deletedEntityGUID, methodName, repositoryName), this.getClass().getName(), methodName, e);<NEW_LINE>}<NEW_LINE>EntityDetail restoredEntity = new EntityDetail(entity);<NEW_LINE>restoredEntity.setStatus(entity.getStatusOnDelete());<NEW_LINE>restoredEntity.setStatusOnDelete(null);<NEW_LINE>restoredEntity = repositoryHelper.<MASK><NEW_LINE>graphStore.updateEntityInStore(restoredEntity);<NEW_LINE>return restoredEntity;<NEW_LINE>}
incrementVersion(userId, entity, restoredEntity);
1,400,083
public Stream<VirtualGraph> fromCypher(@Name("kernelTransaction") String statement, @Name("params") Map<String, Object> params, @Name("name") String name, @Name("properties") Map<String, Object> properties) {<NEW_LINE>params = params == null ? Collections.emptyMap() : params;<NEW_LINE>Set<Node> nodes = new HashSet<>(1000);<NEW_LINE>Set<Relationship> rels = new HashSet<>(1000);<NEW_LINE>Map<String, Object> props <MASK><NEW_LINE>tx.execute(Cypher.withParamMapping(statement, params.keySet()), params).stream().forEach(row -> {<NEW_LINE>row.forEach((k, v) -> {<NEW_LINE>if (!extract(v, nodes, rels)) {<NEW_LINE>props.put(k, v);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>return Stream.of(new VirtualGraph(name, nodes, rels, props));<NEW_LINE>}
= new HashMap<>(properties);
469,652
public DescribeUserPoolResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeUserPoolResult describeUserPoolResult = new DescribeUserPoolResult();<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 describeUserPoolResult;<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("UserPool", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeUserPoolResult.setUserPool(UserPoolTypeJsonUnmarshaller.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 describeUserPoolResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
223,039
static void write(Manifest manifest, OutputStream out) throws IOException {<NEW_LINE>CharsetEncoder encoder = StandardCharsets.UTF_8.newEncoder();<NEW_LINE>ByteBuffer buffer = ByteBuffer.allocate(LINE_LENGTH_LIMIT);<NEW_LINE>Attributes.Name versionName = Attributes.Name.MANIFEST_VERSION;<NEW_LINE>String version = manifest.mainAttributes.getValue(versionName);<NEW_LINE>if (version == null) {<NEW_LINE>versionName = Attributes.Name.SIGNATURE_VERSION;<NEW_LINE>version = manifest.mainAttributes.getValue(versionName);<NEW_LINE>}<NEW_LINE>if (version != null) {<NEW_LINE>writeEntry(out, <MASK><NEW_LINE>Iterator<?> entries = manifest.mainAttributes.keySet().iterator();<NEW_LINE>while (entries.hasNext()) {<NEW_LINE>Attributes.Name name = (Attributes.Name) entries.next();<NEW_LINE>if (!name.equals(versionName)) {<NEW_LINE>writeEntry(out, name, manifest.mainAttributes.getValue(name), encoder, buffer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.write(LINE_SEPARATOR);<NEW_LINE>Iterator<String> i = manifest.getEntries().keySet().iterator();<NEW_LINE>while (i.hasNext()) {<NEW_LINE>String key = i.next();<NEW_LINE>writeEntry(out, Attributes.Name.NAME, key, encoder, buffer);<NEW_LINE>Attributes attributes = manifest.entries.get(key);<NEW_LINE>Iterator<?> entries = attributes.keySet().iterator();<NEW_LINE>while (entries.hasNext()) {<NEW_LINE>Attributes.Name name = (Attributes.Name) entries.next();<NEW_LINE>writeEntry(out, name, attributes.getValue(name), encoder, buffer);<NEW_LINE>}<NEW_LINE>out.write(LINE_SEPARATOR);<NEW_LINE>}<NEW_LINE>}
versionName, version, encoder, buffer);
725,565
public byte[] toMessageOrchid(boolean isSecure) {<NEW_LINE>Uint24 lvalue = this.valueLength;<NEW_LINE>int lshared = this.sharedPath.length();<NEW_LINE>int lencoded = PathEncoder.calculateEncodedLength(lshared);<NEW_LINE>boolean hasLongVal = this.hasLongValue();<NEW_LINE>Optional<Keccak256> leftHashOpt = this.left.getHashOrchid(isSecure);<NEW_LINE>Optional<Keccak256> rightHashOpt = this.right.getHashOrchid(isSecure);<NEW_LINE>int nnodes = 0;<NEW_LINE>int bits = 0;<NEW_LINE>if (leftHashOpt.isPresent()) {<NEW_LINE>bits |= 0b01;<NEW_LINE>nnodes++;<NEW_LINE>}<NEW_LINE>if (rightHashOpt.isPresent()) {<NEW_LINE>bits |= 0b10;<NEW_LINE>nnodes++;<NEW_LINE>}<NEW_LINE>ByteBuffer buffer = ByteBuffer.allocate(MESSAGE_HEADER_LENGTH + (lshared > 0 ? lencoded : 0) + nnodes * Keccak256Helper.DEFAULT_SIZE_BYTES + (hasLongVal ? Keccak256Helper.DEFAULT_SIZE_BYTES : lvalue.intValue()));<NEW_LINE>buffer<MASK><NEW_LINE>byte flags = 0;<NEW_LINE>if (isSecure) {<NEW_LINE>flags |= 1;<NEW_LINE>}<NEW_LINE>if (hasLongVal) {<NEW_LINE>flags |= 2;<NEW_LINE>}<NEW_LINE>buffer.put(flags);<NEW_LINE>buffer.putShort((short) bits);<NEW_LINE>buffer.putShort((short) lshared);<NEW_LINE>if (lshared > 0) {<NEW_LINE>buffer.put(this.sharedPath.encode());<NEW_LINE>}<NEW_LINE>leftHashOpt.ifPresent(h -> buffer.put(h.getBytes()));<NEW_LINE>rightHashOpt.ifPresent(h -> buffer.put(h.getBytes()));<NEW_LINE>if (lvalue.compareTo(Uint24.ZERO) > 0) {<NEW_LINE>if (hasLongVal) {<NEW_LINE>buffer.put(this.getValueHash().getBytes());<NEW_LINE>} else {<NEW_LINE>buffer.put(this.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buffer.array();<NEW_LINE>}
.put((byte) ARITY);
1,567,359
public static void main(String[] args) {<NEW_LINE>CreateFiducialSquareBinary generator = new CreateFiducialSquareBinary();<NEW_LINE>CmdLineParser parser = new CmdLineParser(generator);<NEW_LINE>if (args.length == 0) {<NEW_LINE>generator.printHelp(parser);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>parser.parseArgument(args);<NEW_LINE>if (generator.guiMode) {<NEW_LINE>BoofSwingUtil.invokeNowOrLater(CreateFiducialSquareBinaryGui::new);<NEW_LINE>} else {<NEW_LINE>if (generator.numbers == null) {<NEW_LINE><MASK><NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>generator.finishParsing();<NEW_LINE>generator.run();<NEW_LINE>}<NEW_LINE>} catch (CmdLineException e) {<NEW_LINE>// handling of wrong arguments<NEW_LINE>generator.printHelp(parser);<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
System.err.println("Must specify at least one number");
1,683,114
public static void doPartitionTableCutOver(final String schemaName, final String sourceTableName, final String targetTableName, final TableInfoManager tableInfoManager, final GsiMetaManager.TableType primaryTableType) {<NEW_LINE>String random = UUID.randomUUID().toString();<NEW_LINE>List<TablePartitionRecord> sourceTablePartition = tableInfoManager.queryTablePartitions(schemaName, sourceTableName, false);<NEW_LINE>if (sourceTablePartition == null || sourceTablePartition.isEmpty()) {<NEW_LINE>String msgContent = String.format("Table '%s.%s' doesn't exist", schemaName, sourceTableName);<NEW_LINE>throw new TddlNestableRuntimeException(msgContent);<NEW_LINE>}<NEW_LINE>List<TablePartitionRecord> targetTablePartition = tableInfoManager.queryTablePartitions(schemaName, targetTableName, false);<NEW_LINE>if (targetTablePartition == null || targetTablePartition.isEmpty()) {<NEW_LINE>String msgContent = String.format("Table '%s.%s' doesn't exist", schemaName, targetTableName);<NEW_LINE>throw new TddlNestableRuntimeException(msgContent);<NEW_LINE>}<NEW_LINE>long newVersion = Math.max(sourceTablePartition.get(0).metaVersion, targetTablePartition.get(0).metaVersion) + 1;<NEW_LINE>tableInfoManager.alterTablePartitionsCurOver(schemaName, sourceTableName, random, PartitionTableType.GSI_TABLE.getTableTypeIntValue());<NEW_LINE>switch(primaryTableType) {<NEW_LINE>case SINGLE:<NEW_LINE>tableInfoManager.alterTablePartitionsCurOver(schemaName, targetTableName, sourceTableName, <MASK><NEW_LINE>break;<NEW_LINE>case BROADCAST:<NEW_LINE>tableInfoManager.alterTablePartitionsCurOver(schemaName, targetTableName, sourceTableName, PartitionTableType.BROADCAST_TABLE.getTableTypeIntValue());<NEW_LINE>break;<NEW_LINE>case GSI:<NEW_LINE>tableInfoManager.alterTablePartitionsCurOver(schemaName, targetTableName, sourceTableName, PartitionTableType.GSI_TABLE.getTableTypeIntValue());<NEW_LINE>break;<NEW_LINE>case SHARDING:<NEW_LINE>tableInfoManager.alterTablePartitionsCurOver(schemaName, targetTableName, sourceTableName, PartitionTableType.PARTITION_TABLE.getTableTypeIntValue());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new TddlNestableRuntimeException("unknown primary table type");<NEW_LINE>}<NEW_LINE>tableInfoManager.alterTablePartitionsCurOver(schemaName, random, targetTableName, PartitionTableType.GSI_TABLE.getTableTypeIntValue());<NEW_LINE>tableInfoManager.updateTablePartitionsVersion(schemaName, sourceTableName, newVersion);<NEW_LINE>tableInfoManager.updateTablePartitionsVersion(schemaName, targetTableName, newVersion);<NEW_LINE>}
PartitionTableType.SINGLE_TABLE.getTableTypeIntValue());
1,783,697
public void apply(Element element, boolean sortable) {<NEW_LINE>String horizontalScroll = element.attributeValue("horizontalScroll");<NEW_LINE>if (!StringUtils.isBlank(horizontalScroll)) {<NEW_LINE>table.setHorizontalScrollEnabled(Boolean.valueOf(horizontalScroll));<NEW_LINE>}<NEW_LINE>loadFontPreferences(element);<NEW_LINE>final Element columnsElem = element.element("columns");<NEW_LINE>if (columnsElem == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Collection<String> modelIds = new LinkedList<>();<NEW_LINE>for (TableColumn modelColumn : table.getColumns(true)) {<NEW_LINE>modelIds.add(String.valueOf(modelColumn.getIdentifier()));<NEW_LINE>}<NEW_LINE>Collection<String> <MASK><NEW_LINE>for (Element colElem : Dom4j.elements(columnsElem, "column")) {<NEW_LINE>String id = colElem.attributeValue("id");<NEW_LINE>loadedIds.add(id);<NEW_LINE>}<NEW_LINE>Configuration configuration = AppBeans.get(Configuration.NAME);<NEW_LINE>ClientConfig clientConfig = configuration.getConfig(ClientConfig.class);<NEW_LINE>if (clientConfig.getLoadObsoleteSettingsForTable() || CollectionUtils.isEqualCollection(modelIds, loadedIds)) {<NEW_LINE>applyColumnSettings(element, sortable);<NEW_LINE>}<NEW_LINE>}
loadedIds = new LinkedList<>();
1,165,149
public Void visitInheritDoc(InheritDocTree inheritDocTree, Void unused) {<NEW_LINE>new SimpleTreeVisitor<Void, Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void visitVariable(VariableTree variableTree, Void unused) {<NEW_LINE>state.reportMatch(buildDescription(diagnosticPosition(getCurrentPath(), state)).setMessage("@inheritDoc doesn't make sense on variables as " + "they cannot override a super element.").build());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void visitMethod(MethodTree methodTree, Void unused) {<NEW_LINE>MethodSymbol methodSymbol = getSymbol(methodTree);<NEW_LINE>if (methodSymbol != null && findSuperMethods(methodSymbol, state.getTypes()).isEmpty()) {<NEW_LINE>state.reportMatch(buildDescription(diagnosticPosition(getCurrentPath(), state)).setMessage("This method does not override anything to inherit documentation from.").build());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void visitClass(ClassTree classTree, Void unused) {<NEW_LINE>if (classTree.getExtendsClause() == null && classTree.getImplementsClause().isEmpty()) {<NEW_LINE>state.reportMatch(buildDescription(diagnosticPosition(getCurrentPath(), state)).setMessage("This class does not extend or implement anything to inherit " + "documentation from.").build());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}.visit(getCurrentPath().getTreePath(<MASK><NEW_LINE>return super.visitInheritDoc(inheritDocTree, null);<NEW_LINE>}
).getLeaf(), null);
666,933
public static Image respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {<NEW_LINE>final Switchboard sb = (Switchboard) env;<NEW_LINE>final MultiProtocolURL referer = header.referer();<NEW_LINE>// harvest request information<NEW_LINE>StringBuilder connect = new StringBuilder();<NEW_LINE>connect.append('{');<NEW_LINE>appendJSON(connect, "time", GenericFormatter.SHORT_MILSEC_FORMATTER.format());<NEW_LINE>appendJSON(connect, "trail", (referer == null) ? "" : referer.toNormalform(false));<NEW_LINE>appendJSON(connect, "nick", (post == null) ? "" : post.get("nick", ""));<NEW_LINE>appendJSON(connect, "tag", (post == null) ? "" : post.get("tag", ""));<NEW_LINE>appendJSON(connect, "icon", (post == null) ? "" : post.get("icon", ""));<NEW_LINE>final String ip = header.getRemoteAddr();<NEW_LINE>appendJSON(connect, "ip", (ip == null) ? "" : ip);<NEW_LINE>appendJSON(connect, "agent", header<MASK><NEW_LINE>connect.append('}');<NEW_LINE>if (sb.trail.size() >= 100)<NEW_LINE>sb.trail.remove();<NEW_LINE>sb.trail.add(connect.toString());<NEW_LINE>// Log.logInfo("CYTAG", "catched trail - " + connect.toString());<NEW_LINE>final String defaultimage;<NEW_LINE>if (post != null && post.get("icon", "").equals("invisible")) {<NEW_LINE>defaultimage = "invisible.png";<NEW_LINE>} else {<NEW_LINE>defaultimage = "redpillmini.png";<NEW_LINE>}<NEW_LINE>final File iconfile = new File(sb.getAppPath(), "/htroot/env/grafics/" + defaultimage);<NEW_LINE>byte[] imgb = null;<NEW_LINE>try {<NEW_LINE>imgb = FileUtils.read(iconfile);<NEW_LINE>} catch (final IOException e) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (imgb == null)<NEW_LINE>return null;<NEW_LINE>// read image<NEW_LINE>final Image image = ImageParser.parse("cytag.png", imgb);<NEW_LINE>return image;<NEW_LINE>}
.get("User-Agent", ""));
468,970
private Identity checkIdentity(Business business, PullResult result, Person person, Unit unit, User user) throws Exception {<NEW_LINE>EntityManagerContainer emc = business.entityManagerContainer();<NEW_LINE>EntityManager em = emc.get(Identity.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Identity> cq = cb.createQuery(Identity.class);<NEW_LINE>Root<Identity> root = cq.from(Identity.class);<NEW_LINE>Predicate p = cb.equal(root.get(Identity_.person), person.getId());<NEW_LINE>p = cb.and(p, cb.equal(root.get(Identity_.unit), unit.getId()));<NEW_LINE>List<Identity> os = em.createQuery(cq.select(root).where(p)).setMaxResults(1).getResultList();<NEW_LINE>Identity identity = null;<NEW_LINE>Long order = null;<NEW_LINE>if (StringUtils.isNotEmpty(user.getOrderInDepts())) {<NEW_LINE>Map<Long, Long> map = new HashMap<Long, Long>();<NEW_LINE>map = XGsonBuilder.instance().fromJson(user.getOrderInDepts(), map.getClass());<NEW_LINE>for (Entry<Long, Long> en : map.entrySet()) {<NEW_LINE>if (Objects.equals(Long.parseLong(unit.getDingdingId()), en.getKey())) {<NEW_LINE>order = en.getValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (os.size() == 0) {<NEW_LINE>identity = this.createIdentity(business, result, person, unit, user, order);<NEW_LINE>} else {<NEW_LINE>identity = os.get(0);<NEW_LINE>identity = this.updateIdentity(business, result, <MASK><NEW_LINE>}<NEW_LINE>return identity;<NEW_LINE>}
unit, identity, user, order);
564,770
public LogicalSubQueryPlan buildLogicalQueryPlan(ContextManager contextManager) {<NEW_LINE>TreeNodeLabelManager labelManager = contextManager.getTreeNodeLabelManager();<NEW_LINE>VertexIdManager vertexIdManager = contextManager.getVertexIdManager();<NEW_LINE>QueryFlowOuterClass.OperatorType operatorType = getUseKeyOperator(QueryFlowOuterClass.OperatorType.SUM);<NEW_LINE>LogicalSubQueryPlan logicalSubQueryPlan = new LogicalSubQueryPlan(contextManager);<NEW_LINE>LogicalVertex sourceVertex = getInputNode().getOutputVertex();<NEW_LINE>logicalSubQueryPlan.addLogicalVertex(sourceVertex);<NEW_LINE>ValueValueType valueValueType = ValueValueType.class.cast(getInputNode().getOutputValueType());<NEW_LINE>ProcessorFunction combinerSumFunction = new ProcessorFunction(QueryFlowOuterClass.OperatorType.COMBINER_SUM, Message.Value.newBuilder().setValueType(valueValueType.getDataType()));<NEW_LINE>LogicalVertex combinerSumVertex = new LogicalUnaryVertex(vertexIdManager.getId(), combinerSumFunction, isPropLocalFlag(), sourceVertex);<NEW_LINE>logicalSubQueryPlan.addLogicalVertex(combinerSumVertex);<NEW_LINE>logicalSubQueryPlan.addLogicalEdge(sourceVertex, combinerSumVertex, LogicalEdge.forwardEdge());<NEW_LINE>ProcessorFunction sumFunction = new ProcessorFunction(operatorType, Message.Value.newBuilder().setValueType(valueValueType.getDataType()));<NEW_LINE>LogicalVertex sumVertex = new LogicalUnaryVertex(vertexIdManager.getId(), sumFunction, isPropLocalFlag(), combinerSumVertex);<NEW_LINE>logicalSubQueryPlan.addLogicalVertex(sumVertex);<NEW_LINE>logicalSubQueryPlan.addLogicalEdge(combinerSumVertex<MASK><NEW_LINE>LogicalVertex outputVertex = processJoinZeroVertex(vertexIdManager, logicalSubQueryPlan, sumVertex, isJoinZeroFlag());<NEW_LINE>setFinishVertex(outputVertex, labelManager);<NEW_LINE>return logicalSubQueryPlan;<NEW_LINE>}
, sumVertex, new LogicalEdge());
185,879
public boolean sendMessage(String email, String subject, String text) {<NEW_LINE>if (email.isEmpty()) {<NEW_LINE>logger.info("Email is not sent because the address is empty");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Properties properties = System.getProperties();<NEW_LINE>properties.setProperty("mail.smtps.host", config.getMailSmtpHost());<NEW_LINE>properties.setProperty("mail.smtps.port", config.getMailSmtpPort());<NEW_LINE>properties.setProperty("mail.smtps.auth", "true");<NEW_LINE>properties.setProperty("mail.user", config.getMailUser());<NEW_LINE>properties.setProperty("mail.password", config.getMailPassword());<NEW_LINE>Session session = Session.getDefaultInstance(properties);<NEW_LINE>try {<NEW_LINE>MimeMessage message = new MimeMessage(session);<NEW_LINE>message.setFrom(new InternetAddress(config.getMailFromAddress()));<NEW_LINE>message.addRecipient(Message.RecipientType.TO, new InternetAddress(email));<NEW_LINE>message.setSubject(subject);<NEW_LINE>message.setText(text);<NEW_LINE>Transport trnsport = session.getTransport("smtps");<NEW_LINE>trnsport.connect(null<MASK><NEW_LINE>message.saveChanges();<NEW_LINE>trnsport.sendMessage(message, message.getAllRecipients());<NEW_LINE>trnsport.close();<NEW_LINE>return true;<NEW_LINE>} catch (MessagingException ex) {<NEW_LINE>logger.error("Error sending message to " + email, ex);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
, properties.getProperty("mail.password"));
155,959
public void parentImplotion(int PP_Product_BOMLine_ID) throws Exception {<NEW_LINE>int PP_Product_BOM_ID = 0;<NEW_LINE>int M_Product_ID = 0;<NEW_LINE>X_T_BOMLine tboml = new X_T_BOMLine(ctx, 0, null);<NEW_LINE>PP_Product_BOM_ID = DB.getSQLValue(null, "SELECT PP_Product_BOM_ID FROM PP_Product_BOMLine WHERE PP_Product_BOMLine_ID=?", PP_Product_BOMLine_ID);<NEW_LINE>if (PP_Product_BOM_ID < 0)<NEW_LINE>throw new Exception(CLogger.retrieveErrorString("Error: PrintBOM.parentImplotion()"));<NEW_LINE>M_Product_ID = DB.getSQLValue(null, "SELECT M_Product_ID FROM PP_Product_BOM WHERE PP_Product_BOM_ID=?", PP_Product_BOM_ID);<NEW_LINE>if (M_Product_ID < 0)<NEW_LINE>throw new Exception(CLogger.retrieveErrorString("Error: PrintBOM.parentImplotion()"));<NEW_LINE>tboml.setPP_Product_BOM_ID(PP_Product_BOM_ID);<NEW_LINE>tboml.setPP_Product_BOMLine_ID(PP_Product_BOMLine_ID);<NEW_LINE>tboml.setM_Product_ID(M_Product_ID);<NEW_LINE>tboml.setLevelNo(LevelNo);<NEW_LINE>tboml.setSel_Product_ID(p_M_Product_ID);<NEW_LINE>tboml.setImplosion(p_implosion);<NEW_LINE>if (LevelNo >= 11)<NEW_LINE>tboml.setLevels(levels + ">" + LevelNo);<NEW_LINE>else if (LevelNo >= 1)<NEW_LINE>tboml.setLevels(levels.substring(0, LevelNo) + LevelNo);<NEW_LINE>tboml.setSeqNo(SeqNo);<NEW_LINE>tboml.setAD_PInstance_ID(AD_PInstance_ID);<NEW_LINE>tboml.save();<NEW_LINE>PreparedStatement stmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>String sql = "SELECT PP_Product_BOM_ID, M_Product_ID FROM PP_Product_BOM " + "WHERE IsActive = 'Y' AND M_Product_ID = ? ";<NEW_LINE>try {<NEW_LINE>stmt = DB.<MASK><NEW_LINE>stmt.setInt(1, M_Product_ID);<NEW_LINE>rs = stmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>SeqNo += 1;<NEW_LINE>component(rs.getInt(2));<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, e.getLocalizedMessage() + sql, e);<NEW_LINE>throw new Exception("SQLException: " + e.getLocalizedMessage());<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, stmt);<NEW_LINE>rs = null;<NEW_LINE>stmt = null;<NEW_LINE>}<NEW_LINE>}
prepareStatement(sql, get_TrxName());
715,949
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>langDevModeCheckBox = new javax.swing.JCheckBox();<NEW_LINE>langDevModeDescriptionLabel = new javax.swing.JLabel();<NEW_LINE>// NOI18N<NEW_LINE>langDevModeCheckBox.setText(org.openide.util.NbBundle.getMessage(CategoryPanelTruffle.class, "CategoryPanelTruffle.langDevModeCheckBox.text"));<NEW_LINE>// NOI18N<NEW_LINE>langDevModeDescriptionLabel.setText(org.openide.util.NbBundle.getMessage(CategoryPanelTruffle.class, "CategoryPanelTruffle.langDevModeDescription.text"));<NEW_LINE>javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);<NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(langDevModeCheckBox, javax.swing.GroupLayout.DEFAULT_SIZE, 726, Short.MAX_VALUE).addGap(12, 12, 12)).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addGap(29, 29, 29).addComponent(langDevModeDescriptionLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE).addContainerGap()));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addComponent(langDevModeCheckBox).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(langDevModeDescriptionLabel).addContainerGap(<MASK><NEW_LINE>}
260, Short.MAX_VALUE)));
1,434,891
private JPanel createGraphColumnPane() {<NEW_LINE>JPanel colPanel = new JPanel();<NEW_LINE>colPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>JLabel label = new JLabel(JMeterUtils.getResString("aggregate_graph_columns_to_display"));<NEW_LINE>colPanel.add(label);<NEW_LINE>for (BarGraph bar : eltList) {<NEW_LINE>colPanel.add(bar.getChkBox());<NEW_LINE>colPanel.add(createColorBarButton(bar, eltList.indexOf(bar)));<NEW_LINE>}<NEW_LINE>colPanel.add(Box.createRigidArea(new Dimension(5, 0)));<NEW_LINE>JFactory.small(chooseForeColor);<NEW_LINE>colPanel.add(chooseForeColor);<NEW_LINE>chooseForeColor.addActionListener(this);<NEW_LINE>JPanel optionsPanel = new JPanel();<NEW_LINE>optionsPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));<NEW_LINE><MASK><NEW_LINE>optionsPanel.add(drawOutlinesBar);<NEW_LINE>optionsPanel.add(numberShowGrouping);<NEW_LINE>optionsPanel.add(valueLabelsVertical);<NEW_LINE>JPanel barPane = new JPanel(new BorderLayout());<NEW_LINE>barPane.add(colPanel, BorderLayout.NORTH);<NEW_LINE>barPane.add(Box.createRigidArea(new Dimension(0, 3)), BorderLayout.CENTER);<NEW_LINE>barPane.add(optionsPanel, BorderLayout.SOUTH);<NEW_LINE>JPanel columnPane = new JPanel(new BorderLayout());<NEW_LINE>columnPane.setBorder(// $NON-NLS-1$<NEW_LINE>BorderFactory.// $NON-NLS-1$<NEW_LINE>createTitledBorder(JMeterUtils.getResString("aggregate_graph_column_settings")));<NEW_LINE>columnPane.add(barPane, BorderLayout.NORTH);<NEW_LINE>columnPane.add(Box.createRigidArea(new Dimension(0, 3)), BorderLayout.CENTER);<NEW_LINE>columnPane.add(createGraphSelectionSubPane(), BorderLayout.SOUTH);<NEW_LINE>return columnPane;<NEW_LINE>}
optionsPanel.add(createGraphFontValuePane());
601,887
@POST<NEW_LINE>public Response add(User entity) throws StorageException {<NEW_LINE>if (!Context.getPermissionsManager().getUserAdmin(getUserId())) {<NEW_LINE>Context.getPermissionsManager().checkUserUpdate(getUserId(), new User(), entity);<NEW_LINE>if (Context.getPermissionsManager().getUserManager(getUserId())) {<NEW_LINE>Context.getPermissionsManager().checkUserLimit(getUserId());<NEW_LINE>} else {<NEW_LINE>Context.getPermissionsManager().checkRegistration(getUserId());<NEW_LINE>entity.setDeviceLimit(Context.getConfig().getInteger(Keys.USERS_DEFAULT_DEVICE_LIMIT));<NEW_LINE>int expirationDays = Context.getConfig().getInteger(Keys.USERS_DEFAULT_EXPIRATION_DAYS);<NEW_LINE>if (expirationDays > 0) {<NEW_LINE>entity.setExpirationTime(new Date(System.currentTimeMillis() + (long) expirationDays * 24 * 3600 * 1000));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Context.getUsersManager().addItem(entity);<NEW_LINE>LogAction.<MASK><NEW_LINE>if (Context.getPermissionsManager().getUserManager(getUserId())) {<NEW_LINE>Context.getDataManager().linkObject(User.class, getUserId(), ManagedUser.class, entity.getId(), true);<NEW_LINE>LogAction.link(getUserId(), User.class, getUserId(), ManagedUser.class, entity.getId());<NEW_LINE>}<NEW_LINE>Context.getUsersManager().refreshUserItems();<NEW_LINE>return Response.ok(entity).build();<NEW_LINE>}
create(getUserId(), entity);
6,048
public SuggestModel unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SuggestModel suggestModel = new SuggestModel();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("query", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>suggestModel.setQuery(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("found", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>suggestModel.setFound(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("suggestions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>suggestModel.setSuggestions(new ListUnmarshaller<SuggestionMatch>(SuggestionMatchJsonUnmarshaller.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 suggestModel;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
426,879
private List<ShipmentScheduleWithHU> createShipmentSchedulesWithHUForQtyToDeliver(@NonNull final I_M_ShipmentSchedule scheduleRecord, @Nullable final Quantity quantityToDeliverOverride, @NonNull final M_ShipmentSchedule_QuantityTypeToUse quantityTypeToUse, final boolean pickAccordingToPackingInstruction, @NonNull final IHUContext huContext) {<NEW_LINE>final IShipmentScheduleBL shipmentScheduleBL = Services.get(IShipmentScheduleBL.class);<NEW_LINE>final ArrayList<ShipmentScheduleWithHU> result = new ArrayList<>();<NEW_LINE>final Quantity qtyToDeliver = CoalesceUtil.coalesceSuppliers(() -> quantityToDeliverOverride, () <MASK><NEW_LINE>final boolean pickAvailableHUsOnTheFly = retrievePickAvailableHUsOntheFly(huContext);<NEW_LINE>if (pickAvailableHUsOnTheFly) {<NEW_LINE>final IProductBL productBL = Services.get(IProductBL.class);<NEW_LINE>if (productBL.isStocked(ProductId.ofRepoId(scheduleRecord.getM_Product_ID()))) {<NEW_LINE>result.addAll(pickHUsOnTheFly(scheduleRecord, qtyToDeliver, pickAccordingToPackingInstruction, huContext));<NEW_LINE>} else {<NEW_LINE>Loggables.withLogger(logger, Level.DEBUG).addLog("ProductId={} is not stocked; skip picking it on the fly", scheduleRecord.getM_Product_ID());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// find out if and what the pickHUsOnTheFly() method did for us<NEW_LINE>final Quantity allocatedQty = result.stream().map(ShipmentScheduleWithHU::getQtyPicked).reduce(qtyToDeliver.toZero(), Quantity::add);<NEW_LINE>Loggables.withLogger(logger, Level.DEBUG).addLog("QtyToDeliver={}; Qty picked on-the-fly from available HUs: {}", qtyToDeliver, allocatedQty);<NEW_LINE>final Quantity remainingQtyToAllocate = qtyToDeliver.subtract(allocatedQty);<NEW_LINE>if (remainingQtyToAllocate.signum() > 0) {<NEW_LINE>final boolean hasNoPickedHUs = result.isEmpty();<NEW_LINE>final Quantity catchQtyOverride = hasNoPickedHUs ? shipmentScheduleBL.getCatchQtyOverride(scheduleRecord).orElse(null) : null;<NEW_LINE>final ProductId productId = ProductId.ofRepoId(scheduleRecord.getM_Product_ID());<NEW_LINE>final StockQtyAndUOMQty stockQtyAndCatchQty = StockQtyAndUOMQty.builder().productId(productId).stockQty(remainingQtyToAllocate).uomQty(catchQtyOverride).build();<NEW_LINE>result.add(//<NEW_LINE>ShipmentScheduleWithHU.//<NEW_LINE>ofShipmentScheduleWithoutHu(huContext, scheduleRecord, stockQtyAndCatchQty, quantityTypeToUse));<NEW_LINE>}<NEW_LINE>return ImmutableList.copyOf(result);<NEW_LINE>}
-> shipmentScheduleBL.getQtyToDeliver(scheduleRecord));
1,497,891
public static QueryLoRaJoinPermissionsResponse unmarshall(QueryLoRaJoinPermissionsResponse queryLoRaJoinPermissionsResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryLoRaJoinPermissionsResponse.setRequestId(_ctx.stringValue("QueryLoRaJoinPermissionsResponse.RequestId"));<NEW_LINE>queryLoRaJoinPermissionsResponse.setSuccess(_ctx.booleanValue("QueryLoRaJoinPermissionsResponse.Success"));<NEW_LINE>queryLoRaJoinPermissionsResponse.setCode(_ctx.stringValue("QueryLoRaJoinPermissionsResponse.Code"));<NEW_LINE>queryLoRaJoinPermissionsResponse.setErrorMessage(_ctx.stringValue("QueryLoRaJoinPermissionsResponse.ErrorMessage"));<NEW_LINE>queryLoRaJoinPermissionsResponse.setProductKey(_ctx.stringValue("QueryLoRaJoinPermissionsResponse.ProductKey"));<NEW_LINE>List<JoinPermission> joinPermissions = new ArrayList<JoinPermission>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryLoRaJoinPermissionsResponse.JoinPermissions.Length"); i++) {<NEW_LINE>JoinPermission joinPermission = new JoinPermission();<NEW_LINE>joinPermission.setJoinPermissionId(_ctx.stringValue("QueryLoRaJoinPermissionsResponse.JoinPermissions[" + i + "].JoinPermissionId"));<NEW_LINE>joinPermission.setJoinPermissionName(_ctx.stringValue("QueryLoRaJoinPermissionsResponse.JoinPermissions[" + i + "].JoinPermissionName"));<NEW_LINE>joinPermission.setJoinPermissionType(_ctx.stringValue("QueryLoRaJoinPermissionsResponse.JoinPermissions[" + i + "].JoinPermissionType"));<NEW_LINE>joinPermission.setOwnerAliyunPk(_ctx.stringValue("QueryLoRaJoinPermissionsResponse.JoinPermissions[" + i + "].OwnerAliyunPk"));<NEW_LINE>joinPermission.setEnabled(_ctx.booleanValue("QueryLoRaJoinPermissionsResponse.JoinPermissions[" + i + "].Enabled"));<NEW_LINE>joinPermission.setClassMode(_ctx.stringValue<MASK><NEW_LINE>joinPermissions.add(joinPermission);<NEW_LINE>}<NEW_LINE>queryLoRaJoinPermissionsResponse.setJoinPermissions(joinPermissions);<NEW_LINE>return queryLoRaJoinPermissionsResponse;<NEW_LINE>}
("QueryLoRaJoinPermissionsResponse.JoinPermissions[" + i + "].ClassMode"));
546,598
private // Note that the keys stored in the BatchHolders are not moved around.<NEW_LINE>void resizeAndRehashIfNeeded() {<NEW_LINE>if (numEntries < threshold) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (EXTRA_DEBUG) {<NEW_LINE>logger.debug("Hash table numEntries = {}, threshold = {}; resizing the table...", numEntries, threshold);<NEW_LINE>}<NEW_LINE>// If the table size is already MAXIMUM_CAPACITY, don't resize<NEW_LINE>// the table, but set the threshold to Integer.MAX_VALUE such that<NEW_LINE>// future attempts to resize will return immediately.<NEW_LINE>if (tableSize == MAXIMUM_CAPACITY) {<NEW_LINE>threshold = Integer.MAX_VALUE;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int newTableSize = 2 * tableSize;<NEW_LINE>newTableSize = roundUpToPowerOf2(newTableSize);<NEW_LINE>// if not enough memory available to allocate the new hash-table, plus the new links and<NEW_LINE>// the new hash-values (to replace the existing ones - inside rehash() ), then OOM<NEW_LINE>if (4 * /* sizeof(int) */<NEW_LINE>(newTableSize + 2 * HashTable.BATCH_SIZE) >= allocator.getLimit() - allocator.getAllocatedMemory()) {<NEW_LINE>throw new OutOfMemoryException("Resize Hash Table");<NEW_LINE>}<NEW_LINE>tableSize = newTableSize;<NEW_LINE>if (tableSize > MAXIMUM_CAPACITY) {<NEW_LINE>tableSize = MAXIMUM_CAPACITY;<NEW_LINE>}<NEW_LINE>long t0 = System.currentTimeMillis();<NEW_LINE>// set the new threshold based on the new table size and load factor<NEW_LINE>threshold = (int) Math.ceil(tableSize * htConfig.getLoadFactor());<NEW_LINE>IntVector newStartIndices = allocMetadataVector(tableSize, EMPTY_SLOT);<NEW_LINE>for (int i = 0; i < batchHolders.size(); i++) {<NEW_LINE>BatchHolder bh = batchHolders.get(i);<NEW_LINE>int batchStartIdx = i * BATCH_SIZE;<NEW_LINE>bh.rehash(tableSize, newStartIndices, batchStartIdx);<NEW_LINE>}<NEW_LINE>startIndices.clear();<NEW_LINE>startIndices = newStartIndices;<NEW_LINE>if (EXTRA_DEBUG) {<NEW_LINE>logger.debug("After resizing and rehashing, dumping the hash table...");<NEW_LINE>logger.debug("Number of buckets = {}.", startIndices.getAccessor().getValueCount());<NEW_LINE>for (int i = 0; i < startIndices.getAccessor().getValueCount(); i++) {<NEW_LINE>logger.debug("Bucket: {}, startIdx[ {} ] = {}.", i, i, startIndices.getAccessor().get(i));<NEW_LINE>int startIdx = startIndices.getAccessor().get(i);<NEW_LINE>BatchHolder bh = batchHolders.get((startIdx <MASK><NEW_LINE>bh.dump(startIdx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>resizingTime += System.currentTimeMillis() - t0;<NEW_LINE>numResizing++;<NEW_LINE>}
>>> 16) & BATCH_MASK);
1,610,866
private OrderLineInputValidatorResults evaluateSalesPrescriptionPermission(@NonNull final BPartnerId bpartnerId, @NonNull final ProductId productId) {<NEW_LINE>final IMsgBL msgBL = Services.get(IMsgBL.class);<NEW_LINE>final OrderLineInputValidatorResultsBuilder resultBuilder = OrderLineInputValidatorResults.builder();<NEW_LINE>final PharmaBPartner <MASK><NEW_LINE>final PharmaProduct product = pharmaProductRepo.getById(productId);<NEW_LINE>if (PharmaShipmentPermission.TYPE_C.equals(bPartner.getShipmentPermission())) {<NEW_LINE>return resultBuilder.isValid(true).build();<NEW_LINE>}<NEW_LINE>if (product.isNarcotic()) {<NEW_LINE>final ITranslatableString noPermissionMessage = msgBL.getTranslatableMsgText(MSG_NoNarcoticPermission_Sales, product.getValue(), bPartner.getName());<NEW_LINE>return resultBuilder.isValid(false).errorMessage(noPermissionMessage).build();<NEW_LINE>}<NEW_LINE>if (bPartner.isHasAtLeastOneCustomerPermission()) {<NEW_LINE>return resultBuilder.isValid(true).build();<NEW_LINE>}<NEW_LINE>if (!product.isPrescriptionRequired()) {<NEW_LINE>return resultBuilder.isValid(true).build();<NEW_LINE>}<NEW_LINE>final ITranslatableString noPermissionReason = msgBL.getTranslatableMsgText(MSG_NoPharmaShipmentPermission_Sales, Collections.emptyList());<NEW_LINE>final ITranslatableString noPermissionMessage = msgBL.getTranslatableMsgText(MSG_NoPrescriptionPermission_Sales, product.getValue(), bPartner.getName(), CoalesceUtil.coalesce(bPartner.getShipmentPermission(), noPermissionReason.translate(Env.getAD_Language())));<NEW_LINE>return resultBuilder.isValid(false).errorMessage(noPermissionMessage).build();<NEW_LINE>}
bPartner = pharmaBPartnerRepo.getById(bpartnerId);
565,671
public Object calculate(Context ctx) {<NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("to" + mm.getMessage("function.missingParam"));<NEW_LINE>} else if (param.isLeaf()) {<NEW_LINE>Object o = param.getLeafExpression().calculate(ctx);<NEW_LINE>if (o instanceof Number) {<NEW_LINE>int end = ((Number) o).intValue();<NEW_LINE>return end > 0 ? new Sequence(1, end) : new Sequence(0);<NEW_LINE>} else {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("to" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (param.getSubSize() != 2) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("to" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>IParam sub1 = param.getSub(0);<NEW_LINE>IParam sub2 = param.getSub(1);<NEW_LINE>if (sub1 == null || sub2 == null) {<NEW_LINE><MASK><NEW_LINE>throw new RQException("to" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object o1 = sub1.getLeafExpression().calculate(ctx);<NEW_LINE>Object o2 = sub2.getLeafExpression().calculate(ctx);<NEW_LINE>if (o1 instanceof Long && o2 instanceof Long) {<NEW_LINE>long begin = ((Number) o1).longValue();<NEW_LINE>long end = ((Number) o2).longValue();<NEW_LINE>if (option != null && option.indexOf('s') != -1) {<NEW_LINE>if (end >= 0) {<NEW_LINE>end += begin - 1;<NEW_LINE>} else {<NEW_LINE>end += begin + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Sequence(begin, end);<NEW_LINE>} else if (o1 instanceof Number && o2 instanceof Number) {<NEW_LINE>int begin = ((Number) o1).intValue();<NEW_LINE>int end = ((Number) o2).intValue();<NEW_LINE>if (option != null && option.indexOf('s') != -1) {<NEW_LINE>if (end >= 0) {<NEW_LINE>end += begin - 1;<NEW_LINE>} else {<NEW_LINE>end += begin + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Sequence(begin, end);<NEW_LINE>} else {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("to" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
MessageManager mm = EngineMessage.get();
124,871
private void writeList(VirtualObject virtualObject, ByteBuffer buffer, PackageMetaData packageMetaData, EStructuralFeature feature) throws BimserverDatabaseException {<NEW_LINE>if (feature.getEType() instanceof EEnum) {<NEW_LINE>// Aggregate relations to enums never occur... at this<NEW_LINE>// moment<NEW_LINE>} else if (feature.getEType() instanceof EClass) {<NEW_LINE>List list = (List) virtualObject.eGet(feature);<NEW_LINE>buffer.putInt(list.size());<NEW_LINE>for (Object o : list) {<NEW_LINE>if (o == null) {<NEW_LINE>buffer.order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>buffer.putShort((short) -1);<NEW_LINE>buffer.order(ByteOrder.BIG_ENDIAN);<NEW_LINE>} else {<NEW_LINE>if (o instanceof VirtualObject) {<NEW_LINE>VirtualObject listObject = (VirtualObject) o;<NEW_LINE>if (feature.getEAnnotation("twodimensionalarray") != null) {<NEW_LINE>Short cid = getDatabaseInterface().getCidOfEClass((EClass) feature.getEType());<NEW_LINE>buffer.order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>buffer.putShort((short) -cid);<NEW_LINE>buffer.order(ByteOrder.BIG_ENDIAN);<NEW_LINE>EStructuralFeature lf = listObject.eClass().getEStructuralFeature("List");<NEW_LINE>writeList(listObject, buffer, packageMetaData, lf);<NEW_LINE>} else {<NEW_LINE>if (listObject.eClass().getEAnnotation("wrapped") != null || listObject.eClass().getEStructuralFeature("wrappedValue") != null) {<NEW_LINE>writeWrappedValue(getPid(), getRid(), listObject, buffer, packageMetaData);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (o instanceof Long) {<NEW_LINE>long listObjectOid = (Long) o;<NEW_LINE><MASK><NEW_LINE>} else if (o instanceof HashMapWrappedVirtualObject) {<NEW_LINE>HashMapWrappedVirtualObject hashMapWrappedVirtualObject = (HashMapWrappedVirtualObject) o;<NEW_LINE>writeWrappedValue(-1, -1, hashMapWrappedVirtualObject, buffer, packageMetaData);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (feature.getEType() instanceof EDataType) {<NEW_LINE>List list = (List) virtualObject.eGet(feature);<NEW_LINE>if (list == null) {<NEW_LINE>buffer.putInt(-1);<NEW_LINE>} else {<NEW_LINE>buffer.putInt(list.size());<NEW_LINE>for (Object o : list) {<NEW_LINE>writePrimitiveValue(feature, o, buffer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
writeReference(listObjectOid, buffer, feature);
214,608
protected MutablePropertyValues parseCommonContainerProperties(Element containerEle, ParserContext parserContext) {<NEW_LINE>MutablePropertyValues properties = new MutablePropertyValues();<NEW_LINE>String destinationType = containerEle.getAttribute(DESTINATION_TYPE_ATTRIBUTE);<NEW_LINE>boolean pubSubDomain = false;<NEW_LINE>boolean subscriptionDurable = false;<NEW_LINE>boolean subscriptionShared = false;<NEW_LINE>if (DESTINATION_TYPE_SHARED_DURABLE_TOPIC.equals(destinationType)) {<NEW_LINE>pubSubDomain = true;<NEW_LINE>subscriptionDurable = true;<NEW_LINE>subscriptionShared = true;<NEW_LINE>} else if (DESTINATION_TYPE_SHARED_TOPIC.equals(destinationType)) {<NEW_LINE>pubSubDomain = true;<NEW_LINE>subscriptionShared = true;<NEW_LINE>} else if (DESTINATION_TYPE_DURABLE_TOPIC.equals(destinationType)) {<NEW_LINE>pubSubDomain = true;<NEW_LINE>subscriptionDurable = true;<NEW_LINE>} else if (DESTINATION_TYPE_TOPIC.equals(destinationType)) {<NEW_LINE>pubSubDomain = true;<NEW_LINE>} else if (!StringUtils.hasLength(destinationType) || DESTINATION_TYPE_QUEUE.equals(destinationType)) {<NEW_LINE>// the default: queue<NEW_LINE>} else {<NEW_LINE>parserContext.getReaderContext().error("Invalid listener container 'destination-type': only " + "\"queue\", \"topic\", \"durableTopic\", \"sharedTopic\", \"sharedDurableTopic\" supported.", containerEle);<NEW_LINE>}<NEW_LINE>properties.add("pubSubDomain", pubSubDomain);<NEW_LINE>properties.add("subscriptionDurable", subscriptionDurable);<NEW_LINE>properties.add("subscriptionShared", subscriptionShared);<NEW_LINE>boolean replyPubSubDomain = false;<NEW_LINE>String replyDestinationType = containerEle.getAttribute(RESPONSE_DESTINATION_TYPE_ATTRIBUTE);<NEW_LINE>if (!StringUtils.hasText(replyDestinationType)) {<NEW_LINE>// the default: same value as pubSubDomain<NEW_LINE>replyPubSubDomain = pubSubDomain;<NEW_LINE>} else if (DESTINATION_TYPE_TOPIC.equals(replyDestinationType)) {<NEW_LINE>replyPubSubDomain = true;<NEW_LINE>} else if (!DESTINATION_TYPE_QUEUE.equals(replyDestinationType)) {<NEW_LINE>parserContext.getReaderContext().error("Invalid listener container 'response-destination-type': only " + "\"queue\", \"topic\" supported.", containerEle);<NEW_LINE>}<NEW_LINE>properties.add("replyPubSubDomain", replyPubSubDomain);<NEW_LINE>if (containerEle.hasAttribute(CLIENT_ID_ATTRIBUTE)) {<NEW_LINE>String clientId = containerEle.getAttribute(CLIENT_ID_ATTRIBUTE);<NEW_LINE>if (!StringUtils.hasText(clientId)) {<NEW_LINE>parserContext.getReaderContext().error("Listener 'client-id' attribute contains empty value.", containerEle);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (containerEle.hasAttribute(MESSAGE_CONVERTER_ATTRIBUTE)) {<NEW_LINE>String messageConverter = containerEle.getAttribute(MESSAGE_CONVERTER_ATTRIBUTE);<NEW_LINE>if (!StringUtils.hasText(messageConverter)) {<NEW_LINE>parserContext.getReaderContext().error("listener container 'message-converter' attribute contains empty value.", containerEle);<NEW_LINE>} else {<NEW_LINE>properties.add("messageConverter", new RuntimeBeanReference(messageConverter));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return properties;<NEW_LINE>}
properties.add("clientId", clientId);
101,116
private AllDependenciesMaps createAllDependencies() throws IOException {<NEW_LINE>Collection<? extends IndexResult> results = filterDeletedFiles(querySupport.query(CssIndexer.IMPORTS_KEY, "", QuerySupport.Kind.PREFIX, CssIndexer.IMPORTS_KEY));<NEW_LINE>Map<FileObject, Collection<FileReference>> source2dests = new HashMap<>();<NEW_LINE>Map<FileObject, Collection<FileReference>> dest2sources = new HashMap<>();<NEW_LINE>for (IndexResult result : results) {<NEW_LINE>FileObject file = result.getFile();<NEW_LINE>String[] imports = result.getValues(CssIndexer.IMPORTS_KEY);<NEW_LINE>Collection<FileReference> imported = new HashSet<>();<NEW_LINE>for (String importedFileName : imports) {<NEW_LINE>// resolve the file<NEW_LINE>FileReference resolvedReference = resolveImport(file, importedFileName);<NEW_LINE>if (resolvedReference != null) {<NEW_LINE>imported.add(resolvedReference);<NEW_LINE>// add reverse dependency<NEW_LINE>Collection<FileReference> sources = dest2sources.get(resolvedReference.target());<NEW_LINE>if (sources == null) {<NEW_LINE>sources = new HashSet<>();<NEW_LINE>dest2sources.put(<MASK><NEW_LINE>}<NEW_LINE>sources.add(resolvedReference);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>source2dests.put(file, imported);<NEW_LINE>}<NEW_LINE>return new AllDependenciesMaps(source2dests, dest2sources);<NEW_LINE>}
resolvedReference.target(), sources);
331,133
private void adjustRectangularSelectionMouseX(int x, int y) {<NEW_LINE>if (!rectangularSelection) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JTextComponent c = component;<NEW_LINE>int offset = c.viewToModel(new Point(x, y));<NEW_LINE>Rectangle r = null;<NEW_LINE>;<NEW_LINE>if (offset >= 0) {<NEW_LINE>try {<NEW_LINE>r = c.modelToView(offset);<NEW_LINE>} catch (BadLocationException ex) {<NEW_LINE>r = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (r != null) {<NEW_LINE>float xDiff = x - r.x;<NEW_LINE>if (xDiff > 0) {<NEW_LINE>float charWidth;<NEW_LINE>LockedViewHierarchy lvh = ViewHierarchy.get(c).lock();<NEW_LINE>try {<NEW_LINE>charWidth = lvh.getDefaultCharWidth();<NEW_LINE>} finally {<NEW_LINE>lvh.unlock();<NEW_LINE>}<NEW_LINE>int n = (int) (xDiff / charWidth);<NEW_LINE>r.x += n * charWidth;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>rsDotRect.x = r.x;<NEW_LINE>rsDotRect.width = r.width;<NEW_LINE>updateRectangularSelectionPaintRect();<NEW_LINE>fireStateChanged();<NEW_LINE>}<NEW_LINE>}
r.width = (int) charWidth;
1,317,807
private void buildCells(YearMonth yearMonth, int colIndex) {<NEW_LINE>List<Node> cells = new ArrayList<>();<NEW_LINE>Node header = buildHeaderCell(yearMonth);<NEW_LINE>header.<MASK><NEW_LINE>cells.add(header);<NEW_LINE>LocalDate start = yearMonth.atDay(1);<NEW_LINE>LocalDate end = yearMonth.atEndOfMonth();<NEW_LINE>if (getSkinnable().getWeekDayLayout() == WeekDayLayoutStrategy.ALIGNED) {<NEW_LINE>DayOfWeek firstDayOfWeek = getSkinnable().getFirstDayOfWeek();<NEW_LINE>DayOfWeek startDayOfWeek = start.getDayOfWeek();<NEW_LINE>int distanceDays = Math.abs(firstDayOfWeek.getValue() - startDayOfWeek.getValue());<NEW_LINE>while (distanceDays-- > 0) {<NEW_LINE>cells.add(buildCell(null));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (start.isBefore(end) || start.isEqual(end)) {<NEW_LINE>cells.add(buildCell(start));<NEW_LINE>start = start.plusDays(1);<NEW_LINE>}<NEW_LINE>buildEmptyCellBottom(cells);<NEW_LINE>final YearMonth extendedStart = getSkinnable().getExtendedStartMonth();<NEW_LINE>final YearMonth extendedEnd = getSkinnable().getExtendedEndMonth();<NEW_LINE>cells.forEach(cell -> {<NEW_LINE>if (extendedStart.equals(yearMonth)) {<NEW_LINE>cell.getStyleClass().add("first-month");<NEW_LINE>} else if (extendedEnd.equals(yearMonth)) {<NEW_LINE>cell.getStyleClass().add("last-month");<NEW_LINE>} else {<NEW_LINE>cell.getStyleClass().add("middle-month");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>for (int i = 0; i < cells.size(); i++) {<NEW_LINE>Node node = cells.get(i);<NEW_LINE>grid.add(node, colIndex, i + 1);<NEW_LINE>if (node instanceof DateCell) {<NEW_LINE>final Position position = new Position(colIndex, i);<NEW_LINE>final DateCell dateCell = (DateCell) node;<NEW_LINE>final LocalDate date = dateCell.getDate();<NEW_LINE>cellMap.put(date, dateCell);<NEW_LINE>positionToDateCellMap.put(position, dateCell);<NEW_LINE>dateToPositionMap.put(date, position);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getStyleClass().add("month-header");
937,828
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {<NEW_LINE>// NOSONAR complexity<NEW_LINE>if (!NamespaceUtils.isAttributeDefined(element, NAME_ATTRIBUTE) && !NamespaceUtils.isAttributeDefined(element, ID_ATTRIBUTE)) {<NEW_LINE>parserContext.getReaderContext().error("Queue must have either id or name (or both)", element);<NEW_LINE>}<NEW_LINE>NamespaceUtils.addConstructorArgValueIfAttributeDefined(builder, element, NAME_ATTRIBUTE);<NEW_LINE>if (!NamespaceUtils.isAttributeDefined(element, NAME_ATTRIBUTE)) {<NEW_LINE>if (attributeHasIllegalOverride(element, DURABLE_ATTRIBUTE, "false") || attributeHasIllegalOverride(element, EXCLUSIVE_ATTRIBUTE, "true") || attributeHasIllegalOverride(element, AUTO_DELETE_ATTRIBUTE, "true")) {<NEW_LINE>parserContext.getReaderContext().error("Anonymous queue cannot specify durable='true', exclusive='false' or auto-delete='false'", element);<NEW_LINE>}<NEW_LINE>NamespaceUtils.addConstructorArgRefIfAttributeDefined(builder, element, NAMING_STRATEGY);<NEW_LINE>} else {<NEW_LINE>if (StringUtils.hasText(element.getAttribute(NAMING_STRATEGY))) {<NEW_LINE>parserContext.getReaderContext().error("Only one of 'name' or 'naming-strategy' is allowed", element);<NEW_LINE>}<NEW_LINE>NamespaceUtils.addConstructorArgBooleanValueIfAttributeDefined(<MASK><NEW_LINE>NamespaceUtils.addConstructorArgBooleanValueIfAttributeDefined(builder, element, EXCLUSIVE_ATTRIBUTE, false);<NEW_LINE>NamespaceUtils.addConstructorArgBooleanValueIfAttributeDefined(builder, element, AUTO_DELETE_ATTRIBUTE, false);<NEW_LINE>}<NEW_LINE>parseArguments(element, parserContext, builder);<NEW_LINE>NamespaceUtils.parseDeclarationControls(element, builder);<NEW_LINE>CURRENT_ELEMENT.set(element);<NEW_LINE>}
builder, element, DURABLE_ATTRIBUTE, false);
1,462,753
public static void main(String[] args) throws Exception {<NEW_LINE>AmazonRekognition amazonRekognition = AmazonRekognitionClientBuilder.defaultClient();<NEW_LINE>System.out.println("Listing collections");<NEW_LINE>int limit = 10;<NEW_LINE>ListCollectionsResult listCollectionsResult = null;<NEW_LINE>String paginationToken = null;<NEW_LINE>do {<NEW_LINE>if (listCollectionsResult != null) {<NEW_LINE>paginationToken = listCollectionsResult.getNextToken();<NEW_LINE>}<NEW_LINE>ListCollectionsRequest listCollectionsRequest = new ListCollectionsRequest().withMaxResults(limit).withNextToken(paginationToken);<NEW_LINE>listCollectionsResult = amazonRekognition.listCollections(listCollectionsRequest);<NEW_LINE>List<String> collectionIds = listCollectionsResult.getCollectionIds();<NEW_LINE>for (String resultId : collectionIds) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} while (listCollectionsResult != null && listCollectionsResult.getNextToken() != null);<NEW_LINE>}
System.out.println(resultId);
266,062
// snippet-start:[s3.java2.s3_bucket_ops.delete_bucket]<NEW_LINE>public static void listAllObjects(S3Client s3, String bucket) {<NEW_LINE>try {<NEW_LINE>// To delete a bucket, all the objects in the bucket must be deleted first<NEW_LINE>ListObjectsV2Request listObjectsV2Request = ListObjectsV2Request.builder().bucket(bucket).build();<NEW_LINE>ListObjectsV2Response listObjectsV2Response;<NEW_LINE>do {<NEW_LINE>listObjectsV2Response = s3.listObjectsV2(listObjectsV2Request);<NEW_LINE>for (S3Object s3Object : listObjectsV2Response.contents()) {<NEW_LINE>s3.deleteObject(DeleteObjectRequest.builder().bucket(bucket).key(s3Object.key()).build());<NEW_LINE>}<NEW_LINE>listObjectsV2Request = ListObjectsV2Request.builder().bucket(bucket).continuationToken(listObjectsV2Response.nextContinuationToken()).build();<NEW_LINE>} while (listObjectsV2Response.isTruncated());<NEW_LINE>// snippet-end:[s3.java2.s3_bucket_ops.delete_bucket]<NEW_LINE>DeleteBucketRequest deleteBucketRequest = DeleteBucketRequest.builder().bucket(bucket).build();<NEW_LINE>s3.deleteBucket(deleteBucketRequest);<NEW_LINE>} catch (S3Exception e) {<NEW_LINE>System.err.println(e.<MASK><NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>}
awsErrorDetails().errorMessage());
834,164
public void prep2RollbackCancel(String txType) {<NEW_LINE>TimerService ts = ivContext.getTimerService();<NEW_LINE>Timer timer = null;<NEW_LINE>svLogger.logp(Level.INFO, CLASSNAME, "", "prep2RollbackCancel(" + txType + ")");<NEW_LINE>svLogger.logp(Level.INFO, CLASSNAME, "", "Verify the cancelled timer cannot be found in the timer service.");<NEW_LINE>timer = TimerHelper.getTimerWithMatchingInfo(ts, infoRollbackCancel);<NEW_LINE>if (timer == null) {<NEW_LINE>fail("The timer should be found in prep2RollbackCancel().");<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>svLogger.logp(Level.INFO, CLASSNAME, "", "The timer is found in prep2RollbackCancel().");<NEW_LINE>}<NEW_LINE>if (txType.equals("BMT")) {<NEW_LINE>UserTransaction tx2 = ivContext.getUserTransaction();<NEW_LINE>try {<NEW_LINE>tx2.begin();<NEW_LINE>timer.cancel();<NEW_LINE>tx2.rollback();<NEW_LINE>svLogger.logp(Level.<MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>svLogger.logp(Level.INFO, "", "", "Unexpected exception caught when cancelling timer in prep2RollbackCancel(). ");<NEW_LINE>e.printStackTrace(System.out);<NEW_LINE>fail("Unexpected exception caught when calling timer.cancel()" + e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// CMT<NEW_LINE>try {<NEW_LINE>timer.cancel();<NEW_LINE>ivContext.setRollbackOnly();<NEW_LINE>svLogger.logp(Level.INFO, CLASSNAME, "", "Timer cancellation transaction rolled back successfully.");<NEW_LINE>} catch (Throwable e) {<NEW_LINE>svLogger.logp(Level.INFO, "", "", "Unexpected exception caught when cancelling timer in prep2RollbackCancel(). ");<NEW_LINE>e.printStackTrace(System.out);<NEW_LINE>fail("Unexpected exception caught when calling timer.cancel()" + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// finished trying to cancel timer... now allow the timer to run<NEW_LINE>svTimerRunLatch.countDown();<NEW_LINE>return;<NEW_LINE>}
INFO, CLASSNAME, "", "Timer cancellation transaction rolled back successfully.");
870,203
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {<NEW_LINE>if (key.equals(getString(R.string.pref_key_notification_pending_drafts))) {<NEW_LINE>if (getActivity() != null) {<NEW_LINE>SharedPreferences prefs = androidx.preference.PreferenceManager.getDefaultSharedPreferences(getActivity());<NEW_LINE>boolean shouldNotifyOfPendingDrafts = prefs.getBoolean("wp_pref_notification_pending_drafts", true);<NEW_LINE>if (shouldNotifyOfPendingDrafts) {<NEW_LINE>AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_PENDING_DRAFTS_SETTINGS_ENABLED);<NEW_LINE>} else {<NEW_LINE>AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_PENDING_DRAFTS_SETTINGS_DISABLED);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (key.equals(getString(R.string.wp_pref_custom_notification_sound))) {<NEW_LINE>final String defaultPath = getString(R.string.notification_settings_item_sights_and_sounds_choose_sound_default);<NEW_LINE>final String value = sharedPreferences.getString(key, defaultPath);<NEW_LINE>if (value.trim().toLowerCase(Locale.ROOT).startsWith("file://")) {<NEW_LINE>// sound path begins with 'file://` which will lead to FileUriExposedException when used. Revert to<NEW_LINE>// default and let the user know.<NEW_LINE>AppLog.w(T.NOTIFS, "Notification sound starts with unacceptable scheme: " + value);<NEW_LINE><MASK><NEW_LINE>if (context != null) {<NEW_LINE>// let the user know we won't be using the selected sound<NEW_LINE>ToastUtils.showToast(context, R.string.notification_sound_has_invalid_path, Duration.LONG);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Context context = WordPress.getContext();
1,750,209
private static void printHelpExit(CmdLineParser parser) {<NEW_LINE>parser.getProperties().withUsageWidth(120);<NEW_LINE>parser.printUsage(System.out);<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Document Types");<NEW_LINE>for (PaperSize p : PaperSize.values()) {<NEW_LINE>System.out.printf(" %12s %5.0f %5.0f %s\n", p.getName(), p.width, p.height, p.unit.abbreviation);<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Units");<NEW_LINE>for (Unit u : Unit.values()) {<NEW_LINE>System.out.printf(<MASK><NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("Examples:");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("-t \"http://boofcv.org\" -t \"Hello There!\" -p LETTER -w 5 --GridFill -o document.pdf");<NEW_LINE>System.out.println(" creates PDF with a grid that will fill the entire page composed of two qr codes on letter sized paper");<NEW_LINE>System.out.println();<NEW_LINE>System.out.println("-t \"http://boofcv.org\" -t \"Hello There!\" -o document.png");<NEW_LINE>System.out.println(" Creates two png images names document0.png and document1.png");<NEW_LINE>System.out.println();<NEW_LINE>System.exit(1);<NEW_LINE>}
" %12s %3s\n", u, u.abbreviation);
1,528,655
private static void throwForGettersWithInconsistentAnnotation(List<InconsistentlyAnnotatedGetters> getters, Class<? extends Annotation> annotationClass) {<NEW_LINE>if (getters.size() == 1) {<NEW_LINE>InconsistentlyAnnotatedGetters getter = getters.get(0);<NEW_LINE>throw new IllegalArgumentException(String.format("Expected getter for property [%s] to be marked with @%s on all %s, " + "found only on %s", getter.descriptor.getName(), annotationClass.getSimpleName(), getter.getterClassNames, getter.gettersWithTheAnnotationClassNames));<NEW_LINE>} else if (getters.size() > 1) {<NEW_LINE>StringBuilder errorBuilder = new StringBuilder(String.format("Property getters are inconsistently marked with @%s:", annotationClass.getSimpleName()));<NEW_LINE>for (InconsistentlyAnnotatedGetters getter : getters) {<NEW_LINE>errorBuilder.append(String.format("%n - Expected for property [%s] to be marked on all %s, " + "found only on %s", getter.descriptor.getName(), getter.getterClassNames, getter.gettersWithTheAnnotationClassNames));<NEW_LINE>}<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}
IllegalArgumentException(errorBuilder.toString());
1,241,322
AttributeMap createMapBackedAttributeMap(Map<String, Object> directMap) {<NEW_LINE>AggregatingAttributeMapper owner = this;<NEW_LINE>return new DelegatingAttributeMapper(owner) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@Nullable<NEW_LINE>public <T> T get(String attributeName, Type<T> type) {<NEW_LINE>owner.checkType(attributeName, type);<NEW_LINE>if (getNonConfigurableAttributes().contains(attributeName)) {<NEW_LINE>return owner.get(attributeName, type);<NEW_LINE>}<NEW_LINE>Object val = directMap.get(attributeName);<NEW_LINE>if (val == null) {<NEW_LINE>checkArgument(directMap.containsKey(attributeName), "attribute \"%s\" isn't available in this computed default context", attributeName);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return type.cast(val);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ImmutableList<String> getAttributeNames() {<NEW_LINE>List<String> nonConfigurableAttributes = getNonConfigurableAttributes();<NEW_LINE>return ImmutableList.<String>builderWithExpectedSize(directMap.size() + nonConfigurableAttributes.size()).addAll(directMap.keySet()).<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
addAll(nonConfigurableAttributes).build();
844,489
static void invokeTarget(@NonNull final JavaActionProvider.ScriptAction scriptAction, @NonNull final Context ctx) {<NEW_LINE><MASK><NEW_LINE>final JavaModelWork action = new JavaModelWork(scriptAction, ctx, userPropertiesFile);<NEW_LINE>final Set<ActionFlag> flags = scriptAction.getActionFlags();<NEW_LINE>if (flags.contains(ActionFlag.JAVA_MODEL_SENSITIVE) || (ctx.getCompileOnSaveOperations().contains(CompileOnSaveOperation.UPDATE) && flags.contains(ActionFlag.SCAN_SENSITIVE))) {<NEW_LINE>// Always have to run with java model<NEW_LINE>ScanDialog.runWhenScanFinished(action, scriptAction.getDisplayName());<NEW_LINE>} else if (flags.contains(ActionFlag.SCAN_SENSITIVE)) {<NEW_LINE>// Run without model if not yet ready<NEW_LINE>try {<NEW_LINE>action.needsJavaModel = false;<NEW_LINE>invokeByJavaSource(action);<NEW_LINE>if (!action.isCalled()) {<NEW_LINE>action.doJavaChecks = false;<NEW_LINE>action.run();<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Does not need java model<NEW_LINE>action.run();<NEW_LINE>}<NEW_LINE>}
final String userPropertiesFile = verifyUserPropertiesFile(ctx);
106,961
public void onForwardPass(Model model, Map<String, INDArray> activations) {<NEW_LINE>int iterCount = getModelInfo(model).iterCount;<NEW_LINE>if (calcFromActivations() && updateConfig.reportingFrequency() > 0 && (iterCount == 0 || iterCount % updateConfig.reportingFrequency() == 0)) {<NEW_LINE>if (updateConfig.collectHistograms(StatsType.Activations)) {<NEW_LINE>activationHistograms = getHistograms(activations, updateConfig<MASK><NEW_LINE>}<NEW_LINE>if (updateConfig.collectMean(StatsType.Activations)) {<NEW_LINE>meanActivations = calculateSummaryStats(activations, StatType.Mean);<NEW_LINE>}<NEW_LINE>if (updateConfig.collectStdev(StatsType.Activations)) {<NEW_LINE>stdevActivations = calculateSummaryStats(activations, StatType.Stdev);<NEW_LINE>}<NEW_LINE>if (updateConfig.collectMeanMagnitudes(StatsType.Activations)) {<NEW_LINE>meanMagActivations = calculateSummaryStats(activations, StatType.MeanMagnitude);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.numHistogramBins(StatsType.Activations));
1,160,863
public static int calcColumnNumber(@Nullable Editor editor, @Nonnull CharSequence text, final int start, final int offset, final int tabSize) {<NEW_LINE>if (editor instanceof TextComponentEditor) {<NEW_LINE>return offset - start;<NEW_LINE>}<NEW_LINE>boolean useOptimization = true;<NEW_LINE>if (editor != null) {<NEW_LINE>SoftWrap softWrap = editor.getSoftWrapModel().getSoftWrap(start);<NEW_LINE>useOptimization = softWrap == null;<NEW_LINE>}<NEW_LINE>if (useOptimization) {<NEW_LINE>boolean hasNonTabs = false;<NEW_LINE>for (int i = start; i < offset; i++) {<NEW_LINE>if (text.charAt(i) == '\t') {<NEW_LINE>if (hasNonTabs) {<NEW_LINE>useOptimization = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>hasNonTabs = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (editor != null && useOptimization) {<NEW_LINE>Document document = editor.getDocument();<NEW_LINE>if (start < offset - 1 && document.getLineNumber(start) != document.getLineNumber(offset - 1)) {<NEW_LINE>String editorInfo = editor instanceof DesktopEditorImpl ? ". Editor info: " + ((DesktopEditorImpl) editor).dumpState() : "";<NEW_LINE>String documentInfo;<NEW_LINE>if (text instanceof Dumpable) {<NEW_LINE>documentInfo = ((Dumpable) text).dumpState();<NEW_LINE>} else {<NEW_LINE>documentInfo = "Text holder class: " + text.getClass();<NEW_LINE>}<NEW_LINE>LogMessageEx.error(LOG, "detected incorrect offset -> column number calculation", "start: " + start + ", given offset: " + offset + ", given tab size: " + tabSize + ". " + documentInfo + editorInfo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int shift = 0;<NEW_LINE>for (int i = start; i < offset; i++) {<NEW_LINE>char c = text.charAt(i);<NEW_LINE>if (c == '\t') {<NEW_LINE>shift += getTabLength(i + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return offset - start + shift;<NEW_LINE>}
shift - start, tabSize) - 1;
267,916
public void marshall(CreateModelPackageRequest createModelPackageRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createModelPackageRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getModelPackageName(), MODELPACKAGENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getModelPackageGroupName(), MODELPACKAGEGROUPNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getModelPackageDescription(), MODELPACKAGEDESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getInferenceSpecification(), INFERENCESPECIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getValidationSpecification(), VALIDATIONSPECIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getSourceAlgorithmSpecification(), SOURCEALGORITHMSPECIFICATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getCertifyForMarketplace(), CERTIFYFORMARKETPLACE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getModelApprovalStatus(), MODELAPPROVALSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getMetadataProperties(), METADATAPROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getModelMetrics(), MODELMETRICS_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getClientToken(), CLIENTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getCustomerMetadataProperties(), CUSTOMERMETADATAPROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getDriftCheckBaselines(), DRIFTCHECKBASELINES_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getDomain(), DOMAIN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getTask(), TASK_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createModelPackageRequest.getAdditionalInferenceSpecifications(), ADDITIONALINFERENCESPECIFICATIONS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createModelPackageRequest.getSamplePayloadUrl(), SAMPLEPAYLOADURL_BINDING);
1,255,675
public void store() {<NEW_LINE>BrandingModel branding = getBranding();<NEW_LINE>SplashUISupport.setValue(branding.getSplashRunningTextFontSize(), SplashUISupport.numberToString((Number) fontSize.getValue()));<NEW_LINE>SplashUISupport.setValue(branding.getSplashRunningTextBounds(), SplashUISupport.boundsToString((Rectangle) runningTextBounds.getValue()));<NEW_LINE>SplashUISupport.setValue(branding.getSplashProgressBarBounds(), SplashUISupport.boundsToString((Rectangle) progressBarBounds.getValue()));<NEW_LINE>if (textColor.getColor() != null) {<NEW_LINE>SplashUISupport.setValue(branding.getSplashRunningTextColor(), SplashUISupport.colorToString(textColor.getColor()));<NEW_LINE>}<NEW_LINE>if (barColor.getColor() != null) {<NEW_LINE>SplashUISupport.setValue(branding.getSplashProgressBarColor(), SplashUISupport.colorToString(barColor.getColor()));<NEW_LINE>}<NEW_LINE>// these colors below has a little effect on resulting branded splash<NEW_LINE>// then user can't adjust it from UI<NEW_LINE>// edgeColor.setColor(SplashUISupport.stringToColor(branding.getSplashProgressBarEdgeColor().getValue()));<NEW_LINE>// cornerColor.setColor(SplashUISupport.stringToColor(branding.getSplashProgressBarCornerColor().getValue()));<NEW_LINE>SplashUISupport.setValue(branding.getSplashShowProgressBar(), Boolean.toString(progressBarEnabled.isSelected()));<NEW_LINE><MASK><NEW_LINE>if (splash != null) {<NEW_LINE>splash.setBrandingSource(splashSource);<NEW_LINE>}<NEW_LINE>Image image = splashImage.image;<NEW_LINE>if (image != null) {<NEW_LINE>SplashUISupport.setValue(branding.getSplashWidth(), Integer.toString(image.getWidth(null), 10));<NEW_LINE>SplashUISupport.setValue(branding.getSplashHeight(), Integer.toString(image.getHeight(null), 10));<NEW_LINE>}<NEW_LINE>}
BrandedFile splash = branding.getSplash();
1,265,607
public void reloadSubList() {<NEW_LINE>changedSubs.clear();<NEW_LINE>List<String> allSubs = UserSubscriptions.sort(UserSubscriptions.getAllUserSubreddits(this));<NEW_LINE>// Check which subreddits are different<NEW_LINE>ColorPreferences colorPrefs = new ColorPreferences(SettingsSubreddit.this);<NEW_LINE>int defaultFont = colorPrefs<MASK><NEW_LINE>for (String s : allSubs) {<NEW_LINE>if (Palette.getColor(s) != Palette.getDefaultColor() || SettingValues.prefs.contains(Reddit.PREF_LAYOUT + s) || colorPrefs.getFontStyleSubreddit(s).getColor() != defaultFont || SettingValues.prefs.contains("picsenabled" + s.toLowerCase(Locale.ENGLISH))) {<NEW_LINE>changedSubs.add(s);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mSettingsSubAdapter = new SettingsSubAdapter(this, changedSubs);<NEW_LINE>recycler.setAdapter(mSettingsSubAdapter);<NEW_LINE>final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.post_floating_action_button);<NEW_LINE>recycler.addOnScrollListener(new RecyclerView.OnScrollListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onScrolled(RecyclerView recyclerView, int dx, int dy) {<NEW_LINE>if (dy <= 0 && fab.getId() != 0) {<NEW_LINE>fab.show();<NEW_LINE>} else {<NEW_LINE>fab.hide();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onScrollStateChanged(RecyclerView recyclerView, int newState) {<NEW_LINE>super.onScrollStateChanged(recyclerView, newState);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fab.show();<NEW_LINE>}
.getFontStyle().getColor();
153,616
private Rect findPositionForNewNodeBottomLeft(int width, int height, int rotatedWidth, int rotatedHeight, boolean rotate) {<NEW_LINE>Rect bestNode = new Rect();<NEW_LINE>// best y, score2 is best x<NEW_LINE>bestNode.score1 = Integer.MAX_VALUE;<NEW_LINE>for (int i = 0; i < freeRectangles.size; i++) {<NEW_LINE>// Try to place the rectangle in upright (non-rotated) orientation.<NEW_LINE>if (freeRectangles.get(i).width >= width && freeRectangles.get(i).height >= height) {<NEW_LINE>int topSideY = freeRectangles.get(i).y + height;<NEW_LINE>if (topSideY < bestNode.score1 || (topSideY == bestNode.score1 && freeRectangles.get(i).x < bestNode.score2)) {<NEW_LINE>bestNode.x = freeRectangles.get(i).x;<NEW_LINE>bestNode.y = <MASK><NEW_LINE>bestNode.width = width;<NEW_LINE>bestNode.height = height;<NEW_LINE>bestNode.score1 = topSideY;<NEW_LINE>bestNode.score2 = freeRectangles.get(i).x;<NEW_LINE>bestNode.rotated = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (rotate && freeRectangles.get(i).width >= rotatedWidth && freeRectangles.get(i).height >= rotatedHeight) {<NEW_LINE>int topSideY = freeRectangles.get(i).y + rotatedHeight;<NEW_LINE>if (topSideY < bestNode.score1 || (topSideY == bestNode.score1 && freeRectangles.get(i).x < bestNode.score2)) {<NEW_LINE>bestNode.x = freeRectangles.get(i).x;<NEW_LINE>bestNode.y = freeRectangles.get(i).y;<NEW_LINE>bestNode.width = rotatedWidth;<NEW_LINE>bestNode.height = rotatedHeight;<NEW_LINE>bestNode.score1 = topSideY;<NEW_LINE>bestNode.score2 = freeRectangles.get(i).x;<NEW_LINE>bestNode.rotated = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bestNode;<NEW_LINE>}
freeRectangles.get(i).y;
251,946
// BEGIN: NEVER INVOKED BY WEBSPHERE APPLICATION SERVER (Common Component Specific)<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>public void addWebApplication(DeployedModule deployedModule, List extensionFactories) throws Throwable {<NEW_LINE>WebAppConfiguration wConfig = deployedModule.getWebAppConfig();<NEW_LINE>String displayName = wConfig.getDisplayName();<NEW_LINE>logger.logp(Level.INFO, CLASS_NAME, "addWebApplication", "loading.web.module", displayName);<NEW_LINE>WebApp webApp = deployedModule.getWebApp();<NEW_LINE>try {<NEW_LINE>// PK40127<NEW_LINE>this.webApp = webApp;<NEW_LINE>webApp.initialize(wConfig, deployedModule, extensionFactories);<NEW_LINE>} catch (Throwable th) {<NEW_LINE>webApp.failed();<NEW_LINE>webApp.destroy();<NEW_LINE>// PK40127<NEW_LINE>this.webApp = null;<NEW_LINE>com.ibm.ws.ffdc.FFDCFilter.processException(th, "com.ibm.ws.webcontainer.webapp.WebGroup", "131", this);<NEW_LINE>Object[] arg = { displayName };<NEW_LINE>logger.logp(Level.SEVERE, <MASK><NEW_LINE>throw th;<NEW_LINE>}<NEW_LINE>// this.webApp = webApp; // PK25527<NEW_LINE>}
CLASS_NAME, "addWebApplication", "Failed.to.initialize.webapp.{0}", arg);
62,511
private void removingDupesAndSort() {<NEW_LINE>// duplicated ids can be present for some index due to cancellation of indexing for next index<NEW_LINE>final int[] currentChanges = changes;<NEW_LINE>final int intLength = length;<NEW_LINE>if (intLength < 250) {<NEW_LINE>// Plain sorting in Arrays works without allocations for small number of elements (see DualPivotQuicksort.QUICKSORT_THRESHOLD)<NEW_LINE>Arrays.sort(currentChanges, 0, intLength);<NEW_LINE>boolean hasDupes = false;<NEW_LINE>for (int i = 0, max = intLength - 1; i < max; ++i) {<NEW_LINE>if (currentChanges[i] == currentChanges[i + 1]) {<NEW_LINE>hasDupes = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasDupes) {<NEW_LINE>int ptr = 0;<NEW_LINE>for (int i = 1; i < intLength; ++i) {<NEW_LINE>if (currentChanges[i] != currentChanges[ptr]) {<NEW_LINE>currentChanges[++ptr] = currentChanges[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>length = <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ValueContainer.IntIterator sorted = SortedFileIdSetIterator.getTransientIterator(new ChangesIterator(currentChanges, length, false));<NEW_LINE>int lastIndex = 0;<NEW_LINE>while (sorted.hasNext()) {<NEW_LINE>currentChanges[lastIndex++] = sorted.next();<NEW_LINE>}<NEW_LINE>length = (short) lastIndex;<NEW_LINE>}<NEW_LINE>mayHaveDupes = false;<NEW_LINE>}
(short) (ptr + 1);
355,174
public void createMenuItems(Bundle savedInstanceState) {<NEW_LINE>LayoutInflater inflater = UiUtilities.getInflater(getContext(), nightMode);<NEW_LINE>View itemView = inflater.inflate(R.<MASK><NEW_LINE>items.add(new BaseBottomSheetItem.Builder().setCustomView(itemView).create());<NEW_LINE>statusContainer = itemView.findViewById(R.id.status_container);<NEW_LINE>updateStatus();<NEW_LINE>LinearLayout showTrackContainer = itemView.findViewById(R.id.show_track_on_map);<NEW_LINE>trackAppearanceIcon = showTrackContainer.findViewById(R.id.additional_button_icon);<NEW_LINE>createShowTrackItem(showTrackContainer, trackAppearanceIcon, ItemType.SHOW_TRACK.getTitleId(), TripRecordingBottomSheet.this, nightMode, new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>hide();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>segmentsTabs = itemView.findViewById(R.id.segments_container);<NEW_LINE>createSegmentsTabs(segmentsTabs);<NEW_LINE>RecyclerView statBlocks = itemView.findViewById(R.id.block_statistics);<NEW_LINE>blockStatisticsBuilder = new GpxBlockStatisticsBuilder(app, selectedGpxFile, nightMode);<NEW_LINE>blockStatisticsBuilder.setBlocksView(statBlocks, false);<NEW_LINE>blockStatisticsBuilder.setBlocksClickable(false);<NEW_LINE>blockStatisticsBuilder.setTabItem(GPX_TAB_ITEM_GENERAL);<NEW_LINE>blockStatisticsBuilder.initStatBlocks(null, ContextCompat.getColor(app, ColorUtilities.getActiveColorId(nightMode)), null);<NEW_LINE>}
layout.trip_recording_fragment, null, false);
733,583
final CreateAlgorithmResult executeCreateAlgorithm(CreateAlgorithmRequest createAlgorithmRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createAlgorithmRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateAlgorithmRequest> request = null;<NEW_LINE>Response<CreateAlgorithmResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateAlgorithmRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createAlgorithmRequest));<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, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateAlgorithm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateAlgorithmResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateAlgorithmResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
487,595
public void call(String url) throws Exception {<NEW_LINE>int idx = url.indexOf("fulltext/");<NEW_LINE>String year = url.substring(idx + 9, idx + 9 + 4);<NEW_LINE>String filename = FilenameUtils.getName(url);<NEW_LINE>URI outUri = new URI(rootDir + year + "/" + filename);<NEW_LINE>FileSystem fs = FileSystem.get(outUri, conf);<NEW_LINE>URL source = new URL(url);<NEW_LINE>Path p = new Path(outUri);<NEW_LINE>if (fs.exists(p)) {<NEW_LINE>if (skipExisting) {<NEW_LINE>long length = fs.getFileStatus(p).getLen();<NEW_LINE>if (length < 1024 * 1024) {<NEW_LINE>// Assume it must be corrupt somehow if it's < 1MB<NEW_LINE>log.info("Re-downloading file of length {}: {} - {}", length, url, outUri);<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>log.info("Skipping existing file: {} - {}", url, outUri);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fs.delete(p, false);<NEW_LINE>}<NEW_LINE>try (FSDataOutputStream out = fs.create(p);<NEW_LINE>InputStream is = new BufferedInputStream(source.openStream())) {<NEW_LINE>IOUtils.copy(is, out);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new RuntimeException("Error downloading: " + url, t);<NEW_LINE>}<NEW_LINE>log.info("Downloaded: {} to {}", url, outUri);<NEW_LINE>}
fs.delete(p, false);
566,177
// @formatter:on<NEW_LINE>@Inject(method = "checkIfExtend", cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;blockEvent(Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/Block;II)V"))<NEW_LINE>public void arclight$pistonRetract(Level worldIn, BlockPos pos, BlockState state, CallbackInfo ci, Direction direction) {<NEW_LINE>if (!this.isSticky) {<NEW_LINE>Block block = CraftBlock.at(worldIn, pos);<NEW_LINE>BlockPistonRetractEvent event = new BlockPistonRetractEvent(block, ImmutableList.of(), CraftBlock.notchToBlockFace(direction));<NEW_LINE>Bukkit.<MASK><NEW_LINE>if (event.isCancelled()) {<NEW_LINE>ci.cancel();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getPluginManager().callEvent(event);
802,736
private static CefLoadHandlerAdapter createLoadHandler(BrowserPanel p) {<NEW_LINE>final WeakReference<BrowserPanel> selfRef = new WeakReference<BrowserPanel>(p);<NEW_LINE>return new CefLoadHandlerAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onLoadingStateChange(CefBrowser browser, boolean isLoading, boolean canGoBack, boolean canGoForward) {<NEW_LINE>BrowserPanel self = selfRef.get();<NEW_LINE>if (self != null) {<NEW_LINE>if (isLoading) {<NEW_LINE>self.onStart(new ActionEvent(self.url_));<NEW_LINE>} else {<NEW_LINE>self.onLoad(new ActionEvent(self.url_));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onLoadError(CefBrowser browser, CefFrame frame, CefLoadHandler.ErrorCode errorCode, String errorText, String failedUrl) {<NEW_LINE>BrowserPanel self = selfRef.get();<NEW_LINE>if (self != null) {<NEW_LINE>self.onError(new ActionEvent(errorText, errorCode.getCode()));<NEW_LINE>if (errorCode != CefLoadHandler.ErrorCode.ERR_NONE && errorCode != CefLoadHandler.ErrorCode.ERR_ABORTED) {<NEW_LINE>self.errorMsg_ = "<html><head>";<NEW_LINE>self.errorMsg_ += "<title>Error while loading</title>";<NEW_LINE>self.errorMsg_ += "</head><body>";<NEW_LINE>self.errorMsg_ += "<h1>" + errorCode + "</h1>";<NEW_LINE>self<MASK><NEW_LINE>self.errorMsg_ += "<p>" + (errorText == null ? "" : errorText) + "</p>";<NEW_LINE>self.errorMsg_ += "</body></html>";<NEW_LINE>browser.stopLoad();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
.errorMsg_ += "<h3>Failed to load " + failedUrl + "</h3>";
993,843
private void startScanOrphanJobs() {<NEW_LINE>if (scanOrphanJobsTask != null) {<NEW_LINE>scanOrphanJobsTask.cancel(true);<NEW_LINE>}<NEW_LINE>scanOrphanJobsTask = thdf.submitPeriodicTask(new PeriodicTask() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public TimeUnit getTimeUnit() {<NEW_LINE>return TimeUnit.SECONDS;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public long getInterval() {<NEW_LINE>return GCGlobalConfig.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getName() {<NEW_LINE>return "scan-orphan-gc-jobs";<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>loadOrphanJobs();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new CloudRuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>logger.debug(String.format("[GC] starts scanning orphan job thread with the interval[%ss]", GCGlobalConfig.SCAN_ORPHAN_JOB_INTERVAL.value(Integer.class)));<NEW_LINE>}
SCAN_ORPHAN_JOB_INTERVAL.value(Long.class);
96,380
private void listConfigs(String domain, Model model) {<NEW_LINE>BusinessReportConfig config = m_configManager.queryConfigByDomain(domain);<NEW_LINE>Map<String, Set<String>> <MASK><NEW_LINE>List<BusinessItemConfig> configs = new ArrayList<BusinessItemConfig>(config.getBusinessItemConfigs().values());<NEW_LINE>Collections.sort(configs, new Comparator<BusinessItemConfig>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(BusinessItemConfig m1, BusinessItemConfig m2) {<NEW_LINE>return (int) ((m1.getViewOrder() - m2.getViewOrder()) * 100);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>List<CustomConfig> customConfigs = new ArrayList<CustomConfig>(config.getCustomConfigs().values());<NEW_LINE>Collections.sort(customConfigs, new Comparator<CustomConfig>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(CustomConfig m1, CustomConfig m2) {<NEW_LINE>return (int) ((m1.getViewOrder() - m2.getViewOrder()) * 100);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>model.setConfigs(configs);<NEW_LINE>model.setCustomConfigs(customConfigs);<NEW_LINE>model.setTags(tags);<NEW_LINE>}
tags = m_tagConfigManger.findTagByDomain(domain);
813,207
public static InstructionSequence fromXml(Element element) {<NEW_LINE>if (element == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<String> instructionsList = new ArrayList<>();<NEW_LINE>Element instructionsListEle = element.getChild("instructions");<NEW_LINE>if (instructionsListEle != null) {<NEW_LINE>for (Element instEle : XmlUtilities.getChildren(instructionsListEle, "instruction")) {<NEW_LINE>String <MASK><NEW_LINE>instructionsList.add(val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Integer> sizesList = new ArrayList<>();<NEW_LINE>Element sizesListEle = element.getChild("sizes");<NEW_LINE>if (sizesListEle != null) {<NEW_LINE>for (Element sizeEle : XmlUtilities.getChildren(sizesListEle, "size")) {<NEW_LINE>String val = sizeEle.getAttributeValue("value");<NEW_LINE>sizesList.add(val != null ? XmlUtilities.parseInt(val) : null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<String> csoList = new ArrayList<>();<NEW_LINE>Element csoListEle = element.getChild("commaSeparatedOperands");<NEW_LINE>if (csoListEle != null) {<NEW_LINE>for (Element csoEle : XmlUtilities.getChildren(csoListEle, "operands")) {<NEW_LINE>String val = csoEle.getAttributeValue("value");<NEW_LINE>csoList.add(val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>InstructionSequence result = new InstructionSequence();<NEW_LINE>result.setInstructions(instructionsList.toArray(new String[instructionsList.size()]));<NEW_LINE>result.setCommaSeparatedOperands(csoList.toArray(new String[csoList.size()]));<NEW_LINE>result.setSizes(sizesList.toArray(new Integer[sizesList.size()]));<NEW_LINE>return result;<NEW_LINE>}
val = instEle.getAttributeValue("value");
439,427
public SdkFileEntry[] generateSourceFiles(ServiceModel serviceModel) throws Exception {<NEW_LINE>Shape shape = new Shape();<NEW_LINE>shape.setName("ResponseMetadata");<NEW_LINE>shape.setReferenced(true);<NEW_LINE>shape.setType("structure");<NEW_LINE>Shape stringShape = new Shape();<NEW_LINE>stringShape.setName("RequestId");<NEW_LINE>stringShape.setType("string");<NEW_LINE>ShapeMember stringShapeMember = new ShapeMember();<NEW_LINE>stringShapeMember.setShape(stringShape);<NEW_LINE>shape.setMembers(new HashMap<>());<NEW_LINE>shape.getMembers().put("RequestId", stringShapeMember);<NEW_LINE>serviceModel.getShapes().put("ResponseMetadata", shape);<NEW_LINE>ShapeMember responseMetadataMember = new ShapeMember();<NEW_LINE>responseMetadataMember.setShape(shape);<NEW_LINE>responseMetadataMember.setRequired(true);<NEW_LINE>responseMetadataMember.setValidationNeeded(true);<NEW_LINE>for (Shape resultShape : serviceModel.getShapes().values()) {<NEW_LINE>if (resultShape.isResult()) {<NEW_LINE>resultShape.getMembers().put("ResponseMetadata", responseMetadataMember);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// query api ALWAYS needs a request shape, because it needs to send action and version as part of the payload<NEW_LINE>// we don't want to add it to the operation however, because there is no need for the user to be aware of the existence of this<NEW_LINE>// type.<NEW_LINE>serviceModel.getOperations().values().stream().filter(operation -> operation.getRequest() == null).forEach(operation -> {<NEW_LINE>Shape requestShape = new Shape();<NEW_LINE>requestShape.setName(<MASK><NEW_LINE>requestShape.setReferenced(true);<NEW_LINE>requestShape.setRequest(true);<NEW_LINE>requestShape.setType("structure");<NEW_LINE>requestShape.setMembers(new HashMap<>());<NEW_LINE>requestShape.setSupportsPresigning(true);<NEW_LINE>serviceModel.getShapes().put(requestShape.getName(), requestShape);<NEW_LINE>ShapeMember shapeMemberForRequest = new ShapeMember();<NEW_LINE>shapeMemberForRequest.setDocumentation("");<NEW_LINE>shapeMemberForRequest.setShape(requestShape);<NEW_LINE>operation.setRequest(shapeMemberForRequest);<NEW_LINE>});<NEW_LINE>serviceModel.getOperations().values().stream().forEach(operation -> {<NEW_LINE>operation.getRequest().getShape().setSupportsPresigning(true);<NEW_LINE>});<NEW_LINE>return super.generateSourceFiles(serviceModel);<NEW_LINE>}
operation.getName() + "Request");
629,753
public List<ExpressInfo> query(ExpressCompany company, String num) {<NEW_LINE>String appId = JPressOptions.get("express_api_appid");<NEW_LINE>String appSecret = JPressOptions.get("express_api_appsecret");<NEW_LINE>String param = "{\"com\":\"" + company.getCode() + "\",\"num\":\"" + num + "\"}";<NEW_LINE>String sign = HashKit.md5(param + appSecret + appId).toUpperCase();<NEW_LINE>HashMap params = new HashMap();<NEW_LINE>params.put("param", param);<NEW_LINE>params.put("sign", sign);<NEW_LINE><MASK><NEW_LINE>String result = HttpUtil.httpPost("http://poll.kuaidi100.com/poll/query.do", params);<NEW_LINE>if (StrUtil.isBlank(result)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>JSONObject jsonObject = JSON.parseObject(result);<NEW_LINE>JSONArray jsonArray = jsonObject.getJSONArray("data");<NEW_LINE>if (jsonArray != null && jsonArray.size() > 0) {<NEW_LINE>List<ExpressInfo> list = new ArrayList<>();<NEW_LINE>for (int i = 0; i < jsonArray.size(); i++) {<NEW_LINE>JSONObject expObject = jsonArray.getJSONObject(i);<NEW_LINE>ExpressInfo ei = new ExpressInfo();<NEW_LINE>ei.setInfo(expObject.getString("context"));<NEW_LINE>ei.setTime(expObject.getString("time"));<NEW_LINE>list.add(ei);<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOG.error(ex.toString(), ex);<NEW_LINE>}<NEW_LINE>LOG.error(result);<NEW_LINE>return null;<NEW_LINE>}
params.put("customer", appId);
673,726
public void run() {<NEW_LINE>while (!shutdown) {<NEW_LINE>maxOutstanding.acquireUninterruptibly();<NEW_LINE>final AtomicReference<StreamObserver<Messages.SimpleRequest>> requestObserver = new AtomicReference<>();<NEW_LINE>requestObserver.set(stub.streamingCall(new StreamObserver<Messages.SimpleResponse>() {<NEW_LINE><NEW_LINE>long now = System.nanoTime();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onNext(Messages.SimpleResponse value) {<NEW_LINE>delay(System.nanoTime() - now);<NEW_LINE>if (shutdown) {<NEW_LINE>requestObserver.get().onCompleted();<NEW_LINE>// Must not send another request.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>requestObserver.get().onNext(simpleRequest);<NEW_LINE>now = System.nanoTime();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable t) {<NEW_LINE>maxOutstanding.release();<NEW_LINE>Level level = shutdown ? Level.FINE : Level.INFO;<NEW_LINE>log.<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCompleted() {<NEW_LINE>maxOutstanding.release();<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>requestObserver.get().onNext(simpleRequest);<NEW_LINE>}<NEW_LINE>}
log(level, "Error in Async Ping-Pong call", t);
661,582
final GetConfigResult executeGetConfig(GetConfigRequest getConfigRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getConfigRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetConfigRequest> request = null;<NEW_LINE>Response<GetConfigResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetConfigRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getConfigRequest));<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, "GroundStation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetConfigResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetConfigResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,734,983
protected void run() throws GitException {<NEW_LINE>Repository repository = getRepository();<NEW_LINE>org.eclipse.jgit.api.RebaseCommand command = new Git(repository).rebase();<NEW_LINE>if (operation == GitClient.RebaseOperationType.BEGIN) {<NEW_LINE>Ref ref = null;<NEW_LINE>try {<NEW_LINE>ref = repository.findRef(revision);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new GitException(ex);<NEW_LINE>}<NEW_LINE>if (ref == null) {<NEW_LINE>command.setUpstream(Utils.findCommit(repository, revision));<NEW_LINE>} else {<NEW_LINE>command.setUpstream(ref.getTarget().getObjectId());<NEW_LINE>command.setUpstreamName(ref.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>command.setOperation(getOperation(operation));<NEW_LINE>command.setProgressMonitor(new DelegatingProgressMonitor(monitor));<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>result = createResult(res);<NEW_LINE>} catch (GitAPIException ex) {<NEW_LINE>throw new GitException(ex);<NEW_LINE>}<NEW_LINE>}
RebaseResult res = command.call();
1,357,883
public <G extends FulfillmentGroup> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException {<NEW_LINE>CreateResponse<G> createResponse = context.createOrRetrieveCopyInstance(this);<NEW_LINE>if (createResponse.isAlreadyPopulated()) {<NEW_LINE>return createResponse;<NEW_LINE>}<NEW_LINE>FulfillmentGroup cloned = createResponse.getClone();<NEW_LINE>cloned.setAddress(address == null ? null : address.createOrRetrieveCopyInstance<MASK><NEW_LINE>cloned.setDeliveryInstruction(deliveryInstruction);<NEW_LINE>cloned.setFulfillmentOption(fulfillmentOption);<NEW_LINE>cloned.setFulfillmentPrice(fulfillmentPrice == null ? null : new Money(fulfillmentPrice));<NEW_LINE>cloned.setIsShippingPriceTaxable(isShippingPriceTaxable == null ? null : isShippingPriceTaxable);<NEW_LINE>cloned.setMerchandiseTotal(merchandiseTotal == null ? null : new Money(merchandiseTotal));<NEW_LINE>cloned.setRetailFulfillmentPrice(fulfillmentPrice == null ? null : new Money(fulfillmentPrice));<NEW_LINE>cloneTaxDetails(context, cloned);<NEW_LINE>cloned.setTotalItemTax(totalItemTax == null ? null : new Money(totalItemTax));<NEW_LINE>cloned.setTotalFulfillmentGroupTax(totalFulfillmentGroupTax == null ? null : new Money(totalFulfillmentGroupTax));<NEW_LINE>cloned.setTotalFeeTax(totalFeeTax == null ? null : new Money(totalFeeTax));<NEW_LINE>cloned.setTotalTax(totalTax == null ? null : new Money(totalTax));<NEW_LINE>cloned.setRetailFulfillmentPrice(retailFulfillmentPrice == null ? null : new Money(retailFulfillmentPrice));<NEW_LINE>cloned.setSaleFulfillmentPrice(saleFulfillmentPrice == null ? null : new Money(saleFulfillmentPrice));<NEW_LINE>cloned.setTotal(total == null ? null : new Money(total));<NEW_LINE>cloned.setOrder(order);<NEW_LINE>cloned.setPrimary(primary);<NEW_LINE>cloned.setType(getType());<NEW_LINE>for (FulfillmentGroupItem fgi : fulfillmentGroupItems) {<NEW_LINE>FulfillmentGroupItem fulfillmentGroupItem = fgi.createOrRetrieveCopyInstance(context).getClone();<NEW_LINE>fulfillmentGroupItem.setFulfillmentGroup(cloned);<NEW_LINE>cloned.getFulfillmentGroupItems().add(fulfillmentGroupItem);<NEW_LINE>}<NEW_LINE>return createResponse;<NEW_LINE>}
(context).getClone());