idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,225,502
public boolean diff(final String first, final String second, String diff) throws java.io.IOException {<NEW_LINE>Process prs = null;<NEW_LINE>File diffFile = null;<NEW_LINE>if (null == diff)<NEW_LINE>diffFile = File.createTempFile("~diff", "tmp~");<NEW_LINE>else<NEW_LINE>diffFile = new File(diff);<NEW_LINE>FileOutputStream fos = new FileOutputStream(diffFile);<NEW_LINE>prs = Runtime.getRuntime().exec(prepareCommand(new File(first).getAbsolutePath(), new File(second).getAbsolutePath()));<NEW_LINE>StreamGobbler outputGobbler = new StreamGobbler(<MASK><NEW_LINE>outputGobbler.start();<NEW_LINE>try {<NEW_LINE>prs.waitFor();<NEW_LINE>outputGobbler.join();<NEW_LINE>} catch (java.lang.InterruptedException e) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fos.flush();<NEW_LINE>fos.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>if (0 == prs.exitValue() || null == diff) {<NEW_LINE>diffFile.delete();<NEW_LINE>}<NEW_LINE>return prs.exitValue() != 0;<NEW_LINE>}
prs.getInputStream(), fos);
592,919
protected void applyEnterTableKey(EventBean[] eventsPerStream, Object tableKey, ExprEvaluatorContext exprEvaluatorContext) {<NEW_LINE>ObjectArrayBackedEventBean bean = tableInstance.getCreateRowIntoTable(tableKey, exprEvaluatorContext);<NEW_LINE>currentAggregationRow = (AggregationRow) bean.getProperties()[0];<NEW_LINE>InstrumentationCommon instrumentationCommon = exprEvaluatorContext.getInstrumentationProvider();<NEW_LINE>instrumentationCommon.qAggregationGroupedApplyEnterLeave(true, methodPairs.length, accessAgents.length, tableKey);<NEW_LINE>for (int i = 0; i < methodPairs.length; i++) {<NEW_LINE>TableColumnMethodPairEval methodPair = methodPairs[i];<NEW_LINE>instrumentationCommon.qAggNoAccessEnterLeave(true, i, null, null);<NEW_LINE>Object columnResult = methodPair.getEvaluator().<MASK><NEW_LINE>currentAggregationRow.enterAgg(methodPair.getColumn(), columnResult);<NEW_LINE>instrumentationCommon.aAggNoAccessEnterLeave(true, i, null);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < accessAgents.length; i++) {<NEW_LINE>instrumentationCommon.qAggAccessEnterLeave(true, i, null);<NEW_LINE>accessAgents[i].applyEnter(eventsPerStream, exprEvaluatorContext, currentAggregationRow, accessColumnsZeroOffset[i]);<NEW_LINE>instrumentationCommon.aAggAccessEnterLeave(true, i);<NEW_LINE>}<NEW_LINE>tableInstance.handleRowUpdated(bean);<NEW_LINE>instrumentationCommon.aAggregationGroupedApplyEnterLeave(true);<NEW_LINE>}
evaluate(eventsPerStream, true, exprEvaluatorContext);
1,026,883
public ArrayList<Fact> createFacts(MAcctSchema acctSchema) {<NEW_LINE>ArrayList<Fact> facts = new ArrayList<Fact>();<NEW_LINE>// Other Acct Schema<NEW_LINE>if (acctSchema.getC_AcctSchema_ID() != acctSchemaId)<NEW_LINE>return facts;<NEW_LINE>// create Fact Header<NEW_LINE>Fact fact = new Fact(this, acctSchema, postingType);<NEW_LINE>MDepreciationEntry entry = (MDepreciationEntry) getPO();<NEW_LINE>Iterator<MDepreciationExp> it = entry.getLinesIterator(false);<NEW_LINE>while (it.hasNext()) {<NEW_LINE>MDepreciationExp depreciationExp = it.next();<NEW_LINE>I_A_Asset asset = depreciationExp.getA_Asset();<NEW_LINE>DocLine docLine = createLine(depreciationExp);<NEW_LINE><MASK><NEW_LINE>//<NEW_LINE>MAccount drAccounting = MAccount.getValidCombination(getCtx(), depreciationExp.getDR_Account_ID(), getTrxName());<NEW_LINE>MAccount crAccounting = MAccount.getValidCombination(getCtx(), depreciationExp.getCR_Account_ID(), getTrxName());<NEW_LINE>FactLine[] factLines = FactUtil.createSimpleOperation(fact, docLine, drAccounting, crAccounting, acctSchema.getC_Currency_ID(), expenseAmt, false);<NEW_LINE>for (FactLine factLine : factLines) {<NEW_LINE>StringBuilder description = new StringBuilder(factLine.getDescription() != null ? factLine.getDescription() : "");<NEW_LINE>description.append(" ").append(asset.getValue()).append(" ").append(asset.getName());<NEW_LINE>factLine.setDescription(description.toString());<NEW_LINE>factLine.setC_Project_ID(asset.getC_Project_ID());<NEW_LINE>factLine.setC_Activity_ID(asset.getC_Activity_ID());<NEW_LINE>factLine.setC_BPartner_ID(asset.getC_BPartner_ID());<NEW_LINE>factLine.setLocationFromBPartner(asset.getC_BPartner_Location_ID(), true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>facts.add(fact);<NEW_LINE>return facts;<NEW_LINE>}
BigDecimal expenseAmt = depreciationExp.getExpense();
1,006,361
private void addDeckToCursor(long id, String name, JSONArray deckCounts, MatrixCursor rv, Collection col, String[] columns) {<NEW_LINE>MatrixCursor.<MASK><NEW_LINE>for (String column : columns) {<NEW_LINE>switch(column) {<NEW_LINE>case FlashCardsContract.Deck.DECK_NAME:<NEW_LINE>rb.add(name);<NEW_LINE>break;<NEW_LINE>case FlashCardsContract.Deck.DECK_ID:<NEW_LINE>rb.add(id);<NEW_LINE>break;<NEW_LINE>case FlashCardsContract.Deck.DECK_COUNTS:<NEW_LINE>rb.add(deckCounts);<NEW_LINE>break;<NEW_LINE>case FlashCardsContract.Deck.OPTIONS:<NEW_LINE>String config = col.getDecks().confForDid(id).toString();<NEW_LINE>rb.add(config);<NEW_LINE>break;<NEW_LINE>case FlashCardsContract.Deck.DECK_DYN:<NEW_LINE>rb.add(col.getDecks().isDyn(id));<NEW_LINE>break;<NEW_LINE>case FlashCardsContract.Deck.DECK_DESC:<NEW_LINE>String desc = col.getDecks().getActualDescription();<NEW_LINE>rb.add(desc);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
RowBuilder rb = rv.newRow();
783,061
public Optional<StockMove> copyAndSplitStockMove(StockMove stockMove, List<StockMoveLine> stockMoveLines) throws AxelorException {<NEW_LINE>stockMoveLines = MoreObjects.firstNonNull(stockMoveLines, Collections.emptyList());<NEW_LINE>StockMove newStockMove = stockMoveRepo.copy(stockMove, false);<NEW_LINE>// In copy OriginTypeSelect set null.<NEW_LINE>newStockMove.setOriginTypeSelect(stockMove.getOriginTypeSelect());<NEW_LINE>newStockMove.setOriginId(stockMove.getOriginId());<NEW_LINE>newStockMove.setOrigin(stockMove.getOrigin());<NEW_LINE>for (StockMoveLine stockMoveLine : stockMoveLines) {<NEW_LINE>if (stockMoveLine.getQty().compareTo(stockMoveLine.getRealQty()) > 0) {<NEW_LINE>StockMoveLine newStockMoveLine = copySplittedStockMoveLine(stockMoveLine);<NEW_LINE>newStockMove.addStockMoveLineListItem(newStockMoveLine);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (ObjectUtils.isEmpty(newStockMove.getStockMoveLineList())) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>newStockMove.setRealDate(null);<NEW_LINE>newStockMove.setStockMoveSeq(stockMoveToolService.getSequenceStockMove(newStockMove.getTypeSelect(), newStockMove.getCompany()));<NEW_LINE>newStockMove.setName(stockMoveToolService.computeName(newStockMove, newStockMove.getStockMoveSeq() + " " + I18n.get(IExceptionMessage.STOCK_MOVE_7) + " " + stockMove.getStockMoveSeq() + " )"));<NEW_LINE>newStockMove.setExTaxTotal<MASK><NEW_LINE>plan(newStockMove);<NEW_LINE>newStockMove.setStockMoveOrigin(stockMove);<NEW_LINE>stockMoveRepo.save(newStockMove);<NEW_LINE>stockMove.setBackorderId(newStockMove.getId());<NEW_LINE>return Optional.of(newStockMove);<NEW_LINE>}
(stockMoveToolService.compute(newStockMove));
1,618,339
public static String printMentionDetectionLog(Document document) {<NEW_LINE>StringBuilder sbLog = new StringBuilder();<NEW_LINE>List<CoreMap> sentences = document.annotation.get(SentencesAnnotation.class);<NEW_LINE>sbLog.append("\nERROR START-----------------------------------------------------------------------\n");<NEW_LINE>for (int i = 0; i < sentences.size(); i++) {<NEW_LINE>sbLog.append("\nSENT ").append(i).append(" GOLD : ").append(HybridCorefPrinter.sentenceStringWithMention(i, document, true, false)).append("\n");<NEW_LINE>sbLog.append("SENT ").append(i).append(" PREDICT: ").append(HybridCorefPrinter.sentenceStringWithMention(i, document, false, false)).append("\n");<NEW_LINE>// for(CoreLabel cl : sentences.get(i).get(TokensAnnotation.class)) {<NEW_LINE>// sbLog.append(cl.word()).append("-").append(cl.get(UtteranceAnnotation.class)).append("-").append(cl.get(SpeakerAnnotation.class)).append(" ");<NEW_LINE>// }<NEW_LINE>for (Mention p : document.predictedMentions.get(i)) {<NEW_LINE>sbLog.append("\n");<NEW_LINE>if (!p.hasTwin)<NEW_LINE>sbLog.append("\tSPURIOUS");<NEW_LINE>sbLog.append("\tmention: ").append(p.spanToString()).append("\t\t\theadword: ").append(p.headString).append("\tPOS: ").append(p.headWord.tag()).append("\tmentiontype: ").append(p.mentionType).append("\tnumber: ").append(p.number).append("\tgender: ").append(p.gender).append("\tanimacy: ").append(p.animacy).append("\tperson: ").append(p.person).append("\tNE: ").append(p.nerString);<NEW_LINE>}<NEW_LINE>sbLog.append("\n");<NEW_LINE>for (Mention g : document.goldMentions.get(i)) {<NEW_LINE>if (!g.hasTwin) {<NEW_LINE>sbLog.append("\tmissed gold: ").append(g.spanToString()).append("\tPOS: ").append(g.headWord.tag()).append("\tmentiontype: ").append(g.mentionType).append("\theadword: ").append(g.headString).append("\tnumber: ").append(g.number).append("\tgender: ").append(g.gender).append("\tanimacy: ").append(g.animacy).append("\tperson: ").append(g.person).append("\tNE: ").append(g<MASK><NEW_LINE>if (g.sentenceWords != null)<NEW_LINE>if (g.sentenceWords.size() > g.endIndex)<NEW_LINE>sbLog.append("\tnextword: ").append(g.sentenceWords.get(g.endIndex)).append("\t").append(g.sentenceWords.get(g.endIndex).tag()).append("\n");<NEW_LINE>if (g.contextParseTree != null)<NEW_LINE>sbLog.append(g.contextParseTree.pennString()).append("\n\n");<NEW_LINE>else<NEW_LINE>sbLog.append("\n\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sentences.get(i).get(TreeAnnotation.class) != null)<NEW_LINE>sbLog.append("\n\tparse: \n").append(sentences.get(i).get(TreeAnnotation.class).pennString());<NEW_LINE>sbLog.append("\n\tcollapsedDependency: \n").append(sentences.get(i).get(BasicDependenciesAnnotation.class));<NEW_LINE>}<NEW_LINE>sbLog.append("ERROR END -----------------------------------------------------------------------\n");<NEW_LINE>return sbLog.toString();<NEW_LINE>}
.nerString).append("\n");
1,459,091
private void updateWatchlistBox(final CacheDetailActivity activity) {<NEW_LINE>final boolean supportsWatchList = cache.supportsWatchList();<NEW_LINE>binding.watchlistBox.setVisibility(supportsWatchList ? View.VISIBLE : View.GONE);<NEW_LINE>if (!supportsWatchList) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int watchListCount = cache.getWatchlistCount();<NEW_LINE>if (cache.isOnWatchlist() || cache.isOwner()) {<NEW_LINE>binding.addToWatchlist.setVisibility(View.GONE);<NEW_LINE>binding.removeFromWatchlist.setVisibility(View.VISIBLE);<NEW_LINE>if (watchListCount != -1) {<NEW_LINE>binding.watchlistText.setText(activity.res.getString(R.string.cache_watchlist_on_extra, watchListCount));<NEW_LINE>} else {<NEW_LINE>binding.watchlistText.setText(R.string.cache_watchlist_on);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>binding.addToWatchlist.setVisibility(View.VISIBLE);<NEW_LINE>binding.removeFromWatchlist.setVisibility(View.GONE);<NEW_LINE>if (watchListCount != -1) {<NEW_LINE>binding.watchlistText.setText(activity.res.getString(R.string.cache_watchlist_not_on_extra, watchListCount));<NEW_LINE>} else {<NEW_LINE>binding.watchlistText.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// the owner of a cache has it always on his watchlist. Adding causes an error<NEW_LINE>if (cache.isOwner()) {<NEW_LINE>binding.addToWatchlist.setEnabled(false);<NEW_LINE>binding.addToWatchlist.setVisibility(View.GONE);<NEW_LINE>binding.removeFromWatchlist.setEnabled(false);<NEW_LINE>binding.removeFromWatchlist.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>}
setText(R.string.cache_watchlist_not_on);
1,327,418
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@name('s0') @public insert rstream into NextStream " + "select rstream s0.theString as theString from SupportBean#length(3) as s0", path);<NEW_LINE>env.addListener("s0");<NEW_LINE>env.compileDeploy("@name('ii') select * from NextStream", path).addListener("ii");<NEW_LINE>sendEvent(env, "a", 2);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.assertListenerNotInvoked("ii");<NEW_LINE>sendEvents(env, new String[] { "b", "c" });<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.assertListenerNotInvoked("ii");<NEW_LINE>sendEvent(env, "d", 2);<NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>// receive 'a' as new data<NEW_LINE>assertSame("a", listener.getLastNewData()[0].get("theString"));<NEW_LINE>// receive no more old data<NEW_LINE><MASK><NEW_LINE>});<NEW_LINE>env.assertListener("ii", listener -> {<NEW_LINE>// insert into unchanged<NEW_LINE>assertEquals("a", listener.getLastNewData()[0].get("theString"));<NEW_LINE>// receive no old data in insert into<NEW_LINE>assertNull(listener.getLastOldData());<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
assertNull(listener.getLastOldData());
385,436
public void listSecretVersionsCodeSnippets() {<NEW_LINE>SecretClient secretClient = getSecretClient();<NEW_LINE>// BEGIN: com.azure.security.keyvault.secretclient.listSecretVersions#string<NEW_LINE>for (SecretProperties secret : secretClient.listPropertiesOfSecretVersions("secretName")) {<NEW_LINE>KeyVaultSecret secretWithValue = secretClient.getSecret(secret.getName(), secret.getVersion());<NEW_LINE>System.out.printf("Received secret's version with name %s and value %s", secretWithValue.getName(<MASK><NEW_LINE>}<NEW_LINE>// END: com.azure.security.keyvault.secretclient.listSecretVersions#string<NEW_LINE>// BEGIN: com.azure.security.keyvault.secretclient.listSecretVersions#string-Context<NEW_LINE>for (SecretProperties secret : secretClient.listPropertiesOfSecretVersions("secretName", new Context(key1, value2))) {<NEW_LINE>KeyVaultSecret secretWithValue = secretClient.getSecret(secret.getName(), secret.getVersion());<NEW_LINE>System.out.printf("Received secret's version with name %s and value %s", secretWithValue.getName(), secretWithValue.getValue());<NEW_LINE>}<NEW_LINE>// END: com.azure.security.keyvault.secretclient.listSecretVersions#string-Context<NEW_LINE>// BEGIN: com.azure.security.keyvault.secretclient.listSecretVersions#string-Context-iterableByPage<NEW_LINE>secretClient.listPropertiesOfSecretVersions("secretName", new Context(key1, value2)).iterableByPage().forEach(resp -> {<NEW_LINE>System.out.printf("Got response headers . Url: %s, Status code: %d %n", resp.getRequest().getUrl(), resp.getStatusCode());<NEW_LINE>resp.getItems().forEach(value -> {<NEW_LINE>KeyVaultSecret secretWithValue = secretClient.getSecret(value.getName(), value.getVersion());<NEW_LINE>System.out.printf("Received secret's version with name %s and value %s", secretWithValue.getName(), secretWithValue.getValue());<NEW_LINE>});<NEW_LINE>});<NEW_LINE>// END: com.azure.security.keyvault.secretclient.listSecretVersions#string-Context-iterableByPage<NEW_LINE>}
), secretWithValue.getValue());
225,149
private // final Fact fact,<NEW_LINE>List<Fact> // final Fact fact,<NEW_LINE>createFacts_BankTransfer(// final Fact fact,<NEW_LINE>final AcctSchema as, // final FactLine factLine_BankAsset<NEW_LINE>final DocLine_BankStatement line) {<NEW_LINE>//<NEW_LINE>// Make sure it's a valid bank transfer line<NEW_LINE>Check.assume(line.isBankTransfer(), "Line is bank transfer: {}", line);<NEW_LINE>Check.assume(line.getReferences().isEmpty(), "Line has no referenced payments: {}", line);<NEW_LINE>//<NEW_LINE>// Get the transferred amount.<NEW_LINE>// If the amount is zero, we have nothing to do.<NEW_LINE>final BigDecimal trxAmt = line.getTrxAmt();<NEW_LINE>if (trxAmt.signum() == 0) {<NEW_LINE>return ImmutableList.of();<NEW_LINE>}<NEW_LINE>// NOTE: atm we support only the case when StmtAmt=TrxAmt because we also have to calculate the currency gain and loss (i.e. BankAsset minus BankInTransit),<NEW_LINE>// and the factLine_BankAsset is booking the StmtAmt.<NEW_LINE>Check.assume(trxAmt.compareTo(line.getStmtAmt()) == 0, "StmtAmt equals = TrxAmt for line {}", line);<NEW_LINE>// Bank Account Org<NEW_LINE>final OrgId bankOrgId = getBankOrgId();<NEW_LINE>final Fact fact = new Fact(this, as, PostingType.Actual);<NEW_LINE>//<NEW_LINE>// Bank Asset: DR/CR<NEW_LINE>final FactLineBuilder factLine_BankAsset_Builder = prepareBankAssetFactLine(fact, line);<NEW_LINE>//<NEW_LINE>// Bank In Transit: CR/DR<NEW_LINE>final FactLineBuilder factLine_BankTransfer_Builder = // bank org, line org<NEW_LINE>fact.createLine().setDocLine(line).setAccount(getAccount(AccountType.BankInTransit, as)).setCurrencyId(line.getCurrencyId()).setCurrencyConversionCtx(line.getCurrencyConversionCtx()).// bank org, line org<NEW_LINE>orgId(bankOrgId.isRegular() ? bankOrgId : line.getOrgId()).bpartnerIdIfNotNull(line.getBPartnerId());<NEW_LINE>final FactLine factLine_BankAsset;<NEW_LINE>final FactLine factLine_BankTransfer;<NEW_LINE>final BigDecimal amtAcct_BankAsset;<NEW_LINE>final BigDecimal amtAcct_BankTransfer;<NEW_LINE>//<NEW_LINE>// Bank transfer: income<NEW_LINE>// Bank Asset: DR<NEW_LINE>// Bank In transit: CR<NEW_LINE>if (line.isInboundTrx()) {<NEW_LINE><MASK><NEW_LINE>factLine_BankTransfer_Builder.setAmtSource(null, trxAmt);<NEW_LINE>factLine_BankAsset = factLine_BankAsset_Builder.buildAndAdd();<NEW_LINE>factLine_BankTransfer = factLine_BankTransfer_Builder.buildAndAdd();<NEW_LINE>amtAcct_BankAsset = factLine_BankAsset.getAmtAcctDr();<NEW_LINE>amtAcct_BankTransfer = factLine_BankTransfer.getAmtAcctCr();<NEW_LINE>} else //<NEW_LINE>// Bank transfer: outgoing<NEW_LINE>// Bank Asset: CR<NEW_LINE>// Bank In transit: DR<NEW_LINE>{<NEW_LINE>factLine_BankAsset_Builder.setAmtSource(null, trxAmt.negate());<NEW_LINE>factLine_BankTransfer_Builder.setAmtSource(trxAmt.negate(), null);<NEW_LINE>factLine_BankAsset = factLine_BankAsset_Builder.buildAndAdd();<NEW_LINE>factLine_BankTransfer = factLine_BankTransfer_Builder.buildAndAdd();<NEW_LINE>amtAcct_BankAsset = factLine_BankAsset.getAmtAcctCr();<NEW_LINE>amtAcct_BankTransfer = factLine_BankTransfer.getAmtAcctDr();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Currency Gain/Loss bookings<NEW_LINE>final BigDecimal amtAcct_BankAssetMinusTransferred = amtAcct_BankAsset.subtract(amtAcct_BankTransfer);<NEW_LINE>createFacts_BankTransfer_RealizedGainOrLoss(fact, line, amtAcct_BankAssetMinusTransferred);<NEW_LINE>return ImmutableList.of(fact);<NEW_LINE>}
factLine_BankAsset_Builder.setAmtSource(trxAmt, null);
500,900
private <T> void saveValidConfigToCacheAndNotifyEntityConfigChangeListeners(EntityConfigSaveResult<T> saveResult) {<NEW_LINE>saveValidConfigToCache(saveResult.getConfigHolder());<NEW_LINE>LOGGER.info("About to notify {} config listeners", saveResult.getEntityConfig().getClass().getName());<NEW_LINE>for (ConfigChangedListener listener : listeners) {<NEW_LINE>if (listener instanceof EntityConfigChangedListener<?> && ((EntityConfigChangedListener) listener).shouldCareAbout(saveResult.getEntityConfig())) {<NEW_LINE>try {<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>EntityConfigChangedListener<T> entityConfigChangedListener = (EntityConfigChangedListener<T>) listener;<NEW_LINE>entityConfigChangedListener.onEntityConfigChange(saveResult.getEntityConfig());<NEW_LINE>LOGGER.debug("Notifying {} took (in ms): {}", listener.getClass(), (System<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("failed to fire config changed event for listener: {}", listener, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.info("Finished notifying {} config listeners", saveResult.getEntityConfig().getClass().getName());<NEW_LINE>}
.currentTimeMillis() - startTime));
415,371
final BatchDisassociateUserStackResult executeBatchDisassociateUserStack(BatchDisassociateUserStackRequest batchDisassociateUserStackRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(batchDisassociateUserStackRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<BatchDisassociateUserStackRequest> request = null;<NEW_LINE>Response<BatchDisassociateUserStackResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new BatchDisassociateUserStackRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "AppStream");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchDisassociateUserStack");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<BatchDisassociateUserStackResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new BatchDisassociateUserStackResultJsonUnmarshaller());<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(batchDisassociateUserStackRequest));
131,049
protected int compare(Object obj1, Object obj2, @Cached("create(getContext())") ToTemporalDateTimeNode toTemporalDateTime) {<NEW_LINE>JSTemporalPlainDateTimeObject one = (JSTemporalPlainDateTimeObject) toTemporalDateTime.executeDynamicObject(obj1, Undefined.instance);<NEW_LINE>JSTemporalPlainDateTimeObject two = (JSTemporalPlainDateTimeObject) toTemporalDateTime.executeDynamicObject(obj2, Undefined.instance);<NEW_LINE>return TemporalUtil.compareISODateTime(one.getYear(), one.getMonth(), one.getDay(), one.getHour(), one.getMinute(), one.getSecond(), one.getMillisecond(), one.getMicrosecond(), one.getNanosecond(), two.getYear(), two.getMonth(), two.getDay(), two.getHour(), two.getMinute(), two.getSecond(), two.getMillisecond(), two.getMicrosecond(<MASK><NEW_LINE>}
), two.getNanosecond());
1,772,434
XContentBuilder toXContentFragment(final XContentBuilder builder) throws IOException {<NEW_LINE>if (maxReadRequestOperationCount != null) {<NEW_LINE>builder.field(MAX_READ_REQUEST_OPERATION_COUNT.getPreferredName(), maxReadRequestOperationCount);<NEW_LINE>}<NEW_LINE>if (maxWriteRequestOperationCount != null) {<NEW_LINE>builder.field(<MASK><NEW_LINE>}<NEW_LINE>if (maxOutstandingReadRequests != null) {<NEW_LINE>builder.field(MAX_OUTSTANDING_READ_REQUESTS.getPreferredName(), maxOutstandingReadRequests);<NEW_LINE>}<NEW_LINE>if (maxOutstandingWriteRequests != null) {<NEW_LINE>builder.field(MAX_OUTSTANDING_WRITE_REQUESTS.getPreferredName(), maxOutstandingWriteRequests);<NEW_LINE>}<NEW_LINE>if (maxReadRequestSize != null) {<NEW_LINE>builder.field(MAX_READ_REQUEST_SIZE.getPreferredName(), maxReadRequestSize.getStringRep());<NEW_LINE>}<NEW_LINE>if (maxWriteRequestSize != null) {<NEW_LINE>builder.field(MAX_WRITE_REQUEST_SIZE.getPreferredName(), maxWriteRequestSize.getStringRep());<NEW_LINE>}<NEW_LINE>if (maxWriteBufferCount != null) {<NEW_LINE>builder.field(MAX_WRITE_BUFFER_COUNT.getPreferredName(), maxWriteBufferCount);<NEW_LINE>}<NEW_LINE>if (maxWriteBufferSize != null) {<NEW_LINE>builder.field(MAX_WRITE_BUFFER_SIZE.getPreferredName(), maxWriteBufferSize.getStringRep());<NEW_LINE>}<NEW_LINE>if (maxRetryDelay != null) {<NEW_LINE>builder.field(MAX_RETRY_DELAY.getPreferredName(), maxRetryDelay.getStringRep());<NEW_LINE>}<NEW_LINE>if (readPollTimeout != null) {<NEW_LINE>builder.field(READ_POLL_TIMEOUT.getPreferredName(), readPollTimeout.getStringRep());<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}
MAX_WRITE_REQUEST_OPERATION_COUNT.getPreferredName(), maxWriteRequestOperationCount);
385,062
public void menuShown(MenuEvent e) {<NEW_LINE>Utils.disposeSWTObjects(menuTree.getItems());<NEW_LINE>bShown = true;<NEW_LINE>Object oMenuSource = menuTree.getData("MenuSource");<NEW_LINE>int menuSource = (oMenuSource instanceof Number) ? ((Number) oMenuSource).intValue() : SWT.MENU_MOUSE;<NEW_LINE>SideBarEntrySWT entry;<NEW_LINE>if (menuSource != SWT.MENU_KEYBOARD) {<NEW_LINE>Point ptMouse = tree.toControl(e.display.getCursorLocation());<NEW_LINE>int indent = END_INDENT ? tree.getClientArea().width - 1 : 0;<NEW_LINE>TreeItem treeItem = tree.getItem(new Point(indent, ptMouse.y));<NEW_LINE>if (treeItem != null) {<NEW_LINE>entry = (SideBarEntrySWT) treeItem.getData("MdiEntry");<NEW_LINE>} else {<NEW_LINE>entry = null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>entry = getCurrentEntry();<NEW_LINE>}<NEW_LINE>if (entry != null) {<NEW_LINE>fillMenu(menuTree, entry, "sidebar");<NEW_LINE>}<NEW_LINE>if (entry == null || entry.getParentID() == null) {<NEW_LINE>MenuBuildUtils.addSeparator(menuTree);<NEW_LINE>org.eclipse.swt.widgets.MenuItem mi = new org.eclipse.swt.widgets.MenuItem(menuTree, SWT.PUSH);<NEW_LINE>mi.setText<MASK><NEW_LINE>mi.addListener(SWT.Selection, (ev) -> {<NEW_LINE>UIFunctions uif = UIFunctionsManager.getUIFunctions();<NEW_LINE>if (uif != null) {<NEW_LINE>JSONObject args = new JSONObject();<NEW_LINE>args.put("select", ConfigSectionInterfaceDisplaySWT.REFID_SECTION_SIDEBAR);<NEW_LINE>String args_str = JSONUtils.encodeToJSON(args);<NEW_LINE>uif.getMDI().showEntryByID(MultipleDocumentInterface.SIDEBAR_SECTION_CONFIG, ConfigSectionInterfaceDisplaySWT.SECTION_ID + args_str);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (menuTree.getItemCount() == 0) {<NEW_LINE>Utils.execSWTThreadLater(0, new AERunnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void runSupport() {<NEW_LINE>menuTree.setVisible(false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
(MessageText.getString("menu.sidebar.options"));
1,823,318
static String buildSignature(ImmutableList<String> salts, ImmutableSortedMap<String, byte[]> properties) {<NEW_LINE>Hasher signature = SIGNATURE_HASH_FUNCTION.newHasher();<NEW_LINE>logger.atFinest().log(">>>>>>>> Building signature");<NEW_LINE>for (String salt : salts) {<NEW_LINE>logger.atFinest().log(" Salt: %s", salt);<NEW_LINE>signature.putString(salt, PROPERTY_VALUE_CHARSET);<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, byte[]> property : properties.entrySet()) {<NEW_LINE>if (SALT_IGNORED_FACT_VALUES.contains(property.getKey())) {<NEW_LINE>logger.atFinest().log(" %s [SKIPPED]", property.getKey());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String propertyValue = new String(property.getValue(), PROPERTY_VALUE_CHARSET);<NEW_LINE>logger.atFinest().log(" %s: %s", property.getKey(), propertyValue);<NEW_LINE>signature.putString(property.getKey(), PROPERTY_VALUE_CHARSET).<MASK><NEW_LINE>}<NEW_LINE>String ret = signature.hash().toString();<NEW_LINE>logger.atFinest().log("<<<<<<<< Built signature: %s", ret);<NEW_LINE>return ret;<NEW_LINE>}
putBytes(property.getValue());
1,834,376
public static void main1(String[] args) throws Exception {<NEW_LINE>if (args.length < 2) {<NEW_LINE>System.out.println("Syntax: paste <to movie> <from movie> [second]");<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>File toFile = new File(args[0]);<NEW_LINE>SeekableByteChannel to = null;<NEW_LINE>SeekableByteChannel from = null;<NEW_LINE>SeekableByteChannel out = null;<NEW_LINE>try {<NEW_LINE>File outFile = new File(toFile.getParentFile(), toFile.getName().replaceAll("\\.mov$", "") + ".paste.mov");<NEW_LINE>Platform.deleteFile(outFile);<NEW_LINE>out = writableChannel(outFile);<NEW_LINE>to = writableChannel(toFile);<NEW_LINE>File fromFile = new File(args[1]);<NEW_LINE>from = readableChannel(fromFile);<NEW_LINE>Movie toMov = MP4Util.createRefFullMovie(to, "file://" + toFile.getCanonicalPath());<NEW_LINE>Movie fromMov = MP4Util.createRefFullMovie(from, "file://" + fromFile.getCanonicalPath());<NEW_LINE>new Strip().stripToChunks(fromMov.getMoov());<NEW_LINE>if (args.length > 2) {<NEW_LINE>new Paste().paste(toMov.getMoov(), fromMov.getMoov(), Double.<MASK><NEW_LINE>} else {<NEW_LINE>new Paste().addToMovie(toMov.getMoov(), fromMov.getMoov());<NEW_LINE>}<NEW_LINE>MP4Util.writeFullMovie(out, toMov);<NEW_LINE>} finally {<NEW_LINE>if (to != null)<NEW_LINE>to.close();<NEW_LINE>if (from != null)<NEW_LINE>from.close();<NEW_LINE>if (out != null)<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>}
parseDouble(args[2]));
36,365
protected void handleMetadata() throws Docx4JException {<NEW_LINE>// docProps/app.xml (Extended Properties)<NEW_LINE>if (pkg.getDocPropsExtendedPart() != null && pkg.getDocPropsExtendedPart().getContents() != null) {<NEW_LINE>pkg.getDocPropsExtendedPart().<MASK><NEW_LINE>pkg.getDocPropsExtendedPart().getContents().setManager(null);<NEW_LINE>pkg.getDocPropsExtendedPart().getContents().setHeadingPairs(null);<NEW_LINE>}<NEW_LINE>if (pkg.getDocPropsCorePart() != null && pkg.getDocPropsCorePart().getContents() != null) {<NEW_LINE>pkg.getDocPropsCorePart().getContents().setCategory(null);<NEW_LINE>pkg.getDocPropsCorePart().getContents().setCreator(null);<NEW_LINE>pkg.getDocPropsCorePart().getContents().setDescription(null);<NEW_LINE>pkg.getDocPropsCorePart().getContents().setIdentifier(null);<NEW_LINE>pkg.getDocPropsCorePart().getContents().setKeywords(null);<NEW_LINE>pkg.getDocPropsCorePart().getContents().setSubject(null);<NEW_LINE>pkg.getDocPropsCorePart().getContents().setTitle(null);<NEW_LINE>}<NEW_LINE>if (pkg.getDocPropsCustomPart() != null) {<NEW_LINE>// Remove this<NEW_LINE>pkg.getRelationshipsPart().removePart(pkg.getDocPropsCustomPart().getPartName());<NEW_LINE>}<NEW_LINE>// /docProps/thumbnail.emf, always delete this!<NEW_LINE>pkg.getRelationshipsPart().removePart(new PartName("/docProps/thumbnail.emf"));<NEW_LINE>}
getContents().setCompany(null);
269,831
protected DataPacket createAddEntityPacket() {<NEW_LINE>AddEntityPacket pk = new AddEntityPacket();<NEW_LINE>pk<MASK><NEW_LINE>pk.entityUniqueId = this.getId();<NEW_LINE>pk.type = NETWORK_ID;<NEW_LINE>pk.x = (float) this.x;<NEW_LINE>pk.y = (float) this.y;<NEW_LINE>pk.z = (float) this.z;<NEW_LINE>pk.speedX = (float) this.motionX;<NEW_LINE>pk.speedY = (float) this.motionY;<NEW_LINE>pk.speedZ = (float) this.motionZ;<NEW_LINE>pk.yaw = (float) this.yaw;<NEW_LINE>pk.pitch = (float) this.pitch;<NEW_LINE>long ownerId = -1;<NEW_LINE>if (this.shootingEntity != null) {<NEW_LINE>ownerId = this.shootingEntity.getId();<NEW_LINE>}<NEW_LINE>pk.metadata = this.dataProperties.putLong(DATA_OWNER_EID, ownerId);<NEW_LINE>return pk;<NEW_LINE>}
.entityRuntimeId = this.getId();
1,618,842
protected synchronized void trim() {<NEW_LINE>if (this.chunkcache.length == 0)<NEW_LINE>return;<NEW_LINE>final long needed = this.chunkcount * this.rowdef.objectsize;<NEW_LINE><MASK><NEW_LINE>if (needed >= this.chunkcache.length)<NEW_LINE>// in case that the growfactor causes that the cache would<NEW_LINE>return;<NEW_LINE>// grow instead of shrink, simply ignore the growfactor<NEW_LINE>if (MemoryControl.available() + 1000 < needed)<NEW_LINE>// if the swap buffer is not available, we must give up.<NEW_LINE>return;<NEW_LINE>// This is not critical. Otherwise we provoke a serious<NEW_LINE>// problem with OOM<NEW_LINE>try {<NEW_LINE>final byte[] newChunkcache = new byte[(int) needed];<NEW_LINE>System.arraycopy(this.chunkcache, 0, newChunkcache, 0, newChunkcache.length);<NEW_LINE>this.chunkcache = newChunkcache;<NEW_LINE>} catch (final OutOfMemoryError e) {<NEW_LINE>// lets try again after a forced gc()<NEW_LINE>System.gc();<NEW_LINE>try {<NEW_LINE>final byte[] newChunkcache = new byte[(int) needed];<NEW_LINE>System.arraycopy(this.chunkcache, 0, newChunkcache, 0, newChunkcache.length);<NEW_LINE>this.chunkcache = newChunkcache;<NEW_LINE>} catch (final OutOfMemoryError ee) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
assert needed <= this.chunkcache.length;
1,757,494
final StopRxNormInferenceJobResult executeStopRxNormInferenceJob(StopRxNormInferenceJobRequest stopRxNormInferenceJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopRxNormInferenceJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopRxNormInferenceJobRequest> request = null;<NEW_LINE>Response<StopRxNormInferenceJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StopRxNormInferenceJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopRxNormInferenceJobRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ComprehendMedical");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopRxNormInferenceJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StopRxNormInferenceJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopRxNormInferenceJobResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
1,479,835
public ReservedInstancesConfiguration unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>ReservedInstancesConfiguration reservedInstancesConfiguration = new ReservedInstancesConfiguration();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>int xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>return reservedInstancesConfiguration;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("availabilityZone", targetDepth)) {<NEW_LINE>reservedInstancesConfiguration.setAvailabilityZone(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("platform", targetDepth)) {<NEW_LINE>reservedInstancesConfiguration.setPlatform(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("instanceCount", targetDepth)) {<NEW_LINE>reservedInstancesConfiguration.setInstanceCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("instanceType", targetDepth)) {<NEW_LINE>reservedInstancesConfiguration.setInstanceType(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return reservedInstancesConfiguration;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,718,005
public DeleteVMSnapshotAnswer execute(VmwareHostService hostService, DeleteVMSnapshotCommand cmd) {<NEW_LINE>List<VolumeObjectTO> listVolumeTo = cmd.getVolumeTOs();<NEW_LINE>VirtualMachineMO vmMo = null;<NEW_LINE>VmwareContext context = hostService.getServiceContext(cmd);<NEW_LINE>String vmName = cmd.getVmName();<NEW_LINE>String vmSnapshotName = cmd.getTarget().getSnapshotName();<NEW_LINE>try {<NEW_LINE>VmwareHypervisorHost hyperHost = hostService.getHyperHost(context, cmd);<NEW_LINE><MASK><NEW_LINE>if (vmMo == null) {<NEW_LINE>vmMo = hyperHost.findVmOnPeerHyperHost(vmName);<NEW_LINE>}<NEW_LINE>if (vmMo == null) {<NEW_LINE>String msg = "Unable to find VM for RevertToVMSnapshotCommand";<NEW_LINE>s_logger.debug(msg);<NEW_LINE>return new DeleteVMSnapshotAnswer(cmd, false, msg);<NEW_LINE>} else {<NEW_LINE>if (vmMo.getSnapshotMor(vmSnapshotName) == null) {<NEW_LINE>s_logger.debug("can not find the snapshot " + vmSnapshotName + ", assume it is already removed");<NEW_LINE>} else {<NEW_LINE>if (!vmMo.removeSnapshot(vmSnapshotName, false)) {<NEW_LINE>String msg = "delete vm snapshot " + vmSnapshotName + " due to error occurred in vmware";<NEW_LINE>s_logger.error(msg);<NEW_LINE>return new DeleteVMSnapshotAnswer(cmd, false, msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>s_logger.debug("snapshot: " + vmSnapshotName + " is removed");<NEW_LINE>// after removed snapshot, the volumes' paths have been changed for the VM, needs to report new paths to manager<NEW_LINE>Map<String, String> mapNewDisk = getNewDiskMap(vmMo);<NEW_LINE>setVolumeToPathAndSize(listVolumeTo, mapNewDisk, context, hyperHost, cmd.getVmName());<NEW_LINE>return new DeleteVMSnapshotAnswer(cmd, listVolumeTo);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>String msg = e.getMessage();<NEW_LINE>s_logger.error("failed to delete vm snapshot " + vmSnapshotName + " of vm " + vmName + " due to " + msg);<NEW_LINE>return new DeleteVMSnapshotAnswer(cmd, false, msg);<NEW_LINE>}<NEW_LINE>}
vmMo = hyperHost.findVmOnHyperHost(vmName);
386,778
// auto-generated, see spoon.generating.ReplacementVisitorGenerator<NEW_LINE>@java.lang.Override<NEW_LINE>public void visitCtFor(final spoon.reflect.code.CtFor forLoop) {<NEW_LINE>replaceInListIfExist(forLoop.getAnnotations(), new spoon.support.visitor.replace<MASK><NEW_LINE>replaceInListIfExist(forLoop.getForInit(), new spoon.support.visitor.replace.ReplacementVisitor.CtForForInitReplaceListener(forLoop));<NEW_LINE>replaceElementIfExist(forLoop.getExpression(), new spoon.support.visitor.replace.ReplacementVisitor.CtForExpressionReplaceListener(forLoop));<NEW_LINE>replaceInListIfExist(forLoop.getForUpdate(), new spoon.support.visitor.replace.ReplacementVisitor.CtForForUpdateReplaceListener(forLoop));<NEW_LINE>replaceElementIfExist(forLoop.getBody(), new spoon.support.visitor.replace.ReplacementVisitor.CtLoopBodyReplaceListener(forLoop));<NEW_LINE>replaceInListIfExist(forLoop.getComments(), new spoon.support.visitor.replace.ReplacementVisitor.CtElementCommentsReplaceListener(forLoop));<NEW_LINE>}
.ReplacementVisitor.CtElementAnnotationsReplaceListener(forLoop));
905,036
protected JPanel filletMaterialPanel() {<NEW_LINE>JPanel filletPanel = new JPanel(new MigLayout("", "[][65lp::][30lp::]"));<NEW_LINE>String tip = trans.get("FinsetCfg.ttip.Finfillets1") + trans.get("FinsetCfg.ttip.Finfillets2") + trans.get("FinsetCfg.ttip.Finfillets3");<NEW_LINE>filletPanel.setBorder(BorderFactory.createTitledBorder("Root Fillets"));<NEW_LINE>filletPanel.add(new JLabel(trans.get("FinSetCfg.lbl.Filletradius")));<NEW_LINE>DoubleModel m = new DoubleModel(component, "FilletRadius", UnitGroup.UNITS_LENGTH, 0);<NEW_LINE>JSpinner spin = new <MASK><NEW_LINE>spin.setEditor(new SpinnerEditor(spin));<NEW_LINE>spin.setToolTipText(tip);<NEW_LINE>filletPanel.add(spin, "growx, w 40");<NEW_LINE>UnitSelector us = new UnitSelector(m);<NEW_LINE>filletPanel.add(us, "growx");<NEW_LINE>us.setToolTipText(tip);<NEW_LINE>BasicSlider bs = new BasicSlider(m.getSliderModel(0, 10));<NEW_LINE>filletPanel.add(bs, "w 100lp, wrap para");<NEW_LINE>bs.setToolTipText(tip);<NEW_LINE>JLabel label = new JLabel(trans.get("FinSetCfg.lbl.Finfilletmaterial"));<NEW_LINE>label.setToolTipText(tip);<NEW_LINE>// // The component material affects the weight of the component.<NEW_LINE>label.setToolTipText(trans.get("RocketCompCfg.lbl.ttip.componentmaterialaffects"));<NEW_LINE>filletPanel.add(label, "spanx 4, wrap rel");<NEW_LINE>JComboBox<Material> materialCombo = new JComboBox<Material>(new MaterialModel(filletPanel, component, Material.Type.BULK, "FilletMaterial"));<NEW_LINE>// // The component material affects the weight of the component.<NEW_LINE>materialCombo.setToolTipText(trans.get("RocketCompCfg.combo.ttip.componentmaterialaffects"));<NEW_LINE>filletPanel.add(materialCombo, "spanx 4, growx, wrap paragraph");<NEW_LINE>filletPanel.setToolTipText(tip);<NEW_LINE>return filletPanel;<NEW_LINE>}
JSpinner(m.getSpinnerModel());
962,899
protected String transformResponse(String transformation, String response) {<NEW_LINE>String transformedResponse;<NEW_LINE>if (isEmpty(transformation) || transformation.equalsIgnoreCase("default")) {<NEW_LINE>logger.debug("transformed response is '{}'", response);<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>Matcher <MASK><NEW_LINE>if (matcher.matches()) {<NEW_LINE>matcher.reset();<NEW_LINE>matcher.find();<NEW_LINE>String transformationServiceName = matcher.group(1);<NEW_LINE>String transformationServiceParam = matcher.group(2);<NEW_LINE>try {<NEW_LINE>TransformationService transformationService = TransformationHelper.getTransformationService(TCPActivator.getContext(), transformationServiceName);<NEW_LINE>if (transformationService != null) {<NEW_LINE>transformedResponse = transformationService.transform(transformationServiceParam, response);<NEW_LINE>} else {<NEW_LINE>transformedResponse = response;<NEW_LINE>logger.warn("couldn't transform response because transformationService of type '{}' is unavailable", transformationServiceName);<NEW_LINE>}<NEW_LINE>} catch (Exception te) {<NEW_LINE>logger.warn("Transformation threw an exception. [transformation={}, response={}]", transformation, response, te);<NEW_LINE>// in case of an error we return the response without any<NEW_LINE>// transformation<NEW_LINE>transformedResponse = response;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>transformedResponse = transformation;<NEW_LINE>}<NEW_LINE>logger.debug("transformed response is '{}'", transformedResponse);<NEW_LINE>return transformedResponse;<NEW_LINE>}
matcher = EXTRACT_FUNCTION_PATTERN.matcher(transformation);
1,160,088
private void countVoteAccount(VoteWitnessContract voteContract) {<NEW_LINE>AccountStore accountStore = chainBaseManager.getAccountStore();<NEW_LINE>VotesStore votesStore = chainBaseManager.getVotesStore();<NEW_LINE>MortgageService mortgageService = chainBaseManager.getMortgageService();<NEW_LINE>byte[] ownerAddress = voteContract.getOwnerAddress().toByteArray();<NEW_LINE>VotesCapsule votesCapsule;<NEW_LINE>//<NEW_LINE>mortgageService.withdrawReward(ownerAddress);<NEW_LINE>AccountCapsule <MASK><NEW_LINE>DynamicPropertiesStore dynamicStore = chainBaseManager.getDynamicPropertiesStore();<NEW_LINE>if (dynamicStore.supportAllowNewResourceModel() && accountCapsule.oldTronPowerIsNotInitialized()) {<NEW_LINE>accountCapsule.initializeOldTronPower();<NEW_LINE>}<NEW_LINE>if (!votesStore.has(ownerAddress)) {<NEW_LINE>votesCapsule = new VotesCapsule(voteContract.getOwnerAddress(), accountCapsule.getVotesList());<NEW_LINE>} else {<NEW_LINE>votesCapsule = votesStore.get(ownerAddress);<NEW_LINE>}<NEW_LINE>accountCapsule.clearVotes();<NEW_LINE>votesCapsule.clearNewVotes();<NEW_LINE>voteContract.getVotesList().forEach(vote -> {<NEW_LINE>logger.debug("countVoteAccount, address[{}]", ByteArray.toHexString(vote.getVoteAddress().toByteArray()));<NEW_LINE>votesCapsule.addNewVotes(vote.getVoteAddress(), vote.getVoteCount());<NEW_LINE>accountCapsule.addVotes(vote.getVoteAddress(), vote.getVoteCount());<NEW_LINE>});<NEW_LINE>accountStore.put(accountCapsule.createDbKey(), accountCapsule);<NEW_LINE>votesStore.put(ownerAddress, votesCapsule);<NEW_LINE>}
accountCapsule = accountStore.get(ownerAddress);
336,367
public ByteBuf encodeRequest(Request request) throws Exception {<NEW_LINE>DubboHeader header = new DubboHeader();<NEW_LINE>byte flag = (byte) (FLAG_REQUEST | getContentTypeId());<NEW_LINE>if (!request.isOneWay()) {<NEW_LINE>flag |= FLAG_TWOWAY;<NEW_LINE>}<NEW_LINE>if (request.isHeartbeat()) {<NEW_LINE>flag |= FLAG_EVENT;<NEW_LINE>}<NEW_LINE>header.setFlag(flag);<NEW_LINE>header.setCorrelationId(request.getCorrelationId());<NEW_LINE>byte[] bodyBytes = null;<NEW_LINE>if (request.isHeartbeat()) {<NEW_LINE>bodyBytes = DubboPacket.encodeHeartbeatBody();<NEW_LINE>} else {<NEW_LINE>DubboRequestBody requestBody = new DubboRequestBody();<NEW_LINE>requestBody.setPath(request.getServiceName());<NEW_LINE>requestBody.setVersion(request.getSubscribeInfo().getVersion());<NEW_LINE>requestBody.setMethodName(request.getMethodName());<NEW_LINE>requestBody.setParameterTypes(request.getTargetMethod().getParameterTypes());<NEW_LINE>requestBody.setArguments(request.getArgs());<NEW_LINE>Map<String, String> kvAttachments = new HashMap<String, String>();<NEW_LINE>kvAttachments.put("group", request.<MASK><NEW_LINE>if (request.getKvAttachment() != null) {<NEW_LINE>for (Map.Entry<String, Object> entry : request.getKvAttachment().entrySet()) {<NEW_LINE>kvAttachments.put(entry.getKey(), (String) entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>requestBody.setAttachments(kvAttachments);<NEW_LINE>bodyBytes = requestBody.encodeRequestBody();<NEW_LINE>}<NEW_LINE>header.setBodyLength(bodyBytes.length);<NEW_LINE>return Unpooled.wrappedBuffer(header.encode(), Unpooled.wrappedBuffer(bodyBytes));<NEW_LINE>}
getSubscribeInfo().getGroup());
1,488,114
private static <B extends Enum<B>> B toBukkit(Enum<?> nms, Class<B> bukkit) {<NEW_LINE>Enum<?> converted;<NEW_LINE>BiMap<Enum<?>, Enum<?>> nmsToBukkit = classMappings.get(nms.getClass());<NEW_LINE>if (nmsToBukkit != null) {<NEW_LINE>converted = nmsToBukkit.get(nms);<NEW_LINE>if (converted != null)<NEW_LINE>return (B) converted;<NEW_LINE>}<NEW_LINE>converted = (nms instanceof Direction) ? BlockImplUtil.notchToBlockFace((Direction) nms) : bukkit.getEnumConstants()[nms.ordinal()];<NEW_LINE>Preconditions.checkState(converted != null, "Could not convert enum %s->%s", nms, bukkit);<NEW_LINE>if (nmsToBukkit == null) {<NEW_LINE>nmsToBukkit = HashBiMap.create();<NEW_LINE>classMappings.put(nms.getClass(), nmsToBukkit);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return (B) converted;<NEW_LINE>}
nmsToBukkit.put(nms, converted);
1,051,007
DocIdSet processLeaf(Query query, CompositeValuesCollectorQueue queue, LeafReaderContext context, boolean fillDocIdSet) throws IOException {<NEW_LINE>final Terms terms = context.reader().terms(field);<NEW_LINE>if (terms == null) {<NEW_LINE>// no value for the field<NEW_LINE>return DocIdSet.EMPTY;<NEW_LINE>}<NEW_LINE>BytesRef lowerValue = (BytesRef) queue.getLowerValueLeadSource();<NEW_LINE>BytesRef upperValue = <MASK><NEW_LINE>final TermsEnum te = terms.iterator();<NEW_LINE>if (lowerValue != null) {<NEW_LINE>if (te.seekCeil(lowerValue) == TermsEnum.SeekStatus.END) {<NEW_LINE>return DocIdSet.EMPTY;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (te.next() == null) {<NEW_LINE>return DocIdSet.EMPTY;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DocIdSetBuilder builder = fillDocIdSet ? new DocIdSetBuilder(context.reader().maxDoc(), terms) : null;<NEW_LINE>PostingsEnum reuse = null;<NEW_LINE>boolean first = true;<NEW_LINE>final BytesRef upper = upperValue == null ? null : BytesRef.deepCopyOf(upperValue);<NEW_LINE>do {<NEW_LINE>if (upper != null && upper.compareTo(te.term()) < 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>reuse = te.postings(reuse, PostingsEnum.NONE);<NEW_LINE>if (processBucket(queue, context, reuse, te.term(), builder) && !first) {<NEW_LINE>// this bucket does not have any competitive composite buckets,<NEW_LINE>// we can early terminate the collection because the remaining buckets are guaranteed<NEW_LINE>// to be greater than this bucket.<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>first = false;<NEW_LINE>} while (te.next() != null);<NEW_LINE>return fillDocIdSet ? builder.build() : DocIdSet.EMPTY;<NEW_LINE>}
(BytesRef) queue.getUpperValueLeadSource();
727,882
public Cursor handle(RelNode relNode, ExecutionContext executionContext) {<NEW_LINE>if (relNode instanceof PhyDdlTableOperation) {<NEW_LINE>final PhyDdlTableOperation tableOperation = (PhyDdlTableOperation) relNode;<NEW_LINE>final SequenceBean sequence = tableOperation.getSequence();<NEW_LINE>sequence.setKind(tableOperation.getKind());<NEW_LINE>String ret = ((PhyDdlTableOperation) relNode).getSchemaName();<NEW_LINE>String schemaName = StringUtils.isEmpty(sequence.getSchemaName()) ? ret : sequence.getSchemaName();<NEW_LINE><MASK><NEW_LINE>Cursor cursor = handleGMS(sequence, executionContext);<NEW_LINE>LoggerInit.TDDL_SEQUENCE_LOG.info("Sequence operation was successful, the operation is " + tableOperation.getKind().name());<NEW_LINE>SyncManagerHelper.sync(new SequenceSyncAction(schemaName, sequence.getSequenceName()), schemaName, SyncScope.CURRENT_ONLY);<NEW_LINE>clearPlanCache(schemaName, sequence.getSequenceName(), tableOperation);<NEW_LINE>return cursor;<NEW_LINE>} else {<NEW_LINE>throw new SequenceException("Unexpected Sequence DDL operation");<NEW_LINE>}<NEW_LINE>}
SequenceValidator.validate(sequence, executionContext);
256,007
public SqlResult execute(@Nonnull SqlStatement statement) {<NEW_LINE>ClientConnection connection = getQueryConnection();<NEW_LINE>QueryId id = QueryId.create(connection.getRemoteUuid());<NEW_LINE>List<Object> params = statement.getParameters();<NEW_LINE>List<Data> params0 = new ArrayList<>(params.size());<NEW_LINE>for (Object param : params) {<NEW_LINE>params0.add(serializeParameter(param));<NEW_LINE>}<NEW_LINE>ClientMessage requestMessage = SqlExecuteCodec.encodeRequest(statement.getSql(), params0, statement.getTimeoutMillis(), statement.getCursorBufferSize(), statement.getSchema(), statement.getExpectedResultType().getId(), id, skipUpdateStatistics);<NEW_LINE>SqlClientResult res = new SqlClientResult(this, connection, id, statement.getCursorBufferSize());<NEW_LINE>try {<NEW_LINE>ClientMessage <MASK><NEW_LINE>handleExecuteResponse(res, message);<NEW_LINE>return res;<NEW_LINE>} catch (Exception e) {<NEW_LINE>RuntimeException error = rethrow(e, connection);<NEW_LINE>res.onExecuteError(error);<NEW_LINE>throw error;<NEW_LINE>}<NEW_LINE>}
message = invoke(requestMessage, connection);
173,065
public static String urlToJSONString(String urlToRead) {<NEW_LINE>// Alright, so sometimes Twitch decides that our client ID should be blocked. Currently only happens for the hidden /api endpoints.<NEW_LINE>// IF we are being blocked, then retry the request with Twitch web ClientID. They are typically not blocking this.<NEW_LINE>// "{\"error\":\"Gone\",\"status\":410,\"message\":\"this API has been removed.\"}";<NEW_LINE>String result = urlToJSONString(urlToRead, true);<NEW_LINE>boolean retryWithWebClientId = false;<NEW_LINE>if (result == null || result.isEmpty()) {<NEW_LINE>retryWithWebClientId = true;<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>JSONObject resultJson = new JSONObject(result);<NEW_LINE>int status = resultJson.getInt("status");<NEW_LINE>String error = resultJson.getString("error");<NEW_LINE>retryWithWebClientId = status == 410 || error.equals("Gone");<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (retryWithWebClientId) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return result == null ? "" : result;<NEW_LINE>}
result = urlToJSONString(urlToRead, false);
1,534,641
public PNode visit(ImportFromSSTNode node) {<NEW_LINE>scopeEnvironment.setCurrentScope(node.scope);<NEW_LINE>String from = node.from;<NEW_LINE>int level = 0;<NEW_LINE>while (from.length() > level && from.charAt(level) == '.') {<NEW_LINE>level++;<NEW_LINE>}<NEW_LINE>if (level > 0) {<NEW_LINE>from = from.substring(level);<NEW_LINE>}<NEW_LINE>PNode result;<NEW_LINE>if (node.asNames == null) {<NEW_LINE>// star import<NEW_LINE>result = new ImportStarNode(from, level);<NEW_LINE>} else {<NEW_LINE>String[] fromList = new String[node.asNames.length];<NEW_LINE>WriteNode[] readNodes = new WriteNode[fromList.length];<NEW_LINE>for (int i = 0; i < fromList.length; i++) {<NEW_LINE>String[] asName = node.asNames[i];<NEW_LINE>fromList[i] = asName[0];<NEW_LINE>readNodes[i] = (WriteNode) scopeEnvironment.findVariable(asName[1] == null ? asName[0] : asName[1]).<MASK><NEW_LINE>}<NEW_LINE>result = ImportFromNode.create(from, fromList, readNodes, level);<NEW_LINE>}<NEW_LINE>result.assignSourceSection(createSourceSection(node.startOffset, node.endOffset));<NEW_LINE>return result;<NEW_LINE>}
makeWriteNode(EmptyNode.create());
761,898
final private IntervalFunction IntervalAtLeast() throws ParseException {<NEW_LINE>IntervalFunction source;<NEW_LINE>ArrayList<IntervalFunction> sources <MASK><NEW_LINE>Token minShouldMatch;<NEW_LINE>jj_consume_token(FN_PREFIX);<NEW_LINE>jj_consume_token(ATLEAST);<NEW_LINE>jj_consume_token(LPAREN);<NEW_LINE>minShouldMatch = jj_consume_token(NUMBER);<NEW_LINE>label_4: while (true) {<NEW_LINE>source = IntervalFun();<NEW_LINE>sources.add(source);<NEW_LINE>switch((jj_ntk == -1) ? jj_ntk_f() : jj_ntk) {<NEW_LINE>case FN_PREFIX:<NEW_LINE>case QUOTED:<NEW_LINE>case NUMBER:<NEW_LINE>case TERM:<NEW_LINE>{<NEW_LINE>;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>jj_la1[11] = jj_gen;<NEW_LINE>break label_4;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jj_consume_token(RPAREN);<NEW_LINE>{<NEW_LINE>if ("" != null)<NEW_LINE>return new AtLeast(parseInt(minShouldMatch), sources);<NEW_LINE>}<NEW_LINE>throw new Error("Missing return statement in function");<NEW_LINE>}
= new ArrayList<IntervalFunction>();
1,147,627
private DrownVulnerabilityType genLeakyExportCheckData(String dataFilePath) {<NEW_LINE>Config tlsConfig = getTlsConfig();<NEW_LINE>SSL2CipherSuite cipherSuite = tlsConfig.getDefaultSSL2CipherSuite();<NEW_LINE>// Produce correctly-padded SECRET-KEY-DATA of the wrong length (case 2<NEW_LINE>// from the DROWN paper)<NEW_LINE>int secretKeyLength = cipherSuite.getSecretKeyByteNumber() + 2;<NEW_LINE>byte[] secretKey = new byte[secretKeyLength];<NEW_LINE>for (int i = 0; i < secretKeyLength; i++) {<NEW_LINE>secretKey[i] = (byte) 0xFF;<NEW_LINE>}<NEW_LINE>ModifiableByteArray secretKeyData = Modifiable.explicit(secretKey);<NEW_LINE>SSL2ClientMasterKeyMessage clientMasterKeyMessage = new SSL2ClientMasterKeyMessage();<NEW_LINE>// Make sure computations are already in place for the next step<NEW_LINE>clientMasterKeyMessage.prepareComputations();<NEW_LINE>// The Premaster Secret is SECRET-KEY-DATA for SSLv2<NEW_LINE>clientMasterKeyMessage.getComputations().setPremasterSecret(secretKeyData);<NEW_LINE>WorkflowTrace trace = new WorkflowConfigurationFactory(tlsConfig).createWorkflowTrace(WorkflowTraceType.SSL2_HELLO, RunningModeType.CLIENT);<NEW_LINE>trace.addTlsAction(new SendAction(clientMasterKeyMessage));<NEW_LINE>trace.addTlsAction(new ReceiveAction(new SSL2ServerVerifyMessage()));<NEW_LINE>State state = new State(tlsConfig, trace);<NEW_LINE>WorkflowExecutor workflowExecutor = WorkflowExecutorFactory.createWorkflowExecutor(tlsConfig.getWorkflowExecutorType(), state);<NEW_LINE>workflowExecutor.executeWorkflow();<NEW_LINE>if (!WorkflowTraceUtil.didReceiveMessage(HandshakeMessageType.SSL2_SERVER_HELLO, trace)) {<NEW_LINE>return DrownVulnerabilityType.NONE;<NEW_LINE>}<NEW_LINE>SSL2ServerVerifyMessage serverVerifyMessage = (SSL2ServerVerifyMessage) WorkflowTraceUtil.<MASK><NEW_LINE>CONSOLE.info("Completed server connection");<NEW_LINE>LeakyExportCheckData checkData = new LeakyExportCheckData(state.getTlsContext(), clientMasterKeyMessage, serverVerifyMessage);<NEW_LINE>try {<NEW_LINE>FileOutputStream fileStream = new FileOutputStream(dataFilePath);<NEW_LINE>ObjectOutputStream objectStream = new ObjectOutputStream(fileStream);<NEW_LINE>objectStream.writeObject(checkData);<NEW_LINE>objectStream.close();<NEW_LINE>fileStream.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>CONSOLE.info("Wrote check data to " + dataFilePath + ", now call analysis");<NEW_LINE>return DrownVulnerabilityType.UNKNOWN;<NEW_LINE>}
getFirstReceivedMessage(HandshakeMessageType.SSL2_SERVER_VERIFY, trace);
458,246
private static void init() {<NEW_LINE>try {<NEW_LINE>// TODO is this initialize needed?<NEW_LINE>// PythonInterpreter.initialize(System.getProperties(), null, new String[0]);<NEW_LINE>Class.forName("org.python.util.PythonInterpreter");<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Debug.log("Jython: not found on classpath");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// TODO RunTime.get().exportLib()<NEW_LINE>// RunTime.get().exportLib();<NEW_LINE>try {<NEW_LINE>interpreter = new PythonInterpreter();<NEW_LINE>cPyException = Class.forName("org.python.core.PyException");<NEW_LINE><MASK><NEW_LINE>cPyMethod = Class.forName("org.python.core.PyMethod");<NEW_LINE>cPyInstance = Class.forName("org.python.core.PyInstance");<NEW_LINE>cPyString = Class.forName("org.python.core.PyString");<NEW_LINE>} catch (Exception ex) {<NEW_LINE>instance.log(-1, "reflection problem: %s", ex.getMessage());<NEW_LINE>interpreter = null;<NEW_LINE>}<NEW_LINE>Commons.setJythonReady();<NEW_LINE>// instance.log(lvl, "init: success");<NEW_LINE>}
cPyFunction = Class.forName("org.python.core.PyFunction");
135,654
protected void removeByC_EA(String companyId, String emailAddress) throws NoSuchUserException, SystemException {<NEW_LINE>Session session = null;<NEW_LINE>User systemUser = null;<NEW_LINE>try {<NEW_LINE>systemUser = APILocator.getUserAPI().getSystemUser();<NEW_LINE>} catch (DotDataException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>throw new SystemException("Cannot find System User");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>session = openSession();<NEW_LINE>StringBuffer query = new StringBuffer();<NEW_LINE>query.append("FROM User_ IN CLASS com.liferay.portal.ejb.UserHBM WHERE ");<NEW_LINE>query.append("companyId = ?");<NEW_LINE>query.append(" AND ");<NEW_LINE>query.append("emailAddress = ?");<NEW_LINE>query.append(" AND ");<NEW_LINE>query.append("userId <> ?");<NEW_LINE>query.append(" AND delete_in_progress = ");<NEW_LINE>query.append(DbConnectionFactory.getDBFalse());<NEW_LINE>query.append(" ORDER BY ");<NEW_LINE>query.append<MASK><NEW_LINE>query.append("middleName ASC").append(", ");<NEW_LINE>query.append("lastName ASC");<NEW_LINE>Query q = session.createQuery(query.toString());<NEW_LINE>int queryPos = 0;<NEW_LINE>q.setString(queryPos++, companyId);<NEW_LINE>q.setString(queryPos++, emailAddress);<NEW_LINE>q.setString(queryPos++, systemUser.getUserId());<NEW_LINE>Iterator itr = q.list().iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>UserHBM userHBM = (UserHBM) itr.next();<NEW_LINE>UserPool.remove((String) userHBM.getPrimaryKey());<NEW_LINE>session.delete(userHBM);<NEW_LINE>}<NEW_LINE>session.flush();<NEW_LINE>} catch (HibernateException he) {<NEW_LINE>if (he instanceof ObjectNotFoundException) {<NEW_LINE>throw new NoSuchUserException();<NEW_LINE>} else {<NEW_LINE>throw new SystemException(he);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
("firstName ASC").append(", ");
921,975
protected TaskResult run(GcsClient gcs, String projectId) {<NEW_LINE>Optional<String> command = params.<MASK><NEW_LINE>Optional<String> bucket = params.getOptional("bucket", String.class);<NEW_LINE>Optional<String> object = params.getOptional("object", String.class);<NEW_LINE>// ToDo implement timeout parameter. Please refer to s3_wait><NEW_LINE>if (command.isPresent() && (bucket.isPresent() || object.isPresent()) || !command.isPresent() && (!bucket.isPresent() || !object.isPresent())) {<NEW_LINE>throw new ConfigException("Either the gcs_wait operator command or both 'bucket' and 'object' parameters must be set");<NEW_LINE>}<NEW_LINE>if (command.isPresent()) {<NEW_LINE>Matcher m = URI_PATTERN.matcher(command.get());<NEW_LINE>if (!m.matches()) {<NEW_LINE>throw new ConfigException("Illegal GCS URI or path: " + command.get());<NEW_LINE>}<NEW_LINE>bucket = Optional.of(m.group("bucket"));<NEW_LINE>object = Optional.of(m.group("object"));<NEW_LINE>}<NEW_LINE>return await(gcs, bucket.get(), object.get());<NEW_LINE>}
getOptional("_command", String.class);
1,321,047
private void computeAngleOfRotation(PointTrack t, Vector3D_F64 pointingPlane) {<NEW_LINE>VoTrack p = t.getCookie();<NEW_LINE>// Compute ground pointing vector<NEW_LINE>groundCurr.x = pointingPlane.z;<NEW_LINE>groundCurr.y = -pointingPlane.x;<NEW_LINE>double norm = groundCurr.norm();<NEW_LINE>groundCurr.x /= norm;<NEW_LINE>groundCurr.y /= norm;<NEW_LINE>// dot product. vectors are normalized to 1 already<NEW_LINE>double dot = groundCurr.x * p.ground.x + groundCurr<MASK><NEW_LINE>// floating point round off error some times knocks it above 1.0<NEW_LINE>if (dot > 1.0)<NEW_LINE>dot = 1.0;<NEW_LINE>double angle = Math.acos(dot);<NEW_LINE>// cross product to figure out direction<NEW_LINE>if (groundCurr.x * p.ground.y - groundCurr.y * p.ground.x > 0)<NEW_LINE>angle = -angle;<NEW_LINE>farAngles.add(angle);<NEW_LINE>}
.y * p.ground.y;
1,387,796
public CompletableFuture<List<TextEdit>> willSaveWaitUntil(WillSaveTextDocumentParams params) {<NEW_LINE>String uri = params.getTextDocument().getUri();<NEW_LINE>JavaSource js = getJavaSource(uri);<NEW_LINE>if (js == null) {<NEW_LINE>return CompletableFuture.completedFuture(Collections.emptyList());<NEW_LINE>}<NEW_LINE>ConfigurationItem conf = new ConfigurationItem();<NEW_LINE>conf.setScopeUri(uri);<NEW_LINE>conf.setSection(NETBEANS_JAVA_ON_SAVE_ORGANIZE_IMPORTS);<NEW_LINE>return client.configuration(new ConfigurationParams(Collections.singletonList(conf))).thenApply(c -> {<NEW_LINE>if (c != null && !c.isEmpty() && ((JsonPrimitive) c.get(0)).getAsBoolean()) {<NEW_LINE>try {<NEW_LINE>List<TextEdit> edits = TextDocumentServiceImpl.modify2TextEdits(js, wc -> {<NEW_LINE>wc.toPhase(JavaSource.Phase.RESOLVED);<NEW_LINE>if (wc.getDiagnostics().isEmpty()) {<NEW_LINE>OrganizeImports.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>return edits;<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.emptyList();<NEW_LINE>});<NEW_LINE>}
doOrganizeImports(wc, null, false);
310,147
public boolean[] isTagAuto() {<NEW_LINE>TagProperty[] props = getSupportedProperties();<NEW_LINE>for (TagProperty prop : props) {<NEW_LINE>String name = prop.getName(false);<NEW_LINE>if (name.equals(TagFeatureProperties.PR_TRACKER_TEMPLATES)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int type = prop.getType();<NEW_LINE>if (type == TagFeatureProperties.PT_BOOLEAN) {<NEW_LINE>// PR_UNTAGGED<NEW_LINE>Boolean b = prop.getBoolean();<NEW_LINE>if (b != null && b) {<NEW_LINE>return (AUTO_BOTH);<NEW_LINE>}<NEW_LINE>} else if (type == TagFeatureProperties.PT_LONG) {<NEW_LINE>Long l = prop.getLong();<NEW_LINE>if (l != null && l != Long.MIN_VALUE) {<NEW_LINE>return (AUTO_BOTH);<NEW_LINE>}<NEW_LINE>} else if (type == TagFeatureProperties.PT_STRING_LIST) {<NEW_LINE>String[] vals = prop.getStringList();<NEW_LINE>if (vals != null && vals.length > 0) {<NEW_LINE>if (name.equals(TagFeatureProperties.PR_CONSTRAINT)) {<NEW_LINE>// PR_CONSTRAINT<NEW_LINE>if (!prop.isEnabled()) {<NEW_LINE>// currently only constraints can be disabled<NEW_LINE>return (AUTO_NONE);<NEW_LINE>}<NEW_LINE>String constraint = vals[0];<NEW_LINE>if (constraint == null || constraint.trim().isEmpty()) {<NEW_LINE>return (AUTO_NONE);<NEW_LINE>}<NEW_LINE>if (vals.length > 1) {<NEW_LINE>String options = vals[1];<NEW_LINE>if (options != null) {<NEW_LINE>if (options.contains("am=1;")) {<NEW_LINE>return (new boolean[] <MASK><NEW_LINE>} else if (options.contains("am=2;")) {<NEW_LINE>return (new boolean[] { false, true, false });<NEW_LINE>} else if (options.contains("am=3;")) {<NEW_LINE>return (new boolean[] { false, false, true });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (AUTO_BOTH);<NEW_LINE>} else {<NEW_LINE>// PR_TRACKERS<NEW_LINE>return (AUTO_BOTH);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (AUTO_NONE);<NEW_LINE>}
{ true, false, false });
788,593
private static void evaluateCapabilities() {<NEW_LINE>boolean tempMonitor = false;<NEW_LINE>boolean tempInjection = false;<NEW_LINE>boolean tempNexmonFirmware = false;<NEW_LINE><MASK><NEW_LINE>String line = Nexutil.getInstance().getIoctl(400);<NEW_LINE>if (line.contains("0x000000: 07")) {<NEW_LINE>tempMonitor = true;<NEW_LINE>tempInjection = true;<NEW_LINE>tempNexmonFirmware = true;<NEW_LINE>} else if (line.contains("0x000000: 03") || line.contains("0x000000: 01")) {<NEW_LINE>tempMonitor = true;<NEW_LINE>tempInjection = false;<NEW_LINE>tempNexmonFirmware = true;<NEW_LINE>} else if (line.contains("__nex_driver_io: error")) {<NEW_LINE>tempMonitor = false;<NEW_LINE>tempInjection = false;<NEW_LINE>tempNexmonFirmware = false;<NEW_LINE>}<NEW_LINE>isMonitorModeAvailable = tempMonitor;<NEW_LINE>isInjectionAvailable = tempInjection;<NEW_LINE>isNexmonFirmwareAvailable = tempNexmonFirmware;<NEW_LINE>}
Shell.SU.run("ifconfig wlan0 up");
1,387,831
final EnableRuleResult executeEnableRule(EnableRuleRequest enableRuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(enableRuleRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<EnableRuleRequest> request = null;<NEW_LINE>Response<EnableRuleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new EnableRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(enableRuleRequest));<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, "EventBridge");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "EnableRule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<EnableRuleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new EnableRuleResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
791,557
public static UpdateExperimentBasicInfoResponse unmarshall(UpdateExperimentBasicInfoResponse updateExperimentBasicInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>updateExperimentBasicInfoResponse.setRequestId(_ctx.stringValue("UpdateExperimentBasicInfoResponse.requestId"));<NEW_LINE>Result result = new Result();<NEW_LINE>result.setExperimentId(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.experimentId"));<NEW_LINE>result.setName(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.name"));<NEW_LINE>result.setDescription(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.description"));<NEW_LINE>result.setStatus(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.status"));<NEW_LINE>result.setBase(_ctx.booleanValue("UpdateExperimentBasicInfoResponse.result.base"));<NEW_LINE>result.setOnlineTime(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.onlineTime"));<NEW_LINE>result.setOfflineTime(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.offlineTime"));<NEW_LINE>List<String> buckets <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("UpdateExperimentBasicInfoResponse.result.buckets.Length"); i++) {<NEW_LINE>buckets.add(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.buckets[" + i + "]"));<NEW_LINE>}<NEW_LINE>result.setBuckets(buckets);<NEW_LINE>List<Algorithm> algorithms = new ArrayList<Algorithm>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("UpdateExperimentBasicInfoResponse.result.algorithms.Length"); i++) {<NEW_LINE>Algorithm algorithm = new Algorithm();<NEW_LINE>algorithm.setKey(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.algorithms[" + i + "].key"));<NEW_LINE>algorithm.setName(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.algorithms[" + i + "].name"));<NEW_LINE>algorithm.setCategory(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.algorithms[" + i + "].category"));<NEW_LINE>algorithm.setType(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.algorithms[" + i + "].type"));<NEW_LINE>algorithm.setDefaultValue(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.algorithms[" + i + "].defaultValue"));<NEW_LINE>algorithm.setExperimentValue(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.algorithms[" + i + "].experimentValue"));<NEW_LINE>algorithm.setHasConfig(_ctx.booleanValue("UpdateExperimentBasicInfoResponse.result.algorithms[" + i + "].hasConfig"));<NEW_LINE>List<ConfigItem> config = new ArrayList<ConfigItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("UpdateExperimentBasicInfoResponse.result.algorithms[" + i + "].config.Length"); j++) {<NEW_LINE>ConfigItem configItem = new ConfigItem();<NEW_LINE>configItem.setKey(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.algorithms[" + i + "].config[" + j + "].key"));<NEW_LINE>configItem.setName(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.algorithms[" + i + "].config[" + j + "].name"));<NEW_LINE>configItem.setDefaultValue(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.algorithms[" + i + "].config[" + j + "].defaultValue"));<NEW_LINE>configItem.setExperimentValue(_ctx.stringValue("UpdateExperimentBasicInfoResponse.result.algorithms[" + i + "].config[" + j + "].experimentValue"));<NEW_LINE>config.add(configItem);<NEW_LINE>}<NEW_LINE>algorithm.setConfig(config);<NEW_LINE>algorithms.add(algorithm);<NEW_LINE>}<NEW_LINE>result.setAlgorithms(algorithms);<NEW_LINE>updateExperimentBasicInfoResponse.setResult(result);<NEW_LINE>return updateExperimentBasicInfoResponse;<NEW_LINE>}
= new ArrayList<String>();
249,101
public void run(RegressionEnvironment env) {<NEW_LINE>AtomicInteger milestone = new AtomicInteger();<NEW_LINE>// single-column constant<NEW_LINE>String stmtText = "@name('s0') select (select id from SupportBean_S1#length(1000) where p10='X') as ids1 from SupportBean_S0";<NEW_LINE>env.compileDeployAddListenerMile(stmtText, "s0", milestone.getAndIncrement());<NEW_LINE>env.sendEventBean(new SupportBean_S1(-1, "Y"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertEqualsNew("s0", "ids1", null);<NEW_LINE>env.sendEventBean(new SupportBean_S1(1, "X"));<NEW_LINE>env.sendEventBean(new SupportBean_S1(2, "Y"));<NEW_LINE>env.sendEventBean(new SupportBean_S1(3, "Z"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertEqualsNew("s0", "ids1", 1);<NEW_LINE>env.sendEventBean(new SupportBean_S0(1));<NEW_LINE>env.assertEqualsNew("s0", "ids1", 1);<NEW_LINE>env.sendEventBean(new SupportBean_S1(2, "X"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(2));<NEW_LINE>env.assertEqualsNew("s0", "ids1", null);<NEW_LINE>env.undeployAll();<NEW_LINE>// two-column constant<NEW_LINE>stmtText = "@name('s0') select (select id from SupportBean_S1#length(1000) where p10='X' and p11='Y') as ids1 from SupportBean_S0";<NEW_LINE>env.compileDeployAddListenerMile(stmtText, "s0", milestone.getAndIncrement());<NEW_LINE>env.sendEventBean(new SupportBean_S1(1, "X", "Y"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertEqualsNew("s0", "ids1", 1);<NEW_LINE>env.undeployAll();<NEW_LINE>// single range<NEW_LINE>stmtText = "@name('s0') select (select theString from SupportBean#lastevent where intPrimitive between 10 and 20) as ids1 from SupportBean_S0";<NEW_LINE>env.compileDeployAddListenerMile(stmtText, "s0", milestone.getAndIncrement());<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertEqualsNew("s0", "ids1", "E1");<NEW_LINE>env.undeployAll();<NEW_LINE>}
new SupportBean("E1", 15));
1,153,959
private Map<PendingTx, Transaction> createTransactions(Block parent) {<NEW_LINE>Map<PendingTx, Transaction> txes = new LinkedHashMap<>();<NEW_LINE>Map<ByteArrayWrapper, Long> nonces = new HashMap<>();<NEW_LINE>Repository repoSnapshot = getBlockchain().getRepository().getSnapshotTo(parent.getStateRoot());<NEW_LINE>for (PendingTx tx : submittedTxes) {<NEW_LINE>Transaction transaction;<NEW_LINE>if (tx.customTx == null) {<NEW_LINE>ByteArrayWrapper senderW = new ByteArrayWrapper(tx.sender.getAddress());<NEW_LINE>Long nonce = nonces.get(senderW);<NEW_LINE>if (nonce == null) {<NEW_LINE>BigInteger bcNonce = repoSnapshot.getNonce(tx.sender.getAddress());<NEW_LINE>nonce = bcNonce.longValue();<NEW_LINE>}<NEW_LINE>nonces.put(senderW, nonce + 1);<NEW_LINE>byte[] toAddress = tx.targetContract != null ? tx.targetContract.getAddress() : tx.toAddress;<NEW_LINE>transaction = createTransaction(tx.sender, nonce, toAddress, tx.value, tx.data);<NEW_LINE>if (tx.createdContract != null) {<NEW_LINE>tx.createdContract.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>transaction = tx.customTx;<NEW_LINE>}<NEW_LINE>txes.put(tx, transaction);<NEW_LINE>}<NEW_LINE>return txes;<NEW_LINE>}
setAddress(transaction.getContractAddress());
919,702
<T> R<T> findResult(ProxyLookup proxy, ImmutableInternalData[] newData, Template<T> template) {<NEW_LINE>assert Thread.holdsLock(proxy);<NEW_LINE>Map<Template, Reference<R>> map = getResults();<NEW_LINE>Reference<R> ref = map.get(template);<NEW_LINE>R r = (ref == null) ? null : ref.get();<NEW_LINE>if (r != null) {<NEW_LINE>newData[0] = this;<NEW_LINE>return convertResult(r);<NEW_LINE>}<NEW_LINE>HashMap<Template, Reference<R>> res = new HashMap<Template, <MASK><NEW_LINE>R<T> newR = new R<T>(proxy, template);<NEW_LINE>res.put(template, new java.lang.ref.SoftReference<R>(newR));<NEW_LINE>newR.data = newData[0] = create(getRawLookups(), res);<NEW_LINE>return newR;<NEW_LINE>}
Reference<R>>(map);
1,148,741
public CanaryCodeOutput unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CanaryCodeOutput canaryCodeOutput = new CanaryCodeOutput();<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("SourceLocationArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>canaryCodeOutput.setSourceLocationArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Handler", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>canaryCodeOutput.setHandler(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 canaryCodeOutput;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
629,883
public Expr transforExpr(ParseNode parseNode) {<NEW_LINE>if (parseNode instanceof CallExpr) {<NEW_LINE>CallExpr parseNode1 = (CallExpr) parseNode;<NEW_LINE>String name = parseNode1.getName();<NEW_LINE>List<ParseNode> exprs = parseNode1.getArgs().getExprs();<NEW_LINE>List<Expr> collect = exprs.stream().map(i -> transforExpr(i)).collect(Collectors.toList());<NEW_LINE>return new Fun(name, collect);<NEW_LINE>} else if (parseNode instanceof DecimalLiteral) {<NEW_LINE>return new Literal(((DecimalLiteral) parseNode).getNumber());<NEW_LINE>} else if (parseNode instanceof IdLiteral) {<NEW_LINE>return new Identifier(((IdLiteral) parseNode).getId());<NEW_LINE>} else if (parseNode instanceof StringLiteral) {<NEW_LINE>return new Literal(((StringLiteral) parseNode).getString());<NEW_LINE>} else if (parseNode instanceof IntegerLiteral) {<NEW_LINE>return new Literal(((IntegerLiteral) parseNode).getNumber());<NEW_LINE>} else if (parseNode instanceof ParenthesesExpr) {<NEW_LINE>ParenthesesExpr parseNode1 = (ParenthesesExpr) parseNode;<NEW_LINE>List<ParseNode> exprs = parseNode1.getExprs();<NEW_LINE>if (exprs.size() == 1) {<NEW_LINE>return transforExpr<MASK><NEW_LINE>}<NEW_LINE>} else if (parseNode instanceof BooleanLiteral) {<NEW_LINE>return new Literal(((BooleanLiteral) parseNode).getValue());<NEW_LINE>} else if (parseNode instanceof NullLiteral) {<NEW_LINE>return new Literal(null);<NEW_LINE>} else if (parseNode instanceof ParamLiteral) {<NEW_LINE>if (params.isEmpty()) {<NEW_LINE>return new Param();<NEW_LINE>}<NEW_LINE>return new Literal(params.get(index++));<NEW_LINE>}<NEW_LINE>throw new UnsupportedOperationException();<NEW_LINE>}
(exprs.get(0));
1,507,054
public static ListNodesResponse unmarshall(ListNodesResponse listNodesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listNodesResponse.setRequestId(_ctx.stringValue("ListNodesResponse.RequestId"));<NEW_LINE>listNodesResponse.setTotalCount(_ctx.integerValue("ListNodesResponse.TotalCount"));<NEW_LINE>listNodesResponse.setPageNumber(_ctx.integerValue("ListNodesResponse.PageNumber"));<NEW_LINE>listNodesResponse.setPageSize(_ctx.integerValue("ListNodesResponse.PageSize"));<NEW_LINE>List<NodeInfo> nodes = new ArrayList<NodeInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListNodesResponse.Nodes.Length"); i++) {<NEW_LINE>NodeInfo nodeInfo = new NodeInfo();<NEW_LINE>nodeInfo.setId(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].Id"));<NEW_LINE>nodeInfo.setRegionId(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].RegionId"));<NEW_LINE>nodeInfo.setHostName(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].HostName"));<NEW_LINE>nodeInfo.setIpAddress(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].IpAddress"));<NEW_LINE>nodeInfo.setStatus(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].Status"));<NEW_LINE>nodeInfo.setVersion(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].Version"));<NEW_LINE>nodeInfo.setCreatedByEhpc(_ctx.booleanValue("ListNodesResponse.Nodes[" + i + "].CreatedByEhpc"));<NEW_LINE>nodeInfo.setAddTime(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].AddTime"));<NEW_LINE>nodeInfo.setExpired(_ctx.booleanValue("ListNodesResponse.Nodes[" + i + "].Expired"));<NEW_LINE>nodeInfo.setExpiredTime(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].ExpiredTime"));<NEW_LINE>nodeInfo.setSpotStrategy(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].SpotStrategy"));<NEW_LINE>nodeInfo.setLockReason(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].LockReason"));<NEW_LINE>nodeInfo.setImageOwnerAlias(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].ImageOwnerAlias"));<NEW_LINE>nodeInfo.setImageId(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].ImageId"));<NEW_LINE>nodeInfo.setLocation(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].Location"));<NEW_LINE>nodeInfo.setCreateMode(_ctx.stringValue<MASK><NEW_LINE>nodeInfo.setVpcId(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].VpcId"));<NEW_LINE>nodeInfo.setZoneId(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].ZoneId"));<NEW_LINE>nodeInfo.setVSwitchId(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].VSwitchId"));<NEW_LINE>nodeInfo.setHtEnabled(_ctx.booleanValue("ListNodesResponse.Nodes[" + i + "].HtEnabled"));<NEW_LINE>nodeInfo.setPublicIpAddress(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].PublicIpAddress"));<NEW_LINE>nodeInfo.setInstanceType(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].InstanceType"));<NEW_LINE>List<String> roles = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListNodesResponse.Nodes[" + i + "].Roles.Length"); j++) {<NEW_LINE>roles.add(_ctx.stringValue("ListNodesResponse.Nodes[" + i + "].Roles[" + j + "]"));<NEW_LINE>}<NEW_LINE>nodeInfo.setRoles(roles);<NEW_LINE>TotalResources totalResources = new TotalResources();<NEW_LINE>totalResources.setCpu(_ctx.integerValue("ListNodesResponse.Nodes[" + i + "].TotalResources.Cpu"));<NEW_LINE>totalResources.setMemory(_ctx.integerValue("ListNodesResponse.Nodes[" + i + "].TotalResources.Memory"));<NEW_LINE>totalResources.setGpu(_ctx.integerValue("ListNodesResponse.Nodes[" + i + "].TotalResources.Gpu"));<NEW_LINE>nodeInfo.setTotalResources(totalResources);<NEW_LINE>UsedResources usedResources = new UsedResources();<NEW_LINE>usedResources.setCpu(_ctx.integerValue("ListNodesResponse.Nodes[" + i + "].UsedResources.Cpu"));<NEW_LINE>usedResources.setMemory(_ctx.integerValue("ListNodesResponse.Nodes[" + i + "].UsedResources.Memory"));<NEW_LINE>usedResources.setGpu(_ctx.integerValue("ListNodesResponse.Nodes[" + i + "].UsedResources.Gpu"));<NEW_LINE>nodeInfo.setUsedResources(usedResources);<NEW_LINE>nodes.add(nodeInfo);<NEW_LINE>}<NEW_LINE>listNodesResponse.setNodes(nodes);<NEW_LINE>return listNodesResponse;<NEW_LINE>}
("ListNodesResponse.Nodes[" + i + "].CreateMode"));
741,473
public void registerMap() {<NEW_LINE>// 0 - Entity id<NEW_LINE>map(Type.VAR_INT);<NEW_LINE>// 1 - UUID<NEW_LINE>map(Type.UUID);<NEW_LINE>// 2 - Type<NEW_LINE>map(Type.BYTE);<NEW_LINE>// 3 - X<NEW_LINE>map(Type.DOUBLE);<NEW_LINE>// 4 - Y<NEW_LINE>map(Type.DOUBLE);<NEW_LINE>// 5 - Z<NEW_LINE>map(Type.DOUBLE);<NEW_LINE>// 6 - Pitch<NEW_LINE>map(Type.BYTE);<NEW_LINE>// 7 - Yaw<NEW_LINE>map(Type.BYTE);<NEW_LINE>// 8 - Data<NEW_LINE>map(Type.INT);<NEW_LINE>// Track Entity<NEW_LINE>handler(new PacketHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handle(PacketWrapper wrapper) throws Exception {<NEW_LINE>int entityId = wrapper.get(Type.VAR_INT, 0);<NEW_LINE>byte type = wrapper.get(Type.BYTE, 0);<NEW_LINE>Entity1_13Types.EntityType entType = Entity1_13Types.getTypeFromId(type, true);<NEW_LINE>if (entType != null) {<NEW_LINE>if (entType.is(Entity1_13Types.EntityType.FALLING_BLOCK)) {<NEW_LINE>int data = wrapper.<MASK><NEW_LINE>wrapper.set(Type.INT, 0, protocol.getMappingData().getNewBlockStateId(data));<NEW_LINE>}<NEW_LINE>// Register Type ID<NEW_LINE>wrapper.user().getEntityTracker(Protocol1_13_1To1_13.class).addEntity(entityId, entType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
get(Type.INT, 0);
928,092
private TimeZoneAndName parse(String zone) {<NEW_LINE>final Matcher tzMatcher = TZ_PATTERN.matcher(zone);<NEW_LINE>if (tzMatcher.matches()) {<NEW_LINE>String name = tzMatcher.group(1);<NEW_LINE>String <MASK><NEW_LINE>String hours = tzMatcher.group(3);<NEW_LINE>String minutes = tzMatcher.group(4);<NEW_LINE>String seconds = tzMatcher.group(5);<NEW_LINE>// Sign is reversed in legacy TZ notation<NEW_LINE>return getTimeZoneFromHHMM(name, sign.equals("-"), hours, minutes, seconds);<NEW_LINE>} else {<NEW_LINE>final String expandedZone = expandZoneName(zone);<NEW_LINE>ZoneId zoneID;<NEW_LINE>try {<NEW_LINE>zoneID = ZoneId.of(expandedZone);<NEW_LINE>} catch (DateTimeException | IllegalArgumentException e) {<NEW_LINE>zoneID = UTC;<NEW_LINE>}<NEW_LINE>return new TimeZoneAndName(zoneID);<NEW_LINE>}<NEW_LINE>}
sign = tzMatcher.group(2);
1,296,156
public void run() {<NEW_LINE>DefaultConfiguration defaultConf = DefaultConfiguration.getInstance();<NEW_LINE>long defaultDelay = defaultConf.getTimeInMillis(Property.REPLICATION_WORK_PROCESSOR_DELAY);<NEW_LINE>long defaultPeriod = defaultConf.getTimeInMillis(Property.REPLICATION_WORK_PROCESSOR_PERIOD);<NEW_LINE>AccumuloConfiguration conf = context.getConfiguration();<NEW_LINE>long delay = <MASK><NEW_LINE>long period = conf.getTimeInMillis(Property.REPLICATION_WORK_PROCESSOR_PERIOD);<NEW_LINE>try {<NEW_LINE>DistributedWorkQueue workQueue;<NEW_LINE>if (defaultDelay != delay && defaultPeriod != period) {<NEW_LINE>log.debug("Configuration DistributedWorkQueue with delay and period of {} and {}", delay, period);<NEW_LINE>workQueue = new DistributedWorkQueue(context.getZooKeeperRoot() + ReplicationConstants.ZOO_WORK_QUEUE, conf, context, delay, period);<NEW_LINE>} else {<NEW_LINE>log.debug("Configuring DistributedWorkQueue with default delay and period");<NEW_LINE>workQueue = new DistributedWorkQueue(context.getZooKeeperRoot() + ReplicationConstants.ZOO_WORK_QUEUE, conf, context);<NEW_LINE>}<NEW_LINE>workQueue.startProcessing(new ReplicationProcessor(context), executor);<NEW_LINE>} catch (KeeperException | InterruptedException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
conf.getTimeInMillis(Property.REPLICATION_WORK_PROCESSOR_DELAY);
797,988
public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException {<NEW_LINE>try {<NEW_LINE>// $NON-NLS-1$<NEW_LINE><MASK><NEW_LINE>RefactoringStatus result = Checks.validateModifiesFiles(ResourceUtil.getFiles(new ICompilationUnit[] { fCu }), getValidationContext(), pm);<NEW_LINE>if (result.hasFatalError()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>if (fCompilationUnitNode == null) {<NEW_LINE>fCompilationUnitNode = RefactoringASTParser.parseWithASTProvider(fCu, true, new SubProgressMonitor(pm, 3));<NEW_LINE>}<NEW_LINE>pm.worked(1);<NEW_LINE>if (fCURewrite == null) {<NEW_LINE>fCURewrite = new CompilationUnitRewrite(fCu, fCompilationUnitNode);<NEW_LINE>fCURewrite.setFormattingOptions(fFormatterOptions);<NEW_LINE>fCURewrite.getASTRewrite().setTargetSourceRangeComputer(new NoCommentSourceRangeComputer());<NEW_LINE>}<NEW_LINE>pm.worked(1);<NEW_LINE>// Check the conditions for extracting an expression to a variable.<NEW_LINE>IExpressionFragment selectedExpression = getSelectedExpression();<NEW_LINE>if (selectedExpression == null) {<NEW_LINE>String message = RefactoringCoreMessages.ExtractTempRefactoring_select_expression;<NEW_LINE>return CodeRefactoringUtil.checkMethodSyntaxErrors(fSelectionStart, fSelectionLength, fCompilationUnitNode, message);<NEW_LINE>}<NEW_LINE>pm.worked(1);<NEW_LINE>if (isUsedInExplicitConstructorCall()) {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractTempRefactoring_explicit_constructor);<NEW_LINE>}<NEW_LINE>pm.worked(1);<NEW_LINE>ASTNode associatedNode = selectedExpression.getAssociatedNode();<NEW_LINE>if (getEnclosingBodyNode() == null || ASTNodes.getParent(associatedNode, Annotation.class) != null) {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractTempRefactoring_expr_in_method_or_initializer);<NEW_LINE>}<NEW_LINE>pm.worked(1);<NEW_LINE>if (associatedNode instanceof Name && associatedNode.getParent() instanceof ClassInstanceCreation && associatedNode.getLocationInParent() == ClassInstanceCreation.TYPE_PROPERTY) {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractTempRefactoring_name_in_new);<NEW_LINE>}<NEW_LINE>pm.worked(1);<NEW_LINE>result.merge(checkExpression());<NEW_LINE>if (result.hasFatalError()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>pm.worked(1);<NEW_LINE>result.merge(checkExpressionFragmentIsRValue());<NEW_LINE>if (result.hasFatalError()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>pm.worked(1);<NEW_LINE>Expression associatedExpression = selectedExpression.getAssociatedExpression();<NEW_LINE>if (isUsedInForInitializerOrUpdater(associatedExpression)) {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractTempRefactoring_for_initializer_updater);<NEW_LINE>}<NEW_LINE>pm.worked(1);<NEW_LINE>if (isReferringToLocalVariableFromFor(associatedExpression)) {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractTempRefactoring_refers_to_for_variable);<NEW_LINE>}<NEW_LINE>pm.worked(1);<NEW_LINE>// Check the conditions for extracting an expression to field.<NEW_LINE>ASTNode declaringType = getEnclosingTypeDeclaration();<NEW_LINE>if (declaringType instanceof TypeDeclaration && ((TypeDeclaration) declaringType).isInterface()) {<NEW_LINE>return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ExtractFieldRefactoring_interface_methods);<NEW_LINE>}<NEW_LINE>pm.worked(1);<NEW_LINE>result.merge(checkTempTypeForLocalTypeUsage());<NEW_LINE>if (result.hasFatalError()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>pm.worked(1);<NEW_LINE>checkTempInitializerForLocalTypeUsage();<NEW_LINE>initializeDefaults();<NEW_LINE>pm.worked(1);<NEW_LINE>return result;<NEW_LINE>} finally {<NEW_LINE>pm.done();<NEW_LINE>}<NEW_LINE>}
pm.beginTask("", 16);
881,023
private static void write_package_keepout(app.freerouting.library.Package.Keepout p_keepout, WriteScopeParameter p_par, boolean p_is_via_keepout) throws java.io.IOException {<NEW_LINE>Layer keepout_layer;<NEW_LINE>if (p_keepout.layer >= 0) {<NEW_LINE>app.freerouting.board.Layer board_layer = p_par.board.layer_structure.arr[p_keepout.layer];<NEW_LINE>keepout_layer = new Layer(board_layer.name, p_keepout.layer, board_layer.is_signal);<NEW_LINE>} else {<NEW_LINE>keepout_layer = Layer.SIGNAL;<NEW_LINE>}<NEW_LINE>app.freerouting.geometry.planar.Shape boundary_shape;<NEW_LINE>app.freerouting.geometry.planar.Shape[] holes;<NEW_LINE>if (p_keepout.area instanceof app.freerouting.geometry.planar.Shape) {<NEW_LINE>boundary_shape = (app.freerouting.geometry.planar.Shape) p_keepout.area;<NEW_LINE>holes = new app.freerouting.<MASK><NEW_LINE>} else {<NEW_LINE>boundary_shape = p_keepout.area.get_border();<NEW_LINE>holes = p_keepout.area.get_holes();<NEW_LINE>}<NEW_LINE>p_par.file.start_scope();<NEW_LINE>if (p_is_via_keepout) {<NEW_LINE>p_par.file.write("via_keepout");<NEW_LINE>} else {<NEW_LINE>p_par.file.write("keepout");<NEW_LINE>}<NEW_LINE>Shape dsn_shape = p_par.coordinate_transform.board_to_dsn(boundary_shape, keepout_layer);<NEW_LINE>if (dsn_shape != null) {<NEW_LINE>dsn_shape.write_scope(p_par.file, p_par.identifier_type);<NEW_LINE>}<NEW_LINE>for (int j = 0; j < holes.length; ++j) {<NEW_LINE>Shape dsn_hole = p_par.coordinate_transform.board_to_dsn(holes[j], keepout_layer);<NEW_LINE>dsn_hole.write_hole_scope(p_par.file, p_par.identifier_type);<NEW_LINE>}<NEW_LINE>p_par.file.end_scope();<NEW_LINE>}
geometry.planar.Shape[0];
1,535,292
public int load() {<NEW_LINE>final Map<String, Pair<Map<String, String>, List<Pair<Pattern, String>>>> relatedContentMap = new HashMap<>();<NEW_LINE>getAvailableRelatedContentList().stream().forEach(entity -> {<NEW_LINE>final String key = getHostKey(entity);<NEW_LINE>Pair<Map<String, String>, List<Pair<Pattern, String>>> <MASK><NEW_LINE>if (pair == null) {<NEW_LINE>pair = new Pair<>(new HashMap<>(), new ArrayList<>());<NEW_LINE>relatedContentMap.put(key, pair);<NEW_LINE>}<NEW_LINE>if (entity.getTerm().startsWith(regexPrefix)) {<NEW_LINE>final String regex = entity.getTerm().substring(regexPrefix.length());<NEW_LINE>if (StringUtil.isBlank(regex)) {<NEW_LINE>logger.warn("Unknown regex pattern: {}", entity.getTerm());<NEW_LINE>} else {<NEW_LINE>pair.getSecond().add(new Pair<>(Pattern.compile(regex), entity.getContent()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>pair.getFirst().put(toLowerCase(entity.getTerm()), entity.getContent());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>this.relatedContentMap = relatedContentMap;<NEW_LINE>return relatedContentMap.size();<NEW_LINE>}
pair = relatedContentMap.get(key);
183,624
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "add");<NEW_LINE>final String targetRegister = instruction.getOperands().get(0).getRootNode().getChildren().get(0).getValue();<NEW_LINE>final String sourceRegister1 = instruction.getOperands().get(1).getRootNode().getChildren().get(0).getValue();<NEW_LINE>final String sourceRegister2 = instruction.getOperands().get(2).getRootNode().getChildren().get(0).getValue();<NEW_LINE>final OperandSize bt = OperandSize.BYTE;<NEW_LINE>final OperandSize dw = OperandSize.DWORD;<NEW_LINE>final OperandSize qw = OperandSize.QWORD;<NEW_LINE>final long baseOffset = ReilHelpers.toReilAddress(instruction.getAddress()).toLong();<NEW_LINE>long offset = baseOffset;<NEW_LINE>final String temporaryResult = environment.getNextVariableString();<NEW_LINE>final String bit31 = environment.getNextVariableString();<NEW_LINE>final String bit32 = environment.getNextVariableString();<NEW_LINE>final String jumpCondition = environment.getNextVariableString();<NEW_LINE>final String xoredBits = environment.getNextVariableString();<NEW_LINE>final String sourceImmediateSignExtended = SignExtendGenerator.extend16BitTo32(offset, environment, sourceRegister2, instructions);<NEW_LINE>instructions.add(ReilHelpers.createAdd(offset++, dw, sourceRegister1, dw, sourceImmediateSignExtended, qw, temporaryResult));<NEW_LINE>// is bit 32 != bit 31<NEW_LINE>instructions.add(ReilHelpers.createBsh(offset++, qw, temporaryResult, dw, String.valueOf(-31L), bt, bit31));<NEW_LINE>instructions.add(ReilHelpers.createBsh(offset++, qw, temporaryResult, dw, String.valueOf(-32L), bt, bit32));<NEW_LINE>instructions.add(ReilHelpers.createXor(offset++, bt, bit31, bt, bit32, bt, xoredBits));<NEW_LINE>instructions.add(ReilHelpers.createBisz(offset++, bt, xoredBits, bt, jumpCondition));<NEW_LINE>final String jmpGoal = String.format("%d.%d", instruction.getAddress().toLong(), instructions.size() + 2);<NEW_LINE>instructions.add(ReilHelpers.createJcc(offset++, bt, jumpCondition, dw, jmpGoal));<NEW_LINE>instructions.add(ReilHelpers.createAnd(offset++, qw, temporaryResult, dw, String.valueOf(0xFFFFFFFFL), dw, targetRegister));<NEW_LINE>instructions.add<MASK><NEW_LINE>}
(ReilHelpers.createNop(offset));
1,643,267
private String convertNumber(Number number) {<NEW_LINE>if (Integer.class.isInstance(number)) {<NEW_LINE>return NumericUtils.intToPrefixCoded(number.intValue());<NEW_LINE>} else if (Double.class.isInstance(number)) {<NEW_LINE>return NumericUtils.doubleToPrefixCoded(number.doubleValue());<NEW_LINE>} else if (Long.class.isInstance(number)) {<NEW_LINE>return NumericUtils.longToPrefixCoded(number.longValue());<NEW_LINE>} else if (Float.class.isInstance(number)) {<NEW_LINE>return NumericUtils.floatToPrefixCoded(number.floatValue());<NEW_LINE>} else if (Byte.class.isInstance(number)) {<NEW_LINE>return NumericUtils.<MASK><NEW_LINE>} else if (Short.class.isInstance(number)) {<NEW_LINE>return NumericUtils.intToPrefixCoded(number.intValue());<NEW_LINE>} else if (BigDecimal.class.isInstance(number)) {<NEW_LINE>return NumericUtils.doubleToPrefixCoded(number.doubleValue());<NEW_LINE>} else if (BigInteger.class.isInstance(number)) {<NEW_LINE>return NumericUtils.longToPrefixCoded(number.longValue());<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unsupported numeric type " + number.getClass().getName());<NEW_LINE>}<NEW_LINE>}
intToPrefixCoded(number.intValue());
1,028,820
public static PsiElementVisitor createVisitorAndAcceptElements(@Nonnull LocalInspectionTool tool, @Nonnull ProblemsHolder holder, boolean isOnTheFly, @Nonnull LocalInspectionToolSession session, @Nonnull List<PsiElement> elements, @Nonnull Set<String> elementDialectIds, @Nullable Set<String> dialectIdsSpecifiedForTool) {<NEW_LINE>PsiElementVisitor visitor = tool.<MASK><NEW_LINE>// noinspection ConstantConditions<NEW_LINE>if (visitor == null) {<NEW_LINE>LOG.error("Tool " + tool + " (" + tool.getClass() + ") must not return null from the buildVisitor() method");<NEW_LINE>} else if (visitor instanceof PsiRecursiveVisitor && RECURSIVE_VISITOR_TOOL_CLASSES.add(tool.getClass())) {<NEW_LINE>LOG.error("The visitor returned from LocalInspectionTool.buildVisitor() must not be recursive: " + tool);<NEW_LINE>}<NEW_LINE>tool.inspectionStarted(session, isOnTheFly);<NEW_LINE>acceptElements(elements, visitor, elementDialectIds, dialectIdsSpecifiedForTool);<NEW_LINE>return visitor;<NEW_LINE>}
buildVisitor(holder, isOnTheFly, session);
355,665
private <T> T runMethod(Callable<T> callable, String methodName, File[] roots) throws GitException {<NEW_LINE>try {<NEW_LINE>if (isExclusiveRepositoryAccess(methodName)) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(Level.FINER, "Running an exclusive command: {0} on {1}", new Object[] { methodName, repositoryRoot });<NEW_LINE>if (progressSupport != null) {<NEW_LINE>progressSupport.setRepositoryStateBlocked(repositoryRoot, true);<NEW_LINE>}<NEW_LINE>synchronized (repositoryRoot) {<NEW_LINE>if (Thread.interrupted()) {<NEW_LINE>throw new InterruptedException();<NEW_LINE>}<NEW_LINE>if (progressSupport != null) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(<MASK><NEW_LINE>progressSupport.setRepositoryStateBlocked(repositoryRoot, false);<NEW_LINE>}<NEW_LINE>return runMethodIntern(callable, methodName, roots);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(Level.FINER, "Running a parallelizable command: {0} on {1}", new Object[] { methodName, repositoryRoot.getAbsolutePath() });<NEW_LINE>return runMethodIntern(callable, methodName, roots);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>throw new GitCanceledException(ex);<NEW_LINE>} catch (GitException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>if (ex instanceof RuntimeException) {<NEW_LINE>throw (RuntimeException) ex;<NEW_LINE>} else if (ex.getCause() != null) {<NEW_LINE>throw new GitException(ex.getCause());<NEW_LINE>} else {<NEW_LINE>throw new GitException(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Level.FINEST, "Repository unblocked: {0}", repositoryRoot);
217,299
public ConversionResult<T> convert(String argument, InjectedValueAccess context) {<NEW_LINE>Actor actor = context.injectedValue(Key.of(Actor.class)).orElseThrow(() -> new IllegalStateException("No actor"));<NEW_LINE>LocalSession session = WorldEdit.getInstance().getSessionManager().get(actor);<NEW_LINE>ParserContext parserContext = new ParserContext();<NEW_LINE>parserContext.setActor(actor);<NEW_LINE>if (actor instanceof Locatable) {<NEW_LINE>Extent extent = ((<MASK><NEW_LINE>if (extent instanceof World) {<NEW_LINE>parserContext.setWorld((World) extent);<NEW_LINE>}<NEW_LINE>parserContext.setExtent(new RequestExtent());<NEW_LINE>} else if (session.hasWorldOverride()) {<NEW_LINE>parserContext.setWorld(session.getWorldOverride());<NEW_LINE>parserContext.setExtent(new RequestExtent());<NEW_LINE>}<NEW_LINE>parserContext.setSession(session);<NEW_LINE>parserContext.setRestricted(true);<NEW_LINE>if (contextTweaker != null) {<NEW_LINE>contextTweaker.accept(parserContext);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return SuccessfulConversion.fromSingle(factoryExtractor.apply(worldEdit).parseFromInput(argument, parserContext));<NEW_LINE>} catch (InputParseException e) {<NEW_LINE>return FailedConversion.from(e);<NEW_LINE>}<NEW_LINE>}
Locatable) actor).getExtent();
244,317
private void enableLiveUpdates(boolean enable) {<NEW_LINE>if (!Algorithms.isEmpty(adapter.mapsList)) {<NEW_LINE>AlarmManager alarmMgr = (AlarmManager) app.getSystemService(Context.ALARM_SERVICE);<NEW_LINE>List<LocalIndexInfo> mapsToUpdate = getMapsToUpdate(adapter.mapsList, settings);<NEW_LINE>for (LocalIndexInfo li : mapsToUpdate) {<NEW_LINE>String fileName = li.getFileName();<NEW_LINE>PendingIntent alarmIntent = getPendingIntent(app, fileName);<NEW_LINE>if (enable) {<NEW_LINE>final CommonPreference<Integer> updateFrequencyPreference = preferenceUpdateFrequency(fileName, settings);<NEW_LINE>final CommonPreference<Integer> timeOfDayPreference = preferenceTimeOfDayToUpdate(fileName, settings);<NEW_LINE>UpdateFrequency updateFrequency = UpdateFrequency.values()[updateFrequencyPreference.get()];<NEW_LINE>TimeOfDay timeOfDayToUpdate = TimeOfDay.values(<MASK><NEW_LINE>setAlarmForPendingIntent(alarmIntent, alarmMgr, updateFrequency, timeOfDayToUpdate);<NEW_LINE>} else {<NEW_LINE>alarmMgr.cancel(alarmIntent);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
)[timeOfDayPreference.get()];
1,048,161
private T createProxy(Map<String, String> referenceParameters) {<NEW_LINE>if (shouldJvmRefer(referenceParameters)) {<NEW_LINE>createInvokerForLocal(referenceParameters);<NEW_LINE>} else {<NEW_LINE>urls.clear();<NEW_LINE>if (StringUtils.isNotEmpty(url)) {<NEW_LINE>// user specified URL, could be peer-to-peer address, or register center's address.<NEW_LINE>parseUrl(referenceParameters);<NEW_LINE>} else {<NEW_LINE>// if protocols not in jvm checkRegistry<NEW_LINE>if (!LOCAL_PROTOCOL.equalsIgnoreCase(getProtocol())) {<NEW_LINE>aggregateUrlFromRegistry(referenceParameters);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>createInvokerForRemote();<NEW_LINE>}<NEW_LINE>if (logger.isInfoEnabled()) {<NEW_LINE>logger.info("Referred dubbo service: [" + referenceParameters.get(INTERFACE_KEY) + "]." + (Boolean.parseBoolean(referenceParameters.get(GENERIC_KEY)) ? " it's GenericService reference" : " it's not GenericService reference"));<NEW_LINE>}<NEW_LINE>URL consumerUrl = new ServiceConfigURL(CONSUMER_PROTOCOL, referenceParameters.get(REGISTER_IP_KEY), 0, referenceParameters.get(INTERFACE_KEY), referenceParameters);<NEW_LINE>consumerUrl = consumerUrl.setScopeModel(getScopeModel());<NEW_LINE>consumerUrl = consumerUrl.setServiceModel(consumerModel);<NEW_LINE>MetadataUtils.publishServiceDefinition(consumerUrl, consumerModel.<MASK><NEW_LINE>// create service proxy<NEW_LINE>return (T) proxyFactory.getProxy(invoker, ProtocolUtils.isGeneric(generic));<NEW_LINE>}
getServiceModel(), getApplicationModel());
1,035,129
@Consumes(MediaType.APPLICATION_JSON)<NEW_LINE>@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>@Operation(description = "Add the specified assertion to the given policy version")<NEW_LINE>public Assertion putAssertionPolicyVersion(@Parameter(description = "name of the domain", required = true) @PathParam("domainName") String domainName, @Parameter(description = "name of the policy", required = true) @PathParam("policyName") String policyName, @Parameter(description = "name of the version", required = true) @PathParam("version") String version, @Parameter(description = "Audit param required(not empty) if domain auditEnabled is true.", required = true) @HeaderParam("Y-Audit-Ref") String auditRef, @Parameter(description = "Assertion object to be added to the given policy version", required = true) Assertion assertion) {<NEW_LINE>int code = ResourceException.OK;<NEW_LINE>ResourceContext context = null;<NEW_LINE>try {<NEW_LINE>context = this.delegate.newResourceContext(this.request, this.response, "putAssertionPolicyVersion");<NEW_LINE>context.authorize("update", "" + domainName + ":policy." + policyName + "", null);<NEW_LINE>return this.delegate.putAssertionPolicyVersion(context, domainName, policyName, version, auditRef, assertion);<NEW_LINE>} catch (ResourceException e) {<NEW_LINE>code = e.getCode();<NEW_LINE>switch(code) {<NEW_LINE>case ResourceException.BAD_REQUEST:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.CONFLICT:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.FORBIDDEN:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.NOT_FOUND:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.TOO_MANY_REQUESTS:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.UNAUTHORIZED:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>default:<NEW_LINE>System.err.println("*** Warning: undeclared exception (" + code + ") for resource putAssertionPolicyVersion");<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>this.delegate.publishChangeMessage(context, code);<NEW_LINE>this.<MASK><NEW_LINE>}<NEW_LINE>}
delegate.recordMetrics(context, code);
530,599
public int findPaths(int m, int n, int N, int i, int j) {<NEW_LINE>final int MOD = (int) (1e9 + 7);<NEW_LINE>final int[] dirs = new int[] { -1, 0<MASK><NEW_LINE>int[][] f = new int[m][n];<NEW_LINE>f[i][j] = 1;<NEW_LINE>int res = 0;<NEW_LINE>for (int step = 0; step < N; ++step) {<NEW_LINE>int[][] temp = new int[m][n];<NEW_LINE>for (int x = 0; x < m; ++x) {<NEW_LINE>for (int y = 0; y < n; ++y) {<NEW_LINE>for (int k = 0; k < 4; ++k) {<NEW_LINE>int tx = x + dirs[k], ty = y + dirs[k + 1];<NEW_LINE>if (tx >= 0 && tx < m && ty >= 0 && ty < n) {<NEW_LINE>temp[tx][ty] += f[x][y];<NEW_LINE>temp[tx][ty] %= MOD;<NEW_LINE>} else {<NEW_LINE>res += f[x][y];<NEW_LINE>res %= MOD;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>f = temp;<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
, 1, 0, -1 };
1,596,532
private TokenResponse authorizeWithPassword(final Credentials credentials) throws BackgroundException {<NEW_LINE>try {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Request tokens for user %s", credentials.getUsername()));<NEW_LINE>}<NEW_LINE>final PasswordTokenRequest request = new PasswordTokenRequest(transport, json, new GenericUrl(tokenServerUrl), credentials.getUsername(), credentials.getPassword()).setClientAuthentication(new ClientParametersAuthentication(clientid, clientsecret)).setRequestInitializer(new UserAgentHttpRequestInitializer(new PreferencesUseragentProvider())).setScopes(scopes.isEmpty() ? null : scopes);<NEW_LINE>for (Map.Entry<String, String> values : additionalParameters.entrySet()) {<NEW_LINE>request.set(values.getKey(), values.getValue());<NEW_LINE>}<NEW_LINE>return request.executeUnparsed().parseAs(PermissiveTokenResponse.class).toTokenResponse();<NEW_LINE>} catch (TokenResponseException e) {<NEW_LINE>throw new OAuthExceptionMappingService().map(e);<NEW_LINE>} catch (HttpResponseException e) {<NEW_LINE>throw new DefaultHttpResponseExceptionMappingService().map(new org.apache.http.client.HttpResponseException(e.getStatusCode()<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new DefaultIOExceptionMappingService().map(e);<NEW_LINE>}<NEW_LINE>}
, e.getStatusMessage()));
1,024,908
final PutPublicAccessBlockResult executePutPublicAccessBlock(PutPublicAccessBlockRequest putPublicAccessBlockRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putPublicAccessBlockRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutPublicAccessBlockRequest> request = null;<NEW_LINE>Response<PutPublicAccessBlockResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutPublicAccessBlockRequestMarshaller().marshall(super.beforeMarshalling(putPublicAccessBlockRequest));<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, "S3 Control");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutPublicAccessBlock");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>ValidationUtils.assertStringNotEmpty(putPublicAccessBlockRequest.getAccountId(), "AccountId");<NEW_LINE>HostnameValidator.validateHostnameCompliant(putPublicAccessBlockRequest.getAccountId(), "AccountId", "putPublicAccessBlockRequest");<NEW_LINE>String hostPrefix = "{AccountId}.";<NEW_LINE>String resolvedHostPrefix = String.format("%s.", putPublicAccessBlockRequest.getAccountId());<NEW_LINE>endpointTraitHost = <MASK><NEW_LINE>}<NEW_LINE>StaxResponseHandler<PutPublicAccessBlockResult> responseHandler = new com.amazonaws.services.s3control.internal.S3ControlStaxResponseHandler<PutPublicAccessBlockResult>(new PutPublicAccessBlockResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);
1,354,763
public static void main(String[] args) throws Exception {<NEW_LINE>java.util.Date startDate = new java.util.Date();<NEW_LINE>System.out.println("[Start: " + startDate.toString() + "]");<NEW_LINE>ParseArgs parseArgs = new ParseArgs(args).invoke();<NEW_LINE>if (parseArgs.error()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String minThreshold = parseArgs.getMinThreshold();<NEW_LINE>String projectId = parseArgs.getProjectId();<NEW_LINE>String dbName = parseArgs.getDbName();<NEW_LINE>String tableName = parseArgs.getTableName();<NEW_LINE>String dbType = parseArgs.getDbType();<NEW_LINE>String limitMax = parseArgs.getLimitMax();<NEW_LINE>String inspectTemplate = parseArgs.getInspectTemplate();<NEW_LINE>String threadPoolSize = parseArgs.getThreadPoolSize();<NEW_LINE>System.out.println("Inspect SQL via JDBC V0.1");<NEW_LINE>inspectDatabase(dbName, dbType, tableName, new Integer(limitMax), inspectTemplate, new Integer(threadPoolSize), projectId, new Integer(minThreshold));<NEW_LINE>java.util.Date endDate = new java.util.Date();<NEW_LINE>System.out.println("[End: " + endDate.toString() + "]");<NEW_LINE>long diff = endDate.getTime() - startDate.getTime();<NEW_LINE><MASK><NEW_LINE>long diffMinutes = diff / (60 * 1000) % 60;<NEW_LINE>long diffHours = diff / (60 * 60 * 1000) % 24;<NEW_LINE>long diffDays = diff / (24 * 60 * 60 * 1000);<NEW_LINE>System.out.print("[Duration: ");<NEW_LINE>System.out.print(" " + diffDays + " days, ");<NEW_LINE>System.out.print(" " + diffHours + " hours, ");<NEW_LINE>System.out.print(" " + diffMinutes + " minutes, ");<NEW_LINE>System.out.print(" " + diffSeconds + " seconds.");<NEW_LINE>System.out.println("]");<NEW_LINE>}
long diffSeconds = diff / 1000 % 60;
1,430,910
private void handleSnappy(BuildProducer<ReflectiveClassBuildItem> reflectiveClass, BuildProducer<NativeImageResourceBuildItem> nativeLibs, NativeConfig nativeConfig) {<NEW_LINE>reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, true, "org.xerial.snappy.SnappyInputStream", "org.xerial.snappy.SnappyOutputStream"));<NEW_LINE>String root = "org/xerial/snappy/native/";<NEW_LINE>// add linux64 native lib when targeting containers<NEW_LINE>if (nativeConfig.isContainerBuild()) {<NEW_LINE>String dir = "Linux/x86_64";<NEW_LINE>String snappyNativeLibraryName = "libsnappyjava.so";<NEW_LINE>String path = root + dir + "/" + snappyNativeLibraryName;<NEW_LINE>nativeLibs.produce(new NativeImageResourceBuildItem(path));<NEW_LINE>} else {<NEW_LINE>// otherwise the native lib of the platform this build runs on<NEW_LINE>String dir = OSInfo.getNativeLibFolderPathForCurrentOS();<NEW_LINE>String <MASK><NEW_LINE>String path = root + dir + "/" + snappyNativeLibraryName;<NEW_LINE>nativeLibs.produce(new NativeImageResourceBuildItem(path));<NEW_LINE>}<NEW_LINE>}
snappyNativeLibraryName = System.mapLibraryName("snappyjava");
1,182,873
String generate() {<NEW_LINE>TypeSpec.Builder generated = classBuilder(className).superclass(superType()).addAnnotations(copiedClassAnnotations(context.autoValueClass())).addTypeVariables(annotatedTypeVariableNames()).addModifiers(isFinal ? FINAL : ABSTRACT).addMethod(constructor());<NEW_LINE>generatedAnnotationSpec(elements, sourceVersion, MemoizeExtension.class).ifPresent(generated::addAnnotation);<NEW_LINE>for (ExecutableElement method : memoizedMethods(context)) {<NEW_LINE>MethodOverrider methodOverrider = new MethodOverrider(method);<NEW_LINE>generated.<MASK><NEW_LINE>generated.addMethod(methodOverrider.method());<NEW_LINE>}<NEW_LINE>if (isHashCodeMemoized() && !isEqualsFinal()) {<NEW_LINE>generated.addMethod(equalsWithHashCodeCheck());<NEW_LINE>}<NEW_LINE>if (hasErrors) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return JavaFile.builder(context.packageName(), generated.build()).build().toString();<NEW_LINE>}
addFields(methodOverrider.fields());
1,781,324
public void initSubDevices() {<NEW_LINE>Dual020mADevice sensor0 = ModelFactory.eINSTANCE.createDual020mADevice();<NEW_LINE>sensor0.setSensorNum((short) 0);<NEW_LINE>sensor0.setUid(getUid());<NEW_LINE>String subIdsensor0 = "sensor0";<NEW_LINE>sensor0.setSubId(subIdsensor0);<NEW_LINE>logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdsensor0);<NEW_LINE>sensor0.init();<NEW_LINE>sensor0.setMbrick(this);<NEW_LINE>Dual020mADevice sensor1 = ModelFactory.eINSTANCE.createDual020mADevice();<NEW_LINE>sensor1.setSensorNum((short) 1);<NEW_LINE><MASK><NEW_LINE>String subIdsensor1 = "sensor1";<NEW_LINE>sensor1.setSubId(subIdsensor1);<NEW_LINE>logger.debug("{} addSubDevice {}", LoggerConstants.TFINIT, subIdsensor1);<NEW_LINE>sensor1.init();<NEW_LINE>sensor1.setMbrick(this);<NEW_LINE>}
sensor1.setUid(getUid());
1,311,930
public Image makeGradient(String attribute, int wide, int high) {<NEW_LINE>int top = getColor(attribute + ".gradient.top").getRGB();<NEW_LINE>int bot = getColor(<MASK><NEW_LINE>// float r1 = (top >> 16) & 0xff;<NEW_LINE>// float g1 = (top >> 8) & 0xff;<NEW_LINE>// float b1 = top & 0xff;<NEW_LINE>// float r2 = (bot >> 16) & 0xff;<NEW_LINE>// float g2 = (bot >> 8) & 0xff;<NEW_LINE>// float b2 = bot & 0xff;<NEW_LINE>BufferedImage outgoing = new BufferedImage(wide, high, BufferedImage.TYPE_INT_RGB);<NEW_LINE>int[] row = new int[wide];<NEW_LINE>WritableRaster wr = outgoing.getRaster();<NEW_LINE>for (int i = 0; i < high; i++) {<NEW_LINE>// Arrays.fill(row, (255 - (i + GRADIENT_TOP)) << 24);<NEW_LINE>// int r = (int) PApplet.map(i, 0, high-1, r1, r2);<NEW_LINE>int rgb = PApplet.lerpColor(top, bot, i / (float) (high - 1), PConstants.RGB);<NEW_LINE>Arrays.fill(row, rgb);<NEW_LINE>// System.out.println(PApplet.hex(row[0]));<NEW_LINE>wr.setDataElements(0, i, wide, 1, row);<NEW_LINE>}<NEW_LINE>// Graphics g = outgoing.getGraphics();<NEW_LINE>// for (int i = 0; i < steps; i++) {<NEW_LINE>// g.setColor(new Color(1, 1, 1, 255 - (i + GRADIENT_TOP)));<NEW_LINE>// //g.fillRect(0, i, EditorButton.DIM, 10);<NEW_LINE>// g.drawLine(0, i, EditorButton.DIM, i);<NEW_LINE>// }<NEW_LINE>return outgoing;<NEW_LINE>}
attribute + ".gradient.bottom").getRGB();
113,197
boolean match(Matcher matcher, int i, CharSequence seq) {<NEW_LINE>int savedFrom = matcher.from;<NEW_LINE>boolean conditionMatched = false;<NEW_LINE>int startIndex = (!matcher.transparentBounds) ? matcher.from : 0;<NEW_LINE>int from = Math.<MASK><NEW_LINE>// Set end boundary<NEW_LINE>int savedLBT = matcher.lookbehindTo;<NEW_LINE>matcher.lookbehindTo = i;<NEW_LINE>// Relax transparent region boundaries for lookbehind<NEW_LINE>if (matcher.transparentBounds)<NEW_LINE>matcher.from = 0;<NEW_LINE>for (int j = i - rmin; !conditionMatched && j >= from; j--) {<NEW_LINE>conditionMatched = cond.match(matcher, j, seq);<NEW_LINE>}<NEW_LINE>matcher.from = savedFrom;<NEW_LINE>matcher.lookbehindTo = savedLBT;<NEW_LINE>return conditionMatched && next.match(matcher, i, seq);<NEW_LINE>}
max(i - rmax, startIndex);
137,079
public void actionPerformed(final ActionEvent event) {<NEW_LINE>try {<NEW_LINE>final URL url = new URL(nodeAndMapReference.getMapReference());<NEW_LINE>if (url == null)<NEW_LINE>return;<NEW_LINE>UITools.executeWhenNodeHasFocus(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>if (nodeAndMapReference.hasFreeplaneFileExtension()) {<NEW_LINE>Controller.getCurrentController().selectMode(MModeController.MODENAME);<NEW_LINE>MMapController mapController = (MMapController) Controller.getCurrentModeController().getMapController();<NEW_LINE>mapController.openDocumentationMap(url);<NEW_LINE>if (nodeAndMapReference.hasNodeReference())<NEW_LINE>mapController.<MASK><NEW_LINE>} else {<NEW_LINE>Controller.getCurrentController().getViewController().openDocument(url);<NEW_LINE>}<NEW_LINE>} catch (final Exception e1) {<NEW_LINE>LogUtils.severe(e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>}
select(nodeAndMapReference.getNodeReference());
1,506,731
public Builder mergeFrom(cn.wildfirechat.proto.WFCMessage.PullUserRequest other) {<NEW_LINE>if (other == cn.wildfirechat.proto.WFCMessage.PullUserRequest.getDefaultInstance())<NEW_LINE>return this;<NEW_LINE>if (requestBuilder_ == null) {<NEW_LINE>if (!other.request_.isEmpty()) {<NEW_LINE>if (request_.isEmpty()) {<NEW_LINE>request_ = other.request_;<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>} else {<NEW_LINE>ensureRequestIsMutable();<NEW_LINE>request_.addAll(other.request_);<NEW_LINE>}<NEW_LINE>onChanged();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!other.request_.isEmpty()) {<NEW_LINE>if (requestBuilder_.isEmpty()) {<NEW_LINE>requestBuilder_.dispose();<NEW_LINE>requestBuilder_ = null;<NEW_LINE>request_ = other.request_;<NEW_LINE><MASK><NEW_LINE>requestBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getRequestFieldBuilder() : null;<NEW_LINE>} else {<NEW_LINE>requestBuilder_.addAllMessages(other.request_);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.mergeUnknownFields(other.getUnknownFields());<NEW_LINE>return this;<NEW_LINE>}
bitField0_ = (bitField0_ & ~0x00000001);
366,542
public R read(JsonReader in) throws IOException {<NEW_LINE>JsonElement jsonElement = Streams.parse(in);<NEW_LINE>JsonElement labelJsonElement = jsonElement.getAsJsonObject().remove(typeFieldName);<NEW_LINE>if (labelJsonElement == null) {<NEW_LINE>throw new JsonParseException("cannot deserialize " + baseType + " because it does not define a field named " + typeFieldName);<NEW_LINE>}<NEW_LINE>String label = labelJsonElement.getAsString();<NEW_LINE>try {<NEW_LINE>String subclassName = baseType.getName() + "$" + label.replaceAll("\\s", "");<NEW_LINE>Class<?> subclass = Class.forName(subclassName);<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>TypeAdapter<R> delegate = (TypeAdapter<R>) gson.getDelegateAdapter(InnerClassTypeAdapterFactory.this, TypeToken.get(subclass));<NEW_LINE>if (delegate == null) {<NEW_LINE>throw new JsonParseException(<MASK><NEW_LINE>}<NEW_LINE>return delegate.fromJsonTree(jsonElement);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new JsonParseException("cannot deserialize " + baseType + " subtype named " + label);<NEW_LINE>}<NEW_LINE>}
"cannot deserialize " + baseType + " subtype named " + label);
671,925
private I_C_RemittanceAdvice toRemittanceAdviceRecord(@NonNull final RemittanceAdvice remittanceAdvice) {<NEW_LINE>final I_C_RemittanceAdvice record = getRecordById(remittanceAdvice.getRemittanceAdviceId());<NEW_LINE>record.setDocStatus(remittanceAdvice.getDocStatus());<NEW_LINE>record.setRemittanceAmt(remittanceAdvice.getRemittedAmountSum());<NEW_LINE>record.setSendAt(TimeUtil.asTimestamp(remittanceAdvice.getSendDate()));<NEW_LINE>record.setServiceFeeAmount(remittanceAdvice.getServiceFeeAmount());<NEW_LINE>record.setPaymentDiscountAmountSum(remittanceAdvice.getPaymentDiscountAmountSum());<NEW_LINE>record.setC_Payment_ID(remittanceAdvice.getPaymentId() != null ? remittanceAdvice.getPaymentId().getRepoId() : record.getC_Payment_ID());<NEW_LINE>record.setIsSOTrx(remittanceAdvice.isSOTrx());<NEW_LINE>record.setAD_Org_ID(remittanceAdvice.getOrgId().getRepoId());<NEW_LINE>record.setI_IsImported(remittanceAdvice.isImported());<NEW_LINE>record.setSource_BPartner_ID(remittanceAdvice.<MASK><NEW_LINE>record.setSource_BP_BankAccount_ID(BPartnerBankAccountId.toRepoId(remittanceAdvice.getSourceBPartnerBankAccountId()));<NEW_LINE>record.setDestintion_BPartner_ID(remittanceAdvice.getDestinationBPartnerId().getRepoId());<NEW_LINE>record.setDestination_BP_BankAccount_ID(BPartnerBankAccountId.toRepoId(remittanceAdvice.getDestinationBPartnerBankAccountId()));<NEW_LINE>record.setDocumentNo(remittanceAdvice.getDocumentNumber());<NEW_LINE>record.setExternalDocumentNo(remittanceAdvice.getExternalDocumentNumber());<NEW_LINE>record.setDateDoc(TimeUtil.asTimestamp(remittanceAdvice.getDocumentDate()));<NEW_LINE>record.setC_DocType_ID(remittanceAdvice.getDocTypeId().getRepoId());<NEW_LINE>record.setRemittanceAmt_Currency_ID(remittanceAdvice.getRemittedAmountCurrencyId().getRepoId());<NEW_LINE>record.setServiceFeeAmount_Currency_ID(CurrencyId.toRepoId(remittanceAdvice.getServiceFeeCurrencyId()));<NEW_LINE>record.setAdditionalNotes(remittanceAdvice.getAdditionalNotes());<NEW_LINE>record.setIsDocumentAcknowledged(remittanceAdvice.isDocumentAcknowledged());<NEW_LINE>record.setCurrenciesReadOnlyFlag(remittanceAdvice.isCurrenciesReadOnlyFlag());<NEW_LINE>record.setProcessed(remittanceAdvice.isProcessed());<NEW_LINE>return record;<NEW_LINE>}
getSourceBPartnerId().getRepoId());
579,542
private static String createTokenByGenerator(Controller controller, String tokenName, int secondsOfTimeOut) {<NEW_LINE>if (secondsOfTimeOut < Const.MIN_SECONDS_OF_TOKEN_TIME_OUT) {<NEW_LINE>secondsOfTimeOut = Const.MIN_SECONDS_OF_TOKEN_TIME_OUT;<NEW_LINE>}<NEW_LINE>String tokenId = null;<NEW_LINE>Token token = null;<NEW_LINE>int safeCounter = 8;<NEW_LINE>do {<NEW_LINE>if (safeCounter-- == 0) {<NEW_LINE>throw new RuntimeException("Can not create tokenId.");<NEW_LINE>}<NEW_LINE>tokenId = String.<MASK><NEW_LINE>token = new Token(tokenId, System.currentTimeMillis() + (secondsOfTimeOut * 1000));<NEW_LINE>} while (tokenId == null || tokenCache.contains(token));<NEW_LINE>controller.setAttr(tokenName, tokenId);<NEW_LINE>tokenCache.put(token);<NEW_LINE>createTokenHiddenField(controller, tokenName, tokenId);<NEW_LINE>return tokenId;<NEW_LINE>}
valueOf(random.nextLong());
1,089,179
public ChangeConfigResponse changeMasterConfig(String host, int port, boolean isAdd, boolean useHost, String hostAddrToAdd) throws Exception {<NEW_LINE>String masterUuid = null;<NEW_LINE>if (isAdd || !useHost) {<NEW_LINE>masterUuid = getMasterUUID(host, port);<NEW_LINE>if (masterUuid == null) {<NEW_LINE>throw new IllegalArgumentException("Invalid master host/port of " + host + "/" + port + " - could not get it's uuid.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.info("Sending changeConfig : Target host:port={}:{} at uuid={}, add={}, useHost={}.", host, <MASK><NEW_LINE>long timeout = getDefaultAdminOperationTimeoutMs();<NEW_LINE>ChangeConfigResponse resp = null;<NEW_LINE>boolean changeConfigDone;<NEW_LINE>// It is possible that we might need different addresses for reaching from the client<NEW_LINE>// than the one the DB nodes use to communicate. If the client provides an address<NEW_LINE>// to add to the config explicitly, use that.<NEW_LINE>String hostAddr = hostAddrToAdd == null ? host : hostAddrToAdd;<NEW_LINE>do {<NEW_LINE>changeConfigDone = true;<NEW_LINE>try {<NEW_LINE>Deferred<ChangeConfigResponse> d = asyncClient.changeMasterConfig(hostAddr, port, masterUuid, isAdd, useHost);<NEW_LINE>resp = d.join(timeout);<NEW_LINE>if (!resp.hasError()) {<NEW_LINE>asyncClient.updateMasterAdresses(host, port, isAdd);<NEW_LINE>}<NEW_LINE>} catch (TabletServerErrorException tsee) {<NEW_LINE>String leaderUuid = waitAndGetLeaderMasterUUID(timeout);<NEW_LINE>LOG.info("Hit tserver error {}, leader is {}.", tsee.getTServerError().toString(), leaderUuid);<NEW_LINE>if (tsee.getTServerError().getCode() == TserverTypes.TabletServerErrorPB.Code.LEADER_NEEDS_STEP_DOWN) {<NEW_LINE>stepDownMasterLeaderAndWaitForNewLeader(leaderUuid);<NEW_LINE>changeConfigDone = false;<NEW_LINE>LOG.info("Retrying changeConfig because it received LEADER_NEEDS_STEP_DOWN error code.");<NEW_LINE>} else {<NEW_LINE>throw tsee;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} while (!changeConfigDone);<NEW_LINE>return resp;<NEW_LINE>}
port, masterUuid, isAdd, useHost);
785,098
public ListNamedShadowsForThingResult listNamedShadowsForThing(ListNamedShadowsForThingRequest listNamedShadowsForThingRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listNamedShadowsForThingRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListNamedShadowsForThingRequest> request = null;<NEW_LINE>Response<ListNamedShadowsForThingResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListNamedShadowsForThingRequestMarshaller().marshall(listNamedShadowsForThingRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<ListNamedShadowsForThingResult, JsonUnmarshallerContext> unmarshaller = new ListNamedShadowsForThingResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<ListNamedShadowsForThingResult> responseHandler = new JsonResponseHandler<ListNamedShadowsForThingResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
735,092
final UpdateVoiceConnectorResult executeUpdateVoiceConnector(UpdateVoiceConnectorRequest updateVoiceConnectorRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateVoiceConnectorRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateVoiceConnectorRequest> request = null;<NEW_LINE>Response<UpdateVoiceConnectorResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new UpdateVoiceConnectorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateVoiceConnectorRequest));<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, "Chime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateVoiceConnector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateVoiceConnectorResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateVoiceConnectorResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
583,778
public Asset<?> create(RequestParams requestParams, Asset<?> asset) {<NEW_LINE>try {<NEW_LINE>if (isRestrictedUser()) {<NEW_LINE>throw new WebApplicationException(FORBIDDEN);<NEW_LINE>}<NEW_LINE>if (asset == null) {<NEW_LINE>LOG.finer("No asset in request");<NEW_LINE>throw new WebApplicationException(BAD_REQUEST);<NEW_LINE>}<NEW_LINE>// If there was no realm provided (create was called by regular user in manager UI), use the auth realm<NEW_LINE>if (asset.getRealm() == null || asset.getRealm().length() == 0) {<NEW_LINE>asset.setRealm(getAuthenticatedTenant().getRealm());<NEW_LINE>} else if (!isTenantActiveAndAccessible(asset.getRealm())) {<NEW_LINE>LOG.info("Forbidden access for user '" + getUsername() + "', can't create: " + asset);<NEW_LINE>throw new WebApplicationException(FORBIDDEN);<NEW_LINE>}<NEW_LINE>Asset<?> newAsset = ValueUtil.clone(asset);<NEW_LINE>// Allow client to set identifier<NEW_LINE>if (asset.getId() != null) {<NEW_LINE>newAsset.setId(asset.getId());<NEW_LINE>}<NEW_LINE>// TODO: Decide on the below - clients should ensure the asset conforms to the asset descriptor and we shouldn't do any 'magic' here<NEW_LINE>// AssetModelUtil.getAssetDescriptor(asset.getType()).ifPresent(assetDescriptor -> {<NEW_LINE>//<NEW_LINE>// // Add meta items to well known attributes if not present<NEW_LINE>// newAsset.getAttributes().stream().forEach(assetAttribute -> {<NEW_LINE>// if (assetDescriptor.getAttributeDescriptors() != null) {<NEW_LINE>// Arrays.stream(assetDescriptor.getAttributeDescriptors())<NEW_LINE>// .filter(attrDescriptor -> attrDescriptor.getAttributeName().equals(assetAttribute.getName()))<NEW_LINE>// .findFirst()<NEW_LINE>// .ifPresent(defaultAttribute -> {<NEW_LINE>// if (defaultAttribute.getMetaItemDescriptors() != null) {<NEW_LINE>// assetAttribute.addMeta(<NEW_LINE>// Arrays.stream(defaultAttribute.getMetaItemDescriptors())<NEW_LINE>// .filter(metaItemDescriptor -> !assetAttribute.hasMetaItem(metaItemDescriptor))<NEW_LINE>// .map(MetaItem::new)<NEW_LINE>// .toArray(MetaItem[]::new)<NEW_LINE>// );<NEW_LINE>// }<NEW_LINE>// });<NEW_LINE>// }<NEW_LINE>// });<NEW_LINE>//<NEW_LINE>// // Add attributes for this well known asset if not present<NEW_LINE>// if (assetDescriptor.getAttributeDescriptors() != null) {<NEW_LINE>// newAsset.addAttributes(<NEW_LINE>// Arrays.stream(assetDescriptor.getAttributeDescriptors()).filter(attributeDescriptor -><NEW_LINE>// !newAsset.hasAttribute(attributeDescriptor.getAttributeName())).map(Attribute::new).toArray(Attribute[]::new)<NEW_LINE>// );<NEW_LINE>// }<NEW_LINE>// });<NEW_LINE>return assetStorageService.merge(newAsset);<NEW_LINE>} catch (IllegalStateException ex) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new WebApplicationException(ex, BAD_REQUEST);
854,635
private Single<PathConverter> upload(Set<Path> files) {<NEW_LINE>if (files.isEmpty()) {<NEW_LINE>return Single.just(PathConverter.NO_CONVERSION);<NEW_LINE>}<NEW_LINE>RequestMetadata metadata = TracingMetadataUtils.buildMetadata(<MASK><NEW_LINE>RemoteActionExecutionContext context = RemoteActionExecutionContext.createForBES(metadata);<NEW_LINE>return Single.using(remoteCache::retain, remoteCache -> Flowable.fromIterable(files).map(file -> {<NEW_LINE>try {<NEW_LINE>return readPathMetadata(file);<NEW_LINE>} catch (IOException e) {<NEW_LINE>reporterUploadError(e);<NEW_LINE>return new PathMetadata(file, /*digest=*/<NEW_LINE>null, /*directory=*/<NEW_LINE>false, /*remote=*/<NEW_LINE>false);<NEW_LINE>}<NEW_LINE>}).collect(Collectors.toList()).flatMap(paths -> queryRemoteCache(remoteCache, context, paths)).flatMap(paths -> uploadLocalFiles(remoteCache, context, paths)).map(paths -> new PathConverterImpl(remoteServerInstanceName, paths, omittedFiles)), RemoteCache::release);<NEW_LINE>}
buildRequestId, commandId, "bes-upload", null);
1,227,608
public static QueryMovieSchedulesResponse unmarshall(QueryMovieSchedulesResponse queryMovieSchedulesResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryMovieSchedulesResponse.setRequestId(_ctx.stringValue("QueryMovieSchedulesResponse.RequestId"));<NEW_LINE>queryMovieSchedulesResponse.setLogsId(_ctx.stringValue("QueryMovieSchedulesResponse.LogsId"));<NEW_LINE>queryMovieSchedulesResponse.setSubCode(_ctx.stringValue("QueryMovieSchedulesResponse.SubCode"));<NEW_LINE>queryMovieSchedulesResponse.setSubMessage(_ctx.stringValue("QueryMovieSchedulesResponse.SubMessage"));<NEW_LINE>queryMovieSchedulesResponse.setCode(_ctx.stringValue("QueryMovieSchedulesResponse.Code"));<NEW_LINE>queryMovieSchedulesResponse.setSuccess(_ctx.booleanValue("QueryMovieSchedulesResponse.Success"));<NEW_LINE>queryMovieSchedulesResponse.setMessage(_ctx.stringValue("QueryMovieSchedulesResponse.Message"));<NEW_LINE>List<Schedule> schedules = new ArrayList<Schedule>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryMovieSchedulesResponse.Schedules.Length"); i++) {<NEW_LINE>Schedule schedule = new Schedule();<NEW_LINE>schedule.setCinemaId(_ctx.longValue<MASK><NEW_LINE>schedule.setSessionEndingTime(_ctx.stringValue("QueryMovieSchedulesResponse.Schedules[" + i + "].SessionEndingTime"));<NEW_LINE>schedule.setHallName(_ctx.stringValue("QueryMovieSchedulesResponse.Schedules[" + i + "].HallName"));<NEW_LINE>schedule.setId(_ctx.longValue("QueryMovieSchedulesResponse.Schedules[" + i + "].Id"));<NEW_LINE>schedule.setIsExpired(_ctx.booleanValue("QueryMovieSchedulesResponse.Schedules[" + i + "].IsExpired"));<NEW_LINE>schedule.setMaxCanBuy(_ctx.longValue("QueryMovieSchedulesResponse.Schedules[" + i + "].MaxCanBuy"));<NEW_LINE>schedule.setPrice(_ctx.longValue("QueryMovieSchedulesResponse.Schedules[" + i + "].Price"));<NEW_LINE>schedule.setScheduleArea(_ctx.stringValue("QueryMovieSchedulesResponse.Schedules[" + i + "].ScheduleArea"));<NEW_LINE>schedule.setSectionId(_ctx.stringValue("QueryMovieSchedulesResponse.Schedules[" + i + "].SectionId"));<NEW_LINE>schedule.setServiceFee(_ctx.longValue("QueryMovieSchedulesResponse.Schedules[" + i + "].ServiceFee"));<NEW_LINE>schedule.setReleaseDate(_ctx.stringValue("QueryMovieSchedulesResponse.Schedules[" + i + "].ReleaseDate"));<NEW_LINE>schedule.setMovieId(_ctx.longValue("QueryMovieSchedulesResponse.Schedules[" + i + "].MovieId"));<NEW_LINE>schedule.setSessionStartingTime(_ctx.stringValue("QueryMovieSchedulesResponse.Schedules[" + i + "].SessionStartingTime"));<NEW_LINE>schedule.setMovieVersion(_ctx.stringValue("QueryMovieSchedulesResponse.Schedules[" + i + "].MovieVersion"));<NEW_LINE>schedules.add(schedule);<NEW_LINE>}<NEW_LINE>queryMovieSchedulesResponse.setSchedules(schedules);<NEW_LINE>return queryMovieSchedulesResponse;<NEW_LINE>}
("QueryMovieSchedulesResponse.Schedules[" + i + "].CinemaId"));
850,727
public void verifyBOMAssignment(@NonNull final I_PP_Product_Planning planning, @NonNull final I_PP_Product_BOM productBom) {<NEW_LINE>if (!planning.isAttributeDependant()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final AttributeSetInstanceId planningASIId = AttributeSetInstanceId.ofRepoIdOrNone(planning.getM_AttributeSetInstance_ID());<NEW_LINE>final AttributesKey planningAttributesKeys = AttributesKeys.createAttributesKeyFromASIStorageAttributes(planningASIId).orElse(AttributesKey.NONE);<NEW_LINE>if (planningAttributesKeys.isNone()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final AttributeSetInstanceId productBomASIId = AttributeSetInstanceId.ofRepoIdOrNone(productBom.getM_AttributeSetInstance_ID());<NEW_LINE>final AttributesKey productBOMAttributesKeys = AttributesKeys.createAttributesKeyFromASIStorageAttributes(productBomASIId<MASK><NEW_LINE>if (!productBOMAttributesKeys.contains(planningAttributesKeys)) {<NEW_LINE>throw new AdempiereException(AdMessageKey.of(PP_PRODUCT_PLANNING_BOM_ATTR_ERROR));<NEW_LINE>}<NEW_LINE>}
).orElse(AttributesKey.NONE);
1,331,230
final DeactivateAnomalyDetectorResult executeDeactivateAnomalyDetector(DeactivateAnomalyDetectorRequest deactivateAnomalyDetectorRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deactivateAnomalyDetectorRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeactivateAnomalyDetectorRequest> request = null;<NEW_LINE>Response<DeactivateAnomalyDetectorResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeactivateAnomalyDetectorRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deactivateAnomalyDetectorRequest));<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, "LookoutMetrics");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeactivateAnomalyDetectorResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeactivateAnomalyDetectorResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeactivateAnomalyDetector");
837,228
public GroupIdentifier unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GroupIdentifier groupIdentifier = new GroupIdentifier();<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("GroupName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>groupIdentifier.setGroupName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("GroupArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>groupIdentifier.setGroupArn(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 groupIdentifier;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
577,086
public void batchPackets(Player[] players, DataPacket[] packets, boolean forceSync) {<NEW_LINE>if (players == null || packets == null || players.length == 0 || packets.length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Timings.playerNetworkSendTimer.startTiming();<NEW_LINE>byte[][] payload = new byte[packets.length * 2][];<NEW_LINE>int size = 0;<NEW_LINE>for (int i = 0; i < packets.length; i++) {<NEW_LINE>DataPacket p = packets[i];<NEW_LINE>if (!p.isEncoded) {<NEW_LINE>p.encode();<NEW_LINE>}<NEW_LINE>byte[] buf = p.getBuffer();<NEW_LINE>payload[i * 2] = Binary.writeUnsignedVarInt(buf.length);<NEW_LINE>payload[i * 2 + 1] = buf;<NEW_LINE>packets[i] = null;<NEW_LINE>size += payload[i * 2].length;<NEW_LINE>size += payload[i * 2 + 1].length;<NEW_LINE>}<NEW_LINE>List<String> targets = new ArrayList<>();<NEW_LINE>for (Player p : players) {<NEW_LINE>if (p.isConnected()) {<NEW_LINE>targets.add(this.identifier.get(p.rawHashCode()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!forceSync && this.networkCompressionAsync) {<NEW_LINE>this.getScheduler().scheduleAsyncTask(new CompressBatchedTask(payload, targets, this.networkCompressionLevel));<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>byte[] data = Binary.appendBytes(payload);<NEW_LINE>this.broadcastPacketsCallback(Zlib.deflate(data<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Timings.playerNetworkSendTimer.stopTiming();<NEW_LINE>}
, this.networkCompressionLevel), targets);
699,657
private void installModules(Collection<String> artifacts, String jsonProject) {<NEW_LINE>final Set<String> dependencies = new HashSet<>();<NEW_LINE>// process mvnDependencies from CWD package.json<NEW_LINE>if (jsonProject != null) {<NEW_LINE>try {<NEW_LINE>processJson(new File<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>fatal(e.getMessage());<NEW_LINE>}<NEW_LINE>// crawl node modules<NEW_LINE>if (!baseDir.equals(cwd)) {<NEW_LINE>if (baseDir.exists() && baseDir.isDirectory()) {<NEW_LINE>try {<NEW_LINE>processModules(baseDir, dependencies);<NEW_LINE>} catch (IOException e) {<NEW_LINE>fatal(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>File libs = new File(baseDir, ".lib");<NEW_LINE>try {<NEW_LINE>Resolver resolver = new Resolver();<NEW_LINE>// lookup root<NEW_LINE>String root = "io.reactiverse:es4x:" + VERSIONS.getProperty("es4x");<NEW_LINE>for (String el : dependencies) {<NEW_LINE>// ensure we respect the wish of the user<NEW_LINE>if (el.startsWith("io.reactiverse:es4x:")) {<NEW_LINE>root = el;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Artifact a : resolver.resolve(root, dependencies)) {<NEW_LINE>if (!libs.exists()) {<NEW_LINE>if (!libs.mkdirs()) {<NEW_LINE>fatal(String.format("Failed to mkdirs '%s'.", libs));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addIfMissing(artifacts, ".." + File.separator + ".lib" + File.separator + a.getFile().getName());<NEW_LINE>File destination = new File(libs, a.getFile().getName());<NEW_LINE>// locate core jar<NEW_LINE>if ("io.vertx".equals(a.getGroupId()) && "vertx-core".equals(a.getArtifactId())) {<NEW_LINE>coreJar = a.getFile();<NEW_LINE>}<NEW_LINE>if (!destination.exists()) {<NEW_LINE>if (link) {<NEW_LINE>Files.createSymbolicLink(destination.toPath(), a.getFile().toPath());<NEW_LINE>} else {<NEW_LINE>Files.copy(a.getFile().toPath(), destination.toPath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>fatal(e.getMessage());<NEW_LINE>}<NEW_LINE>}
(cwd, jsonProject), dependencies);
1,826,156
public boolean addReplica(ReplicaId replicaId) {<NEW_LINE>if (partitionToPartitionInfo.containsKey(replicaId.getPartitionId())) {<NEW_LINE>logger.warn("Partition {} already exists in replication manager, rejecting adding replica request.", replicaId.getPartitionId());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>rwLock.writeLock().lock();<NEW_LINE>try {<NEW_LINE>List<? extends ReplicaId> peerReplicas = replicaId.getPeerReplicaIds();<NEW_LINE>List<RemoteReplicaInfo> <MASK><NEW_LINE>if (!peerReplicas.isEmpty()) {<NEW_LINE>remoteReplicaInfos = createRemoteReplicaInfos(peerReplicas, replicaId);<NEW_LINE>updatePartitionInfoMaps(remoteReplicaInfos, replicaId);<NEW_LINE>}<NEW_LINE>logger.info("Assigning thread for {}", replicaId.getPartitionId());<NEW_LINE>addRemoteReplicaInfoToReplicaThread(remoteReplicaInfos, true);<NEW_LINE>// No need to update persistor to explicitly persist tokens for new replica because background persistor will<NEW_LINE>// periodically persist all tokens including new added replica's<NEW_LINE>logger.info("{} is successfully added into replication manager", replicaId.getPartitionId());<NEW_LINE>} finally {<NEW_LINE>rwLock.writeLock().unlock();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
remoteReplicaInfos = new ArrayList<>();
497,599
private static void compute(MeasureComputerContext context, String metricKey) {<NEW_LINE>var component = context.getComponent();<NEW_LINE>if (component.getType() == Component.Type.FILE) {<NEW_LINE>// FILE doesn't required any aggregation. Relevant metrics should be provided by the sensor.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>var existingMeasure = context.getMeasure(metricKey);<NEW_LINE>if (existingMeasure != null) {<NEW_LINE>// For all other component types (e.g. PROJECT, MODULE, DIRECTORY) the<NEW_LINE>// measurement <metricKey> should not be calculated manually (e.g. in the sensors).<NEW_LINE>// Otherwise there is a chance, that your custom calculation won't work properly for<NEW_LINE>// multi-module projects.<NEW_LINE>LOG.debug("Component {}: measure {} already calculated, value = {}", component.getKey(), metricKey, existingMeasure.getIntValue());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Iterable<Measure> childrenMeasures = context.getChildrenMeasures(metricKey);<NEW_LINE>if (childrenMeasures == null || !childrenMeasures.iterator().hasNext()) {<NEW_LINE>// There is always a chance, that required metrics were not calculated for this particular component<NEW_LINE>// (e.g. one of modules in a multi-module project doesn't contain any C/C++ data at all).<NEW_LINE>// So don't complain about the missing data, but just ignore such components.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>var aggregation = 0;<NEW_LINE>for (var childMeasure : childrenMeasures) {<NEW_LINE>if (childMeasure != null) {<NEW_LINE>aggregation += childMeasure.getIntValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.debug("Component {}: add measure {}, value {}", component.getKey(), metricKey, aggregation);<NEW_LINE><MASK><NEW_LINE>}
context.addMeasure(metricKey, aggregation);
1,361,953
final DisassociateHealthCheckResult executeDisassociateHealthCheck(DisassociateHealthCheckRequest disassociateHealthCheckRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateHealthCheckRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateHealthCheckRequest> request = null;<NEW_LINE>Response<DisassociateHealthCheckResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateHealthCheckRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Shield");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateHealthCheck");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateHealthCheckResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateHealthCheckResultJsonUnmarshaller());<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(disassociateHealthCheckRequest));
549,752
final DescribeFleetPortSettingsResult executeDescribeFleetPortSettings(DescribeFleetPortSettingsRequest describeFleetPortSettingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeFleetPortSettingsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeFleetPortSettingsRequest> request = null;<NEW_LINE>Response<DescribeFleetPortSettingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeFleetPortSettingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeFleetPortSettingsRequest));<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, "GameLift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeFleetPortSettings");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeFleetPortSettingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeFleetPortSettingsResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,192,358
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>Toolbar toolbar = view.findViewById(R.id.payments_recovery_phrase_confirm_fragment_toolbar);<NEW_LINE>EditText word1 = view.findViewById(R.id.payments_recovery_phrase_confirm_fragment_word_1);<NEW_LINE>EditText word2 = view.<MASK><NEW_LINE>View seePhraseAgain = view.findViewById(R.id.payments_recovery_phrase_confirm_fragment_see_again);<NEW_LINE>View done = view.findViewById(R.id.payments_recovery_phrase_confirm_fragment_done);<NEW_LINE>TextInputLayout wordWrapper1 = view.findViewById(R.id.payments_recovery_phrase_confirm_fragment_word1_wrapper);<NEW_LINE>TextInputLayout wordWrapper2 = view.findViewById(R.id.payments_recovery_phrase_confirm_fragment_word2_wrapper);<NEW_LINE>PaymentsRecoveryPhraseConfirmFragmentArgs args = PaymentsRecoveryPhraseConfirmFragmentArgs.fromBundle(requireArguments());<NEW_LINE>validWordCheckMark = AppCompatResources.getDrawable(requireContext(), R.drawable.ic_check_circle_24);<NEW_LINE>invalidWordX = AppCompatResources.getDrawable(requireContext(), R.drawable.ic_circle_x_24);<NEW_LINE>DrawableCompat.setTint(validWordCheckMark, ContextCompat.getColor(requireContext(), R.color.signal_accent_green));<NEW_LINE>DrawableCompat.setTint(invalidWordX, ContextCompat.getColor(requireContext(), R.color.signal_alert_primary));<NEW_LINE>PaymentsRecoveryPhraseConfirmViewModel viewModel = ViewModelProviders.of(requireActivity()).get(PaymentsRecoveryPhraseConfirmViewModel.class);<NEW_LINE>toolbar.setNavigationOnClickListener(v -> Navigation.findNavController(requireView()).popBackStack());<NEW_LINE>word1.addTextChangedListener(new AfterTextChanged(e -> viewModel.validateWord1(e.toString())));<NEW_LINE>word2.addTextChangedListener(new AfterTextChanged(e -> viewModel.validateWord2(e.toString())));<NEW_LINE>seePhraseAgain.setOnClickListener(v -> Navigation.findNavController(requireView()).popBackStack());<NEW_LINE>done.setOnClickListener(v -> {<NEW_LINE>SignalStore.paymentsValues().setUserConfirmedMnemonic(true);<NEW_LINE>ViewUtil.hideKeyboard(requireContext(), view);<NEW_LINE>Toast.makeText(requireContext(), R.string.PaymentRecoveryPhraseConfirmFragment__recovery_phrase_confirmed, Toast.LENGTH_SHORT).show();<NEW_LINE>if (args.getFinishOnConfirm()) {<NEW_LINE>requireActivity().setResult(Activity.RESULT_OK);<NEW_LINE>requireActivity().finish();<NEW_LINE>} else {<NEW_LINE>Navigation.findNavController(view).popBackStack(R.id.paymentsHome, false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>viewModel.getViewState().observe(getViewLifecycleOwner(), viewState -> {<NEW_LINE>updateValidity(word1, viewState.isWord1Valid());<NEW_LINE>updateValidity(word2, viewState.isWord2Valid());<NEW_LINE>done.setEnabled(viewState.areAllWordsValid());<NEW_LINE>String hint1 = getString(R.string.PaymentRecoveryPhraseConfirmFragment__word_d, viewState.getWord1Index() + 1);<NEW_LINE>String hint2 = getString(R.string.PaymentRecoveryPhraseConfirmFragment__word_d, viewState.getWord2Index() + 1);<NEW_LINE>wordWrapper1.setHint(hint1);<NEW_LINE>wordWrapper2.setHint(hint2);<NEW_LINE>});<NEW_LINE>viewModel.updateRandomIndices();<NEW_LINE>}
findViewById(R.id.payments_recovery_phrase_confirm_fragment_word_2);
1,420,534
private HttpDataSource.Factory buildHttpDataSourceFactory(DefaultBandwidthMeter bandwidthMeter, OCFile file, Account account) {<NEW_LINE>if (file.isDown()) {<NEW_LINE>return new DefaultHttpDataSourceFactory(MainApp.Companion.getUserAgent(), bandwidthMeter);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>OwnCloudCredentials credentials = AccountUtils.getCredentialsForAccount(MainApp.Companion.getAppContext(), account);<NEW_LINE>String login = credentials.getUsername();<NEW_LINE>String password = credentials.getAuthToken();<NEW_LINE>Map<String, String> params = new HashMap<String, String>(1);<NEW_LINE>if (credentials instanceof OwnCloudBasicCredentials) {<NEW_LINE>// Basic auth<NEW_LINE>String cred = login + ":" + password;<NEW_LINE>String auth = "Basic " + Base64.encodeToString(cred.getBytes(), Base64.URL_SAFE);<NEW_LINE>params.put("Authorization", auth);<NEW_LINE>} else if (credentials instanceof OwnCloudBearerCredentials) {<NEW_LINE>// OAuth<NEW_LINE>String bearerToken = credentials.getAuthToken();<NEW_LINE>String auth = "Bearer " + bearerToken;<NEW_LINE>params.put("Authorization", auth);<NEW_LINE>}<NEW_LINE>return new CustomHttpDataSourceFactory(MainApp.Companion.<MASK><NEW_LINE>} catch (AuthenticatorException | IOException | OperationCanceledException e) {<NEW_LINE>Timber.e(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
getUserAgent(), bandwidthMeter, params);
1,273,449
private void pollingConsumer(MessageChannel channel) {<NEW_LINE>PollingConsumer pollingConsumer = new PollingConsumer((PollableChannel) channel, this.handler);<NEW_LINE>if (this.pollerMetadata == null) {<NEW_LINE>this.pollerMetadata = PollerMetadata.getDefaultPollerMetadata(this.beanFactory);<NEW_LINE>Assert.notNull(this.pollerMetadata, () -> "No poller has been defined for endpoint '" + this.beanName + "', and no default poller is available within the context.");<NEW_LINE>}<NEW_LINE>pollingConsumer.setTaskExecutor(this.pollerMetadata.getTaskExecutor());<NEW_LINE>pollingConsumer.setTrigger(this.pollerMetadata.getTrigger());<NEW_LINE>pollingConsumer.setAdviceChain(this.pollerMetadata.getAdviceChain());<NEW_LINE>pollingConsumer.setMaxMessagesPerPoll(this.pollerMetadata.getMaxMessagesPerPoll());<NEW_LINE>pollingConsumer.setErrorHandler(<MASK><NEW_LINE>pollingConsumer.setReceiveTimeout(this.pollerMetadata.getReceiveTimeout());<NEW_LINE>pollingConsumer.setTransactionSynchronizationFactory(this.pollerMetadata.getTransactionSynchronizationFactory());<NEW_LINE>pollingConsumer.setBeanClassLoader(this.beanClassLoader);<NEW_LINE>pollingConsumer.setBeanFactory(this.beanFactory);<NEW_LINE>this.endpoint = pollingConsumer;<NEW_LINE>}
this.pollerMetadata.getErrorHandler());
1,132,119
protected ThriftMessage decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception {<NEW_LINE>if (!buffer.readable()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>short firstByte = buffer.getUnsignedByte(0);<NEW_LINE>if (firstByte >= 0x80) {<NEW_LINE>ChannelBuffer messageBuffer = tryDecodeUnframedMessage(ctx, channel, buffer, inputProtocolFactory);<NEW_LINE>if (messageBuffer == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// A non-zero MSB for the first byte of the message implies the message starts with a<NEW_LINE>// protocol id (and thus it is unframed).<NEW_LINE>return new ThriftMessage(messageBuffer, ThriftTransportType.UNFRAMED);<NEW_LINE>} else if (buffer.readableBytes() < MESSAGE_FRAME_SIZE) {<NEW_LINE>// Expecting a framed message, but not enough bytes available to read the frame size<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>ChannelBuffer messageBuffer = tryDecodeFramedMessage(<MASK><NEW_LINE>if (messageBuffer == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Messages with a zero MSB in the first byte are framed messages<NEW_LINE>return new ThriftMessage(messageBuffer, ThriftTransportType.FRAMED);<NEW_LINE>}<NEW_LINE>}
ctx, channel, buffer, true);
850,450
private static Map<String, GHEvent> createEventMap() {<NEW_LINE>HashMap<String, GHEvent> map = new HashMap<>();<NEW_LINE>map.put("CommitCommentEvent", GHEvent.COMMIT_COMMENT);<NEW_LINE>map.put("CreateEvent", GHEvent.CREATE);<NEW_LINE>map.put("DeleteEvent", GHEvent.DELETE);<NEW_LINE>map.put("ForkEvent", GHEvent.FORK);<NEW_LINE>map.put("GollumEvent", GHEvent.GOLLUM);<NEW_LINE>map.put("IssueCommentEvent", GHEvent.ISSUE_COMMENT);<NEW_LINE>map.put("IssuesEvent", GHEvent.ISSUES);<NEW_LINE>map.put("MemberEvent", GHEvent.MEMBER);<NEW_LINE>map.put("PublicEvent", GHEvent.PUBLIC);<NEW_LINE>map.put("PullRequestEvent", GHEvent.PULL_REQUEST);<NEW_LINE>map.put("PullRequestReviewEvent", GHEvent.PULL_REQUEST_REVIEW);<NEW_LINE>map.put("PullRequestReviewCommentEvent", GHEvent.PULL_REQUEST_REVIEW_COMMENT);<NEW_LINE>map.put("PushEvent", GHEvent.PUSH);<NEW_LINE>map.put("ReleaseEvent", GHEvent.RELEASE);<NEW_LINE>map.<MASK><NEW_LINE>return Collections.unmodifiableMap(map);<NEW_LINE>}
put("WatchEvent", GHEvent.WATCH);
222,868
protected void throwOrLogDisposedException(final Long disposedTS) {<NEW_LINE>final StringBuilder message = new StringBuilder();<NEW_LINE>message.append("Accessing an already disposed AttributeStorage shall not be allowed");<NEW_LINE>message.append("\n Storage: " + this);<NEW_LINE>message.append("\n Disposed on: " + (disposedTS != null && disposedTS > 0 ? new Date(disposedTS).toString() : "<time unknown>"));<NEW_LINE>int counter = 1;<NEW_LINE>message.append("\n Direct children: ");<NEW_LINE>for (final IAttributeStorage child : getChildAttributeStorages(false)) {<NEW_LINE>message.append("\n\t " + counter + ": " + child);<NEW_LINE>}<NEW_LINE>counter = 1;<NEW_LINE>message.append("\n Parents: ");<NEW_LINE>IAttributeStorage parentAttributeStorage = getParentAttributeStorage();<NEW_LINE>while (parentAttributeStorage != null && !NullAttributeStorage.isNull(parentAttributeStorage)) {<NEW_LINE>message.append("\n\t " + counter + ": " + parentAttributeStorage);<NEW_LINE>parentAttributeStorage = parentAttributeStorage.getParentAttributeStorage();<NEW_LINE>}<NEW_LINE>final HUException ex = new <MASK><NEW_LINE>if (HUConstants.isAttributeStorageFailOnDisposed()) {<NEW_LINE>throw ex;<NEW_LINE>} else {<NEW_LINE>logger.warn(ex.getLocalizedMessage(), ex);<NEW_LINE>}<NEW_LINE>}
HUException(message.toString());