idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
508,045
public Decision canForceAllocatePrimary(ShardRouting shardRouting, RoutingNode node, RoutingAllocation allocation) {<NEW_LINE>assert shardRouting.primary() : "must not call canForceAllocatePrimary on a non-primary shard routing " + shardRouting;<NEW_LINE>if (allocation.shouldIgnoreShardForNode(shardRouting.shardId(), node.nodeId())) {<NEW_LINE>return Decision.NO;<NEW_LINE>}<NEW_LINE>Decision.Multi ret = new Decision.Multi();<NEW_LINE>for (AllocationDecider decider : allocations) {<NEW_LINE>Decision decision = decider.<MASK><NEW_LINE>// short track if a NO is returned.<NEW_LINE>if (decision == Decision.NO) {<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("Shard [{}] can not be forcefully allocated to node [{}] due to [{}].", shardRouting.shardId(), node.nodeId(), decider.getClass().getSimpleName());<NEW_LINE>}<NEW_LINE>if (allocation.debugDecision() == false) {<NEW_LINE>return decision;<NEW_LINE>} else {<NEW_LINE>ret.add(decision);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>addDecision(ret, decision, allocation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
canForceAllocatePrimary(shardRouting, node, allocation);
368,176
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "c1,c2".split(",");<NEW_LINE>String epl = "@name('s0') select " + "count(intBoxed, boolPrimitive) as c1," + "count(distinct intBoxed, boolPrimitive) as c2 " + "from SupportBean#length(3)";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.sendEventBean(makeBean(100, true));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 1L, 1L });<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(makeBean(100, true));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 2L, 1L });<NEW_LINE>env.sendEventBean(makeBean(101, false));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 2L, 1L });<NEW_LINE>env.sendEventBean(makeBean(102, true));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 2L, 2L });<NEW_LINE>env.sendEventBean(makeBean(103, false));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 1L, 1L });<NEW_LINE>env.sendEventBean(makeBean(104, false));<NEW_LINE>env.assertPropsNew("s0", fields, new Object<MASK><NEW_LINE>env.sendEventBean(makeBean(105, false));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 0L, 0L });<NEW_LINE>env.undeployAll();<NEW_LINE>}
[] { 1L, 1L });
755,188
public Query rewrite(IndexReader reader) throws IOException {<NEW_LINE>ScoreTermQueue q = new ScoreTermQueue(MAX_NUM_TERMS);<NEW_LINE>// load up the list of possible terms<NEW_LINE>for (FieldVals f : fieldVals) {<NEW_LINE>addTerms(reader, f, q);<NEW_LINE>}<NEW_LINE>BooleanQuery.Builder bq = new BooleanQuery.Builder();<NEW_LINE>// create BooleanQueries to hold the variants for each token/field pair and ensure it<NEW_LINE>// has no coord factor<NEW_LINE>// Step 1: sort the termqueries by term/field<NEW_LINE>HashMap<Term, ArrayList<ScoreTerm>> variantQueries = new HashMap<>();<NEW_LINE>int size = q.size();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>ScoreTerm st = q.pop();<NEW_LINE>if (st != null) {<NEW_LINE>ArrayList<ScoreTerm> l = variantQueries.computeIfAbsent(st.fuzziedSourceTerm, k -> new ArrayList<>());<NEW_LINE>l.add(st);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Step 2: Organize the sorted termqueries into zero-coord scoring boolean queries<NEW_LINE>for (ArrayList<ScoreTerm> variants : variantQueries.values()) {<NEW_LINE>if (variants.size() == 1) {<NEW_LINE>// optimize where only one selected variant<NEW_LINE>ScoreTerm st = variants.get(0);<NEW_LINE>Query tq = newTermQuery(reader, st.term);<NEW_LINE>// set the boost to a mix of IDF and score<NEW_LINE>bq.add(new BoostQuery(tq, st.score), BooleanClause.Occur.SHOULD);<NEW_LINE>} else {<NEW_LINE>BooleanQuery.Builder termVariants = new BooleanQuery.Builder();<NEW_LINE>for (ScoreTerm st : variants) {<NEW_LINE>// found a match<NEW_LINE>Query tq = newTermQuery(reader, st.term);<NEW_LINE>// set the boost using the ScoreTerm's score<NEW_LINE>// add to query<NEW_LINE>termVariants.// add to query<NEW_LINE>add(// add to query<NEW_LINE>new BoostQuery(tq, st.score<MASK><NEW_LINE>}<NEW_LINE>// add to query<NEW_LINE>bq.add(termVariants.build(), BooleanClause.Occur.SHOULD);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO possible alternative step 3 - organize above booleans into a new layer of field-based<NEW_LINE>// booleans with a minimum-should-match of NumFields-1?<NEW_LINE>return bq.build();<NEW_LINE>}
), BooleanClause.Occur.SHOULD);
731,868
final DescribeReplaceRootVolumeTasksResult executeDescribeReplaceRootVolumeTasks(DescribeReplaceRootVolumeTasksRequest describeReplaceRootVolumeTasksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeReplaceRootVolumeTasksRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeReplaceRootVolumeTasksRequest> request = null;<NEW_LINE>Response<DescribeReplaceRootVolumeTasksResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeReplaceRootVolumeTasksRequestMarshaller().marshall(super.beforeMarshalling(describeReplaceRootVolumeTasksRequest));<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, "EC2");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeReplaceRootVolumeTasksResult> responseHandler = new StaxResponseHandler<DescribeReplaceRootVolumeTasksResult>(new DescribeReplaceRootVolumeTasksResultStaxUnmarshaller());<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, "DescribeReplaceRootVolumeTasks");
661,903
public GetEvidenceResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetEvidenceResult getEvidenceResult = new GetEvidenceResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return getEvidenceResult;<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("evidence", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getEvidenceResult.setEvidence(EvidenceJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getEvidenceResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,265,100
public ListPricingRulesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListPricingRulesResult listPricingRulesResult = new ListPricingRulesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listPricingRulesResult;<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("BillingPeriod", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPricingRulesResult.setBillingPeriod(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("PricingRules", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPricingRulesResult.setPricingRules(new ListUnmarshaller<PricingRuleListElement>(PricingRuleListElementJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPricingRulesResult.setNextToken(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 listPricingRulesResult;<NEW_LINE>}
)).unmarshall(context));
588,124
public void validate(Insert insert) {<NEW_LINE>for (ValidationCapability c : getCapabilities()) {<NEW_LINE><MASK><NEW_LINE>validateOptionalFeature(c, insert.getItemsList(), Feature.insertValues);<NEW_LINE>validateOptionalFeature(c, insert.getModifierPriority(), Feature.insertModifierPriority);<NEW_LINE>validateFeature(c, insert.isModifierIgnore(), Feature.insertModifierIgnore);<NEW_LINE>validateOptionalFeature(c, insert.getSelect(), Feature.insertFromSelect);<NEW_LINE>validateFeature(c, insert.isUseSet(), Feature.insertUseSet);<NEW_LINE>validateFeature(c, insert.isUseDuplicate(), Feature.insertUseDuplicateKeyUpdate);<NEW_LINE>validateFeature(c, insert.isReturningAllColumns(), Feature.insertReturningAll);<NEW_LINE>validateOptionalFeature(c, insert.getReturningExpressionList(), Feature.insertReturningExpressionList);<NEW_LINE>}<NEW_LINE>validateOptionalFromItem(insert.getTable());<NEW_LINE>validateOptionalExpressions(insert.getColumns());<NEW_LINE>validateOptionalItemsList(insert.getItemsList());<NEW_LINE>if (insert.getSelect() != null) {<NEW_LINE>insert.getSelect().accept(getValidator(StatementValidator.class));<NEW_LINE>}<NEW_LINE>if (insert.isUseSet()) {<NEW_LINE>ExpressionValidator v = getValidator(ExpressionValidator.class);<NEW_LINE>// TODO is this useful?<NEW_LINE>// validateModelCondition (insert.getSetColumns().size() !=<NEW_LINE>// insert.getSetExpressionList().size(), "model-error");<NEW_LINE>insert.getSetColumns().forEach(c -> c.accept(v));<NEW_LINE>insert.getSetExpressionList().forEach(c -> c.accept(v));<NEW_LINE>}<NEW_LINE>if (insert.isUseDuplicate()) {<NEW_LINE>ExpressionValidator v = getValidator(ExpressionValidator.class);<NEW_LINE>// TODO is this useful?<NEW_LINE>// validateModelCondition (insert.getDuplicateUpdateColumns().size() !=<NEW_LINE>// insert.getDuplicateUpdateExpressionList().size(), "model-error");<NEW_LINE>insert.getDuplicateUpdateColumns().forEach(c -> c.accept(v));<NEW_LINE>insert.getDuplicateUpdateExpressionList().forEach(c -> c.accept(v));<NEW_LINE>}<NEW_LINE>if (isNotEmpty(insert.getReturningExpressionList())) {<NEW_LINE>ExpressionValidator v = getValidator(ExpressionValidator.class);<NEW_LINE>insert.getReturningExpressionList().forEach(c -> c.getExpression().accept(v));<NEW_LINE>}<NEW_LINE>}
validateFeature(c, Feature.insert);
452,922
private File createLogFile() {<NEW_LINE>File newLogFile = null;<NEW_LINE>String appName = Application.getInstance().getString(R.string.application_title_full).replaceAll("\\s+", "");<NEW_LINE>try {<NEW_LINE>File sdCard = Application.getInstance().getApplicationContext().getExternalFilesDir(null);<NEW_LINE>if (sdCard == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>File dir = new File(<MASK><NEW_LINE>dir.mkdirs();<NEW_LINE>newLogFile = new File(dir, appName + "_" + BuildConfig.VERSION_NAME + "_" + dateFormat.format(System.currentTimeMillis()) + ".txt");<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (streamWriter != null) {<NEW_LINE>streamWriter.flush();<NEW_LINE>streamWriter.close();<NEW_LINE>}<NEW_LINE>newLogFile.createNewFile();<NEW_LINE>FileOutputStream stream = new FileOutputStream(newLogFile);<NEW_LINE>streamWriter = new OutputStreamWriter(stream);<NEW_LINE>streamWriter.write("-----start log " + dateFormat.format(System.currentTimeMillis()) + " " + appName + " " + BuildConfig.VERSION_NAME + " Android " + Build.VERSION.RELEASE + " SDK " + Build.VERSION.SDK_INT + " Battery optimization: " + BatteryHelper.isOptimizingBattery() + "-----\n");<NEW_LINE>streamWriter.flush();<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>// delete log files if need<NEW_LINE>deleteRedundantFiles();<NEW_LINE>return newLogFile;<NEW_LINE>}
sdCard.getAbsolutePath() + "/logs");
1,010,828
public static Consumer<OutputWriter> toJSON(MaterialConfig materialConfig) {<NEW_LINE>return materialWriter -> {<NEW_LINE>if (!materialConfig.errors().isEmpty()) {<NEW_LINE>materialWriter.addChild("errors", errorWriter -> {<NEW_LINE>HashMap<String, String> <MASK><NEW_LINE>errorMapping.put("materialName", "name");<NEW_LINE>errorMapping.put("folder", "destination");<NEW_LINE>errorMapping.put("autoUpdate", "auto_update");<NEW_LINE>errorMapping.put("filterAsString", "filter");<NEW_LINE>errorMapping.put("checkexternals", "check_externals");<NEW_LINE>errorMapping.put("serverAndPort", "port");<NEW_LINE>errorMapping.put("useTickets", "use_tickets");<NEW_LINE>errorMapping.put("pipelineName", "pipeline");<NEW_LINE>errorMapping.put("stageName", "stage");<NEW_LINE>errorMapping.put("pipelineStageName", "pipeline");<NEW_LINE>errorMapping.put("packageId", "ref");<NEW_LINE>errorMapping.put("scmId", "ref");<NEW_LINE>errorMapping.put("encryptedPassword", "encrypted_password");<NEW_LINE>new ErrorGetter(errorMapping).toJSON(errorWriter, materialConfig);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>stream(Materials.values()).filter(material -> material.type == materialConfig.getClass()).findFirst().ifPresent(material -> {<NEW_LINE>materialWriter.add("type", material.name().toLowerCase());<NEW_LINE>materialWriter.add("fingerprint", materialConfig.getFingerprint());<NEW_LINE>materialWriter.addChild("attributes", material.representer.toJSON(materialConfig));<NEW_LINE>});<NEW_LINE>};<NEW_LINE>}
errorMapping = new HashMap<>();
323,691
public OBaseIndexEngine createIndexEngine(int indexId, String algorithm, String name, Boolean durableInNonTxMode, OStorage storage, int version, int apiVersion, @SuppressWarnings("SpellCheckingInspection") boolean multiValue, Map<String, String> engineProperties) {<NEW_LINE>if (algorithm == null) {<NEW_LINE>throw new OIndexException("Name of algorithm is not specified");<NEW_LINE>}<NEW_LINE>final OBaseIndexEngine indexEngine;<NEW_LINE>String storageType = storage.getType();<NEW_LINE>if (storageType.equals("distributed")) {<NEW_LINE>storageType = storage.getType();<NEW_LINE>}<NEW_LINE>switch(storageType) {<NEW_LINE>case "memory":<NEW_LINE>case "plocal":<NEW_LINE>switch(algorithm) {<NEW_LINE>case SBTREE_ALGORITHM:<NEW_LINE>indexEngine = new OSBTreeIndexEngine(indexId, name, (OAbstractPaginatedStorage) storage, version);<NEW_LINE>break;<NEW_LINE>case CELL_BTREE_ALGORITHM:<NEW_LINE>if (multiValue) {<NEW_LINE>indexEngine = new OCellBTreeMultiValueIndexEngine(indexId, name, (OAbstractPaginatedStorage) storage, version);<NEW_LINE>} else {<NEW_LINE>indexEngine = new OCellBTreeSingleValueIndexEngine(indexId, name, (OAbstractPaginatedStorage) storage, version);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Invalid name of algorithm :'" + "'");<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case "remote":<NEW_LINE>indexEngine <MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new OIndexException("Unsupported storage type: " + storageType);<NEW_LINE>}<NEW_LINE>return indexEngine;<NEW_LINE>}
= new ORemoteIndexEngine(indexId, name);
1,711,667
private Iterable<String> queryStringIndex(final String key, final String prefix) throws DatastoreException {<NEW_LINE>List<ResultSetFuture> futures = queryClusters((cluster) -> {<NEW_LINE>BoundStatement boundStatement = new BoundStatement(cluster.psStringIndexPrefixQuery);<NEW_LINE>boundStatement.setBytesUnsafe(0, serializeString(key));<NEW_LINE>boundStatement.setBytesUnsafe(1, serializeString(prefix));<NEW_LINE>boundStatement.setBytesUnsafe<MASK><NEW_LINE>boundStatement.setConsistencyLevel(cluster.getReadConsistencyLevel());<NEW_LINE>return cluster.executeAsync(boundStatement);<NEW_LINE>});<NEW_LINE>ListenableFuture<List<ResultSet>> listListenableFuture = Futures.allAsList(futures);<NEW_LINE>Set<String> ret = new HashSet<String>();<NEW_LINE>try {<NEW_LINE>Iterator<ResultSet> iterator = listListenableFuture.get().iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>ResultSet resultSet = iterator.next();<NEW_LINE>while (!resultSet.isExhausted()) {<NEW_LINE>Row row = resultSet.one();<NEW_LINE>ret.add(row.getString(0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new DatastoreException("CQL Query failure", e);<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
(2, serializeEndString(prefix));
239,700
public DenseMatrix gradient(DenseMatrix coef, int iter) {<NEW_LINE>if (coef.numRows() != p + q && coef.numRows() != p + q + 1) {<NEW_LINE>throw new RuntimeException("Error!coef is not comparable with the model");<NEW_LINE>}<NEW_LINE>double[] arCoef = new double[p];<NEW_LINE>double[] maCoef = new double[q];<NEW_LINE>double intercept;<NEW_LINE>for (int i = 0; i < this.p; i++) {<NEW_LINE>arCoef[i] = coef.get(i, 0);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < this.q; i++) {<NEW_LINE>maCoef[i] = coef.get(i + this.p, 0);<NEW_LINE>}<NEW_LINE>if (this.ifIntercept == 1) {<NEW_LINE>intercept = coef.<MASK><NEW_LINE>} else {<NEW_LINE>intercept = 0;<NEW_LINE>}<NEW_LINE>// compute estimated residual<NEW_LINE>this.computeRSS(this.data, this.cResidual, this.optOrder, arCoef, maCoef, intercept, this.type, this.ifIntercept);<NEW_LINE>double[][] newGradient;<NEW_LINE>if (ifIntercept == 1) {<NEW_LINE>newGradient = new double[p + q + 1][1];<NEW_LINE>} else {<NEW_LINE>newGradient = new double[p + q][1];<NEW_LINE>}<NEW_LINE>// parameters gradient of AR<NEW_LINE>for (int j = 0; j < this.p; j++) {<NEW_LINE>// partial Inverse of ComputeRSS at sARCoef[j]<NEW_LINE>newGradient[j][0] = this.pComputeRSS(j, data, this.iterResidual, this.optOrder, arCoef, maCoef, intercept, type, 1);<NEW_LINE>}<NEW_LINE>// parameters gradient of MA<NEW_LINE>for (int j = 0; j < this.q; j++) {<NEW_LINE>// partial Inverse of ComputeRSS at maCoef[j]<NEW_LINE>newGradient[j + this.p][0] = this.pComputeRSS(j, data, this.iterResidual, this.optOrder, arCoef, maCoef, intercept, type, 2);<NEW_LINE>}<NEW_LINE>// gradient of intercept<NEW_LINE>if (this.ifIntercept == 1) {<NEW_LINE>newGradient[this.p + this.q][0] = this.pComputeRSS(0, data, this.iterResidual, this.optOrder, arCoef, maCoef, intercept, type, 3);<NEW_LINE>}<NEW_LINE>return new DenseMatrix(newGradient);<NEW_LINE>}
get(p + q, 0);
1,125,134
final UpdateLFTagResult executeUpdateLFTag(UpdateLFTagRequest updateLFTagRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateLFTagRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateLFTagRequest> request = null;<NEW_LINE>Response<UpdateLFTagResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateLFTagRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateLFTagRequest));<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, "LakeFormation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateLFTag");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateLFTagResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateLFTagResultJsonUnmarshaller());<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();
869,064
final UpdateDomainNameResult executeUpdateDomainName(UpdateDomainNameRequest updateDomainNameRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateDomainNameRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateDomainNameRequest> request = null;<NEW_LINE>Response<UpdateDomainNameResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new UpdateDomainNameRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDomainNameRequest));<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, "ApiGatewayV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDomainName");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateDomainNameResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDomainNameResultJsonUnmarshaller());<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);
1,243,163
private void genCode() {<NEW_LINE>JbootApplication.setBootArg("jboot.datasource.url", dbUrl);<NEW_LINE>JbootApplication.setBootArg("jboot.datasource.user", dbUser);<NEW_LINE>JbootApplication.setBootArg("jboot.datasource.password", dbPassword);<NEW_LINE>String baseModelPackage = modelPackage + ".base";<NEW_LINE>String modelDir = basePath + "/src/main/java/" + modelPackage.replace(".", "/");<NEW_LINE>String baseModelDir = basePath + "/src/main/java/" + baseModelPackage.replace(".", "/");<NEW_LINE>System.out.println("start generate... dir:" + modelDir);<NEW_LINE>MetaBuilder metaBuilder = CodeGenHelpler.createMetaBuilder();<NEW_LINE>metaBuilder.setGenerateRemarks(true);<NEW_LINE>List<TableMeta> tableMetas = metaBuilder.build();<NEW_LINE>Set<String> genTableNames = StrUtil.splitToSet(dbTables, ",");<NEW_LINE>tableMetas.removeIf(tableMeta -> genTableNames != null && !genTableNames.contains(tableMeta.name.toLowerCase()));<NEW_LINE>new BaseModelGenerator(baseModelPackage, baseModelDir).generate(tableMetas);<NEW_LINE>new ModelGenerator(modelPackage, baseModelPackage, modelDir).generate(tableMetas);<NEW_LINE>String apiPath = basePath + "/src/main/java/" + servicePackage.replace(".", "/");<NEW_LINE>String providerPath = basePath + "/src/main/java/" + servicePackage.replace(".", "/") + "/provider";<NEW_LINE>new ServiceApiGenerator(servicePackage, modelPackage, apiPath).generate(tableMetas);<NEW_LINE>new ServiceProviderGenerator(servicePackage, modelPackage, providerPath).generate(tableMetas);<NEW_LINE>if (genUI) {<NEW_LINE>new AddonUIGenerator(basePath, addonName, modelPackage, tableMetas).genControllers().genEdit().genList();<NEW_LINE>}<NEW_LINE>Set<String> optionsTableNames = StrUtil.splitToSet(optionsTables, ",");<NEW_LINE>if (optionsTableNames != null && optionsTableNames.size() > 0) {<NEW_LINE>new BaseOptionsModelGenerator(baseModelPackage, baseModelDir).generate(copyTableMetasByNames(tableMetas, optionsTableNames));<NEW_LINE>}<NEW_LINE>// SortTables<NEW_LINE>Set<String> sortTableNames = StrUtil.splitToSet(sortTables, ",");<NEW_LINE>if (sortTableNames != null && sortTableNames.size() > 0) {<NEW_LINE>new BaseSortModelGenerator(baseModelPackage, baseModelDir).generate(copyTableMetasByNames(tableMetas, sortTableNames));<NEW_LINE>}<NEW_LINE>// SortOptionsTables<NEW_LINE>Set<String> sortOptionsTableNames = StrUtil.splitToSet(sortOptionsTables, ",");<NEW_LINE>if (sortOptionsTableNames != null && sortOptionsTableNames.size() > 0) {<NEW_LINE>new BaseSortOptionsModelGenerator(baseModelPackage, baseModelDir).generate<MASK><NEW_LINE>}<NEW_LINE>}
(copyTableMetasByNames(tableMetas, sortOptionsTableNames));
379,086
private void showLine12(int line, int diffLength) {<NEW_LINE>assert SwingUtilities.isEventDispatchThread();<NEW_LINE>// System.out.println("showLine("+line+", "+diffLength+")");<NEW_LINE>this.linesComp1.setActiveLine(line);<NEW_LINE>this.linesComp2.setActiveLine(line);<NEW_LINE>linesComp1.repaint();<NEW_LINE>linesComp2.repaint();<NEW_LINE>int padding = 5;<NEW_LINE>if (line <= 5)<NEW_LINE>padding = line / 2;<NEW_LINE>int off1, off2;<NEW_LINE>int ypos;<NEW_LINE>int viewHeight = jViewport1.getExtentSize().height;<NEW_LINE>java.awt.Point p1, p2;<NEW_LINE>// The window might be resized in the mean time.<NEW_LINE>initGlobalSizes();<NEW_LINE>p1 = jViewport1.getViewPosition();<NEW_LINE>p2 = jViewport2.getViewPosition();<NEW_LINE>ypos = (totalHeight * (line - padding - 1)) / (totalLines + 1);<NEW_LINE>int viewSize = jViewport1.getViewRect().y;<NEW_LINE>if (ypos < p1.y || ypos + ((diffLength + padding) * totalHeight) / totalLines > p1.y + viewHeight) {<NEW_LINE>// System.out.println("resetting posision=" + ypos);<NEW_LINE>p1.y = ypos;<NEW_LINE>p2.y = ypos;<NEW_LINE>setViewPosition(p1, p2);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>off1 = org.openide.text.NbDocument.findLineOffset((StyledDocument) <MASK><NEW_LINE>jEditorPane1.setCaretPosition(off1);<NEW_LINE>} catch (IndexOutOfBoundsException ex) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>off2 = org.openide.text.NbDocument.findLineOffset((StyledDocument) jEditorPane2.getDocument(), line);<NEW_LINE>jEditorPane2.setCaretPosition(off2);<NEW_LINE>} catch (IndexOutOfBoundsException ex) {<NEW_LINE>}<NEW_LINE>// D.deb("off1 = "+off1+", off2 = "+off2+", totalHeight = "+totalHeight+", totalLines = "+totalLines+", ypos = "+ypos);<NEW_LINE>// System.out.println("off1 = "+off1+", off2 = "+off2+", totalHeight = "+totalHeight+", totalLines = "+totalLines+", ypos = "+ypos);<NEW_LINE>}
jEditorPane1.getDocument(), line);
912,429
public void sync(MediaItemMetadata metadata, boolean useAltInfo) {<NEW_LINE>if (metadata == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (newTitle != null) {<NEW_LINE>title = newTitle;<NEW_LINE>}<NEW_LINE>String newInfo = null;<NEW_LINE>// Don't sync future translation because of not precise info<NEW_LINE>if (!metadata.isUpcoming()) {<NEW_LINE>newInfo = useAltInfo ? metadata.getInfoAlt() : metadata.getInfo();<NEW_LINE>}<NEW_LINE>if (newInfo != null) {<NEW_LINE>info = newInfo;<NEW_LINE>}<NEW_LINE>// No checks. This data wasn't existed before sync.<NEW_LINE>if (metadata.getDescription() != null) {<NEW_LINE>description = metadata.getDescription();<NEW_LINE>}<NEW_LINE>channelId = metadata.getChannelId();<NEW_LINE>nextMediaItem = metadata.getNextVideo();<NEW_LINE>// NOTE: Upcoming videos metadata wrongly reported as live<NEW_LINE>isLive = metadata.isLive();<NEW_LINE>isUpcoming = metadata.isUpcoming();<NEW_LINE>isSubscribed = metadata.isSubscribed();<NEW_LINE>isSynced = true;<NEW_LINE>if (mediaItem != null) {<NEW_LINE>mediaItem.sync(metadata);<NEW_LINE>}<NEW_LINE>}
String newTitle = metadata.getTitle();
679,364
public void marshall(ReputationOptions _reputationOptions, Request<?> request, String _prefix) {<NEW_LINE>String prefix;<NEW_LINE>if (_reputationOptions.getSendingEnabled() != null) {<NEW_LINE>prefix = _prefix + "SendingEnabled";<NEW_LINE>Boolean sendingEnabled = _reputationOptions.getSendingEnabled();<NEW_LINE>request.addParameter(prefix, StringUtils.fromBoolean(sendingEnabled));<NEW_LINE>}<NEW_LINE>if (_reputationOptions.getReputationMetricsEnabled() != null) {<NEW_LINE>prefix = _prefix + "ReputationMetricsEnabled";<NEW_LINE>Boolean reputationMetricsEnabled = _reputationOptions.getReputationMetricsEnabled();<NEW_LINE>request.addParameter(prefix<MASK><NEW_LINE>}<NEW_LINE>if (_reputationOptions.getLastFreshStart() != null) {<NEW_LINE>prefix = _prefix + "LastFreshStart";<NEW_LINE>java.util.Date lastFreshStart = _reputationOptions.getLastFreshStart();<NEW_LINE>request.addParameter(prefix, StringUtils.fromDate(lastFreshStart));<NEW_LINE>}<NEW_LINE>}
, StringUtils.fromBoolean(reputationMetricsEnabled));
1,523,919
final DisassociateConnectionFromLagResult executeDisassociateConnectionFromLag(DisassociateConnectionFromLagRequest disassociateConnectionFromLagRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateConnectionFromLagRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateConnectionFromLagRequest> request = null;<NEW_LINE>Response<DisassociateConnectionFromLagResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateConnectionFromLagRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateConnectionFromLagRequest));<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, "Direct Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateConnectionFromLag");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateConnectionFromLagResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateConnectionFromLagResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,542,377
public static void main(String[] args) {<NEW_LINE>String d = "{\"ip\":\"50.112.119.64\",\"count\":27}$$${\\\"ip\\\":\\\"50.112.119.64\\\",\\\"count\\\":27}";<NEW_LINE>String e1 = "{\"ip\":\"11.112.119.64\",\"count\":27}";<NEW_LINE>String e2 = "{\"ip\":\"22.111.112.62\",\"count\":27}";<NEW_LINE>String e3 = "{\"ip\":\"33.222.112.62\",\"count\":27}";<NEW_LINE>List<String> events = new ArrayList<>();<NEW_LINE>events.add(e1);<NEW_LINE>events.add(e2);<NEW_LINE>events.add(e3);<NEW_LINE>String <MASK><NEW_LINE>List<MantisServerSentEvent> orig = CompressionUtils.decompressAndBase64Decode(encodedString, true);<NEW_LINE>for (MantisServerSentEvent event : orig) {<NEW_LINE>System.out.println("event -> " + event);<NEW_LINE>}<NEW_LINE>// String d2 = "blah1$$$blah3$$$blah4";<NEW_LINE>// System.out.println("pos " + d2.indexOf("$$$"));<NEW_LINE>// String [] toks = d.split("\\$\\$\\$");<NEW_LINE>//<NEW_LINE>// System.out.println("toks len" + toks.length);<NEW_LINE>// for(int i=0; i<toks.length; i++) {<NEW_LINE>// System.out.println("t -> " + toks[i]);<NEW_LINE>// }<NEW_LINE>}
encodedString = CompressionUtils.compressAndBase64Encode(events);
1,686,784
private IRubyObject inspect(ThreadContext context, boolean recurse) {<NEW_LINE>Ruby runtime = context.runtime;<NEW_LINE>ByteList bytes = new ByteList();<NEW_LINE>bytes.append((byte) '#').append((byte) '<');<NEW_LINE>bytes.append(getMetaClass().getName().getBytes());<NEW_LINE>bytes.append((byte) ':')<MASK><NEW_LINE>if (recurse) {<NEW_LINE>bytes.append("...>".getBytes());<NEW_LINE>return RubyString.newStringNoCopy(runtime, bytes);<NEW_LINE>} else {<NEW_LINE>bytes.append(RubyObject.inspect(context, object).getByteList());<NEW_LINE>bytes.append((byte) ':');<NEW_LINE>bytes.append(method.getBytes());<NEW_LINE>if (methodArgs.length > 0) {<NEW_LINE>bytes.append((byte) '(');<NEW_LINE>for (int i = 0; i < methodArgs.length; i++) {<NEW_LINE>bytes.append(RubyObject.inspect(context, methodArgs[i]).getByteList());<NEW_LINE>if (i < methodArgs.length - 1) {<NEW_LINE>bytes.append((byte) ',').append((byte) ' ');<NEW_LINE>} else {<NEW_LINE>bytes.append((byte) ')');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>bytes.append((byte) '>');<NEW_LINE>RubyString result = RubyString.newStringNoCopy(runtime, bytes);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
.append((byte) ' ');
1,303,347
public FlinkKafkaConsumerBase<Row> createKafkaTableSource(KafkaSourceTableInfo kafkaSourceTableInfo, TypeInformation<Row> typeInformation, Properties props) {<NEW_LINE>KafkaConsumer kafkaSrc;<NEW_LINE>if (kafkaSourceTableInfo.getTopicIsPattern()) {<NEW_LINE>DeserializationMetricWrapper deserMetricWrapper = createDeserializationMetricWrapper(kafkaSourceTableInfo, typeInformation, (Calculate & Serializable) (subscriptionState, tp) -> subscriptionState.partitionLag(tp, IsolationLevel.READ_UNCOMMITTED));<NEW_LINE>kafkaSrc = new KafkaConsumer(Pattern.compile(kafkaSourceTableInfo.getTopic()), kafkaSourceTableInfo.getSampleSize(), deserMetricWrapper, props);<NEW_LINE>} else {<NEW_LINE>DeserializationMetricWrapper deserMetricWrapper = createDeserializationMetricWrapper(kafkaSourceTableInfo, typeInformation, (Calculate & Serializable) (subscriptionState, tp) -> subscriptionState.partitionLag<MASK><NEW_LINE>kafkaSrc = new KafkaConsumer(kafkaSourceTableInfo.getTopic(), kafkaSourceTableInfo.getSampleSize(), deserMetricWrapper, props);<NEW_LINE>}<NEW_LINE>return kafkaSrc;<NEW_LINE>}
(tp, IsolationLevel.READ_UNCOMMITTED));
443,673
protected void matchReportReference(ASTNode reference, IJavaElement element, IJavaElement localElement, IJavaElement[] otherElements, Binding elementBinding, int accuracy, MatchLocator locator) throws CoreException {<NEW_LINE>if (this.isDeclarationOfReferencedTypesPattern) {<NEW_LINE>if ((element = findElement(element, accuracy)) != null)<NEW_LINE>reportDeclaration(reference, element, locator, ((DeclarationOfReferencedTypesPattern) this.pattern).knownTypes);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Create search match<NEW_LINE>TypeReferenceMatch refMatch = locator.newTypeReferenceMatch(element, elementBinding, accuracy, reference);<NEW_LINE>refMatch.setLocalElement(localElement);<NEW_LINE>refMatch.setOtherElements(otherElements);<NEW_LINE>this.match = refMatch;<NEW_LINE>// Report match depending on reference type<NEW_LINE>if (reference instanceof QualifiedNameReference)<NEW_LINE>matchReportReference((QualifiedNameReference) reference, element, elementBinding, accuracy, locator);<NEW_LINE>else if (reference instanceof QualifiedTypeReference)<NEW_LINE>matchReportReference((QualifiedTypeReference) reference, element, elementBinding, accuracy, locator);<NEW_LINE>else if (reference instanceof ArrayTypeReference)<NEW_LINE>matchReportReference((ArrayTypeReference) reference, <MASK><NEW_LINE>else {<NEW_LINE>TypeBinding typeBinding = reference instanceof Expression ? ((Expression) reference).resolvedType : null;<NEW_LINE>if (typeBinding != null) {<NEW_LINE>matchReportReference((Expression) reference, -1, typeBinding, locator);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>locator.report(this.match);<NEW_LINE>}<NEW_LINE>}
element, elementBinding, accuracy, locator);
1,128,819
final GetContactMethodsResult executeGetContactMethods(GetContactMethodsRequest getContactMethodsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getContactMethodsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetContactMethodsRequest> request = null;<NEW_LINE>Response<GetContactMethodsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetContactMethodsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getContactMethodsRequest));<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, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetContactMethods");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetContactMethodsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetContactMethodsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
430,903
private ArrayList<LayoutElementParcelable> listMediaCommon(Uri contentUri, @NonNull String[] projection, @Nullable String selection) {<NEW_LINE>final Context context = this.context.get();<NEW_LINE>if (context == null) {<NEW_LINE>cancel(true);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Cursor cursor = context.getContentResolver().query(contentUri, projection, selection, null, null);<NEW_LINE>ArrayList<LayoutElementParcelable> retval = new ArrayList<>();<NEW_LINE>if (cursor == null)<NEW_LINE>return retval;<NEW_LINE>else if (cursor.getCount() > 0 && cursor.moveToFirst()) {<NEW_LINE>do {<NEW_LINE>String path = cursor.getString(cursor.getColumnIndex(MediaStore.Files.FileColumns.DATA));<NEW_LINE>HybridFileParcelable strings = RootHelper.generateBaseFile(<MASK><NEW_LINE>if (strings != null) {<NEW_LINE>LayoutElementParcelable parcelable = createListParcelables(strings);<NEW_LINE>if (parcelable != null)<NEW_LINE>retval.add(parcelable);<NEW_LINE>}<NEW_LINE>} while (cursor.moveToNext());<NEW_LINE>}<NEW_LINE>cursor.close();<NEW_LINE>return retval;<NEW_LINE>}
new File(path), showHiddenFiles);
1,303,809
public void execute(EventNotificationContext ctx) throws TemporaryEventNotificationException, PermanentEventNotificationException {<NEW_LINE>final HTTPEventNotificationConfig config = <MASK><NEW_LINE>final HttpUrl httpUrl = HttpUrl.parse(config.url());<NEW_LINE>if (httpUrl == null) {<NEW_LINE>throw new TemporaryEventNotificationException("Malformed URL: <" + config.url() + "> in notification <" + ctx.notificationId() + ">");<NEW_LINE>}<NEW_LINE>ImmutableList<MessageSummary> backlog = notificationCallbackService.getBacklogForEvent(ctx);<NEW_LINE>final EventNotificationModelData model = EventNotificationModelData.of(ctx, backlog);<NEW_LINE>if (!whitelistService.isWhitelisted(config.url())) {<NEW_LINE>if (!NotificationTestData.TEST_NOTIFICATION_ID.equals(ctx.notificationId())) {<NEW_LINE>publishSystemNotificationForWhitelistFailure(config.url(), model.eventDefinitionTitle());<NEW_LINE>}<NEW_LINE>throw new TemporaryEventNotificationException("URL <" + config.url() + "> is not whitelisted.");<NEW_LINE>}<NEW_LINE>final byte[] body;<NEW_LINE>try {<NEW_LINE>body = objectMapper.writeValueAsBytes(model);<NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE>throw new PermanentEventNotificationException("Unable to serialize notification", e);<NEW_LINE>}<NEW_LINE>final Request request = new Request.Builder().url(httpUrl).post(RequestBody.create(CONTENT_TYPE, body)).build();<NEW_LINE>LOG.debug("Requesting HTTP endpoint at <{}> in notification <{}>", config.url(), ctx.notificationId());<NEW_LINE>try (final Response r = httpClient.newCall(request).execute()) {<NEW_LINE>if (!r.isSuccessful()) {<NEW_LINE>throw new PermanentEventNotificationException("Expected successful HTTP response [2xx] but got [" + r.code() + "]. " + config.url());<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new PermanentEventNotificationException(e.getMessage());<NEW_LINE>}<NEW_LINE>}
(HTTPEventNotificationConfig) ctx.notificationConfig();
1,336,086
private void create(ItemCheckoutStatus[] checkouts) {<NEW_LINE>tableModel = new CheckoutsTableModel(checkouts);<NEW_LINE>// set up table sorter stuff<NEW_LINE>TableSortStateEditor tsse = new TableSortStateEditor();<NEW_LINE>tsse.addSortedColumn(CheckoutsTableModel.DATE_COL, SortDirection.DESCENDING);<NEW_LINE>tableModel.setTableSortState(tsse.createTableSortState());<NEW_LINE>table = new GTable(tableModel);<NEW_LINE>JScrollPane sp = new JScrollPane(table);<NEW_LINE>table.setPreferredScrollableViewportSize(new Dimension(680, 120));<NEW_LINE>table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);<NEW_LINE>add(sp, BorderLayout.CENTER);<NEW_LINE>TableColumnModel columnModel = table.getColumnModel();<NEW_LINE>// MyCellRenderer cellRenderer = new MyCellRenderer();<NEW_LINE>TableColumn column;<NEW_LINE>column = columnModel.getColumn(CheckoutsTableModel.DATE_COL);<NEW_LINE>column.setPreferredWidth(120);<NEW_LINE>column.setCellRenderer(new GenericDateCellRenderer("Date when file was checked out"));<NEW_LINE>columnModel.getColumn(CheckoutsTableModel.VERSION_COL).setPreferredWidth(50);<NEW_LINE>columnModel.getColumn(CheckoutsTableModel.USER_COL).setPreferredWidth(80);<NEW_LINE>columnModel.getColumn(CheckoutsTableModel.HOST_COL).setPreferredWidth(120);<NEW_LINE>columnModel.getColumn(CheckoutsTableModel.PROJECT_NAME_COL).setPreferredWidth(120);<NEW_LINE>columnModel.getColumn(CheckoutsTableModel<MASK><NEW_LINE>}
.PROJECT_LOC_COL).setPreferredWidth(180);
1,244,192
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>// TODO Auto-generated method stub<NEW_LINE>PrintWriter writer = response.getWriter();<NEW_LINE>Enumeration<?> enu = request.getParameterNames();<NEW_LINE>while (enu.hasMoreElements()) {<NEW_LINE>String paraName = (String) enu.nextElement();<NEW_LINE>System.out.println("Get parameter: " + paraName + " - " <MASK><NEW_LINE>}<NEW_LINE>String appName = request.getParameter("app");<NEW_LINE>String methodName = request.getParameter("method");<NEW_LINE>String result = "";<NEW_LINE>if (appName.equals("policyAttachmentsService1")) {<NEW_LINE>try {<NEW_LINE>String service = "http://localhost:8091/policyAttachmentsService1/HelloService1?wsdl";<NEW_LINE>QName serviceName = new QName("http://service1.policyattachments.ws.ibm.com/", "HelloService1");<NEW_LINE>HelloService1PortProxy proxy = new HelloService1PortProxy(new URL(service), serviceName);<NEW_LINE>if (methodName.equals("helloWithoutPolicy")) {<NEW_LINE>result = proxy.helloWithoutPolicy();<NEW_LINE>} else if (methodName.equals("helloWithPolicy")) {<NEW_LINE>result = proxy.helloWithPolicy();<NEW_LINE>} else if (methodName.equals("helloWithOptionalPolicy")) {<NEW_LINE>result = proxy.helloWithOptionalPolicy();<NEW_LINE>} else if (methodName.equals("helloWithYouWant")) {<NEW_LINE>result = proxy.helloWithYouWant();<NEW_LINE>}<NEW_LINE>writer.println(result);<NEW_LINE>System.out.println(result);<NEW_LINE>} catch (Exception e) {<NEW_LINE>writer.println(e.getMessage());<NEW_LINE>}<NEW_LINE>} else if (appName.equals("policyAttachmentsService2")) {<NEW_LINE>try {<NEW_LINE>String service = "http://localhost:8091/policyAttachmentsService2/HelloService2?wsdl";<NEW_LINE>QName serviceName = new QName("http://service2.policyattachments.ws.ibm.com/", "HelloService2");<NEW_LINE>HelloService2PortProxy proxy = new HelloService2PortProxy(new URL(service), serviceName);<NEW_LINE>if (methodName.equals("helloWithoutPolicy")) {<NEW_LINE>result = proxy.helloWithoutPolicy();<NEW_LINE>} else if (methodName.equals("helloWithPolicy")) {<NEW_LINE>result = proxy.helloWithPolicy();<NEW_LINE>} else if (methodName.equals("helloWithOptionalPolicy")) {<NEW_LINE>result = proxy.helloWithOptionalPolicy();<NEW_LINE>} else if (methodName.equals("helloWithYouWant")) {<NEW_LINE>result = proxy.helloWithYouWant();<NEW_LINE>}<NEW_LINE>writer.println(result);<NEW_LINE>System.out.println(result);<NEW_LINE>} catch (Exception e) {<NEW_LINE>writer.println(e.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>writer.println("No method invoked");<NEW_LINE>}<NEW_LINE>}
+ request.getParameter(paraName));
1,540,484
public ExtensionJson toExtensionJson() {<NEW_LINE>var json = new ExtensionJson();<NEW_LINE>var extension = this.getExtension();<NEW_LINE>json.namespace = extension.getNamespace().getName();<NEW_LINE>json.name = extension.getName();<NEW_LINE>json.averageRating = extension.getAverageRating();<NEW_LINE>json.downloadCount = extension.getDownloadCount();<NEW_LINE>json.version = this.getVersion();<NEW_LINE>json.preRelease = this.isPreRelease();<NEW_LINE>if (this.getTimestamp() != null) {<NEW_LINE>json.timestamp = TimeUtil.toUTCString(this.getTimestamp());<NEW_LINE>}<NEW_LINE>json.displayName = this.getDisplayName();<NEW_LINE>json.description = this.getDescription();<NEW_LINE>json.engines = this.getEnginesMap();<NEW_LINE>json.categories = this.getCategories();<NEW_LINE>json.extensionKind = this.getExtensionKind();<NEW_LINE>json.tags = this.getTags();<NEW_LINE>json.license = this.getLicense();<NEW_LINE>json.homepage = this.getHomepage();<NEW_LINE>json.repository = this.getRepository();<NEW_LINE>json.bugs = this.getBugs();<NEW_LINE>json.markdown = this.getMarkdown();<NEW_LINE>json.galleryColor = this.getGalleryColor();<NEW_LINE>json.galleryTheme = this.getGalleryTheme();<NEW_LINE>json<MASK><NEW_LINE>if (this.getPublishedWith() != null) {<NEW_LINE>json.publishedBy = this.getPublishedWith().getUser().toUserJson();<NEW_LINE>}<NEW_LINE>if (this.getDependencies() != null) {<NEW_LINE>json.dependencies = toExtensionReferenceJson(this.getDependencies());<NEW_LINE>}<NEW_LINE>if (this.getBundledExtensions() != null) {<NEW_LINE>json.bundledExtensions = toExtensionReferenceJson(this.getBundledExtensions());<NEW_LINE>}<NEW_LINE>return json;<NEW_LINE>}
.qna = this.getQna();
832,925
private IndexDefinition descriptorToDefinition(final TokenRead tokenRead, IndexDescriptor index) {<NEW_LINE>try {<NEW_LINE>SchemaDescriptor schema = index.schema();<NEW_LINE>int[] entityTokenIds = schema.getEntityTokenIds();<NEW_LINE>boolean constraintIndex = index.isUnique();<NEW_LINE>String[] propertyNames = PropertyNameUtils.getPropertyKeysOrThrow(tokenRead, index.schema().getPropertyIds());<NEW_LINE>switch(schema.entityType()) {<NEW_LINE>case NODE:<NEW_LINE>Label[] labels = new Label[entityTokenIds.length];<NEW_LINE>for (int i = 0; i < labels.length; i++) {<NEW_LINE>labels[i] = label(tokenRead.nodeLabelName(entityTokenIds[i]));<NEW_LINE>}<NEW_LINE>return new IndexDefinitionImpl(actions, index, labels, propertyNames, constraintIndex);<NEW_LINE>case RELATIONSHIP:<NEW_LINE>RelationshipType[] relTypes = new RelationshipType[entityTokenIds.length];<NEW_LINE>for (int i = 0; i < relTypes.length; i++) {<NEW_LINE>relTypes[i] = withName(tokenRead.relationshipTypeName(entityTokenIds[i]));<NEW_LINE>}<NEW_LINE>return new IndexDefinitionImpl(actions, index, relTypes, propertyNames, constraintIndex);<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Cannot create IndexDefinition for " + <MASK><NEW_LINE>}<NEW_LINE>} catch (KernelException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
schema.entityType() + " entity-typed schema.");
15,185
public SymbolReference<? extends ResolvedValueDeclaration> solveSymbolInParentContext(String name) {<NEW_LINE>Optional<MASK><NEW_LINE>if (!optionalParentContext.isPresent()) {<NEW_LINE>return SymbolReference.unsolved(ResolvedValueDeclaration.class);<NEW_LINE>}<NEW_LINE>// First check if there are any pattern expressions available to this node.<NEW_LINE>Context parentContext = optionalParentContext.get();<NEW_LINE>if (parentContext instanceof BinaryExprContext || parentContext instanceof IfStatementContext) {<NEW_LINE>List<PatternExpr> patternExprs = parentContext.patternExprsExposedToChild(this.getWrappedNode());<NEW_LINE>Optional<PatternExpr> localResolutionResults = patternExprs.stream().filter(vd -> vd.getNameAsString().equals(name)).findFirst();<NEW_LINE>if (localResolutionResults.isPresent()) {<NEW_LINE>if (patternExprs.size() == 1) {<NEW_LINE>JavaParserPatternDeclaration decl = JavaParserSymbolDeclaration.patternVar(localResolutionResults.get(), typeSolver);<NEW_LINE>return SymbolReference.solved(decl);<NEW_LINE>} else if (patternExprs.size() > 1) {<NEW_LINE>throw new IllegalStateException("Unexpectedly more than one reference in scope");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Delegate solving to the parent context.<NEW_LINE>return parentContext.solveSymbol(name);<NEW_LINE>}
<Context> optionalParentContext = getParent();
413,632
public void testCaptureDebuggerWatchesPlugin() throws Throwable {<NEW_LINE>TraceThread thread;<NEW_LINE>long snap0, snap1;<NEW_LINE>try (UndoableTransaction tid = tb.startTransaction()) {<NEW_LINE>snap0 = tb.trace.getTimeManager().<MASK><NEW_LINE>snap1 = tb.trace.getTimeManager().createSnapshot("Second").getKey();<NEW_LINE>thread = tb.getOrAddThread("[1]", snap0);<NEW_LINE>PcodeExecutor<byte[]> executor0 = TraceSleighUtils.buildByteExecutor(tb.trace, snap0, thread, 0);<NEW_LINE>executor0.executeSleighLine("RSP = 0x7ffefff8");<NEW_LINE>executor0.executeSleighLine("*:4 (RSP+8) = 0x4030201");<NEW_LINE>PcodeExecutor<byte[]> executor1 = TraceSleighUtils.buildByteExecutor(tb.trace, snap1, thread, 0);<NEW_LINE>executor1.executeSleighLine("RSP = 0x7ffefff8");<NEW_LINE>executor1.executeSleighLine("*:4 (RSP+8) = 0x1020304");<NEW_LINE>executor1.executeSleighLine("*:4 0x7fff0004:8 = 0x4A9A70C8");<NEW_LINE>}<NEW_LINE>watchesProvider.addWatch("RSP");<NEW_LINE>watchesProvider.addWatch("*:8 RSP");<NEW_LINE>watchesProvider.addWatch("*:4 (RSP+8)").setDataType(LongDataType.dataType);<NEW_LINE>watchesProvider.addWatch("*:4 0x7fff0004:8").setDataType(FloatDataType.dataType);<NEW_LINE>traceManager.openTrace(tb.trace);<NEW_LINE>traceManager.activateThread(thread);<NEW_LINE>waitForSwing();<NEW_LINE>traceManager.activateSnap(snap0);<NEW_LINE>waitForSwing();<NEW_LINE>traceManager.activateSnap(snap1);<NEW_LINE>waitForSwing();<NEW_LINE>captureIsolatedProvider(watchesProvider, 700, 400);<NEW_LINE>}
createSnapshot("First").getKey();
499,607
public InputStream openClassFile(String className) throws IOException {<NEW_LINE>// TODO(stu): handle primitives & not stdlib<NEW_LINE>if (className.contains(".")) {<NEW_LINE>int dollarPosition = className.indexOf("$");<NEW_LINE>if (dollarPosition >= 0) {<NEW_LINE>className = className.substring(0, dollarPosition);<NEW_LINE>}<NEW_LINE>if (className.startsWith("java")) {<NEW_LINE>String[] <MASK><NEW_LINE>String path = String.join("/", packages);<NEW_LINE>Path classPath = root.resolve(path + ".java");<NEW_LINE>return new FileInputStream(classPath.toFile());<NEW_LINE>} else {<NEW_LINE>String packageName = className.substring(0, className.lastIndexOf("."));<NEW_LINE>Path packageRoot = pkgRoots.get(packageName);<NEW_LINE>if (packageRoot != null) {<NEW_LINE>Path classPath = packageRoot.resolve(className.substring(className.lastIndexOf(".") + 1) + ".java");<NEW_LINE>return new FileInputStream(classPath.toFile());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new InputStream() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int read() throws IOException {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
packages = className.split("\\.");
1,157,234
public ArrayList<MegaOffline> findByPath(String path) {<NEW_LINE>ArrayList<MegaOffline> listOffline = new ArrayList<MegaOffline>();<NEW_LINE>// Get the foreign key of the node<NEW_LINE>String selectQuery = "SELECT * FROM " + TABLE_OFFLINE + " WHERE " + KEY_OFF_PATH + " = '" + encrypt(path) + "'";<NEW_LINE>try (Cursor cursor = db.rawQuery(selectQuery, null)) {<NEW_LINE>if (cursor != null && cursor.moveToFirst()) {<NEW_LINE>do {<NEW_LINE>int _id = Integer.parseInt(cursor.getString(0));<NEW_LINE>String _handle = decrypt(cursor.getString(1));<NEW_LINE>String _path = decrypt<MASK><NEW_LINE>String _name = decrypt(cursor.getString(3));<NEW_LINE>int _parent = cursor.getInt(4);<NEW_LINE>String _type = decrypt(cursor.getString(5));<NEW_LINE>int _incoming = cursor.getInt(6);<NEW_LINE>String _handleIncoming = decrypt(cursor.getString(7));<NEW_LINE>listOffline.add(new MegaOffline(_id, _handle, _path, _name, _parent, _type, _incoming, _handleIncoming));<NEW_LINE>} while (cursor.moveToNext());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logError("Exception opening or managing DB cursor", e);<NEW_LINE>}<NEW_LINE>return listOffline;<NEW_LINE>}
(cursor.getString(2));
205,103
// visible for testing<NEW_LINE>protected void start(Map<String, String> props, ElasticsearchClient client) {<NEW_LINE>log.info("Starting ElasticsearchSinkTask.");<NEW_LINE>this.config = new ElasticsearchSinkConnectorConfig(props);<NEW_LINE>this.converter = new DataConverter(config);<NEW_LINE>this.existingMappings = new HashSet<>();<NEW_LINE>this.<MASK><NEW_LINE>int offsetHighWaterMark = config.maxBufferedRecords() * 10;<NEW_LINE>int offsetLowWaterMark = config.maxBufferedRecords() * 5;<NEW_LINE>this.partitionPauser = new PartitionPauser(context, () -> offsetTracker.numOffsetStateEntries() > offsetHighWaterMark, () -> offsetTracker.numOffsetStateEntries() <= offsetLowWaterMark);<NEW_LINE>this.reporter = null;<NEW_LINE>try {<NEW_LINE>if (context.errantRecordReporter() == null) {<NEW_LINE>log.info("Errant record reporter not configured.");<NEW_LINE>}<NEW_LINE>// may be null if DLQ not enabled<NEW_LINE>reporter = context.errantRecordReporter();<NEW_LINE>} catch (NoClassDefFoundError | NoSuchMethodError e) {<NEW_LINE>// Will occur in Connect runtimes earlier than 2.6<NEW_LINE>log.warn("AK versions prior to 2.6 do not support the errant record reporter.");<NEW_LINE>}<NEW_LINE>Runnable afterBulkCallback = () -> offsetTracker.updateOffsets();<NEW_LINE>this.client = client != null ? client : new ElasticsearchClient(config, reporter, afterBulkCallback);<NEW_LINE>if (!config.flushSynchronously()) {<NEW_LINE>this.offsetTracker = new AsyncOffsetTracker(context);<NEW_LINE>} else {<NEW_LINE>this.offsetTracker = new SyncOffsetTracker(this.client);<NEW_LINE>}<NEW_LINE>log.info("Started ElasticsearchSinkTask. Connecting to ES server version: {}", getServerVersion());<NEW_LINE>}
indexCache = new HashSet<>();
808,397
public Answer execute(final RebootCommand command, final CitrixResourceBase citrixResourceBase) {<NEW_LINE>final Connection conn = citrixResourceBase.getConnection();<NEW_LINE>s_logger.debug("7. The VM " + command.getVmName() + " is in Starting state");<NEW_LINE>try {<NEW_LINE>Set<VM> vms = null;<NEW_LINE>try {<NEW_LINE>vms = VM.getByNameLabel(<MASK><NEW_LINE>} catch (final XenAPIException e0) {<NEW_LINE>s_logger.debug("getByNameLabel failed " + e0.toString());<NEW_LINE>return new RebootAnswer(command, "getByNameLabel failed " + e0.toString(), false);<NEW_LINE>} catch (final Exception e0) {<NEW_LINE>s_logger.debug("getByNameLabel failed " + e0.getMessage());<NEW_LINE>return new RebootAnswer(command, "getByNameLabel failed", false);<NEW_LINE>}<NEW_LINE>for (final VM vm : vms) {<NEW_LINE>try {<NEW_LINE>citrixResourceBase.rebootVM(conn, vm, vm.getNameLabel(conn));<NEW_LINE>} catch (final Exception e) {<NEW_LINE>final String msg = e.toString();<NEW_LINE>s_logger.warn(msg, e);<NEW_LINE>return new RebootAnswer(command, msg, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new RebootAnswer(command, "reboot succeeded", true);<NEW_LINE>} finally {<NEW_LINE>s_logger.debug("8. The VM " + command.getVmName() + " is in Running state");<NEW_LINE>}<NEW_LINE>}
conn, command.getVmName());
233,750
private SampleQueue createSampleQueue(int id, int type) {<NEW_LINE>int trackCount = sampleQueues.length;<NEW_LINE>boolean isAudioVideo = type == C.TRACK_TYPE_AUDIO || type == C.TRACK_TYPE_VIDEO;<NEW_LINE>HlsSampleQueue sampleQueue = new HlsSampleQueue(allocator, drmSessionManager, drmEventDispatcher, overridingDrmInitData);<NEW_LINE>sampleQueue.setStartTimeUs(lastSeekPositionUs);<NEW_LINE>if (isAudioVideo) {<NEW_LINE>sampleQueue.setDrmInitData(drmInitData);<NEW_LINE>}<NEW_LINE>sampleQueue.setSampleOffsetUs(sampleOffsetUs);<NEW_LINE>if (sourceChunk != null) {<NEW_LINE>sampleQueue.setSourceChunk(sourceChunk);<NEW_LINE>}<NEW_LINE>sampleQueue.setUpstreamFormatChangeListener(this);<NEW_LINE>sampleQueueTrackIds = Arrays.copyOf(sampleQueueTrackIds, trackCount + 1);<NEW_LINE>sampleQueueTrackIds[trackCount] = id;<NEW_LINE>sampleQueues = Util.nullSafeArrayAppend(sampleQueues, sampleQueue);<NEW_LINE>sampleQueueIsAudioVideoFlags = Arrays.copyOf(sampleQueueIsAudioVideoFlags, trackCount + 1);<NEW_LINE>sampleQueueIsAudioVideoFlags[trackCount] = isAudioVideo;<NEW_LINE>haveAudioVideoSampleQueues |= sampleQueueIsAudioVideoFlags[trackCount];<NEW_LINE>sampleQueueMappingDoneByType.add(type);<NEW_LINE>sampleQueueIndicesByType.append(type, trackCount);<NEW_LINE>if (getTrackTypeScore(type) > getTrackTypeScore(primarySampleQueueType)) {<NEW_LINE>primarySampleQueueIndex = trackCount;<NEW_LINE>primarySampleQueueType = type;<NEW_LINE>}<NEW_LINE>sampleQueuesEnabledStates = Arrays.<MASK><NEW_LINE>return sampleQueue;<NEW_LINE>}
copyOf(sampleQueuesEnabledStates, trackCount + 1);
356,599
private void processUnderFile(VirtualFile file) {<NEW_LINE>final MultiMap<VirtualFile, FileAnnotation> <MASK><NEW_LINE>synchronized (myLock) {<NEW_LINE>for (VirtualFile virtualFile : myFileAnnotationMap.keySet()) {<NEW_LINE>if (VfsUtilCore.isAncestor(file, virtualFile, true)) {<NEW_LINE>final Collection<FileAnnotation> values = myFileAnnotationMap.get(virtualFile);<NEW_LINE>for (FileAnnotation value : values) {<NEW_LINE>annotations.putValue(virtualFile, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!annotations.isEmpty()) {<NEW_LINE>for (Map.Entry<VirtualFile, Collection<FileAnnotation>> entry : annotations.entrySet()) {<NEW_LINE>final VirtualFile key = entry.getKey();<NEW_LINE>final VcsRevisionNumber number = fromDiffProvider(key);<NEW_LINE>if (number == null)<NEW_LINE>continue;<NEW_LINE>final Collection<FileAnnotation> fileAnnotations = entry.getValue();<NEW_LINE>for (FileAnnotation annotation : fileAnnotations) {<NEW_LINE>if (annotation.isBaseRevisionChanged(number)) {<NEW_LINE>annotation.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
annotations = new MultiMap<>();
341,981
private void init(long transferBlockSize) {<NEW_LINE>List<TorrentFile> files = torrent.getFiles();<NEW_LINE><MASK><NEW_LINE>long chunkSize = torrent.getChunkSize();<NEW_LINE>transferBlockSize = Math.min(transferBlockSize, chunkSize);<NEW_LINE>int chunksTotal = PieceUtils.calculateNumberOfChunks(totalSize, chunkSize);<NEW_LINE>List<List<TorrentFile>> pieceNumToFile = new ArrayList<>(chunksTotal);<NEW_LINE>final Map<StorageUnit, TorrentFile> storageUnitsToFilesMap = buildStorageUnitToFilesMap(files);<NEW_LINE>// filter out empty files (and create them at once)<NEW_LINE>List<StorageUnit> nonEmptyStorageUnits = handleEmptyStorageUnits(storageUnitsToFilesMap);<NEW_LINE>List<ChunkDescriptor> chunks = PieceUtils.buildChunkDescriptors(torrent, transferBlockSize, totalSize, chunkSize, chunksTotal, pieceNumToFile, storageUnitsToFilesMap, nonEmptyStorageUnits);<NEW_LINE>List<List<CompletableTorrentFile>> countdownTorrentFiles = createListOfCountdownFiles(torrent.getFiles(), pieceNumToFile);<NEW_LINE>this.bitfield = buildBitfield(chunks, countdownTorrentFiles);<NEW_LINE>this.chunkDescriptors = chunks;<NEW_LINE>this.storageUnits = nonEmptyStorageUnits;<NEW_LINE>this.filesForPieces = pieceNumToFile;<NEW_LINE>}
long totalSize = torrent.getSize();
1,549,734
private static void initializeFTS(SQLiteDatabase db) {<NEW_LINE>db.execSQL(SQL_CREATE_SEARCH_CONTENT_TABLE);<NEW_LINE>db.execSQL(SQL_CREATE_NGRAM_TABLE);<NEW_LINE>db.execSQL(SQL_CREATE_SEARCH_TASK_DELETE_TRIGGER);<NEW_LINE>db.execSQL(SQL_CREATE_SEARCH_TASK_DELETE_PROPERTY_TRIGGER);<NEW_LINE>// create indices<NEW_LINE>db.execSQL(TaskDatabaseHelper.createIndexString(FTS_NGRAM_TABLE, true, NGramColumns.TEXT));<NEW_LINE>db.execSQL(TaskDatabaseHelper.createIndexString(FTS_CONTENT_TABLE, false, FTSContentColumns.NGRAM_ID));<NEW_LINE>db.execSQL(TaskDatabaseHelper.createIndexString(FTS_CONTENT_TABLE, false, FTSContentColumns.TASK_ID));<NEW_LINE>db.execSQL(TaskDatabaseHelper.createIndexString(FTS_CONTENT_TABLE, true, FTSContentColumns.PROPERTY_ID, FTSContentColumns<MASK><NEW_LINE>db.execSQL(TaskDatabaseHelper.createIndexString(FTS_CONTENT_TABLE, true, FTSContentColumns.TYPE, FTSContentColumns.TASK_ID, FTSContentColumns.PROPERTY_ID));<NEW_LINE>}
.TASK_ID, FTSContentColumns.NGRAM_ID));
650,311
private Modifier resolveVisibility(TypeElement clazz) {<NEW_LINE>NestingKind nestingKind = clazz.getNestingKind();<NEW_LINE>if (nestingKind == NestingKind.ANONYMOUS || nestingKind == NestingKind.LOCAL) {<NEW_LINE>return Modifier.PRIVATE;<NEW_LINE>}<NEW_LINE>Set<Modifier<MASK><NEW_LINE>if (nestingKind == NestingKind.TOP_LEVEL) {<NEW_LINE>return mods.contains(Modifier.PUBLIC) ? Modifier.PUBLIC : null;<NEW_LINE>}<NEW_LINE>if (mods.contains(Modifier.PRIVATE)) {<NEW_LINE>return Modifier.PRIVATE;<NEW_LINE>}<NEW_LINE>Modifier mod1 = resolveVisibility((TypeElement) clazz.getEnclosingElement());<NEW_LINE>Modifier mod2 = null;<NEW_LINE>if (mods.contains(Modifier.PUBLIC)) {<NEW_LINE>mod2 = Modifier.PUBLIC;<NEW_LINE>} else if (mods.contains(Modifier.PROTECTED)) {<NEW_LINE>mod2 = Modifier.PROTECTED;<NEW_LINE>}<NEW_LINE>return max(mod1, mod2);<NEW_LINE>}
> mods = clazz.getModifiers();
290,203
private void optionLegend() {<NEW_LINE>// Show help<NEW_LINE>Dialog dialog = new Dialog(ActivityApp.this);<NEW_LINE>dialog.requestWindowFeature(Window.FEATURE_LEFT_ICON);<NEW_LINE>dialog.setTitle(R.string.menu_legend);<NEW_LINE>dialog.setContentView(R.layout.legend);<NEW_LINE>dialog.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, getThemed(R.attr.icon_launcher));<NEW_LINE>((ImageView) dialog.findViewById(R.id.imgHelpHalf)).setImageBitmap(getHalfCheckBox());<NEW_LINE>((ImageView) dialog.findViewById(R.id.imgHelpOnDemand)<MASK><NEW_LINE>for (View child : Util.getViewsByTag((ViewGroup) dialog.findViewById(android.R.id.content), "main")) child.setVisibility(View.GONE);<NEW_LINE>((LinearLayout) dialog.findViewById(R.id.llUnsafe)).setVisibility(PrivacyManager.cVersion3 ? View.VISIBLE : View.GONE);<NEW_LINE>dialog.setCancelable(true);<NEW_LINE>dialog.show();<NEW_LINE>}
).setImageBitmap(getOnDemandCheckBox());
367,757
public void process(BeanArchiveIndexBuildItem beanArchiveIndexBuildItem, BuildProducer<ReflectiveClassBuildItem> reflectiveClass, BuildProducer<ServletInitParamBuildItem> initParamProducer, BuildProducer<ResteasyDeploymentCustomizerBuildItem> deploymentCustomizerProducer) {<NEW_LINE>validateControllers(beanArchiveIndexBuildItem);<NEW_LINE>final IndexView index = beanArchiveIndexBuildItem.getIndex();<NEW_LINE>final Collection<AnnotationInstance> annotations = index.getAnnotations(REST_CONTROLLER_ANNOTATION);<NEW_LINE>if (annotations.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Set<String> classNames = new HashSet<>();<NEW_LINE>for (AnnotationInstance annotation : annotations) {<NEW_LINE>classNames.add(annotation.target().asClass().toString());<NEW_LINE>}<NEW_LINE>// initialize the init params that will be used in case of servlet<NEW_LINE>initParamProducer.produce(new ServletInitParamBuildItem(ResteasyContextParameters.RESTEASY_SCANNED_RESOURCE_CLASSES_WITH_BUILDER, SpringResourceBuilder.class.getName() + ":" + String.join(",", classNames)));<NEW_LINE>// customize the deployment that will be used in case of RESTEasy standalone<NEW_LINE>deploymentCustomizerProducer.produce(new ResteasyDeploymentCustomizerBuildItem(new Consumer<ResteasyDeployment>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void accept(ResteasyDeployment resteasyDeployment) {<NEW_LINE>resteasyDeployment.getScannedResourceClassesWithBuilder().put(SpringResourceBuilder.class.getName(), <MASK><NEW_LINE>}<NEW_LINE>}));<NEW_LINE>reflectiveClass.produce(new ReflectiveClassBuildItem(true, false, false, SpringResourceBuilder.class.getName()));<NEW_LINE>}
new ArrayList<>(classNames));
636,162
private byte[] removeSegmentation(final int mtuSize, final byte[] data) {<NEW_LINE>int srcOffset = 0;<NEW_LINE>int dstOffset = 0;<NEW_LINE>final int chunks = (data.length + (mtuSize - 1)) / mtuSize;<NEW_LINE>if (chunks > 1) {<NEW_LINE>final byte[] buffer = new byte[data.length - (chunks - 1)];<NEW_LINE>int length;<NEW_LINE>for (int i = 0; i < chunks; i++) {<NEW_LINE>// when removing segmentation bits we only remove the start because the pdu type would be the same for each segment.<NEW_LINE>// Therefore we can ignore this pdu type byte as they are already put together in the ble<NEW_LINE>length = Math.min(<MASK><NEW_LINE>if (i == 0) {<NEW_LINE>System.arraycopy(data, srcOffset, buffer, dstOffset, length);<NEW_LINE>buffer[0] = (byte) (buffer[0] & GATT_SAR_UNMASK);<NEW_LINE>} else if (i == chunks - 1) {<NEW_LINE>System.arraycopy(data, srcOffset + 1, buffer, dstOffset, length);<NEW_LINE>} else {<NEW_LINE>length = length - 1;<NEW_LINE>System.arraycopy(data, srcOffset + 1, buffer, dstOffset, length);<NEW_LINE>}<NEW_LINE>srcOffset += mtuSize;<NEW_LINE>dstOffset += length;<NEW_LINE>}<NEW_LINE>return buffer;<NEW_LINE>}<NEW_LINE>return data;<NEW_LINE>}
buffer.length - dstOffset, mtuSize);
701,294
private void addDestroyChildNodesCommand(ICompositeCommand cmd) {<NEW_LINE>View view = (View) getHost().getModel();<NEW_LINE>for (Iterator nit = view.getChildren().iterator(); nit.hasNext(); ) {<NEW_LINE>Node node = (Node) nit.next();<NEW_LINE>switch(OpenDDSDcpsLibVisualIDRegistry.getVisualID(node)) {<NEW_LINE>case RdlQosPolicyAutopurge_disposed_samples_delay2EditPart.VISUAL_ID:<NEW_LINE>for (Iterator cit = node.getChildren().iterator(); cit.hasNext(); ) {<NEW_LINE>Node cnode = (Node) cit.next();<NEW_LINE>// For the OpenDDS Modeling SDK, elements behind compartment children may not necessarily be in the same<NEW_LINE>// library as the element behind the compartment's parent (e.g. a DataReader's shared policies).<NEW_LINE>// In this case avoid destroying the child.<NEW_LINE>if (!OpenDDSLibHelper.areElementsInSameLib(view.getElement(), cnode.getElement())) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(OpenDDSDcpsLibVisualIDRegistry.getVisualID(cnode)) {<NEW_LINE>case Period7EditPart.VISUAL_ID:<NEW_LINE>cmd.add(new // directlyOwned: true<NEW_LINE>DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false)));<NEW_LINE>// don't need explicit deletion of cnode as parent's view deletion would clean child views as well<NEW_LINE>// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case RdlQosPolicyAutopurge_nowriter_samples_delay2EditPart.VISUAL_ID:<NEW_LINE>for (Iterator cit = node.getChildren().iterator(); cit.hasNext(); ) {<NEW_LINE>Node cnode = <MASK><NEW_LINE>// For the OpenDDS Modeling SDK, elements behind compartment children may not necessarily be in the same<NEW_LINE>// library as the element behind the compartment's parent (e.g. a DataReader's shared policies).<NEW_LINE>// In this case avoid destroying the child.<NEW_LINE>if (!OpenDDSLibHelper.areElementsInSameLib(view.getElement(), cnode.getElement())) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>switch(OpenDDSDcpsLibVisualIDRegistry.getVisualID(cnode)) {<NEW_LINE>case Period8EditPart.VISUAL_ID:<NEW_LINE>cmd.add(new // directlyOwned: true<NEW_LINE>DestroyElementCommand(new DestroyElementRequest(getEditingDomain(), cnode.getElement(), false)));<NEW_LINE>// don't need explicit deletion of cnode as parent's view deletion would clean child views as well<NEW_LINE>// cmd.add(new org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand(getEditingDomain(), cnode));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(Node) cit.next();
925,866
public static void assertPeriodCounts(Timeline timeline, int... expectedPeriodCounts) {<NEW_LINE>int windowCount = timeline.getWindowCount();<NEW_LINE>assertThat(windowCount).isEqualTo(expectedPeriodCounts.length);<NEW_LINE>int[] accumulatedPeriodCounts = new int[windowCount + 1];<NEW_LINE>accumulatedPeriodCounts[0] = 0;<NEW_LINE>for (int i = 0; i < windowCount; i++) {<NEW_LINE>accumulatedPeriodCounts[i + 1] = accumulatedPeriodCounts[i] + expectedPeriodCounts[i];<NEW_LINE>}<NEW_LINE>assertThat(timeline.getPeriodCount()).isEqualTo(accumulatedPeriodCounts<MASK><NEW_LINE>Window window = new Window();<NEW_LINE>Period period = new Period();<NEW_LINE>for (int i = 0; i < windowCount; i++) {<NEW_LINE>timeline.getWindow(i, window);<NEW_LINE>assertThat(window.firstPeriodIndex).isEqualTo(accumulatedPeriodCounts[i]);<NEW_LINE>assertThat(window.lastPeriodIndex).isEqualTo(accumulatedPeriodCounts[i + 1] - 1);<NEW_LINE>}<NEW_LINE>int expectedWindowIndex = 0;<NEW_LINE>for (int i = 0; i < timeline.getPeriodCount(); i++) {<NEW_LINE>timeline.getPeriod(i, period, true);<NEW_LINE>while (i >= accumulatedPeriodCounts[expectedWindowIndex + 1]) {<NEW_LINE>expectedWindowIndex++;<NEW_LINE>}<NEW_LINE>assertThat(period.windowIndex).isEqualTo(expectedWindowIndex);<NEW_LINE>Object periodUid = Assertions.checkNotNull(period.uid);<NEW_LINE>assertThat(timeline.getIndexOfPeriod(periodUid)).isEqualTo(i);<NEW_LINE>assertThat(timeline.getUidOfPeriod(i)).isEqualTo(periodUid);<NEW_LINE>for (int repeatMode : REPEAT_MODES) {<NEW_LINE>if (i < accumulatedPeriodCounts[expectedWindowIndex + 1] - 1) {<NEW_LINE>assertThat(timeline.getNextPeriodIndex(i, period, window, repeatMode, false)).isEqualTo(i + 1);<NEW_LINE>} else {<NEW_LINE>int nextWindow = timeline.getNextWindowIndex(expectedWindowIndex, repeatMode, false);<NEW_LINE>int nextPeriod = nextWindow == C.INDEX_UNSET ? C.INDEX_UNSET : accumulatedPeriodCounts[nextWindow];<NEW_LINE>assertThat(timeline.getNextPeriodIndex(i, period, window, repeatMode, false)).isEqualTo(nextPeriod);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
[accumulatedPeriodCounts.length - 1]);
1,219,074
private void scanNonCollectableObjectsInternal(long memoryType) throws CorruptDataException {<NEW_LINE>GCHeapRegionIterator regionIterator = GCHeapRegionIterator.from();<NEW_LINE>while (regionIterator.hasNext()) {<NEW_LINE>GCHeapRegionDescriptor region = regionIterator.next();<NEW_LINE>if (new UDATA(region.getTypeFlags()).allBitsIn(memoryType)) {<NEW_LINE>GCObjectHeapIterator objectIterator = GCObjectHeapIterator.fromHeapRegionDescriptor(region, true, false);<NEW_LINE>while (objectIterator.hasNext()) {<NEW_LINE>J9ObjectPointer object = objectIterator.next();<NEW_LINE>doClassSlot(J9ObjectHelper.clazz(object));<NEW_LINE>GCObjectIterator fieldIterator = GCObjectIterator.fromJ9Object(object, true);<NEW_LINE>GCObjectIterator fieldAddressIterator = <MASK><NEW_LINE>while (fieldIterator.hasNext()) {<NEW_LINE>doNonCollectableObjectSlot(fieldIterator.next(), fieldAddressIterator.nextAddress());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
GCObjectIterator.fromJ9Object(object, true);
672,269
public void handleEvent(Event event) {<NEW_LINE>Rectangle area = lblImage.getBounds();<NEW_LINE>Rectangle carea = c.getBounds();<NEW_LINE>Point ptInDisplay = c.toDisplay(0, 0);<NEW_LINE>event.gc.setAdvanced(true);<NEW_LINE>event.gc.setAntialias(SWT.ON);<NEW_LINE>event.gc.setLineWidth(2);<NEW_LINE>if (new Rectangle(ptInDisplay.x, ptInDisplay.y, carea.width, carea.height).contains(event.display.getCursorLocation())) {<NEW_LINE>// if (event.display.getCursorControl() == lblImage) {<NEW_LINE>Color color1 = ColorCache.getColor(event.gc.getDevice(), 252, 253, 255);<NEW_LINE>Color color2 = ColorCache.getColor(event.gc.getDevice(), 169, 195, 252);<NEW_LINE>Pattern pattern = new Pattern(event.gc.getDevice(), 0, 0, 0, area.height, color1, 0, color2, 200);<NEW_LINE>event.gc.setBackgroundPattern(pattern);<NEW_LINE>event.gc.fillRoundRectangle(0, 0, area.width - 1, area.height - 1, 20, 20);<NEW_LINE>event.gc.setBackgroundPattern(null);<NEW_LINE>pattern.dispose();<NEW_LINE>pattern = new Pattern(event.gc.getDevice(), 0, 0, 0, area.height, color2, 50, color2, 255);<NEW_LINE>event.gc.setForegroundPattern(pattern);<NEW_LINE>event.gc.drawRoundRectangle(0, 0, area.width - 1, area.height - 1, 20, 20);<NEW_LINE>event.gc.setForegroundPattern(null);<NEW_LINE>pattern.dispose();<NEW_LINE>}<NEW_LINE>Image image = (Image) lblImage.getData("Image");<NEW_LINE>if (image != null) {<NEW_LINE>Rectangle bounds = image.getBounds();<NEW_LINE>event.gc.drawImage(image, bounds.x, bounds.y, bounds.width, bounds.height, 8, 5, bounds.width, bounds.height);<NEW_LINE>} else {<NEW_LINE>Rectangle ca = lblImage.getClientArea();<NEW_LINE>event.gc.setAdvanced(true);<NEW_LINE>event.gc.setAntialias(SWT.ON);<NEW_LINE>event.gc.setAlpha(50);<NEW_LINE>event.gc.setBackground(event.gc.getForeground());<NEW_LINE>event.gc.fillRoundRectangle(ca.x + 10, ca.y + 5, ca.width - 21, ca.<MASK><NEW_LINE>}<NEW_LINE>}
height - 11, 20, 20);
1,826,873
public Tuple2<Params, Iterable<String>> serializeModel(TableSummary summary) {<NEW_LINE>List<String> data = null;<NEW_LINE>if (summary != null) {<NEW_LINE>data = new ArrayList<>();<NEW_LINE>data.add(JsonConverter.toJson(summary.colNames));<NEW_LINE>data.add(String.valueOf(summary.count));<NEW_LINE>data.add(JsonConverter.toJson(summary.numericalColIndices));<NEW_LINE>if (summary.count() != 0) {<NEW_LINE>data.add(VectorUtil.toString(summary.numMissingValue));<NEW_LINE>data.add(VectorUtil.toString(summary.sum));<NEW_LINE>data.add(VectorUtil<MASK><NEW_LINE>data.add(VectorUtil.toString(summary.min));<NEW_LINE>data.add(VectorUtil.toString(summary.max));<NEW_LINE>data.add(VectorUtil.toString(summary.normL1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Tuple2.of(new Params(), data);<NEW_LINE>}
.toString(summary.squareSum));
1,763,127
public boolean apply(Game game, Ability source) {<NEW_LINE>Permanent copyToCreature = game.getPermanent(source.getSourceId());<NEW_LINE>if (copyToCreature != null) {<NEW_LINE>Permanent copyFromCreature = getTargetPointer().getFirstTargetPermanentOrLKI(game, source);<NEW_LINE>if (copyFromCreature != null) {<NEW_LINE>game.copyPermanent(Duration.WhileOnBattlefield, copyFromCreature, copyToCreature.getId()<MASK><NEW_LINE>ContinuousEffect effect = new GainAbilityTargetEffect(new DiesCreatureTriggeredAbility(new DoIfCostPaid(new CemeteryPucaEffect(), new ManaCostsImpl("{1}")), false, StaticFilters.FILTER_PERMANENT_A_CREATURE, true), Duration.WhileOnBattlefield);<NEW_LINE>effect.setTargetPointer(new FixedTarget(copyToCreature.getId(), game));<NEW_LINE>game.addEffect(effect, source);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
, source, new EmptyCopyApplier());
251,408
private void downloadAll(int downloadNum, boolean onlyNew) {<NEW_LINE>if (bookShelfBeans == null || mView.getContext() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AsyncTask.execute(() -> {<NEW_LINE>for (BookShelfBean bookShelfBean : new ArrayList<>(bookShelfBeans)) {<NEW_LINE>if (!bookShelfBean.getTag().equals(BookShelfBean.LOCAL_TAG) && (!onlyNew || bookShelfBean.getHasUpdate())) {<NEW_LINE>List<BookChapterBean> chapterBeanList = BookshelfHelp.getChapterList(bookShelfBean.getNoteUrl());<NEW_LINE>if (chapterBeanList.size() >= bookShelfBean.getDurChapter()) {<NEW_LINE>for (int start = bookShelfBean.getDurChapter(); start < chapterBeanList.size(); start++) {<NEW_LINE>if (!chapterBeanList.get(start).getHasCache(bookShelfBean.getBookInfoBean())) {<NEW_LINE>DownloadBookBean downloadBook = new DownloadBookBean();<NEW_LINE>downloadBook.setName(bookShelfBean.getBookInfoBean().getName());<NEW_LINE>downloadBook.setNoteUrl(bookShelfBean.getNoteUrl());<NEW_LINE>downloadBook.setCoverUrl(bookShelfBean.<MASK><NEW_LINE>downloadBook.setStart(start);<NEW_LINE>downloadBook.setEnd(downloadNum > 0 ? Math.min(chapterBeanList.size() - 1, start + downloadNum - 1) : chapterBeanList.size() - 1);<NEW_LINE>downloadBook.setFinalDate(System.currentTimeMillis());<NEW_LINE>DownloadService.addDownload(mView.getContext(), downloadBook);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
getBookInfoBean().getCoverUrl());
1,476,372
public Context addContext(String contextPath, String docBase, Host host) throws ServletException {<NEW_LINE>log.debug("Add context - path: {} docbase: {}", contextPath, docBase);<NEW_LINE>// instance a context<NEW_LINE>org.apache.catalina.Context ctx = embedded.<MASK><NEW_LINE>if (ctx != null) {<NEW_LINE>// grab the current classloader<NEW_LINE>ClassLoader classLoader = Thread.currentThread().getContextClassLoader();<NEW_LINE>ctx.setParentClassLoader(classLoader);<NEW_LINE>// get the associated loader for the context<NEW_LINE>Object ldr = ctx.getLoader();<NEW_LINE>log.trace("Context loader (null if the context has not been started): {}", ldr);<NEW_LINE>if (ldr == null) {<NEW_LINE>WebappLoader wldr = new WebappLoader(classLoader);<NEW_LINE>// add the Loader to the context<NEW_LINE>ctx.setLoader(wldr);<NEW_LINE>}<NEW_LINE>log.trace("Context loader (check): {} Context classloader: {}", ctx.getLoader(), ctx.getLoader().getClassLoader());<NEW_LINE>LoaderBase.setRed5ApplicationContext(getHostId() + contextPath, new TomcatApplicationContext(ctx));<NEW_LINE>} else {<NEW_LINE>log.trace("Context is null");<NEW_LINE>}<NEW_LINE>return ctx;<NEW_LINE>}
addWebapp(host, contextPath, docBase);
1,168,949
public void fire(SessionLocal session, int type, boolean beforeAction) {<NEW_LINE>if (rowBased || before != beforeAction || (typeMask & type) == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>load();<NEW_LINE>Connection c2 = session.createConnection(false);<NEW_LINE>boolean old = false;<NEW_LINE>if (type != Trigger.SELECT) {<NEW_LINE>old = session.setCommitOrRollbackDisabled(true);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>if (triggerCallback instanceof TriggerAdapter) {<NEW_LINE>((TriggerAdapter) triggerCallback).fire(c2, (ResultSet) null, (ResultSet) null);<NEW_LINE>} else {<NEW_LINE>triggerCallback.fire(c2, null, null);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw getErrorExecutingTrigger(e);<NEW_LINE>} finally {<NEW_LINE>session.setLastIdentity(identity);<NEW_LINE>if (type != Trigger.SELECT) {<NEW_LINE>session.setCommitOrRollbackDisabled(old);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Value identity = session.getLastIdentity();
1,153,907
public void draw(String text) {<NEW_LINE>if (StringUtils.isNotBlank(text)) {<NEW_LINE>text = text.trim();<NEW_LINE>renderer.beginRendering(drawable.getSurfaceWidth(<MASK><NEW_LINE>Rectangle2D bounds = renderer.getBounds(text);<NEW_LINE>int width = (int) bounds.getWidth();<NEW_LINE>int height = (int) bounds.getHeight();<NEW_LINE>int offset = (int) (height * 0.5f);<NEW_LINE>// Figure out the location at which to draw the text<NEW_LINE>int x = 0;<NEW_LINE>int y = 0;<NEW_LINE>switch(textLocation) {<NEW_LINE>case UPPER_LEFT:<NEW_LINE>x = offset;<NEW_LINE>y = drawable.getSurfaceHeight() - height - offset;<NEW_LINE>break;<NEW_LINE>case UPPER_RIGHT:<NEW_LINE>x = drawable.getSurfaceWidth() - width - offset;<NEW_LINE>y = drawable.getSurfaceHeight() - height - offset;<NEW_LINE>break;<NEW_LINE>case LOWER_LEFT:<NEW_LINE>x = offset;<NEW_LINE>y = offset;<NEW_LINE>break;<NEW_LINE>case LOWER_RIGHT:<NEW_LINE>x = drawable.getSurfaceWidth() - width - offset;<NEW_LINE>y = offset;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>renderer.draw(text, x, y);<NEW_LINE>renderer.endRendering();<NEW_LINE>}<NEW_LINE>}
), drawable.getSurfaceHeight());
1,469,679
public void save(GlowVillager entity, CompoundTag tag) {<NEW_LINE>super.save(entity, tag);<NEW_LINE>if (entity.getProfession() != null) {<NEW_LINE>tag.putInt("Profession", entity.getProfession().ordinal());<NEW_LINE>}<NEW_LINE>tag.putInt("Riches", entity.getRiches());<NEW_LINE>tag.putBool("Willing", entity.isWilling());<NEW_LINE>tag.putInt("CareerLevel", entity.getCareerLevel());<NEW_LINE>// Recipes<NEW_LINE>CompoundTag offers = new CompoundTag();<NEW_LINE>List<CompoundTag> recipesList = new ArrayList<>();<NEW_LINE>for (MerchantRecipe recipe : entity.getRecipes()) {<NEW_LINE>CompoundTag recipeTag = new CompoundTag();<NEW_LINE>recipeTag.putBool(<MASK><NEW_LINE>recipeTag.putInt("uses", recipe.getUses());<NEW_LINE>recipeTag.putInt("maxUses", recipe.getMaxUses());<NEW_LINE>recipeTag.putCompound("sell", NbtSerialization.writeItem(recipe.getResult(), 0));<NEW_LINE>recipeTag.putCompound("buy", NbtSerialization.writeItem(recipe.getIngredients().get(0), 0));<NEW_LINE>if (recipe.getIngredients().size() > 1) {<NEW_LINE>recipeTag.putCompound("buyB", NbtSerialization.writeItem(recipe.getIngredients().get(1), 0));<NEW_LINE>}<NEW_LINE>recipesList.add(recipeTag);<NEW_LINE>}<NEW_LINE>offers.putCompoundList("Recipes", recipesList);<NEW_LINE>tag.putCompound("Offers", offers);<NEW_LINE>// TODO: remaining data<NEW_LINE>}
"rewardExp", recipe.hasExperienceReward());
132,609
public VTMatch addMatch(VTMatchInfo info) {<NEW_LINE>AssociationDatabaseManager associationManager = session.getAssociationManagerDBM();<NEW_LINE>VTAssociationDB associationDB = associationManager.getOrCreateAssociationDB(info.getSourceAddress(), info.getDestinationAddress(), info.getAssociationType());<NEW_LINE>VTMatchTag tag = info.getTag();<NEW_LINE>VTMatch newMatch = null;<NEW_LINE>try {<NEW_LINE>lock.acquire();<NEW_LINE>VTMatchTagDB tagDB = session.getOrCreateMatchTagDB(tag);<NEW_LINE>DBRecord matchRecord = matchTableAdapter.insertMatchRecord(<MASK><NEW_LINE>newMatch = getMatchForRecord(matchRecord);<NEW_LINE>} catch (IOException e) {<NEW_LINE>dbError(e);<NEW_LINE>} finally {<NEW_LINE>lock.release();<NEW_LINE>}<NEW_LINE>if (newMatch != null) {<NEW_LINE>session.setObjectChanged(VTChangeManager.DOCR_VT_MATCH_ADDED, newMatch, null, newMatch);<NEW_LINE>}<NEW_LINE>return newMatch;<NEW_LINE>}
info, this, associationDB, tagDB);
1,422,410
private static Map<String, MetadataFieldMapper.TypeParser> initBuiltInMetadataMappers() {<NEW_LINE>Map<MASK><NEW_LINE>// Use a LinkedHashMap for metadataMappers because iteration order matters<NEW_LINE>builtInMetadataMappers = new LinkedHashMap<>();<NEW_LINE>// _ignored first so that we always load it, even if only _id is requested<NEW_LINE>builtInMetadataMappers.put(IgnoredFieldMapper.NAME, new IgnoredFieldMapper.TypeParser());<NEW_LINE>// UID second so it will be the first (if no ignored fields) stored field to load<NEW_LINE>// (so will benefit from "fields: []" early termination<NEW_LINE>builtInMetadataMappers.put(UidFieldMapper.NAME, new UidFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(IdFieldMapper.NAME, new IdFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(RoutingFieldMapper.NAME, new RoutingFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(IndexFieldMapper.NAME, new IndexFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(SourceFieldMapper.NAME, new SourceFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(TypeFieldMapper.NAME, new TypeFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(AllFieldMapper.NAME, new AllFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(VersionFieldMapper.NAME, new VersionFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(ParentFieldMapper.NAME, new ParentFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(SeqNoFieldMapper.NAME, new SeqNoFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(TokenFieldMapper.NAME, new TokenFieldMapper.TypeParser());<NEW_LINE>builtInMetadataMappers.put(HostFieldMapper.NAME, new HostFieldMapper.TypeParser());<NEW_LINE>// _field_names must be added last so that it has a chance to see all the other mappers<NEW_LINE>builtInMetadataMappers.put(FieldNamesFieldMapper.NAME, new FieldNamesFieldMapper.TypeParser());<NEW_LINE>return Collections.unmodifiableMap(builtInMetadataMappers);<NEW_LINE>}
<String, MetadataFieldMapper.TypeParser> builtInMetadataMappers;
708,871
public static void main(String[] args) {<NEW_LINE>if (args.length == 0) {<NEW_LINE>args = new String[] { "C:\\temp\\downloads.config", "C:\\temp\\downloads-9-3-05.config", "C:\\temp\\merged.config" };<NEW_LINE>} else if (args.length != 3) {<NEW_LINE>System.out.println("Usage: newer_config_file older_config_file save_config_file");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Map map1 = FileUtil.readResilientFile(FileUtil.newFile(args[0]));<NEW_LINE>Map map2 = FileUtil.readResilientFile(FileUtil.newFile(args[1]));<NEW_LINE>List downloads1 = (List) map1.get("downloads");<NEW_LINE>List downloads2 = (List) map2.get("downloads");<NEW_LINE>Set torrents = new HashSet();<NEW_LINE>Iterator it1 = downloads1.iterator();<NEW_LINE>while (it1.hasNext()) {<NEW_LINE>Map m = (Map) it1.next();<NEW_LINE>byte[] hash = (byte[]) m.get("torrent_hash");<NEW_LINE>System.out.println("1:" + ByteFormatter.nicePrint(hash));<NEW_LINE>torrents.add(new HashWrapper(hash));<NEW_LINE>}<NEW_LINE>List to_add = new ArrayList();<NEW_LINE>Iterator it2 = downloads2.iterator();<NEW_LINE>while (it2.hasNext()) {<NEW_LINE>Map m = (Map) it2.next();<NEW_LINE>byte[] hash = (byte[]) m.get("torrent_hash");<NEW_LINE><MASK><NEW_LINE>if (torrents.contains(wrapper)) {<NEW_LINE>System.out.println("-:" + ByteFormatter.nicePrint(hash));<NEW_LINE>} else {<NEW_LINE>System.out.println("2:" + ByteFormatter.nicePrint(hash));<NEW_LINE>to_add.add(m);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>downloads1.addAll(to_add);<NEW_LINE>System.out.println(to_add.size() + " copied from " + args[1] + " to " + args[2]);<NEW_LINE>FileUtil.writeResilientFile(FileUtil.newFile(args[2]), map1);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
HashWrapper wrapper = new HashWrapper(hash);
758,776
public BufferAggregator factorizeBuffered(ColumnSelectorFactory metricFactory) {<NEW_LINE>ColumnValueSelector<?> selector = metricFactory.makeColumnValueSelector(fieldName);<NEW_LINE>if (selector instanceof NilColumnValueSelector) {<NEW_LINE>return NoopBufferAggregator.instance();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (ValueType.FLOAT.name().equalsIgnoreCase(type)) {<NEW_LINE>return new VarianceBufferAggregator.FloatVarianceAggregator(selector);<NEW_LINE>} else if (ValueType.DOUBLE.name().equalsIgnoreCase(type)) {<NEW_LINE>return new VarianceBufferAggregator.DoubleVarianceAggregator(selector);<NEW_LINE>} else if (ValueType.LONG.name().equalsIgnoreCase(type)) {<NEW_LINE>return new VarianceBufferAggregator.LongVarianceAggregator(selector);<NEW_LINE>} else if (VARIANCE_TYPE_NAME.equalsIgnoreCase(type) || ValueType.COMPLEX.name().equalsIgnoreCase(type)) {<NEW_LINE>return new VarianceBufferAggregator.ObjectVarianceAggregator(selector);<NEW_LINE>}<NEW_LINE>throw new IAE("Incompatible type for metric[%s], expected a float, double, long, or variance, but got a %s", fieldName, type);<NEW_LINE>}
final String type = getTypeString(metricFactory);
772,316
List<String> toStringArray() {<NEW_LINE>List<String> ss = new ArrayList<>(moduleProps);<NEW_LINE>Set<String> keys = xxProps.keySet();<NEW_LINE>for (String name : keys) {<NEW_LINE>String value = xxProps.get(name);<NEW_LINE>if (value != null) {<NEW_LINE>ss.add("-XX" + name + "=" + value);<NEW_LINE>} else {<NEW_LINE>ss.add("-XX" + name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>keys = xProps.keySet();<NEW_LINE>for (String name : keys) {<NEW_LINE>String value = xProps.get(name);<NEW_LINE>if (value != null) {<NEW_LINE>ss.add("-X" + name + "=" + value);<NEW_LINE>} else {<NEW_LINE>ss.add("-X" + name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>keys = plainProps.keySet();<NEW_LINE>for (String name : keys) {<NEW_LINE>String value = plainProps.get(name);<NEW_LINE>if (value != null) {<NEW_LINE>ss.add(<MASK><NEW_LINE>} else {<NEW_LINE>ss.add("-" + name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>keys = sysProps.keySet();<NEW_LINE>for (String name : keys) {<NEW_LINE>String value = sysProps.get(name);<NEW_LINE>if (value != null) {<NEW_LINE>ss.add("-D" + name + "=" + value);<NEW_LINE>} else {<NEW_LINE>ss.add("-D" + name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return postProcessOrdering(ss);<NEW_LINE>}
"-" + name + "=" + value);
85,539
final DeleteOpsMetadataResult executeDeleteOpsMetadata(DeleteOpsMetadataRequest deleteOpsMetadataRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteOpsMetadataRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteOpsMetadataRequest> request = null;<NEW_LINE>Response<DeleteOpsMetadataResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteOpsMetadataRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteOpsMetadataRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteOpsMetadata");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteOpsMetadataResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteOpsMetadataResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,132,042
private void apolloLoad(final Supplier<Context> context, final LoaderHandler<ApolloConfig> handler, final ApolloConfig config) {<NEW_LINE>if (config != null) {<NEW_LINE>check(config);<NEW_LINE>LOGGER.info("loader apollo config: {}", config);<NEW_LINE>String fileExtension = config.getFileExtension();<NEW_LINE>PropertyLoader propertyLoader = LOADERS.get(fileExtension);<NEW_LINE>if (propertyLoader == null) {<NEW_LINE>throw new ConfigException("apollo.fileExtension setting error, The loader was not found");<NEW_LINE>}<NEW_LINE>InputStream pull = client.pull(config);<NEW_LINE>Optional.ofNullable(pull).map(e -> propertyLoader.load("remote.apollo." + fileExtension, e)).ifPresent(e -> context.get().getOriginal().load(() -> context.get().withSources(e), this::apolloFinish));<NEW_LINE><MASK><NEW_LINE>passive(context, null, config);<NEW_LINE>} else {<NEW_LINE>throw new ConfigException("apollo config is null");<NEW_LINE>}<NEW_LINE>}
handler.finish(context, config);
1,586,932
public V fillAndGet(Object key) {<NEW_LINE>if (containsKey(key)) {<NEW_LINE>return this.get(key);<NEW_LINE>}<NEW_LINE>Type expectedType = null;<NEW_LINE>// The type should be a record or map for filling read.<NEW_LINE>if (this.type.getTag() == TypeTags.RECORD_TYPE_TAG) {<NEW_LINE>BRecordType recordType = (BRecordType) this.type;<NEW_LINE>Map fields = recordType.getFields();<NEW_LINE>if (fields.containsKey(key.toString())) {<NEW_LINE>expectedType = ((BField) fields.get(key.toString())).getFieldType();<NEW_LINE>} else {<NEW_LINE>if (recordType.sealed) {<NEW_LINE>// Panic if this record type does not contain a key by the specified name.<NEW_LINE>throw ErrorCreator.createError(MAP_KEY_NOT_FOUND_ERROR, BLangExceptionHelper.getErrorDetails(RuntimeErrors.KEY_NOT_FOUND_ERROR, key));<NEW_LINE>}<NEW_LINE>expectedType = recordType.restFieldType;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>expectedType = ((BMapType) this.type).getConstrainedType();<NEW_LINE>}<NEW_LINE>if (!TypeChecker.hasFillerValue(expectedType)) {<NEW_LINE>// Panic if the field does not have a filler value.<NEW_LINE>throw ErrorCreator.createError(MAP_KEY_NOT_FOUND_ERROR, BLangExceptionHelper.getErrorDetails(RuntimeErrors.KEY_NOT_FOUND_ERROR, key));<NEW_LINE>}<NEW_LINE>Object value = expectedType.getZeroValue();<NEW_LINE>this.put((K<MASK><NEW_LINE>return (V) value;<NEW_LINE>}
) key, (V) value);
1,576,713
public void checkFile() throws MojoExecutionException {<NEW_LINE>resetExamination();<NEW_LINE>Manifest mf = null;<NEW_LINE>if (jarFile != null) {<NEW_LINE>JarFile jar = null;<NEW_LINE>try {<NEW_LINE>jar = new JarFile(jarFile);<NEW_LINE>mf = jar.getManifest();<NEW_LINE>} catch (Exception exc) {<NEW_LINE>throw new MojoExecutionException("Opening " + jarFile + ": " + exc, exc);<NEW_LINE>} finally {<NEW_LINE>if (jar != null) {<NEW_LINE>try {<NEW_LINE>jar.close();<NEW_LINE>} catch (IOException io) {<NEW_LINE>throw new MojoExecutionException(io.getMessage(), io);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (manifestFile != null) {<NEW_LINE>InputStream stream = null;<NEW_LINE>try {<NEW_LINE>stream = new FileInputStream(manifestFile);<NEW_LINE>mf = new Manifest(stream);<NEW_LINE>} catch (Exception exc) {<NEW_LINE>throw new MojoExecutionException("Opening " + manifestFile + ": " + exc, exc);<NEW_LINE>} finally {<NEW_LINE>if (stream != null) {<NEW_LINE>try {<NEW_LINE>stream.close();<NEW_LINE>} catch (IOException io) {<NEW_LINE>throw new MojoExecutionException(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mf != null) {<NEW_LINE>processManifest(mf);<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>throw new MojoExecutionException("Cannot read jar file or manifest file");<NEW_LINE>}<NEW_LINE>}
io.getMessage(), io);
869,185
private static int parseLinearGradient(SvgContainer container, char[] ca, int start, int end) {<NEW_LINE>end = <MASK><NEW_LINE>if (end != -1) {<NEW_LINE>int endAttrs = closer(ca, start, end);<NEW_LINE>SvgGradient gradient = new SvgGradient(container, getAttrValue(ca, start, endAttrs, ATTR_ID));<NEW_LINE>gradient.data = new float[4];<NEW_LINE>gradient.data[0] = parsePercentage(getAttrValue(ca, start, endAttrs, ATTR_X1), 0f, false);<NEW_LINE>gradient.data[1] = parsePercentage(getAttrValue(ca, start, endAttrs, ATTR_Y1), 0f, false);<NEW_LINE>gradient.data[2] = parsePercentage(getAttrValue(ca, start, endAttrs, ATTR_X2), 1f, false);<NEW_LINE>gradient.data[3] = parsePercentage(getAttrValue(ca, start, endAttrs, ATTR_Y2), 0f, false);<NEW_LINE>gradient.setLinkId(getAttrValue(ca, start, endAttrs, ATTR_XLINK_HREF));<NEW_LINE>gradient.setSpreadMethod(getAttrValue(ca, start, endAttrs, ATTR_SPREAD_METHOD));<NEW_LINE>gradient.setUnits(getAttrValue(ca, start, endAttrs, ATTR_GRADIENT_UNITS));<NEW_LINE>gradient.transform = getTransform(ca, getAttrValueRange(ca, start, endAttrs, ATTR_GRADIENT_TRANSFORM));<NEW_LINE>int s1 = endAttrs;<NEW_LINE>while (s1 != -1 && s1 < end) {<NEW_LINE>s1 = findNextTag(ca, s1 + 1, end);<NEW_LINE>if (isNext(ca, s1 + 1, ATTR_STOP)) {<NEW_LINE>s1 = parseGradientStop(gradient, ca, s1, end);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return end;<NEW_LINE>}
findClosingTag(ca, start, end);
98,663
public void onMatchReturn(NullAway analysis, ReturnTree tree, VisitorState state) {<NEW_LINE>// Figure out the enclosing method node<NEW_LINE>TreePath enclosingMethodOrLambda = NullabilityUtil.<MASK><NEW_LINE>if (enclosingMethodOrLambda == null) {<NEW_LINE>throw new RuntimeException("no enclosing method, lambda or initializer!");<NEW_LINE>}<NEW_LINE>if (!(enclosingMethodOrLambda.getLeaf() instanceof MethodTree || enclosingMethodOrLambda.getLeaf() instanceof LambdaExpressionTree)) {<NEW_LINE>throw new RuntimeException("return statement outside of a method or lambda! (e.g. in an initializer block)");<NEW_LINE>}<NEW_LINE>Tree leaf = enclosingMethodOrLambda.getLeaf();<NEW_LINE>if (filterMethodOrLambdaSet.contains(leaf)) {<NEW_LINE>returnToEnclosingMethodOrLambda.put(tree, leaf);<NEW_LINE>// We need to manually trigger the dataflow analysis to run on the filter method,<NEW_LINE>// this ensures onDataflowVisitReturn(...) gets called for all return statements in this<NEW_LINE>// method before<NEW_LINE>// onDataflowInitialStore(...) is called for all successor methods in the observable chain.<NEW_LINE>// Caching should prevent us from re-analyzing any given method.<NEW_LINE>AccessPathNullnessAnalysis nullnessAnalysis = analysis.getNullnessAnalysis(state);<NEW_LINE>nullnessAnalysis.forceRunOnMethod(new TreePath(state.getPath(), leaf), state.context);<NEW_LINE>}<NEW_LINE>}
findEnclosingMethodOrLambdaOrInitializer(state.getPath());
15,724
public static ListCompliancePacksResponse unmarshall(ListCompliancePacksResponse listCompliancePacksResponse, UnmarshallerContext _ctx) {<NEW_LINE>listCompliancePacksResponse.setRequestId(_ctx.stringValue("ListCompliancePacksResponse.RequestId"));<NEW_LINE>CompliancePacksResult compliancePacksResult = new CompliancePacksResult();<NEW_LINE>compliancePacksResult.setPageSize(_ctx.integerValue("ListCompliancePacksResponse.CompliancePacksResult.PageSize"));<NEW_LINE>compliancePacksResult.setPageNumber(_ctx.integerValue("ListCompliancePacksResponse.CompliancePacksResult.PageNumber"));<NEW_LINE>compliancePacksResult.setTotalCount(_ctx.longValue("ListCompliancePacksResponse.CompliancePacksResult.TotalCount"));<NEW_LINE>List<CompliancePacksItem> compliancePacks = new ArrayList<CompliancePacksItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListCompliancePacksResponse.CompliancePacksResult.CompliancePacks.Length"); i++) {<NEW_LINE>CompliancePacksItem compliancePacksItem = new CompliancePacksItem();<NEW_LINE>compliancePacksItem.setStatus(_ctx.stringValue("ListCompliancePacksResponse.CompliancePacksResult.CompliancePacks[" + i + "].Status"));<NEW_LINE>compliancePacksItem.setCompliancePackId(_ctx.stringValue("ListCompliancePacksResponse.CompliancePacksResult.CompliancePacks[" + i + "].CompliancePackId"));<NEW_LINE>compliancePacksItem.setRiskLevel(_ctx.integerValue<MASK><NEW_LINE>compliancePacksItem.setDescription(_ctx.stringValue("ListCompliancePacksResponse.CompliancePacksResult.CompliancePacks[" + i + "].Description"));<NEW_LINE>compliancePacksItem.setCompliancePackName(_ctx.stringValue("ListCompliancePacksResponse.CompliancePacksResult.CompliancePacks[" + i + "].CompliancePackName"));<NEW_LINE>compliancePacksItem.setAccountId(_ctx.longValue("ListCompliancePacksResponse.CompliancePacksResult.CompliancePacks[" + i + "].AccountId"));<NEW_LINE>compliancePacksItem.setCompliancePackTemplateId(_ctx.stringValue("ListCompliancePacksResponse.CompliancePacksResult.CompliancePacks[" + i + "].CompliancePackTemplateId"));<NEW_LINE>compliancePacksItem.setCreateTimestamp(_ctx.longValue("ListCompliancePacksResponse.CompliancePacksResult.CompliancePacks[" + i + "].CreateTimestamp"));<NEW_LINE>compliancePacks.add(compliancePacksItem);<NEW_LINE>}<NEW_LINE>compliancePacksResult.setCompliancePacks(compliancePacks);<NEW_LINE>listCompliancePacksResponse.setCompliancePacksResult(compliancePacksResult);<NEW_LINE>return listCompliancePacksResponse;<NEW_LINE>}
("ListCompliancePacksResponse.CompliancePacksResult.CompliancePacks[" + i + "].RiskLevel"));
244,506
public EventTypeList requestListOfEventTypesForTenant(String xSdsServiceToken) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/provisioning/webhooks/event_types";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new <MASK><NEW_LINE>if (xSdsServiceToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Service-Token", apiClient.parameterToString(xSdsServiceToken));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>GenericType<EventTypeList> localVarReturnType = new GenericType<EventTypeList>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
HashMap<String, Object>();
1,760,396
public static DescribeCdnDomainLogsResponse unmarshall(DescribeCdnDomainLogsResponse describeCdnDomainLogsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeCdnDomainLogsResponse.setRequestId(_ctx.stringValue("DescribeCdnDomainLogsResponse.RequestId"));<NEW_LINE>List<DomainLogDetail> domainLogDetails = new ArrayList<DomainLogDetail>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeCdnDomainLogsResponse.DomainLogDetails.Length"); i++) {<NEW_LINE>DomainLogDetail domainLogDetail = new DomainLogDetail();<NEW_LINE>domainLogDetail.setDomainName(_ctx.stringValue("DescribeCdnDomainLogsResponse.DomainLogDetails[" + i + "].DomainName"));<NEW_LINE>domainLogDetail.setLogCount(_ctx.longValue("DescribeCdnDomainLogsResponse.DomainLogDetails[" + i + "].LogCount"));<NEW_LINE>PageInfos pageInfos = new PageInfos();<NEW_LINE>pageInfos.setPageIndex(_ctx.longValue("DescribeCdnDomainLogsResponse.DomainLogDetails[" + i + "].PageInfos.PageIndex"));<NEW_LINE>pageInfos.setPageSize(_ctx.longValue("DescribeCdnDomainLogsResponse.DomainLogDetails[" + i + "].PageInfos.PageSize"));<NEW_LINE>pageInfos.setTotal(_ctx.longValue("DescribeCdnDomainLogsResponse.DomainLogDetails[" + i + "].PageInfos.Total"));<NEW_LINE>domainLogDetail.setPageInfos(pageInfos);<NEW_LINE>List<LogInfoDetail> logInfos = new ArrayList<LogInfoDetail>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeCdnDomainLogsResponse.DomainLogDetails[" + i + "].LogInfos.Length"); j++) {<NEW_LINE>LogInfoDetail logInfoDetail = new LogInfoDetail();<NEW_LINE>logInfoDetail.setLogName(_ctx.stringValue("DescribeCdnDomainLogsResponse.DomainLogDetails[" + i + "].LogInfos[" + j + "].LogName"));<NEW_LINE>logInfoDetail.setLogPath(_ctx.stringValue("DescribeCdnDomainLogsResponse.DomainLogDetails[" + i + "].LogInfos[" + j + "].LogPath"));<NEW_LINE>logInfoDetail.setLogSize(_ctx.longValue("DescribeCdnDomainLogsResponse.DomainLogDetails[" + i <MASK><NEW_LINE>logInfoDetail.setStartTime(_ctx.stringValue("DescribeCdnDomainLogsResponse.DomainLogDetails[" + i + "].LogInfos[" + j + "].StartTime"));<NEW_LINE>logInfoDetail.setEndTime(_ctx.stringValue("DescribeCdnDomainLogsResponse.DomainLogDetails[" + i + "].LogInfos[" + j + "].EndTime"));<NEW_LINE>logInfos.add(logInfoDetail);<NEW_LINE>}<NEW_LINE>domainLogDetail.setLogInfos(logInfos);<NEW_LINE>domainLogDetails.add(domainLogDetail);<NEW_LINE>}<NEW_LINE>describeCdnDomainLogsResponse.setDomainLogDetails(domainLogDetails);<NEW_LINE>return describeCdnDomainLogsResponse;<NEW_LINE>}
+ "].LogInfos[" + j + "].LogSize"));
1,558,705
public Request<BundleInstanceRequest> marshall(BundleInstanceRequest bundleInstanceRequest) {<NEW_LINE>if (bundleInstanceRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<BundleInstanceRequest> request = new DefaultRequest<MASK><NEW_LINE>request.addParameter("Action", "BundleInstance");<NEW_LINE>request.addParameter("Version", "2015-10-01");<NEW_LINE>if (bundleInstanceRequest.getInstanceId() != null) {<NEW_LINE>request.addParameter("InstanceId", StringUtils.fromString(bundleInstanceRequest.getInstanceId()));<NEW_LINE>}<NEW_LINE>Storage storageStorage = bundleInstanceRequest.getStorage();<NEW_LINE>if (storageStorage != null) {<NEW_LINE>S3Storage s3StorageS3 = storageStorage.getS3();<NEW_LINE>if (s3StorageS3 != null) {<NEW_LINE>if (s3StorageS3.getBucket() != null) {<NEW_LINE>request.addParameter("Storage.S3.Bucket", StringUtils.fromString(s3StorageS3.getBucket()));<NEW_LINE>}<NEW_LINE>if (s3StorageS3.getPrefix() != null) {<NEW_LINE>request.addParameter("Storage.S3.Prefix", StringUtils.fromString(s3StorageS3.getPrefix()));<NEW_LINE>}<NEW_LINE>if (s3StorageS3.getAWSAccessKeyId() != null) {<NEW_LINE>request.addParameter("Storage.S3.AWSAccessKeyId", StringUtils.fromString(s3StorageS3.getAWSAccessKeyId()));<NEW_LINE>}<NEW_LINE>if (s3StorageS3.getUploadPolicy() != null) {<NEW_LINE>request.addParameter("Storage.S3.UploadPolicy", StringUtils.fromString(s3StorageS3.getUploadPolicy()));<NEW_LINE>}<NEW_LINE>if (s3StorageS3.getUploadPolicySignature() != null) {<NEW_LINE>request.addParameter("Storage.S3.UploadPolicySignature", StringUtils.fromString(s3StorageS3.getUploadPolicySignature()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
<BundleInstanceRequest>(bundleInstanceRequest, "AmazonEC2");
1,297,611
public void visit(BLangJoinClause joinClause, AnalyzerData data) {<NEW_LINE>boolean prevBreakEnv = data.breakToParallelQueryEnv;<NEW_LINE>BLangExpression collection = joinClause.collection;<NEW_LINE>if (collection.getKind() == NodeKind.QUERY_EXPR || (collection.getKind() == NodeKind.GROUP_EXPR && ((BLangGroupExpr) collection).expression.getKind() == NodeKind.QUERY_EXPR)) {<NEW_LINE>data.breakToParallelQueryEnv = true;<NEW_LINE>}<NEW_LINE>SymbolEnv joinEnv = SymbolEnv.createTypeNarrowedEnv(joinClause, data.queryEnvs.pop());<NEW_LINE>joinClause.env = joinEnv;<NEW_LINE>data.queryEnvs.push(joinEnv);<NEW_LINE>checkExpr(joinClause.collection, data.queryEnvs.peek(), data);<NEW_LINE>// Set the type of the foreach node's type node.<NEW_LINE>types.setInputClauseTypedBindingPatternType(joinClause);<NEW_LINE>handleInputClauseVariables(joinClause, data.queryEnvs.peek());<NEW_LINE>if (joinClause.onClause != null) {<NEW_LINE>((BLangOnClause) joinClause.onClause<MASK><NEW_LINE>}<NEW_LINE>data.breakToParallelQueryEnv = prevBreakEnv;<NEW_LINE>}
).accept(this, data);
616,060
public void lookupDestination(SIPUri suri, NaptrRequestListener listener) {<NEW_LINE>if (!_naptrAutoResolve) {<NEW_LINE>listener.error(new SipURIResolveException("Resolver service not initialized."));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean fix = fixNonStandardURI(suri);<NEW_LINE>SipURILookupCallbackImpl callback = new SipURILookupCallbackImpl(listener, fix);<NEW_LINE>// create the SipURILookup object //<NEW_LINE>SipURILookup request = SipResolverService.getInstance(callback, suri);<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>StringBuilder buff = new StringBuilder();<NEW_LINE>buff.append(" Requested Uri = <").append(suri.toString()).append(">").append(" NaptrRequestListener = <").append(listener).append(">").append(" SipURILookup object = <").append(request.getSipURI().toString<MASK><NEW_LINE>c_logger.traceDebug(this, "lookupDestination", buff.toString());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (request.lookup()) {<NEW_LINE>// Get the answer sync<NEW_LINE>List<SIPUri> response = request.getAnswer();<NEW_LINE>if (response == null || response.size() < 1) {<NEW_LINE>callback.error(request, new SipURILookupException());<NEW_LINE>} else {<NEW_LINE>callback.complete(request);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SipURILookupException e) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "lookupDestination", "SipURILookupException when lookup = " + e.getMessage());<NEW_LINE>}<NEW_LINE>callback.error(request, e);<NEW_LINE>}<NEW_LINE>}
()).append(">");
1,291,376
public WorksheetTaskWrapper<Void> doAction(String id, WorksheetContext ctx) {<NEW_LINE>ExampleActionTask task = null;<NEW_LINE>switch(id) {<NEW_LINE>case ACTION_BOTH_ID:<NEW_LINE>task = new ExampleActionTask(ExtensionResources.get(ExtensionResources.WORKSHEET_ACTION_BOTH), ctx.getConnectionName(), ctx.getCallback(), id, false);<NEW_LINE>break;<NEW_LINE>case ACTION_CONTEXT_MENU_ONLY_ID:<NEW_LINE>task = new ExampleActionTask(ExtensionResources.get(ExtensionResources.WORKSHEET_ACTION_CONTEXT_MENU_ONLY), ctx.getConnectionName(), ctx.getCallback(), id, true);<NEW_LINE>break;<NEW_LINE>case ACTION_TOOLBAR_ONLY_ID:<NEW_LINE>task = new ExampleActionTask(ExtensionResources.get(ExtensionResources.WORKSHEET_ACTION_TOOLBAR_ONLY), ctx.getConnectionName(), ctx.<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>task = null;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (null == task) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new WorksheetTaskWrapper<Void>(task, getTaskListenerList(), getTaskUIListenerList(), Collections.singletonList(ctx.getTaskViewer()), ctx);<NEW_LINE>}
getCallback(), id, false);
1,754,535
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>super.onViewCreated(view, savedInstanceState);<NEW_LINE>GroupId.V2 groupId = getGroupId();<NEW_LINE>GroupLinkInviteFriendsViewModel.Factory factory = new GroupLinkInviteFriendsViewModel.Factory(requireContext().getApplicationContext(), groupId);<NEW_LINE>GroupLinkInviteFriendsViewModel viewModel = ViewModelProviders.of(this, factory).get(GroupLinkInviteFriendsViewModel.class);<NEW_LINE>viewModel.getGroupInviteLinkAndStatus().observe(getViewLifecycleOwner(), groupLinkUrlAndStatus -> {<NEW_LINE>if (groupLinkUrlAndStatus.isEnabled()) {<NEW_LINE>groupLinkShareButton.setVisibility(View.VISIBLE);<NEW_LINE>groupLinkEnableAndShareButton.setVisibility(View.INVISIBLE);<NEW_LINE>memberApprovalRow.setVisibility(View.GONE);<NEW_LINE>memberApprovalRow2.setVisibility(View.GONE);<NEW_LINE>groupLinkShareButton.setOnClickListener(v -> shareGroupLinkAndDismiss(groupId));<NEW_LINE>} else {<NEW_LINE>memberApprovalRow.setVisibility(View.VISIBLE);<NEW_LINE>memberApprovalRow2.setVisibility(View.VISIBLE);<NEW_LINE>groupLinkEnableAndShareButton.setVisibility(View.VISIBLE);<NEW_LINE>groupLinkShareButton.setVisibility(View.INVISIBLE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>memberApprovalRow.setOnClickListener(v -> viewModel.toggleMemberApproval());<NEW_LINE>viewModel.getMemberApproval().observe(getViewLifecycleOwner(), enabled -> memberApprovalSwitch.setChecked(enabled));<NEW_LINE>viewModel.isBusy().observe(<MASK><NEW_LINE>viewModel.getEnableErrors().observe(getViewLifecycleOwner(), error -> {<NEW_LINE>Toast.makeText(requireContext(), errorToMessage(error), Toast.LENGTH_SHORT).show();<NEW_LINE>if (error == EnableInviteLinkError.NOT_IN_GROUP || error == EnableInviteLinkError.INSUFFICIENT_RIGHTS) {<NEW_LINE>dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>groupLinkEnableAndShareButton.setOnClickListener(v -> viewModel.enable());<NEW_LINE>viewModel.getEnableSuccess().observe(getViewLifecycleOwner(), joinGroupSuccess -> {<NEW_LINE>Log.i(TAG, "Group link enabled, sharing");<NEW_LINE>shareGroupLinkAndDismiss(groupId);<NEW_LINE>});<NEW_LINE>}
getViewLifecycleOwner(), this::setBusy);
128,200
int run(final Namespace options, final HeliosClient client, final PrintStream out, final boolean json, final BufferedReader stdin) throws ExecutionException, InterruptedException {<NEW_LINE>final String jobIdString = options.getString(jobArg.getDest());<NEW_LINE>final String hostPattern = options.getString(hostArg.getDest());<NEW_LINE>final boolean full = options.getBoolean(fullArg.getDest());<NEW_LINE>if (Strings.isNullOrEmpty(jobIdString) && Strings.isNullOrEmpty(hostPattern)) {<NEW_LINE>if (!json) {<NEW_LINE>out.printf("WARNING: listing status of all hosts in the cluster is a slow operation. " + "Consider adding the --job and/or --host flag(s)!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Set<JobId> jobIds = client.jobs(jobIdString, hostPattern).get().keySet();<NEW_LINE>if (!Strings.isNullOrEmpty(jobIdString) && jobIds.isEmpty()) {<NEW_LINE>if (json) {<NEW_LINE>out.println("{ }");<NEW_LINE>} else {<NEW_LINE>out.printf("job id matcher \"%s\" matched no jobs%n", jobIdString);<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>final Map<JobId, JobStatus> statuses = new TreeMap<>(client.jobStatuses(jobIds).get());<NEW_LINE>if (json) {<NEW_LINE>showJsonStatuses(out, hostPattern, jobIds, statuses);<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>final JobStatusTable table = jobStatusTable(out, full);<NEW_LINE>final boolean noHostMatchedEver = showStatusesForHosts(hostPattern, jobIds, statuses, new HostStatusDisplayer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void matchedStatus(JobStatus jobStatus, Iterable<String> matchingHosts, Map<String, TaskStatus> taskStatuses) {<NEW_LINE>displayTask(full, table, jobStatus.getJob().getId(), jobStatus, taskStatuses, matchingHosts);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (noHostMatchedEver) {<NEW_LINE>String domainsSwitchString = "";<NEW_LINE>final List<String> domains = options.get("domains");<NEW_LINE>if (domains.size() > 0) {<NEW_LINE>domainsSwitchString = "-d " + Joiner.on<MASK><NEW_LINE>}<NEW_LINE>out.printf("There are no jobs deployed to hosts with the host pattern '%s'%n" + "Run 'helios %s hosts %s' to check your host exists and is up.%n", hostPattern, domainsSwitchString, hostPattern);<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>table.print();<NEW_LINE>return 0;<NEW_LINE>}
(",").join(domains);
1,840,643
public static String bash(String scriptName, CommandLine commandLine) {<NEW_LINE>if (scriptName == null) {<NEW_LINE>throw new NullPointerException("scriptName");<NEW_LINE>}<NEW_LINE>if (commandLine == null) {<NEW_LINE>throw new NullPointerException("commandLine");<NEW_LINE>}<NEW_LINE>scriptName = sanitizeScriptName(scriptName);<NEW_LINE>StringBuilder result = new StringBuilder();<NEW_LINE>result.append(format(SCRIPT_HEADER, scriptName, CommandLine.VERSION));<NEW_LINE>List<CommandDescriptor> hierarchy = createHierarchy(scriptName, commandLine);<NEW_LINE>result.append(generateEntryPointFunction(scriptName, commandLine, hierarchy));<NEW_LINE>for (CommandDescriptor descriptor : hierarchy) {<NEW_LINE>// #887 skip hidden subcommands<NEW_LINE>if (descriptor.commandLine.getCommandSpec().usageMessage().hidden()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>result.append(generateFunctionForCommand(descriptor.functionName, descriptor<MASK><NEW_LINE>}<NEW_LINE>result.append(format(SCRIPT_FOOTER, scriptName));<NEW_LINE>return result.toString();<NEW_LINE>}
.commandName, descriptor.commandLine));
445,013
private static <N, E, K, V> N merge(DG<N, E, K, V> dg, N n, DG<N, E, K, V> ndg, boolean addEnds) {<NEW_LINE>if (ndg.containsNode(n))<NEW_LINE>return n;<NEW_LINE>ndg.addNode(n);<NEW_LINE>ndg.putAllProperties(n, dg.getProperties(n));<NEW_LINE>if (addEnds && dg.getEnds().contains(n))<NEW_LINE>ndg.addEnd(n);<NEW_LINE>Iterator<E> it = dg.getEdges(n).iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE><MASK><NEW_LINE>N nn = dg.getNode(n, edge);<NEW_LINE>N endN = merge(dg, nn, ndg, addEnds);<NEW_LINE>ndg.addEdge(n, endN, edge);<NEW_LINE>ndg.putAllProperties(n, edge, dg.getProperties(n, edge));<NEW_LINE>}<NEW_LINE>return n;<NEW_LINE>}
E edge = it.next();
1,643,307
private static void validatePageFile(final Path path, final CheckpointIO cpIo, final File v1PageFile) {<NEW_LINE>final int num = Integer.parseInt(v1PageFile.getName().substring("page.".length()));<NEW_LINE>try (final MmapPageIOV1 iov1 = new MmapPageIOV1(num, Ints.checkedCast(v1PageFile.length()), path)) {<NEW_LINE>final Checkpoint cp = loadCheckpoint(path, cpIo, num);<NEW_LINE>final int count = cp.getElementCount();<NEW_LINE>final <MASK><NEW_LINE>iov1.open(minSeqNum, count);<NEW_LINE>for (int i = 0; i < count; ++i) {<NEW_LINE>verifyEvent(iov1, minSeqNum + i);<NEW_LINE>}<NEW_LINE>} catch (final IOException ex) {<NEW_LINE>throw new IllegalStateException(ex);<NEW_LINE>}<NEW_LINE>}
long minSeqNum = cp.getMinSeqNum();
207,191
public ServiceStatus update(String userId, String json) {<NEW_LINE>JSONObject jsonObject = JSONObject.parseObject(json);<NEW_LINE>DashboardBoard board = new DashboardBoard();<NEW_LINE>board.setUserId(userId);<NEW_LINE>board.setName(jsonObject.getString("name"));<NEW_LINE>board.setCategoryId(jsonObject.getLong("categoryId"));<NEW_LINE>board.setLayout(jsonObject.getString("layout"));<NEW_LINE>board.setId(jsonObject.getLong("id"));<NEW_LINE>board.setUpdateTime(new Timestamp(Calendar.getInstance().getTimeInMillis()));<NEW_LINE>Map<String, Object> paramMap = new HashMap<String, Object>();<NEW_LINE>paramMap.put("board_id", board.getId());<NEW_LINE>paramMap.put("user_id", board.getUserId());<NEW_LINE>paramMap.put("board_name", board.getName());<NEW_LINE>if (boardDao.countExistBoardName(paramMap) <= 0) {<NEW_LINE>boardDao.update(board);<NEW_LINE>return new ServiceStatus(ServiceStatus.Status.Success, "success");<NEW_LINE>} else {<NEW_LINE>return new ServiceStatus(<MASK><NEW_LINE>}<NEW_LINE>}
ServiceStatus.Status.Fail, "Duplicated name");
1,287,236
public static ValidationResult validateINDArrayTextFile(@NonNull File f) {<NEW_LINE>ValidationResult vr = Nd4jCommonValidator.isValidFile(f, "INDArray Text File", false);<NEW_LINE>if (vr != null && !vr.isValid()) {<NEW_LINE>vr.setFormatClass(INDArray.class);<NEW_LINE>return vr;<NEW_LINE>}<NEW_LINE>// TODO let's do this without reading the whole thing into memory - check header + length...<NEW_LINE>try (INDArray arr = Nd4j.readTxt(f.getPath())) {<NEW_LINE>// Using the fact that INDArray.close() exists -> deallocate memory as soon as reading is done<NEW_LINE>System.out.println();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>if (t instanceof OutOfMemoryError || t.getMessage().toLowerCase().contains("failed to allocate")) {<NEW_LINE>// This is a memory exception during reading... result is indeterminant (might be valid, might not be, can't tell here)<NEW_LINE>return ValidationResult.builder().valid(true).formatType("INDArray Text File").formatClass(INDArray.class).path(Nd4jCommonValidator.getPath<MASK><NEW_LINE>}<NEW_LINE>return ValidationResult.builder().valid(false).formatType("INDArray Text File").formatClass(INDArray.class).path(Nd4jCommonValidator.getPath(f)).issues(Collections.singletonList("File may be corrupt or is not a text INDArray file")).exception(t).build();<NEW_LINE>}<NEW_LINE>return ValidationResult.builder().valid(true).formatType("INDArray Text File").formatClass(INDArray.class).path(Nd4jCommonValidator.getPath(f)).build();<NEW_LINE>}
(f)).build();
1,377,730
protected Object handleFallback(Invocation inv, String fallback, String defaultFallback, Class<?>[] fallbackClass, Throwable ex) throws Throwable {<NEW_LINE>Object[] originArgs = inv.getArgs();<NEW_LINE>// Execute fallback function if configured.<NEW_LINE>Method fallbackMethod = extractFallbackMethod(inv, fallback, fallbackClass);<NEW_LINE>if (fallbackMethod != null) {<NEW_LINE>// Construct args.<NEW_LINE>int paramCount = fallbackMethod.getParameterTypes().length;<NEW_LINE>Object[] args;<NEW_LINE>if (paramCount == originArgs.length) {<NEW_LINE>args = originArgs;<NEW_LINE>} else {<NEW_LINE>args = Arrays.copyOf(originArgs, originArgs.length + 1);<NEW_LINE>args[args.length - 1] = ex;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (isStatic(fallbackMethod)) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>return fallbackMethod.invoke(inv.getTarget(), args);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>// throw the actual exception<NEW_LINE>throw e.getTargetException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If fallback is absent, we'll try the defaultFallback if provided.<NEW_LINE>return handleDefaultFallback(inv, defaultFallback, fallbackClass, ex);<NEW_LINE>}
fallbackMethod.invoke(null, args);
1,444,663
public boolean apply(Game game, Ability source) {<NEW_LINE>Choice typeChoice = new ChoiceCreatureType(game.getObject(source));<NEW_LINE>typeChoice.setMessage("Choose creature type to return cards from your graveyard");<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Set<Card> toHand = new HashSet<>();<NEW_LINE>if (controller != null) {<NEW_LINE>for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {<NEW_LINE>Player player = game.getPlayer(playerId);<NEW_LINE>if (player != null) {<NEW_LINE>typeChoice.clearChoice();<NEW_LINE>if (player.choose(outcome, typeChoice, game)) {<NEW_LINE>game.informPlayers(player.getLogName() + " has chosen: " + typeChoice.getChoice());<NEW_LINE>FilterCard filter = new FilterCreatureCard("creature cards with creature type " + typeChoice.getChoice() + " from your graveyard");<NEW_LINE>filter.add(SubType.byDescription(typeChoice.getChoice()).getPredicate());<NEW_LINE>Target target = new TargetCardInYourGraveyard(<MASK><NEW_LINE>player.chooseTarget(outcome, target, source, game);<NEW_LINE>toHand.addAll(new CardsImpl(target.getTargets()).getCards(game));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// must happen simultaneously Rule 101.4<NEW_LINE>controller.moveCards(toHand, Zone.HAND, source, game, false, false, true, null);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
0, Integer.MAX_VALUE, filter);
791,830
private void invokeConnectToBluetoothDevice() {<NEW_LINE>if (BuildConfig.BUILD_TYPE == "light") {<NEW_LINE>AlertDialog infoDialog = new AlertDialog.Builder(this).setMessage(Html.fromHtml(getResources().getString(R.string.label_upgrade_to_openScale_pro) + "<br><br> <a href=\"https://play.google.com/store/apps/details?id=com.health.openscale.pro\">Install openScale pro version</a>")).setPositiveButton(getResources().getString(R.string.label_ok), null).setIcon(R.drawable.ic_launcher_openscale_light).setTitle("openScale " + BuildConfig.VERSION_NAME).create();<NEW_LINE>infoDialog.show();<NEW_LINE>((TextView) infoDialog.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final OpenScale openScale = OpenScale.getInstance();<NEW_LINE>if (openScale.getSelectedScaleUserId() == -1) {<NEW_LINE>showNoSelectedUserDialog();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String deviceName = prefs.<MASK><NEW_LINE>String hwAddress = prefs.getString(BluetoothSettingsFragment.PREFERENCE_KEY_BLUETOOTH_HW_ADDRESS, "");<NEW_LINE>if (!BluetoothAdapter.checkBluetoothAddress(hwAddress)) {<NEW_LINE>setBluetoothStatusIcon(R.drawable.ic_bluetooth_connection_lost);<NEW_LINE>Toast.makeText(getApplicationContext(), R.string.info_bluetooth_no_device_set, Toast.LENGTH_SHORT).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BluetoothManager bluetoothManager = (BluetoothManager) getSystemService(BLUETOOTH_SERVICE);<NEW_LINE>if (!bluetoothManager.getAdapter().isEnabled()) {<NEW_LINE>setBluetoothStatusIcon(R.drawable.ic_bluetooth_connection_lost);<NEW_LINE>Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);<NEW_LINE>startActivityForResult(enableBtIntent, ENABLE_BLUETOOTH_REQUEST);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.S) {<NEW_LINE>Timber.d("SDK >= 31 request for Bluetooth Scan and Bluetooth connect permissions");<NEW_LINE>requestPermissions(new String[] { Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_CONNECT }, PermissionHelper.PERMISSIONS_REQUEST_ACCESS_BLUETOOTH);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>connectToBluetooth();<NEW_LINE>}
getString(BluetoothSettingsFragment.PREFERENCE_KEY_BLUETOOTH_DEVICE_NAME, "");
645,241
public void doWait() throws InterruptedException {<NEW_LINE>long millis = duration.toMillis();<NEW_LINE>if (millis > 0) {<NEW_LINE>Instant waitUntil = clock.<MASK><NEW_LINE>while (clock.now().isBefore(waitUntil)) {<NEW_LINE>synchronized (lock) {<NEW_LINE>if (skipNextWait) {<NEW_LINE>LOG.debug("Waiter has been notified to skip next wait-period. Skipping wait.");<NEW_LINE>skipNextWait = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>woken = false;<NEW_LINE>LOG.debug("Waiter start wait.");<NEW_LINE>this.isWaiting = true;<NEW_LINE>lock.wait(millis);<NEW_LINE>this.isWaiting = false;<NEW_LINE>if (woken) {<NEW_LINE>LOG.debug("Waiter woken, it had {}ms left to wait.", (waitUntil.toEpochMilli() - clock.now().toEpochMilli()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
now().plusMillis(millis);
1,456,840
protected QuicSession createSession(SocketAddress remoteAddress, ByteBuffer cipherBuffer) throws IOException {<NEW_LINE>ByteBufferPool byteBufferPool = getByteBufferPool();<NEW_LINE>// TODO make the token validator configurable<NEW_LINE>QuicheConnection quicheConnection = QuicheConnection.tryAccept(connector.newQuicheConfig(), new SimpleTokenValidator((InetSocketAddress) remoteAddress), cipherBuffer, remoteAddress);<NEW_LINE>if (quicheConnection == null) {<NEW_LINE>ByteBuffer negotiationBuffer = byteBufferPool.acquire(getOutputBufferSize(), true);<NEW_LINE>int pos = BufferUtil.flipToFill(negotiationBuffer);<NEW_LINE>// TODO make the token minter configurable<NEW_LINE>if (!QuicheConnection.negotiate(new SimpleTokenMinter((InetSocketAddress) remoteAddress), cipherBuffer, negotiationBuffer)) {<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("QUIC connection negotiation failed, dropping packet");<NEW_LINE>byteBufferPool.release(negotiationBuffer);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>BufferUtil.flipToFlush(negotiationBuffer, pos);<NEW_LINE>write(Callback.from(() -> byteBufferPool.release(negotiationBuffer)), remoteAddress, negotiationBuffer);<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("QUIC connection negotiation packet sent");<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>QuicSession session = new ServerQuicSession(getExecutor(), getScheduler(), byteBufferPool, <MASK><NEW_LINE>// Send the response packet(s) that tryAccept() generated.<NEW_LINE>session.flush();<NEW_LINE>return session;<NEW_LINE>}<NEW_LINE>}
quicheConnection, this, remoteAddress, connector);
621,087
private void readMapIndex(MapIndex index, boolean onlyInitEncodingRules) throws IOException {<NEW_LINE>int defaultId = 1;<NEW_LINE>int oldLimit;<NEW_LINE>int encodingRulesSize = 0;<NEW_LINE>while (true) {<NEW_LINE>int t = codedIS.readTag();<NEW_LINE>int tag = WireFormat.getTagFieldNumber(t);<NEW_LINE>switch(tag) {<NEW_LINE>case 0:<NEW_LINE>// encoding rules are required!<NEW_LINE>if (onlyInitEncodingRules) {<NEW_LINE>index.finishInitializingTags();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>case OsmandOdb.OsmAndMapIndex.NAME_FIELD_NUMBER:<NEW_LINE>index.<MASK><NEW_LINE>break;<NEW_LINE>case OsmandOdb.OsmAndMapIndex.RULES_FIELD_NUMBER:<NEW_LINE>if (onlyInitEncodingRules) {<NEW_LINE>if (encodingRulesSize == 0) {<NEW_LINE>encodingRulesSize = codedIS.getTotalBytesRead();<NEW_LINE>}<NEW_LINE>int len = codedIS.readInt32();<NEW_LINE>oldLimit = codedIS.pushLimit(len);<NEW_LINE>readMapEncodingRule(index, defaultId++);<NEW_LINE>codedIS.popLimit(oldLimit);<NEW_LINE>index.encodingRulesSizeBytes = (codedIS.getTotalBytesRead() - encodingRulesSize);<NEW_LINE>} else {<NEW_LINE>skipUnknownField(t);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case OsmandOdb.OsmAndMapIndex.LEVELS_FIELD_NUMBER:<NEW_LINE>int length = readInt();<NEW_LINE>int filePointer = codedIS.getTotalBytesRead();<NEW_LINE>if (!onlyInitEncodingRules) {<NEW_LINE>oldLimit = codedIS.pushLimit(length);<NEW_LINE>MapRoot mapRoot = readMapLevel(new MapRoot());<NEW_LINE>mapRoot.length = length;<NEW_LINE>mapRoot.filePointer = filePointer;<NEW_LINE>index.getRoots().add(mapRoot);<NEW_LINE>codedIS.popLimit(oldLimit);<NEW_LINE>}<NEW_LINE>codedIS.seek(filePointer + length);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>skipUnknownField(t);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setName(codedIS.readString());
955,052
public int compareTo(LayoutDecision arg) {<NEW_LINE>ObjectFile.Element ourElement = getElement();<NEW_LINE>int ourElementIndex = ourElement == null ? -1 : ourElement.getOwner().getElements().indexOf(ourElement);<NEW_LINE>int ourKindOrdinal = getKind().ordinal();<NEW_LINE>ObjectFile.Element argElement = arg.getElement();<NEW_LINE>int argElementIndex = argElement == null ? -1 : argElement.getOwner().<MASK><NEW_LINE>int argKindOrdinal = arg.getKind().ordinal();<NEW_LINE>// we can only compare decisions about the same object file<NEW_LINE>if (ourElement != null && argElement != null && ourElement.getOwner() != argElement.getOwner()) {<NEW_LINE>throw new IllegalArgumentException("cannot compare decisions across object files");<NEW_LINE>}<NEW_LINE>if (ourElementIndex < argElementIndex) {<NEW_LINE>return -1;<NEW_LINE>} else if (ourElementIndex > argElementIndex) {<NEW_LINE>return 1;<NEW_LINE>} else {<NEW_LINE>if (ourKindOrdinal < argKindOrdinal) {<NEW_LINE>return -1;<NEW_LINE>} else if (ourKindOrdinal > argKindOrdinal) {<NEW_LINE>return 1;<NEW_LINE>} else {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getElements().indexOf(argElement);
1,378,691
public final GF2nPolynomial[] divide(GF2nPolynomial b) {<NEW_LINE>GF2nPolynomial[] result = new GF2nPolynomial[2];<NEW_LINE>GF2nPolynomial a = new GF2nPolynomial(this);<NEW_LINE>a.shrink();<NEW_LINE>GF2nPolynomial shift;<NEW_LINE>GF2nElement factor;<NEW_LINE>int bDegree = b.getDegree();<NEW_LINE>GF2nElement inv = (GF2nElement) b.coeff[bDegree].invert();<NEW_LINE>if (a.getDegree() < bDegree) {<NEW_LINE>result[0] = new GF2nPolynomial(this);<NEW_LINE>result[0].assignZeroToElements();<NEW_LINE>result[0].shrink();<NEW_LINE>result[1] = new GF2nPolynomial(this);<NEW_LINE>result[1].shrink();<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>result[0] = new GF2nPolynomial(this);<NEW_LINE>result[0].assignZeroToElements();<NEW_LINE>int i = a.getDegree() - bDegree;<NEW_LINE>while (i >= 0) {<NEW_LINE>factor = (GF2nElement) a.coeff[a.getDegree()].multiply(inv);<NEW_LINE><MASK><NEW_LINE>shift.shiftThisLeft(i);<NEW_LINE>a = a.add(shift);<NEW_LINE>a.shrink();<NEW_LINE>result[0].coeff[i] = (GF2nElement) factor.clone();<NEW_LINE>i = a.getDegree() - bDegree;<NEW_LINE>}<NEW_LINE>result[1] = a;<NEW_LINE>result[0].shrink();<NEW_LINE>return result;<NEW_LINE>}
shift = b.scalarMultiply(factor);
1,318,762
private boolean tryRehash() {<NEW_LINE>long newCapacityLong = hashCapacity * 2L;<NEW_LINE>if (newCapacityLong > Integer.MAX_VALUE) {<NEW_LINE>throw new TrinoException(GENERIC_INSUFFICIENT_RESOURCES, "Size of hash table cannot exceed 1 billion entries");<NEW_LINE>}<NEW_LINE>int newCapacity = toIntExact(newCapacityLong);<NEW_LINE>// An estimate of how much extra memory is needed before we can go ahead and expand the hash table.<NEW_LINE>// This includes the new capacity for values, groupIds, and valuesByGroupId as well as the size of the current page<NEW_LINE>preallocatedMemoryInBytes = (newCapacity - hashCapacity) * (long) (Long.BYTES + Integer.BYTES) + (long) (calculateMaxFill(newCapacity) - maxFill) * Long.BYTES + currentPageSizeInBytes;<NEW_LINE>if (!updateMemory.update()) {<NEW_LINE>// reserved memory but has exceeded the limit<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>preallocatedMemoryInBytes = 0;<NEW_LINE>expectedHashCollisions += estimateNumberOfHashCollisions(getGroupCount(), hashCapacity);<NEW_LINE>int newMask = newCapacity - 1;<NEW_LINE>long[] newValues = new long[newCapacity];<NEW_LINE>int[] newGroupIds = new int[newCapacity];<NEW_LINE>Arrays.fill(newGroupIds, -1);<NEW_LINE>for (int groupId = 0; groupId < nextGroupId; groupId++) {<NEW_LINE>if (groupId == nullGroupId) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>long value = valuesByGroupId.get(groupId);<NEW_LINE>// find an empty slot for the address<NEW_LINE>int hashPosition = getHashPosition(value, newMask);<NEW_LINE>while (newGroupIds[hashPosition] != -1) {<NEW_LINE>hashPosition <MASK><NEW_LINE>hashCollisions++;<NEW_LINE>}<NEW_LINE>// record the mapping<NEW_LINE>newValues[hashPosition] = value;<NEW_LINE>newGroupIds[hashPosition] = groupId;<NEW_LINE>}<NEW_LINE>mask = newMask;<NEW_LINE>hashCapacity = newCapacity;<NEW_LINE>maxFill = calculateMaxFill(hashCapacity);<NEW_LINE>values = newValues;<NEW_LINE>groupIds = newGroupIds;<NEW_LINE>this.valuesByGroupId.ensureCapacity(maxFill);<NEW_LINE>return true;<NEW_LINE>}
= (hashPosition + 1) & newMask;
425,825
private static <T> T callAction(AnAction action, String operation, Supplier<T> call) {<NEW_LINE>if (action instanceof UpdateInBackground || ApplicationManager.getApplication().isDispatchThread())<NEW_LINE>return call.get();<NEW_LINE>ProgressIndicator progress = Objects.requireNonNull(ProgressManager.getInstance().getProgressIndicator());<NEW_LINE>return ActionUpdateEdtExecutor.computeOnEdt(() -> {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>return ProgressManager.getInstance().runProcess(call::get, ProgressWrapper.wrap(progress));<NEW_LINE>} finally {<NEW_LINE>long elapsed = System.currentTimeMillis() - start;<NEW_LINE>if (elapsed > 100) {<NEW_LINE>LOG.warn("Slow (" + elapsed + "ms) '" + operation + "' on action " + action + " of " + action.getClass() + ". Consider speeding it up and/or implementing UpdateInBackground.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
long start = System.currentTimeMillis();
1,135,867
public void handleDelivery(String consumerTag, Envelope envelope, BasicProperties properties, byte[] body) throws IOException {<NEW_LINE>String decodedBody;<NEW_LINE>try {<NEW_LINE>decodedBody = new String(body, "UTF-8");<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>// can't happen<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>JSONObject jo = new JSONObject(decodedBody);<NEW_LINE>if ("GET".equals(jo.getString("method"))) {<NEW_LINE>try {<NEW_LINE>CrawlURI curi = makeCrawlUri(jo);<NEW_LINE>KeyedProperties.clearAllOverrideContexts();<NEW_LINE>candidates.runCandidateChain(curi, null);<NEW_LINE>appCtx.publishEvent(new AMQPUrlReceivedEvent(AMQPUrlReceiver.this, curi));<NEW_LINE>} catch (URIException e) {<NEW_LINE>logger.log(Level.WARNING, "problem creating CrawlURI from json received via AMQP " + decodedBody, e);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>logger.log(Level.<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.log(Level.SEVERE, "Unanticipated problem creating CrawlURI from json received via AMQP " + decodedBody, e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.info("ignoring url with method other than GET - " + decodedBody);<NEW_LINE>}<NEW_LINE>logger.finest("Now ACKing: " + decodedBody);<NEW_LINE>this.getChannel().basicAck(envelope.getDeliveryTag(), false);<NEW_LINE>}
SEVERE, "problem creating CrawlURI from json received via AMQP " + decodedBody, e);
1,476,300
public VirtualRouterOfferingInventory selectVirtualRouterOffering(L3NetworkInventory l3, List<VirtualRouterOfferingInventory> candidates) {<NEW_LINE>Map<String, List<String>> tags = VirtualRouterSystemTags.VYOS_OFFERING.getTags(candidates.stream().map(VirtualRouterOfferingInventory::getUuid).collect(Collectors.toList()));<NEW_LINE>if (tags.isEmpty()) {<NEW_LINE>Optional p = candidates.stream().filter(VirtualRouterOfferingInventory::isDefault).findAny();<NEW_LINE>return p.isPresent() ? (VirtualRouterOfferingInventory) p.get(<MASK><NEW_LINE>} else {<NEW_LINE>List<VirtualRouterOfferingInventory> offerings = candidates.stream().filter(i -> tags.containsKey(i.getUuid())).collect(Collectors.toList());<NEW_LINE>Optional p = offerings.stream().filter(VirtualRouterOfferingInventory::isDefault).findAny();<NEW_LINE>return p.isPresent() ? (VirtualRouterOfferingInventory) p.get() : offerings.get(0);<NEW_LINE>}<NEW_LINE>}
) : candidates.get(0);
1,189,206
public void check(Database database, DatabaseChangeLog changeLog, ChangeSet changeSet, ChangeExecListener changeExecListener) throws PreconditionFailedException, PreconditionErrorException {<NEW_LINE>CustomPrecondition customPrecondition;<NEW_LINE>try {<NEW_LINE>// System.out.println(classLoader.toString());<NEW_LINE>try {<NEW_LINE>customPrecondition = (CustomPrecondition) Class.forName(className, true, Scope.getCurrentScope().getClassLoader()).getConstructor().newInstance();<NEW_LINE>} catch (ClassCastException e) {<NEW_LINE>// fails in Ant in particular<NEW_LINE>customPrecondition = (CustomPrecondition) Class.forName(className).getConstructor().newInstance();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new PreconditionFailedException("Could not open custom precondition class " + className, changeLog, this);<NEW_LINE>}<NEW_LINE>for (String param : params) {<NEW_LINE>try {<NEW_LINE>ObjectUtil.setProperty(customPrecondition, param, paramValues.get(param));<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new PreconditionFailedException("Error setting parameter " + param + " on custom precondition " + className, changeLog, this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>customPrecondition.check(database);<NEW_LINE>} catch (CustomPreconditionFailedException e) {<NEW_LINE>throw new PreconditionFailedException(new FailedPrecondition("Custom Precondition Failed: " + e.getMessage<MASK><NEW_LINE>} catch (CustomPreconditionErrorException e) {<NEW_LINE>throw new PreconditionErrorException(new ErrorPrecondition(e, changeLog, this));<NEW_LINE>}<NEW_LINE>}
(), changeLog, this));
14,024
private static void bindSlowPoint(BoundStatement boundStatement, String agentRollupId, String agentId, String traceId, Trace.Header header, int adjustedTTL, boolean overall, boolean partial, boolean cassandra2x) throws IOException {<NEW_LINE>int i = bind(boundStatement, agentRollupId, agentId, traceId, header, overall, partial && !cassandra2x);<NEW_LINE>if (partial) {<NEW_LINE>if (cassandra2x) {<NEW_LINE>// don't set real_capture_time, so this still looks like data prior to 0.13.1<NEW_LINE>boundStatement.setToNull(i++);<NEW_LINE>} else {<NEW_LINE>boundStatement.setTimestamp(i++, new Date<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>boundStatement.setLong(i++, header.getDurationNanos());<NEW_LINE>boundStatement.setBool(i++, header.hasError());<NEW_LINE>boundStatement.setString(i++, header.getHeadline());<NEW_LINE>boundStatement.setString(i++, Strings.emptyToNull(header.getUser()));<NEW_LINE>List<Trace.Attribute> attributes = header.getAttributeList();<NEW_LINE>if (attributes.isEmpty()) {<NEW_LINE>boundStatement.setToNull(i++);<NEW_LINE>} else {<NEW_LINE>boundStatement.setBytes(i++, Messages.toByteBuffer(attributes));<NEW_LINE>}<NEW_LINE>boundStatement.setInt(i++, adjustedTTL);<NEW_LINE>}
(header.getCaptureTime()));
1,694,427
public Request<ReleaseHostsRequest> marshall(ReleaseHostsRequest releaseHostsRequest) {<NEW_LINE>if (releaseHostsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ReleaseHostsRequest> request = new DefaultRequest<MASK><NEW_LINE>request.addParameter("Action", "ReleaseHosts");<NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> releaseHostsRequestHostIdsList = (com.amazonaws.internal.SdkInternalList<String>) releaseHostsRequest.getHostIds();<NEW_LINE>if (!releaseHostsRequestHostIdsList.isEmpty() || !releaseHostsRequestHostIdsList.isAutoConstruct()) {<NEW_LINE>int hostIdsListIndex = 1;<NEW_LINE>for (String releaseHostsRequestHostIdsListValue : releaseHostsRequestHostIdsList) {<NEW_LINE>if (releaseHostsRequestHostIdsListValue != null) {<NEW_LINE>request.addParameter("HostId." + hostIdsListIndex, StringUtils.fromString(releaseHostsRequestHostIdsListValue));<NEW_LINE>}<NEW_LINE>hostIdsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
<ReleaseHostsRequest>(releaseHostsRequest, "AmazonEC2");
791,780
public ArtifactSourceType unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ArtifactSourceType artifactSourceType = new ArtifactSourceType();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("SourceIdType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>artifactSourceType.setSourceIdType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Value", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>artifactSourceType.setValue(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 artifactSourceType;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,431,163
private static void collectCoverageInformation(TestCase testCase) {<NEW_LINE>SameDiff sd = testCase.sameDiff();<NEW_LINE>// NOTE: Count on a per-test-case basis, not on a 'per function seen' basis<NEW_LINE>// i.e., don't double count if a SameDiff instance has multiple copies of the same op type<NEW_LINE>// Collect coverage information for backprop:<NEW_LINE>DifferentialFunction[] functions = sd.ops();<NEW_LINE>Set<Class> backpropSeen = new HashSet<>();<NEW_LINE>for (DifferentialFunction df : functions) {<NEW_LINE>backpropSeen.<MASK><NEW_LINE>}<NEW_LINE>for (Class c : backpropSeen) {<NEW_LINE>if (gradCheckCoverageCountPerClass.containsKey(c))<NEW_LINE>gradCheckCoverageCountPerClass.put(c, gradCheckCoverageCountPerClass.get(c) + 1);<NEW_LINE>else<NEW_LINE>gradCheckCoverageCountPerClass.put(c, 1);<NEW_LINE>}<NEW_LINE>// Collect coverage information for forward pass (expected outputs)<NEW_LINE>Set<Class> seen = null;<NEW_LINE>if (testCase.fwdTestFns() != null) {<NEW_LINE>for (String s : testCase.fwdTestFns().keySet()) {<NEW_LINE>// Determine the differential function that this variable is the output of, if any<NEW_LINE>DifferentialFunction df = sd.getVariableOutputOp(s);<NEW_LINE>if (df != null) {<NEW_LINE>if (seen == null)<NEW_LINE>seen = new HashSet<>();<NEW_LINE>seen.add(df.getClass());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (seen != null) {<NEW_LINE>for (Class c : seen) {<NEW_LINE>if (fwdPassCoverageCountPerClass.containsKey(c)) {<NEW_LINE>fwdPassCoverageCountPerClass.put(c, fwdPassCoverageCountPerClass.get(c) + 1);<NEW_LINE>} else {<NEW_LINE>fwdPassCoverageCountPerClass.put(c, 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
add(df.getClass());
1,839,767
private List<Result> partitionHits(Result result, String summaryClass) {<NEW_LINE>List<Result> parts = new ArrayList<>();<NEW_LINE>TinyIdentitySet<Query> queryMap = new TinyIdentitySet<>(4);<NEW_LINE>for (Iterator<Hit> i = hitIterator(result); i.hasNext(); ) {<NEW_LINE>Hit hit = i.next();<NEW_LINE>if (hit instanceof FastHit) {<NEW_LINE>FastHit fastHit = (FastHit) hit;<NEW_LINE>if (!fastHit.isFilled(summaryClass)) {<NEW_LINE>Query q = fastHit.getQuery();<NEW_LINE>if (q == null) {<NEW_LINE>// fallback for untagged hits<NEW_LINE>q = result.hits().getQuery();<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>if (idx < 0) {<NEW_LINE>idx = queryMap.size();<NEW_LINE>Result r = new Result(q);<NEW_LINE>parts.add(r);<NEW_LINE>queryMap.add(q);<NEW_LINE>}<NEW_LINE>parts.get(idx).hits().add(fastHit);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return parts;<NEW_LINE>}
idx = queryMap.indexOf(q);
983,258
private ParameterMap createValidationParameters(final Node node) {<NEW_LINE>final ParameterMap parameters = new ParameterMap();<NEW_LINE>parameters.insert("DEFAULT", name);<NEW_LINE>parameters.insert(PARAM_TYPE, getType().toString());<NEW_LINE>parameters.insert(PARAM_NODEHOST, nodehost, node.getNodeHost());<NEW_LINE>parameters.insert(PARAM_INSTALLDIR, installdir, node.getInstallDir());<NEW_LINE>parameters.insert(PARAM_NODEDIR, nodedir, node.getNodeDir());<NEW_LINE>parameters.insert(PARAM_WINDOWSDOMAINNAME, <MASK><NEW_LINE>final SshConnector sshc = node.getSshConnector();<NEW_LINE>parameters.insert(PARAM_REMOTEPORT, remotePort, getSupplier(sshc, sshc::getSshPort));<NEW_LINE>final SshAuth ssha = sshc.getSshAuth();<NEW_LINE>parameters.insert(PARAM_REMOTEUSER, remoteUser, getSupplier(ssha, ssha::getUserName));<NEW_LINE>parameters.insert(PARAM_SSHAUTHTYPE, sshAuthType, getSupplier(ssha, () -> null));<NEW_LINE>if (sshAuthType == null) {<NEW_LINE>if (sshkeyfile == null && remotepassword == null) {<NEW_LINE>parameters.insert(PARAM_SSHPASSWORD, null, getSupplier(ssha, ssha::getPassword));<NEW_LINE>parameters.insert(PARAM_SSHKEYFILE, null, getSupplier(ssha, ssha::getKeyfile));<NEW_LINE>parameters.insert(PARAM_SSHKEYPASSPHRASE, null, getSupplier(ssha, ssha::getKeyPassphrase));<NEW_LINE>} else if (remotepassword != null) {<NEW_LINE>parameters.insert(PARAM_SSHPASSWORD, remotepassword, getSupplier(ssha, ssha::getPassword));<NEW_LINE>} else {<NEW_LINE>parameters.insert(PARAM_SSHKEYFILE, sshkeyfile, getSupplier(ssha, ssha::getKeyfile));<NEW_LINE>parameters.insert(PARAM_SSHKEYPASSPHRASE, sshkeypassphrase, getSupplier(ssha, ssha::getKeyPassphrase));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (SshAuthType.KEY.name().equals(sshAuthType)) {<NEW_LINE>parameters.insert(PARAM_SSHKEYFILE, sshkeyfile, getSupplier(ssha, ssha::getKeyfile));<NEW_LINE>parameters.insert(PARAM_SSHKEYPASSPHRASE, sshkeypassphrase, getSupplier(ssha, ssha::getKeyPassphrase));<NEW_LINE>} else if (SshAuthType.PASSWORD.name().equals(sshAuthType)) {<NEW_LINE>parameters.insert(PARAM_SSHPASSWORD, remotepassword, getSupplier(ssha, ssha::getPassword));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return parameters;<NEW_LINE>}
windowsdomain, node.getWindowsDomain());
1,689,829
public boolean execute(final OHttpRequest iRequest, OHttpResponse iResponse) throws Exception {<NEW_LINE>checkSyntax(iRequest.getUrl(), 1, "Syntax error: disconnect");<NEW_LINE>iRequest<MASK><NEW_LINE>iRequest.getData().commandDetail = null;<NEW_LINE>if (iRequest.getSessionId() != null) {<NEW_LINE>server.getHttpSessionManager().removeSession(iRequest.getSessionId());<NEW_LINE>iRequest.setSessionId(OServerCommandAuthenticatedDbAbstract.SESSIONID_UNAUTHORIZED);<NEW_LINE>iResponse.setSessionId(iRequest.getSessionId());<NEW_LINE>}<NEW_LINE>iResponse.setKeepAlive(false);<NEW_LINE>if (isJsonResponse(iResponse)) {<NEW_LINE>sendJsonError(iResponse, OHttpUtils.STATUS_AUTH_CODE, OHttpUtils.STATUS_AUTH_DESCRIPTION, OHttpUtils.CONTENT_TEXT_PLAIN, "Logged out", null);<NEW_LINE>} else {<NEW_LINE>iResponse.send(OHttpUtils.STATUS_AUTH_CODE, OHttpUtils.STATUS_AUTH_DESCRIPTION, OHttpUtils.CONTENT_TEXT_PLAIN, "Logged out", null);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
.getData().commandInfo = "Disconnect";