idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
892,691 | public static void addEntityManagementRelatedClasses(Context context) {<NEW_LINE>ModuleManager moduleManager = <MASK><NEW_LINE>ModuleEnvironment environment = moduleManager.getEnvironment();<NEW_LINE>NetworkSystem networkSystem = context.get(NetworkSystem.class);<NEW_LINE>// Entity Manager<NEW_LINE>PojoEntityManager entityManager = new PojoEntityManager();<NEW_LINE>context.put(EntityManager.class, entityManager);<NEW_LINE>context.put(EngineEntityManager.class, entityManager);<NEW_LINE>// Standard serialization library<NEW_LINE>TypeHandlerLibrary typeHandlerLibrary = context.get(TypeHandlerLibrary.class);<NEW_LINE>typeHandlerLibrary.addTypeHandler(EntityRef.class, new EntityRefTypeHandler(entityManager));<NEW_LINE>entityManager.setTypeSerializerLibrary(typeHandlerLibrary);<NEW_LINE>// Prefab Manager<NEW_LINE>PrefabManager prefabManager = new PojoPrefabManager(context);<NEW_LINE>entityManager.setPrefabManager(prefabManager);<NEW_LINE>context.put(PrefabManager.class, prefabManager);<NEW_LINE>EntitySystemLibrary library = context.get(EntitySystemLibrary.class);<NEW_LINE>entityManager.setComponentLibrary(library.getComponentLibrary());<NEW_LINE>// Record and Replay<NEW_LINE>RecordAndReplayCurrentStatus recordAndReplayCurrentStatus = context.get(RecordAndReplayCurrentStatus.class);<NEW_LINE>RecordAndReplayUtils recordAndReplayUtils = context.get(RecordAndReplayUtils.class);<NEW_LINE>CharacterStateEventPositionMap characterStateEventPositionMap = context.get(CharacterStateEventPositionMap.class);<NEW_LINE>DirectionAndOriginPosRecorderList directionAndOriginPosRecorderList = context.get(DirectionAndOriginPosRecorderList.class);<NEW_LINE>RecordedEventStore recordedEventStore = new RecordedEventStore();<NEW_LINE>RecordAndReplaySerializer recordAndReplaySerializer = new RecordAndReplaySerializer(entityManager, recordedEventStore, recordAndReplayUtils, characterStateEventPositionMap, directionAndOriginPosRecorderList, moduleManager, context.get(TypeRegistry.class));<NEW_LINE>context.put(RecordAndReplaySerializer.class, recordAndReplaySerializer);<NEW_LINE>// Event System<NEW_LINE>EventSystem eventSystem = createEventSystem(networkSystem, entityManager, library, recordedEventStore, recordAndReplaySerializer, recordAndReplayUtils, recordAndReplayCurrentStatus);<NEW_LINE>entityManager.setEventSystem(eventSystem);<NEW_LINE>context.put(EventSystem.class, eventSystem);<NEW_LINE>// TODO: Review - NodeClassLibrary related to the UI for behaviours. Should not be here and probably not even in the CoreRegistry<NEW_LINE>context.put(OneOfProviderFactory.class, new OneOfProviderFactory());<NEW_LINE>registerComponents(library.getComponentLibrary(), environment);<NEW_LINE>registerEvents(entityManager.getEventSystem(), environment);<NEW_LINE>} | context.get(ModuleManager.class); |
381,321 | private List<CSSASMechConfig> extractASMech(Map<String, Object> authenticationLayerProperties) {<NEW_LINE>List<CSSASMechConfig> cssasMechConfigs = new ArrayList<CSSASMechConfig>();<NEW_LINE>List<String> configuredMechanisms = new ArrayList<String>();<NEW_LINE>String establishTrustInClient = (String) authenticationLayerProperties.get(KEY_ESTABLISH_TRUST_IN_CLIENT);<NEW_LINE>printTrace("EstablishTrustInClient", establishTrustInClient, 3);<NEW_LINE>boolean required = false;<NEW_LINE>if (OPTION_REQUIRED.equals(establishTrustInClient)) {<NEW_LINE>required = true;<NEW_LINE>} else if (OPTION_NEVER.equals(establishTrustInClient)) {<NEW_LINE>logWarning("CSIv2_COMMON_AUTH_LAYER_DISABLED", establishTrustInClient);<NEW_LINE>cssasMechConfigs.add(new CSSNULLASMechConfig());<NEW_LINE>return cssasMechConfigs;<NEW_LINE>}<NEW_LINE>List<String> mechanisms = getAsMechanisms(authenticationLayerProperties);<NEW_LINE>if (mechanisms.isEmpty()) {<NEW_LINE>logWarning("CSIv2_CLIENT_AUTH_MECHANISMS_NULL");<NEW_LINE>cssasMechConfigs.add(new CSSNULLASMechConfig());<NEW_LINE>} else {<NEW_LINE>for (String mech : mechanisms) {<NEW_LINE>if (!configuredMechanisms.contains(mech.toUpperCase())) {<NEW_LINE>CSSASMechConfig camConfig = handleASMech(mech, <MASK><NEW_LINE>if (camConfig != null) {<NEW_LINE>cssasMechConfigs.add(camConfig);<NEW_LINE>} else {<NEW_LINE>logWarning("CSIv2_CLIENT_AUTH_MECHANISM_INVALID");<NEW_LINE>}<NEW_LINE>configuredMechanisms.add(mech.toUpperCase());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (cssasMechConfigs.isEmpty()) {<NEW_LINE>cssasMechConfigs.add(new CSSNULLASMechConfig());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return cssasMechConfigs;<NEW_LINE>} | authenticator, domain, required, authenticationLayerProperties); |
1,301,287 | public PricingDetail unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>PricingDetail pricingDetail = new PricingDetail();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE><MASK><NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>return pricingDetail;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("price", targetDepth)) {<NEW_LINE>pricingDetail.setPrice(DoubleStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("count", targetDepth)) {<NEW_LINE>pricingDetail.setCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return pricingDetail;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int xmlEvent = context.nextEvent(); |
630,369 | private void declareExchange(final String rootName, String group, final Exchange exchangeArg) {<NEW_LINE>Exchange exchange = exchangeArg;<NEW_LINE>for (DeclarableCustomizer customizer : this.customizers) {<NEW_LINE>exchange = (<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>this.rabbitAdmin.declareExchange(exchange);<NEW_LINE>} catch (AmqpConnectException e) {<NEW_LINE>if (this.logger.isDebugEnabled()) {<NEW_LINE>this.logger.debug("Declaration of exchange: " + exchange.getName() + " deferred - connection not available");<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>if (this.notOurAdminException) {<NEW_LINE>this.notOurAdminException = false;<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>if (this.logger.isDebugEnabled()) {<NEW_LINE>this.logger.debug("Declaration of exchange: " + exchange.getName() + " deferred", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addToAutoDeclareContext(rootName + "." + group + ".exchange", exchange);<NEW_LINE>} | Exchange) customizer.apply(exchange); |
698,978 | final DescribeReplicationTasksResult executeDescribeReplicationTasks(DescribeReplicationTasksRequest describeReplicationTasksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeReplicationTasksRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeReplicationTasksRequest> request = null;<NEW_LINE>Response<DescribeReplicationTasksResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeReplicationTasksRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeReplicationTasksRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeReplicationTasks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeReplicationTasksResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeReplicationTasksResultJsonUnmarshaller());<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.SERVICE_ID, "Database Migration Service"); |
1,316,582 | private static void downloadEN_US(File localeFile) {<NEW_LINE>try {<NEW_LINE>// Let the user know we are downloading the JAR<NEW_LINE>GeyserImpl.getInstance().getLogger().info(GeyserLocale.getLocaleStringLog("geyser.locale.download.en_us"));<NEW_LINE>GeyserImpl.getInstance().getLogger().debug("Download URL: " + clientJarInfo.getUrl());<NEW_LINE>// Download the smallest JAR (client or server)<NEW_LINE>Path tmpFilePath = GeyserImpl.getInstance().getBootstrap().getConfigFolder().resolve("tmp_locale.jar");<NEW_LINE>WebUtils.downloadFile(clientJarInfo.getUrl(), tmpFilePath.toString());<NEW_LINE>// Load in the JAR as a zip and extract the file<NEW_LINE>try (ZipFile localeJar = new ZipFile(tmpFilePath.toString())) {<NEW_LINE>try (InputStream fileStream = localeJar.getInputStream(localeJar.getEntry("assets/minecraft/lang/en_us.json"))) {<NEW_LINE>try (FileOutputStream outStream = new FileOutputStream(localeFile)) {<NEW_LINE>// Write the file to the locale dir<NEW_LINE>byte[] buf = new byte[fileStream.available()];<NEW_LINE>int length;<NEW_LINE>while ((length = fileStream.read(buf)) != -1) {<NEW_LINE>outStream.write(buf, 0, length);<NEW_LINE>}<NEW_LINE>// Flush all changes to disk and cleanup<NEW_LINE>outStream.flush();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Store the latest jar hash<NEW_LINE>FileUtils.writeFile(GeyserImpl.getInstance().getBootstrap().getConfigFolder().resolve("locales/en_us.hash").toString(), clientJarInfo.getSha1().toCharArray());<NEW_LINE>// Delete the nolonger needed client/server jar<NEW_LINE>Files.delete(tmpFilePath);<NEW_LINE>GeyserImpl.getInstance().getLogger().info<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>GeyserImpl.getInstance().getLogger().error(GeyserLocale.getLocaleStringLog("geyser.locale.fail.en_us"), e);<NEW_LINE>}<NEW_LINE>} | (GeyserLocale.getLocaleStringLog("geyser.locale.download.en_us.done")); |
1,035,407 | public byte[] asn1Encode() throws Asn1Exception, IOException {<NEW_LINE>DerOutputStream bytes = new DerOutputStream();<NEW_LINE>DerOutputStream temp = new DerOutputStream();<NEW_LINE>DerValue[] der = new DerValue[4];<NEW_LINE>temp.putInteger(BigInteger.valueOf(tkt_vno));<NEW_LINE>bytes.write(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x00), temp);<NEW_LINE>bytes.write(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x01), sname.<MASK><NEW_LINE>bytes.write(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x02), sname.asn1Encode());<NEW_LINE>bytes.write(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte) 0x03), encPart.asn1Encode());<NEW_LINE>temp = new DerOutputStream();<NEW_LINE>temp.write(DerValue.tag_Sequence, bytes);<NEW_LINE>DerOutputStream ticket = new DerOutputStream();<NEW_LINE>ticket.write(DerValue.createTag(DerValue.TAG_APPLICATION, true, (byte) 0x01), temp);<NEW_LINE>return ticket.toByteArray();<NEW_LINE>} | getRealm().asn1Encode()); |
1,770,858 | public static ListCompliancePackTemplatesResponse unmarshall(ListCompliancePackTemplatesResponse listCompliancePackTemplatesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listCompliancePackTemplatesResponse.setRequestId(_ctx.stringValue("ListCompliancePackTemplatesResponse.RequestId"));<NEW_LINE>CompliancePackTemplatesResult compliancePackTemplatesResult = new CompliancePackTemplatesResult();<NEW_LINE>compliancePackTemplatesResult.setPageSize(_ctx.integerValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.PageSize"));<NEW_LINE>compliancePackTemplatesResult.setPageNumber(_ctx.integerValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.PageNumber"));<NEW_LINE>compliancePackTemplatesResult.setTotalCount(_ctx.longValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.TotalCount"));<NEW_LINE>List<CompliancePackTemplate> compliancePackTemplates = new ArrayList<CompliancePackTemplate>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.CompliancePackTemplates.Length"); i++) {<NEW_LINE>CompliancePackTemplate compliancePackTemplate = new CompliancePackTemplate();<NEW_LINE>compliancePackTemplate.setRiskLevel(_ctx.integerValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.CompliancePackTemplates[" + i + "].RiskLevel"));<NEW_LINE>compliancePackTemplate.setDescription(_ctx.stringValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.CompliancePackTemplates[" + i + "].Description"));<NEW_LINE>compliancePackTemplate.setAutomationHelpUrl(_ctx.stringValue<MASK><NEW_LINE>compliancePackTemplate.setCompliancePackTemplateName(_ctx.stringValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.CompliancePackTemplates[" + i + "].CompliancePackTemplateName"));<NEW_LINE>compliancePackTemplate.setCompliancePackTemplateId(_ctx.stringValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.CompliancePackTemplates[" + i + "].CompliancePackTemplateId"));<NEW_LINE>List<ConfigRulesItem> configRules = new ArrayList<ConfigRulesItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.CompliancePackTemplates[" + i + "].ConfigRules.Length"); j++) {<NEW_LINE>ConfigRulesItem configRulesItem = new ConfigRulesItem();<NEW_LINE>configRulesItem.setDescription(_ctx.stringValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.CompliancePackTemplates[" + i + "].ConfigRules[" + j + "].Description"));<NEW_LINE>configRulesItem.setManagedRuleIdentifier(_ctx.stringValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.CompliancePackTemplates[" + i + "].ConfigRules[" + j + "].ManagedRuleIdentifier"));<NEW_LINE>configRulesItem.setManagedRuleName(_ctx.stringValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.CompliancePackTemplates[" + i + "].ConfigRules[" + j + "].ManagedRuleName"));<NEW_LINE>configRulesItem.setRiskLevel(_ctx.integerValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.CompliancePackTemplates[" + i + "].ConfigRules[" + j + "].RiskLevel"));<NEW_LINE>List<ConfigRuleParametersItem> configRuleParameters = new ArrayList<ConfigRuleParametersItem>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.CompliancePackTemplates[" + i + "].ConfigRules[" + j + "].ConfigRuleParameters.Length"); k++) {<NEW_LINE>ConfigRuleParametersItem configRuleParametersItem = new ConfigRuleParametersItem();<NEW_LINE>configRuleParametersItem.setRequired(_ctx.booleanValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.CompliancePackTemplates[" + i + "].ConfigRules[" + j + "].ConfigRuleParameters[" + k + "].Required"));<NEW_LINE>configRuleParametersItem.setParameterName(_ctx.stringValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.CompliancePackTemplates[" + i + "].ConfigRules[" + j + "].ConfigRuleParameters[" + k + "].ParameterName"));<NEW_LINE>configRuleParametersItem.setParameterValue(_ctx.stringValue("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.CompliancePackTemplates[" + i + "].ConfigRules[" + j + "].ConfigRuleParameters[" + k + "].ParameterValue"));<NEW_LINE>configRuleParameters.add(configRuleParametersItem);<NEW_LINE>}<NEW_LINE>configRulesItem.setConfigRuleParameters(configRuleParameters);<NEW_LINE>configRules.add(configRulesItem);<NEW_LINE>}<NEW_LINE>compliancePackTemplate.setConfigRules(configRules);<NEW_LINE>compliancePackTemplates.add(compliancePackTemplate);<NEW_LINE>}<NEW_LINE>compliancePackTemplatesResult.setCompliancePackTemplates(compliancePackTemplates);<NEW_LINE>listCompliancePackTemplatesResponse.setCompliancePackTemplatesResult(compliancePackTemplatesResult);<NEW_LINE>return listCompliancePackTemplatesResponse;<NEW_LINE>} | ("ListCompliancePackTemplatesResponse.CompliancePackTemplatesResult.CompliancePackTemplates[" + i + "].AutomationHelpUrl")); |
1,554,485 | public void computeMacAndEncode(JwtSignRequest request, StreamObserver<JwtSignResponse> responseObserver) {<NEW_LINE>JwtSignResponse response;<NEW_LINE>try {<NEW_LINE>KeysetHandle keysetHandle = CleartextKeysetHandle.read(BinaryKeysetReader.withBytes(request.getKeyset().toByteArray()));<NEW_LINE>RawJwt rawJwt = convertJwtTokenToRawJwt(request.getRawJwt());<NEW_LINE>JwtMac jwtMac = keysetHandle.getPrimitive(JwtMac.class);<NEW_LINE>String signedCompactJwt = jwtMac.computeMacAndEncode(rawJwt);<NEW_LINE>response = JwtSignResponse.newBuilder().<MASK><NEW_LINE>} catch (GeneralSecurityException | InvalidProtocolBufferException e) {<NEW_LINE>response = JwtSignResponse.newBuilder().setErr(e.toString()).build();<NEW_LINE>} catch (IOException e) {<NEW_LINE>responseObserver.onError(Status.UNKNOWN.withDescription(e.getMessage()).asException());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>responseObserver.onNext(response);<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} | setSignedCompactJwt(signedCompactJwt).build(); |
1,410,873 | public void parseDetail(ByteBuffer bb) throws IOException {<NEW_LINE>objectTypeIndication = IsoTypeReader.readUInt8(bb);<NEW_LINE>int data = IsoTypeReader.readUInt8(bb);<NEW_LINE>streamType = data >>> 2;<NEW_LINE>upStream = (data >> 1) & 0x1;<NEW_LINE>bufferSizeDB = IsoTypeReader.readUInt24(bb);<NEW_LINE>maxBitRate = IsoTypeReader.readUInt32(bb);<NEW_LINE>avgBitRate = IsoTypeReader.readUInt32(bb);<NEW_LINE>BaseDescriptor descriptor;<NEW_LINE>while (bb.remaining() > 2) {<NEW_LINE>// 1byte tag + at least 1byte size<NEW_LINE>final int begin = bb.position();<NEW_LINE>descriptor = ObjectDescriptorFactory.createFrom(objectTypeIndication, bb);<NEW_LINE>final int read <MASK><NEW_LINE>LOG.trace("{} - DecoderConfigDescr1 read: {}, size: {}", descriptor, read, descriptor != null ? descriptor.getSize() : null);<NEW_LINE>if (descriptor != null) {<NEW_LINE>final int size = descriptor.getSize();<NEW_LINE>if (read < size) {<NEW_LINE>// skip<NEW_LINE>configDescriptorDeadBytes = new byte[size - read];<NEW_LINE>bb.get(configDescriptorDeadBytes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (descriptor instanceof DecoderSpecificInfo) {<NEW_LINE>decoderSpecificInfo = (DecoderSpecificInfo) descriptor;<NEW_LINE>} else if (descriptor instanceof AudioSpecificConfig) {<NEW_LINE>audioSpecificInfo = (AudioSpecificConfig) descriptor;<NEW_LINE>} else if (descriptor instanceof ProfileLevelIndicationDescriptor) {<NEW_LINE>profileLevelIndicationDescriptors.add((ProfileLevelIndicationDescriptor) descriptor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = bb.position() - begin; |
1,210,775 | public void process(final LifecycleEventsProto.StatusEvent statusEvent) {<NEW_LINE>String message = " " + statusEvent.statusEventType <MASK><NEW_LINE>if (statusEvent instanceof LifecycleEventsProto.WorkerStatusEvent) {<NEW_LINE>LifecycleEventsProto.WorkerStatusEvent wse = (LifecycleEventsProto.WorkerStatusEvent) statusEvent;<NEW_LINE>message = wse.getWorkerId().getId() + message + wse.getWorkerState();<NEW_LINE>} else if (statusEvent instanceof LifecycleEventsProto.JobStatusEvent) {<NEW_LINE>LifecycleEventsProto.JobStatusEvent jse = (LifecycleEventsProto.JobStatusEvent) statusEvent;<NEW_LINE>message = jse.getJobId() + message + jse.getJobState();<NEW_LINE>} else if (statusEvent instanceof LifecycleEventsProto.JobClusterStatusEvent) {<NEW_LINE>LifecycleEventsProto.JobClusterStatusEvent jcse = (LifecycleEventsProto.JobClusterStatusEvent) statusEvent;<NEW_LINE>message = jcse.getJobCluster() + message;<NEW_LINE>}<NEW_LINE>logger.info("[STATUS] {}", message);<NEW_LINE>} | + " " + statusEvent.message + " "; |
15,726 | public static DescribeAccountsResponse unmarshall(DescribeAccountsResponse describeAccountsResponse, UnmarshallerContext context) {<NEW_LINE>describeAccountsResponse.setRequestId(context.stringValue("DescribeAccountsResponse.RequestId"));<NEW_LINE>describeAccountsResponse.setPageSize(context.integerValue("DescribeAccountsResponse.PageSize"));<NEW_LINE>describeAccountsResponse.setCurrentPage(context.integerValue("DescribeAccountsResponse.CurrentPage"));<NEW_LINE>describeAccountsResponse.setTotalCount(context.integerValue("DescribeAccountsResponse.TotalCount"));<NEW_LINE>List<Account> items = new ArrayList<Account>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeAccountsResponse.Items.Length"); i++) {<NEW_LINE>Account account = new Account();<NEW_LINE>account.setId(context.longValue("DescribeAccountsResponse.Items[" + i + "].Id"));<NEW_LINE>account.setUserId(context.longValue("DescribeAccountsResponse.Items[" + i + "].UserId"));<NEW_LINE>account.setFirstLevelDepartId(context.longValue("DescribeAccountsResponse.Items[" + i + "].FirstLevelDepartId"));<NEW_LINE>account.setLoginName(context.stringValue("DescribeAccountsResponse.Items[" + i + "].LoginName"));<NEW_LINE>account.setFullName(context.stringValue("DescribeAccountsResponse.Items[" + i + "].FullName"));<NEW_LINE>account.setCellphoneNum(context.stringValue("DescribeAccountsResponse.Items[" + i + "].CellphoneNum"));<NEW_LINE>account.setTelephoneNum(context.stringValue<MASK><NEW_LINE>account.setEmail(context.stringValue("DescribeAccountsResponse.Items[" + i + "].Email"));<NEW_LINE>account.setActiveStatus(context.stringValue("DescribeAccountsResponse.Items[" + i + "].ActiveStatus"));<NEW_LINE>account.setDeleteStatus(context.stringValue("DescribeAccountsResponse.Items[" + i + "].DeleteStatus"));<NEW_LINE>account.setDataInstance(context.stringValue("DescribeAccountsResponse.Items[" + i + "].DataInstance"));<NEW_LINE>account.setCreateTime(context.longValue("DescribeAccountsResponse.Items[" + i + "].CreateTime"));<NEW_LINE>account.setLoginDataTime(context.longValue("DescribeAccountsResponse.Items[" + i + "].LoginDataTime"));<NEW_LINE>account.setLoginPolicyName(context.stringValue("DescribeAccountsResponse.Items[" + i + "].LoginPolicyName"));<NEW_LINE>account.setFirstLevelDepartName(context.stringValue("DescribeAccountsResponse.Items[" + i + "].FirstLevelDepartName"));<NEW_LINE>account.setRoleNames(context.stringValue("DescribeAccountsResponse.Items[" + i + "].RoleNames"));<NEW_LINE>account.setInstanceName(context.stringValue("DescribeAccountsResponse.Items[" + i + "].InstanceName"));<NEW_LINE>account.setAliUid(context.longValue("DescribeAccountsResponse.Items[" + i + "].AliUid"));<NEW_LINE>account.setAccountTypeId(context.longValue("DescribeAccountsResponse.Items[" + i + "].AccountTypeId"));<NEW_LINE>EventCount eventCount = new EventCount();<NEW_LINE>Total total = new Total();<NEW_LINE>total.setTotalCount(context.longValue("DescribeAccountsResponse.Items[" + i + "].EventCount.Total.TotalCount"));<NEW_LINE>total.setUndealCount(context.longValue("DescribeAccountsResponse.Items[" + i + "].EventCount.Total.UndealCount"));<NEW_LINE>total.setConfirmCount(context.longValue("DescribeAccountsResponse.Items[" + i + "].EventCount.Total.ConfirmCount"));<NEW_LINE>total.setExcludeCount(context.longValue("DescribeAccountsResponse.Items[" + i + "].EventCount.Total.ExcludeCount"));<NEW_LINE>eventCount.setTotal(total);<NEW_LINE>account.setEventCount(eventCount);<NEW_LINE>items.add(account);<NEW_LINE>}<NEW_LINE>describeAccountsResponse.setItems(items);<NEW_LINE>return describeAccountsResponse;<NEW_LINE>} | ("DescribeAccountsResponse.Items[" + i + "].TelephoneNum")); |
565,748 | public org.mlflow.api.proto.ModelRegistry.RegisteredModel buildPartial() {<NEW_LINE>org.mlflow.api.proto.ModelRegistry.RegisteredModel result = new org.mlflow.api.proto.ModelRegistry.RegisteredModel(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.name_ = name_;<NEW_LINE>if (((from_bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>result.creationTimestamp_ = creationTimestamp_;<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>result.lastUpdatedTimestamp_ = lastUpdatedTimestamp_;<NEW_LINE>if (((from_bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>to_bitField0_ |= 0x00000008;<NEW_LINE>}<NEW_LINE>result.userId_ = userId_;<NEW_LINE>if (((from_bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>to_bitField0_ |= 0x00000010;<NEW_LINE>}<NEW_LINE>result.description_ = description_;<NEW_LINE>if (latestVersionsBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>latestVersions_ = java.<MASK><NEW_LINE>bitField0_ = (bitField0_ & ~0x00000020);<NEW_LINE>}<NEW_LINE>result.latestVersions_ = latestVersions_;<NEW_LINE>} else {<NEW_LINE>result.latestVersions_ = latestVersionsBuilder_.build();<NEW_LINE>}<NEW_LINE>if (tagsBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000040) == 0x00000040)) {<NEW_LINE>tags_ = java.util.Collections.unmodifiableList(tags_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000040);<NEW_LINE>}<NEW_LINE>result.tags_ = tags_;<NEW_LINE>} else {<NEW_LINE>result.tags_ = tagsBuilder_.build();<NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | util.Collections.unmodifiableList(latestVersions_); |
661,682 | public J visitBinary(G.Binary binary, P p) {<NEW_LINE>G.Binary b = binary;<NEW_LINE>b = b.withPrefix(visitSpace(b.getPrefix(), GSpace.Location.BINARY_PREFIX, p));<NEW_LINE>b = b.withMarkers(visitMarkers(b.getMarkers(), p));<NEW_LINE>Expression temp = (<MASK><NEW_LINE>if (!(temp instanceof G.Binary)) {<NEW_LINE>return temp;<NEW_LINE>} else {<NEW_LINE>b = (G.Binary) temp;<NEW_LINE>}<NEW_LINE>b = b.withLeft(visitAndCast(b.getLeft(), p));<NEW_LINE>b = b.getPadding().withOperator(visitLeftPadded(b.getPadding().getOperator(), GLeftPadded.Location.BINARY_OPERATOR, p));<NEW_LINE>b = b.withRight(visitAndCast(b.getRight(), p));<NEW_LINE>b = b.withType(visitType(b.getType(), p));<NEW_LINE>return b;<NEW_LINE>} | Expression) visitExpression(b, p); |
219,314 | public void registerMap() {<NEW_LINE>// 0 - Location<NEW_LINE>map(Type.POSITION);<NEW_LINE>// 1 - Action<NEW_LINE>map(Type.UNSIGNED_BYTE);<NEW_LINE>// 2 - NBT data<NEW_LINE>map(Type.NBT);<NEW_LINE>handler(new PacketHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handle(PacketWrapper wrapper) throws Exception {<NEW_LINE>Position position = wrapper.get(Type.POSITION, 0);<NEW_LINE>short action = wrapper.get(Type.UNSIGNED_BYTE, 0);<NEW_LINE>CompoundTag tag = wrapper.get(Type.NBT, 0);<NEW_LINE>BlockEntityProvider provider = Via.getManager().getProviders().get(BlockEntityProvider.class);<NEW_LINE>int newId = provider.transform(wrapper.user(<MASK><NEW_LINE>if (newId != -1) {<NEW_LINE>BlockStorage storage = wrapper.user().get(BlockStorage.class);<NEW_LINE>BlockStorage.ReplacementData replacementData = storage.get(position);<NEW_LINE>if (replacementData != null) {<NEW_LINE>replacementData.setReplacement(newId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (action == 5) {<NEW_LINE>// Set type of flower in flower pot<NEW_LINE>// Removed<NEW_LINE>wrapper.cancel();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | ), position, tag, true); |
383,432 | public JSDynamicObject createPrototype(JSRealm realm, JSFunctionObject constructor) {<NEW_LINE>JSContext ctx = realm.getContext();<NEW_LINE>JSObject prototype = JSObjectUtil.createOrdinaryPrototypeObject(realm);<NEW_LINE>JSObjectUtil.putConstructorProperty(ctx, prototype, constructor);<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, CALENDAR, realm.lookupAccessor(TemporalPlainDatePrototypeBuiltins.BUILTINS, CALENDAR));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, YEAR, realm.lookupAccessor(TemporalPlainDatePrototypeBuiltins.BUILTINS, YEAR));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, MONTH, realm.lookupAccessor(TemporalPlainDatePrototypeBuiltins.BUILTINS, MONTH));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, MONTH_CODE, realm.lookupAccessor(TemporalPlainDatePrototypeBuiltins.BUILTINS, MONTH_CODE));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, DAY, realm.lookupAccessor(TemporalPlainDatePrototypeBuiltins.BUILTINS, DAY));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, DAY_OF_WEEK, realm.lookupAccessor<MASK><NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, DAY_OF_YEAR, realm.lookupAccessor(TemporalPlainDatePrototypeBuiltins.BUILTINS, DAY_OF_YEAR));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, WEEK_OF_YEAR, realm.lookupAccessor(TemporalPlainDatePrototypeBuiltins.BUILTINS, WEEK_OF_YEAR));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, DAYS_IN_WEEK, realm.lookupAccessor(TemporalPlainDatePrototypeBuiltins.BUILTINS, DAYS_IN_WEEK));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, DAYS_IN_MONTH, realm.lookupAccessor(TemporalPlainDatePrototypeBuiltins.BUILTINS, DAYS_IN_MONTH));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, DAYS_IN_YEAR, realm.lookupAccessor(TemporalPlainDatePrototypeBuiltins.BUILTINS, DAYS_IN_YEAR));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, MONTHS_IN_YEAR, realm.lookupAccessor(TemporalPlainDatePrototypeBuiltins.BUILTINS, MONTHS_IN_YEAR));<NEW_LINE>JSObjectUtil.putBuiltinAccessorProperty(prototype, IN_LEAP_YEAR, realm.lookupAccessor(TemporalPlainDatePrototypeBuiltins.BUILTINS, IN_LEAP_YEAR));<NEW_LINE>JSObjectUtil.putFunctionsFromContainer(realm, prototype, TemporalPlainDatePrototypeBuiltins.BUILTINS);<NEW_LINE>JSObjectUtil.putToStringTag(prototype, TO_STRING_TAG);<NEW_LINE>return prototype;<NEW_LINE>} | (TemporalPlainDatePrototypeBuiltins.BUILTINS, DAY_OF_WEEK)); |
1,808,197 | public // tag::message[]<NEW_LINE>void onSessionMessage(final ClientSession session, final long timestamp, final DirectBuffer buffer, final int offset, final int length, final Header header) {<NEW_LINE>// <1><NEW_LINE>final long correlationId = buffer.getLong(offset + CORRELATION_ID_OFFSET);<NEW_LINE>final long customerId = buffer.getLong(offset + CUSTOMER_ID_OFFSET);<NEW_LINE>final long price = buffer.getLong(offset + PRICE_OFFSET);<NEW_LINE>// <2><NEW_LINE>final boolean bidSucceeded = auction.attemptBid(price, customerId);<NEW_LINE>if (// <3><NEW_LINE>null != session) {<NEW_LINE>// <4><NEW_LINE>egressMessageBuffer.putLong(CORRELATION_ID_OFFSET, correlationId);<NEW_LINE>egressMessageBuffer.putLong(CUSTOMER_ID_OFFSET, auction.getCurrentWinningCustomerId());<NEW_LINE>egressMessageBuffer.putLong(PRICE_OFFSET, auction.getBestPrice());<NEW_LINE>egressMessageBuffer.putByte(BID_SUCCEEDED_OFFSET, bidSucceeded ? (byte<MASK><NEW_LINE>idleStrategy.reset();<NEW_LINE>while (// <5><NEW_LINE>session.offer(egressMessageBuffer, 0, EGRESS_MESSAGE_LENGTH) < 0) {<NEW_LINE>// <6><NEW_LINE>idleStrategy.idle();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ) 1 : (byte) 0); |
1,408,365 | private static // method declaration's throws clause to declare the new checked exceptions<NEW_LINE>void fixThrows(VisitorState state, SuggestedFix.Builder fix) {<NEW_LINE>MethodTree methodTree = state.findEnclosing(MethodTree.class);<NEW_LINE>if (methodTree == null || methodTree.getThrows().isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ImmutableMap.Builder<Type, ExpressionTree> thrown = ImmutableMap.builder();<NEW_LINE>for (ExpressionTree e : methodTree.getThrows()) {<NEW_LINE>thrown.put(ASTHelpers.getType(e), e);<NEW_LINE>}<NEW_LINE>UnhandledResult<ExpressionTree> result = unhandled(thrown.buildOrThrow(), state);<NEW_LINE>if (result.unhandled.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> <MASK><NEW_LINE>for (Type handle : result.unhandled) {<NEW_LINE>newThrows.add(handle.tsym.getSimpleName().toString());<NEW_LINE>}<NEW_LINE>Collections.sort(newThrows);<NEW_LINE>fix.postfixWith(Iterables.getLast(methodTree.getThrows()), ", " + Joiner.on(", ").join(newThrows));<NEW_LINE>// the other exceptions are in java.lang<NEW_LINE>fix.addImport("java.lang.reflect.InvocationTargetException");<NEW_LINE>} | newThrows = new ArrayList<>(); |
1,551,354 | public void modifyTestElement(TestElement element) {<NEW_LINE>super.modifyTestElement(element);<NEW_LINE>final String method = element.getPropertyAsString(HTTPSamplerBase.METHOD);<NEW_LINE>final GraphQLRequestParams params = new GraphQLRequestParams(operationNameText.getText(), queryContent.getText(), variablesContent.getText());<NEW_LINE>element.setProperty(OPERATION_NAME, params.getOperationName());<NEW_LINE>element.setProperty(QUERY, params.getQuery());<NEW_LINE>element.setProperty(VARIABLES, params.getVariables());<NEW_LINE>element.setProperty(HTTPSamplerBase.POST_BODY_RAW, !HTTPConstants<MASK><NEW_LINE>final Arguments args;<NEW_LINE>if (HTTPConstants.GET.equals(method)) {<NEW_LINE>args = createHTTPArgumentsTestElement();<NEW_LINE>if (StringUtils.isNotBlank(params.getOperationName())) {<NEW_LINE>args.addArgument(createHTTPArgument("operationName", params.getOperationName().trim(), true));<NEW_LINE>}<NEW_LINE>args.addArgument(createHTTPArgument("query", GraphQLRequestParamUtils.queryToGetParamValue(params.getQuery()), true));<NEW_LINE>if (StringUtils.isNotBlank(params.getVariables())) {<NEW_LINE>final String variablesParamValue = GraphQLRequestParamUtils.variablesToGetParamValue(params.getVariables());<NEW_LINE>if (variablesParamValue != null) {<NEW_LINE>args.addArgument(createHTTPArgument("variables", variablesParamValue, true));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>args = new Arguments();<NEW_LINE>args.addArgument(createHTTPArgument("", GraphQLRequestParamUtils.toPostBodyString(params), false));<NEW_LINE>}<NEW_LINE>element.setProperty(new TestElementProperty(HTTPSamplerBase.ARGUMENTS, args));<NEW_LINE>} | .GET.equals(method)); |
1,624,535 | public void voidCommand(TelCommand telCommand) throws Throwable {<NEW_LINE>String[] args = telCommand.getCommandArgs();<NEW_LINE>String argsJoin = StringUtils.join(args, "");<NEW_LINE>argsJoin = argsJoin.replace("\\s+", " ");<NEW_LINE>args = argsJoin.split("=");<NEW_LINE>//<NEW_LINE>if (args.length > 0) {<NEW_LINE>String cmd = telCommand.getCommandName();<NEW_LINE>String varName = <MASK><NEW_LINE>if (StringUtils.isBlank(varName)) {<NEW_LINE>throw new Exception("var name undefined.");<NEW_LINE>}<NEW_LINE>//<NEW_LINE>if ("set".equalsIgnoreCase(cmd)) {<NEW_LINE>if (args.length > 1) {<NEW_LINE>String varValue = args[1].trim();<NEW_LINE>telCommand.getSession().setAttribute(varName, varValue);<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>throw new Exception("args count error.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ("get".equalsIgnoreCase(cmd)) {<NEW_LINE>Object obj = telCommand.getSession().getAttribute(varName);<NEW_LINE>if (obj == null) {<NEW_LINE>telCommand.writeMessageLine("");<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>// TODO may be is object<NEW_LINE>telCommand.writeMessageLine(obj.toString());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>throw new Exception("does not support command '" + telCommand.getCommandName() + "'.");<NEW_LINE>} else {<NEW_LINE>throw new Exception("args count error.");<NEW_LINE>}<NEW_LINE>} | args[0].trim(); |
1,511,392 | public String asi(final ICalloutField calloutField) {<NEW_LINE>if (isCalloutActive()) {<NEW_LINE>return NO_ERROR;<NEW_LINE>}<NEW_LINE>final I_M_InOutLine inoutLine = calloutField.getModel(I_M_InOutLine.class);<NEW_LINE>final int asiId = inoutLine.getM_AttributeSetInstance_ID();<NEW_LINE>if (asiId <= 0) {<NEW_LINE>return NO_ERROR;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>final I_M_InOut inout = inoutLine.getM_InOut();<NEW_LINE>final <MASK><NEW_LINE>final int M_Warehouse_ID = inout.getM_Warehouse_ID();<NEW_LINE>// TODO: Env.getContextAsInt(ctx, WindowNo, CTXNAME_M_Locator_ID);<NEW_LINE>final int M_Locator_ID = inoutLine.getM_Locator_ID();<NEW_LINE>log.debug("M_Product_ID={}, M_ASI_ID={} - M_Warehouse_ID={}, M_Locator_ID={}", M_Product_ID, asiId, M_Warehouse_ID, M_Locator_ID);<NEW_LINE>//<NEW_LINE>// Check Selection<NEW_LINE>final int selected_asiId = calloutField.getTabInfoContextAsInt(CTXNAME_M_AttributeSetInstance_ID);<NEW_LINE>if (selected_asiId == asiId) {<NEW_LINE>final int selectedM_Locator_ID = calloutField.getTabInfoContextAsInt(CTXNAME_M_Locator_ID);<NEW_LINE>if (selectedM_Locator_ID > 0) {<NEW_LINE>log.debug("Selected M_Locator_ID={}", selectedM_Locator_ID);<NEW_LINE>inoutLine.setM_Locator_ID(selectedM_Locator_ID);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// metas: make sure that MovementQty must be 1 for a product with a serial number.<NEW_LINE>final I_M_AttributeSetInstance attributeSetInstance = inoutLine.getM_AttributeSetInstance();<NEW_LINE>if (attributeSetInstance != null) {<NEW_LINE>final BigDecimal qtyEntered = inoutLine.getQtyEntered();<NEW_LINE>final String serNo = attributeSetInstance.getSerNo();<NEW_LINE>if (!Check.isEmpty(serNo, true) && (qtyEntered == null || qtyEntered.compareTo(BigDecimal.ONE) != 0)) {<NEW_LINE>final int windowNo = calloutField.getWindowNo();<NEW_LINE>Services.get(IClientUI.class).info(windowNo, MSG_SERIALNO_QTY_ONE);<NEW_LINE>inoutLine.setQtyEntered(BigDecimal.ONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// metas end<NEW_LINE>return NO_ERROR;<NEW_LINE>} | int M_Product_ID = inoutLine.getM_Product_ID(); |
985,897 | static void completeInPlaceSubtract(TBigInteger op1, TBigInteger op2) {<NEW_LINE>int resultSign = op1.compareTo(op2);<NEW_LINE>if (op1.sign == 0) {<NEW_LINE>System.arraycopy(op2.digits, 0, op1.digits, 0, op2.numberLength);<NEW_LINE>op1.sign = -op2.sign;<NEW_LINE>} else if (op1.sign != op2.sign) {<NEW_LINE>add(op1.digits, op1.digits, op1.numberLength, op2.digits, op2.numberLength);<NEW_LINE>op1.sign = resultSign;<NEW_LINE>} else {<NEW_LINE>int sign = unsignedArraysCompare(op1.digits, op2.digits, op1.numberLength, op2.numberLength);<NEW_LINE>if (sign > 0) {<NEW_LINE>subtract(op1.digits, op1.digits, op1.numberLength, op2.digits, op2.numberLength);<NEW_LINE>// op1.sign remains equal<NEW_LINE>} else {<NEW_LINE>inverseSubtract(op1.digits, op1.digits, op1.numberLength, op2.digits, op2.numberLength);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>op1.numberLength = Math.max(op1.numberLength, op2.numberLength) + 1;<NEW_LINE>op1.cutOffLeadingZeroes();<NEW_LINE>op1.unCache();<NEW_LINE>} | op1.sign = -op1.sign; |
1,819,703 | // obtains the data and calculates the grid of results<NEW_LINE>private static void calculate(CalculationRunner runner) {<NEW_LINE>// the trades for which to calculate a P&L series<NEW_LINE>List<Trade> trades = ImmutableList.of(createTrade());<NEW_LINE>// the columns, specifying the measures to be calculated<NEW_LINE>List<Column> columns = ImmutableList.of(Column.of(Measures.PRESENT_VALUE));<NEW_LINE>// use the built-in example historical scenario market data<NEW_LINE>ExampleMarketDataBuilder marketDataBuilder = ExampleMarketDataBuilder.ofResource(MARKET_DATA_RESOURCE_ROOT);<NEW_LINE>// the complete set of rules for calculating measures<NEW_LINE>CalculationFunctions functions = StandardComponents.calculationFunctions();<NEW_LINE>CalculationRules rules = CalculationRules.of(functions, marketDataBuilder.ratesLookup(LocalDate.of(2015, 4, 23)));<NEW_LINE>// load the historical calibrated curves from which we will build our scenarios<NEW_LINE>// these curves are provided in the example data environment<NEW_LINE>SortedMap<LocalDate, RatesCurveGroup> historicalCurves = marketDataBuilder.loadAllRatesCurves();<NEW_LINE>// sorted list of dates for the available series of curves<NEW_LINE>// the entries in the P&L vector we produce will correspond to these dates<NEW_LINE>List<LocalDate> scenarioDates = new ArrayList<>(historicalCurves.keySet());<NEW_LINE>// build the historical scenarios<NEW_LINE>ScenarioDefinition historicalScenarios = buildHistoricalScenarios(historicalCurves, scenarioDates);<NEW_LINE>// build a market data snapshot for the valuation date<NEW_LINE>// this is the base snapshot which will be perturbed by the scenarios<NEW_LINE>LocalDate valuationDate = LocalDate.of(2015, 4, 23);<NEW_LINE>MarketData marketData = marketDataBuilder.buildSnapshot(valuationDate);<NEW_LINE>// the reference data, such as holidays and securities<NEW_LINE><MASK><NEW_LINE>// calculate the results<NEW_LINE>MarketDataRequirements reqs = MarketDataRequirements.of(rules, trades, columns, refData);<NEW_LINE>ScenarioMarketData scenarioMarketData = marketDataFactory().createMultiScenario(reqs, MarketDataConfig.empty(), marketData, refData, historicalScenarios);<NEW_LINE>Results results = runner.calculateMultiScenario(rules, trades, columns, scenarioMarketData, refData);<NEW_LINE>// the results contain the one measure requested (Present Value) for each scenario<NEW_LINE>ScenarioArray<CurrencyAmount> scenarioValuations = results.getScenarios(0, 0, CurrencyAmount.class).getValue();<NEW_LINE>outputPnl(scenarioDates, scenarioValuations);<NEW_LINE>} | ReferenceData refData = ReferenceData.standard(); |
277,289 | public Object evaluateRecord(OIdentifiable iRecord, ODocument iCurrentResult, OSQLFilterCondition iCondition, Object iLeft, Object iRight, OCommandContext iContext, final ODocumentSerializer serializer) {<NEW_LINE>List<Number> left <MASK><NEW_LINE>double lat = left.get(0).doubleValue();<NEW_LINE>double lon = left.get(1).doubleValue();<NEW_LINE>Shape shape = factory.context().makePoint(lon, lat);<NEW_LINE>List<Number> right = (List<Number>) iRight;<NEW_LINE>double lat1 = right.get(0).doubleValue();<NEW_LINE>double lon1 = right.get(1).doubleValue();<NEW_LINE>Shape shape1 = factory.context().makePoint(lon1, lat1);<NEW_LINE>Map map = (Map) right.get(2);<NEW_LINE>double distance = 0;<NEW_LINE>Number n = (Number) map.get("maxDistance");<NEW_LINE>if (n != null) {<NEW_LINE>distance = n.doubleValue();<NEW_LINE>}<NEW_LINE>Point p = (Point) shape1;<NEW_LINE>Circle circle = factory.context().makeCircle(p.getX(), p.getY(), DistanceUtils.dist2Degrees(distance, DistanceUtils.EARTH_MEAN_RADIUS_KM));<NEW_LINE>double docDistDEG = factory.context().getDistCalc().distance((Point) shape, p);<NEW_LINE>final double docDistInKM = DistanceUtils.degrees2Dist(docDistDEG, DistanceUtils.EARTH_EQUATORIAL_RADIUS_KM);<NEW_LINE>iContext.setVariable("distance", docDistInKM);<NEW_LINE>return shape.relate(circle) == SpatialRelation.WITHIN;<NEW_LINE>} | = (List<Number>) iLeft; |
1,283,536 | public Future putBlob(final Callback callback, final MetricsCollector metricsCollector) {<NEW_LINE>int randomNum = localRandom.nextInt((maxBlobSize - minBlobSize) + 1) + minBlobSize;<NEW_LINE>final byte[] blob = new byte[randomNum];<NEW_LINE>byte[] usermetadata = new byte[random.nextInt(1024)];<NEW_LINE>BlobProperties props = new BlobProperties(randomNum, "test", Account.UNKNOWN_ACCOUNT_ID, Container.UNKNOWN_CONTAINER_ID, false);<NEW_LINE>final FutureResult futureResult = new FutureResult();<NEW_LINE>try {<NEW_LINE>final long startTimeInMs = SystemTime.getInstance().milliseconds();<NEW_LINE>ByteBufferReadableStreamChannel putChannel = new ByteBufferReadableStreamChannel(ByteBuffer.wrap(blob));<NEW_LINE>router.putBlob(props, usermetadata, putChannel, new PutBlobOptionsBuilder().build(), new Callback<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCompletion(String result, Exception exception) {<NEW_LINE>long latencyPerBlob = SystemTime.getInstance().milliseconds() - startTimeInMs;<NEW_LINE>metricsCollector.updateLatency(latencyPerBlob);<NEW_LINE>logger.trace(" Time taken to put blob id {} in ms {} for blob of size {}", result, latencyPerBlob, blob.length);<NEW_LINE>Exception exceptionToReturn = null;<NEW_LINE>Pair<String, byte[]> toReturn = null;<NEW_LINE>if (result != null) {<NEW_LINE>toReturn = new Pair(result, blob);<NEW_LINE>} else {<NEW_LINE>exceptionToReturn = exception;<NEW_LINE>}<NEW_LINE>futureResult.done(toReturn, exceptionToReturn);<NEW_LINE>if (callback != null) {<NEW_LINE>callback.onCompletion(toReturn, exceptionToReturn);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, QUOTA_CHARGE_EVENT_LISTENER);<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>if (callback != null) {<NEW_LINE>callback.onCompletion(null, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return futureResult;<NEW_LINE>} | futureResult.done(null, e); |
1,093,630 | public ListenableFuture<?> processFor(long maxRuntime, long start) {<NEW_LINE>checkLockNotHeld("Can not process for a duration while holding the driver lock");<NEW_LINE>try (DriverLockResult lockResult = tryLockAndProcessPendingStateChanges(100, TimeUnit.MILLISECONDS)) {<NEW_LINE>if (lockResult.wasAcquired()) {<NEW_LINE>driverContext.startProcessTimer();<NEW_LINE>driverContext.getYieldSignal().setWithDelay(maxRuntime, driverContext.getPipelineContext().<MASK><NEW_LINE>try {<NEW_LINE>do {<NEW_LINE>ListenableFuture<?> future = processInternal();<NEW_LINE>if (!future.isDone()) {<NEW_LINE>return future;<NEW_LINE>}<NEW_LINE>} while (System.currentTimeMillis() - start < maxRuntime && !isFinishedInternal());<NEW_LINE>} finally {<NEW_LINE>driverContext.getYieldSignal().reset();<NEW_LINE>driverContext.recordProcessed();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return NOT_BLOCKED;<NEW_LINE>} | getTaskContext().getYieldExecutor()); |
143,263 | public static String escape(String source, char delimiter) {<NEW_LINE>byte[] bytes = source.getBytes(UTF8);<NEW_LINE>ByteArrayOutputStream result = new ByteArrayOutputStream();<NEW_LINE>for (byte b : bytes) {<NEW_LINE>int val = b;<NEW_LINE>if (val < 0)<NEW_LINE>val += 256;<NEW_LINE>if (b == delimiter) {<NEW_LINE>result.write('\\');<NEW_LINE>result.write('x');<NEW_LINE>result.write(toHex((val >> 4) & 0xF));<NEW_LINE>result.write(toHex(val & 0xF));<NEW_LINE>} else if (replacementCharacters.needEscape[val] == 0) {<NEW_LINE>result.write(b);<NEW_LINE>} else {<NEW_LINE>if (replacementCharacters.needEscape[val] == 3) {<NEW_LINE>result.write('\\');<NEW_LINE>result.write('x');<NEW_LINE>}<NEW_LINE>result.write(replacementCharacters.replacement1[val]);<NEW_LINE>result.write(replacementCharacters.replacement2[val]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new String(<MASK><NEW_LINE>} | result.toByteArray(), UTF8); |
303,975 | public static void renderHUD(PoseStack ms, Player player, ItemStack stack, float pticks) {<NEW_LINE>int xo = Minecraft.getInstance().getWindow().getGuiScaledWidth() / 2 - 20;<NEW_LINE>int y = Minecraft.getInstance().getWindow().getGuiScaledHeight() / 2 + 20;<NEW_LINE>if (!player.getAbilities().flying) {<NEW_LINE>int cd = ItemNBTHelper.getInt(stack, TAG_DODGE_COOLDOWN, 0);<NEW_LINE>int width = Math.min((int) ((cd - pticks) * 2), 40);<NEW_LINE>RenderSystem.setShaderColor(1F, 1F, 1F, 1F);<NEW_LINE>if (width > 0) {<NEW_LINE>GuiComponent.fill(ms, xo, y - 2, xo + <MASK><NEW_LINE>GuiComponent.fill(ms, xo, y - 2, xo + width, y - 1, 0xFFFFFFFF);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>RenderSystem.setShaderColor(1F, 1F, 1F, 1F);<NEW_LINE>} | 40, y - 1, 0x88000000); |
1,021,431 | public void validate() throws InvalidPropertyException {<NEW_LINE>PrintStream out = DebugTracer.getPrintStream();<NEW_LINE>boolean good = false;<NEW_LINE><MASK><NEW_LINE>if (debug) {<NEW_LINE>out.println("ActivationAnnNonJB1.validate(): Current contents of Prop1: " + prop1);<NEW_LINE>out.println("ActivationAnnNonJB1.validate(): Current destinationType: " + destinationType);<NEW_LINE>}<NEW_LINE>if (destination != null) {<NEW_LINE>if (destination instanceof TRAAdminObject1) {<NEW_LINE>if (debug)<NEW_LINE>out.println("ActivationAnnNonJB1.validate(): destination is of type TRAAdminObject1");<NEW_LINE>good = true;<NEW_LINE>// Return from here... Not a pretty way to control the<NEW_LINE>// flow, but it works.<NEW_LINE>// Returning because we have a valid situation, otherwise we want to<NEW_LINE>// throw an exception<NEW_LINE>} else if (destination instanceof TRAAdminObject2) {<NEW_LINE>if (debug)<NEW_LINE>out.println("ActivationAnnNonJB1.validate(): destination is of type TRAAdminObject2");<NEW_LINE>good = true;<NEW_LINE>} else {<NEW_LINE>if (debug)<NEW_LINE>out.println("ActivationAnnNonJB1.validate(): destination is of type: " + destination.getClass().getName());<NEW_LINE>// for now<NEW_LINE>good = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (debug)<NEW_LINE>out.println("ActivationAnnNonJB1.validate(): destination is null");<NEW_LINE>// why not.<NEW_LINE>good = true;<NEW_LINE>}<NEW_LINE>if (!good) {<NEW_LINE>throw new InvalidPropertyException("ActivationAnnNonJB1.validate() failed due to unusable type.");<NEW_LINE>}<NEW_LINE>} | boolean debug = DebugTracer.isDebugActivationSpec(); |
240,049 | public void marshall(Event event, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (event == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(event.getArn(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(event.getService(), SERVICE_BINDING);<NEW_LINE>protocolMarshaller.marshall(event.getEventTypeCode(), EVENTTYPECODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(event.getEventTypeCategory(), EVENTTYPECATEGORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(event.getRegion(), REGION_BINDING);<NEW_LINE>protocolMarshaller.marshall(event.getAvailabilityZone(), AVAILABILITYZONE_BINDING);<NEW_LINE>protocolMarshaller.marshall(event.getStartTime(), STARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(event.getEndTime(), ENDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(event.getStatusCode(), STATUSCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(event.getEventScopeCode(), EVENTSCOPECODE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | event.getLastUpdatedTime(), LASTUPDATEDTIME_BINDING); |
241,655 | private synchronized V _put(K key, V value, long keepTime, MODE m) {<NEW_LINE>ENTRY<K, V>[] tab = table;<NEW_LINE>int index = hash(key) % tab.length;<NEW_LINE>for (ENTRY<K, V> e = tab[index]; e != null; e = e.next) {<NEW_LINE>if (CompareUtil.equals(e.key, key)) {<NEW_LINE>V old = e.value;<NEW_LINE>e.value = value;<NEW_LINE>e.keepAlive(keepTime);<NEW_LINE>switch(m) {<NEW_LINE>case FORCE_FIRST:<NEW_LINE>if (header.link_next != e) {<NEW_LINE>unchain(e);<NEW_LINE>chain(<MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FORCE_LAST:<NEW_LINE>if (header.link_prev != e) {<NEW_LINE>unchain(e);<NEW_LINE>chain(header.link_prev, header, e);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return old;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (max > 0) {<NEW_LINE>switch(m) {<NEW_LINE>case FORCE_FIRST:<NEW_LINE>case FIRST:<NEW_LINE>while (count >= max) {<NEW_LINE>removeLast();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FORCE_LAST:<NEW_LINE>case LAST:<NEW_LINE>while (count >= max) {<NEW_LINE>removeFirst();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (count >= threshold) {<NEW_LINE>rehash();<NEW_LINE>tab = table;<NEW_LINE>index = hash(key) % tab.length;<NEW_LINE>}<NEW_LINE>ENTRY e = new ENTRY(key, value, keepTime, tab[index]);<NEW_LINE>tab[index] = e;<NEW_LINE>switch(m) {<NEW_LINE>case FORCE_FIRST:<NEW_LINE>case FIRST:<NEW_LINE>chain(header, header.link_next, e);<NEW_LINE>break;<NEW_LINE>case FORCE_LAST:<NEW_LINE>case LAST:<NEW_LINE>chain(header.link_prev, header, e);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>return null;<NEW_LINE>} | header, header.link_next, e); |
513,270 | public void visitAPIResponse(AnnotationModel annotation, AnnotatedElement element, ApiContext context) {<NEW_LINE>APIResponseImpl apiResponse = <MASK><NEW_LINE>Operation workingOperation = context.getWorkingOperation();<NEW_LINE>// Handle exception mappers<NEW_LINE>if (workingOperation == null) {<NEW_LINE>if (element instanceof MethodModel && "toResponse".equals(element.getName())) {<NEW_LINE>final MethodModel methodModel = (MethodModel) element;<NEW_LINE>final String exceptionType = methodModel.getParameter(0).getTypeName();<NEW_LINE>mapException(context, exceptionType, apiResponse);<NEW_LINE>} else {<NEW_LINE>LOGGER.warning("Unrecognised annotation position at: " + element.shortDesc());<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>APIResponsesImpl.merge(apiResponse, workingOperation.getResponses(), true, context);<NEW_LINE>// If an APIResponse has been processed that isn't the default<NEW_LINE>String responseCode = apiResponse.getResponseCode();<NEW_LINE>if (responseCode != null && !responseCode.isEmpty() && !responseCode.equals(APIResponses.DEFAULT)) {<NEW_LINE>// If the element doesn't also contain a response mapping to the default<NEW_LINE>AnnotationModel apiResponsesParent = element.getAnnotation(org.eclipse.microprofile.openapi.annotations.responses.APIResponses.class.getName());<NEW_LINE>if (apiResponsesParent != null) {<NEW_LINE>List<AnnotationModel> apiResponses = apiResponsesParent.getValue("value", List.class);<NEW_LINE>if (apiResponses.stream().map(a -> a.getValue("responseCode", String.class)).noneMatch(code -> code == null || code.isEmpty() || code.equals(APIResponses.DEFAULT))) {<NEW_LINE>// Then remove the default response<NEW_LINE>workingOperation.getResponses().removeAPIResponse(APIResponses.DEFAULT);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>workingOperation.getResponses().removeAPIResponse(APIResponses.DEFAULT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | APIResponseImpl.createInstance(annotation, context); |
452,710 | static void savePrediction8x8(DecoderState sharedState, int mbX, MvList x) {<NEW_LINE>sharedState.mvTopLeft.copyPair(0, sharedState.mvTop, (mbX << 2) + 3);<NEW_LINE>sharedState.mvLeft.<MASK><NEW_LINE>sharedState.mvLeft.copyPair(1, x, 7);<NEW_LINE>sharedState.mvLeft.copyPair(2, x, 11);<NEW_LINE>sharedState.mvLeft.copyPair(3, x, 15);<NEW_LINE>sharedState.mvTop.copyPair(mbX << 2, x, 12);<NEW_LINE>sharedState.mvTop.copyPair((mbX << 2) + 1, x, 13);<NEW_LINE>sharedState.mvTop.copyPair((mbX << 2) + 2, x, 14);<NEW_LINE>sharedState.mvTop.copyPair((mbX << 2) + 3, x, 15);<NEW_LINE>} | copyPair(0, x, 3); |
1,439,930 | public static void checkDisplaySize(Context context, Configuration newConfiguration) {<NEW_LINE>try {<NEW_LINE>density = context.getResources().getDisplayMetrics().density;<NEW_LINE>Configuration configuration = newConfiguration;<NEW_LINE>if (configuration == null) {<NEW_LINE>configuration = context.getResources().getConfiguration();<NEW_LINE>}<NEW_LINE>WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);<NEW_LINE>if (manager != null) {<NEW_LINE>Display display = manager.getDefaultDisplay();<NEW_LINE>if (display != null) {<NEW_LINE>display.getMetrics(displayMetrics);<NEW_LINE>display.getSize(displaySize);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (configuration.screenWidthDp != Configuration.SCREEN_WIDTH_DP_UNDEFINED) {<NEW_LINE>int newSize = (int) Math.ceil(configuration.screenWidthDp * density);<NEW_LINE>if (Math.abs(displaySize.x - newSize) > 3) {<NEW_LINE>displaySize.x = newSize;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (configuration.screenHeightDp != Configuration.SCREEN_HEIGHT_DP_UNDEFINED) {<NEW_LINE>int newSize = (int) Math.<MASK><NEW_LINE>if (Math.abs(displaySize.y - newSize) > 3) {<NEW_LINE>displaySize.y = newSize;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Utils.printLog(context, "DimensionUtils", "Display size = " + displaySize.x + " " + displaySize.y + " " + displayMetrics.xdpi + "x" + displayMetrics.ydpi);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | ceil(configuration.screenHeightDp * density); |
986,974 | FinishPatchOperation popFinishPatchAction(String patchId, boolean clear) {<NEW_LINE>String value = getPreferences().get(HOOK_PREFIX + <MASK><NEW_LINE>if (value == null)<NEW_LINE>return null;<NEW_LINE>String[] values = value.split(DELIMITER);<NEW_LINE>if (clear) {<NEW_LINE>getPreferences().remove(HOOK_PREFIX + type + HOOK_QFINISH_ + patchId);<NEW_LINE>}<NEW_LINE>return values.length < 5 ? null : new // NOI18N<NEW_LINE>FinishPatchOperation(// NOI18N<NEW_LINE>values[0], // NOI18N<NEW_LINE>values[4].isEmpty() ? null : values[4], // NOI18N<NEW_LINE>"1".equals(values[1]) ? true : false, // NOI18N<NEW_LINE>"1".equals(values[2]) ? true : false, "1".equals(values[3]) ? true : false);<NEW_LINE>} | type + HOOK_QFINISH_ + patchId, null); |
69,790 | // actionPerformed<NEW_LINE>private void send() throws Exception {<NEW_LINE>final IMsgBL msgBL = Services.get(IMsgBL.class);<NEW_LINE>final <MASK><NEW_LINE>setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));<NEW_LINE>confirmPanel.getOKButton().setEnabled(false);<NEW_LINE>final StringTokenizer st = new StringTokenizer(getTo(), " ,;", false);<NEW_LINE>final EMailAddress to = EMailAddress.ofString(st.nextToken());<NEW_LINE>email = m_client.createEMail(getFromUserEMailConfig(), to, getSubject(), getMessage(), true);<NEW_LINE>String status = "Check Setup";<NEW_LINE>if (email != null) {<NEW_LINE>while (st.hasMoreTokens()) {<NEW_LINE>email.addTo(EMailAddress.ofString(st.nextToken()));<NEW_LINE>}<NEW_LINE>// cc<NEW_LINE>final StringTokenizer stcc = new StringTokenizer(getCc(), " ,;", false);<NEW_LINE>while (stcc.hasMoreTokens()) {<NEW_LINE>final String cc = stcc.nextToken();<NEW_LINE>if (cc != null && cc.length() > 0) {<NEW_LINE>email.addCc(EMailAddress.ofString(cc));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// metas<NEW_LINE>addBcc(email);<NEW_LINE>// Attachment<NEW_LINE>// metas<NEW_LINE>attachDocument(email);<NEW_LINE>if (m_attachFile != null && m_attachFile.exists()) {<NEW_LINE>email.addAttachment(m_attachFile);<NEW_LINE>}<NEW_LINE>// metas: begin<NEW_LINE>final File pdf = fLetter.getPDF();<NEW_LINE>if (pdf != null && pdf.exists()) {<NEW_LINE>email.addAttachment(pdf);<NEW_LINE>}<NEW_LINE>// metas: end<NEW_LINE>final EMailSentStatus emailSentStatus = email.send();<NEW_LINE>//<NEW_LINE>if (m_user != null) {<NEW_LINE>new MUserMail(Env.getCtx(), m_user.getAD_User_ID(), email, emailSentStatus).save();<NEW_LINE>}<NEW_LINE>if (emailSentStatus.isSentOK()) {<NEW_LINE>// updating the status first, to make sure it's done when the user reads the message and clicks on OK<NEW_LINE>updateDocExchange(ArchiveEmailSentStatus.MESSAGE_SENT);<NEW_LINE>ADialog.info(0, this, "MessageSent");<NEW_LINE>dispose();<NEW_LINE>} else {<NEW_LINE>// updating the status first, to make sure it's done when the user reads the message and clicks on OK<NEW_LINE>updateDocExchange(ArchiveEmailSentStatus.MESSAGE_NOT_SENT);<NEW_LINE>ADialog.error(0, this, "MessageNotSent", status);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// updating the status first, to make sure it's done when the user reads the message and clicks on OK<NEW_LINE>updateDocExchange(ArchiveEmailSentStatus.MESSAGE_NOT_SENT);<NEW_LINE>ADialog.error(0, this, "MessageNotSent", status);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>confirmPanel.getOKButton().setEnabled(true);<NEW_LINE>setCursor(Cursor.getDefaultCursor());<NEW_LINE>} | Properties ctx = Env.getCtx(); |
178,140 | public ActorFuture<Void> copySnapshot(final PersistedSnapshot snapshot, final Path targetDirectory) {<NEW_LINE>final CompletableActorFuture<Void> result = new CompletableActorFuture<>();<NEW_LINE>actor.run(() -> {<NEW_LINE>if (!Files.exists(snapshot.getPath())) {<NEW_LINE>result.completeExceptionally(String.format("Expected to copy snapshot %s to directory %s, but snapshot directory %s does not exists. Snapshot may have been deleted.", snapshot.getId(), targetDirectory, snapshot.getPath(<MASK><NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>FileUtil.copySnapshot(snapshot.getPath(), targetDirectory);<NEW_LINE>result.complete(null);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>result.completeExceptionally(String.format("Failed to copy snapshot %s to directory %s.", snapshot.getId(), targetDirectory), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return result;<NEW_LINE>} | )), new FileNotFoundException()); |
1,020,877 | public MethodInsnAST visit(int lineNo, String line) throws ASTParseException {<NEW_LINE>try {<NEW_LINE>String[] trim = line.trim().split("\\s+");<NEW_LINE>if (trim.length < 2)<NEW_LINE>throw new ASTParseException(lineNo, "Not enough paramters");<NEW_LINE>int start = line.indexOf(trim[0]);<NEW_LINE>// op<NEW_LINE>OpcodeParser opParser = new OpcodeParser();<NEW_LINE>opParser.setOffset(line.indexOf(trim[0]));<NEW_LINE>OpcodeAST op = opParser.visit(lineNo, trim[0]);<NEW_LINE>// owner & name & desc<NEW_LINE>String data = trim[1];<NEW_LINE>int dot = data.indexOf('.');<NEW_LINE>if (dot == -1)<NEW_LINE>throw new ASTParseException(lineNo, "Format error: expecting '<Owner>.<Name><Desc>'" + " - missing '.'");<NEW_LINE>int parenthesis = data.indexOf('(');<NEW_LINE>if (parenthesis < dot)<NEW_LINE>throw new ASTParseException(lineNo, "Format error: Missing valid method descriptor");<NEW_LINE>String typeS = data.substring(0, dot);<NEW_LINE>String nameS = data.substring(dot + 1, parenthesis);<NEW_LINE>String descS = data.substring(parenthesis);<NEW_LINE>// owner<NEW_LINE>TypeParser typeParser = new TypeParser();<NEW_LINE>typeParser.setOffset(line.indexOf(data));<NEW_LINE>TypeAST owner = typeParser.visit(lineNo, typeS);<NEW_LINE>// name<NEW_LINE>NameParser nameParser = new NameParser(this);<NEW_LINE>nameParser.setOffset(line.indexOf('.'));<NEW_LINE>NameAST name = <MASK><NEW_LINE>// desc<NEW_LINE>DescParser descParser = new DescParser();<NEW_LINE>descParser.setOffset(line.indexOf('('));<NEW_LINE>DescAST desc = descParser.visit(lineNo, descS);<NEW_LINE>return new MethodInsnAST(lineNo, start, op, owner, name, desc);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new ASTParseException(ex, lineNo, "Bad format for method instruction");<NEW_LINE>}<NEW_LINE>} | nameParser.visit(lineNo, nameS); |
1,106,897 | static Alert buildDeleteAlertDialog(List<Path> pathsLabel) {<NEW_LINE>Alert deleteAlert = new WindowModalAlert(Alert.AlertType.WARNING, null, ButtonType.YES, ButtonType.CANCEL);<NEW_LINE>deleteAlert.setHeaderText("Do you want to delete selected path(s)?");<NEW_LINE>DialogPane dialogPane = deleteAlert.getDialogPane();<NEW_LINE>ObservableList<Path> paths = Optional.ofNullable(pathsLabel).map(FXCollections::observableList).orElse(FXCollections.emptyObservableList());<NEW_LINE>if (paths.isEmpty()) {<NEW_LINE>dialogPane.setContentText("There are no files selected.");<NEW_LINE>deleteAlert.getButtonTypes().clear();<NEW_LINE>deleteAlert.getButtonTypes().add(ButtonType.CANCEL);<NEW_LINE>return deleteAlert;<NEW_LINE>}<NEW_LINE>ListView<Path> listView <MASK><NEW_LINE>listView.setId("listOfPaths");<NEW_LINE>GridPane gridPane = new GridPane();<NEW_LINE>gridPane.addRow(0, listView);<NEW_LINE>GridPane.setHgrow(listView, Priority.ALWAYS);<NEW_LINE>double minWidth = 200.0;<NEW_LINE>double maxWidth = Screen.getScreens().stream().mapToDouble(s -> s.getBounds().getWidth() / 3).min().orElse(minWidth);<NEW_LINE>double prefWidth = paths.stream().map(String::valueOf).mapToDouble(s -> s.length() * 7).max().orElse(maxWidth);<NEW_LINE>double minHeight = IntStream.of(paths.size()).map(e -> e * 70).filter(e -> e <= 300 && e >= 70).findFirst().orElse(200);<NEW_LINE>gridPane.setMinWidth(minWidth);<NEW_LINE>gridPane.setPrefWidth(prefWidth);<NEW_LINE>gridPane.setPrefHeight(minHeight);<NEW_LINE>dialogPane.setContent(gridPane);<NEW_LINE>return deleteAlert;<NEW_LINE>} | = new ListView<>(paths); |
900,345 | final GetRelationalDatabaseLogEventsResult executeGetRelationalDatabaseLogEvents(GetRelationalDatabaseLogEventsRequest getRelationalDatabaseLogEventsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getRelationalDatabaseLogEventsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetRelationalDatabaseLogEventsRequest> request = null;<NEW_LINE>Response<GetRelationalDatabaseLogEventsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetRelationalDatabaseLogEventsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getRelationalDatabaseLogEventsRequest));<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, "GetRelationalDatabaseLogEvents");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetRelationalDatabaseLogEventsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetRelationalDatabaseLogEventsResultJsonUnmarshaller());<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,690,468 | public ProcessInstance execute(CommandContext commandContext) {<NEW_LINE>ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);<NEW_LINE>ProcessDefinition processDefinition = getProcessDefinition(processEngineConfiguration, commandContext);<NEW_LINE>processInstanceHelper = processEngineConfiguration.getProcessInstanceHelper();<NEW_LINE>ExecutionEntity processInstance = (ExecutionEntity) processInstanceHelper.createProcessInstance(processDefinition, businessKey, businessStatus, processInstanceName, overrideDefinitionTenantId, predefinedProcessInstanceId, variables, transientVariables, callbackId, callbackType, <MASK><NEW_LINE>ExecutionEntity execution = processInstance.getExecutions().get(0);<NEW_LINE>Process process = ProcessDefinitionUtil.getProcess(processInstance.getProcessDefinitionId());<NEW_LINE>processInstanceHelper.processAvailableEventSubProcesses(processInstance, process, commandContext);<NEW_LINE>FlowableEventDispatcher eventDispatcher = processEngineConfiguration.getEventDispatcher();<NEW_LINE>if (eventDispatcher != null && eventDispatcher.isEnabled()) {<NEW_LINE>eventDispatcher.dispatchEvent(FlowableEventBuilder.createProcessStartedEvent(execution, variables, false), processEngineConfiguration.getEngineCfgKey());<NEW_LINE>}<NEW_LINE>executeAsynchronous(execution, process, commandContext);<NEW_LINE>return processInstance;<NEW_LINE>} | referenceId, referenceType, stageInstanceId, false); |
1,289,167 | public static void main(String[] args) {<NEW_LINE>try {<NEW_LINE>CommandLine cl = parseComandLine(args);<NEW_LINE>DcmValidate main = new DcmValidate();<NEW_LINE>String iodFile = cl.getOptionValue("iod");<NEW_LINE>if (iodFile == null)<NEW_LINE>throw new MissingOptionException(Arrays.asList("iod"));<NEW_LINE>main.setIOD(IOD.load(iodFile));<NEW_LINE>List<String<MASK><NEW_LINE>if (fnames.isEmpty())<NEW_LINE>throw new ParseException(rb.getString("missing"));<NEW_LINE>for (String fname : fnames) validate(main, new File(fname));<NEW_LINE>} catch (ParseException e) {<NEW_LINE>System.err.println("DcmValidate: " + e.getMessage());<NEW_LINE>System.err.println(rb.getString("try"));<NEW_LINE>System.exit(2);<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.println("DcmValidate: " + e.getMessage());<NEW_LINE>System.exit(2);<NEW_LINE>}<NEW_LINE>} | > fnames = cl.getArgList(); |
1,293,742 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>tvExpressions = new BeanTreeView();<NEW_LINE>lblPropertyExpressions = new javax.swing.JLabel();<NEW_LINE>jScrollPane2 = new javax.swing.JScrollPane();<NEW_LINE>tpDesc = new javax.swing.JTextPane();<NEW_LINE>// NOI18N<NEW_LINE>lblPropertyExpressions.setText(org.openide.util.NbBundle.getMessage(AddPropertyDialog.class, "AddPropertyDialog.lblPropertyExpressions.text"));<NEW_LINE>tpDesc.setEditable(false);<NEW_LINE>jScrollPane2.setViewportView(tpDesc);<NEW_LINE>javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);<NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(tvExpressions, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE).addComponent(lblPropertyExpressions, javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 433, Short.MAX_VALUE)).addContainerGap()));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(lblPropertyExpressions).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(tvExpressions, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.<MASK><NEW_LINE>} | MAX_VALUE).addContainerGap())); |
467,570 | public Mono<Response<Void>> deleteWithResponseAsync(String scope, String roleManagementPolicyAssignmentName) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (scope == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (roleManagementPolicyAssignmentName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter roleManagementPolicyAssignmentName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2020-10-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), scope, roleManagementPolicyAssignmentName, apiVersion, accept, context)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext(<MASK><NEW_LINE>} | )).readOnly())); |
498,837 | public void performInstrospect(HttpServletRequest req, HttpServletResponse resp, StringBuffer sb) {<NEW_LINE>sb.append("\n\nPreparing Introspect Data:");<NEW_LINE>String clientId = req.getParameter("clientId");<NEW_LINE>String clientSecret = req.getParameter("clientSecret");<NEW_LINE>sb.append("\n***clientID:" + clientId + " clientSecret:" + clientSecret);<NEW_LINE>sb.append("\n***Calling API PropagationHelp:" + bCallApi);<NEW_LINE>String encodedOpUrl = req.getParameter("opUrl");<NEW_LINE>String opUrl = encodedOpUrl;<NEW_LINE>try {<NEW_LINE>opUrl = URLDecoder.decode(encodedOpUrl, "UTF8");<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>sb.append("\n***encodedOpUrl:" + encodedOpUrl + "\n opUrl:" + opUrl);<NEW_LINE>Hashtable<String, Object> hashTable = getProperties(runAsSubject, sb);<NEW_LINE>// debugHashtable( hashTable, sb);<NEW_LINE>String accessToken = bCallApi ? PropagationHelper.getAccessToken() : (String) hashTable.get("access_token");<NEW_LINE>String tokenType = bCallApi ? PropagationHelper.getAccessTokenType() : (String) hashTable.get("token_type");<NEW_LINE>long expiresAt = bCallApi ? PropagationHelper.getAccessTokenExpirationTime() : (Long) hashTable.get("expires_in");<NEW_LINE>sb.append("\n***access_token:" + accessToken + " token_type:" + tokenType + " expires_at/in:" + expiresAt + "***");<NEW_LINE>if (bCallApi) {<NEW_LINE><MASK><NEW_LINE>sb.append("\n***IdToken-JsonString:" + idToken.getAllClaimsAsJson());<NEW_LINE>}<NEW_LINE>manual_IntrospectRequester introspectRequester = new manual_IntrospectRequester(req, resp, clientId, clientSecret, opUrl, accessToken, tokenType);<NEW_LINE>try {<NEW_LINE>introspectRequester.submitIntrospect(sb);<NEW_LINE>} catch (WebTrustAssociationFailedException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>sb.append("\nGet Exception:" + e);<NEW_LINE>}<NEW_LINE>} | IdToken idToken = PropagationHelper.getIdToken(); |
1,056,144 | protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>Map<String, Object> map = new HashMap<>();<NEW_LINE>int id = ServletRequestUtils.getRequiredIntParameter(request, "id");<NEW_LINE>User user = securityService.getCurrentUser(request);<NEW_LINE>String username = user.getUsername();<NEW_LINE>UserSettings userSettings = settingsService.getUserSettings(username);<NEW_LINE>Player player = playerService.getPlayer(request, response);<NEW_LINE>Playlist playlist = playlistService.getPlaylist(id);<NEW_LINE>if (playlist == null) {<NEW_LINE>return new ModelAndView(new RedirectView("notFound"));<NEW_LINE>}<NEW_LINE>map.put("playlist", playlist);<NEW_LINE>map.put("user", user);<NEW_LINE>map.put("player", player);<NEW_LINE>map.put("editAllowed", username.equals(playlist.getUsername()) || securityService.isAdmin(username));<NEW_LINE>map.put("partyMode", userSettings.isPartyModeEnabled());<NEW_LINE>return new <MASK><NEW_LINE>} | ModelAndView("playlist", "model", map); |
1,852,559 | protected WireFeed parseChannel(final Element rssRoot, final Locale locale) {<NEW_LINE>final Channel channel = new Channel(getType());<NEW_LINE>channel.setStyleSheet(getStyleSheet(rssRoot.getDocument()));<NEW_LINE>final Element eChannel = rssRoot.getChild("channel", getRSSNamespace());<NEW_LINE>final Element title = eChannel.getChild("title", getRSSNamespace());<NEW_LINE>if (title != null) {<NEW_LINE>channel.<MASK><NEW_LINE>}<NEW_LINE>final Element link = eChannel.getChild("link", getRSSNamespace());<NEW_LINE>if (link != null) {<NEW_LINE>channel.setLink(link.getText());<NEW_LINE>}<NEW_LINE>final Element description = eChannel.getChild("description", getRSSNamespace());<NEW_LINE>if (description != null) {<NEW_LINE>channel.setDescription(description.getText());<NEW_LINE>}<NEW_LINE>channel.setImage(parseImage(rssRoot));<NEW_LINE>channel.setTextInput(parseTextInput(rssRoot));<NEW_LINE>// Unfortunately Microsoft's SSE extension has a special case of effectively putting the<NEW_LINE>// sharing channel module inside the RSS tag and not inside the channel itself. So we also<NEW_LINE>// need to look for channel modules from the root RSS element.<NEW_LINE>final List<Module> allFeedModules = new ArrayList<Module>();<NEW_LINE>final List<Module> rootModules = parseFeedModules(rssRoot, locale);<NEW_LINE>final List<Module> channelModules = parseFeedModules(eChannel, locale);<NEW_LINE>if (rootModules != null) {<NEW_LINE>allFeedModules.addAll(rootModules);<NEW_LINE>}<NEW_LINE>if (channelModules != null) {<NEW_LINE>allFeedModules.addAll(channelModules);<NEW_LINE>}<NEW_LINE>channel.setModules(allFeedModules);<NEW_LINE>channel.setItems(parseItems(rssRoot, locale));<NEW_LINE>final List<Element> foreignMarkup = extractForeignMarkup(eChannel, channel, getRSSNamespace());<NEW_LINE>if (!foreignMarkup.isEmpty()) {<NEW_LINE>channel.setForeignMarkup(foreignMarkup);<NEW_LINE>}<NEW_LINE>return channel;<NEW_LINE>} | setTitle(title.getText()); |
1,255,639 | protected List<float[]> convertColumn(float[] cLine) {<NEW_LINE>if (cLine.length < 4)<NEW_LINE>throw new RuntimeException(MessageLocalization.getComposedMessage("no.valid.column.line.found"));<NEW_LINE>List<float[]> cc = new ArrayList<>();<NEW_LINE>for (int k = 0; k < cLine.length - 2; k += 2) {<NEW_LINE>if (cLine.length == k + 3) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>float x1 = cLine[k];<NEW_LINE>float y1 = cLine[k + 1];<NEW_LINE>float x2 = cLine[k + 2];<NEW_LINE>float y2 = cLine[k + 3];<NEW_LINE>if (y1 == y2)<NEW_LINE>continue;<NEW_LINE>// x = ay + b<NEW_LINE>float a = (x1 - x2) / (y1 - y2);<NEW_LINE>float b = x1 - a * y1;<NEW_LINE>float[] r = new float[4];<NEW_LINE>r[0] = Math.min(y1, y2);<NEW_LINE>r[1] = Math.max(y1, y2);<NEW_LINE>r[2] = a;<NEW_LINE>r[3] = b;<NEW_LINE>cc.add(r);<NEW_LINE>maxY = Math.max(maxY, r[1]);<NEW_LINE>minY = Math.min<MASK><NEW_LINE>}<NEW_LINE>if (cc.isEmpty())<NEW_LINE>throw new RuntimeException(MessageLocalization.getComposedMessage("no.valid.column.line.found"));<NEW_LINE>return cc;<NEW_LINE>} | (minY, r[0]); |
1,062,257 | public Optional<AbstractDeclaring> typeAdaptersProvider() {<NEW_LINE>Optional<DeclaringType> typeDefining = declaringType().isPresent() ? Optional.of(declaringType().get().associatedTopLevel()) : Optional.<DeclaringType>absent();<NEW_LINE>Optional<TypeAdaptersMirror> typeDefined = typeDefining.isPresent() ? typeDefining.get().typeAdapters() : Optional.<TypeAdaptersMirror>absent();<NEW_LINE>Optional<TypeAdaptersMirror> packageDefined = packageOf().typeAdapters();<NEW_LINE>if (packageDefined.isPresent()) {<NEW_LINE>if (typeDefined.isPresent()) {<NEW_LINE>report().withElement(typeDefining.get().element()).annotationNamed(TypeAdaptersMirror.simpleName()).warning(About.INCOMPAT, "@%s is also used on the package, this type level annotation is ignored", TypeAdaptersMirror.simpleName());<NEW_LINE>}<NEW_LINE>return Optional.<<MASK><NEW_LINE>}<NEW_LINE>return typeDefined.isPresent() ? Optional.<AbstractDeclaring>of(typeDefining.get()) : Optional.<AbstractDeclaring>absent();<NEW_LINE>} | AbstractDeclaring>of(packageOf()); |
313,028 | public CreateGroupResult createGroup(CreateGroupRequest createGroupRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createGroupRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateGroupRequest> request = null;<NEW_LINE>Response<CreateGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateGroupRequestMarshaller().marshall(createGroupRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<CreateGroupResult, JsonUnmarshallerContext> unmarshaller = new CreateGroupResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<CreateGroupResult> responseHandler = new JsonResponseHandler<CreateGroupResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
465,378 | protected void processFingerprintVerification(XmppUri uri) {<NEW_LINE>if (mConversation != null && mAccount != null && uri.hasFingerprints() && mAccount.getAxolotlService().getCryptoTargets(mConversation).contains(uri.getJid())) {<NEW_LINE>boolean performedVerification = xmppConnectionService.verifyFingerprints(mAccount.getRoster().getContact(uri.getJid()), uri.getFingerprints());<NEW_LINE>boolean keys = reloadFingerprints();<NEW_LINE>if (performedVerification && !keys && !hasNoOtherTrustedKeys() && !hasPendingKeyFetches()) {<NEW_LINE>Toast.makeText(this, R.string.all_omemo_keys_have_been_verified, Toast.LENGTH_SHORT).show();<NEW_LINE>finishOk(false);<NEW_LINE>return;<NEW_LINE>} else if (performedVerification) {<NEW_LINE>Toast.makeText(this, R.string.verified_fingerprints, Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>reloadFingerprints();<NEW_LINE>Log.d(Config.LOGTAG, "xmpp uri was: " + uri.getJid() + " has Fingerprints: " + uri.hasFingerprints());<NEW_LINE>Toast.makeText(this, R.string.barcode_does_not_contain_fingerprints_for_this_conversation, <MASK><NEW_LINE>}<NEW_LINE>populateView();<NEW_LINE>} | Toast.LENGTH_SHORT).show(); |
890,981 | public void actionPerformed(ActionEvent e) {<NEW_LINE>TelaPrincipal t = PortugolStudio<MASK><NEW_LINE>AbaCodigoFonte abaCodigoFonte = AbaCodigoFonte.novaAba();<NEW_LINE>abaCodigoFonte.setCodigoFonte(codigoFonte, recente, true);<NEW_LINE>t.getPainelTabulado().adicionaAba(abaCodigoFonte);<NEW_LINE>// List<File> arquivo = new ArrayList<>();<NEW_LINE>// arquivo.add(recente);<NEW_LINE>// t.abrirArquivosCodigoFonte(arquivo);<NEW_LINE>PortugolStudio.getInstancia().salvarComoRecente(recente);<NEW_LINE>} | .getInstancia().getTelaPrincipal(); |
1,371,969 | private RequestController fetchThumbnail(@NonNull String imageUrl, @NonNull Consumer<Optional<Attachment>> callback) {<NEW_LINE>Call call = client.newCall(new Request.Builder().url(imageUrl).build());<NEW_LINE>CallRequestController controller = new CallRequestController(call);<NEW_LINE>SignalExecutors.UNBOUNDED.execute(() -> {<NEW_LINE>try {<NEW_LINE>Response response = call.execute();<NEW_LINE>if (!response.isSuccessful() || response.body() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InputStream bodyStream = response.body().byteStream();<NEW_LINE>controller.setStream(bodyStream);<NEW_LINE>byte[] data = OkHttpUtil.readAsBytes(bodyStream, FAILSAFE_MAX_IMAGE_SIZE);<NEW_LINE>Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);<NEW_LINE>Optional<Attachment> thumbnail = bitmapToAttachment(bitmap, Bitmap.CompressFormat.JPEG, MediaUtil.IMAGE_JPEG);<NEW_LINE>if (bitmap != null)<NEW_LINE>bitmap.recycle();<NEW_LINE>callback.accept(thumbnail);<NEW_LINE>} catch (IOException | IllegalArgumentException e) {<NEW_LINE>Log.w(TAG, "Exception during link preview image retrieval.", e);<NEW_LINE>controller.cancel();<NEW_LINE>callback.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>return controller;<NEW_LINE>} | accept(Optional.empty()); |
1,263,636 | public Response createTokenResponse(UserModel user, UserSessionModel userSession, ClientSessionContext clientSessionCtx, String scopeParam, boolean code) {<NEW_LINE>AccessToken token = tokenManager.createClientAccessToken(session, realm, <MASK><NEW_LINE>TokenManager.AccessTokenResponseBuilder responseBuilder = tokenManager.responseBuilder(realm, client, event, session, userSession, clientSessionCtx).accessToken(token);<NEW_LINE>if (OIDCAdvancedConfigWrapper.fromClientModel(client).isUseRefreshToken()) {<NEW_LINE>responseBuilder.generateRefreshToken();<NEW_LINE>}<NEW_LINE>checkMtlsHoKToken(responseBuilder, OIDCAdvancedConfigWrapper.fromClientModel(client).isUseRefreshToken());<NEW_LINE>if (TokenUtil.isOIDCRequest(scopeParam)) {<NEW_LINE>responseBuilder.generateIDToken().generateAccessTokenHash();<NEW_LINE>}<NEW_LINE>AccessTokenResponse res = null;<NEW_LINE>if (code) {<NEW_LINE>try {<NEW_LINE>res = responseBuilder.build();<NEW_LINE>} catch (RuntimeException re) {<NEW_LINE>if ("can not get encryption KEK".equals(re.getMessage())) {<NEW_LINE>throw new CorsErrorResponseException(cors, OAuthErrorException.INVALID_REQUEST, "can not get encryption KEK", Response.Status.BAD_REQUEST);<NEW_LINE>} else {<NEW_LINE>throw re;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>res = responseBuilder.build();<NEW_LINE>}<NEW_LINE>event.success();<NEW_LINE>return cors.builder(Response.ok(res).type(MediaType.APPLICATION_JSON_TYPE)).build();<NEW_LINE>} | client, user, userSession, clientSessionCtx); |
496,600 | public static double d(int[] x1, int[] x2, int radius) {<NEW_LINE>int n1 = x1.length;<NEW_LINE>int n2 = x2.length;<NEW_LINE>double[][] table = new double[2][n2 + 1];<NEW_LINE>table[0][0] = 0;<NEW_LINE>for (int i = 1; i <= n2; i++) {<NEW_LINE>table[0][i] = Double.POSITIVE_INFINITY;<NEW_LINE>}<NEW_LINE>for (int i = 1; i <= n1; i++) {<NEW_LINE>int start = Math.max(1, i - radius);<NEW_LINE>int end = Math.min(n2, i + radius);<NEW_LINE>table[1][start - 1] = Double.POSITIVE_INFINITY;<NEW_LINE>if (end < n2)<NEW_LINE>table[1][end + 1] = Double.POSITIVE_INFINITY;<NEW_LINE>for (int j = start; j <= end; j++) {<NEW_LINE>double cost = Math.abs(x1[i - 1] - x2[j - 1]);<NEW_LINE>double min = table[0][j - 1];<NEW_LINE>if (min > table[0][j]) {<NEW_LINE>min = table[0][j];<NEW_LINE>}<NEW_LINE>if (min > table[1][j - 1]) {<NEW_LINE>min = table[1][j - 1];<NEW_LINE>}<NEW_LINE>table[1][j] = cost + min;<NEW_LINE>}<NEW_LINE>double[] swap = table[0];<NEW_LINE>table<MASK><NEW_LINE>table[1] = swap;<NEW_LINE>}<NEW_LINE>return table[0][n2];<NEW_LINE>} | [0] = table[1]; |
1,389,273 | public static void importChunks(WorldDirectories source, Progress progressChannel, boolean headless, boolean overwrite, SelectionData sourceSelection, SelectionData targetSelection, List<Range> ranges, Point3i offset, DataProperty<Map<Point2i, RegionDirectories>> tempFiles) {<NEW_LINE>try {<NEW_LINE>WorldDirectories wd = Config.getWorldDirs();<NEW_LINE>RegionDirectories[] rd = wd.listRegions(targetSelection);<NEW_LINE>if (rd == null || rd.length == 0) {<NEW_LINE>if (headless) {<NEW_LINE>progressChannel.done("no files");<NEW_LINE>} else {<NEW_LINE>progressChannel.done(Translation.DIALOG_PROGRESS_NO_FILES.toString());<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JobHandler.clearQueues();<NEW_LINE>if (headless) {<NEW_LINE>progressChannel.setMessage("collecting data...");<NEW_LINE>} else {<NEW_LINE>progressChannel.setMessage(Translation.DIALOG_PROGRESS_COLLECTING_DATA.toString());<NEW_LINE>}<NEW_LINE>// if source world and target world is the same, we need to create temp files of all source files<NEW_LINE>Map<Point2i, RegionDirectories> tempFilesMap = null;<NEW_LINE>if (source.sharesDirectories(Config.getWorldDirs())) {<NEW_LINE>tempFilesMap = new HashMap<>();<NEW_LINE>}<NEW_LINE>tempFiles.set(tempFilesMap);<NEW_LINE>// only pass regions here<NEW_LINE>Long2ObjectOpenHashMap<LongOpenHashSet> targetMapping = createTargetSourceMapping(source.getRegion(), sourceSelection, targetSelection, offset.toPoint2i());<NEW_LINE>progressChannel.setMax(targetMapping.size());<NEW_LINE>progressChannel.updateProgress(rd[0].getLocationAsFileName(), 0);<NEW_LINE>// create local source and local target selections<NEW_LINE>for (Long2ObjectMap.Entry<LongOpenHashSet> entry : targetMapping.long2ObjectEntrySet()) {<NEW_LINE>long targetRegion = entry.getLongKey();<NEW_LINE>LongOpenHashSet sourceRegions = entry.getValue();<NEW_LINE>Long2ObjectOpenHashMap<LongOpenHashSet> localSourceSelection = new Long2ObjectOpenHashMap<>();<NEW_LINE>LongOpenHashSet localTargetSelection;<NEW_LINE>// creating local source selection<NEW_LINE>if (sourceSelection == null) {<NEW_LINE>localSourceSelection = new Long2ObjectOpenHashMap<>(0);<NEW_LINE>} else {<NEW_LINE>for (long sourceRegion : sourceRegions) {<NEW_LINE>LongOpenHashSet localSourceChunks;<NEW_LINE>localSourceChunks = sourceSelection.selection().getOrDefault(sourceRegion, new LongOpenHashSet(0));<NEW_LINE>localSourceSelection.put(sourceRegion, localSourceChunks);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// creating local target selection<NEW_LINE>if (targetSelection == null) {<NEW_LINE>localTargetSelection = new LongOpenHashSet(0);<NEW_LINE>} else {<NEW_LINE>localTargetSelection = targetSelection.selection().getOrDefault(targetRegion, new LongOpenHashSet(0));<NEW_LINE>}<NEW_LINE>boolean sourceInverted = sourceSelection <MASK><NEW_LINE>boolean targetInverted = targetSelection != null && targetSelection.inverted();<NEW_LINE>Point2i target = new Point2i(targetRegion);<NEW_LINE>RegionDirectories targetDirs = FileHelper.createRegionDirectories(target);<NEW_LINE>JobHandler.addJob(new MCAChunkImporterProcessJob(targetDirs, source, target, sourceRegions, offset, progressChannel, overwrite, localSourceSelection, sourceInverted, localTargetSelection, targetInverted, ranges, tempFilesMap));<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Debug.dumpException("failed creating jobs to import chunks", ex);<NEW_LINE>}<NEW_LINE>} | != null && sourceSelection.inverted(); |
99,142 | public Request<DescribeSpotFleetRequestsRequest> marshall(DescribeSpotFleetRequestsRequest describeSpotFleetRequestsRequest) {<NEW_LINE>if (describeSpotFleetRequestsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DescribeSpotFleetRequestsRequest> request = new DefaultRequest<DescribeSpotFleetRequestsRequest>(describeSpotFleetRequestsRequest, "AmazonEC2");<NEW_LINE><MASK><NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (describeSpotFleetRequestsRequest.getMaxResults() != null) {<NEW_LINE>request.addParameter("MaxResults", StringUtils.fromInteger(describeSpotFleetRequestsRequest.getMaxResults()));<NEW_LINE>}<NEW_LINE>if (describeSpotFleetRequestsRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("NextToken", StringUtils.fromString(describeSpotFleetRequestsRequest.getNextToken()));<NEW_LINE>}<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> describeSpotFleetRequestsRequestSpotFleetRequestIdsList = (com.amazonaws.internal.SdkInternalList<String>) describeSpotFleetRequestsRequest.getSpotFleetRequestIds();<NEW_LINE>if (!describeSpotFleetRequestsRequestSpotFleetRequestIdsList.isEmpty() || !describeSpotFleetRequestsRequestSpotFleetRequestIdsList.isAutoConstruct()) {<NEW_LINE>int spotFleetRequestIdsListIndex = 1;<NEW_LINE>for (String describeSpotFleetRequestsRequestSpotFleetRequestIdsListValue : describeSpotFleetRequestsRequestSpotFleetRequestIdsList) {<NEW_LINE>if (describeSpotFleetRequestsRequestSpotFleetRequestIdsListValue != null) {<NEW_LINE>request.addParameter("SpotFleetRequestId." + spotFleetRequestIdsListIndex, StringUtils.fromString(describeSpotFleetRequestsRequestSpotFleetRequestIdsListValue));<NEW_LINE>}<NEW_LINE>spotFleetRequestIdsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.addParameter("Action", "DescribeSpotFleetRequests"); |
175,136 | public Request<AssociateSecurityKeyRequest> marshall(AssociateSecurityKeyRequest associateSecurityKeyRequest) {<NEW_LINE>if (associateSecurityKeyRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(AssociateSecurityKeyRequest)");<NEW_LINE>}<NEW_LINE>Request<AssociateSecurityKeyRequest> request = new DefaultRequest<AssociateSecurityKeyRequest>(associateSecurityKeyRequest, "AmazonConnect");<NEW_LINE>request.setHttpMethod(HttpMethodName.PUT);<NEW_LINE>String uriResourcePath = "/instance/{InstanceId}/security-key";<NEW_LINE>uriResourcePath = uriResourcePath.replace("{InstanceId}", (associateSecurityKeyRequest.getInstanceId() == null) ? "" : StringUtils.fromString(associateSecurityKeyRequest.getInstanceId()));<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter <MASK><NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (associateSecurityKeyRequest.getKey() != null) {<NEW_LINE>String key = associateSecurityKeyRequest.getKey();<NEW_LINE>jsonWriter.name("Key");<NEW_LINE>jsonWriter.value(key);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | jsonWriter = JsonUtils.getJsonWriter(stringWriter); |
395,487 | final DescribeConfigurationResult executeDescribeConfiguration(DescribeConfigurationRequest describeConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeConfigurationRequest> request = null;<NEW_LINE>Response<DescribeConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeConfigurationRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "mq");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(describeConfigurationRequest)); |
435,525 | public void receiveResponse(HttpClientResponse clientResponse) {<NEW_LINE>int sc = clientResponse.statusCode();<NEW_LINE>int maxRedirects = request.followRedirects ? client.getOptions().getMaxRedirects() : 0;<NEW_LINE>this.clientResponse = clientResponse;<NEW_LINE>if (redirects < maxRedirects && sc >= 300 && sc < 400) {<NEW_LINE>redirects++;<NEW_LINE>Future<RequestOptions> next = client.redirectHandler().apply(clientResponse);<NEW_LINE>if (next != null) {<NEW_LINE>if (redirectedLocations.isEmpty()) {<NEW_LINE>redirectedLocations = new ArrayList<>();<NEW_LINE>}<NEW_LINE>redirectedLocations.add(clientResponse<MASK><NEW_LINE>next.onComplete(ar -> {<NEW_LINE>if (ar.succeeded()) {<NEW_LINE>RequestOptions options = ar.result();<NEW_LINE>requestOptions = options;<NEW_LINE>fire(ClientPhase.FOLLOW_REDIRECT);<NEW_LINE>} else {<NEW_LINE>fail(ar.cause());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.clientResponse = clientResponse;<NEW_LINE>fire(ClientPhase.RECEIVE_RESPONSE);<NEW_LINE>} | .getHeader(HttpHeaders.LOCATION)); |
1,158,069 | public ItemStack doBukkitEvent_PlayerItemConsumeEvent(ItemStack s, World w, LivingEntity e) {<NEW_LINE>PICE_canceled = false;<NEW_LINE>if (get() instanceof ServerPlayerEntity) {<NEW_LINE>org.bukkit.inventory.ItemStack craftItem = CraftItemStack.asBukkitCopy(get().activeItemStack);<NEW_LINE>PlayerItemConsumeEvent event = new PlayerItemConsumeEvent((Player) ((IMixinServerEntityPlayer) ((ServerPlayerEntity) get())).getBukkitEntity(), craftItem);<NEW_LINE>Bukkit.getServer().<MASK><NEW_LINE>if (event.isCancelled()) {<NEW_LINE>((Player) ((IMixinServerEntityPlayer) ((ServerPlayerEntity) get())).getBukkitEntity()).updateInventory();<NEW_LINE>((PlayerImpl) ((IMixinServerEntityPlayer) ((ServerPlayerEntity) get())).getBukkitEntity()).updateScaledHealth();<NEW_LINE>PICE_canceled = true;<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return (craftItem.equals(event.getItem())) ? get().activeItemStack.finishUsing(get().world, get()) : CraftItemStack.asNMSCopy(event.getItem()).finishUsing(get().world, get());<NEW_LINE>} else<NEW_LINE>return get().activeItemStack.finishUsing(get().world, get());<NEW_LINE>} | getPluginManager().callEvent(event); |
1,729,304 | public void replaceSelect() {<NEW_LINE>ReplaceRuleBean oldRuleBean = new ReplaceRuleBean();<NEW_LINE>oldRuleBean.setReplaceSummary(binding.pageView.getSelectStr().trim());<NEW_LINE>oldRuleBean.setEnable(true);<NEW_LINE>oldRuleBean.setRegex(binding.pageView.getSelectStr().trim());<NEW_LINE>oldRuleBean.setIsRegex(false);<NEW_LINE>oldRuleBean.setReplacement("");<NEW_LINE>oldRuleBean.setSerialNumber(0);<NEW_LINE>oldRuleBean.setUseTo(String.format("%s,%s", mPresenter.getBookShelf().getBookInfoBean().getName(), mPresenter.getBookShelf<MASK><NEW_LINE>ReplaceRuleDialog.builder(ReadBookActivity.this, oldRuleBean, mPresenter.getBookShelf(), ReplaceRuleDialog.DefaultUI).setPositiveButton(replaceRuleBean1 -> ReplaceRuleManager.saveData(replaceRuleBean1).subscribe(new MySingleObserver<Boolean>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(@NonNull Boolean aBoolean) {<NEW_LINE>binding.cursorLeft.setVisibility(View.INVISIBLE);<NEW_LINE>binding.cursorRight.setVisibility(View.INVISIBLE);<NEW_LINE>binding.readLongPress.setVisibility(View.INVISIBLE);<NEW_LINE>binding.pageView.setSelectMode(PageView.SelectMode.Normal);<NEW_LINE>moDialogHUD.dismiss();<NEW_LINE>refresh(false);<NEW_LINE>}<NEW_LINE>})).show();<NEW_LINE>} | ().getTag())); |
450,322 | public ParseException generateParseException() {<NEW_LINE>jj_expentries.clear();<NEW_LINE>boolean[] la1tokens = new boolean[157];<NEW_LINE>if (jj_kind >= 0) {<NEW_LINE>la1tokens[jj_kind] = true;<NEW_LINE>jj_kind = -1;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < 177; i++) {<NEW_LINE>if (jj_la1[i] == jj_gen) {<NEW_LINE>for (int j = 0; j < 32; j++) {<NEW_LINE>if ((jj_la1_0[i] & (1 << j)) != 0) {<NEW_LINE>la1tokens[j] = true;<NEW_LINE>}<NEW_LINE>if ((jj_la1_1[i] & (1 << j)) != 0) {<NEW_LINE>la1tokens[32 + j] = true;<NEW_LINE>}<NEW_LINE>if ((jj_la1_2[i] & (1 << j)) != 0) {<NEW_LINE>la1tokens[64 + j] = true;<NEW_LINE>}<NEW_LINE>if ((jj_la1_3[i] & (1 << j)) != 0) {<NEW_LINE>la1tokens[96 + j] = true;<NEW_LINE>}<NEW_LINE>if ((jj_la1_4[i] & (1 << j)) != 0) {<NEW_LINE>la1tokens[128 + j] = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < 157; i++) {<NEW_LINE>if (la1tokens[i]) {<NEW_LINE>jj_expentry = new int[1];<NEW_LINE>jj_expentry[0] = i;<NEW_LINE>jj_expentries.add(jj_expentry);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jj_endpos = 0;<NEW_LINE>jj_rescan_token();<NEW_LINE>jj_add_error_token(0, 0);<NEW_LINE>int[][] exptokseq = new int[jj_expentries.size()][];<NEW_LINE>for (int i = 0; i < jj_expentries.size(); i++) {<NEW_LINE>exptokseq[i] = jj_expentries.get(i);<NEW_LINE>}<NEW_LINE>return new ParseException(token, exptokseq, tokenImage, token_source == null ? null : ASTParserTokenManager<MASK><NEW_LINE>} | .lexStateNames[token_source.curLexState]); |
609,000 | final GetJobRunResult executeGetJobRun(GetJobRunRequest getJobRunRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getJobRunRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetJobRunRequest> request = null;<NEW_LINE>Response<GetJobRunResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetJobRunRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getJobRunRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Glue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetJobRun");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetJobRunResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetJobRunResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,151,996 | public static void generateCustomPolicy(LibertyServer server, String... permissionsToAdd) throws Exception {<NEW_LINE>if (!server.isJava2SecurityEnabled() || permissionsToAdd == null || permissionsToAdd.length == 0)<NEW_LINE>return;<NEW_LINE>String policyPath;<NEW_LINE>if (JavaInfo.JAVA_VERSION >= 9) {<NEW_LINE>policyPath = JavaInfo.forServer(server).javaHome() + "/conf/security/java.policy";<NEW_LINE>} else {<NEW_LINE>policyPath = JavaInfo.forServer(server).javaHome() + "/lib/security/java.policy";<NEW_LINE>}<NEW_LINE>String policyContents = FileUtils.readFile(policyPath);<NEW_LINE>// Add in our custom policy for JAX-B permissions:<NEW_LINE>StringBuilder sb = new StringBuilder(" // Permissions added by FAT bucket\n");<NEW_LINE>for (String permToAdd : permissionsToAdd) sb.append(" ").append(permToAdd).append('\n');<NEW_LINE>if (!policyContents.contains("grant {"))<NEW_LINE><MASK><NEW_LINE>policyContents = policyContents.replace("grant {", "grant {\n" + sb.toString() + '\n');<NEW_LINE>File outputFile = new File(server.getServerRoot() + "/custom_j2sec.policy");<NEW_LINE>Log.info(PrivHelper.class, "generateCustomPolicy", "Generating custom policy file at: " + outputFile + "\n" + policyContents);<NEW_LINE>try (BufferedWriter writer = new BufferedWriter(new FileWriter(outputFile))) {<NEW_LINE>writer.write(policyContents);<NEW_LINE>}<NEW_LINE>RemoteFile f = server.getServerBootstrapPropertiesFile();<NEW_LINE>try (OutputStream w = f.openForWriting(true)) {<NEW_LINE>String policySetting = "\njava.security.policy=" + outputFile.toURI().toURL();<NEW_LINE>w.write(policySetting.getBytes());<NEW_LINE>w.flush();<NEW_LINE>}<NEW_LINE>} | throw new Exception("Policy file did not contain special token 'grant {'. The contents were: " + policyContents); |
893,895 | private JsonResponseUpsertItemBuilder syncJsonContact(@NonNull final OrgId orgId, @NonNull final JsonRequestContactUpsertItem jsonContact, @NonNull final SyncAdvise parentSyncAdvise, @NonNull final ShortTermContactIndex shortTermIndex) {<NEW_LINE>final ExternalIdentifier contactIdentifier = ExternalIdentifier.of(jsonContact.getContactIdentifier());<NEW_LINE>BPartnerContact existingContact = null;<NEW_LINE>if (ExternalIdentifier.Type.EXTERNAL_REFERENCE.equals(contactIdentifier.getType())) {<NEW_LINE>final Optional<MetasfreshId> metasfreshId = jsonRetrieverService.resolveExternalReference(orgId, contactIdentifier, ExternalUserReferenceType.USER_ID);<NEW_LINE>if (metasfreshId.isPresent()) {<NEW_LINE>existingContact = shortTermIndex.extract(metasfreshId.get());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>existingContact = shortTermIndex.extract(contactIdentifier);<NEW_LINE>}<NEW_LINE>final JsonResponseUpsertItemBuilder result = JsonResponseUpsertItem.builder().identifier(jsonContact.getContactIdentifier());<NEW_LINE>final SyncOutcome syncOutcome;<NEW_LINE>final BPartnerContact contact;<NEW_LINE>if (existingContact != null) {<NEW_LINE>contact = existingContact;<NEW_LINE>syncOutcome = parentSyncAdvise.getIfExists().isUpdate() <MASK><NEW_LINE>} else {<NEW_LINE>if (parentSyncAdvise.isFailIfNotExists()) {<NEW_LINE>throw MissingResourceException.builder().resourceName("contact").resourceIdentifier(jsonContact.getContactIdentifier()).parentResource(jsonContact).build().setParameter("parentSyncAdvise", parentSyncAdvise);<NEW_LINE>} else if (METASFRESH_ID.equals(contactIdentifier.getType())) {<NEW_LINE>throw MissingResourceException.builder().resourceName("contact").resourceIdentifier(jsonContact.getContactIdentifier()).parentResource(jsonContact).detail(TranslatableStrings.constant("With this type, only updates are allowed.")).build().setParameter("parentSyncAdvise", parentSyncAdvise);<NEW_LINE>}<NEW_LINE>contact = shortTermIndex.newContact(contactIdentifier);<NEW_LINE>syncOutcome = SyncOutcome.CREATED;<NEW_LINE>}<NEW_LINE>// always add the handle; we'll need it later, even if the contact existed and was not updated<NEW_LINE>contact.addHandle(contactIdentifier.getRawValue());<NEW_LINE>result.syncOutcome(syncOutcome);<NEW_LINE>if (!Objects.equals(SyncOutcome.NOTHING_DONE, syncOutcome)) {<NEW_LINE>syncJsonToContact(jsonContact.getContact(), contact);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | ? SyncOutcome.UPDATED : SyncOutcome.NOTHING_DONE; |
1,728,138 | protected void onSaveInstanceState(Bundle outState) {<NEW_LINE>super.onSaveInstanceState(outState);<NEW_LINE>outState.putInt(getString(R.string.frag_prev_mid), initalMiddleFragment);<NEW_LINE>outState.putInt(getString(R.string.frag_prev_bottom), initalBottomFragment);<NEW_LINE>outState.putInt(getString(R.string.frag_prev), mode);<NEW_LINE>outState.putBoolean("Dialogshown", exitDialog);<NEW_LINE>outState.putBoolean("exitWithoutChanges", exitWithoutChanges);<NEW_LINE>outState.putBoolean("modeChanges", modeChangesExit);<NEW_LINE><MASK><NEW_LINE>outState.putInt("checkString", messageCheck);<NEW_LINE>outState.putParcelable("Edited Bitmap", mainBitmap);<NEW_LINE>outState.putInt("numberOfEdits", mOpTimes);<NEW_LINE>if (addTextFragment.isAdded()) {<NEW_LINE>getSupportFragmentManager().putFragment(outState, "addTextFragment", addTextFragment);<NEW_LINE>}<NEW_LINE>} | outState.putInt("checkMode", modeCheck); |
591,070 | default <T1, T2, T3> Tuple3<Iterator<T1>, Iterator<T2>, Iterator<T3>> unzip3(Function<? super T, ? extends T1> unzipper1, Function<? super T, ? extends T2> unzipper2, Function<? super T, ? extends T3> unzipper3) {<NEW_LINE>Objects.requireNonNull(unzipper1, "unzipper1 is null");<NEW_LINE>Objects.requireNonNull(unzipper2, "unzipper2 is null");<NEW_LINE>Objects.requireNonNull(unzipper3, "unzipper3 is null");<NEW_LINE>if (!hasNext()) {<NEW_LINE>return Tuple.of(empty(), empty(), empty());<NEW_LINE>} else {<NEW_LINE>final Stream<T> stream = Stream.ofAll(() -> this);<NEW_LINE>final Iterator<T1> iter1 = stream.iterator().map(unzipper1);<NEW_LINE>final Iterator<T2> iter2 = stream.<MASK><NEW_LINE>final Iterator<T3> iter3 = stream.iterator().map(unzipper3);<NEW_LINE>return Tuple.of(iter1, iter2, iter3);<NEW_LINE>}<NEW_LINE>} | iterator().map(unzipper2); |
451,794 | public RealInfo generateRealInfo() {<NEW_LINE>double min = Double.POSITIVE_INFINITY;<NEW_LINE>double max = Double.NEGATIVE_INFINITY;<NEW_LINE>double sum = 0.0;<NEW_LINE>double sumSquares = 0.0;<NEW_LINE>double mean;<NEW_LINE>if (valueCounts != null) {<NEW_LINE>List<Map.Entry<Double, MutableLong>> entries = valueCounts.entrySet().stream().sorted(Comparator.comparingDouble(Map.Entry::getKey)).collect(Collectors.toList());<NEW_LINE>for (Map.Entry<Double, MutableLong> e : entries) {<NEW_LINE>double value = e.getKey();<NEW_LINE>double valCount = e.getValue().longValue();<NEW_LINE>if (value > max) {<NEW_LINE>max = value;<NEW_LINE>}<NEW_LINE>if (value < min) {<NEW_LINE>min = value;<NEW_LINE>}<NEW_LINE>sum += value * valCount;<NEW_LINE>}<NEW_LINE>mean = sum / count;<NEW_LINE>for (Map.Entry<Double, MutableLong> e : entries) {<NEW_LINE><MASK><NEW_LINE>double valCount = e.getValue().longValue();<NEW_LINE>sumSquares += (value - mean) * (value - mean) * valCount;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>min = observedValue;<NEW_LINE>max = observedValue;<NEW_LINE>mean = observedValue;<NEW_LINE>sumSquares = 0.0;<NEW_LINE>}<NEW_LINE>return new RealInfo(name, count, max, min, mean, sumSquares);<NEW_LINE>} | double value = e.getKey(); |
1,479,296 | private void uploadAutoModeContextSettings(File remoteFolder) throws SharedConfigurationException {<NEW_LINE>logger.log(Level.INFO, "Uploading shared configuration to {0}", remoteFolder.getAbsolutePath());<NEW_LINE>publishTask("Uploading AutoModeContext configuration files");<NEW_LINE>// Make a subfolder<NEW_LINE>File remoteAutoConfFolder <MASK><NEW_LINE>try {<NEW_LINE>if (remoteAutoConfFolder.exists()) {<NEW_LINE>FileUtils.deleteDirectory(remoteAutoConfFolder);<NEW_LINE>}<NEW_LINE>Files.createDirectories(remoteAutoConfFolder.toPath());<NEW_LINE>} catch (IOException | SecurityException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.SEVERE, "Failed to create clean shared configuration subfolder " + remoteAutoConfFolder.getAbsolutePath(), ex);<NEW_LINE>throw new SharedConfigurationException("Failed to create clean shared configuration subfolder " + remoteAutoConfFolder.getAbsolutePath());<NEW_LINE>}<NEW_LINE>IngestJobSettings ingestJobSettings = new IngestJobSettings(AutoIngestUserPreferences.getAutoModeIngestModuleContextString());<NEW_LINE>File localFolder = ingestJobSettings.getSavedModuleSettingsFolder().toFile();<NEW_LINE>if (!localFolder.exists()) {<NEW_LINE>logger.log(Level.SEVERE, "Local configuration folder {0} does not exist", localFolder.getAbsolutePath());<NEW_LINE>throw new SharedConfigurationException("Local configuration folder " + localFolder.getAbsolutePath() + " does not exist");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>FileUtils.copyDirectory(localFolder, remoteAutoConfFolder);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new SharedConfigurationException(String.format("Failed to copy %s to %s", localFolder.getAbsolutePath(), remoteAutoConfFolder.getAbsolutePath()), ex);<NEW_LINE>}<NEW_LINE>} | = new File(remoteFolder, AUTO_MODE_FOLDER); |
1,207,191 | public static void carry(int[] z) {<NEW_LINE>int z0 = z[0], z1 = z[1], z2 = z[2], z3 = z[3], z4 = z[4];<NEW_LINE>int z5 = z[5], z6 = z[6], z7 = z[7], z8 = z[8], z9 = z[9];<NEW_LINE>z2 += (z1 >> 26);<NEW_LINE>z1 &= M26;<NEW_LINE>z4 += (z3 >> 26);<NEW_LINE>z3 &= M26;<NEW_LINE>z7 += (z6 >> 26);<NEW_LINE>z6 &= M26;<NEW_LINE>z9 += (z8 >> 26);<NEW_LINE>z8 &= M26;<NEW_LINE>z3 += (z2 >> 25);<NEW_LINE>z2 &= M25;<NEW_LINE>z5 += (z4 >> 25);<NEW_LINE>z4 &= M25;<NEW_LINE>z8 += (z7 >> 25);<NEW_LINE>z7 &= M25;<NEW_LINE>// z0 += (z9 >> 24) * 19; z9 &= M24;<NEW_LINE>z0 += (z9 >> 25) * 38;<NEW_LINE>z9 &= M25;<NEW_LINE>z1 += (z0 >> 26);<NEW_LINE>z0 &= M26;<NEW_LINE>z6 += (z5 >> 26);<NEW_LINE>z5 &= M26;<NEW_LINE>z2 += (z1 >> 26);<NEW_LINE>z1 &= M26;<NEW_LINE><MASK><NEW_LINE>z3 &= M26;<NEW_LINE>z7 += (z6 >> 26);<NEW_LINE>z6 &= M26;<NEW_LINE>z9 += (z8 >> 26);<NEW_LINE>z8 &= M26;<NEW_LINE>z[0] = z0;<NEW_LINE>z[1] = z1;<NEW_LINE>z[2] = z2;<NEW_LINE>z[3] = z3;<NEW_LINE>z[4] = z4;<NEW_LINE>z[5] = z5;<NEW_LINE>z[6] = z6;<NEW_LINE>z[7] = z7;<NEW_LINE>z[8] = z8;<NEW_LINE>z[9] = z9;<NEW_LINE>} | z4 += (z3 >> 26); |
762,249 | private String queryCmdbName(List<String> ips) {<NEW_LINE>Map<String, Integer> nameCountMap = new HashMap<String, Integer>();<NEW_LINE>for (String ip : ips) {<NEW_LINE>String cmdbDomain = queryDomainFromCMDB(ip);<NEW_LINE>if (checkIfValid(cmdbDomain)) {<NEW_LINE>Integer count = nameCountMap.get(cmdbDomain);<NEW_LINE>if (count == null) {<NEW_LINE>nameCountMap.put(cmdbDomain, 1);<NEW_LINE>} else {<NEW_LINE>nameCountMap.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String probableDomain = null;<NEW_LINE>int maxCount = 0;<NEW_LINE>for (Entry<String, Integer> entry : nameCountMap.entrySet()) {<NEW_LINE>int currentCount = entry.getValue();<NEW_LINE>if (currentCount > maxCount) {<NEW_LINE>maxCount = currentCount;<NEW_LINE>probableDomain = entry.getKey();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return probableDomain;<NEW_LINE>} | put(cmdbDomain, count + 1); |
767,472 | private List<GlobalConfig> prepareTimeoutGlobalConfig() {<NEW_LINE>Set<Class<? extends ConfigurableTimeoutMessage>> allConfigurableMessageClasses = BeanUtils.reflections.getSubTypesOf(ConfigurableTimeoutMessage.class).stream().filter(clz -> !APISyncCallMessage.class.isAssignableFrom(clz)).collect(Collectors.toSet());<NEW_LINE>List<GlobalConfig> results = new ArrayList<>();<NEW_LINE>allConfigurableMessageClasses.forEach(clz -> {<NEW_LINE>GlobalConfigVO vo = new GlobalConfigVO();<NEW_LINE>if (APIMessage.class.isAssignableFrom(clz)) {<NEW_LINE>vo.setCategory(APITIMEOUT_GLOBAL_CONFIG_TYPE);<NEW_LINE>} else {<NEW_LINE>vo.setCategory(CONFIGURABLE_TIMEOUT_GLOBAL_CONFIG_TYPE);<NEW_LINE>}<NEW_LINE>vo.setName(clz.getName());<NEW_LINE>vo.setDescription(String<MASK><NEW_LINE>DefaultTimeout at = clz.getAnnotation(DefaultTimeout.class);<NEW_LINE>if (at == null) {<NEW_LINE>vo.setDefaultValue("30m");<NEW_LINE>} else {<NEW_LINE>vo.setDefaultValue(String.valueOf(at.timeunit().toMillis(at.value())));<NEW_LINE>}<NEW_LINE>vo.setValue(getTimeoutGlobalConfigValue(clz, vo));<NEW_LINE>results.add(GlobalConfig.valueOf(vo));<NEW_LINE>});<NEW_LINE>return results;<NEW_LINE>} | .format("timeout for message %s", clz)); |
1,345,700 | private void openChat(UserJid user, String text) {<NEW_LINE>UserJid bareAddress = user.getBareUserJid();<NEW_LINE>ArrayList<BaseEntity> entities = new ArrayList<>();<NEW_LINE>for (AbstractChat check : MessageManager.getInstance().getChats()) {<NEW_LINE>if (check.isActive() && check.getUser().equals(bareAddress)) {<NEW_LINE>entities.add(check);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (entities.size() == 1) {<NEW_LINE>openChat(entities.get(0), text);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>entities.clear();<NEW_LINE>Collection<AccountJid> enabledAccounts = AccountManager.getInstance().getEnabledAccounts();<NEW_LINE>RosterManager rosterManager = RosterManager.getInstance();<NEW_LINE>for (AccountJid accountJid : enabledAccounts) {<NEW_LINE>RosterContact rosterContact = rosterManager.getRosterContact(accountJid, user);<NEW_LINE>if (rosterContact != null && rosterContact.isEnabled()) {<NEW_LINE>entities.add(rosterContact);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (entities.size() == 1) {<NEW_LINE>openChat(entities<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (enabledAccounts.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (enabledAccounts.size() == 1) {<NEW_LINE>openChat(rosterManager.getBestContact(enabledAccounts.iterator().next(), bareAddress), text);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AccountChooseDialogFragment.newInstance(bareAddress, text).show(getFragmentManager(), "OPEN_WITH_ACCOUNT");<NEW_LINE>} | .get(0), text); |
742,596 | protected Color convertToPresentation(String modelValue) throws ConversionException {<NEW_LINE>if (modelValue == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (modelValue.startsWith("#")) {<NEW_LINE>modelValue = modelValue.substring(<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>switch(modelValue.length()) {<NEW_LINE>case 3:<NEW_LINE>return new Color(Integer.valueOf(modelValue.substring(0, 1), 16), Integer.valueOf(modelValue.substring(1, 2), 16), Integer.valueOf(modelValue.substring(2, 3), 16));<NEW_LINE>case 6:<NEW_LINE>return new Color(Integer.valueOf(modelValue.substring(0, 2), 16), Integer.valueOf(modelValue.substring(2, 4), 16), Integer.valueOf(modelValue.substring(4, 6), 16));<NEW_LINE>default:<NEW_LINE>throw new ConversionException(String.format("Value '%s' must be 3 or 6 characters in length", modelValue));<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new ConversionException(String.format("Value '%s' is not valid", modelValue));<NEW_LINE>}<NEW_LINE>} | 1, modelValue.length()); |
275,429 | public List<T> compactThirteen(List<T> collection, int position) {<NEW_LINE>_N = neighbour[position][Positions.N.ordinal()];<NEW_LINE>_S = neighbour[position][<MASK><NEW_LINE>_E = neighbour[position][Positions.E.ordinal()];<NEW_LINE>_W = neighbour[position][Positions.W.ordinal()];<NEW_LINE>_NW = neighbour[neighbour[position][Positions.N.ordinal()]][Positions.W.ordinal()];<NEW_LINE>_SW = neighbour[neighbour[position][Positions.S.ordinal()]][Positions.W.ordinal()];<NEW_LINE>_NE = neighbour[neighbour[position][Positions.N.ordinal()]][Positions.E.ordinal()];<NEW_LINE>_SE = neighbour[neighbour[position][Positions.S.ordinal()]][Positions.E.ordinal()];<NEW_LINE>_NN = neighbour[_N][Positions.N.ordinal()];<NEW_LINE>_SS = neighbour[_S][Positions.S.ordinal()];<NEW_LINE>_EE = neighbour[_E][Positions.E.ordinal()];<NEW_LINE>_WW = neighbour[_W][Positions.W.ordinal()];<NEW_LINE>chromosomes.add(collection.get(_N));<NEW_LINE>chromosomes.add(collection.get(_S));<NEW_LINE>chromosomes.add(collection.get(_E));<NEW_LINE>chromosomes.add(collection.get(_W));<NEW_LINE>chromosomes.add(collection.get(_NW));<NEW_LINE>chromosomes.add(collection.get(_SW));<NEW_LINE>chromosomes.add(collection.get(_NE));<NEW_LINE>chromosomes.add(collection.get(_SE));<NEW_LINE>chromosomes.add(collection.get(_NN));<NEW_LINE>chromosomes.add(collection.get(_SS));<NEW_LINE>chromosomes.add(collection.get(_EE));<NEW_LINE>chromosomes.add(collection.get(_WW));<NEW_LINE>chromosomes.add(collection.get(position));<NEW_LINE>return chromosomes;<NEW_LINE>} | Positions.S.ordinal()]; |
475,057 | private Map<String, Object> export() {<NEW_LINE>Map<String, Object> map = new HashMap<>();<NEW_LINE>exportBoolean(map, "aue", auto_up_enabled);<NEW_LINE>exportBoolean(map, "ause", auto_up_seeding_enabled);<NEW_LINE>exportBoolean(map, "sle", seeding_limits_enabled);<NEW_LINE>exportInt(map, "ul", up_limit);<NEW_LINE>exportInt(map, "usl", up_seeding_limit);<NEW_LINE>exportInt(map, "dl", down_limit);<NEW_LINE>exportBoolean(map, "lre", lan_rates_enabled);<NEW_LINE>exportInt(map, "lul", lan_up_limit);<NEW_LINE>exportInt(map, "ldl", lan_down_limit);<NEW_LINE>List<Map<String, Object>> d_list = new ArrayList<>();<NEW_LINE>map.put("dms", d_list);<NEW_LINE>for (Map.Entry<String, int[]> entry : download_limits.entrySet()) {<NEW_LINE>Map<String, Object> m = new HashMap<>();<NEW_LINE>d_list.add(m);<NEW_LINE>exportString(m, "k", entry.getKey());<NEW_LINE>exportInt(m, "u", entry.getValue()[0]);<NEW_LINE>exportInt(m, "d", entry.getValue()[1]);<NEW_LINE>}<NEW_LINE>List<Map<String, Object>> <MASK><NEW_LINE>map.put("cts", c_list);<NEW_LINE>for (Map.Entry<String, int[]> entry : category_limits.entrySet()) {<NEW_LINE>Map<String, Object> m = new HashMap<>();<NEW_LINE>c_list.add(m);<NEW_LINE>exportString(m, "k", entry.getKey());<NEW_LINE>exportInt(m, "u", entry.getValue()[0]);<NEW_LINE>exportInt(m, "d", entry.getValue()[1]);<NEW_LINE>}<NEW_LINE>List<Map<String, Object>> t_list = new ArrayList<>();<NEW_LINE>map.put("tgs", t_list);<NEW_LINE>for (Map.Entry<String, int[]> entry : tag_limits.entrySet()) {<NEW_LINE>Map<String, Object> m = new HashMap<>();<NEW_LINE>t_list.add(m);<NEW_LINE>exportString(m, "k", entry.getKey());<NEW_LINE>exportInt(m, "u", entry.getValue()[0]);<NEW_LINE>exportInt(m, "d", entry.getValue()[1]);<NEW_LINE>}<NEW_LINE>return (map);<NEW_LINE>} | c_list = new ArrayList<>(); |
1,131,487 | private RelOptCost hashJoinCumulativeCostLowerBound(Join join, RelMetadataQuery mq, VolcanoPlanner planner) {<NEW_LINE>final double leftRowCount = mq.getRowCount(join.getLeft());<NEW_LINE>final double rightRowCount = mq.getRowCount(join.getRight());<NEW_LINE>final RelDataType probeSideRowType;<NEW_LINE>final RelDataType buildSideRowType;<NEW_LINE>final double probeRowCount;<NEW_LINE>final double buildRowCount;<NEW_LINE>if (leftRowCount < rightRowCount) {<NEW_LINE>buildRowCount = leftRowCount;<NEW_LINE>probeRowCount = rightRowCount;<NEW_LINE>buildSideRowType = join.getLeft().getRowType();<NEW_LINE>probeSideRowType = join.getRight().getRowType();<NEW_LINE>} else {<NEW_LINE>buildRowCount = rightRowCount;<NEW_LINE>probeRowCount = leftRowCount;<NEW_LINE>buildSideRowType = join.getRight().getRowType();<NEW_LINE>probeSideRowType = join.getLeft().getRowType();<NEW_LINE>}<NEW_LINE>double buildWeight = CostModelWeight.INSTANCE.getBuildWeight();<NEW_LINE>double probeWeight = CostModelWeight.INSTANCE.getProbeWeight();<NEW_LINE>double rowCount = probeRowCount + buildRowCount;<NEW_LINE>double hashJoinCpu = buildWeight * buildRowCount + probeWeight * probeRowCount;<NEW_LINE>double hashJoinMemory = MemoryEstimator.estimateRowSizeInHashTable(buildSideRowType) * buildRowCount;<NEW_LINE>RelOptCost hashJoinCost = planner.getCostFactory().makeCost(rowCount, <MASK><NEW_LINE>RelOptCost hashJoinCumulativeCost = hashJoinCost.plus(planner.getCostFactory().makeCost(buildRowCount, buildRowCount, 0, buildRowCount * (TUPLE_HEADER_SIZE + TableScanIOEstimator.estimateRowSize(buildSideRowType)) / CostModelWeight.SEQ_IO_PAGE_SIZE, Math.ceil(TableScanIOEstimator.estimateRowSize(buildSideRowType) * buildRowCount / CostModelWeight.NET_BUFFER_SIZE))).plus(planner.getCostFactory().makeCost(probeRowCount, probeRowCount, 0, probeRowCount * (TUPLE_HEADER_SIZE + TableScanIOEstimator.estimateRowSize(probeSideRowType)) / CostModelWeight.SEQ_IO_PAGE_SIZE, Math.ceil(TableScanIOEstimator.estimateRowSize(probeSideRowType) * probeRowCount / CostModelWeight.NET_BUFFER_SIZE)));<NEW_LINE>return hashJoinCumulativeCost;<NEW_LINE>} | hashJoinCpu, hashJoinMemory, 0, 0); |
1,505,012 | final GetDetectorModelAnalysisResultsResult executeGetDetectorModelAnalysisResults(GetDetectorModelAnalysisResultsRequest getDetectorModelAnalysisResultsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDetectorModelAnalysisResultsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDetectorModelAnalysisResultsRequest> request = null;<NEW_LINE>Response<GetDetectorModelAnalysisResultsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDetectorModelAnalysisResultsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDetectorModelAnalysisResultsRequest));<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, "IoT Events");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDetectorModelAnalysisResults");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDetectorModelAnalysisResultsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDetectorModelAnalysisResultsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
372,559 | public void updateImageRampupPlan(final ImageRampupPlanRequestDTO imageRampupPlanRequest) throws ImageMgmtException {<NEW_LINE>// input validation for image version create request<NEW_LINE>final List<String> validationErrors = new ArrayList<>();<NEW_LINE>if (!ValidatorUtils.validateObject(imageRampupPlanRequest, validationErrors, ValidationOnUpdate.class)) {<NEW_LINE>final String errors = validationErrors.stream().collect(Collectors.joining(","));<NEW_LINE>throw new ImageMgmtValidationException(ErrorCode.BAD_REQUEST, String.format("Provide valid " + "input for updating image rampup plan. Error(s): [%s]", errors));<NEW_LINE>}<NEW_LINE>// Validate rampup details and set the modified by user<NEW_LINE>if (!CollectionUtils.isEmpty(imageRampupPlanRequest.getImageRampups())) {<NEW_LINE>vaidateRampup(imageRampupPlanRequest);<NEW_LINE>}<NEW_LINE>this.imageRampupDao.updateImageRampupPlan(this<MASK><NEW_LINE>} | .converter.convertToDataModel(imageRampupPlanRequest)); |
1,199,600 | private void encodeMarkup(FacesContext context, Knob knob) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>Object value = knob.getValue() != null ? knob.getValue() : 0;<NEW_LINE>writer.startElement("input", knob);<NEW_LINE>writer.writeAttribute("id", knob.getClientId(), null);<NEW_LINE>writer.writeAttribute("name", knob.getClientId(), null);<NEW_LINE>writer.writeAttribute("disabled", true, null);<NEW_LINE>writer.writeAttribute("value", value.toString(), null);<NEW_LINE>writer.writeAttribute("data-min", knob.getMin(), null);<NEW_LINE>writer.writeAttribute("data-step", knob.getStep(), null);<NEW_LINE>writer.writeAttribute("data-max", knob.getMax(), null);<NEW_LINE>writer.writeAttribute("data-displayInput", Boolean.toString(knob.isShowLabel()), null);<NEW_LINE>writer.writeAttribute("data-readOnly", Boolean.toString(knob.isDisabled()), null);<NEW_LINE>writer.writeAttribute("data-cursor", Boolean.toString(knob.isCursor()), null);<NEW_LINE>writer.writeAttribute("data-linecap", knob.getLineCap(), "butt");<NEW_LINE>if (knob.getThickness() != null) {<NEW_LINE>writer.writeAttribute("data-thickness", knob.getThickness(), null);<NEW_LINE>}<NEW_LINE>if (knob.getWidth() != null) {<NEW_LINE>writer.writeAttribute("data-width", knob.getWidth().toString(), null);<NEW_LINE>}<NEW_LINE>if (knob.getHeight() != null) {<NEW_LINE>writer.writeAttribute("data-height", knob.getHeight().toString(), null);<NEW_LINE>}<NEW_LINE>writer.writeAttribute("class", "knob", null);<NEW_LINE>writer.endElement("input");<NEW_LINE>renderHiddenInput(context, knob.getClientId() + "_hidden", value.toString(<MASK><NEW_LINE>} | ), knob.isDisabled()); |
583,077 | private void computeKeepIndexing() {<NEW_LINE>if (_keepIndexing) {<NEW_LINE>_segmentLogger.debug(<MASK><NEW_LINE>if ((System.currentTimeMillis() >= _segmentEndTimeThreshold) || _realtimeSegment.getNumDocsIndexed() >= _streamConfig.getFlushThresholdRows()) {<NEW_LINE>if (_realtimeSegment.getNumDocsIndexed() == 0) {<NEW_LINE>_segmentLogger.info("no new events coming in, extending the end time by another hour");<NEW_LINE>_segmentEndTimeThreshold = System.currentTimeMillis() + _streamConfig.getFlushThresholdTimeMillis();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>_segmentLogger.info("Stopped indexing due to reaching segment limit: {} raw documents indexed, segment is aged {} minutes", _realtimeSegment.getNumDocsIndexed(), ((System.currentTimeMillis() - _start) / (ONE_MINUTE_IN_MILLSEC)));<NEW_LINE>_keepIndexing = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updateCurrentDocumentCountMetrics();<NEW_LINE>} | "Current indexed {} raw events", _realtimeSegment.getNumDocsIndexed()); |
1,020,419 | public com.amazonaws.services.alexaforbusiness.model.SkillNotLinkedException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.alexaforbusiness.model.SkillNotLinkedException skillNotLinkedException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 skillNotLinkedException;<NEW_LINE>} | alexaforbusiness.model.SkillNotLinkedException(null); |
1,199,096 | protected Iterator<RowResult<Value>> computeNext() {<NEW_LINE>if (endOfResults) {<NEW_LINE>return endOfData();<NEW_LINE>} else {<NEW_LINE>try (ConnectionSupplier conns = new ConnectionSupplier(connectionPool);<NEW_LINE>ClosableIterator<AgnosticLightResultRow> iter = selectNextPage(conns)) {<NEW_LINE>List<RowResult<Value>> results = new ArrayList<>(maxRowsPerPage);<NEW_LINE>int numSqlRows = 0;<NEW_LINE>byte[] colName = null;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>numSqlRows += 1;<NEW_LINE>AgnosticLightResultRow sqlRow = iter.next();<NEW_LINE>byte[] rowName = sqlRow.getBytes("row_name");<NEW_LINE>colName = Preconditions.checkNotNull(sqlRow.getBytes("col_name"), "received a null col_name from the database");<NEW_LINE>if (!Arrays.equals(currentRowName, rowName)) {<NEW_LINE>flushCurrentRow(results);<NEW_LINE>currentRowName = rowName;<NEW_LINE>}<NEW_LINE>Value value = Value.create(sqlRow.getBytes("val"), sqlRow.getLong("ts"));<NEW_LINE>currentRowCells.put(colName, value);<NEW_LINE>}<NEW_LINE>if (numSqlRows < maxCellsPerPage || colName == null) {<NEW_LINE>getCurrentRowResult(<MASK><NEW_LINE>endOfResults = true;<NEW_LINE>} else {<NEW_LINE>computeNextStartPosition(colName, results);<NEW_LINE>}<NEW_LINE>return results.iterator();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).ifPresent(results::add); |
957,996 | protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {<NEW_LINE>String scriptLocation = element.getAttribute(LOCATION_ATTRIBUTE);<NEW_LINE>String scriptText = DomUtils.getTextValue(element);<NEW_LINE>if (StringUtils.hasText(scriptLocation) == StringUtils.hasText(scriptText)) {<NEW_LINE>parserContext.getReaderContext().error("Either the 'location' attribute or inline script text must be provided, but not both.", element);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Element> variableElements = DomUtils.getChildElementsByTagName(element, "variable");<NEW_LINE>String scriptVariableGeneratorName = element.getAttribute("script-variable-generator");<NEW_LINE>if (StringUtils.hasText(scriptVariableGeneratorName) && variableElements.size() > 0) {<NEW_LINE>parserContext.getReaderContext().error("'script-variable-generator' and 'variable' sub-elements are mutually exclusive.", element);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(scriptLocation)) {<NEW_LINE>builder.addConstructorArgValue<MASK><NEW_LINE>} else {<NEW_LINE>builder.addConstructorArgValue(new StaticScriptSource(scriptText));<NEW_LINE>}<NEW_LINE>BeanMetadataElement scriptVariableGeneratorDef;<NEW_LINE>if (!StringUtils.hasText(scriptVariableGeneratorName)) {<NEW_LINE>BeanDefinitionBuilder scriptVariableGeneratorBuilder = BeanDefinitionBuilder.genericBeanDefinition(DefaultScriptVariableGenerator.class);<NEW_LINE>ManagedMap<String, Object> variableMap = buildVariablesMap(element, parserContext, variableElements);<NEW_LINE>if (!CollectionUtils.isEmpty(variableMap)) {<NEW_LINE>scriptVariableGeneratorBuilder.addConstructorArgValue(variableMap);<NEW_LINE>}<NEW_LINE>scriptVariableGeneratorDef = scriptVariableGeneratorBuilder.getBeanDefinition();<NEW_LINE>} else {<NEW_LINE>scriptVariableGeneratorDef = new RuntimeBeanReference(scriptVariableGeneratorName);<NEW_LINE>}<NEW_LINE>builder.addConstructorArgValue(scriptVariableGeneratorDef);<NEW_LINE>postProcess(builder, element, parserContext);<NEW_LINE>} | (resolveScriptLocation(element, scriptLocation)); |
787,068 | private static URL[] classPath2URLArray(String classPath) {<NEW_LINE>if (Objects.isNull(classPath) || classPath.length() == 0) {<NEW_LINE>logger.error("Empty class Path!");<NEW_LINE>return new URL[] {};<NEW_LINE>}<NEW_LINE>String[] splited = classPath.split(":");<NEW_LINE>logger.info("Splited class path: " + String<MASK><NEW_LINE>List<URL> res = Arrays.stream(splited).map(File::new).map(file -> {<NEW_LINE>try {<NEW_LINE>return file.toURL();<NEW_LINE>} catch (MalformedURLException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>logger.info("Extracted URL: " + String.join(":", res.stream().map(URL::toString).collect(Collectors.toList())));<NEW_LINE>URL[] ret = new URL[splited.length];<NEW_LINE>for (int i = 0; i < splited.length; ++i) {<NEW_LINE>ret[i] = res.get(i);<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | .join(",", splited)); |
132,421 | public Tuple2<Double, Double> calcHessianGradientLoss(Iterable<Tuple3<Double, Double, Vector>> labelVectors, DenseVector coefVector, DenseMatrix hessian, DenseVector grad) {<NEW_LINE>if (this.hasSecondDerivative()) {<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < size; ++i) {<NEW_LINE>grad.set(i, 0.0);<NEW_LINE>for (int j = 0; j < size; ++j) {<NEW_LINE>hessian.set(i, j, 0.0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double weightSum = 0.0;<NEW_LINE>double loss = 0.0;<NEW_LINE>for (Tuple3<Double, Double, Vector> labledVector : labelVectors) {<NEW_LINE>updateHessian(labledVector, coefVector, hessian);<NEW_LINE>weightSum += labledVector.f0;<NEW_LINE>updateGradient(labledVector, coefVector, grad);<NEW_LINE>loss += calcLoss(labledVector, coefVector);<NEW_LINE>}<NEW_LINE>if (0.0 != this.l1) {<NEW_LINE>double tmpVal = this.l1 * weightSum;<NEW_LINE>double[] coefArray = coefVector.getData();<NEW_LINE>for (int i = 0; i < coefVector.size(); i++) {<NEW_LINE>grad.add(i, Math.signum(coefArray[i]) * tmpVal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (0.0 != this.l2) {<NEW_LINE>double tmpVal = this.l2 * 2 * weightSum;<NEW_LINE>grad.plusScaleEqual(coefVector, tmpVal);<NEW_LINE>for (int i = 0; i < hessian.numRows(); ++i) {<NEW_LINE>hessian.add(i, i, tmpVal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Tuple2.of(weightSum, loss);<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("loss function can't support second derivative, newton precondition can not work.");<NEW_LINE>}<NEW_LINE>} | int size = grad.size(); |
119,065 | public okhttp3.Call postPingCall(SomeObj someObj, final ApiCallback _callback) throws ApiException {<NEW_LINE>String basePath = null;<NEW_LINE>// Operation Servers<NEW_LINE>String[] localBasePaths = new String[] {};<NEW_LINE>// Determine Base Path to Use<NEW_LINE>if (localCustomBaseUrl != null) {<NEW_LINE>basePath = localCustomBaseUrl;<NEW_LINE>} else if (localBasePaths.length > 0) {<NEW_LINE>basePath = localBasePaths[localHostIndex];<NEW_LINE>} else {<NEW_LINE>basePath = null;<NEW_LINE>}<NEW_LINE>Object localVarPostBody = someObj;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/ping";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final <MASK><NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>if (localVarContentType != null) {<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | String[] localVarAccepts = { "application/json" }; |
1,593,201 | public void afterCreate(VerticalViewActivity a) {<NEW_LINE>final VerticalViewActivity activity = getManagedComponent();<NEW_LINE>DocumentController.chooseFullScreen(activity, AppState.get().fullScreenMode);<NEW_LINE>if (++loadingCount == 1) {<NEW_LINE>documentModel = ActivityControllerStub.DM_STUB;<NEW_LINE>if (intent == null || intent.getData() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File file = new File(intent.getData().getPath());<NEW_LINE>m_fileName = intent.getData().getPath();<NEW_LINE>codecType = BookType.getByUri(m_fileName);<NEW_LINE>FileMeta meta = FileMetaCore.createMetaIfNeed(m_fileName, false);<NEW_LINE>title = meta.getTitle();<NEW_LINE>if (TxtUtils.isEmpty(title)) {<NEW_LINE>title = ExtUtils.getFileName(m_fileName);<NEW_LINE>}<NEW_LINE>LOG.d("Book-title", title);<NEW_LINE>if (codecType == null) {<NEW_LINE>if (getActivity() != null) {<NEW_LINE>Toast.makeText(getActivity(), Apps.getApplicationName(getActivity()) + " " + getActivity().getString(R.string.application_cannot_open_the_book), Toast.LENGTH_LONG).show();<NEW_LINE>getActivity().finish();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>documentModel = new DocumentModel(codecType, getView());<NEW_LINE>documentModel.addListener(ViewerActivityController.this);<NEW_LINE>final Uri uri = Uri.fromFile(file);<NEW_LINE>controller.setCurrentBook(file);<NEW_LINE>wrapperControlls.hideShowEditIcon();<NEW_LINE>controller.addRecent(uri);<NEW_LINE>SettingsManager.getBookSettings(uri.getPath());<NEW_LINE>final AppBook.Diff diff = new AppBook.Diff(null, SettingsManager.getBookSettings());<NEW_LINE>onBookSettingsChanged(null, SettingsManager.getBookSettings(), diff);<NEW_LINE>if (intent.hasExtra("id2")) {<NEW_LINE>wrapperControlls.showSelectTextMenu();<NEW_LINE>}<NEW_LINE>wrapperControlls.setTitle(title);<NEW_LINE>}<NEW_LINE>wrapperControlls.updateUI();<NEW_LINE>} | LOG.d("codecType last", codecType); |
1,537,945 | private static FeedClient createFeedClient(CliArguments cliArgs) throws CliArguments.CliArgumentsException {<NEW_LINE>FeedClientBuilder builder = FeedClientBuilder.create(cliArgs.endpoint());<NEW_LINE>cliArgs.connections().ifPresent(builder::setConnectionsPerEndpoint);<NEW_LINE>cliArgs.maxStreamsPerConnection().ifPresent(builder::setMaxStreamPerConnection);<NEW_LINE>if (cliArgs.sslHostnameVerificationDisabled()) {<NEW_LINE>builder.setHostnameVerifier(AcceptAllHostnameVerifier.INSTANCE);<NEW_LINE>}<NEW_LINE>cliArgs.certificateAndKey().ifPresent(c -> builder.setCertificate(c.certificateFile, c.privateKeyFile));<NEW_LINE>cliArgs.caCertificates().ifPresent(builder::setCaCertificatesFile);<NEW_LINE>cliArgs.headers().forEach(builder::addRequestHeader);<NEW_LINE>builder.setDryrun(cliArgs.dryrunEnabled());<NEW_LINE>cliArgs.doomSeconds().ifPresent(doom -> builder.setCircuitBreaker(new GracePeriodCircuitBreaker(Duration.ofSeconds(10), Duration<MASK><NEW_LINE>cliArgs.proxy().ifPresent(builder::setProxy);<NEW_LINE>return builder.build();<NEW_LINE>} | .ofSeconds(doom)))); |
982,905 | public void onSensorChanged(SensorEvent event) {<NEW_LINE>// Attention : sensor produces a lot of events & can hang the system<NEW_LINE>if (inUpdateValue) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>synchronized (this) {<NEW_LINE>if (!sensorRegistered) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>inUpdateValue = true;<NEW_LINE>try {<NEW_LINE>float val = 0;<NEW_LINE>switch(event.sensor.getType()) {<NEW_LINE>case Sensor.TYPE_ACCELEROMETER:<NEW_LINE>System.arraycopy(event.values, 0, mGravs, 0, 3);<NEW_LINE>break;<NEW_LINE>case Sensor.TYPE_MAGNETIC_FIELD:<NEW_LINE>System.arraycopy(event.values, 0, mGeoMags, 0, 3);<NEW_LINE>break;<NEW_LINE>case Sensor.TYPE_ORIENTATION:<NEW_LINE>case Sensor.TYPE_ROTATION_VECTOR:<NEW_LINE>val = event.values[0];<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>OsmandSettings settings = app.getSettings();<NEW_LINE>if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER || event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) {<NEW_LINE>boolean success = SensorManager.getRotationMatrix(mRotationM, null, mGravs, mGeoMags);<NEW_LINE>if (!success) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float[] orientation = SensorManager.getOrientation(mRotationM, new float[3]);<NEW_LINE>val = (float) Math.toDegrees(orientation[0]);<NEW_LINE>} else if (event.sensor.getType() == Sensor.TYPE_ROTATION_VECTOR) {<NEW_LINE>SensorManager.getRotationMatrixFromVector(mRotationM, event.values);<NEW_LINE>float[] orientation = SensorManager.getOrientation(mRotationM, new float[3]);<NEW_LINE>val = (float) Math.toDegrees(orientation[0]);<NEW_LINE>}<NEW_LINE>val = calcScreenOrientationCorrection(val);<NEW_LINE>val = calcGeoMagneticCorrection(val);<NEW_LINE>float valRad = (float) (val / 180f * Math.PI);<NEW_LINE>lastValSin = (float) Math.sin(valRad);<NEW_LINE>lastValCos = (float) Math.cos(valRad);<NEW_LINE>// lastHeadingCalcTime = System.currentTimeMillis();<NEW_LINE>boolean filter = settings.USE_KALMAN_FILTER_FOR_COMPASS.get();<NEW_LINE>if (filter) {<NEW_LINE>filterCompassValue();<NEW_LINE>} else {<NEW_LINE>avgValSin = lastValSin;<NEW_LINE>avgValCos = lastValCos;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>updateCompassVal();<NEW_LINE>} finally {<NEW_LINE>inUpdateValue = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | heading = getAngle(avgValSin, avgValCos); |
1,758,648 | public void recordActivityEnd(ExecutionEntity executionEntity, String deleteReason, Date endTime) {<NEW_LINE>if (getHistoryConfigurationSettings().isHistoryEnabledForActivity(executionEntity.getProcessDefinitionId(), executionEntity.getActivityId())) {<NEW_LINE>String activityId = getActivityIdForExecution(executionEntity);<NEW_LINE>if (StringUtils.isNotEmpty(activityId)) {<NEW_LINE>ObjectNode data = processEngineConfiguration.getObjectMapper().createObjectNode();<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.PROCESS_DEFINITION_ID, executionEntity.getProcessDefinitionId());<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.PROCESS_INSTANCE_ID, executionEntity.getProcessInstanceId());<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.EXECUTION_ID, executionEntity.getId());<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.ACTIVITY_ID, activityId);<NEW_LINE>if (executionEntity.getCurrentFlowElement() != null) {<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.ACTIVITY_NAME, executionEntity.getCurrentFlowElement().getName());<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.ACTIVITY_TYPE, parseActivityType(executionEntity.getCurrentFlowElement()));<NEW_LINE>}<NEW_LINE>if (executionEntity.getTenantId() != null) {<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.TENANT_ID, executionEntity.getTenantId());<NEW_LINE>}<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.DELETE_REASON, deleteReason);<NEW_LINE>putIfNotNull(data, HistoryJsonConstants.END_TIME, endTime);<NEW_LINE>ObjectNode correspondingActivityStartData = getActivityStart(executionEntity.getId(), activityId, true);<NEW_LINE>if (correspondingActivityStartData == null) {<NEW_LINE>getAsyncHistorySession().addHistoricData(getJobServiceConfiguration(<MASK><NEW_LINE>} else {<NEW_LINE>data.put(HistoryJsonConstants.START_TIME, getStringFromJson(correspondingActivityStartData, HistoryJsonConstants.START_TIME));<NEW_LINE>getAsyncHistorySession().addHistoricData(getJobServiceConfiguration(), HistoryJsonConstants.TYPE_ACTIVITY_FULL, data);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), HistoryJsonConstants.TYPE_ACTIVITY_END, data); |
69,968 | private Mono<Response<Flux<ByteBuffer>>> updateTagsWithResponseAsync(String resourceGroupName, String networkInterfaceName, TagsObject parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (networkInterfaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter networkInterfaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2018-11-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.updateTags(this.client.getEndpoint(), resourceGroupName, networkInterfaceName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context);<NEW_LINE>} | this.client.mergeContext(context); |
34,293 | protected void handleReadyResponse(String response, JsonObject jo) {<NEW_LINE>if (TinyGUtils.isTinyGVersion(jo)) {<NEW_LINE>firmwareVersionNumber = TinyGUtils.getVersion(jo);<NEW_LINE>firmwareVersion = "G2Core " + firmwareVersionNumber;<NEW_LINE>}<NEW_LINE>capabilities.addCapability(CapabilitiesConstants.X_AXIS);<NEW_LINE>capabilities.addCapability(CapabilitiesConstants.Y_AXIS);<NEW_LINE>capabilities.addCapability(CapabilitiesConstants.Z_AXIS);<NEW_LINE>capabilities.addCapability(CapabilitiesConstants.A_AXIS);<NEW_LINE>capabilities.addCapability(CapabilitiesConstants.B_AXIS);<NEW_LINE>capabilities.addCapability(CapabilitiesConstants.C_AXIS);<NEW_LINE>capabilities.addCapability(CapabilitiesConstants.RETURN_TO_ZERO);<NEW_LINE>capabilities.addCapability(CapabilitiesConstants.JOGGING);<NEW_LINE>capabilities.addCapability(CapabilitiesConstants.CONTINUOUS_JOGGING);<NEW_LINE>capabilities.addCapability(CapabilitiesConstants.HOMING);<NEW_LINE>capabilities.addCapability(CapabilitiesConstants.FIRMWARE_SETTINGS);<NEW_LINE>capabilities.addCapability(CapabilitiesConstants.OVERRIDES);<NEW_LINE>capabilities.removeCapability(CapabilitiesConstants.SETUP_WIZARD);<NEW_LINE>setCurrentState(COMM_IDLE);<NEW_LINE>dispatchConsoleMessage(MessageType.INFO, "[ready] " + response + "\n");<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>dispatchConsoleMessage(MessageType.ERROR, "Couldn't enquire for controller status\n");<NEW_LINE>}<NEW_LINE>} | comm.sendByteImmediately(TinyGUtils.COMMAND_ENQUIRE_STATUS); |
295,595 | private String contrast() {<NEW_LINE>final ShenyuDictDO before = (ShenyuDictDO) getBefore();<NEW_LINE>Objects.requireNonNull(before);<NEW_LINE>final ShenyuDictDO after = (ShenyuDictDO) getAfter();<NEW_LINE>Objects.requireNonNull(after);<NEW_LINE>if (Objects.equals(before, after)) {<NEW_LINE>return "it no change";<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (!Objects.equals(before.getDictName(), after.getDictName())) {<NEW_LINE>builder.append(String.format("name[%s => %s] ", before.getDictName(), after.getDictName()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getDictValue(), after.getDictValue())) {<NEW_LINE>builder.append(String.format("value[%s => %s] ", before.getDictValue(), after.getDictValue()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getDesc(), after.getDesc())) {<NEW_LINE>builder.append(String.format("desc[%s => %s] ", before.getDesc(), after.getDesc()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getType(), after.getType())) {<NEW_LINE>builder.append(String.format("type[%s => %s] ", before.getType(), after.getType()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getEnabled(), after.getEnabled())) {<NEW_LINE>builder.append(String.format("enable[%s => %s] ", before.getEnabled(), after.getEnabled()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(before.getSort(), after.getSort())) {<NEW_LINE>builder.append(String.format("sort[%s => %s] ", before.getSort(), after.getSort()));<NEW_LINE>}<NEW_LINE>return builder.toString();<NEW_LINE>} | final StringBuilder builder = new StringBuilder(); |
1,362,210 | private Result<TopicOffsetChangedEnum> checkTopicOffsetChanged(ClusterDO clusterDO, String topicName, Map<TopicPartition, Long> endOffsetMap) {<NEW_LINE>if (ValidateUtils.isNull(clusterDO) || ValidateUtils.isNull(topicName) || ValidateUtils.isEmptyMap(endOffsetMap)) {<NEW_LINE>return new Result<>(TopicOffsetChangedEnum.UNKNOWN);<NEW_LINE>}<NEW_LINE>Map<TopicPartition, Long> beginningOffsetMap = this.getPartitionOffset(clusterDO, topicName, OffsetPosEnum.BEGINNING);<NEW_LINE>if (ValidateUtils.isEmptyMap(beginningOffsetMap)) {<NEW_LINE>return new Result<>(TopicOffsetChangedEnum.UNKNOWN);<NEW_LINE>}<NEW_LINE>TopicOffsetChangedEnum changedEnum = TopicOffsetChangedEnum.NO;<NEW_LINE>for (Map.Entry<TopicPartition, Long> entry : endOffsetMap.entrySet()) {<NEW_LINE>Long beginningOffset = beginningOffsetMap.<MASK><NEW_LINE>if (!ValidateUtils.isNull(beginningOffset) && beginningOffset < entry.getValue()) {<NEW_LINE>return new Result<>(TopicOffsetChangedEnum.YES);<NEW_LINE>}<NEW_LINE>if (ValidateUtils.isNull(beginningOffset)) {<NEW_LINE>changedEnum = TopicOffsetChangedEnum.UNKNOWN;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TopicOffsetChangedEnum.UNKNOWN.equals(changedEnum) || endOffsetMap.size() != beginningOffsetMap.size()) {<NEW_LINE>return new Result<>(TopicOffsetChangedEnum.UNKNOWN);<NEW_LINE>}<NEW_LINE>return new Result<>(TopicOffsetChangedEnum.NO);<NEW_LINE>} | get(entry.getKey()); |
791,749 | public void nextTuple() {<NEW_LINE>ConsumerRecord<K, V<MASK><NEW_LINE>if (record != null) {<NEW_LINE>// there are still records remaining for emission from the previous poll<NEW_LINE>emitConsumerRecord(record);<NEW_LINE>} else {<NEW_LINE>// all the records from previous poll have been<NEW_LINE>// emitted or this is very first time to poll<NEW_LINE>if (topologyReliabilityMode == Config.TopologyReliabilityMode.ATLEAST_ONCE) {<NEW_LINE>ackRegistry.forEach((key, value) -> {<NEW_LINE>if (value != null) {<NEW_LINE>// seek back to the earliest failed offset if there is any<NEW_LINE>rewindAndDiscardAck(key, value);<NEW_LINE>// commit based on the first continuous acknowledgement range<NEW_LINE>manualCommit(key, value);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>poll().forEach(kvConsumerRecord -> buffer.offer(kvConsumerRecord));<NEW_LINE>}<NEW_LINE>} | > record = buffer.poll(); |
1,458,726 | private void removeJob(String resourceId, String group) {<NEW_LINE>if (StringUtils.equals(ScheduleGroup.API_SCENARIO_TEST.name(), group)) {<NEW_LINE>scheduleManager.removeJob(ApiScenarioTestJob.getJobKey(resourceId), ApiScenarioTestJob.getTriggerKey(resourceId));<NEW_LINE>} else if (StringUtils.equals(ScheduleGroup.TEST_PLAN_TEST.name(), group)) {<NEW_LINE>scheduleManager.removeJob(TestPlanTestJob.getJobKey(resourceId), TestPlanTestJob.getTriggerKey(resourceId));<NEW_LINE>} else if (StringUtils.equals(ScheduleGroup.SWAGGER_IMPORT.name(), group)) {<NEW_LINE>scheduleManager.removeJob(SwaggerUrlImportJob.getJobKey(resourceId), SwaggerUrlImportJob.getTriggerKey(resourceId));<NEW_LINE>} else if (StringUtils.equals(ScheduleGroup.PERFORMANCE_TEST.name(), group)) {<NEW_LINE>scheduleManager.removeJob(PerformanceTestJob.getJobKey(resourceId)<MASK><NEW_LINE>} else {<NEW_LINE>scheduleManager.removeJob(ApiTestJob.getJobKey(resourceId), ApiTestJob.getTriggerKey(resourceId));<NEW_LINE>}<NEW_LINE>} | , PerformanceTestJob.getTriggerKey(resourceId)); |
641,998 | public byte[] encode(MVCCRecord record) {<NEW_LINE>KeyMeta meta = KeyMeta.newBuilder().setCreateRevision(record.getCreateRev()).setModRevision(record.getModRev()).setVersion(record.getVersion()).setValueType(record.getValueType()).setExpireTime(record.getExpireTime()).build();<NEW_LINE>int metaLen = meta.getSerializedSize();<NEW_LINE>int valLen = record.getValue().readableBytes();<NEW_LINE>// meta len<NEW_LINE>int // meta len<NEW_LINE>totalLen = // meta bytes<NEW_LINE>Integer.BYTES + // val len<NEW_LINE>metaLen + // val bytes<NEW_LINE>Integer.BYTES + valLen;<NEW_LINE>// NOTE: currently rocksdb jni only supports `byte[]`<NEW_LINE>// we can improve this if rocksdb jni support ByteBuffer or ByteBuf<NEW_LINE>byte[] data = new byte[totalLen];<NEW_LINE>ByteBuf buf = Unpooled.wrappedBuffer(data);<NEW_LINE>buf.writerIndex(0);<NEW_LINE>buf.writeInt(metaLen);<NEW_LINE>CodedOutputStream out = CodedOutputStream.newInstance(data, Integer.BYTES, metaLen);<NEW_LINE>try {<NEW_LINE>meta.writeTo(out);<NEW_LINE>} catch (IOException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>buf.writerIndex(buf.writerIndex() + metaLen);<NEW_LINE>buf.writeInt(valLen);<NEW_LINE>buf.writeBytes(record.getValue().slice());<NEW_LINE>buf.release();<NEW_LINE>return data;<NEW_LINE>} | throw new StateStoreRuntimeException("Failed to serialize key metadata", e); |
1,513,595 | public static void colorizeIcons(Context context, int iconType, GradientDrawable background, @ColorInt int defaultColor) {<NEW_LINE>switch(iconType) {<NEW_LINE>case Icons.VIDEO:<NEW_LINE>case Icons.IMAGE:<NEW_LINE>background.setColor(Utils.getColor(context<MASK><NEW_LINE>break;<NEW_LINE>case Icons.AUDIO:<NEW_LINE>background.setColor(Utils.getColor(context, R.color.audio_item));<NEW_LINE>break;<NEW_LINE>case Icons.PDF:<NEW_LINE>background.setColor(Utils.getColor(context, R.color.pdf_item));<NEW_LINE>break;<NEW_LINE>case Icons.CODE:<NEW_LINE>background.setColor(Utils.getColor(context, R.color.code_item));<NEW_LINE>break;<NEW_LINE>case Icons.TEXT:<NEW_LINE>background.setColor(Utils.getColor(context, R.color.text_item));<NEW_LINE>break;<NEW_LINE>case Icons.COMPRESSED:<NEW_LINE>background.setColor(Utils.getColor(context, R.color.archive_item));<NEW_LINE>break;<NEW_LINE>case Icons.APK:<NEW_LINE>background.setColor(Utils.getColor(context, R.color.apk_item));<NEW_LINE>break;<NEW_LINE>case Icons.NOT_KNOWN:<NEW_LINE>background.setColor(Utils.getColor(context, R.color.generic_item));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>background.setColor(defaultColor);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} | , R.color.video_item)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.