idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
313,984 | public static String replaceSQLParameter(String sql, String params) {<NEW_LINE>UnescapedSQL unescapedSql = unescapeLiteralSQL(sql, params);<NEW_LINE>sql = unescapedSql.sql;<NEW_LINE>params = unescapedSql.param;<NEW_LINE>if (StringUtil.isEmpty(sql) || StringUtil.isEmpty(params)) {<NEW_LINE>return sql;<NEW_LINE>}<NEW_LINE>ArrayList<String> paramList = divideParams(params);<NEW_LINE>StringBuilder sqlBuilder = new StringBuilder();<NEW_LINE>int sqlLength = sql.length();<NEW_LINE>int search;<NEW_LINE>int index = 0;<NEW_LINE>int pos = 0;<NEW_LINE>try {<NEW_LINE>while (pos < sqlLength) {<NEW_LINE>search = <MASK><NEW_LINE>if (search < 0) {<NEW_LINE>sqlBuilder.append(sql.substring(pos));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>sqlBuilder.append(sql.substring(pos, search)).append(paramList.get(index));<NEW_LINE>index++;<NEW_LINE>pos = search + 1;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>return ">>>> Failed bind parameter : " + e.getMessage();<NEW_LINE>}<NEW_LINE>return sqlBuilder.toString();<NEW_LINE>} | sql.indexOf('?', pos); |
880 | public void run() {<NEW_LINE>Thread me = Thread.currentThread();<NEW_LINE>while (thread == me && !isShowing() || getSize().width == 0) {<NEW_LINE>try {<NEW_LINE>thread.sleep(500);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (thread == me && isShowing()) {<NEW_LINE>Dimension d = getSize();<NEW_LINE>if (d.width != w || d.height != h) {<NEW_LINE>w = d.width;<NEW_LINE>h = d.height;<NEW_LINE>bimg = (BufferedImage) createImage(w, h);<NEW_LINE>big = bimg.createGraphics();<NEW_LINE>big.setFont(font);<NEW_LINE>FontMetrics <MASK><NEW_LINE>ascent = (int) fm.getAscent();<NEW_LINE>descent = (int) fm.getDescent();<NEW_LINE>}<NEW_LINE>repaint();<NEW_LINE>try {<NEW_LINE>thread.sleep(sleepAmount);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (MemoryMonitor5.dateStampCB.isSelected()) {<NEW_LINE>System.out.println(new Date().toString() + " " + usedStr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>thread = null;<NEW_LINE>} | fm = big.getFontMetrics(font); |
1,067,945 | private ColumnPrinter build(Map<String, Entry> entries) {<NEW_LINE>ColumnPrinter printer = new ColumnPrinter();<NEW_LINE>printer.addColumn("PROPERTY");<NEW_LINE>printer.addColumn("FIELD");<NEW_LINE>printer.addColumn("DEFAULT");<NEW_LINE>printer.addColumn("VALUE");<NEW_LINE>printer.addColumn("DESCRIPTION");<NEW_LINE>Map<String, Entry> sortedEntries = Maps.newTreeMap();<NEW_LINE>sortedEntries.putAll(entries);<NEW_LINE>for (Entry entry : sortedEntries.values()) {<NEW_LINE>printer.addValue(0, entry.configurationName);<NEW_LINE>printer.addValue(1, entry.field.getDeclaringClass().getName() + "#" + <MASK><NEW_LINE>printer.addValue(2, entry.defaultValue);<NEW_LINE>printer.addValue(3, entry.has ? entry.value : "");<NEW_LINE>printer.addValue(4, entry.documentation);<NEW_LINE>}<NEW_LINE>return printer;<NEW_LINE>} | entry.field.getName()); |
1,005,709 | public void onComplete() {<NEW_LINE>if (lengthOptimization) {<NEW_LINE>LOGGER.finest(() -> "(client reqID: " + requestId + ") " + "Message body contains only one data chunk. Setting chunked encoding to false.");<NEW_LINE>HttpUtil.setTransferEncodingChunked(request, false);<NEW_LINE>if (!HttpUtil.isContentLengthSet(request)) {<NEW_LINE>if (firstDataChunk != null) {<NEW_LINE>HttpUtil.setContentLength(request, firstDataChunk.remaining());<NEW_LINE>} else if (EMPTY_CONTENT_LENGTH.contains(request.method())) {<NEW_LINE>HttpUtil.setContentLength(request, 0);<NEW_LINE>}<NEW_LINE>} else if (HttpUtil.getContentLength(request) == 0 && firstDataChunk != null) {<NEW_LINE>HttpUtil.setContentLength(request, firstDataChunk.remaining());<NEW_LINE>}<NEW_LINE>channel.write(true, request);<NEW_LINE>if (firstDataChunk != null) {<NEW_LINE>sendData(firstDataChunk);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>LOGGER.finest(() -> "(client reqID: " + requestId + ") Sending last http content");<NEW_LINE>channel.write(true, LAST_HTTP_CONTENT, f -> f.addListener(completeOnFailureListener("(client reqID: " + requestId + ") " + "An exception occurred when writing last http content.")).addListener(ChannelFutureListener.CLOSE_ON_FAILURE).addListener(future -> {<NEW_LINE>if (future.isSuccess()) {<NEW_LINE>sent.complete(serviceRequest);<NEW_LINE>LOGGER.finest(() -> "(client reqID: " + requestId + ") Request sent");<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>} | WebClientServiceRequest serviceRequest = channel.serviceRequest(); |
418,044 | public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {<NEW_LINE>if (!pattern.matcher(file.toString()).matches()) {<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>} else if (!file.toString().endsWith(".java")) {<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>try (InputStream stream = Files.newInputStream(file)) {<NEW_LINE>JavaUnit unit = Roaster.parseUnit(stream);<NEW_LINE>JavaType myClass = unit.getGoverningType();<NEW_LINE>if (!(myClass instanceof JavaEnumImpl)) {<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>JavaEnumImpl myEnum = (JavaEnumImpl) myClass;<NEW_LINE>if (!myEnum.getInterfaces().contains(DocumentedSpan.class.getCanonicalName())) {<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>System.out.println("Checking [" + <MASK><NEW_LINE>if (myEnum.getEnumConstants().size() == 0) {<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>for (EnumConstantSource enumConstant : myEnum.getEnumConstants()) {<NEW_LINE>SpanEntry entry = parseSpan(enumConstant, myEnum);<NEW_LINE>if (entry != null) {<NEW_LINE>spanEntries.add(entry);<NEW_LINE>System.out.println("Found [" + entry.tagKeys.size() + "] tags and [" + entry.events.size() + "] events");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>} | myEnum.getName() + "]"); |
1,791,676 | public void demask() {<NEW_LINE>if (isMasked() && hasPayload()) {<NEW_LINE>int maskInt = 0;<NEW_LINE>for (byte maskByte : mask) {<NEW_LINE>maskInt = (maskInt << 8) + (maskByte & 0xFF);<NEW_LINE>}<NEW_LINE>int maskOffset = 0;<NEW_LINE>int start = payload.position();<NEW_LINE>int end = payload.limit();<NEW_LINE>int offset = maskOffset;<NEW_LINE>int remaining;<NEW_LINE>while ((remaining = end - start) > 0) {<NEW_LINE>if (remaining >= 4 && (offset & 3) == 0) {<NEW_LINE>payload.putInt(start, payload<MASK><NEW_LINE>start += 4;<NEW_LINE>offset += 4;<NEW_LINE>} else {<NEW_LINE>payload.put(start, (byte) (payload.get(start) ^ mask[offset & 3]));<NEW_LINE>++start;<NEW_LINE>++offset;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Arrays.fill(mask, (byte) 0);<NEW_LINE>}<NEW_LINE>} | .getInt(start) ^ maskInt); |
829,800 | public void visit(BLangWorkerFlushExpr workerFlushExpr, AnalyzerData data) {<NEW_LINE>// Two scenarios should be handled<NEW_LINE>// 1) flush w1 -> Wait till all the asynchronous sends to worker w1 is completed<NEW_LINE>// 2) flush -> Wait till all asynchronous sends to all workers are completed<NEW_LINE>BLangIdentifier flushWrkIdentifier = workerFlushExpr.workerIdentifier;<NEW_LINE>Stack<WorkerActionSystem> workerActionSystems = data.workerActionSystemStack;<NEW_LINE>WorkerActionSystem currentWrkerAction = workerActionSystems.peek();<NEW_LINE>List<BLangWorkerSend> sendStmts = getAsyncSendStmtsOfWorker(currentWrkerAction);<NEW_LINE>if (flushWrkIdentifier != null) {<NEW_LINE>List<BLangWorkerSend> sendsToGivenWrkr = sendStmts.stream().filter(bLangNode -> bLangNode.workerIdentifier.equals(flushWrkIdentifier)).collect(Collectors.toList());<NEW_LINE>if (sendsToGivenWrkr.size() == 0) {<NEW_LINE>this.dlog.error(workerFlushExpr.pos, DiagnosticErrorCode.INVALID_WORKER_FLUSH_FOR_WORKER, workerFlushExpr.workerSymbol, currentWrkerAction.currentWorkerId());<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>sendStmts = sendsToGivenWrkr;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (sendStmts.size() == 0) {<NEW_LINE>this.dlog.error(workerFlushExpr.pos, DiagnosticErrorCode.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>workerFlushExpr.cachedWorkerSendStmts = sendStmts;<NEW_LINE>validateActionParentNode(workerFlushExpr.pos, workerFlushExpr);<NEW_LINE>} | INVALID_WORKER_FLUSH, currentWrkerAction.currentWorkerId()); |
525,976 | public Set<Command> findCommandsMatchingCriterion(@Valid final Criterion criterion, final boolean addDefaultStatus) {<NEW_LINE>final Criterion finalCriterion;<NEW_LINE>if (addDefaultStatus && !criterion.getStatus().isPresent()) {<NEW_LINE>finalCriterion = new Criterion(criterion, CommandStatus.ACTIVE.name());<NEW_LINE>} else {<NEW_LINE>finalCriterion = criterion;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>final CriteriaBuilder criteriaBuilder = this.entityManager.getCriteriaBuilder();<NEW_LINE>final CriteriaQuery<CommandEntity> criteriaQuery = criteriaBuilder.createQuery(CommandEntity.class);<NEW_LINE>final Root<CommandEntity> queryRoot = criteriaQuery.from(CommandEntity.class);<NEW_LINE>criteriaQuery.where(CommandPredicates.findCommandsMatchingCriterion(queryRoot, criteriaQuery, criteriaBuilder, finalCriterion));<NEW_LINE>return this.entityManager.createQuery(criteriaQuery).setHint(LOAD_GRAPH_HINT, this.entityManager.getEntityGraph(CommandEntity.DTO_ENTITY_GRAPH)).getResultStream().map(EntityV4DtoConverters::toV4CommandDto).collect(Collectors.toSet());<NEW_LINE>} | log.debug("[findCommandsMatchingCriterion] Called to find commands matching {}", finalCriterion); |
1,479,893 | protected void apply(BaseInjection other) {<NEW_LINE>final String displayName = myNameTextField.getText();<NEW_LINE>if (StringUtil.isEmpty(displayName)) {<NEW_LINE>throw new IllegalArgumentException("Display name should not be empty");<NEW_LINE>}<NEW_LINE>other.setDisplayName(displayName);<NEW_LINE>boolean enabled = true;<NEW_LINE>final StringBuilder sb = new StringBuilder();<NEW_LINE>final ArrayList<InjectionPlace> places = new ArrayList<InjectionPlace>();<NEW_LINE>for (String s : myTextArea.getText().split("\\s*\n\\s*")) {<NEW_LINE>final boolean nextEnabled;<NEW_LINE>if (s.startsWith("+")) {<NEW_LINE>nextEnabled = true;<NEW_LINE>s = s.substring(1).trim();<NEW_LINE>} else if (s.startsWith("-")) {<NEW_LINE>nextEnabled = false;<NEW_LINE>s = s.substring(1).trim();<NEW_LINE>} else {<NEW_LINE>sb.append(s.trim());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (sb.length() > 0) {<NEW_LINE>final String text = sb.toString();<NEW_LINE>places.add(new InjectionPlace(myHelper.compileElementPattern(text), enabled));<NEW_LINE>sb.setLength(0);<NEW_LINE>}<NEW_LINE>sb.append(s);<NEW_LINE>enabled = nextEnabled;<NEW_LINE>}<NEW_LINE>if (sb.length() > 0) {<NEW_LINE>final String text = sb.toString();<NEW_LINE>places.add(new InjectionPlace(myHelper.compileElementPattern(text), enabled));<NEW_LINE>}<NEW_LINE>for (InjectionPlace place : places) {<NEW_LINE>ElementPattern<PsiElement> pattern = place.getElementPattern();<NEW_LINE>if (pattern instanceof PatternCompilerImpl.LazyPresentablePattern) {<NEW_LINE>try {<NEW_LINE>((PatternCompilerImpl.<MASK><NEW_LINE>} catch (Throwable ex) {<NEW_LINE>throw (RuntimeException) new IllegalArgumentException("Pattern failed to compile:").initCause(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>other.setInjectionPlaces(places.toArray(new InjectionPlace[places.size()]));<NEW_LINE>} | LazyPresentablePattern) pattern).compile(); |
1,597,196 | public final MergeMatchedContext mergeMatched() throws RecognitionException {<NEW_LINE>MergeMatchedContext _localctx = new MergeMatchedContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 46, RULE_mergeMatched);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(787);<NEW_LINE>match(WHEN);<NEW_LINE>setState(788);<NEW_LINE>match(MATCHED);<NEW_LINE>setState(791);<NEW_LINE>_errHandler.sync(this);<NEW_LINE><MASK><NEW_LINE>if (_la == AND_EXPR) {<NEW_LINE>{<NEW_LINE>setState(789);<NEW_LINE>match(AND_EXPR);<NEW_LINE>setState(790);<NEW_LINE>expression();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(794);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>do {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(793);<NEW_LINE>mergeMatchedItem();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(796);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>} while (_la == THEN);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | _la = _input.LA(1); |
1,707,784 | private Mono<Response<Enum0>> checkServiceProviderAvailabilityWithResponseAsync(CheckServiceProviderAvailabilityInput checkServiceProviderAvailabilityInput) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (checkServiceProviderAvailabilityInput == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>} else {<NEW_LINE>checkServiceProviderAvailabilityInput.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.checkServiceProviderAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), checkServiceProviderAvailabilityInput, accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>} | error(new IllegalArgumentException("Parameter checkServiceProviderAvailabilityInput is required and cannot be null.")); |
1,356,567 | final DeleteDevEndpointResult executeDeleteDevEndpoint(DeleteDevEndpointRequest deleteDevEndpointRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDevEndpointRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDevEndpointRequest> request = null;<NEW_LINE>Response<DeleteDevEndpointResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDevEndpointRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDevEndpointRequest));<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, "Glue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDevEndpoint");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDevEndpointResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDevEndpointResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
104,861 | public void createCheckpoint(String targetPath) {<NEW_LINE>Path parentName = Paths.get(targetPath).getParent().getFileName();<NEW_LINE>assert parentName.toString().startsWith("snapshot") : targetPath;<NEW_LINE>// https://github.com/facebook/rocksdb/wiki/Checkpoints<NEW_LINE>try (Checkpoint checkpoint = Checkpoint.create(this.rocksdb)) {<NEW_LINE>String tempPath = targetPath + "_temp";<NEW_LINE>File tempFile = new File(tempPath);<NEW_LINE>FileUtils.deleteDirectory(tempFile);<NEW_LINE>LOG.debug("Deleted temp directory {}", tempFile);<NEW_LINE>FileUtils.forceMkdir(tempFile.getParentFile());<NEW_LINE>checkpoint.createCheckpoint(tempPath);<NEW_LINE><MASK><NEW_LINE>FileUtils.deleteDirectory(snapshotFile);<NEW_LINE>LOG.debug("Deleted stale directory {}", snapshotFile);<NEW_LINE>if (!tempFile.renameTo(snapshotFile)) {<NEW_LINE>throw new IOException(String.format("Failed to rename %s to %s", tempFile, snapshotFile));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new BackendException("Failed to create checkpoint at path %s", e, targetPath);<NEW_LINE>}<NEW_LINE>} | File snapshotFile = new File(targetPath); |
564,770 | public LogicalSubQueryPlan buildLogicalQueryPlan(ContextManager contextManager) {<NEW_LINE>TreeNodeLabelManager labelManager = contextManager.getTreeNodeLabelManager();<NEW_LINE>VertexIdManager vertexIdManager = contextManager.getVertexIdManager();<NEW_LINE>QueryFlowOuterClass.OperatorType operatorType = <MASK><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, sumVertex, new LogicalEdge());<NEW_LINE>LogicalVertex outputVertex = processJoinZeroVertex(vertexIdManager, logicalSubQueryPlan, sumVertex, isJoinZeroFlag());<NEW_LINE>setFinishVertex(outputVertex, labelManager);<NEW_LINE>return logicalSubQueryPlan;<NEW_LINE>} | getUseKeyOperator(QueryFlowOuterClass.OperatorType.SUM); |
877,185 | private void prepareReadingSession(FeedSet fs, StateFilter stateFilter, ReadFilter readFilter) {<NEW_LINE>// a selection filter that will be used to pull active story hashes from the stories table into the reading session table<NEW_LINE>StringBuilder sel = new StringBuilder();<NEW_LINE>// any selection args that need to be used within the inner select statement<NEW_LINE>ArrayList<String> selArgs = new ArrayList<String>();<NEW_LINE>getLocalStorySelectionAndArgs(sel, <MASK><NEW_LINE>// use the inner select statement to push the active hashes into the session table<NEW_LINE>StringBuilder q = new StringBuilder("INSERT INTO " + DatabaseConstants.READING_SESSION_TABLE);<NEW_LINE>q.append(" (" + DatabaseConstants.READING_SESSION_STORY_HASH + ") ");<NEW_LINE>q.append(sel);<NEW_LINE>synchronized (RW_MUTEX) {<NEW_LINE>dbRW.execSQL(q.toString(), selArgs.toArray(new String[selArgs.size()]));<NEW_LINE>}<NEW_LINE>} | selArgs, fs, stateFilter, readFilter); |
655,504 | protected Bundle doInBackground(Bundle... params) {<NEW_LINE>Bundle result = new Bundle();<NEW_LINE>try {<NEW_LINE>LinkedInApiClient apiClient = mLinkedInApiClientFactory.createLinkedInApiClient(mSharedPreferences.getString(SAVE_STATE_KEY_OAUTH_TOKEN, ""), mSharedPreferences.getString(SAVE_STATE_KEY_OAUTH_SECRET, ""));<NEW_LINE>ArrayList<String> friendIds = new ArrayList<String>();<NEW_LINE>ArrayList<SocialPerson> socialPersons = new ArrayList<SocialPerson>();<NEW_LINE>SocialPerson socialPerson = new SocialPerson();<NEW_LINE>Connections connections = apiClient.getConnectionsForCurrentUser();<NEW_LINE>if (connections.getPersonList() != null)<NEW_LINE>for (Person person : connections.getPersonList()) {<NEW_LINE>if (person.getId() != null) {<NEW_LINE>friendIds.add(person.getId());<NEW_LINE>}<NEW_LINE>getSocialPerson(socialPerson, person);<NEW_LINE>socialPersons.add(socialPerson);<NEW_LINE>socialPerson = new SocialPerson();<NEW_LINE>}<NEW_LINE>result.putStringArray(RESULT_GET_FRIENDS_ID, friendIds.toArray(new String[friendIds.size()]));<NEW_LINE>result.putParcelableArrayList(RESULT_GET_FRIENDS, socialPersons);<NEW_LINE>} catch (Exception e) {<NEW_LINE>result.putString(<MASK><NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | RESULT_ERROR, e.getMessage()); |
1,284,945 | private void loadNode109() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.Server_SetSubscriptionDurable_OutputArguments, new QualifiedName(0, "OutputArguments"), new LocalizedText("en", "OutputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.Server_SetSubscriptionDurable_OutputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_SetSubscriptionDurable_OutputArguments, Identifiers.HasProperty, Identifiers.Server_SetSubscriptionDurable<MASK><NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>RevisedLifetimeInHours</Name><DataType><Identifier>i=7</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), false)); |
1,457,876 | private void installUpdater() {<NEW_LINE>if (ApplicationManager.getApplication().isUnitTestMode() || myPopup.isDisposed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Alarm alarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD, myPopup);<NEW_LINE>alarm.addRequest(new Runnable() {<NEW_LINE><NEW_LINE>String filter = "";<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>alarm.cancelAllRequests();<NEW_LINE>String prefix = mySpeedSearch.getEnteredPrefix();<NEW_LINE>myTree.getEmptyText().setText(StringUtil.isEmpty(prefix) ? "Structure is empty" : "'" + prefix + "' not found");<NEW_LINE>if (prefix == null)<NEW_LINE>prefix = "";<NEW_LINE>if (!filter.equals(prefix)) {<NEW_LINE>boolean isBackspace = prefix.length() < filter.length();<NEW_LINE>filter = prefix;<NEW_LINE>rebuild(true).onProcessed(ignore -> UIUtil.invokeLaterIfNeeded(() -> {<NEW_LINE>if (isDisposed())<NEW_LINE>return;<NEW_LINE>TreeUtil.promiseExpandAll(myTree);<NEW_LINE>if (isBackspace && handleBackspace(filter)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (myFilteringStructure.getRootElement().getChildren().length == 0) {<NEW_LINE>for (JBCheckBox box : myCheckBoxes.values()) {<NEW_LINE>if (!box.isSelected()) {<NEW_LINE>myAutoClicked.add(box);<NEW_LINE>myTriggeredCheckboxes.add(0, Pair<MASK><NEW_LINE>box.doClick();<NEW_LINE>filter = "";<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>if (!alarm.isDisposed()) {<NEW_LINE>alarm.addRequest(this, 300);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, 300);<NEW_LINE>} | .create(filter, box)); |
224,411 | public void seekModule(char[] name, boolean prefixMatch, IJavaElementRequestor requestor) {<NEW_LINE>IPrefixMatcherCharArray prefixMatcher = prefixMatch ? CharOperation.equals(name, CharOperation.ALL_PREFIX) ? (x, y, isCaseSensitive) -> true : CharOperation::prefixEquals : CharOperation::equals;<NEW_LINE>int count = this.packageFragmentRoots.length;<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>if (requestor.isCanceled())<NEW_LINE>return;<NEW_LINE>IPackageFragmentRoot root = this.packageFragmentRoots[i];<NEW_LINE>IModuleDescription module = null;<NEW_LINE>if (root instanceof JrtPackageFragmentRoot) {<NEW_LINE>if (!prefixMatcher.matches(name, root.getElementName().toCharArray(), false)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>module = getModuleDescription(root, this.<MASK><NEW_LINE>if (module != null && prefixMatcher.matches(name, module.getElementName().toCharArray(), false)) {<NEW_LINE>requestor.acceptModule(module);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | rootToModule, this.rootToResolvedEntries::get); |
1,489,773 | public Message toProtoMessage() {<NEW_LINE>final protobuf.TradingPeer.Builder builder = protobuf.TradingPeer.newBuilder().setChangeOutputValue(changeOutputValue);<NEW_LINE>Optional.ofNullable(accountId).ifPresent(builder::setAccountId);<NEW_LINE>Optional.ofNullable(paymentAccountPayload).ifPresent(e -> builder.setPaymentAccountPayload((protobuf.PaymentAccountPayload) e.toProtoMessage()));<NEW_LINE>Optional.ofNullable(payoutAddressString).ifPresent(builder::setPayoutAddressString);<NEW_LINE>Optional.ofNullable(contractAsJson<MASK><NEW_LINE>Optional.ofNullable(contractSignature).ifPresent(builder::setContractSignature);<NEW_LINE>Optional.ofNullable(signature).ifPresent(e -> builder.setSignature(ByteString.copyFrom(e)));<NEW_LINE>Optional.ofNullable(pubKeyRing).ifPresent(e -> builder.setPubKeyRing(e.toProtoMessage()));<NEW_LINE>Optional.ofNullable(multiSigPubKey).ifPresent(e -> builder.setMultiSigPubKey(ByteString.copyFrom(e)));<NEW_LINE>Optional.ofNullable(rawTransactionInputs).ifPresent(e -> builder.addAllRawTransactionInputs(ProtoUtil.collectionToProto(e, protobuf.RawTransactionInput.class)));<NEW_LINE>Optional.ofNullable(changeOutputAddress).ifPresent(builder::setChangeOutputAddress);<NEW_LINE>Optional.ofNullable(accountAgeWitnessNonce).ifPresent(e -> builder.setAccountAgeWitnessNonce(ByteString.copyFrom(e)));<NEW_LINE>Optional.ofNullable(accountAgeWitnessSignature).ifPresent(e -> builder.setAccountAgeWitnessSignature(ByteString.copyFrom(e)));<NEW_LINE>Optional.ofNullable(mediatedPayoutTxSignature).ifPresent(e -> builder.setMediatedPayoutTxSignature(ByteString.copyFrom(e)));<NEW_LINE>Optional.ofNullable(hashOfPaymentAccountPayload).ifPresent(e -> builder.setHashOfPaymentAccountPayload(ByteString.copyFrom(e)));<NEW_LINE>builder.setCurrentDate(currentDate);<NEW_LINE>return builder.build();<NEW_LINE>} | ).ifPresent(builder::setContractAsJson); |
421,304 | public void paint(Graphics g) {<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>if (g2 == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>// g2.setRenderingHint(RenderingHints.KEY_RENDERING,<NEW_LINE>// RenderingHints.VALUE_RENDER_QUALITY);<NEW_LINE>int sweep_angle = (int) (((float) value * 360) / 100);<NEW_LINE>g2.setColor(Color.GRAY);<NEW_LINE>g2.setStroke(stroke);<NEW_LINE>g2.drawArc(padding, padding, getWidth() - 2 * padding, getHeight() - 2 * padding, getScaledInt(90), -360);<NEW_LINE>// g2.drawArc(2, 2, getWidth() - 12, getHeight() - 12, 90, -360);<NEW_LINE>if (value > 0) {<NEW_LINE>g2.setColor(foreColor);<NEW_LINE>// g2.drawArc(2, 2, getWidth() - 12, getHeight() - 12, 90,<NEW_LINE>// -sweep_angle);<NEW_LINE>g2.drawArc(padding, padding, getWidth() - 2 * padding, getHeight() - 2 * padding, getScaledInt(90), -sweep_angle);<NEW_LINE>}<NEW_LINE>g2.<MASK><NEW_LINE>FontMetrics fm = g2.getFontMetrics();<NEW_LINE>String str = value + "%";<NEW_LINE>// fm.stringWidth(str);<NEW_LINE>int w = (int) fm.getStringBounds(str, g2).getWidth();<NEW_LINE>LineMetrics lm = fm.getLineMetrics(str, g2);<NEW_LINE>int h = (int) (lm.getAscent() + lm.getDescent());<NEW_LINE>g2.drawString(str, (getWidth() - w) / 2, ((getHeight() + h) / 2) - lm.getDescent());<NEW_LINE>} | setFont(FontResource.getItemFont()); |
1,417,771 | private void init() throws UpdateFailedException {<NEW_LINE>_resolver = new Utils.Resolver(_descriptor.variables);<NEW_LINE>_resolver.put("application", _descriptor.name);<NEW_LINE>_origVariables = _descriptor.variables;<NEW_LINE>_origDescription = _descriptor.description;<NEW_LINE>_origDistrib = _descriptor.distrib.clone();<NEW_LINE>_propertySets = new PropertySets(this, _descriptor.propertySets);<NEW_LINE>_replicaGroups = new ReplicaGroups(this, _descriptor.replicaGroups);<NEW_LINE>_serviceTemplates = new ServiceTemplates(this, _descriptor.serviceTemplates);<NEW_LINE>_serverTemplates = new ServerTemplates(this, _descriptor.serverTemplates);<NEW_LINE>_nodes = new Nodes(this, _descriptor.nodes);<NEW_LINE>_children.add(_nodes);<NEW_LINE>_children.add(_propertySets);<NEW_LINE>_children.add(_replicaGroups);<NEW_LINE>_children.add(_serverTemplates);<NEW_LINE>_children.add(_serviceTemplates);<NEW_LINE>_tree <MASK><NEW_LINE>_treeModel = (DefaultTreeModel) _tree.getModel();<NEW_LINE>//<NEW_LINE>// Rebind "copy" and "paste"<NEW_LINE>//<NEW_LINE>javax.swing.ActionMap am = _tree.getActionMap();<NEW_LINE>am.put("copy", _coordinator.getActionsForMenu().get(COPY));<NEW_LINE>am.put("paste", _coordinator.getActionsForMenu().get(PASTE));<NEW_LINE>} | = new JTree(this, true); |
1,766,539 | @Transactional<NEW_LINE>@Path("async-with-completion-stage")<NEW_LINE>public CompletionStage<Integer> async2() throws SystemException {<NEW_LINE>System.out.printf("submitting async job ...%n");<NEW_LINE>ContextManagerProvider cmp <MASK><NEW_LINE>ManagedExecutor me = cmp.getContextManager().newManagedExecutorBuilder().propagated(ThreadContext.TRANSACTION).build();<NEW_LINE>Transaction txnToPropagate = TransactionManager.transactionManager().getTransaction();<NEW_LINE>return me.supplyAsync(() -> {<NEW_LINE>try {<NEW_LINE>Transaction txn = TransactionManager.transactionManager().getTransaction();<NEW_LINE>if (!txn.equals(txnToPropagate)) {<NEW_LINE>// the original transaction, txnToPropagate, should have been propagated to the new thread<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>// should return Status.STATUS_ACTIVE<NEW_LINE>return getTransactionStatus();<NEW_LINE>} catch (SystemException e) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | = ContextManagerProvider.INSTANCE.get(); |
327,029 | private static Query stringMatch(LuceneQueryBuilder.Context context, List<Symbol> arguments, Object queryTerm) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, Object> fields = (Map) ((Literal) arguments.get(0)).value();<NEW_LINE>String queryString = (String) queryTerm;<NEW_LINE>String matchType = (String) ((Literal) arguments.get(2)).value();<NEW_LINE>// noinspection unchecked<NEW_LINE>Map<String, Object> options = (Map<String, Object>) ((Literal) arguments.get(3)).value();<NEW_LINE>MatchOptionsAnalysis.validate(options);<NEW_LINE>if (fields.size() == 1) {<NEW_LINE>return singleMatchQuery(context.queryShardContext(), fields.entrySet().iterator().next(), queryString, matchType, options);<NEW_LINE>} else {<NEW_LINE>fields.replaceAll((s, o) -> {<NEW_LINE>if (o instanceof Number) {<NEW_LINE>return ((Number) o).floatValue();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>// noinspection unchecked<NEW_LINE>return MatchQueries.multiMatch(context.queryShardContext(), matchType, (Map<String, Float>) (<MASK><NEW_LINE>}<NEW_LINE>} | Map) fields, queryString, options); |
1,606,049 | public static void endTrack(final String title) {<NEW_LINE>if (isClosed) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// --Make Task<NEW_LINE>final long timestamp = System.currentTimeMillis();<NEW_LINE>Runnable endTrack = () -> {<NEW_LINE>assert <MASK><NEW_LINE>String expected = titleStack.pop();<NEW_LINE>// (check name match)<NEW_LINE>if (!isThreaded && !expected.equalsIgnoreCase(title)) {<NEW_LINE>log(Flag.ERROR, "Track names do not match: expected: " + expected + " found: " + title);<NEW_LINE>// throw new IllegalArgumentException("Track names do not match: expected: " + expected + " found: " + title);<NEW_LINE>}<NEW_LINE>// (decrement depth)<NEW_LINE>depth -= 1;<NEW_LINE>// (send signal)<NEW_LINE>handlers.process(null, MessageType.END_TRACK, depth, timestamp);<NEW_LINE>assert !isThreaded || control.isHeldByCurrentThread();<NEW_LINE>};<NEW_LINE>// --Run Task<NEW_LINE>if (isThreaded) {<NEW_LINE>// (case: multithreaded)<NEW_LINE>long threadId = Thread.currentThread().getId();<NEW_LINE>attemptThreadControl(threadId, endTrack);<NEW_LINE>} else {<NEW_LINE>// (case: no threading)<NEW_LINE>endTrack.run();<NEW_LINE>}<NEW_LINE>} | !isThreaded || control.isHeldByCurrentThread(); |
695,394 | public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {<NEW_LINE>SearchRequest countRequest = new SearchRequest(Strings.splitStringByCommaToArray(request.param("index")));<NEW_LINE>countRequest.indicesOptions(IndicesOptions.fromRequest(request, countRequest.indicesOptions()));<NEW_LINE>SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder().size(0);<NEW_LINE>countRequest.source(searchSourceBuilder);<NEW_LINE>request.withContentOrSourceParamParserOrNull(parser -> {<NEW_LINE>if (parser == null) {<NEW_LINE>QueryBuilder queryBuilder = RestActions.urlParamsToQueryBuilder(request);<NEW_LINE>if (queryBuilder != null) {<NEW_LINE>searchSourceBuilder.query(queryBuilder);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>searchSourceBuilder.query(RestActions.getQueryContent(parser));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>countRequest.routing(request.param("routing"));<NEW_LINE>float minScore = request.paramAsFloat("min_score", -1f);<NEW_LINE>if (minScore != -1f) {<NEW_LINE>searchSourceBuilder.minScore(minScore);<NEW_LINE>}<NEW_LINE>countRequest.types(Strings.splitStringByCommaToArray(request.param("type")));<NEW_LINE>countRequest.preference(request.param("preference"));<NEW_LINE>final int terminateAfter = request.paramAsInt("terminate_after", DEFAULT_TERMINATE_AFTER);<NEW_LINE>if (terminateAfter < 0) {<NEW_LINE>throw new IllegalArgumentException("terminateAfter must be > 0");<NEW_LINE>} else if (terminateAfter > 0) {<NEW_LINE>searchSourceBuilder.terminateAfter(terminateAfter);<NEW_LINE>}<NEW_LINE>return channel -> client.search(countRequest, new RestBuilderListener<SearchResponse>(channel) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public RestResponse buildResponse(SearchResponse response, XContentBuilder builder) throws Exception {<NEW_LINE>builder.startObject();<NEW_LINE>if (terminateAfter != DEFAULT_TERMINATE_AFTER) {<NEW_LINE>builder.field("terminated_early", response.isTerminatedEarly());<NEW_LINE>}<NEW_LINE>builder.field("count", response.getHits().getTotalHits());<NEW_LINE>buildBroadcastShardsHeader(builder, request, response.getTotalShards(), response.getSuccessfulShards(), 0, response.getFailedShards(<MASK><NEW_LINE>builder.endObject();<NEW_LINE>return new BytesRestResponse(response.status(), builder);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ), response.getShardFailures()); |
1,814,319 | private void resizeVolume(VolumeInfo volumeInfo) {<NEW_LINE>LOGGER.debug("Resizing PowerFlex volume");<NEW_LINE>Preconditions.checkArgument(volumeInfo != null, "volumeInfo cannot be null");<NEW_LINE>try {<NEW_LINE>String scaleIOVolumeId = ScaleIOUtil.getVolumePath(volumeInfo.getPath());<NEW_LINE>Long storagePoolId = volumeInfo.getPoolId();<NEW_LINE>ResizeVolumePayload payload = (ResizeVolumePayload) volumeInfo.getpayload();<NEW_LINE>long newSizeInBytes = payload.newSize != null ? payload.newSize : volumeInfo.getSize();<NEW_LINE>// Only increase size is allowed and size should be specified in granularity of 8 GB<NEW_LINE>if (newSizeInBytes <= volumeInfo.getSize()) {<NEW_LINE>throw new CloudRuntimeException("Only increase size is allowed for volume: " + volumeInfo.getName());<NEW_LINE>}<NEW_LINE>org.apache.cloudstack.storage.datastore.api.Volume scaleIOVolume = null;<NEW_LINE>long newSizeInGB = newSizeInBytes / (1024 * 1024 * 1024);<NEW_LINE>long newSizeIn8gbBoundary = (long) (Math.ceil(newSizeInGB / 8.0) * 8.0);<NEW_LINE>final ScaleIOGatewayClient client = getScaleIOClient(storagePoolId);<NEW_LINE>scaleIOVolume = client.resizeVolume<MASK><NEW_LINE>if (scaleIOVolume == null) {<NEW_LINE>throw new CloudRuntimeException("Failed to resize volume: " + volumeInfo.getName());<NEW_LINE>}<NEW_LINE>VolumeVO volume = volumeDao.findById(volumeInfo.getId());<NEW_LINE>long oldVolumeSize = volume.getSize();<NEW_LINE>volume.setSize(scaleIOVolume.getSizeInKb() * 1024);<NEW_LINE>volumeDao.update(volume.getId(), volume);<NEW_LINE>StoragePoolVO storagePool = storagePoolDao.findById(storagePoolId);<NEW_LINE>long capacityBytes = storagePool.getCapacityBytes();<NEW_LINE>long usedBytes = storagePool.getUsedBytes();<NEW_LINE>long newVolumeSize = volume.getSize();<NEW_LINE>usedBytes += newVolumeSize - oldVolumeSize;<NEW_LINE>storagePool.setUsedBytes(usedBytes > capacityBytes ? capacityBytes : usedBytes);<NEW_LINE>storagePoolDao.update(storagePoolId, storagePool);<NEW_LINE>} catch (Exception e) {<NEW_LINE>String errMsg = "Unable to resize PowerFlex volume: " + volumeInfo.getId() + " due to " + e.getMessage();<NEW_LINE>LOGGER.warn(errMsg);<NEW_LINE>throw new CloudRuntimeException(errMsg, e);<NEW_LINE>}<NEW_LINE>} | (scaleIOVolumeId, (int) newSizeIn8gbBoundary); |
1,691,813 | private void convertCodeSystemCodesToCsv(List<CodeSystem.ConceptDefinitionComponent> theConcept, Map<String, String> theCodes, Map<String, List<CodeSystem.ConceptPropertyComponent>> theProperties, String theParentCode, Multimap<String, String> theCodeToParentCodes) {<NEW_LINE>for (CodeSystem.ConceptDefinitionComponent nextConcept : theConcept) {<NEW_LINE>if (isNotBlank(nextConcept.getCode())) {<NEW_LINE>theCodes.put(nextConcept.getCode(), nextConcept.getDisplay());<NEW_LINE>if (isNotBlank(theParentCode)) {<NEW_LINE>theCodeToParentCodes.put(<MASK><NEW_LINE>}<NEW_LINE>if (nextConcept.getProperty() != null) {<NEW_LINE>theProperties.put(nextConcept.getCode(), nextConcept.getProperty());<NEW_LINE>}<NEW_LINE>convertCodeSystemCodesToCsv(nextConcept.getConcept(), theCodes, theProperties, nextConcept.getCode(), theCodeToParentCodes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | nextConcept.getCode(), theParentCode); |
571,210 | public void init() {<NEW_LINE>photos = service.getPhotos();<NEW_LINE>responsiveOptions1 = new ArrayList<>();<NEW_LINE>responsiveOptions1.add(new ResponsiveOption("1024px", 5));<NEW_LINE>responsiveOptions1.add(new ResponsiveOption("768px", 3));<NEW_LINE>responsiveOptions1.add(new ResponsiveOption("560px", 1));<NEW_LINE><MASK><NEW_LINE>responsiveOptions2.add(new ResponsiveOption("1024px", 5));<NEW_LINE>responsiveOptions2.add(new ResponsiveOption("960px", 4));<NEW_LINE>responsiveOptions2.add(new ResponsiveOption("768px", 3));<NEW_LINE>responsiveOptions2.add(new ResponsiveOption("560px", 1));<NEW_LINE>responsiveOptions3 = new ArrayList<>();<NEW_LINE>responsiveOptions3.add(new ResponsiveOption("1500px", 5));<NEW_LINE>responsiveOptions3.add(new ResponsiveOption("1024px", 3));<NEW_LINE>responsiveOptions3.add(new ResponsiveOption("768px", 2));<NEW_LINE>responsiveOptions3.add(new ResponsiveOption("560px", 1));<NEW_LINE>} | responsiveOptions2 = new ArrayList<>(); |
620,565 | protected String generateSyntaxIncorrectAST() {<NEW_LINE>// create some dummy source to generate an ast node<NEW_LINE>StringBuilder buff = new StringBuilder();<NEW_LINE>IType type = getType();<NEW_LINE>String lineSeparator = org.eclipse.jdt.internal.core.util.Util.getLineSeparator(this.source, type == null ? null : type.getJavaProject());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>buff.append(lineSeparator + " public class A {" + lineSeparator);<NEW_LINE>buff.append(this.source);<NEW_LINE>buff.append(lineSeparator).append('}');<NEW_LINE>ASTParser parser = ASTParser.newParser(getLatestASTLevel());<NEW_LINE>parser.setSource(buff.<MASK><NEW_LINE>CompilationUnit compilationUnit = (CompilationUnit) parser.createAST(null);<NEW_LINE>TypeDeclaration typeDeclaration = (TypeDeclaration) compilationUnit.types().iterator().next();<NEW_LINE>List bodyDeclarations = typeDeclaration.bodyDeclarations();<NEW_LINE>if (bodyDeclarations.size() != 0)<NEW_LINE>this.createdNode = (ASTNode) bodyDeclarations.iterator().next();<NEW_LINE>return buff.toString();<NEW_LINE>} | toString().toCharArray()); |
1,288,502 | private void printUsage(PrintStream ps) {<NEW_LINE>OutputStreamWriter outputStream = new OutputStreamWriter(ps, UTF_8);<NEW_LINE>boolean isFirst = true;<NEW_LINE>for (Map.Entry<String, Collection<String>> entry : categories.asMap().entrySet()) {<NEW_LINE>String prefix = "\n\n";<NEW_LINE>String suffix = "";<NEW_LINE>if (isFirst) {<NEW_LINE>isFirst = false;<NEW_LINE>prefix = "";<NEW_LINE>}<NEW_LINE>if (entry.getKey().equals("Warning and Error Management")) {<NEW_LINE>if (helpMarkdown) {<NEW_LINE>suffix = "\n## Available Error Groups\n\n" + " - " + DiagnosticGroups.DIAGNOSTIC_GROUP_NAMES.replace(", ", "\n - ");<NEW_LINE>} else {<NEW_LINE>suffix = "\n" + boldPrefix <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (this.helpMarkdown) {<NEW_LINE>// For markdown docs we don't want any line wrapping so we just set a very<NEW_LINE>// large line length.<NEW_LINE>maxLineLength = 5000;<NEW_LINE>parser.setUsageWidth(maxLineLength);<NEW_LINE>}<NEW_LINE>printCategoryUsage(entry.getKey(), entry.getValue(), outputStream, prefix, suffix);<NEW_LINE>}<NEW_LINE>ps.flush();<NEW_LINE>} | + "Available Error Groups: " + normalPrefix + DiagnosticGroups.DIAGNOSTIC_GROUP_NAMES; |
344,015 | public Void execute(CommandContext commandContext) {<NEW_LINE>CommandConfig commandConfig = commandExecutor<MASK><NEW_LINE>FailedJobCommandFactory failedJobCommandFactory = commandContext.getFailedJobCommandFactory();<NEW_LINE>Command<Object> cmd = failedJobCommandFactory.getCommand(job.getId(), exception);<NEW_LINE>LOGGER.trace("Using FailedJobCommandFactory '{}' and command of type '{}'", failedJobCommandFactory.getClass(), cmd.getClass());<NEW_LINE>commandExecutor.execute(commandConfig, cmd);<NEW_LINE>// Dispatch an event, indicating job execution failed in a try-catch block, to prevent the original<NEW_LINE>// exception to be swallowed<NEW_LINE>if (commandContext.getEventDispatcher().isEnabled()) {<NEW_LINE>try {<NEW_LINE>commandContext.getEventDispatcher().dispatchEvent(ActivitiEventBuilder.createEntityExceptionEvent(FlowableEngineEventType.JOB_EXECUTION_FAILURE, job, exception), EngineConfigurationConstants.KEY_PROCESS_ENGINE_CONFIG);<NEW_LINE>} catch (Throwable ignore) {<NEW_LINE>LOGGER.warn("Exception occurred while dispatching job failure event, ignoring.", ignore);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | .getDefaultConfig().transactionRequiresNew(); |
1,540,241 | public Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext) {<NEW_LINE>Size size = IntegerConstant.forValue(stackManipulations.size()).apply(methodVisitor, implementationContext);<NEW_LINE>// The array's construction does not alter the stack's size.<NEW_LINE>size = size.aggregate(arrayCreator.apply(methodVisitor, implementationContext));<NEW_LINE>int index = 0;<NEW_LINE>for (StackManipulation stackManipulation : stackManipulations) {<NEW_LINE>methodVisitor.visitInsn(Opcodes.DUP);<NEW_LINE>size = size.aggregate(StackSize.SINGLE.toIncreasingSize());<NEW_LINE>size = size.aggregate(IntegerConstant.forValue(index++).apply(methodVisitor, implementationContext));<NEW_LINE>size = size.aggregate(stackManipulation<MASK><NEW_LINE>methodVisitor.visitInsn(arrayCreator.getStorageOpcode());<NEW_LINE>size = size.aggregate(sizeDecrease);<NEW_LINE>}<NEW_LINE>return size;<NEW_LINE>} | .apply(methodVisitor, implementationContext)); |
536,582 | private SecurityContext oauth2SecurityContext(Oauth2 oauth2) {<NEW_LINE>List<AuthorizationScope> scopes = new ArrayList<>();<NEW_LINE>List<AuthorizationScope> oauth2Scopes = oauth2.getScopes();<NEW_LINE>for (AuthorizationScope oauth2Scope : oauth2Scopes) {<NEW_LINE>scopes.add(new AuthorizationScope(oauth2Scope.getScope(), oauth2Scope.getDescription()));<NEW_LINE>}<NEW_LINE>SecurityReference securityReference = new SecurityReference(oauth2.getName(), scopes.toArray(new AuthorizationScope[0]));<NEW_LINE>final List<String> pathPatterns = new ArrayList<>(oauth2.getPathPatterns());<NEW_LINE>if (pathPatterns.isEmpty()) {<NEW_LINE>pathPatterns.add("/**");<NEW_LINE>}<NEW_LINE>final AntPathMatcher matcher = new AntPathMatcher();<NEW_LINE>return SecurityContext.builder().securityReferences(Collections.singletonList(securityReference)).operationSelector((context) -> {<NEW_LINE>String mappingPattern = context.requestMappingPattern();<NEW_LINE>return pathPatterns.stream().anyMatch(patterns -> matcher<MASK><NEW_LINE>}).build();<NEW_LINE>} | .match(patterns, mappingPattern)); |
1,316,323 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_list_sample);<NEW_LINE><MASK><NEW_LINE>final ListView listView = (ListView) findViewById(android.R.id.list);<NEW_LINE>List<String> data = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < 25; i++) {<NEW_LINE>data.add(String.format("Item %d", (i + 1)));<NEW_LINE>}<NEW_LINE>ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, data);<NEW_LINE>listView.setAdapter(adapter);<NEW_LINE>listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onItemClick(AdapterView<?> parent, View view, int position, long id) {<NEW_LINE>SnackbarManager.show(Snackbar.with(SnackbarListViewSampleActivity.this).text(String.format("Item %d pressed", (position + 1))).actionLabel("Close").actionColor(Color.parseColor("#FF8A80")).duration(Snackbar.SnackbarDuration.LENGTH_LONG).attachToAbsListView(listView));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | getSupportActionBar().setDisplayHomeAsUpEnabled(true); |
246,625 | private void handleReadResultForFenceRead(CompletableFuture<Boolean> fenceResult, ByteBuf data, long startTimeNanos) {<NEW_LINE>if (null != fenceThreadPool) {<NEW_LINE>fenceResult.whenCompleteAsync(new FutureEventListener<Boolean>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(Boolean result) {<NEW_LINE>sendFenceResponse(result, data, startTimeNanos);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Throwable t) {<NEW_LINE>LOG.error("Error processing fence request", t);<NEW_LINE>// if failed to fence, fail the read request to make it retry.<NEW_LINE>sendResponse(<MASK><NEW_LINE>}<NEW_LINE>}, fenceThreadPool);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>Boolean fenced = fenceResult.get(1000, TimeUnit.MILLISECONDS);<NEW_LINE>sendFenceResponse(fenced, data, startTimeNanos);<NEW_LINE>return;<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>LOG.error("Interrupting fence read entry {}", request, ie);<NEW_LINE>} catch (ExecutionException ee) {<NEW_LINE>LOG.error("Failed to fence read entry {}", request, ee.getCause());<NEW_LINE>} catch (TimeoutException te) {<NEW_LINE>LOG.error("Timeout to fence read entry {}", request, te);<NEW_LINE>}<NEW_LINE>sendResponse(data, BookieProtocol.EIO, startTimeNanos);<NEW_LINE>}<NEW_LINE>} | data, BookieProtocol.EIO, startTimeNanos); |
397,124 | public boolean visit(MySqlKey x) {<NEW_LINE>if (x.isHasConstraint()) {<NEW_LINE>print0(ucase ? "CONSTRAINT " : "constraint ");<NEW_LINE>if (x.getName() != null) {<NEW_LINE>x.getName().accept(this);<NEW_LINE>print(' ');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String indexType = x.getIndexType();<NEW_LINE>boolean fullText = "FULLTEXT".equalsIgnoreCase(indexType);<NEW_LINE>boolean clustering = "CLUSTERING".equalsIgnoreCase(indexType);<NEW_LINE>boolean clustered = "CLUSTERED".equalsIgnoreCase(indexType);<NEW_LINE>if (fullText) {<NEW_LINE>print0(ucase ? "FULLTEXT " : "fulltext ");<NEW_LINE>} else if (clustering) {<NEW_LINE>print0(ucase ? "CLUSTERING " : "clustering ");<NEW_LINE>} else if (clustered) {<NEW_LINE>print0(ucase ? "CLUSTERED " : "CLUSTERED ");<NEW_LINE>}<NEW_LINE>print0(ucase ? "KEY" : "key");<NEW_LINE>SQLName name = x.getName();<NEW_LINE>if (name != null) {<NEW_LINE>print(' ');<NEW_LINE>name.accept(this);<NEW_LINE>}<NEW_LINE>if (indexType != null && !fullText && !clustering && !clustered) {<NEW_LINE>print0(ucase ? " USING " : " using ");<NEW_LINE>print0(indexType);<NEW_LINE>}<NEW_LINE>print0(" (");<NEW_LINE>for (int i = 0, size = x.getColumns().size(); i < size; ++i) {<NEW_LINE>if (i != 0) {<NEW_LINE>print0(", ");<NEW_LINE>}<NEW_LINE>x.getColumns().get(i).accept(this);<NEW_LINE>}<NEW_LINE>print(')');<NEW_LINE><MASK><NEW_LINE>if (comment != null) {<NEW_LINE>print0(ucase ? " COMMENT " : " comment ");<NEW_LINE>printExpr(comment);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | SQLExpr comment = x.getComment(); |
1,614,983 | public void processResult(int rc, String path, Object ctx) {<NEW_LINE>if (rc == Code.OK.intValue()) {<NEW_LINE>String parent = new File(originalPath).getParent().replace("\\", "/");<NEW_LINE>zk.getData(parent, false, (dRc, dPath, dCtx, data, stat) -> {<NEW_LINE>if (Code.OK.intValue() == dRc && (stat != null && stat.getNumChildren() == 0)) {<NEW_LINE>asyncDeleteFullPathOptimistic(zk, parent, -1, callback, leafNodePath);<NEW_LINE>} else {<NEW_LINE>// parent node is not empty so, complete the<NEW_LINE>// callback<NEW_LINE>callback.processResult(Code.OK.intValue(), path, leafNodePath);<NEW_LINE>}<NEW_LINE>}, null);<NEW_LINE>} else {<NEW_LINE>// parent node deletion fails.. so, complete the callback<NEW_LINE>if (path.equals(leafNodePath)) {<NEW_LINE>callback.processResult(rc, path, leafNodePath);<NEW_LINE>} else {<NEW_LINE>callback.processResult(Code.OK.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | intValue(), path, leafNodePath); |
1,665,837 | private static SubstrateIntrinsics.Any slotTypeCheck(short start, short range, short slot, int typeIDSlotOffset, DynamicHub checkedHub, SubstrateIntrinsics.Any trueValue, SubstrateIntrinsics.Any falseValue) {<NEW_LINE>int typeCheckStart = Short.toUnsignedInt(start);<NEW_LINE>int <MASK><NEW_LINE>int typeCheckSlot = Short.toUnsignedInt(slot) * 2;<NEW_LINE>// No need to guard reading from hub as `checkedHub` is guaranteed to be non-null.<NEW_LINE>final GuardingNode guard = null;<NEW_LINE>int checkedTypeID = Short.toUnsignedInt(DynamicHubAccess.readShort(checkedHub, typeIDSlotOffset + typeCheckSlot, NamedLocationIdentity.FINAL_LOCATION, guard));<NEW_LINE>if (UnsignedMath.belowThan(checkedTypeID - typeCheckStart, typeCheckRange)) {<NEW_LINE>return trueValue;<NEW_LINE>}<NEW_LINE>return falseValue;<NEW_LINE>} | typeCheckRange = Short.toUnsignedInt(range); |
479,655 | public void cleanAutoDeclareContext(ProducerDestination dest, ExtendedProducerProperties<RabbitProducerProperties> properties) {<NEW_LINE>synchronized (this.autoDeclareContext) {<NEW_LINE>if (dest instanceof RabbitProducerDestination) {<NEW_LINE>String qual = ((RabbitProducerDestination) dest).getBeanNameQualifier();<NEW_LINE>removeSingleton(dest.getName() + "." + qual + ".exchange");<NEW_LINE>String[] requiredGroups = properties.getRequiredGroups();<NEW_LINE>if (!ObjectUtils.isEmpty(requiredGroups)) {<NEW_LINE>for (String group : requiredGroups) {<NEW_LINE>if (properties.isPartitioned()) {<NEW_LINE>for (int i = 0; i < properties.getPartitionCount(); i++) {<NEW_LINE>removeQueueAndBindingBeans(properties.getExtension(), properties.getExtension().isQueueNameGroupOnly() ? "" : dest.getName(), group + "-" + i, group, true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>removeQueueAndBindingBeans(properties.getExtension(), dest.getName() + "." + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | group, "", group, false); |
141,827 | private void removeSharedFieldsByDifference(BibEntry localBibEntry, BibEntry sharedBibEntry) throws SQLException {<NEW_LINE>Set<Field> nullFields = new HashSet<>(sharedBibEntry.getFields());<NEW_LINE>nullFields.<MASK><NEW_LINE>for (Field nullField : nullFields) {<NEW_LINE>StringBuilder deleteFieldQuery = new StringBuilder().append("DELETE FROM ").append(escape("FIELD")).append(" WHERE ").append(escape("NAME")).append(" = ? AND ").append(escape("ENTRY_SHARED_ID")).append(" = ?");<NEW_LINE>try (PreparedStatement preparedDeleteFieldStatement = connection.prepareStatement(deleteFieldQuery.toString())) {<NEW_LINE>preparedDeleteFieldStatement.setString(1, nullField.getName());<NEW_LINE>preparedDeleteFieldStatement.setInt(2, localBibEntry.getSharedBibEntryData().getSharedID());<NEW_LINE>preparedDeleteFieldStatement.executeUpdate();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | removeAll(localBibEntry.getFields()); |
515,339 | public List<ValidateError> validate() {<NEW_LINE>List<ValidateError> <MASK><NEW_LINE>Validator validator;<NEW_LINE>ValidateError error;<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.REQUIRED);<NEW_LINE>error = validator.validate(this.knowledgeId, convLabelName("Knowledge Id"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.commentStatus, convLabelName("Comment Status"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.anonymous, convLabelName("Anonymous"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.insertUser, convLabelName("Insert User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.updateUser, convLabelName("Update User"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>validator = ValidatorFactory.getInstance(Validator.INTEGER);<NEW_LINE>error = validator.validate(this.deleteFlag, convLabelName("Delete Flag"));<NEW_LINE>if (error != null) {<NEW_LINE>errors.add(error);<NEW_LINE>}<NEW_LINE>return errors;<NEW_LINE>} | errors = new ArrayList<>(); |
57,599 | public static void orderBandsBufferedFromRGB(DataBufferByte buffer, WritableRaster raster, int type) {<NEW_LINE>int height = raster.getHeight();<NEW_LINE>int width = raster.getWidth();<NEW_LINE>int <MASK><NEW_LINE>int offset = ConvertRaster.getOffset(raster);<NEW_LINE>byte[] data = buffer.getData();<NEW_LINE>if (BufferedImage.TYPE_3BYTE_BGR == type) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, height, y -> {<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>int index = offset + y * stride;<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>byte tmp = data[index];<NEW_LINE>data[index] = data[index + 2];<NEW_LINE>data[index + 2] = tmp;<NEW_LINE>index += 3;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else if (BufferedImage.TYPE_4BYTE_ABGR == type) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, height, y -> {<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>int index = offset + y * stride;<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>byte tmp0 = data[index];<NEW_LINE>byte tmp1 = data[index + 1];<NEW_LINE>data[index] = data[index + 3];<NEW_LINE>data[index + 1] = data[index + 2];<NEW_LINE>data[index + 2] = tmp1;<NEW_LINE>data[index + 3] = tmp0;<NEW_LINE>index += 4;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unsupported buffered image type");<NEW_LINE>}<NEW_LINE>} | stride = ConvertRaster.stride(raster); |
181,661 | public DeleteActionTargetResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteActionTargetResult deleteActionTargetResult = new DeleteActionTargetResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return deleteActionTargetResult;<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("ActionTargetArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteActionTargetResult.setActionTargetArn(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return deleteActionTargetResult;<NEW_LINE>} | class).unmarshall(context)); |
905,718 | public void checkcast(TypeReference typeReference, TypeBinding typeBinding, int currentPosition) {<NEW_LINE>if (typeReference != null) {<NEW_LINE>TypeReference[<MASK><NEW_LINE>for (int i = typeReferences.length - 1; i >= 0; i--) {<NEW_LINE>// need to emit right to left.<NEW_LINE>typeReference = typeReferences[i];<NEW_LINE>if (typeReference != null) {<NEW_LINE>if ((typeReference.bits & ASTNode.HasTypeAnnotations) != 0) {<NEW_LINE>if (!typeReference.resolvedType.isBaseType()) {<NEW_LINE>addAnnotationContext(typeReference, this.position, i, AnnotationTargetTypeConstants.CAST);<NEW_LINE>} else {<NEW_LINE>// for base type record it against the start position of the expression<NEW_LINE>addAnnotationContext(typeReference, currentPosition, i, AnnotationTargetTypeConstants.CAST);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!typeReference.resolvedType.isBaseType()) {<NEW_LINE>super.checkcast(typeReference, typeReference.resolvedType, currentPosition);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>super.checkcast(null, typeBinding, currentPosition);<NEW_LINE>}<NEW_LINE>} | ] typeReferences = typeReference.getTypeReferences(); |
497,854 | public ReviveModelResultRepresentation reviveProcessModelHistory(ModelHistory modelHistory, String userId, String newVersionComment) {<NEW_LINE>Model latestModel = modelRepository.get(modelHistory.getModelId());<NEW_LINE>if (latestModel == null) {<NEW_LINE>throw new IllegalArgumentException("No process model found with id: " + modelHistory.getModelId());<NEW_LINE>}<NEW_LINE>// Store the current model in history<NEW_LINE>ModelHistory latestModelHistory = createNewModelhistory(latestModel);<NEW_LINE>persistModelHistory(latestModelHistory);<NEW_LINE>// Populate the actual latest version with the properties in the historic model<NEW_LINE>latestModel.setVersion(latestModel.getVersion() + 1);<NEW_LINE>latestModel<MASK><NEW_LINE>latestModel.setLastUpdatedBy(userId);<NEW_LINE>latestModel.setName(modelHistory.getName());<NEW_LINE>latestModel.setKey(modelHistory.getKey());<NEW_LINE>latestModel.setDescription(modelHistory.getDescription());<NEW_LINE>latestModel.setModelEditorJson(modelHistory.getModelEditorJson());<NEW_LINE>latestModel.setModelType(modelHistory.getModelType());<NEW_LINE>latestModel.setComment(newVersionComment);<NEW_LINE>persistModel(latestModel);<NEW_LINE>ReviveModelResultRepresentation result = new ReviveModelResultRepresentation();<NEW_LINE>// For apps, we need to make sure the referenced processes exist as models.<NEW_LINE>// It could be the user has deleted the process model in the meantime. We give back that info to the user.<NEW_LINE>if (latestModel.getModelType() == AbstractModel.MODEL_TYPE_APP) {<NEW_LINE>if (StringUtils.isNotEmpty(latestModel.getModelEditorJson())) {<NEW_LINE>try {<NEW_LINE>AppDefinition appDefinition = objectMapper.readValue(latestModel.getModelEditorJson(), AppDefinition.class);<NEW_LINE>for (AppModelDefinition appModelDefinition : appDefinition.getModels()) {<NEW_LINE>if (modelRepository.get(appModelDefinition.getId()) == null) {<NEW_LINE>result.getUnresolvedModels().add(new UnresolveModelRepresentation(appModelDefinition.getId(), appModelDefinition.getName(), appModelDefinition.getLastUpdatedBy()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("Could not deserialize app model json (id = {})", latestModel.getId(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | .setLastUpdated(new Date()); |
461,017 | private static int sortByTag(List<MdiEntry> entries) {<NEW_LINE>// due to async/swt-thread nature of tree construction we can't get an accurate list<NEW_LINE>// of existing tree items without forcing swt sync which messes up other crud<NEW_LINE>// so reconstruct the order here so we can insert new items based on this<NEW_LINE>Comparator<String> comp = FormattersImpl.getAlphanumericComparator2(true);<NEW_LINE>Collections.sort(entries, (m1, m2) -> {<NEW_LINE>Object o1 = m1.getUserData(TAG_TAG_OR_GROUP_KEY);<NEW_LINE>Object o2 = m2.getUserData(TAG_TAG_OR_GROUP_KEY);<NEW_LINE>if (o1 == o2) {<NEW_LINE>return (0);<NEW_LINE>} else if (o1 == null) {<NEW_LINE>return (1);<NEW_LINE>} else if (o2 == null) {<NEW_LINE>return (-1);<NEW_LINE>} else {<NEW_LINE>TagType tt1;<NEW_LINE>TagType tt2;<NEW_LINE>String n1;<NEW_LINE>String n2;<NEW_LINE>if (o1 instanceof Tag) {<NEW_LINE>Tag t = (Tag) o1;<NEW_LINE>tt1 = t.getTagType();<NEW_LINE>n1 = t.getTagName(true);<NEW_LINE>} else {<NEW_LINE>TagGroup tg = (TagGroup) o1;<NEW_LINE>tt1 = tg.getTagType();<NEW_LINE>n1 = tg.getName();<NEW_LINE>}<NEW_LINE>if (o2 instanceof Tag) {<NEW_LINE>Tag t = (Tag) o2;<NEW_LINE>tt2 = t.getTagType();<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>TagGroup tg = (TagGroup) o2;<NEW_LINE>tt2 = tg.getTagType();<NEW_LINE>n2 = tg.getName();<NEW_LINE>}<NEW_LINE>if (tt1 == tt2) {<NEW_LINE>return (comp.compare(n1, n2));<NEW_LINE>} else {<NEW_LINE>return (tt1.getTagType() - tt2.getTagType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>int num_tags = 0;<NEW_LINE>for (MdiEntry e : entries) {<NEW_LINE>if (e.getUserData(TAG_TAG_OR_GROUP_KEY) != null) {<NEW_LINE>num_tags++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (num_tags);<NEW_LINE>} | n2 = t.getTagName(true); |
889,233 | public io.kubernetes.client.proto.V1beta1Extensions.SupplementalGroupsStrategyOptions buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1beta1Extensions.SupplementalGroupsStrategyOptions result = new io.kubernetes.client.<MASK><NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.rule_ = rule_;<NEW_LINE>if (rangesBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>ranges_ = java.util.Collections.unmodifiableList(ranges_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.ranges_ = ranges_;<NEW_LINE>} else {<NEW_LINE>result.ranges_ = rangesBuilder_.build();<NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | proto.V1beta1Extensions.SupplementalGroupsStrategyOptions(this); |
754,001 | public static QueryCardsInfoResponse unmarshall(QueryCardsInfoResponse queryCardsInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryCardsInfoResponse.setRequestId(_ctx.stringValue("QueryCardsInfoResponse.RequestId"));<NEW_LINE>queryCardsInfoResponse.setCode(_ctx.stringValue("QueryCardsInfoResponse.Code"));<NEW_LINE>queryCardsInfoResponse.setMessage<MASK><NEW_LINE>List<CardsInfoItem> cardsInfo = new ArrayList<CardsInfoItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryCardsInfoResponse.CardsInfo.Length"); i++) {<NEW_LINE>CardsInfoItem cardsInfoItem = new CardsInfoItem();<NEW_LINE>cardsInfoItem.setIccid(_ctx.stringValue("QueryCardsInfoResponse.CardsInfo[" + i + "].Iccid"));<NEW_LINE>cardsInfoItem.setOpenTime(_ctx.stringValue("QueryCardsInfoResponse.CardsInfo[" + i + "].OpenTime"));<NEW_LINE>cardsInfoItem.setFirstActiveTime(_ctx.stringValue("QueryCardsInfoResponse.CardsInfo[" + i + "].FirstActiveTime"));<NEW_LINE>cardsInfoItem.setImsi(_ctx.stringValue("QueryCardsInfoResponse.CardsInfo[" + i + "].Imsi"));<NEW_LINE>cardsInfoItem.setMsisdn(_ctx.stringValue("QueryCardsInfoResponse.CardsInfo[" + i + "].Msisdn"));<NEW_LINE>cardsInfoItem.setGprsStatus(_ctx.stringValue("QueryCardsInfoResponse.CardsInfo[" + i + "].GprsStatus"));<NEW_LINE>cardsInfoItem.setVoiceStatus(_ctx.stringValue("QueryCardsInfoResponse.CardsInfo[" + i + "].VoiceStatus"));<NEW_LINE>cardsInfoItem.setSmsStatus(_ctx.stringValue("QueryCardsInfoResponse.CardsInfo[" + i + "].SmsStatus"));<NEW_LINE>cardsInfo.add(cardsInfoItem);<NEW_LINE>}<NEW_LINE>queryCardsInfoResponse.setCardsInfo(cardsInfo);<NEW_LINE>return queryCardsInfoResponse;<NEW_LINE>} | (_ctx.stringValue("QueryCardsInfoResponse.Message")); |
721,773 | final DescribeListenerResult executeDescribeListener(DescribeListenerRequest describeListenerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeListenerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeListenerRequest> request = null;<NEW_LINE>Response<DescribeListenerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeListenerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeListenerRequest));<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, "Global Accelerator");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeListener");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeListenerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeListenerResultJsonUnmarshaller());<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); |
810,379 | private void openTab(WebElement tabCell) {<NEW_LINE>// Open the tab by clicking its caption text if it exists.<NEW_LINE>List<WebElement> tabCaptions = tabCell.findElements(byCaption);<NEW_LINE>if (!tabCaptions.isEmpty()) {<NEW_LINE>tabCaptions.get(0).click();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// If no caption text was found, click the icon of the tab.<NEW_LINE>List<WebElement> tabIcons = tabCell.findElements<MASK><NEW_LINE>if (!tabIcons.isEmpty()) {<NEW_LINE>tabIcons.get(0).click();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// If neither text nor icon caption was found, click at a position that<NEW_LINE>// is unlikely to close the tab.<NEW_LINE>if (BrowserUtil.isIE(getCapabilities())) {<NEW_LINE>// old default, offset calculated from top left<NEW_LINE>((TestBenchElement) tabCell).click(10, 10);<NEW_LINE>} else {<NEW_LINE>// w3c compliant, offset calculated from middle<NEW_LINE>((TestBenchElement) tabCell).click(-5, 0);<NEW_LINE>}<NEW_LINE>} | (By.className("v-icon")); |
950,137 | public static XComponentContext createInitialComponentContext(Map<String, Object> context_entries) throws Exception {<NEW_LINE>ServiceManager xSMgr = new ServiceManager();<NEW_LINE>XImplementationLoader xImpLoader = UnoRuntime.queryInterface(XImplementationLoader.class, new JavaLoader());<NEW_LINE>XInitialization xInit = UnoRuntime.queryInterface(XInitialization.class, xImpLoader);<NEW_LINE>Object[] args = new Object[] { xSMgr };<NEW_LINE>xInit.initialize(args);<NEW_LINE>// initial component context<NEW_LINE>if (context_entries == null) {<NEW_LINE>context_entries = new HashMap<>(1);<NEW_LINE>}<NEW_LINE>// add smgr<NEW_LINE>context_entries.put("/singletons/com.sun.star.lang.theServiceManager", new ComponentContextEntry(null, xSMgr));<NEW_LINE>// ... xxx todo: add standard entries<NEW_LINE>XComponentContext xContext = new ComponentContext(context_entries, null);<NEW_LINE>xSMgr.setDefaultContext(xContext);<NEW_LINE>XSet xSet = UnoRuntime.<MASK><NEW_LINE>// insert basic jurt factories<NEW_LINE>insertBasicFactories(xSet, xImpLoader);<NEW_LINE>return xContext;<NEW_LINE>} | queryInterface(XSet.class, xSMgr); |
41,560 | private static RestRequest doEncode(final RestRequest request) throws URISyntaxException, MessagingException, IOException {<NEW_LINE>RestRequestBuilder requestBuilder = new RestRequestBuilder(request);<NEW_LINE>// Reconstruct URI without query. Use the URI(String) constructor to preserve any Rest.li specific encoding of the<NEW_LINE>// URI path keys.<NEW_LINE>URI uri = request.getURI();<NEW_LINE>String uriString = uri.toString();<NEW_LINE>int queryIndex = uriString.indexOf('?');<NEW_LINE>if (queryIndex > 0) {<NEW_LINE>uriString = uriString.substring(0, queryIndex);<NEW_LINE>}<NEW_LINE>URI newUri = new URI(uriString);<NEW_LINE>// If there's no existing body, just pass the request as x-www-form-urlencoded<NEW_LINE><MASK><NEW_LINE>if (entity == null || entity.length() == 0) {<NEW_LINE>requestBuilder.setHeader(HEADER_CONTENT_TYPE, FORM_URL_ENCODED);<NEW_LINE>requestBuilder.setEntity(ByteString.copyString(uri.getRawQuery(), Data.UTF_8_CHARSET));<NEW_LINE>} else {<NEW_LINE>// If we have a body, we must preserve it, so use multipart/mixed encoding<NEW_LINE>MimeMultipart multi = createMultiPartEntity(entity, request.getHeader(HEADER_CONTENT_TYPE), uri.getRawQuery());<NEW_LINE>requestBuilder.setHeader(HEADER_CONTENT_TYPE, multi.getContentType());<NEW_LINE>ByteArrayOutputStream os = new ByteArrayOutputStream();<NEW_LINE>multi.writeTo(os);<NEW_LINE>requestBuilder.setEntity(ByteString.copy(os.toByteArray()));<NEW_LINE>}<NEW_LINE>// Set the base uri, supply the original method in the override header, set/update content length<NEW_LINE>// header to the new entity length, and change method to POST<NEW_LINE>requestBuilder.setURI(newUri);<NEW_LINE>requestBuilder.setHeader(HEADER_METHOD_OVERRIDE, requestBuilder.getMethod());<NEW_LINE>requestBuilder.setHeader(CONTENT_LENGTH, Integer.toString(requestBuilder.getEntity().length()));<NEW_LINE>requestBuilder.setMethod(RestMethod.POST);<NEW_LINE>return requestBuilder.build();<NEW_LINE>} | ByteString entity = request.getEntity(); |
982,174 | static void exportAttributes(final ODTExporter thisNode, final String uuid, final SecurityContext securityContext) throws FrameworkException {<NEW_LINE>final File output = thisNode.getResultDocument();<NEW_LINE>final VirtualType transformation = thisNode.getTransformationProvider();<NEW_LINE>try {<NEW_LINE>final App <MASK><NEW_LINE>final ResultStream result = app.nodeQuery(AbstractNode.class).and(GraphObject.id, uuid).getResultStream();<NEW_LINE>final ResultStream transformedResult = transformation.transformOutput(securityContext, AbstractNode.class, result);<NEW_LINE>Map<String, Object> nodeProperties = new HashMap<>();<NEW_LINE>GraphObjectMap node = (GraphObjectMap) Iterables.first(transformedResult);<NEW_LINE>node.getPropertyKeys(null).forEach(p -> nodeProperties.put(p.dbName(), node.getProperty(p)));<NEW_LINE>TextDocument text = TextDocument.loadDocument(output.getFileOnDisk().getAbsolutePath());<NEW_LINE>NodeList nodes = text.getContentRoot().getElementsByTagName(ODT_FIELD_TAG_NAME);<NEW_LINE>for (int i = 0; i < nodes.getLength(); i++) {<NEW_LINE>Node currentNode = nodes.item(i);<NEW_LINE>NamedNodeMap attrs = currentNode.getAttributes();<NEW_LINE>Node fieldName = attrs.getNamedItem(ODT_FIELD_ATTRIBUTE_NAME);<NEW_LINE>Object nodeFieldValue = nodeProperties.get(fieldName.getNodeValue());<NEW_LINE>Node currentContent = attrs.getNamedItem(ODT_FIELD_ATTRIBUTE_VALUE);<NEW_LINE>if (nodeFieldValue != null) {<NEW_LINE>if (nodeFieldValue instanceof String[]) {<NEW_LINE>String[] arr = (String[]) nodeFieldValue;<NEW_LINE>List<String> list = new ArrayList<>(Arrays.asList(arr));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>list.forEach(s -> sb.append(s + "\n"));<NEW_LINE>currentContent.setNodeValue(sb.toString());<NEW_LINE>} else if (nodeFieldValue instanceof Collection) {<NEW_LINE>Collection col = (Collection) nodeFieldValue;<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>col.forEach(s -> sb.append(s + "\n"));<NEW_LINE>currentContent.setNodeValue(sb.toString());<NEW_LINE>} else {<NEW_LINE>currentContent.setNodeValue(nodeFieldValue.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>text.save(output.getFileOnDisk().getAbsolutePath());<NEW_LINE>text.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>final Logger logger = LoggerFactory.getLogger(ODTExporter.class);<NEW_LINE>logger.error("Error while exporting to ODT", e);<NEW_LINE>}<NEW_LINE>} | app = StructrApp.getInstance(securityContext); |
1,455,288 | private void defineReadStructMethod() {<NEW_LINE>MethodDefinition read = new MethodDefinition(a(PUBLIC), "read", structType, arg("protocol", TProtocol.class)).addException(Exception.class);<NEW_LINE>// TProtocolReader reader = new TProtocolReader(protocol);<NEW_LINE>read.addLocalVariable(type(TProtocolReader.class), "reader");<NEW_LINE>read.newObject(TProtocolReader.class);<NEW_LINE>read.dup();<NEW_LINE>read.loadVariable("protocol");<NEW_LINE>read.invokeConstructor(type(TProtocolReader.class), type(TProtocol.class));<NEW_LINE>read.storeVariable("reader");<NEW_LINE>// read all of the data in to local variables<NEW_LINE>Map<Short, LocalVariableDefinition> structData = readFieldValues(read);<NEW_LINE>// build the struct<NEW_LINE>LocalVariableDefinition <MASK><NEW_LINE>// push instance on stack, and return it<NEW_LINE>read.loadVariable(result).retObject();<NEW_LINE>classDefinition.addMethod(read);<NEW_LINE>} | result = buildStruct(read, structData); |
180,963 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>mView = inflater.inflate(R.layout.basic_settings, container, false);<NEW_LINE>mProfileName = mView.findViewById(id.profilename);<NEW_LINE>mClientCert = <MASK><NEW_LINE>mClientKey = mView.findViewById(id.keyselect);<NEW_LINE>mCaCert = mView.findViewById(id.caselect);<NEW_LINE>mpkcs12 = mView.findViewById(id.pkcs12select);<NEW_LINE>mCrlFile = mView.findViewById(id.crlfile);<NEW_LINE>mUseLzo = mView.findViewById(id.lzo);<NEW_LINE>mUseLegacyProvider = mView.findViewById(R.id.legacyprovider);<NEW_LINE>mType = mView.findViewById(id.type);<NEW_LINE>mCompatMode = mView.findViewById(id.compatmode);<NEW_LINE>mPKCS12Password = mView.findViewById(id.pkcs12password);<NEW_LINE>mEnablePeerFingerprint = mView.findViewById(id.enable_peer_fingerprint);<NEW_LINE>mPeerFingerprints = mView.findViewById(id.peer_fingerprint);<NEW_LINE>mUserName = mView.findViewById(id.auth_username);<NEW_LINE>mPassword = mView.findViewById(id.auth_password);<NEW_LINE>mKeyPassword = mView.findViewById(id.key_password);<NEW_LINE>mAuthRetry = mView.findViewById(id.auth_retry);<NEW_LINE>addFileSelectLayout(mCaCert, Utils.FileType.CA_CERTIFICATE);<NEW_LINE>addFileSelectLayout(mClientCert, Utils.FileType.CLIENT_CERTIFICATE);<NEW_LINE>addFileSelectLayout(mClientKey, Utils.FileType.KEYFILE);<NEW_LINE>addFileSelectLayout(mpkcs12, Utils.FileType.PKCS12);<NEW_LINE>addFileSelectLayout(mCrlFile, Utils.FileType.CRL_FILE);<NEW_LINE>mCaCert.setShowClear();<NEW_LINE>mCrlFile.setShowClear();<NEW_LINE>mType.setOnItemSelectedListener(this);<NEW_LINE>mAuthRetry.setOnItemSelectedListener(this);<NEW_LINE>mEnablePeerFingerprint.setOnCheckedChangeListener(this);<NEW_LINE>initKeychainViews(mView);<NEW_LINE>return mView;<NEW_LINE>} | mView.findViewById(id.certselect); |
523,692 | final DescribeModelResult executeDescribeModel(DescribeModelRequest describeModelRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeModelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeModelRequest> request = null;<NEW_LINE>Response<DescribeModelResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeModelRequest));<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, "LookoutEquipment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeModel");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeModelResult>> 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 DescribeModelResultJsonUnmarshaller()); |
109,593 | private Color reconcileObjectProtos(ColorId id, Map<ShardView, TypeProto> viewToProto) {<NEW_LINE>TreeSet<String> debugTypenames = new TreeSet<>();<NEW_LINE>ImmutableSet.Builder<Color<MASK><NEW_LINE>ImmutableSet.Builder<Color> prototypes = ImmutableSet.builder();<NEW_LINE>ImmutableSet.Builder<String> ownProperties = ImmutableSet.builder();<NEW_LINE>Tri isClosureAssert = Tri.UNKNOWN;<NEW_LINE>boolean isConstructor = false;<NEW_LINE>boolean isInvalidating = false;<NEW_LINE>boolean propertiesKeepOriginalName = false;<NEW_LINE>for (Map.Entry<ShardView, TypeProto> entry : viewToProto.entrySet()) {<NEW_LINE>ShardView shard = entry.getKey();<NEW_LINE>TypeProto proto = entry.getValue();<NEW_LINE>checkState(proto.hasObject());<NEW_LINE>ObjectTypeProto objProto = proto.getObject();<NEW_LINE>if (objProto.hasDebugInfo()) {<NEW_LINE>debugTypenames.addAll(objProto.getDebugInfo().getTypenameList());<NEW_LINE>}<NEW_LINE>for (Integer p : objProto.getInstanceTypeList()) {<NEW_LINE>instanceColors.add(this.lookupOrReconcileColor(shard.getId(p)));<NEW_LINE>}<NEW_LINE>boolean isClosureAssertBool = objProto.getClosureAssert();<NEW_LINE>checkWellFormed(isClosureAssert.toBoolean(isClosureAssertBool) == isClosureAssertBool, "Inconsistent values for closure_assert", objProto);<NEW_LINE>isClosureAssert = Tri.forBoolean(isClosureAssertBool);<NEW_LINE>isConstructor |= objProto.getMarkedConstructor();<NEW_LINE>isInvalidating |= objProto.getIsInvalidating();<NEW_LINE>propertiesKeepOriginalName |= objProto.getPropertiesKeepOriginalName();<NEW_LINE>for (Integer p : objProto.getPrototypeList()) {<NEW_LINE>prototypes.add(this.lookupOrReconcileColor(shard.getId(p)));<NEW_LINE>}<NEW_LINE>for (int i = 0; i < objProto.getOwnPropertyCount(); i++) {<NEW_LINE>ownProperties.add(shard.stringPool.get(objProto.getOwnProperty(i)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DebugInfo debugInfo = DebugInfo.EMPTY;<NEW_LINE>if (!debugTypenames.isEmpty()) {<NEW_LINE>debugInfo = DebugInfo.builder().setCompositeTypename(String.join("/", debugTypenames)).build();<NEW_LINE>}<NEW_LINE>return Color.singleBuilder().setId(id).setDebugInfo(debugInfo).setInstanceColors(instanceColors.build()).setPrototypes(prototypes.build()).setOwnProperties(ownProperties.build()).setClosureAssert(isClosureAssert.toBoolean(false)).setConstructor(isConstructor).setInvalidating(isInvalidating).setPropertiesKeepOriginalName(propertiesKeepOriginalName).build();<NEW_LINE>} | > instanceColors = ImmutableSet.builder(); |
1,016,084 | static void onNullInjectedIntoNonNullableDependency(Object source, Dependency<?> dependency) throws InternalProvisionException {<NEW_LINE>// Hack to allow null parameters to @Provides methods, for backwards compatibility.<NEW_LINE>if (dependency.getInjectionPoint().getMember() instanceof Method) {<NEW_LINE>Method annotated = (Method) dependency<MASK><NEW_LINE>if (annotated.isAnnotationPresent(Provides.class)) {<NEW_LINE>switch(InternalFlags.getNullableProvidesOption()) {<NEW_LINE>case ERROR:<NEW_LINE>// break out & let the below exception happen<NEW_LINE>break;<NEW_LINE>case IGNORE:<NEW_LINE>// user doesn't care about injecting nulls to non-@Nullables.<NEW_LINE>return;<NEW_LINE>case WARN:<NEW_LINE>// Warn only once, otherwise we spam logs too much.<NEW_LINE>if (warnedDependencies.add(dependency)) {<NEW_LINE>logger.log(Level.WARNING, "Guice injected null into {0} (a {1}), please mark it @Nullable." + " Use -Dguice_check_nullable_provides_params=ERROR to turn this into an" + " error.", new Object[] { SourceFormatter.getParameterName(dependency), Messages.convert(dependency.getKey()) });<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String parameterName = (dependency.getParameterIndex() != -1) ? SourceFormatter.getParameterName(dependency) : "";<NEW_LINE>Object memberStackTraceElement = StackTraceElements.forMember(dependency.getInjectionPoint().getMember());<NEW_LINE>Object formattedDependency = parameterName.isEmpty() ? memberStackTraceElement : "the " + parameterName + " of " + memberStackTraceElement;<NEW_LINE>throw InternalProvisionException.create(ErrorId.NULL_INJECTED_INTO_NON_NULLABLE, "null returned by binding at %s%n but %s is not @Nullable", source, formattedDependency).addSource(source);<NEW_LINE>} | .getInjectionPoint().getMember(); |
1,307,862 | private void processUpdateWithNameChange(final String pid, final ApplicationConfig newAppConfig, final NamedApplication appFromPid) {<NEW_LINE>final <MASK><NEW_LINE>ApplicationConfig oldAppConfig = appFromPid.getConfig();<NEW_LINE>if (oldAppConfig == null) {<NEW_LINE>// hmmm, our pid was previously associated with a different name,<NEW_LINE>// but we cannot find an app config with that name<NEW_LINE>throw new RuntimeException("processUpdateWithNameChange: pid=" + pid + ", oldAppName=" + oldAppName + ": unable to find old app config");<NEW_LINE>}<NEW_LINE>String oldPid = oldAppConfig.getConfigPid();<NEW_LINE>if (!oldPid.equals(pid)) {<NEW_LINE>// the last update we received for this name had a different pid<NEW_LINE>throw new RuntimeException("processUpdateWithNameChange: name=" + oldAppName + ", oldPid=" + oldPid + ", newPid=" + pid);<NEW_LINE>}<NEW_LINE>if (_tc.isEventEnabled()) {<NEW_LINE>Tr.event(_tc, "processUpdateWithNameChange: pid=" + pid + ", oldAppName=" + oldAppName + ", newAppName=" + newAppConfig.getName());<NEW_LINE>}<NEW_LINE>final UpdateEpisodeState episode = joinEpisode();<NEW_LINE>if (episode != null) {<NEW_LINE>ApplicationDependency appRemoved = uninstallApp(appFromPid);<NEW_LINE>appRemoved.onCompletion(new CompletionListener<Boolean>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void successfulCompletion(Future<Boolean> future, Boolean result) {<NEW_LINE>synchronized (ApplicationConfigurator.this) {<NEW_LINE>processUpdate(pid, newAppConfig);<NEW_LINE>episode.dropReference();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void failedCompletion(Future<Boolean> future, Throwable t) {<NEW_LINE>episode.dropReference();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | String oldAppName = appFromPid.getAppName(); |
1,510,765 | public static <T extends ImageGray<T>> void median(Planar<T> input, T output, int startBand, int lastBand) {<NEW_LINE>if (GrayU8.class == input.getBandType()) {<NEW_LINE>ImageBandMath.median((Planar<GrayU8>) input, (GrayU8) output, startBand, lastBand);<NEW_LINE>} else if (GrayU16.class == input.getBandType()) {<NEW_LINE>ImageBandMath.median((Planar<GrayU16>) input, (GrayU16) output, startBand, lastBand);<NEW_LINE>} else if (GrayS16.class == input.getBandType()) {<NEW_LINE>ImageBandMath.median((Planar<GrayS16>) input, (GrayS16) output, startBand, lastBand);<NEW_LINE>} else if (GrayS32.class == input.getBandType()) {<NEW_LINE>ImageBandMath.median((Planar<GrayS32>) input, (GrayS32) output, startBand, lastBand);<NEW_LINE>} else if (GrayS64.class == input.getBandType()) {<NEW_LINE>ImageBandMath.median((Planar<GrayS64>) input, (<MASK><NEW_LINE>} else if (GrayF32.class == input.getBandType()) {<NEW_LINE>ImageBandMath.median((Planar<GrayF32>) input, (GrayF32) output, startBand, lastBand);<NEW_LINE>} else if (GrayF64.class == input.getBandType()) {<NEW_LINE>ImageBandMath.median((Planar<GrayF64>) input, (GrayF64) output, startBand, lastBand);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown image Type: " + input.getBandType().getSimpleName());<NEW_LINE>}<NEW_LINE>} | GrayS64) output, startBand, lastBand); |
1,616,159 | protected void addRunnableTasks(ImageData<T> imageData, PathObject parentObject, List<Runnable> tasks) {<NEW_LINE>// Get pixel sizes, if possible<NEW_LINE>ImageServer<?> server = imageData.getServer();<NEW_LINE>double pixelWidth = 1, pixelHeight = 1;<NEW_LINE>PixelCalibration cal = server.getPixelCalibration();<NEW_LINE>boolean hasMicrons = server != null && cal.hasPixelSizeMicrons();<NEW_LINE>if (hasMicrons) {<NEW_LINE>pixelWidth = cal.getPixelWidthMicrons();<NEW_LINE>pixelHeight = cal.getPixelHeightMicrons();<NEW_LINE>}<NEW_LINE>double distanceThresholdPixels;<NEW_LINE>if (cal.hasPixelSizeMicrons())<NEW_LINE>distanceThresholdPixels = params.getDoubleParameterValue(<MASK><NEW_LINE>else<NEW_LINE>distanceThresholdPixels = params.getDoubleParameterValue("distanceThreshold");<NEW_LINE>tasks.add(new DelaunayRunnable(imageData, parentObject, params.getBooleanParameterValue("addClusterMeasurements"), pixelWidth, pixelHeight, distanceThresholdPixels, params.getBooleanParameterValue("limitByClass")));<NEW_LINE>} | "distanceThresholdMicrons") / cal.getAveragedPixelSizeMicrons(); |
621,864 | public void incrementalRedraw() {<NEW_LINE>if (layer == null) {<NEW_LINE>makeLayerElement();<NEW_LINE>addCSSClasses();<NEW_LINE>}<NEW_LINE>// TODO make the number of digits configurable<NEW_LINE>final String label = (epsilon > 0.0) ? FormatUtil.NF4.format(epsilon) : "";<NEW_LINE>// compute absolute y-value of bar<NEW_LINE>final double yAct = getYFromEpsilon(epsilon);<NEW_LINE>if (elemText == null) {<NEW_LINE>elemText = svgp.svgText(StyleLibrary.SCALE * 1.05, yAct, label);<NEW_LINE>SVGUtil.setAtt(elemText, SVGConstants.SVG_CLASS_ATTRIBUTE, CSS_EPSILON);<NEW_LINE>layer.appendChild(elemText);<NEW_LINE>} else {<NEW_LINE>elemText.setTextContent(label);<NEW_LINE>SVGUtil.setAtt(elemText, SVGConstants.SVG_Y_ATTRIBUTE, yAct);<NEW_LINE>}<NEW_LINE>// line and handle<NEW_LINE>if (elementLine == null) {<NEW_LINE>elementLine = svgp.svgLine(0, yAct, StyleLibrary.SCALE * 1.04, yAct);<NEW_LINE><MASK><NEW_LINE>layer.appendChild(elementLine);<NEW_LINE>} else {<NEW_LINE>SVGUtil.setAtt(elementLine, SVG12Constants.SVG_Y1_ATTRIBUTE, yAct);<NEW_LINE>SVGUtil.setAtt(elementLine, SVG12Constants.SVG_Y2_ATTRIBUTE, yAct);<NEW_LINE>}<NEW_LINE>if (elementPoint == null) {<NEW_LINE>elementPoint = svgp.svgCircle(StyleLibrary.SCALE * 1.04, yAct, StyleLibrary.SCALE * 0.004);<NEW_LINE>SVGUtil.addCSSClass(elementPoint, CSS_LINE);<NEW_LINE>layer.appendChild(elementPoint);<NEW_LINE>} else {<NEW_LINE>SVGUtil.setAtt(elementPoint, SVG12Constants.SVG_CY_ATTRIBUTE, yAct);<NEW_LINE>}<NEW_LINE>if (eventarea == null) {<NEW_LINE>eventarea = new //<NEW_LINE>//<NEW_LINE>DragableArea(//<NEW_LINE>svgp, //<NEW_LINE>StyleLibrary.SCALE, -StyleLibrary.SCALE * 0.01, StyleLibrary.SCALE * 0.1, plotheight + StyleLibrary.SCALE * 0.02, this);<NEW_LINE>layer.appendChild(eventarea.getElement());<NEW_LINE>}<NEW_LINE>} | SVGUtil.addCSSClass(elementLine, CSS_LINE); |
9,341 | private void energyCell(BlockDefinition<?> block, String baseTexture) {<NEW_LINE>var blockBuilder = <MASK><NEW_LINE>var models = new ArrayList<ModelFile>();<NEW_LINE>for (var i = 0; i < 5; i++) {<NEW_LINE>var model = models().cubeAll(modelPath(block) + "_" + i, makeId(baseTexture + "_" + i));<NEW_LINE>blockBuilder.partialState().with(EnergyCellBlock.ENERGY_STORAGE, i).setModels(new ConfiguredModel(model));<NEW_LINE>models.add(model);<NEW_LINE>}<NEW_LINE>var item = itemModels().withExistingParent(modelPath(block), models.get(0).getLocation());<NEW_LINE>for (var i = 1; i < models.size(); i++) {<NEW_LINE>// The predicate matches "greater than", meaning for fill-level > 0 the first non-empty texture is used<NEW_LINE>float fillFactor = (i - 1) / (float) (models.size() - 1);<NEW_LINE>item.override().predicate(InitItemModelsProperties.ENERGY_FILL_LEVEL_ID, fillFactor).model(models.get(i));<NEW_LINE>}<NEW_LINE>} | getVariantBuilder(block.block()); |
377,861 | protected void initScene() {<NEW_LINE>final Material material = new Material();<NEW_LINE>final Plane plane = new Plane(1, 1, 1, 1);<NEW_LINE>plane.setMaterial(material);<NEW_LINE>getCurrentScene().addChild(plane);<NEW_LINE>try {<NEW_LINE>mGifTexture = new AnimatedGIFTexture("animGif", R.drawable.animated_gif);<NEW_LINE>material.addTexture(mGifTexture);<NEW_LINE>material.setColorInfluence(0);<NEW_LINE>mGifTexture.rewind();<NEW_LINE>plane.setScaleX((float) mGifTexture.getWidth() / (float) mGifTexture.getHeight());<NEW_LINE>} catch (ATexture.TextureException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>final EllipticalOrbitAnimation3D anim = new EllipticalOrbitAnimation3D(new Vector3(0, 0, 3), new Vector3(0.5, 0.5<MASK><NEW_LINE>anim.setDurationMilliseconds(12000);<NEW_LINE>anim.setRepeatMode(Animation.RepeatMode.INFINITE);<NEW_LINE>anim.setTransformable3D(getCurrentCamera());<NEW_LINE>getCurrentScene().registerAnimation(anim);<NEW_LINE>anim.play();<NEW_LINE>} | , 3), 0, 359); |
757,050 | public ParameterMapEntry unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ParameterMapEntry parameterMapEntry = new ParameterMapEntry();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Key", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>parameterMapEntry.setKey(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Values", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>parameterMapEntry.setValues(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return parameterMapEntry;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
96,336 | protected void initComponents() {<NEW_LINE>if (!oPanel.isPrepared()) {<NEW_LINE>// NOI18N<NEW_LINE>initComponent = new JLabel(NbBundle.getMessage(InitPanel.class, "LBL_computing"));<NEW_LINE>initComponent.setPreferredSize(new Dimension(850, 450));<NEW_LINE>// avoid flicking ?<NEW_LINE>// NOI18N<NEW_LINE>Color <MASK><NEW_LINE>if (c == null) {<NEW_LINE>// GTK 1.4.2 will return null for Tree.background<NEW_LINE>c = Color.WHITE;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>initComponent.setBackground(c);<NEW_LINE>initComponent.setHorizontalAlignment(SwingConstants.CENTER);<NEW_LINE>initComponent.setOpaque(true);<NEW_LINE>CardLayout card = new CardLayout();<NEW_LINE>setLayout(card);<NEW_LINE>// NOI18N<NEW_LINE>add(initComponent, "init");<NEW_LINE>// NOI18N<NEW_LINE>card.show(this, "init");<NEW_LINE>Utilities.attachInitJob(this, this);<NEW_LINE>} else {<NEW_LINE>finished();<NEW_LINE>}<NEW_LINE>} | c = UIManager.getColor("Tree.background"); |
1,709,434 | public ProfilingPoint create(Lookup.Provider project) {<NEW_LINE>if (project == null) {<NEW_LINE>// project not defined, will be detected from most active Editor or Main Project will be used<NEW_LINE>project = Utils.getCurrentProject();<NEW_LINE>}<NEW_LINE>CodeProfilingPoint.Location[] selectionLocations = Utils.getCurrentSelectionLocations();<NEW_LINE>if (selectionLocations.length != 2) {<NEW_LINE>CodeProfilingPoint.Location location = Utils.<MASK><NEW_LINE>if (location.equals(CodeProfilingPoint.Location.EMPTY)) {<NEW_LINE>// NOI18N<NEW_LINE>String filename = "";<NEW_LINE>// NOI18N<NEW_LINE>String name = Utils.getUniqueName(getType(), "", project);<NEW_LINE>return new StopwatchProfilingPoint(name, location, null, project, this);<NEW_LINE>} else {<NEW_LINE>File file = FileUtil.normalizeFile(new File(location.getFile()));<NEW_LINE>String filename = FileUtil.toFileObject(file).getName();<NEW_LINE>String name = // NOI18N<NEW_LINE>Utils.// NOI18N<NEW_LINE>getUniqueName(// NOI18N<NEW_LINE>getType(), // NOI18N<NEW_LINE>Bundle.StopwatchProfilingPointFactory_PpDefaultName("", filename, location.getLine()), project);<NEW_LINE>return new StopwatchProfilingPoint(name, location, null, project, this);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>CodeProfilingPoint.Location startLocation = selectionLocations[0];<NEW_LINE>CodeProfilingPoint.Location endLocation = selectionLocations[1];<NEW_LINE>File file = FileUtil.normalizeFile(new File(startLocation.getFile()));<NEW_LINE>String filename = FileUtil.toFileObject(file).getName();<NEW_LINE>String name = // NOI18N<NEW_LINE>Utils.// NOI18N<NEW_LINE>getUniqueName(// NOI18N<NEW_LINE>getType(), // NOI18N<NEW_LINE>Bundle.StopwatchProfilingPointFactory_PpDefaultName("", filename, startLocation.getLine()), project);<NEW_LINE>return new StopwatchProfilingPoint(name, startLocation, endLocation, project, this);<NEW_LINE>}<NEW_LINE>} | getCurrentLocation(CodeProfilingPoint.Location.OFFSET_START); |
1,321,682 | public void onUpdate(double tpf) {<NEW_LINE>if (sense.getState() == SenseAIState.CALM)<NEW_LINE>return;<NEW_LINE>if (!astarMove.isAtDestination())<NEW_LINE>return;<NEW_LINE><MASK><NEW_LINE>var cellX = (int) (lastPoint.getX() / CELL_WIDTH);<NEW_LINE>var cellY = (int) (lastPoint.getY() / CELL_HEIGHT);<NEW_LINE>var cell = astarMove.getGrid().get(cellX, cellY);<NEW_LINE>var currentCell = astarMove.getCurrentCell().get();<NEW_LINE>if (currentCell != cell) {<NEW_LINE>astarMove.moveToCell(cell);<NEW_LINE>} else {<NEW_LINE>if (sense.getState() == SenseAIState.AGGRESSIVE) {<NEW_LINE>astarMove.getGrid().getNeighbors(cellX, cellY).stream().findAny().ifPresent(c -> astarMove.moveToCell(c));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sense.getState() == SenseAIState.ALERT) {<NEW_LINE>cellMove.setSpeed(120);<NEW_LINE>} else if (sense.getState() == SenseAIState.AGGRESSIVE) {<NEW_LINE>cellMove.setSpeed(450);<NEW_LINE>}<NEW_LINE>} | var lastPoint = sense.getLastHeardPoint(); |
1,200,262 | public VehicleRoutingAlgorithm createAlgorithm(VehicleRoutingProblem vrp) {<NEW_LINE>// TODO determine alpha threshold<NEW_LINE>int radialShare = (int) (vrp.getJobs().size() * 0.3);<NEW_LINE>int randomShare = (int) (vrp.getJobs(<MASK><NEW_LINE>Jsprit.Builder builder = Jsprit.Builder.newInstance(vrp);<NEW_LINE>builder.setProperty(Jsprit.Parameter.THRESHOLD_ALPHA, "0.0");<NEW_LINE>builder.setProperty(Jsprit.Strategy.RADIAL_BEST, "0.5");<NEW_LINE>builder.setProperty(Jsprit.Strategy.RADIAL_REGRET, "0.0");<NEW_LINE>builder.setProperty(Jsprit.Strategy.RANDOM_BEST, "0.5");<NEW_LINE>builder.setProperty(Jsprit.Strategy.RANDOM_REGRET, "0.0");<NEW_LINE>builder.setProperty(Jsprit.Strategy.WORST_BEST, "0.0");<NEW_LINE>builder.setProperty(Jsprit.Strategy.WORST_REGRET, "0.0");<NEW_LINE>builder.setProperty(Jsprit.Strategy.CLUSTER_BEST, "0.0");<NEW_LINE>builder.setProperty(Jsprit.Strategy.CLUSTER_REGRET, "0.0");<NEW_LINE>builder.setProperty(Jsprit.Parameter.RADIAL_MIN_SHARE, String.valueOf(radialShare));<NEW_LINE>builder.setProperty(Jsprit.Parameter.RADIAL_MAX_SHARE, String.valueOf(radialShare));<NEW_LINE>builder.setProperty(Jsprit.Parameter.RANDOM_BEST_MIN_SHARE, String.valueOf(randomShare));<NEW_LINE>builder.setProperty(Jsprit.Parameter.RANDOM_BEST_MAX_SHARE, String.valueOf(randomShare));<NEW_LINE>return builder.buildAlgorithm();<NEW_LINE>} | ).size() * 0.5); |
669,072 | public PTransform<PBegin, PCollection<Row>> buildExternal(ReadBuilder.Configuration configuration) {<NEW_LINE>configuration.checkMandatoryFields();<NEW_LINE>SpannerIO.Read readTransform = SpannerIO.read().withProjectId(configuration.projectId).withDatabaseId(configuration.databaseId).withInstanceId(configuration.instanceId).withReadOperation(configuration.getReadOperation());<NEW_LINE>if (configuration.host != null) {<NEW_LINE>readTransform = readTransform.withHost(configuration.host);<NEW_LINE>}<NEW_LINE>if (configuration.emulatorHost != null) {<NEW_LINE>readTransform = readTransform.withEmulatorHost(configuration.emulatorHost);<NEW_LINE>}<NEW_LINE>@Nullable<NEW_LINE>TimestampBound timestampBound = configuration.getTimestampBound();<NEW_LINE>if (timestampBound != null) {<NEW_LINE>readTransform = readTransform.withTimestampBound(timestampBound);<NEW_LINE>}<NEW_LINE>if (configuration.batching != null) {<NEW_LINE>readTransform = <MASK><NEW_LINE>}<NEW_LINE>return new SpannerIO.ReadRows(readTransform, configuration.schema);<NEW_LINE>} | readTransform.withBatching(configuration.batching); |
465,491 | public com.amazonaws.services.inspector.model.InvalidCrossAccountRoleException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.inspector.model.InvalidCrossAccountRoleException invalidCrossAccountRoleException = new com.amazonaws.services.inspector.model.InvalidCrossAccountRoleException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("canRetry", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>invalidCrossAccountRoleException.setCanRetry(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("errorCode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>invalidCrossAccountRoleException.setInspectorErrorCode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return invalidCrossAccountRoleException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
153,101 | public boolean onMessage(Message<?> message) {<NEW_LINE>if (this.delegate.getConnectionId().equals(message.getHeaders().get(IpHeaders.CONNECTION_ID))) {<NEW_LINE>AbstractIntegrationMessageBuilder<?> messageBuilder = getMessageBuilderFactory().fromMessage(message).setHeader(IpHeaders.<MASK><NEW_LINE>if (message.getHeaders().get(IpHeaders.ACTUAL_CONNECTION_ID) == null) {<NEW_LINE>messageBuilder.setHeader(IpHeaders.ACTUAL_CONNECTION_ID, message.getHeaders().get(IpHeaders.CONNECTION_ID));<NEW_LINE>}<NEW_LINE>TcpListener listener = getListener();<NEW_LINE>if (listener == null) {<NEW_LINE>if (this.logger.isDebugEnabled()) {<NEW_LINE>logger.debug("No listener for " + message);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>return listener.onMessage(messageBuilder.build());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Message from defunct connection ignored " + message);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | CONNECTION_ID, this.getConnectionId()); |
544,055 | // ~ Methods --------------------------------------------------------------------------------------------------------------<NEW_LINE>private String buildInfo() {<NEW_LINE>JmxModel jmx = JmxModelFactory.getJmxModelFor(module.getGlassFishRoot().getApplication());<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>try {<NEW_LINE>ObjectName objName = new ObjectName(module.getObjectName());<NEW_LINE>MBeanServerConnection connection = jmx.getMBeanServerConnection();<NEW_LINE>sb.append("<br/>");<NEW_LINE>sb.append("<b>Context: </b>").append(connection.getAttribute(objName, "path")).append("<br/>");<NEW_LINE>sb.append("<b>Document Base: </b>").append(connection.getAttribute(objName, "docBase")).append("<br/>");<NEW_LINE>sb.append("<b>Working Dir: </b>").append(connection.getAttribute(objName, "workDir")).append("<br/>");<NEW_LINE>sb.append("<br/>");<NEW_LINE>boolean cacheAllowed = (Boolean) connection.getAttribute(objName, "cachingAllowed");<NEW_LINE>sb.append("<b>Caching: </b>").append(cacheAllowed ? "Allowed" : "Disallowed").append("<br/>");<NEW_LINE>sb.append("<br/>");<NEW_LINE>} catch (MBeanException ex) {<NEW_LINE>LOGGER.throwing(GlassFishWebModuleViewProvider.class.getName(), "buildInfo", ex);<NEW_LINE>} catch (AttributeNotFoundException ex) {<NEW_LINE>LOGGER.throwing(GlassFishWebModuleViewProvider.class.getName(), "buildInfo", ex);<NEW_LINE>} catch (InstanceNotFoundException ex) {<NEW_LINE>LOGGER.throwing(GlassFishWebModuleViewProvider.class.getName(), "buildInfo", ex);<NEW_LINE>} catch (ReflectionException ex) {<NEW_LINE>LOGGER.throwing(GlassFishWebModuleViewProvider.class.<MASK><NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.throwing(GlassFishWebModuleViewProvider.class.getName(), "buildInfo", ex);<NEW_LINE>} catch (MalformedObjectNameException ex) {<NEW_LINE>LOGGER.throwing(GlassFishWebModuleViewProvider.class.getName(), "buildInfo", ex);<NEW_LINE>} catch (NullPointerException ex) {<NEW_LINE>LOGGER.throwing(GlassFishWebModuleViewProvider.class.getName(), "buildInfo", ex);<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | getName(), "buildInfo", ex); |
163,449 | final DescribeAccountAttributesResult executeDescribeAccountAttributes(DescribeAccountAttributesRequest describeAccountAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAccountAttributesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAccountAttributesRequest> request = null;<NEW_LINE>Response<DescribeAccountAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAccountAttributesRequestMarshaller().marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Elastic Beanstalk");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAccountAttributes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeAccountAttributesResult> responseHandler = new StaxResponseHandler<DescribeAccountAttributesResult>(new DescribeAccountAttributesResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(describeAccountAttributesRequest)); |
1,037,012 | public static Pair<List<String>, List<String>> classifyTablesByPrefixPartitionColumns(String schemaName, int prefixPartColCnt, String tableGroupName, String baseTableName) {<NEW_LINE>PartitionInfoManager partInfoMgr = OptimizerContext.getContext(schemaName).getPartitionInfoManager();<NEW_LINE>TableGroupInfoManager tgMgr = OptimizerContext.<MASK><NEW_LINE>TableGroupConfig tgConfig = tgMgr.getTableGroupConfigByName(tableGroupName);<NEW_LINE>PartitionInfo baseTblPartInfo = partInfoMgr.getPartitionInfo(baseTableName);<NEW_LINE>List<String> targetTblList = new ArrayList<>();<NEW_LINE>List<String> targetPartColList = new ArrayList<>();<NEW_LINE>List<String> baseTblPartCols = baseTblPartInfo.getPartitionBy().getPartitionColumnNameList();<NEW_LINE>if (baseTblPartCols.size() < prefixPartColCnt) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < prefixPartColCnt; i++) {<NEW_LINE>targetPartColList.add(baseTblPartCols.get(i));<NEW_LINE>}<NEW_LINE>List<TablePartRecordInfoContext> tblInfos = tgConfig.getTables();<NEW_LINE>for (int i = 0; i < tblInfos.size(); i++) {<NEW_LINE>TablePartRecordInfoContext tbInfo = tblInfos.get(i);<NEW_LINE>String tbName = tbInfo.getTableName();<NEW_LINE>if (tbName.equalsIgnoreCase(baseTableName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>PartitionInfo partInfo = partInfoMgr.getPartitionInfo(tbName);<NEW_LINE>boolean compRs = baseTblPartInfo.equals(partInfo, prefixPartColCnt);<NEW_LINE>if (compRs) {<NEW_LINE>targetTblList.add(tbName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Pair<List<String>, List<String>> result = new Pair<>(targetPartColList, targetTblList);<NEW_LINE>return result;<NEW_LINE>} | getContext(schemaName).getTableGroupInfoManager(); |
1,581,440 | private void genVirtualCall(BIRTerminator.Call callIns, boolean isBuiltInModule, int localVarOffset) {<NEW_LINE>// load self<NEW_LINE>BIRNode.BIRVariableDcl selfArg = callIns.args.get(0).variableDcl;<NEW_LINE>this.loadVar(selfArg);<NEW_LINE>this.mv.visitTypeInsn(CHECKCAST, B_OBJECT);<NEW_LINE>// load the strand<NEW_LINE>this.mv.visitVarInsn(ALOAD, localVarOffset);<NEW_LINE>// load the function name as the second argument<NEW_LINE>this.mv.visitLdcInsn(JvmCodeGenUtil.rewriteVirtualCallTypeName(callIns.name.value));<NEW_LINE>// create an Object[] for the rest params<NEW_LINE>int argsCount = callIns.args.size() - 1;<NEW_LINE>// arg count doubled and 'isExist' boolean variables added for each arg.<NEW_LINE>this.mv.visitLdcInsn((long) (argsCount * 2));<NEW_LINE>this.mv.visitInsn(L2I);<NEW_LINE>this.mv.visitTypeInsn(ANEWARRAY, OBJECT);<NEW_LINE>int i = 0;<NEW_LINE>int j = 0;<NEW_LINE>while (i < argsCount) {<NEW_LINE>this.mv.visitInsn(DUP);<NEW_LINE>this.mv.visitLdcInsn((long) j);<NEW_LINE>this.mv.visitInsn(L2I);<NEW_LINE>j += 1;<NEW_LINE>// i + 1 is used since we skip the first argument (self)<NEW_LINE>BIRArgument arg = callIns.<MASK><NEW_LINE>this.loadArgument(arg);<NEW_LINE>// Add the to the rest params array<NEW_LINE>jvmCastGen.addBoxInsn(this.mv, arg.variableDcl.type);<NEW_LINE>this.mv.visitInsn(AASTORE);<NEW_LINE>this.mv.visitInsn(DUP);<NEW_LINE>this.mv.visitLdcInsn((long) j);<NEW_LINE>this.mv.visitInsn(L2I);<NEW_LINE>j += 1;<NEW_LINE>this.loadStateOfArgument(arg, isBuiltInModule);<NEW_LINE>jvmCastGen.addBoxInsn(this.mv, symbolTable.booleanType);<NEW_LINE>this.mv.visitInsn(AASTORE);<NEW_LINE>i += 1;<NEW_LINE>}<NEW_LINE>// call method<NEW_LINE>String methodDesc = BOBJECT_CALL;<NEW_LINE>this.mv.visitMethodInsn(INVOKEINTERFACE, B_OBJECT, "call", methodDesc, true);<NEW_LINE>BType returnType = callIns.lhsOp.variableDcl.type;<NEW_LINE>jvmCastGen.addUnboxInsn(this.mv, returnType);<NEW_LINE>} | args.get(i + 1); |
495,713 | public void paint(Graphics2D g, int w, int h) {<NEW_LINE>if (Float.isNaN(dot_x)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int draw_width = w - ins_left - ins_right;<NEW_LINE>int draw_height = h - ins_top - ins_left;<NEW_LINE>float x = draw_width * (dot_x - minx) / (maxx - minx) + ins_left;<NEW_LINE>float y = draw_height * (1 - (dot_y - miny) / <MASK><NEW_LINE>int dot_x = (int) x - 3;<NEW_LINE>int dot_y = (int) y - 3;<NEW_LINE>for (int i = 0; i < lastDotsX.length; i++) {<NEW_LINE>g.setColor(dotsColor[i]);<NEW_LINE>g.fillRoundRect(lastDotsX[i], lastDotsY[i], 7, 7, 6, 6);<NEW_LINE>if (i < lastDotsX.length - 1) {<NEW_LINE>lastDotsX[i] = lastDotsX[i + 1];<NEW_LINE>lastDotsY[i] = lastDotsY[i + 1];<NEW_LINE>} else {<NEW_LINE>lastDotsX[i] = dot_x;<NEW_LINE>lastDotsY[i] = dot_y;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>g.setColor(base);<NEW_LINE>g.fillRoundRect(dot_x, dot_y, 7, 7, 6, 6);<NEW_LINE>} | (maxy - miny)) + ins_top; |
1,610,657 | public com.amazonaws.services.lexmodelbuilding.model.NotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.lexmodelbuilding.model.NotFoundException notFoundException = new com.amazonaws.services.lexmodelbuilding.model.NotFoundException(null);<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return notFoundException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
633,155 | public void captureAmount(@NonNull final PaymentReservationCaptureRequest request) {<NEW_LINE>final PaymentReservation reservation = getBySalesOrderIdNotVoided(request.getSalesOrderId()).orElse(null);<NEW_LINE>if (reservation == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// eagerly fetching the processor to fail fast<NEW_LINE>final PaymentProcessor paymentProcessor = getPaymentProcessor(reservation.getPaymentRule());<NEW_LINE>final PaymentId paymentId = createPayment(request);<NEW_LINE>final PaymentReservationCapture capture = //<NEW_LINE>PaymentReservationCapture.builder().reservationId(reservation.getId()).status(PaymentReservationCaptureStatus.NEW).orgId(reservation.getOrgId()).salesOrderId(reservation.getSalesOrderId()).salesInvoiceId(request.getSalesInvoiceId()).paymentId(//<NEW_LINE>paymentId).amount(//<NEW_LINE>request.<MASK><NEW_LINE>capturesRepo.save(capture);<NEW_LINE>paymentProcessor.processCapture(reservation, capture);<NEW_LINE>reservationsRepo.save(reservation);<NEW_LINE>capture.setStatusAsCompleted();<NEW_LINE>capturesRepo.save(capture);<NEW_LINE>} | getAmount()).build(); |
738,857 | public void marshall(BackupVaultListMember backupVaultListMember, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (backupVaultListMember == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(backupVaultListMember.getBackupVaultName(), BACKUPVAULTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(backupVaultListMember.getBackupVaultArn(), BACKUPVAULTARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(backupVaultListMember.getCreationDate(), CREATIONDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(backupVaultListMember.getCreatorRequestId(), CREATORREQUESTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(backupVaultListMember.getNumberOfRecoveryPoints(), NUMBEROFRECOVERYPOINTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(backupVaultListMember.getLocked(), LOCKED_BINDING);<NEW_LINE>protocolMarshaller.marshall(backupVaultListMember.getMinRetentionDays(), MINRETENTIONDAYS_BINDING);<NEW_LINE>protocolMarshaller.marshall(backupVaultListMember.getMaxRetentionDays(), MAXRETENTIONDAYS_BINDING);<NEW_LINE>protocolMarshaller.marshall(backupVaultListMember.getLockDate(), LOCKDATE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | backupVaultListMember.getEncryptionKeyArn(), ENCRYPTIONKEYARN_BINDING); |
423,153 | public void createMenuItems(Bundle savedInstanceState) {<NEW_LINE>final OsmandApplication app = getMyApplication();<NEW_LINE>Context context = getContext();<NEW_LINE>if (context == null || app == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE>pluginId = savedInstanceState.getString(PLUGIN_ID_KEY);<NEW_LINE>} else {<NEW_LINE>Bundle args = getArguments();<NEW_LINE>if (args != null) {<NEW_LINE>pluginId = args.getString(PLUGIN_ID_KEY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OsmandPlugin <MASK><NEW_LINE>if (plugin == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BaseBottomSheetItem titleItem = new TitleItem.Builder().setTitle(getString(R.string.new_plugin_added)).setLayoutId(R.layout.bottom_sheet_item_title_big).create();<NEW_LINE>items.add(titleItem);<NEW_LINE>Typeface typeface = FontCache.getRobotoMedium(getContext());<NEW_LINE>SpannableString pluginTitleSpan = new SpannableString(plugin.getName());<NEW_LINE>pluginTitleSpan.setSpan(new CustomTypefaceSpan(typeface), 0, pluginTitleSpan.length(), 0);<NEW_LINE>Drawable pluginIcon = plugin.getLogoResource();<NEW_LINE>if (pluginIcon.getConstantState() != null) {<NEW_LINE>pluginIcon = pluginIcon.getConstantState().newDrawable().mutate();<NEW_LINE>}<NEW_LINE>pluginIcon = UiUtilities.tintDrawable(pluginIcon, ColorUtilities.getDefaultIconColor(app, nightMode));<NEW_LINE>BaseBottomSheetItem pluginTitle = new SimpleBottomSheetItem.Builder().setTitle(pluginTitleSpan).setTitleColorId(ColorUtilities.getActiveColorId(nightMode)).setIcon(pluginIcon).setLayoutId(R.layout.bottom_sheet_item_simple_56dp).create();<NEW_LINE>items.add(pluginTitle);<NEW_LINE>descrItem = (BottomSheetItemTitleWithDescrAndButton) new BottomSheetItemTitleWithDescrAndButton.Builder().setButtonTitle(getString(R.string.show_full_description)).setOnButtonClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>descriptionExpanded = !descriptionExpanded;<NEW_LINE>descrItem.setButtonText(getString(descriptionExpanded ? R.string.hide_full_description : R.string.show_full_description));<NEW_LINE>descrItem.setDescriptionMaxLines(descriptionExpanded ? Integer.MAX_VALUE : COLLAPSED_DESCRIPTION_LINES);<NEW_LINE>setupHeightAndBackground(getView());<NEW_LINE>}<NEW_LINE>}).setDescriptionLinksClickable(true).setDescription(plugin.getDescription()).setDescriptionMaxLines(COLLAPSED_DESCRIPTION_LINES).setLayoutId(R.layout.bottom_sheet_item_with_expandable_descr).create();<NEW_LINE>items.add(descrItem);<NEW_LINE>List<ApplicationMode> addedAppModes = plugin.getAddedAppModes();<NEW_LINE>if (!addedAppModes.isEmpty()) {<NEW_LINE>createAddedAppModesItems(addedAppModes);<NEW_LINE>}<NEW_LINE>List<IndexItem> suggestedMaps = plugin.getSuggestedMaps();<NEW_LINE>if (!suggestedMaps.isEmpty()) {<NEW_LINE>createSuggestedMapsItems(suggestedMaps);<NEW_LINE>}<NEW_LINE>} | plugin = OsmandPlugin.getPlugin(pluginId); |
247,359 | public okhttp3.Call subscriptionsMultiplePostCall(List<SubscriptionDTO> subscriptionDTO, String xWSO2Tenant, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = subscriptionDTO;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/subscriptions/multiple";<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>if (xWSO2Tenant != null) {<NEW_LINE>localVarHeaderParams.put("X-WSO2-Tenant", localVarApiClient.parameterToString(xWSO2Tenant));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | String[] localVarContentTypes = { "application/json" }; |
1,043,989 | static MaskedPassword createRaw(String algorithm, char[] initialKeyMaterial, int iterationCount, byte[] salt, byte[] maskedPasswordBytes, byte[] initializationVector) {<NEW_LINE><MASK><NEW_LINE>Assert.checkNotNullParam("initialKeyMaterial", initialKeyMaterial);<NEW_LINE>Assert.checkNotNullParam("salt", salt);<NEW_LINE>Assert.checkNotNullParam("maskedPasswordBytes", maskedPasswordBytes);<NEW_LINE>char[] initialKeyMaterialClone = new char[initialKeyMaterial.length];<NEW_LINE>System.arraycopy(initialKeyMaterial, 0, initialKeyMaterialClone, 0, initialKeyMaterial.length);<NEW_LINE>byte[] saltClone = new byte[salt.length];<NEW_LINE>System.arraycopy(salt, 0, saltClone, 0, salt.length);<NEW_LINE>byte[] maskedPasswordBytesClone = new byte[maskedPasswordBytes.length];<NEW_LINE>System.arraycopy(maskedPasswordBytes, 0, maskedPasswordBytesClone, 0, maskedPasswordBytes.length);<NEW_LINE>return (MaskedPassword) (Object) new Target_org_wildfly_security_password_interfaces_RawMaskedPassword(algorithm, initialKeyMaterialClone, iterationCount, saltClone, maskedPasswordBytesClone, initializationVector);<NEW_LINE>} | Assert.checkNotNullParam("algorithm", algorithm); |
170,898 | public void insertRow() throws SQLException {<NEW_LINE>isUpdatable();<NEW_LINE>if (!oninsrow || rowbuf == null) {<NEW_LINE>throw new SQLException("no insert data provided");<NEW_LINE>}<NEW_LINE>JDBCResultSetMetaData <MASK><NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>sb.append("INSERT INTO ");<NEW_LINE>sb.append(SQLite.Shell.sql_quote_dbl(uptable));<NEW_LINE>sb.append("(");<NEW_LINE>for (int i = 0; i < tr.ncolumns; i++) {<NEW_LINE>sb.append(SQLite.Shell.sql_quote_dbl(m.getColumnName(i + 1)));<NEW_LINE>if (i < tr.ncolumns - 1) {<NEW_LINE>sb.append(",");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(") VALUES(");<NEW_LINE>for (int i = 0; i < tr.ncolumns; i++) {<NEW_LINE>sb.append(nullrepl ? "'%q'" : "%Q");<NEW_LINE>if (i < tr.ncolumns - 1) {<NEW_LINE>sb.append(",");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(")");<NEW_LINE>try {<NEW_LINE>this.s.conn.db.exec(sb.toString(), null, rowbuf);<NEW_LINE>} catch (SQLite.Exception e) {<NEW_LINE>throw new SQLException(e.getMessage());<NEW_LINE>}<NEW_LINE>tr.newrow(rowbuf);<NEW_LINE>rowbuf = null;<NEW_LINE>oninsrow = false;<NEW_LINE>last();<NEW_LINE>} | m = (JDBCResultSetMetaData) getMetaData(); |
1,673,106 | public LoadStmt toLoadStmt() throws DdlException {<NEW_LINE>LabelName commitLabel = multiLabel;<NEW_LINE>List<DataDescription> dataDescriptions = Lists.newArrayList();<NEW_LINE>for (TableLoadDesc desc : loadDescByTable.values()) {<NEW_LINE>dataDescriptions.add(desc.toDataDesc());<NEW_LINE>}<NEW_LINE>Map<String, String> brokerProperties = Maps.newHashMap();<NEW_LINE>brokerProperties.put(BrokerDesc.MULTI_LOAD_BROKER_BACKEND_KEY, backendId.toString());<NEW_LINE>BrokerDesc brokerDesc = new BrokerDesc(BrokerDesc.MULTI_LOAD_BROKER, brokerProperties);<NEW_LINE>LoadStmt loadStmt = new LoadStmt(commitLabel, dataDescriptions, brokerDesc, null, properties);<NEW_LINE>loadStmt.setEtlJobType(EtlJobType.BROKER);<NEW_LINE>loadStmt.setOrigStmt(new OriginStatement("", 0));<NEW_LINE>loadStmt.setUserInfo(ConnectContext.<MASK><NEW_LINE>Analyzer analyzer = new Analyzer(ConnectContext.get().getCatalog(), ConnectContext.get());<NEW_LINE>try {<NEW_LINE>loadStmt.analyze(analyzer);<NEW_LINE>} catch (UserException e) {<NEW_LINE>throw new DdlException(e.getMessage());<NEW_LINE>}<NEW_LINE>return loadStmt;<NEW_LINE>} | get().getCurrentUserIdentity()); |
1,814,202 | public static SvnMaterialConfig fromJSON(JsonReader jsonReader, ConfigHelperOptions options) {<NEW_LINE>SvnMaterialConfig svnMaterialConfig = new SvnMaterialConfig();<NEW_LINE>ScmMaterialRepresenter.fromJSON(jsonReader, svnMaterialConfig);<NEW_LINE>jsonReader.readStringIfPresent("url", svnMaterialConfig::setUrl);<NEW_LINE>jsonReader.optBoolean("check_externals").ifPresent(svnMaterialConfig::setCheckExternals);<NEW_LINE>jsonReader.readStringIfPresent("username", svnMaterialConfig::setUserName);<NEW_LINE>String password = null, encryptedPassword = null;<NEW_LINE>if (jsonReader.hasJsonObject("password")) {<NEW_LINE>password = jsonReader.getString("password");<NEW_LINE>}<NEW_LINE>if (jsonReader.hasJsonObject("encrypted_password")) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>PasswordDeserializer passwordDeserializer = options.getPasswordDeserializer();<NEW_LINE>String encryptedPasswordValue = passwordDeserializer.deserialize(password, encryptedPassword, svnMaterialConfig);<NEW_LINE>svnMaterialConfig.setEncryptedPassword(encryptedPasswordValue);<NEW_LINE>return svnMaterialConfig;<NEW_LINE>} | encryptedPassword = jsonReader.getString("encrypted_password"); |
1,144,904 | // We use reflection to get the methods from WebObjects because the jar is not distribuable publicly<NEW_LINE>// and we want to build witout it.<NEW_LINE>@Init<NEW_LINE>@SuppressWarnings({ "rawtypes", "unchecked" })<NEW_LINE>public void init(PluginConfiguration pluginConfiguration, ClassLoader appClassLoader) {<NEW_LINE>try {<NEW_LINE>Class kvcDefaultImplementationClass = Class.forName("com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation", false, appClassLoader);<NEW_LINE>kvcDefaultImplementation_flushCaches = kvcDefaultImplementationClass.getMethod("_flushCaches");<NEW_LINE>Class kvcReflectionKeyBindingCreationClass = Class.forName("com.webobjects.foundation.NSKeyValueCoding$_ReflectionKeyBindingCreation", false, appClassLoader);<NEW_LINE><MASK><NEW_LINE>Class kvcValueAccessorClass = Class.forName("com.webobjects.foundation.NSKeyValueCoding$ValueAccessor", false, appClassLoader);<NEW_LINE>kvcValueAccessor_flushCaches = kvcValueAccessorClass.getMethod("_flushCaches");<NEW_LINE>Class nsValidationDefaultImplementationClass = Class.forName("com.webobjects.foundation.NSValidation$DefaultImplementation", false, appClassLoader);<NEW_LINE>nsValidationDefaultImplementation_flushCaches = nsValidationDefaultImplementationClass.getMethod("_flushCaches");<NEW_LINE>Class woApplicationClass = Class.forName("com.webobjects.appserver.WOApplication", false, appClassLoader);<NEW_LINE>woApplication_removeComponentDefinitionCacheContents = woApplicationClass.getMethod("_removeComponentDefinitionCacheContents");<NEW_LINE>woApplicationObject = woApplicationClass.getMethod("application").invoke(null);<NEW_LINE>ClassPool classPool = ClassPool.getDefault();<NEW_LINE>woComponentCtClass = classPool.makeClass("com.webobjects.appserver.WOComponent");<NEW_LINE>nsValidationCtClass = classPool.makeClass("com.webobjects.foundation.NSValidation");<NEW_LINE>woActionCtClass = classPool.makeClass("com.webobjects.appserver.WOAction");<NEW_LINE>Class woActionClass = Class.forName("com.webobjects.appserver.WOAction", false, appClassLoader);<NEW_LINE>Field actionClassesField = woActionClass.getDeclaredField("_actionClasses");<NEW_LINE>actionClassesField.setAccessible(true);<NEW_LINE>actionClassesCacheDictionnary = actionClassesField.get(null);<NEW_LINE>Class nsThreadsafeMutableDictionaryClass = Class.forName("com.webobjects.foundation._NSThreadsafeMutableDictionary", false, appClassLoader);<NEW_LINE>woApplication_removeComponentDefinitionCacheContents = woApplicationClass.getMethod("_removeComponentDefinitionCacheContents");<NEW_LINE>nsThreadsafeMutableDictionary_removeAllObjects = nsThreadsafeMutableDictionaryClass.getMethod("removeAllObjects");<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | kvcReflectionKeyBindingCreation_flushCaches = kvcReflectionKeyBindingCreationClass.getMethod("_flushCaches"); |
1,108,944 | public Quaternion mulLeft(Quaternion other) {<NEW_LINE>final float newX = other.w * this.x + other.x * this.w + other.y * this.z <MASK><NEW_LINE>final float newY = other.w * this.y + other.y * this.w + other.z * this.x - other.x * this.z;<NEW_LINE>final float newZ = other.w * this.z + other.z * this.w + other.x * this.y - other.y * this.x;<NEW_LINE>final float newW = other.w * this.w - other.x * this.x - other.y * this.y - other.z * this.z;<NEW_LINE>this.x = newX;<NEW_LINE>this.y = newY;<NEW_LINE>this.z = newZ;<NEW_LINE>this.w = newW;<NEW_LINE>return this;<NEW_LINE>} | - other.z * this.y; |
1,294,572 | private static void checkTelnetPortPid(Bootstrap bootstrap, long telnetPortPid, long targetPid) {<NEW_LINE>if (telnetPortPid > 0 && targetPid != telnetPortPid) {<NEW_LINE>AnsiLog.error("The telnet port {} is used by process {} instead of target process {}, you will connect to an unexpected process.", bootstrap.<MASK><NEW_LINE>AnsiLog.error("1. Try to restart arthas-boot, select process {}, shutdown it first with running the 'stop' command.", telnetPortPid);<NEW_LINE>AnsiLog.error("2. Or try to stop the existing arthas instance: java -jar arthas-client.jar 127.0.0.1 {} -c \"stop\"", bootstrap.getTelnetPortOrDefault());<NEW_LINE>AnsiLog.error("3. Or try to use different telnet port, for example: java -jar arthas-boot.jar --telnet-port 9998 --http-port -1");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>} | getTelnetPortOrDefault(), telnetPortPid, targetPid); |
1,424,676 | public final OnUpdateExprContext onUpdateExpr() throws RecognitionException {<NEW_LINE>OnUpdateExprContext _localctx = new OnUpdateExprContext(_ctx, getState());<NEW_LINE><MASK><NEW_LINE>paraphrases.push("on-update clause");<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(900);<NEW_LINE>match(UPDATE);<NEW_LINE>setState(901);<NEW_LINE>((OnUpdateExprContext) _localctx).n = match(IDENT);<NEW_LINE>setState(905);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(_input.LA(1)) {<NEW_LINE>case AS:<NEW_LINE>{<NEW_LINE>setState(902);<NEW_LINE>match(AS);<NEW_LINE>setState(903);<NEW_LINE>identOrTicked();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case TICKED_STRING_LITERAL:<NEW_LINE>case IDENT:<NEW_LINE>{<NEW_LINE>setState(904);<NEW_LINE>identOrTicked();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case SET:<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>setState(907);<NEW_LINE>match(SET);<NEW_LINE>setState(908);<NEW_LINE>onSetAssignmentList();<NEW_LINE>setState(911);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == WHERE) {<NEW_LINE>{<NEW_LINE>setState(909);<NEW_LINE>match(WHERE);<NEW_LINE>setState(910);<NEW_LINE>whereClause();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>_ctx.stop = _input.LT(-1);<NEW_LINE>paraphrases.pop();<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | enterRule(_localctx, 60, RULE_onUpdateExpr); |
1,629,943 | public StartTaskContactResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StartTaskContactResult startTaskContactResult = new StartTaskContactResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return startTaskContactResult;<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("ContactId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startTaskContactResult.setContactId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return startTaskContactResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
935,616 | /*<NEW_LINE>* @see com.sitewhere.grpc.service.DeviceEventManagementGrpc.<NEW_LINE>* DeviceEventManagementImplBase#addStateChanges(com.sitewhere.grpc.service.<NEW_LINE>* GAddStateChangesRequest, io.grpc.stub.StreamObserver)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void addStateChanges(GAddStateChangesRequest request, StreamObserver<GAddStateChangesResponse> responseObserver) {<NEW_LINE>try {<NEW_LINE>GrpcUtils.handleServerMethodEntry(this, DeviceEventManagementGrpc.getAddStateChangesMethod());<NEW_LINE>List<? extends IDeviceStateChange> apiResult = getDeviceEventManagement().addDeviceStateChanges(EventModelConverter.asApiDeviceEventContext(request.getContext()), EventModelConverter.asApiDeviceStateChangeCreateRequests(request.getRequestsList()).toArray(new IDeviceStateChangeCreateRequest[0]));<NEW_LINE>GAddStateChangesResponse.Builder response = GAddStateChangesResponse.newBuilder();<NEW_LINE>if (apiResult != null) {<NEW_LINE>response.addAllStateChanges(EventModelConverter.asGrpcDeviceStateChanges(apiResult));<NEW_LINE>}<NEW_LINE>responseObserver.<MASK><NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>GrpcUtils.handleServerMethodException(DeviceEventManagementGrpc.getAddStateChangesMethod(), e, responseObserver);<NEW_LINE>} finally {<NEW_LINE>GrpcUtils.handleServerMethodExit(DeviceEventManagementGrpc.getAddStateChangesMethod());<NEW_LINE>}<NEW_LINE>} | onNext(response.build()); |
1,296,762 | private void read() {<NEW_LINE>org.w3c.dom.Document document;<NEW_LINE>File file;<NEW_LINE>InputStream is;<NEW_LINE>int avail = 0;<NEW_LINE>try {<NEW_LINE>file = trackingFile;<NEW_LINE>if (!file.isFile()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>is = new FileInputStream(file);<NEW_LINE>avail = is.available();<NEW_LINE>InputSource xmlInputSource = new InputSource(is);<NEW_LINE>document = XMLUtil.parse(xmlInputSource, false, false, DUMMY_ERROR_HANDLER, XMLUtil.createAUResolver());<NEW_LINE>if (is != null) {<NEW_LINE>is.close();<NEW_LINE>}<NEW_LINE>} catch (org.xml.sax.SAXException e) {<NEW_LINE>// NOI18N<NEW_LINE>XMLUtil.LOG.log(Level.SEVERE, "Bad update_tracking: " + <MASK><NEW_LINE>return;<NEW_LINE>} catch (java.io.IOException e) {<NEW_LINE>// NOI18N<NEW_LINE>XMLUtil.LOG.log(Level.SEVERE, "Missing update_tracking: " + trackingFile + ", available bytes: " + avail, e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>org.w3c.dom.Element element = document.getDocumentElement();<NEW_LINE>if ((element != null) && element.getTagName().equals(ELEMENT_MODULES)) {<NEW_LINE>scanElement_installed_modules(element);<NEW_LINE>}<NEW_LINE>} | trackingFile + ", available bytes: " + avail, e); |
28,369 | public InsightSelector unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InsightSelector insightSelector = new InsightSelector();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("InsightType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>insightSelector.setInsightType(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return insightSelector;<NEW_LINE>} | class).unmarshall(context)); |
1,500,287 | public static void shareFeedItemLinkWithDownloadLink(Context context, FeedItem item, boolean withPosition) {<NEW_LINE>String text = getItemShareText(item);<NEW_LINE>int pos = 0;<NEW_LINE>if (item.getMedia() != null && withPosition) {<NEW_LINE>text += "\n" + context.getResources().getString(R.string.share_starting_position_label) + ": ";<NEW_LINE>pos = item.getMedia().getPosition();<NEW_LINE>text += Converter.getDurationStringLong(pos);<NEW_LINE>}<NEW_LINE>if (hasLinkToShare(item)) {<NEW_LINE>text += "\n\n" + context.getResources().getString(R.string.share_dialog_episode_website_label) + ": ";<NEW_LINE>text += FeedItemUtil.getLinkWithFallback(item);<NEW_LINE>}<NEW_LINE>if (item.getMedia() != null && item.getMedia().getDownload_url() != null) {<NEW_LINE>text += "\n\n" + context.getResources().getString(<MASK><NEW_LINE>text += item.getMedia().getDownload_url();<NEW_LINE>if (withPosition) {<NEW_LINE>text += "#t=" + pos / 1000;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>shareLink(context, text);<NEW_LINE>} | R.string.share_dialog_media_file_label) + ": "; |
1,602,832 | public static long LLVMDIBuilderCreateModule(@NativeType("LLVMDIBuilderRef") long Builder, @NativeType("LLVMMetadataRef") long ParentScope, @NativeType("char const *") CharSequence Name, @NativeType("char const *") CharSequence ConfigMacros, @NativeType("char const *") CharSequence IncludePath, @NativeType("char const *") CharSequence APINotesFile) {<NEW_LINE>MemoryStack stack = stackGet();<NEW_LINE>int stackPointer = stack.getPointer();<NEW_LINE>try {<NEW_LINE>int NameEncodedLength = stack.nUTF8(Name, false);<NEW_LINE><MASK><NEW_LINE>int ConfigMacrosEncodedLength = stack.nUTF8(ConfigMacros, false);<NEW_LINE>long ConfigMacrosEncoded = stack.getPointerAddress();<NEW_LINE>int IncludePathEncodedLength = stack.nUTF8(IncludePath, false);<NEW_LINE>long IncludePathEncoded = stack.getPointerAddress();<NEW_LINE>int APINotesFileEncodedLength = stack.nUTF8(APINotesFile, false);<NEW_LINE>long APINotesFileEncoded = stack.getPointerAddress();<NEW_LINE>return nLLVMDIBuilderCreateModule(Builder, ParentScope, NameEncoded, NameEncodedLength, ConfigMacrosEncoded, ConfigMacrosEncodedLength, IncludePathEncoded, IncludePathEncodedLength, APINotesFileEncoded, APINotesFileEncodedLength);<NEW_LINE>} finally {<NEW_LINE>stack.setPointer(stackPointer);<NEW_LINE>}<NEW_LINE>} | long NameEncoded = stack.getPointerAddress(); |
1,621,410 | private void buildRow(Table table, boolean fullId, boolean detailed, DiscoveryNodes discoveryNodes, TaskInfo taskInfo) {<NEW_LINE>table.startRow();<NEW_LINE>String nodeId = taskInfo.getTaskId().getNodeId();<NEW_LINE>DiscoveryNode node = discoveryNodes.get(nodeId);<NEW_LINE>table.addCell(taskInfo.getId());<NEW_LINE>table.addCell(taskInfo.getAction());<NEW_LINE>table.addCell(taskInfo.getTaskId().toString());<NEW_LINE>if (taskInfo.getParentTaskId().isSet()) {<NEW_LINE>table.addCell(taskInfo.getParentTaskId().toString());<NEW_LINE>} else {<NEW_LINE>table.addCell("-");<NEW_LINE>}<NEW_LINE>table.addCell(taskInfo.getType());<NEW_LINE>table.addCell(taskInfo.getStartTime());<NEW_LINE>table.addCell(FORMATTER.format(Instant.ofEpochMilli(taskInfo.getStartTime())));<NEW_LINE>table.addCell(taskInfo.getRunningTimeNanos());<NEW_LINE>table.addCell(TimeValue.timeValueNanos(taskInfo.getRunningTimeNanos()).toString());<NEW_LINE>// Node information. Note that the node may be null because it has left the cluster between when we got this response and now.<NEW_LINE>table.addCell(fullId ? nodeId : Strings.substring(nodeId, 0, 4));<NEW_LINE>table.addCell(node == null ? "-" : node.getHostAddress());<NEW_LINE>table.addCell(node.getAddress().<MASK><NEW_LINE>table.addCell(node == null ? "-" : node.getName());<NEW_LINE>table.addCell(node == null ? "-" : node.getVersion().toString());<NEW_LINE>if (detailed) {<NEW_LINE>table.addCell(taskInfo.getDescription());<NEW_LINE>}<NEW_LINE>table.endRow();<NEW_LINE>} | address().getPort()); |
1,266,585 | private void createViaBranchBasedOnIncomingRequest(ViaHeader viaHeader, TransactionUserWrapper tUser) throws SipParseException, IllegalArgumentException {<NEW_LINE>B2buaHelper helper = getB2buaHelper(false, UAMode.UAC);<NEW_LINE>if (helper == null) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "createViaBranchBasedOnIncomingRequest", "we are not in B2b mode, branch will be created randomly on stack");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SipServletRequestImpl req = (SipServletRequestImpl) helper.getLinkedSipServletRequest(this);<NEW_LINE>if (req == null) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "createViaBranchBasedOnIncomingRequest", "no B2B request came in, branch will be created randomly on stack");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String reqViaBranch = ((ViaHeader) req.getMessage().getHeader(ViaHeader.name, true)).getBranch();<NEW_LINE>if (reqViaBranch == null) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "createViaBranchBasedOnIncomingRequest", "Incoming message had no VIA branch, branch will be created randomly on stack");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (tUser == null) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "createViaBranchBasedOnIncomingRequest", "TransactionUser was null, branch will be created randomly on stack");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuffer hashedID = new StringBuffer(reqViaBranch.length() + 9);<NEW_LINE>hashedID.append(reqViaBranch);<NEW_LINE>hashedID.append("_");<NEW_LINE>int result = 1;<NEW_LINE>result = 31 * result + tUser<MASK><NEW_LINE>result = 31 * result + (int) getRequest().getCSeqHeader().getSequenceNumber();<NEW_LINE>hashedID.append(result);<NEW_LINE>viaHeader.setBranch(hashedID.toString());<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "createViaBranchBasedOnIncomingRequest", "reqViaBranch = " + reqViaBranch + ", Incoming Request: " + req.getMethod() + " incoming callid= " + req.getCallId() + ", tUser.getSharedID() = " + tUser.getSharedID() + ", getRequest().getCSeqHeader().getSequenceNumber() = " + getRequest().getCSeqHeader().getSequenceNumber() + ", via branch = " + viaHeader.getBranch());<NEW_LINE>}<NEW_LINE>} | .getSharedID().hashCode(); |
957,640 | public static void main(String[] args) throws Exception {<NEW_LINE>Options options = getOptions();<NEW_LINE>try {<NEW_LINE>CommandLineParser parser = new GnuParser();<NEW_LINE>CommandLine line = parser.parse(options, args);<NEW_LINE>File dir = new File(line.getOptionValue("dir", "."));<NEW_LINE>String name = line.getOptionValue("name", "jar");<NEW_LINE>Collection files = FindFile.find(dir, name);<NEW_LINE>System.out.println("listing files in " + dir + " containing " + name);<NEW_LINE>for (Iterator it = files.iterator(); it.hasNext(); ) {<NEW_LINE>System.out.println("\t" + it.next() + "\n");<NEW_LINE>}<NEW_LINE>} catch (ParseException exp) {<NEW_LINE>// oops, something went wrong<NEW_LINE>System.err.println("Parsing failed. Reason: " + exp.getMessage());<NEW_LINE>HelpFormatter formatter = new HelpFormatter();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | formatter.printHelp("find", options); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.