idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
776,700
private void injectParamCollector(Element element, Map<String, Integer> paramsType, Map<String, Autowired> injectConfig) {<NEW_LINE>for (Element field : element.getEnclosedElements()) {<NEW_LINE>if (field.getKind().isField() && field.getAnnotation(Autowired.class) != null && !types.isSubtype(field.asType(), iProvider)) {<NEW_LINE>// It must be field, then it has annotation, but it not be provider.<NEW_LINE>Autowired paramConfig = field.getAnnotation(Autowired.class);<NEW_LINE>String injectName = StringUtils.isEmpty(paramConfig.name()) ? field.getSimpleName().toString() : paramConfig.name();<NEW_LINE>paramsType.put(injectName, typeUtils.typeExchange(field));<NEW_LINE>injectConfig.put(injectName, paramConfig);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if has parent?<NEW_LINE>TypeMirror parent = ((<MASK><NEW_LINE>if (parent instanceof DeclaredType) {<NEW_LINE>Element parentElement = ((DeclaredType) parent).asElement();<NEW_LINE>if (parentElement instanceof TypeElement && !((TypeElement) parentElement).getQualifiedName().toString().startsWith("android")) {<NEW_LINE>injectParamCollector(parentElement, paramsType, injectConfig);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
TypeElement) element).getSuperclass();
1,588,265
private void actionAcquireWakeLock() {<NEW_LINE>if (mWakeLock != null) {<NEW_LINE>Logger.logDebug(LOG_TAG, "Ignoring acquiring WakeLocks since they are already held");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Logger.logDebug(LOG_TAG, "Acquiring WakeLocks");<NEW_LINE>PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);<NEW_LINE>mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, TermuxConstants.TERMUX_APP_NAME.toLowerCase() + ":service-wakelock");<NEW_LINE>mWakeLock.acquire();<NEW_LINE>// http://tools.android.com/tech-docs/lint-in-studio-2-3#TOC-WifiManager-Leak<NEW_LINE>WifiManager wm = (WifiManager) getApplicationContext(<MASK><NEW_LINE>mWifiLock = wm.createWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF, TermuxConstants.TERMUX_APP_NAME.toLowerCase());<NEW_LINE>mWifiLock.acquire();<NEW_LINE>if (!PermissionUtils.checkIfBatteryOptimizationsDisabled(this)) {<NEW_LINE>PermissionUtils.requestDisableBatteryOptimizations(this);<NEW_LINE>}<NEW_LINE>updateNotification();<NEW_LINE>Logger.logDebug(LOG_TAG, "WakeLocks acquired successfully");<NEW_LINE>}
).getSystemService(Context.WIFI_SERVICE);
219,640
private Process launchMixAudit(File folder, List<String> mixAuditArgs) throws AnalysisException {<NEW_LINE>if (!folder.isDirectory()) {<NEW_LINE>throw new AnalysisException(String.format("%s should have been a directory.", folder.getAbsolutePath()));<NEW_LINE>}<NEW_LINE>final List<String> args = new ArrayList<>();<NEW_LINE>final String mixAuditPath = getSettings().getString(Settings.KEYS.ANALYZER_MIX_AUDIT_PATH);<NEW_LINE>File mixAudit = null;<NEW_LINE>if (mixAuditPath != null) {<NEW_LINE>mixAudit = new File(mixAuditPath);<NEW_LINE>if (!mixAudit.isFile()) {<NEW_LINE>LOGGER.warn("Supplied `mixAudit` path is incorrect: {}", mixAuditPath);<NEW_LINE>mixAudit = null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final Path homePath = Paths.get(System.getProperty("user.home"));<NEW_LINE>final Path escriptPath = Paths.get(homePath.toString(), ".mix", "escripts", "mix_audit");<NEW_LINE>mixAudit = escriptPath.toFile();<NEW_LINE>}<NEW_LINE>args.add(mixAudit != null ? mixAudit.getAbsolutePath() : "mix_audit");<NEW_LINE>args.addAll(mixAuditArgs);<NEW_LINE>final ProcessBuilder builder = new ProcessBuilder(args);<NEW_LINE>builder.directory(folder);<NEW_LINE>try {<NEW_LINE>LOGGER.info("Launching: {} from {}", args, folder);<NEW_LINE>return builder.start();<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}
AnalysisException("mix_audit initialization failure; this error can be ignored if you are not analyzing Elixir. " + "Otherwise ensure that mix_audit is installed and the path to mix_audit is correctly specified", ioe);
884,711
final GetUsageForecastResult executeGetUsageForecast(GetUsageForecastRequest getUsageForecastRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getUsageForecastRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetUsageForecastRequest> request = null;<NEW_LINE>Response<GetUsageForecastResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetUsageForecastRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getUsageForecastRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Cost Explorer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetUsageForecast");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetUsageForecastResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetUsageForecastResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
839,699
public void initialize() {<NEW_LINE>createNotificationChannels();<NEW_LINE>this.subscriptions.add(this.notifications.onBackpressureBuffer().filter(PushNotificationEnvelope::isErroredPledge).observeOn(Schedulers.newThread()).subscribe(this::displayNotificationFromErroredPledge));<NEW_LINE>this.subscriptions.add(this.notifications.onBackpressureBuffer().filter(PushNotificationEnvelope::isFriendFollow).observeOn(Schedulers.newThread()).subscribe(this::displayNotificationFromFriendFollowActivity));<NEW_LINE>this.subscriptions.add(this.notifications.onBackpressureBuffer().filter(PushNotificationEnvelope::isMessage).flatMap(this::fetchMessageThreadWithEnvelope).filter(ObjectUtils::isNotNull).observeOn(Schedulers.newThread()).subscribe(envelopeAndMessageThread -> this.displayNotificationFromMessageActivity(envelopeAndMessageThread.first, envelopeAndMessageThread.second)));<NEW_LINE>this.subscriptions.add(this.notifications.onBackpressureBuffer().filter(PushNotificationEnvelope::isProjectActivity).observeOn(Schedulers.newThread()).subscribe(this::displayNotificationFromProjectActivity));<NEW_LINE>this.subscriptions.add(this.notifications.onBackpressureBuffer().filter(PushNotificationEnvelope::isProjectReminder).observeOn(Schedulers.newThread()).subscribe(this::displayNotificationFromProjectReminder));<NEW_LINE>this.subscriptions.add(this.notifications.onBackpressureBuffer().filter(PushNotificationEnvelope::isProjectUpdateActivity).flatMap(this::fetchUpdateWithEnvelope).filter(ObjectUtils::isNotNull).observeOn(Schedulers.newThread()).subscribe(envelopeAndUpdate -> this.displayNotificationFromUpdateActivity(envelopeAndUpdate.<MASK><NEW_LINE>this.subscriptions.add(this.notifications.onBackpressureBuffer().filter(PushNotificationEnvelope::isSurvey).flatMap(this::fetchSurveyResponseWithEnvelope).filter(ObjectUtils::isNotNull).observeOn(Schedulers.newThread()).subscribe(envelopeAndSurveyResponse -> this.displayNotificationFromSurveyResponseActivity(envelopeAndSurveyResponse.first, envelopeAndSurveyResponse.second)));<NEW_LINE>}
first, envelopeAndUpdate.second)));
1,636,490
final ImportCertificateResult executeImportCertificate(ImportCertificateRequest importCertificateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(importCertificateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ImportCertificateRequest> request = null;<NEW_LINE>Response<ImportCertificateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ImportCertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(importCertificateRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ACM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ImportCertificate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ImportCertificateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ImportCertificateResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
592,203
protected UrlRequest.Builder buildRequestBuilder(DataSpec dataSpec) throws IOException {<NEW_LINE>UrlRequest.Builder requestBuilder = cronetEngine.newUrlRequestBuilder(dataSpec.uri.toString(), urlRequestCallback, executor).setPriority(requestPriority).allowDirectExecutor();<NEW_LINE>// Set the headers.<NEW_LINE>Map<String, String> requestHeaders = new HashMap<>();<NEW_LINE>if (defaultRequestProperties != null) {<NEW_LINE>requestHeaders.putAll(defaultRequestProperties.getSnapshot());<NEW_LINE>}<NEW_LINE>requestHeaders.<MASK><NEW_LINE>requestHeaders.putAll(dataSpec.httpRequestHeaders);<NEW_LINE>for (Entry<String, String> headerEntry : requestHeaders.entrySet()) {<NEW_LINE>String key = headerEntry.getKey();<NEW_LINE>String value = headerEntry.getValue();<NEW_LINE>requestBuilder.addHeader(key, value);<NEW_LINE>}<NEW_LINE>if (dataSpec.httpBody != null && !requestHeaders.containsKey(HttpHeaders.CONTENT_TYPE)) {<NEW_LINE>throw new OpenException("HTTP request with non-empty body must set Content-Type", dataSpec, PlaybackException.ERROR_CODE_FAILED_RUNTIME_CHECK, Status.IDLE);<NEW_LINE>}<NEW_LINE>@Nullable<NEW_LINE>String rangeHeader = buildRangeRequestHeader(dataSpec.position, dataSpec.length);<NEW_LINE>if (rangeHeader != null) {<NEW_LINE>requestBuilder.addHeader(HttpHeaders.RANGE, rangeHeader);<NEW_LINE>}<NEW_LINE>if (userAgent != null) {<NEW_LINE>requestBuilder.addHeader(HttpHeaders.USER_AGENT, userAgent);<NEW_LINE>}<NEW_LINE>// TODO: Uncomment when https://bugs.chromium.org/p/chromium/issues/detail?id=711810 is fixed<NEW_LINE>// (adjusting the code as necessary).<NEW_LINE>// Force identity encoding unless gzip is allowed.<NEW_LINE>// if (!dataSpec.isFlagSet(DataSpec.FLAG_ALLOW_GZIP)) {<NEW_LINE>// requestBuilder.addHeader("Accept-Encoding", "identity");<NEW_LINE>// }<NEW_LINE>// Set the method and (if non-empty) the body.<NEW_LINE>requestBuilder.setHttpMethod(dataSpec.getHttpMethodString());<NEW_LINE>if (dataSpec.httpBody != null) {<NEW_LINE>requestBuilder.setUploadDataProvider(new ByteArrayUploadDataProvider(dataSpec.httpBody), executor);<NEW_LINE>}<NEW_LINE>return requestBuilder;<NEW_LINE>}
putAll(requestProperties.getSnapshot());
1,006,306
public static VersionCompatibility fromVersionList(List<String> versions) {<NEW_LINE>Node root = new Node();<NEW_LINE>for (String spec : versions) {<NEW_LINE>String[] parts = spec.split("\\.");<NEW_LINE>if (parts.length < 1 || parts.length > 3)<NEW_LINE>throw new IllegalArgumentException("Each spec must have 1 to 3 parts, but found '" + spec + "'");<NEW_LINE>boolean wildcard = false;<NEW_LINE>Node node = root;<NEW_LINE>for (int i = 0; i < 3; i++) {<NEW_LINE>String part = i < parts.length ? parts[i] : wildcard ? null : "0";<NEW_LINE>if (wildcard && part != null && !part.equals("*"))<NEW_LINE>throw new IllegalArgumentException("Wildcard parts may only have wildcard children, but found '" + spec + "'");<NEW_LINE>if ("*".equals(part)) {<NEW_LINE>wildcard = true;<NEW_LINE>if (node.children.isEmpty())<NEW_LINE>node = node.children.computeIfAbsent(-1, __ -> new Node());<NEW_LINE>else<NEW_LINE>throw new IllegalArgumentException("Wildcards may not have siblings, but got: " + versions);<NEW_LINE>} else if (part != null) {<NEW_LINE>int number = Integer.parseInt(part);<NEW_LINE>if (number < 0)<NEW_LINE>throw new IllegalArgumentException("Version parts must be non-negative, but found '" + spec + "'");<NEW_LINE>if (node.children.containsKey(-1))<NEW_LINE>throw new IllegalArgumentException("Wildcards may not have siblings, but got: " + versions);<NEW_LINE>if (i < 2)<NEW_LINE>node = node.children.computeIfAbsent(number, __ -> new Node());<NEW_LINE>else if (node.children.put(number, new Node()) != null)<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new VersionCompatibility(root);<NEW_LINE>}
IllegalArgumentException("Duplicate element '" + spec + "'");
1,110,076
static void validate(Message message, DataDictionary sessionDataDictionary, DataDictionary applicationDataDictionary) throws IncorrectTagValue, FieldNotFound, IncorrectDataFormat {<NEW_LINE>final boolean bodyOnly = sessionDataDictionary == null;<NEW_LINE>if (isVersionSpecified(sessionDataDictionary) && !sessionDataDictionary.getVersion().equals(message.getHeader().getString(BeginString.FIELD)) && !message.getHeader().getString(BeginString.FIELD).equals("FIXT.1.1") && !sessionDataDictionary.getVersion().equals("FIX.5.0")) {<NEW_LINE>throw new UnsupportedVersion("Message version '" + message.getHeader().getString(BeginString.FIELD) + "' does not match the data dictionary version '" + sessionDataDictionary.getVersion() + "'");<NEW_LINE>}<NEW_LINE>if (!message.hasValidStructure() && message.getException() != null) {<NEW_LINE>throw message.getException();<NEW_LINE>}<NEW_LINE>final String msgType = message.getHeader(<MASK><NEW_LINE>if (isVersionSpecified(applicationDataDictionary)) {<NEW_LINE>applicationDataDictionary.checkMsgType(msgType);<NEW_LINE>applicationDataDictionary.checkHasRequired(message.getHeader(), message, message.getTrailer(), msgType, bodyOnly);<NEW_LINE>}<NEW_LINE>if (!bodyOnly) {<NEW_LINE>sessionDataDictionary.iterate(message.getHeader(), HEADER_ID, sessionDataDictionary);<NEW_LINE>sessionDataDictionary.iterate(message.getTrailer(), TRAILER_ID, sessionDataDictionary);<NEW_LINE>}<NEW_LINE>applicationDataDictionary.iterate(message, msgType, applicationDataDictionary);<NEW_LINE>}
).getString(MsgType.FIELD);
1,673,586
final CreateCloudFormationChangeSetResult executeCreateCloudFormationChangeSet(CreateCloudFormationChangeSetRequest createCloudFormationChangeSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createCloudFormationChangeSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateCloudFormationChangeSetRequest> request = null;<NEW_LINE>Response<CreateCloudFormationChangeSetResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new CreateCloudFormationChangeSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createCloudFormationChangeSetRequest));<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, "ServerlessApplicationRepository");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateCloudFormationChangeSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateCloudFormationChangeSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateCloudFormationChangeSetResultJsonUnmarshaller());<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,118,683
public void marshall(StepExecution stepExecution, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (stepExecution == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(stepExecution.getStepName(), STEPNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getAction(), ACTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getTimeoutSeconds(), TIMEOUTSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getOnFailure(), ONFAILURE_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getMaxAttempts(), MAXATTEMPTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getExecutionStartTime(), EXECUTIONSTARTTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(stepExecution.getStepStatus(), STEPSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getResponseCode(), RESPONSECODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getInputs(), INPUTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getOutputs(), OUTPUTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getResponse(), RESPONSE_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getFailureMessage(), FAILUREMESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getFailureDetails(), FAILUREDETAILS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getStepExecutionId(), STEPEXECUTIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getOverriddenParameters(), OVERRIDDENPARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getIsEnd(), ISEND_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getNextStep(), NEXTSTEP_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getIsCritical(), ISCRITICAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getValidNextSteps(), VALIDNEXTSTEPS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getTargets(), TARGETS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stepExecution.getTargetLocation(), TARGETLOCATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
stepExecution.getExecutionEndTime(), EXECUTIONENDTIME_BINDING);
1,042,394
public ManualSyncSubmissionResult synchronousResetConnection(final UUID connectionId) {<NEW_LINE><MASK><NEW_LINE>if (resetResult.getFailingReason().isPresent()) {<NEW_LINE>return resetResult;<NEW_LINE>}<NEW_LINE>final ConnectionManagerWorkflow connectionManagerWorkflow = getExistingWorkflow(ConnectionManagerWorkflow.class, getConnectionManagerName(connectionId));<NEW_LINE>final long oldJobId = connectionManagerWorkflow.getJobInformation().getJobId();<NEW_LINE>do {<NEW_LINE>try {<NEW_LINE>Thread.sleep(DELAY_BETWEEN_QUERY_MS);<NEW_LINE>} catch (final InterruptedException e) {<NEW_LINE>return new ManualSyncSubmissionResult(Optional.of("Didn't manage to reset a sync for: " + connectionId), Optional.empty());<NEW_LINE>}<NEW_LINE>} while (connectionManagerWorkflow.getJobInformation().getJobId() == oldJobId);<NEW_LINE>log.info("End of reset");<NEW_LINE>final long jobId = connectionManagerWorkflow.getJobInformation().getJobId();<NEW_LINE>return new ManualSyncSubmissionResult(Optional.empty(), Optional.of(jobId));<NEW_LINE>}
final ManualSyncSubmissionResult resetResult = resetConnection(connectionId);
932,153
public void transform(PictureHiBD src, PictureHiBD dst) {<NEW_LINE>int[] y = src.getPlaneData(0);<NEW_LINE>int[] u = src.getPlaneData(1);<NEW_LINE>int[] v = src.getPlaneData(2);<NEW_LINE>int[] <MASK><NEW_LINE>int offLuma = 0, offChroma = 0;<NEW_LINE>for (int i = 0; i < dst.getHeight(); i++) {<NEW_LINE>for (int j = 0; j < dst.getWidth(); j += 2) {<NEW_LINE>YUVJtoRGB(y[offLuma], u[offChroma], v[offChroma], data, offLuma * 3);<NEW_LINE>YUVJtoRGB(y[offLuma + 1], u[offChroma], v[offChroma], data, (offLuma + 1) * 3);<NEW_LINE>offLuma += 2;<NEW_LINE>++offChroma;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
data = dst.getPlaneData(0);
69,238
public static QueryHBaseHaDBResponse unmarshall(QueryHBaseHaDBResponse queryHBaseHaDBResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryHBaseHaDBResponse.setRequestId(_ctx.stringValue("QueryHBaseHaDBResponse.RequestId"));<NEW_LINE>queryHBaseHaDBResponse.setTotalCount(_ctx.longValue("QueryHBaseHaDBResponse.TotalCount"));<NEW_LINE>queryHBaseHaDBResponse.setPageNumber(_ctx.integerValue("QueryHBaseHaDBResponse.PageNumber"));<NEW_LINE>queryHBaseHaDBResponse.setPageSize(_ctx.integerValue("QueryHBaseHaDBResponse.PageSize"));<NEW_LINE>List<Cluster> clusterList = new ArrayList<Cluster>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryHBaseHaDBResponse.ClusterList.Length"); i++) {<NEW_LINE>Cluster cluster = new Cluster();<NEW_LINE>cluster.setHaName(_ctx.stringValue("QueryHBaseHaDBResponse.ClusterList[" + i + "].HaName"));<NEW_LINE>cluster.setBdsName(_ctx.stringValue("QueryHBaseHaDBResponse.ClusterList[" + i + "].BdsName"));<NEW_LINE>cluster.setActiveName(_ctx.stringValue("QueryHBaseHaDBResponse.ClusterList[" + i + "].ActiveName"));<NEW_LINE>cluster.setStandbyName(_ctx.stringValue("QueryHBaseHaDBResponse.ClusterList[" + i + "].StandbyName"));<NEW_LINE>List<HaSlbConn> haSlbConnList = new ArrayList<HaSlbConn>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("QueryHBaseHaDBResponse.ClusterList[" + i + "].HaSlbConnList.Length"); j++) {<NEW_LINE>HaSlbConn haSlbConn = new HaSlbConn();<NEW_LINE>haSlbConn.setSlbType(_ctx.stringValue("QueryHBaseHaDBResponse.ClusterList[" + i + "].HaSlbConnList[" + j + "].SlbType"));<NEW_LINE>haSlbConn.setSlbConnAddr(_ctx.stringValue("QueryHBaseHaDBResponse.ClusterList[" + i <MASK><NEW_LINE>haSlbConn.setHbaseType(_ctx.stringValue("QueryHBaseHaDBResponse.ClusterList[" + i + "].HaSlbConnList[" + j + "].HbaseType"));<NEW_LINE>haSlbConnList.add(haSlbConn);<NEW_LINE>}<NEW_LINE>cluster.setHaSlbConnList(haSlbConnList);<NEW_LINE>clusterList.add(cluster);<NEW_LINE>}<NEW_LINE>queryHBaseHaDBResponse.setClusterList(clusterList);<NEW_LINE>return queryHBaseHaDBResponse;<NEW_LINE>}
+ "].HaSlbConnList[" + j + "].SlbConnAddr"));
877,985
protected synchronized void processElectricityProducerSolarAssetAttributeEvent(AttributeEvent attributeEvent) {<NEW_LINE>if (ElectricityProducerSolarAsset.POWER.getName().equals(attributeEvent.getAttributeName()) || ElectricityProducerSolarAsset.POWER_FORECAST.getName().equals(attributeEvent.getAttributeName())) {<NEW_LINE>// These are updated by this service<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (attributeEvent.getAttributeName().equals(ElectricityProducerSolarAsset.INCLUDE_FORECAST_SOLAR_SERVICE.getName())) {<NEW_LINE>boolean enabled = attributeEvent.<Boolean>getValue().orElse(false);<NEW_LINE>if (enabled && calculationFutures.containsKey(attributeEvent.getAssetId())) {<NEW_LINE>// Nothing to do here<NEW_LINE>return;<NEW_LINE>} else if (!enabled && !calculationFutures.containsKey(attributeEvent.getAssetId())) {<NEW_LINE>// Nothing to do here<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>stopProcessing(attributeEvent.getAssetId());<NEW_LINE>// Get latest asset from storage<NEW_LINE>ElectricityProducerSolarAsset asset = (ElectricityProducerSolarAsset) assetStorageService.find(attributeEvent.getAssetId());<NEW_LINE>if (asset != null && asset.isIncludeForecastSolarService().orElse(false)) {<NEW_LINE>startProcessing(asset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (attributeEvent.getAttributeName().equals(ElectricityProducerSolarAsset.SET_ACTUAL_SOLAR_VALUE_WITH_FORECAST.getName())) {<NEW_LINE>// Get latest asset from storage<NEW_LINE>ElectricityProducerSolarAsset asset = (ElectricityProducerSolarAsset) assetStorageService.find(attributeEvent.getAssetId());<NEW_LINE>// Check if power is currently zero and set it if power forecast has an value<NEW_LINE>if (asset.getPower().orElse(0d) == 0d && asset.getPowerForecast().orElse(0d) != 0d) {<NEW_LINE>assetProcessingService.sendAttributeEvent(new AttributeEvent(asset.getId(), ElectricityProducerSolarAsset.POWER, asset.getPowerForecast().orElse(0d)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
LOG.info("Processing producer solar asset attribute event: " + attributeEvent);
201,740
private boolean parseUrl(SearchPhrase phrase, SearchResultMatcher resultMatcher) {<NEW_LINE>String text = phrase.getUnknownSearchPhrase();<NEW_LINE>GeoParsedPoint pnt = GeoPointParserUtil.parse(text);<NEW_LINE>if (pnt != null && pnt.isGeoPoint() && phrase.isSearchTypeAllowed(ObjectType.LOCATION)) {<NEW_LINE>SearchResult sp = new SearchResult(phrase);<NEW_LINE>sp.priority = 0;<NEW_LINE>sp.object = pnt;<NEW_LINE>sp.wordsSpan = text;<NEW_LINE>sp.location = new LatLon(pnt.getLatitude(<MASK><NEW_LINE>sp.localeName = formatLatLon(pnt.getLatitude()) + ", " + formatLatLon(pnt.getLongitude());<NEW_LINE>if (pnt.getZoom() > 0) {<NEW_LINE>sp.preferredZoom = pnt.getZoom();<NEW_LINE>}<NEW_LINE>sp.objectType = ObjectType.LOCATION;<NEW_LINE>resultMatcher.publish(sp);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
), pnt.getLongitude());
207,204
private void writeMetadata() {<NEW_LINE>for (IMPLICIT_STRING_COLUMN column : IMPLICIT_STRING_COLUMN.values()) {<NEW_LINE>String value = stringMetadata.get(column.getFieldName());<NEW_LINE>int index = column.ordinal();<NEW_LINE>if (value == null) {<NEW_LINE>metadataColumnWriters.get(index).setNull();<NEW_LINE>} else {<NEW_LINE>metadataColumnWriters.get<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (IMPLICIT_TIMESTAMP_COLUMN column : IMPLICIT_TIMESTAMP_COLUMN.values()) {<NEW_LINE>Date timeValue = dateMetadata.get(column.getFieldName());<NEW_LINE>int index = column.ordinal() + IMPLICIT_STRING_COLUMN.values().length;<NEW_LINE>if (timeValue == null) {<NEW_LINE>metadataColumnWriters.get(index).setNull();<NEW_LINE>} else {<NEW_LINE>metadataColumnWriters.get(index).setTimestamp(Instant.ofEpochMilli(timeValue.getTime()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Write the sheet names. Since this is the only list field<NEW_LINE>int listIndex = IMPLICIT_STRING_COLUMN.values().length + IMPLICIT_TIMESTAMP_COLUMN.values().length;<NEW_LINE>String sheetColumnName = IMPLICIT_LIST_COLUMN.SHEETS.fieldName;<NEW_LINE>List<String> sheetNames = listMetadata.get(sheetColumnName);<NEW_LINE>if (sheetNameWriter == null) {<NEW_LINE>int sheetColumnIndex = rowWriter.tupleSchema().index(IMPLICIT_LIST_COLUMN.SHEETS.getFieldName());<NEW_LINE>if (sheetColumnIndex == -1) {<NEW_LINE>ColumnMetadata colSchema = MetadataUtils.newScalar(sheetColumnName, MinorType.VARCHAR, DataMode.REPEATED);<NEW_LINE>colSchema.setBooleanProperty(ColumnMetadata.EXCLUDE_FROM_WILDCARD, true);<NEW_LINE>listIndex = rowWriter.addColumn(colSchema);<NEW_LINE>}<NEW_LINE>sheetNameWriter = rowWriter.column(listIndex).array().scalar();<NEW_LINE>}<NEW_LINE>for (String sheetName : sheetNames) {<NEW_LINE>sheetNameWriter.setString(sheetName);<NEW_LINE>}<NEW_LINE>}
(index).setString(value);
1,719,663
// auto-generated, see spoon.generating.CloneVisitorGenerator<NEW_LINE>@java.lang.Override<NEW_LINE>public <T, E extends spoon.reflect.code.CtExpression<?>> void visitCtExecutableReferenceExpression(final spoon.reflect.code.CtExecutableReferenceExpression<T, E> expression) {<NEW_LINE>spoon.reflect.code.CtExecutableReferenceExpression<T, E> aCtExecutableReferenceExpression = expression.getFactory().Core().createExecutableReferenceExpression();<NEW_LINE>this.builder.copy(expression, aCtExecutableReferenceExpression);<NEW_LINE>aCtExecutableReferenceExpression.setComments(this.cloneHelper.clone(expression.getComments()));<NEW_LINE>aCtExecutableReferenceExpression.setAnnotations(this.cloneHelper.clone(expression.getAnnotations()));<NEW_LINE>aCtExecutableReferenceExpression.setType(this.cloneHelper.clone(expression.getType()));<NEW_LINE>aCtExecutableReferenceExpression.setTypeCasts(this.cloneHelper.clone(expression.getTypeCasts()));<NEW_LINE>aCtExecutableReferenceExpression.setExecutable(this.cloneHelper.clone(expression.getExecutable()));<NEW_LINE>aCtExecutableReferenceExpression.setTarget(this.cloneHelper.clone(expression.getTarget()));<NEW_LINE>this.<MASK><NEW_LINE>this.other = aCtExecutableReferenceExpression;<NEW_LINE>}
cloneHelper.tailor(expression, aCtExecutableReferenceExpression);
1,634,790
public void _editWebAsset(ActionRequest req, ActionResponse res, PortletConfig config, ActionForm form, User user) throws Exception {<NEW_LINE>// calls edit method from super class that returns parent folder<NEW_LINE>super._editWebAsset(req, res, config, form, user, WebKeys.CONTAINER_EDIT);<NEW_LINE>// setting parent folder path and inode on the form bean<NEW_LINE>ContainerForm cf = (ContainerForm) form;<NEW_LINE>ActionRequestImpl reqImpl = (ActionRequestImpl) req;<NEW_LINE>HttpServletRequest httpReq = reqImpl.getHttpServletRequest();<NEW_LINE>HttpSession session = httpReq.getSession();<NEW_LINE>// Setting the default host = the selected crumbtrail host if it is a new container<NEW_LINE>String hostId = (String) session.getAttribute(com.dotmarketing.util.WebKeys.CMS_SELECTED_HOST_ID);<NEW_LINE>if (!hostId.equals("allHosts") && cf.getHostId() == null) {<NEW_LINE>Host crumbHost = hostAPI.find(hostId, user, false);<NEW_LINE>if (crumbHost != null && permissionAPI.doesUserHavePermission(crumbHost, PermissionAPI.PERMISSION_CAN_ADD_CHILDREN, user, false))<NEW_LINE>cf.setHostId(hostId);<NEW_LINE>}<NEW_LINE>// This can't be done on the WebAsset so it needs to be done here.<NEW_LINE>Container container = (Container) req.getAttribute(WebKeys.CONTAINER_EDIT);<NEW_LINE>if (UtilMethods.isSet(container.getLuceneQuery())) {<NEW_LINE>cf.setDynamic(true);<NEW_LINE>}<NEW_LINE>// gets the container host<NEW_LINE>Host host = hostAPI.<MASK><NEW_LINE>if (host != null)<NEW_LINE>cf.setHostId(host.getIdentifier());<NEW_LINE>// Getting container structures<NEW_LINE>cf.setContainerStructures(APILocator.getContainerAPI().getContainerStructures(container));<NEW_LINE>// Asset Versions to list in the versions tab<NEW_LINE>req.setAttribute(WebKeys.VERSIONS_INODE_EDIT, container);<NEW_LINE>}
findParentHost(container, user, false);
201,772
private void updateConfigurationProperty(OAtomicOperation atomicOperation) {<NEW_LINE>final List<byte[]> entries = new ArrayList<>(8);<NEW_LINE>int totalSize = 0;<NEW_LINE>final byte[] contextSize = new byte[OIntegerSerializer.INT_SIZE];<NEW_LINE>totalSize += contextSize.length;<NEW_LINE>entries.add(contextSize);<NEW_LINE>OIntegerSerializer.INSTANCE.serializeNative(configuration.getContextSize(), contextSize, 0);<NEW_LINE>for (final String k : configuration.getContextKeys()) {<NEW_LINE>final OGlobalConfiguration cfg = OGlobalConfiguration.findByKey(k);<NEW_LINE>final byte[] key = serializeStringValue(k);<NEW_LINE>totalSize += key.length;<NEW_LINE>entries.add(key);<NEW_LINE>if (cfg != null) {<NEW_LINE>final byte[] value = serializeStringValue(cfg.isHidden() ? null : configuration.getValueAsString(cfg));<NEW_LINE>totalSize += value.length;<NEW_LINE>entries.add(value);<NEW_LINE>} else {<NEW_LINE>final byte[] value = serializeStringValue(null);<NEW_LINE>totalSize += value.length;<NEW_LINE>entries.add(value);<NEW_LINE>OLogManager.instance().warn(this, "Storing configuration for property:'" + k + "' not existing in current version");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final byte[] property = mergeBinaryEntries(totalSize, entries);<NEW_LINE>storeProperty(<MASK><NEW_LINE>}
atomicOperation, CONFIGURATION_PROPERTY, property, CONFIGURATION_PROPERTY_VERSION);
129,729
public BerkeleyJETx beginTransaction(final BaseTransactionConfig txCfg) throws BackendException {<NEW_LINE>try {<NEW_LINE>Transaction tx = null;<NEW_LINE>Configuration effectiveCfg = new MergedConfiguration(txCfg.<MASK><NEW_LINE>if (transactional) {<NEW_LINE>TransactionConfig txnConfig = new TransactionConfig();<NEW_LINE>ConfigOption.getEnumValue(effectiveCfg.get(ISOLATION_LEVEL), IsolationLevel.class).configure(txnConfig);<NEW_LINE>tx = environment.beginTransaction(null, txnConfig);<NEW_LINE>} else {<NEW_LINE>if (txCfg instanceof TransactionConfiguration) {<NEW_LINE>if (!((TransactionConfiguration) txCfg).isSingleThreaded()) {<NEW_LINE>// Non-transactional cursors can't shared between threads, more info ThreadLocker.checkState<NEW_LINE>throw new PermanentBackendException("BerkeleyJE does not support non-transactional for multi threaded tx");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BerkeleyJETx btx = new BerkeleyJETx(tx, ConfigOption.getEnumValue(effectiveCfg.get(LOCK_MODE), LockMode.class), ConfigOption.getEnumValue(effectiveCfg.get(CACHE_MODE), CacheMode.class), txCfg);<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("Berkeley tx created", new TransactionBegin(btx.toString()));<NEW_LINE>}<NEW_LINE>return btx;<NEW_LINE>} catch (DatabaseException e) {<NEW_LINE>throw new PermanentBackendException("Could not start BerkeleyJE transaction", e);<NEW_LINE>}<NEW_LINE>}
getCustomOptions(), getStorageConfig());
1,279,980
public void actionPerformed(ActionEvent e) {<NEW_LINE>ExporterUI exporterUI = exportController.<MASK><NEW_LINE>if (exporterUI != null) {<NEW_LINE>JPanel panel = exporterUI.getPanel();<NEW_LINE>exporterUI.setup(selectedExporter);<NEW_LINE>DialogDescriptor dd = new DialogDescriptor(panel, NbBundle.getMessage(VectorialFileExporterUI.class, "VectorialFileExporterUI_optionsDialog_title", selectedBuilder.getName()));<NEW_LINE>TopDialog topDialog = new TopDialog(dialog, dd.getTitle(), dd.isModal(), dd, dd.getClosingOptions(), dd.getButtonListener());<NEW_LINE>topDialog.setVisible(true);<NEW_LINE>Object result = (dd.getValue() != null) ? dd.getValue() : NotifyDescriptor.CLOSED_OPTION;<NEW_LINE>// Object result = DialogDisplayer.getDefault().notify(dd);<NEW_LINE>exporterUI.unsetup(result == NotifyDescriptor.OK_OPTION);<NEW_LINE>}<NEW_LINE>}
getExportController().getUI(selectedExporter);
102,073
final DescribeConfigurationAggregatorSourcesStatusResult executeDescribeConfigurationAggregatorSourcesStatus(DescribeConfigurationAggregatorSourcesStatusRequest describeConfigurationAggregatorSourcesStatusRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeConfigurationAggregatorSourcesStatusRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeConfigurationAggregatorSourcesStatusRequest> request = null;<NEW_LINE>Response<DescribeConfigurationAggregatorSourcesStatusResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribeConfigurationAggregatorSourcesStatusRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeConfigurationAggregatorSourcesStatusRequest));<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, "Config Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeConfigurationAggregatorSourcesStatus");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeConfigurationAggregatorSourcesStatusResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeConfigurationAggregatorSourcesStatusResultJsonUnmarshaller());<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);
880,721
public static void square(int len, int[] x, int xOff, int[] zz, int zzOff) {<NEW_LINE>int extLen = len << 1;<NEW_LINE>int c = 0;<NEW_LINE>int j = len, k = extLen;<NEW_LINE>do {<NEW_LINE>long xVal = (x[xOff + --j] & M);<NEW_LINE>long p = xVal * xVal;<NEW_LINE>zz[zzOff + --k] = (c << 31) | (int) (p >>> 33);<NEW_LINE>zz[zzOff + --k] = (int) (p >>> 1);<NEW_LINE>c = (int) p;<NEW_LINE>} while (j > 0);<NEW_LINE>long d = 0L;<NEW_LINE>int zzPos = zzOff + 2;<NEW_LINE>for (int i = 1; i < len; ++i) {<NEW_LINE>d += squareWordAddTo(x, xOff, i, zz, zzOff) & M;<NEW_LINE><MASK><NEW_LINE>zz[zzPos++] = (int) d;<NEW_LINE>d >>>= 32;<NEW_LINE>d += zz[zzPos] & M;<NEW_LINE>zz[zzPos++] = (int) d;<NEW_LINE>d >>>= 32;<NEW_LINE>}<NEW_LINE>// assert 0L == d;<NEW_LINE>shiftUpBit(extLen, zz, zzOff, x[xOff] << 31);<NEW_LINE>}
d += zz[zzPos] & M;
1,742,656
public void recompile() {<NEW_LINE>TIntIntIterator it = disposalAction.shaderPrograms.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>it.advance();<NEW_LINE>GL20.<MASK><NEW_LINE>}<NEW_LINE>disposalAction.shaderPrograms.clear();<NEW_LINE>uniformLocationMap.clear();<NEW_LINE>bindMap.clear();<NEW_LINE>disposalAction.shaderPrograms.put(0, shader.linkShaderProgram(0));<NEW_LINE>for (Set<ShaderProgramFeature> permutation : Sets.powerSet(shader.getAvailableFeatures())) {<NEW_LINE>int featureMask = ShaderProgramFeature.getBitset(permutation);<NEW_LINE>disposalAction.shaderPrograms.put(featureMask, shader.linkShaderProgram(featureMask));<NEW_LINE>}<NEW_LINE>// resolves #966<NEW_LINE>// Some of the uniforms are not updated constantly between frames<NEW_LINE>// this function will rebind any uniforms that are not bound<NEW_LINE>rebindVariables(materialData);<NEW_LINE>}
glDeleteProgram(it.value());
1,280,598
public static ListMcubeMiniTasksResponse unmarshall(ListMcubeMiniTasksResponse listMcubeMiniTasksResponse, UnmarshallerContext _ctx) {<NEW_LINE>listMcubeMiniTasksResponse.setRequestId(_ctx.stringValue("ListMcubeMiniTasksResponse.RequestId"));<NEW_LINE>listMcubeMiniTasksResponse.setResultMessage(_ctx.stringValue("ListMcubeMiniTasksResponse.ResultMessage"));<NEW_LINE>listMcubeMiniTasksResponse.setResultCode(_ctx.stringValue("ListMcubeMiniTasksResponse.ResultCode"));<NEW_LINE>ListMiniTaskResult listMiniTaskResult = new ListMiniTaskResult();<NEW_LINE>listMiniTaskResult.setSuccess(_ctx.booleanValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.Success"));<NEW_LINE>listMiniTaskResult.setResultMsg(_ctx.stringValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.ResultMsg"));<NEW_LINE>List<MiniTaskListItem> miniTaskList = new ArrayList<MiniTaskListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList.Length"); i++) {<NEW_LINE>MiniTaskListItem miniTaskListItem = new MiniTaskListItem();<NEW_LINE>miniTaskListItem.setStatus(_ctx.stringValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].Status"));<NEW_LINE>miniTaskListItem.setPublishMode(_ctx.longValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].PublishMode"));<NEW_LINE>miniTaskListItem.setAppCode(_ctx.stringValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].AppCode"));<NEW_LINE>miniTaskListItem.setMemo(_ctx.stringValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].Memo"));<NEW_LINE>miniTaskListItem.setGreyEndtime(_ctx.stringValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].GreyEndtime"));<NEW_LINE>miniTaskListItem.setGreyNum(_ctx.longValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].GreyNum"));<NEW_LINE>miniTaskListItem.setGreyConfigInfo(_ctx.stringValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].GreyConfigInfo"));<NEW_LINE>miniTaskListItem.setGmtModified(_ctx.stringValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].GmtModified"));<NEW_LINE>miniTaskListItem.setProductVersion(_ctx.stringValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].ProductVersion"));<NEW_LINE>miniTaskListItem.setGreyEndtimeData(_ctx.stringValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].GreyEndtimeData"));<NEW_LINE>miniTaskListItem.setPublishType(_ctx.longValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].PublishType"));<NEW_LINE>miniTaskListItem.setTaskStatus(_ctx.longValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].TaskStatus"));<NEW_LINE>miniTaskListItem.setWhitelistIds(_ctx.stringValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].WhitelistIds"));<NEW_LINE>miniTaskListItem.setPlatform(_ctx.stringValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].Platform"));<NEW_LINE>miniTaskListItem.setGmtCreate(_ctx.stringValue<MASK><NEW_LINE>miniTaskListItem.setPackageId(_ctx.longValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].PackageId"));<NEW_LINE>miniTaskListItem.setId(_ctx.longValue("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].Id"));<NEW_LINE>miniTaskList.add(miniTaskListItem);<NEW_LINE>}<NEW_LINE>listMiniTaskResult.setMiniTaskList(miniTaskList);<NEW_LINE>listMcubeMiniTasksResponse.setListMiniTaskResult(listMiniTaskResult);<NEW_LINE>return listMcubeMiniTasksResponse;<NEW_LINE>}
("ListMcubeMiniTasksResponse.ListMiniTaskResult.MiniTaskList[" + i + "].GmtCreate"));
555,620
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = new String[] { "sumb" };<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>// create window<NEW_LINE>String stmtTextCreate = namedWindow ? "@name('create') @public create window MyInfraSA#keepall as select theString as a, intPrimitive as b from SupportBean" : "@name('create') @public create table MyInfraSA (a string primary key, b int primary key)";<NEW_LINE>env.compileDeploy(stmtTextCreate, path);<NEW_LINE>// create select stmt<NEW_LINE>String stmtTextSelect = "@name('select') on SupportBean_A select sum(b) as sumb from MyInfraSA";<NEW_LINE>env.compileDeploy(stmtTextSelect, path).addListener("select");<NEW_LINE>// create insert into<NEW_LINE>String stmtTextInsertOne = "insert into MyInfraSA select theString as a, intPrimitive as b from SupportBean";<NEW_LINE>env.compileDeploy(stmtTextInsertOne, path);<NEW_LINE>// send 3 event<NEW_LINE>sendSupportBean(env, "E1", 1);<NEW_LINE>sendSupportBean(env, "E2", 2);<NEW_LINE>sendSupportBean(env, "E3", 3);<NEW_LINE>env.assertListenerNotInvoked("select");<NEW_LINE>env.milestone(0);<NEW_LINE>// fire trigger<NEW_LINE>sendSupportBean_A(env, "A1");<NEW_LINE>env.assertPropsNew("select", fields, new Object[] { 6 });<NEW_LINE>// create delete stmt<NEW_LINE>String stmtTextDelete = "on SupportBean_B delete from MyInfraSA where id = a";<NEW_LINE>env.compileDeploy(stmtTextDelete, path);<NEW_LINE>// Delete E2<NEW_LINE>sendSupportBean_B(env, "E2");<NEW_LINE>env.milestone(1);<NEW_LINE>// fire trigger<NEW_LINE>sendSupportBean_A(env, "A2");<NEW_LINE>env.assertPropsNew("select", fields, <MASK><NEW_LINE>sendSupportBean(env, "E4", 10);<NEW_LINE>sendSupportBean_A(env, "A3");<NEW_LINE>env.assertPropsNew("select", fields, new Object[] { 14 });<NEW_LINE>env.assertStatement("select", statement -> {<NEW_LINE>EventType resultType = statement.getEventType();<NEW_LINE>assertEquals(1, resultType.getPropertyNames().length);<NEW_LINE>assertEquals(Integer.class, resultType.getPropertyType("sumb"));<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
new Object[] { 4 });
1,653,960
public static String splitJVMParams(String line, boolean newLines) {<NEW_LINE>PropertySplitter ps = new PropertySplitter(line);<NEW_LINE>// NOI18N<NEW_LINE>ps.setSeparator(' ');<NEW_LINE><MASK><NEW_LINE>// NOI18N<NEW_LINE>String jvms = "";<NEW_LINE>while (s != null) {<NEW_LINE>if (s.startsWith("-") || /* #199411 */<NEW_LINE>s.startsWith("\"-") || s.contains("%classpath")) {<NEW_LINE>// NOI18N<NEW_LINE>if (s.contains("%classpath")) {<NEW_LINE>jvms = jvms + " " + s;<NEW_LINE>} else {<NEW_LINE>jvms = jvms + (jvms.isEmpty() ? "" : (newLines ? "\n" : " ")) + s;<NEW_LINE>}<NEW_LINE>} else if (s.equals(PACKAGE_CLASS_NAME_TOKEN) || s.equals(RUN_MAIN_CLASS_TOKEN) || s.matches("[\\w]+[\\.]{0,1}[\\w\\.]*")) {<NEW_LINE>// NOI18N<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>jvms = jvms + " " + s;<NEW_LINE>}<NEW_LINE>s = ps.nextPair();<NEW_LINE>}<NEW_LINE>return jvms.trim();<NEW_LINE>}
String s = ps.nextPair();
306,495
private TreeNode convertClassDeclaration(ClassTree node, TreePath parent) {<NEW_LINE>TreePath path = getTreePath(parent, node);<NEW_LINE>TypeElement element = (TypeElement) getElement(path);<NEW_LINE>// javac defines all type declarations with JCClassDecl, so differentiate here<NEW_LINE>// to support our different declaration nodes.<NEW_LINE>if (element.getKind() == ElementKind.ANNOTATION_TYPE) {<NEW_LINE>throw new AssertionError("Annotation type declaration tree conversion not implemented");<NEW_LINE>}<NEW_LINE>TypeDeclaration newNode = convertClassDeclarationHelper(node, parent);<NEW_LINE>newNode.setInterface(node.getKind() == Kind.INTERFACE || node.getKind() == Kind.ANNOTATION_TYPE);<NEW_LINE>if (ElementUtil.isAnonymous(element)) {<NEW_LINE>TypeMirror classType = getTypeMirror(path);<NEW_LINE>if (!classType.getAnnotationMirrors().isEmpty()) {<NEW_LINE>newUnit.getEnv().elementUtil().mapElementType(element, classType);<NEW_LINE>} else {<NEW_LINE>// With javac 12 and above, annotations are no longer part of the supertype,<NEW_LINE>// so check to see if a mutated type that has them is necessary.<NEW_LINE>GeneratedTypeElement newElement = GeneratedTypeElement.mutableCopy(element);<NEW_LINE>boolean annotationFound = copyAnnotations(node.getExtendsClause(), path, newNode, newElement);<NEW_LINE>for (Tree clause : node.getImplementsClause()) {<NEW_LINE>annotationFound |= copyAnnotations(<MASK><NEW_LINE>}<NEW_LINE>if (annotationFound) {<NEW_LINE>newUnit.getEnv().elementUtil().mapElementType(element, newElement.asType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newNode;<NEW_LINE>}
clause, path, newNode, newElement);
1,387,871
private static Request prepareDeleteByQueryRequest(DeleteByQueryRequest deleteByQueryRequest, boolean waitForCompletion) throws IOException {<NEW_LINE>String endpoint = endpoint(deleteByQueryRequest.indices(), "_delete_by_query");<NEW_LINE>Request request = new Request(HttpPost.METHOD_NAME, endpoint);<NEW_LINE>Params params = new Params().withRouting(deleteByQueryRequest.getRouting()).withRefresh(deleteByQueryRequest.isRefresh()).withTimeout(deleteByQueryRequest.getTimeout()).withWaitForActiveShards(deleteByQueryRequest.getWaitForActiveShards()).withRequestsPerSecond(deleteByQueryRequest.getRequestsPerSecond()).withIndicesOptions(deleteByQueryRequest.indicesOptions()).withWaitForCompletion(waitForCompletion).withSlices(deleteByQueryRequest.getSlices());<NEW_LINE>if (deleteByQueryRequest.isAbortOnVersionConflict() == false) {<NEW_LINE>params.putParam("conflicts", "proceed");<NEW_LINE>}<NEW_LINE>if (deleteByQueryRequest.getBatchSize() != AbstractBulkByScrollRequest.DEFAULT_SCROLL_SIZE) {<NEW_LINE>params.putParam("scroll_size", Integer.toString(deleteByQueryRequest.getBatchSize()));<NEW_LINE>}<NEW_LINE>if (deleteByQueryRequest.getScrollTime() != AbstractBulkByScrollRequest.DEFAULT_SCROLL_TIMEOUT) {<NEW_LINE>params.putParam("scroll", deleteByQueryRequest.getScrollTime());<NEW_LINE>}<NEW_LINE>if (deleteByQueryRequest.getMaxDocs() > 0) {<NEW_LINE>params.putParam("max_docs", Integer.toString(deleteByQueryRequest.getMaxDocs()));<NEW_LINE>}<NEW_LINE>request.addParameters(params.asMap());<NEW_LINE>request.setEntity<MASK><NEW_LINE>return request;<NEW_LINE>}
(createEntity(deleteByQueryRequest, REQUEST_BODY_CONTENT_TYPE));
1,395,362
protected void process(RelationshipGroupRecord[] batch, BatchSender sender, CursorContext cursorContext) {<NEW_LINE>int groupStartIndex = 0;<NEW_LINE>for (int i = 0; i < batch.length; i++) {<NEW_LINE>RelationshipGroupRecord group = batch[i];<NEW_LINE>// The iterator over the groups will not produce real next pointers, they are instead<NEW_LINE>// a count meaning how many groups come after it. This encoder will set the real group ids.<NEW_LINE>long count = group.getNext();<NEW_LINE>boolean lastInChain = count == 0;<NEW_LINE>group.setId(nextId == -1 ? nextId = store.nextId(cursorContext) : nextId);<NEW_LINE>if (!lastInChain) {<NEW_LINE>group.setNext(nextId <MASK><NEW_LINE>} else {<NEW_LINE>group.setNext(nextId = -1);<NEW_LINE>// OK so this group is the last in this chain, which means all the groups in this chain<NEW_LINE>// are now fully populated. We can now prepare these groups so that their potential<NEW_LINE>// secondary units ends up very close by.<NEW_LINE>for (int j = groupStartIndex; j <= i; j++) {<NEW_LINE>store.prepareForCommit(batch[j], cursorContext);<NEW_LINE>}<NEW_LINE>groupStartIndex = i + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assert groupStartIndex == batch.length;<NEW_LINE>sender.send(batch);<NEW_LINE>}
= store.nextId(cursorContext));
1,143,232
public PCollection<Row> expand(PCollectionList<Row> inputs) {<NEW_LINE>checkArgument(inputs.size() == 2, "Wrong number of arguments to %s: %s", beamRelNode.getClass().getSimpleName(), inputs);<NEW_LINE>PCollection<Row> leftRows = inputs.get(0);<NEW_LINE>PCollection<Row> rightRows = inputs.get(1);<NEW_LINE>WindowFn leftWindow = leftRows.getWindowingStrategy().getWindowFn();<NEW_LINE>WindowFn rightWindow = rightRows.getWindowingStrategy().getWindowFn();<NEW_LINE>if (!leftWindow.isCompatible(rightWindow)) {<NEW_LINE>throw new IllegalArgumentException("inputs of " + opType + " have different window strategy: " + leftWindow + " VS " + rightWindow);<NEW_LINE>}<NEW_LINE>// TODO: We may want to preaggregate the counts first using Group instead of calling CoGroup and<NEW_LINE>// measuring the<NEW_LINE>// iterable size. If on average there are duplicates in the input, this will be faster.<NEW_LINE>final String lhsTag = "lhs";<NEW_LINE>final String rhsTag = "rhs";<NEW_LINE>PCollection<Row> joined = PCollectionTuple.of(lhsTag, leftRows, rhsTag, rightRows).apply("CoGroup", CoGroup.join(By.fieldNames("*")));<NEW_LINE>return joined.apply("FilterResults", ParDo.of(new BeamSetOperatorsTransforms.SetOperatorFilteringDoFn(lhsTag, rhsTag, opType, all))).setRowSchema(joined.getSchema().getField("key").<MASK><NEW_LINE>}
getType().getRowSchema());
1,002,643
public void indent(final int sign) {<NEW_LINE>final JEditTextArea textArea = getTextArea();<NEW_LINE>final int startLine = textArea.getSelectionStartLine();<NEW_LINE>final int stopLine = textArea.getSelectionStopLine();<NEW_LINE>final int selectionStart = textArea.getSelectionStart();<NEW_LINE>final int selectionStop = textArea.getSelectionStop();<NEW_LINE>final LineInfo currentLine = new LineInfo(startLine);<NEW_LINE>final int currentCaret = textArea.getCaretPosition();<NEW_LINE>final int startLineEndRelativePos = textArea.getLineStopOffset(startLine) - selectionStart;<NEW_LINE>final int stopLineEndRelativePos = textArea.getLineStopOffset(stopLine) - selectionStop;<NEW_LINE>final int newIndent;<NEW_LINE>if (sign > 0) {<NEW_LINE>// Find previous non-blank non-comment line.<NEW_LINE>LineInfo candidate = null;<NEW_LINE>for (int i = startLine - 1; i >= 0; i--) {<NEW_LINE>candidate = new LineInfo(i);<NEW_LINE>if (candidate.text.length() > 0 && !candidate.text.startsWith("#")) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (candidate == null) {<NEW_LINE>newIndent = 0;<NEW_LINE>} else {<NEW_LINE>final String trimmed = candidate.text.trim();<NEW_LINE>if (trimmed.endsWith(":") || trimmed.endsWith("(")) {<NEW_LINE>newIndent = Math.min(candidate.indent + <MASK><NEW_LINE>} else {<NEW_LINE>newIndent = Math.min(candidate.indent, currentLine.indent + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>newIndent = Math.max(0, currentLine.indent - 1);<NEW_LINE>}<NEW_LINE>final int deltaIndent = newIndent - currentLine.indent;<NEW_LINE>for (int i = startLine; i <= stopLine; i++) {<NEW_LINE>indentLineBy(i, deltaIndent);<NEW_LINE>}<NEW_LINE>textArea.setSelectionStart(getAbsoluteCaretPositionRelativeToLineEnd(startLine, startLineEndRelativePos));<NEW_LINE>textArea.setSelectionEnd(getAbsoluteCaretPositionRelativeToLineEnd(stopLine, stopLineEndRelativePos));<NEW_LINE>}
1, currentLine.indent + 1);
1,825,956
static protected int isSimpleAsFeature(/* const */<NEW_LINE>Geometry geometry, /* const */<NEW_LINE>SpatialReference spatialReference, boolean bForce, NonSimpleResult result, ProgressTracker progressTracker) {<NEW_LINE>if (result != null) {<NEW_LINE>result.m_reason = NonSimpleResult.Reason.NotDetermined;<NEW_LINE>result.m_vertexIndex1 = -1;<NEW_LINE>result.m_vertexIndex2 = -1;<NEW_LINE>}<NEW_LINE>if (geometry.isEmpty())<NEW_LINE>return 1;<NEW_LINE>Geometry.Type gt = geometry.getType();<NEW_LINE>if (gt == Geometry.Type.Point)<NEW_LINE>return 1;<NEW_LINE>double tolerance = InternalUtils.calculateToleranceFromGeometry(spatialReference, geometry, false);<NEW_LINE>if (gt == Geometry.Type.Envelope) {<NEW_LINE>Segment seg = (Segment) geometry;<NEW_LINE>Polyline polyline = new Polyline(seg.getDescription());<NEW_LINE>polyline.addSegment(seg, true);<NEW_LINE>return isSimpleAsFeature(polyline, spatialReference, bForce, result, progressTracker);<NEW_LINE>}<NEW_LINE>// double geomTolerance = 0;<NEW_LINE>int isSimple = ((MultiVertexGeometryImpl) geometry._getImpl()).getIsSimple(tolerance);<NEW_LINE>int knownSimpleResult = bForce ? -1 : isSimple;<NEW_LINE>// TODO: need to distinguish KnownSimple between SimpleAsFeature and<NEW_LINE>// SimplePlanar.<NEW_LINE>// From the first sight it seems the SimplePlanar implies<NEW_LINE>// SimpleAsFeature.<NEW_LINE>if (knownSimpleResult != -1)<NEW_LINE>return knownSimpleResult;<NEW_LINE>OperatorSimplifyLocalHelper helper = new OperatorSimplifyLocalHelper(geometry, spatialReference, knownSimpleResult, progressTracker, false);<NEW_LINE>if (gt == Geometry.Type.MultiPoint) {<NEW_LINE>knownSimpleResult = helper.multiPointIsSimpleAsFeature_();<NEW_LINE>} else if (gt == Geometry.Type.Polyline) {<NEW_LINE>knownSimpleResult = helper.polylineIsSimpleAsFeature_();<NEW_LINE>} else if (gt == Geometry.Type.Polygon) {<NEW_LINE>knownSimpleResult = helper.polygonIsSimpleAsFeature_();<NEW_LINE>} else {<NEW_LINE>// what else?<NEW_LINE>throw GeometryException.GeometryInternalError();<NEW_LINE>}<NEW_LINE>((MultiVertexGeometryImpl) (geometry._getImpl())).<MASK><NEW_LINE>if (result != null && knownSimpleResult == 0)<NEW_LINE>result.Assign(helper.m_nonSimpleResult);<NEW_LINE>return knownSimpleResult;<NEW_LINE>}
setIsSimple(knownSimpleResult, tolerance, false);
1,461,098
protected void onPrepare(@NonNull MediaEncoderEngine.Controller controller, long maxLengthUs) {<NEW_LINE>MediaFormat format = MediaFormat.createVideoFormat(mConfig.mimeType, mConfig.width, mConfig.height);<NEW_LINE>// Failing to specify some of these can cause the MediaCodec configure() call to throw an<NEW_LINE>// unhelpful exception. About COLOR_FormatSurface, see<NEW_LINE>// https://stackoverflow.com/q/28027858/4288782<NEW_LINE>// This just means it is an opaque, implementation-specific format that the device<NEW_LINE>// GPU prefers. So as long as we use the GPU to draw, the format will match what<NEW_LINE>// the encoder expects.<NEW_LINE>format.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);<NEW_LINE>format.setInteger(MediaFormat.KEY_BIT_RATE, mConfig.bitRate);<NEW_LINE>format.setInteger(MediaFormat.KEY_FRAME_RATE, mConfig.frameRate);<NEW_LINE>// seconds between key frames!<NEW_LINE>format.<MASK><NEW_LINE>format.setInteger("rotation-degrees", mConfig.rotation);<NEW_LINE>try {<NEW_LINE>if (mConfig.encoder != null) {<NEW_LINE>mMediaCodec = MediaCodec.createByCodecName(mConfig.encoder);<NEW_LINE>} else {<NEW_LINE>mMediaCodec = MediaCodec.createEncoderByType(mConfig.mimeType);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>mMediaCodec.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);<NEW_LINE>mSurface = mMediaCodec.createInputSurface();<NEW_LINE>mMediaCodec.start();<NEW_LINE>}
setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 1);
157,945
public static long readKeyValueSize(PageCursor cursor, boolean msbIsOffload) {<NEW_LINE><MASK><NEW_LINE>boolean hasTombstone = hasTombstone(firstByte);<NEW_LINE>boolean hasAdditionalKeySize = (firstByte & FLAG_ADDITIONAL_KEY_SIZE) != 0;<NEW_LINE>boolean hasValueSize = (firstByte & FLAG_HAS_VALUE_SIZE) != 0;<NEW_LINE>int keySizeLsb = firstByte & MASK_ONE_BYTE_KEY_SIZE;<NEW_LINE>long keySize;<NEW_LINE>if (hasAdditionalKeySize) {<NEW_LINE>byte secondByte = cursor.getByte();<NEW_LINE>if (msbIsOffload && hasOffload(secondByte)) {<NEW_LINE>return (hasTombstone ? FLAG_READ_TOMBSTONE : 0) | FLAG_READ_OFFLOAD;<NEW_LINE>}<NEW_LINE>int keySizeMsb = secondByte & 0xFF;<NEW_LINE>keySize = (keySizeMsb << SHIFT_LSB_KEY_SIZE) | keySizeLsb;<NEW_LINE>} else {<NEW_LINE>keySize = keySizeLsb;<NEW_LINE>}<NEW_LINE>long valueSize;<NEW_LINE>if (hasValueSize) {<NEW_LINE>byte firstValueByte = cursor.getByte();<NEW_LINE>int valueSizeLsb = firstValueByte & MASK_ONE_BYTE_VALUE_SIZE;<NEW_LINE>boolean hasAdditionalValueSize = (firstValueByte & FLAG_ADDITIONAL_VALUE_SIZE) != 0;<NEW_LINE>if (hasAdditionalValueSize) {<NEW_LINE>int valueSizeMsb = cursor.getByte() & 0xFF;<NEW_LINE>valueSize = (valueSizeMsb << SHIFT_LSB_VALUE_SIZE) | valueSizeLsb;<NEW_LINE>} else {<NEW_LINE>valueSize = valueSizeLsb;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>valueSize = 0;<NEW_LINE>}<NEW_LINE>return (hasTombstone ? FLAG_READ_TOMBSTONE : 0) | (keySize << Integer.SIZE) | valueSize;<NEW_LINE>}
byte firstByte = cursor.getByte();
1,415,784
public void configure(ConfigurableProvider provider) {<NEW_LINE>provider.addAlgorithm("MessageDigest.BLAKE2S-256", PREFIX + "$Blake2s256");<NEW_LINE>provider.addAlgorithm("Alg.Alias.MessageDigest." + MiscObjectIdentifiers.id_blake2s256, "BLAKE2S-256");<NEW_LINE>provider.addAlgorithm("MessageDigest.BLAKE2S-224", PREFIX + "$Blake2s224");<NEW_LINE>provider.addAlgorithm("Alg.Alias.MessageDigest." + MiscObjectIdentifiers.id_blake2s224, "BLAKE2S-224");<NEW_LINE>provider.addAlgorithm("MessageDigest.BLAKE2S-160", PREFIX + "$Blake2s160");<NEW_LINE>provider.addAlgorithm("Alg.Alias.MessageDigest." + MiscObjectIdentifiers.id_blake2s160, "BLAKE2S-160");<NEW_LINE>provider.addAlgorithm("MessageDigest.BLAKE2S-128", PREFIX + "$Blake2s128");<NEW_LINE>provider.addAlgorithm(<MASK><NEW_LINE>}
"Alg.Alias.MessageDigest." + MiscObjectIdentifiers.id_blake2s128, "BLAKE2S-128");
737,581
public DeleteBackendStorageResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteBackendStorageResult deleteBackendStorageResult = new DeleteBackendStorageResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return deleteBackendStorageResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("appId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteBackendStorageResult.setAppId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("backendEnvironmentName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteBackendStorageResult.setBackendEnvironmentName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("jobId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteBackendStorageResult.setJobId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteBackendStorageResult.setStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return deleteBackendStorageResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,137,482
protected final synchronized // tzezula: should set CHANGE_EXPECTED flag on the sources.<NEW_LINE>void schedule(final Source source, final SchedulerEvent event) {<NEW_LINE>if (task != null) {<NEW_LINE>task.cancel();<NEW_LINE>}<NEW_LINE>task = null;<NEW_LINE>if (requestProcessor == null) {<NEW_LINE>requestProcessor = new RequestProcessor(Scheduler.class.getName(), 1, false, false);<NEW_LINE>}<NEW_LINE>boolean different = this.source != source;<NEW_LINE>if (different) {<NEW_LINE>if (this.source != null) {<NEW_LINE>final SourceCache cache = SourceAccessor.getINSTANCE(<MASK><NEW_LINE>cache.unscheduleTasks(Scheduler.this.getClass());<NEW_LINE>SourceAccessor.getINSTANCE().attachScheduler(this.source, ctrl, false);<NEW_LINE>}<NEW_LINE>this.source = source;<NEW_LINE>}<NEW_LINE>if (source == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (different) {<NEW_LINE>SourceAccessor.getINSTANCE().attachScheduler(source, ctrl, true);<NEW_LINE>}<NEW_LINE>task = requestProcessor.create(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>SourceCache cache = SourceAccessor.getINSTANCE().getCache(source);<NEW_LINE>SourceAccessor.getINSTANCE().setSchedulerEvent(source, Scheduler.this, event);<NEW_LINE>// S ystem.out.println ("\nSchedule tasks (" + Scheduler.this + "):");<NEW_LINE>LOG.fine("Scheduling tasks for :" + source + " and scheduler " + this);<NEW_LINE>cache.scheduleTasks(Scheduler.this.getClass());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>task.schedule(reparseDelay);<NEW_LINE>}
).getCache(this.source);
666,135
public static void main(String[] args) {<NEW_LINE>JbootApplication.setBootArg("jboot.datasource.url", "jdbc:mysql://127.0.0.1:3306/jbootdemo");<NEW_LINE>JbootApplication.setBootArg("jboot.datasource.user", "root");<NEW_LINE>String modelPackage = "io.jboot.codegen.test";<NEW_LINE>String baseModelPackage = modelPackage + ".base";<NEW_LINE>String modelDir = CodeGenHelpler.getUserDir() + "/src/main/java/" + modelPackage.replace(".", "/");<NEW_LINE>String baseModelDir = CodeGenHelpler.getUserDir() + "/src/main/java/" + baseModelPackage.replace(".", "/");<NEW_LINE><MASK><NEW_LINE>System.out.println("generate dir:" + modelDir);<NEW_LINE>new JbootBaseModelGenerator(baseModelPackage, baseModelDir).generate();<NEW_LINE>new JbootModelGenerator(modelPackage, baseModelPackage, modelDir).generate();<NEW_LINE>}
System.out.println("start generate...");
426,586
public EC2AssociateRouteTableAction unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>EC2AssociateRouteTableAction eC2AssociateRouteTableAction = new EC2AssociateRouteTableAction();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Description", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>eC2AssociateRouteTableAction.setDescription(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("RouteTableId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>eC2AssociateRouteTableAction.setRouteTableId(ActionTargetJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("SubnetId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>eC2AssociateRouteTableAction.setSubnetId(ActionTargetJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("GatewayId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>eC2AssociateRouteTableAction.setGatewayId(ActionTargetJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return eC2AssociateRouteTableAction;<NEW_LINE>}
class).unmarshall(context));
493,135
boolean yolov4(String model_config_path, String filename) {<NEW_LINE>// https://deeplearning4j.konduit.ai/<NEW_LINE>int height = 608;<NEW_LINE>int width = 608;<NEW_LINE>int channels = 3;<NEW_LINE>NativeImageLoader loader = new NativeImageLoader(height, width, channels);<NEW_LINE>INDArray BGRimage = null;<NEW_LINE>try {<NEW_LINE>BGRimage = loader.asMatrix(new File(filename));<NEW_LINE>} catch (java.io.IOException e) {<NEW_LINE>System.out.println("load image fail.");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// shape: (channels, height, width)<NEW_LINE>BGRimage = BGRimage.reshape(channels, height, width);<NEW_LINE>INDArray RGBimage = Nd4j.create(BGRimage.shape());<NEW_LINE>// BGR2RGB<NEW_LINE>CustomOp op = DynamicCustomOp.builder("reverse").addInputs(BGRimage).addOutputs(RGBimage).<MASK><NEW_LINE>Nd4j.getExecutioner().exec(op);<NEW_LINE>// Div(255.0)<NEW_LINE>INDArray image = RGBimage.divi(255.0);<NEW_LINE>long[] batch_shape = { 1, image.shape()[0], image.shape()[1], image.shape()[2] };<NEW_LINE>INDArray batch_image = image.reshape(batch_shape);<NEW_LINE>INDArray im_size = Nd4j.createFromArray(new int[] { height, width });<NEW_LINE>long[] batch_size_shape = { 1, 2 };<NEW_LINE>INDArray batch_im_size = im_size.reshape(batch_size_shape);<NEW_LINE>HashMap<String, Object> feed_data = new HashMap<String, Object>() {<NEW_LINE><NEW_LINE>{<NEW_LINE>put("image", batch_image);<NEW_LINE>put("im_size", batch_im_size);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>List<String> fetch = Arrays.asList("save_infer_model/scale_0.tmp_0");<NEW_LINE>Client client = new Client();<NEW_LINE>client.setIP("127.0.0.1");<NEW_LINE>client.setPort("9393");<NEW_LINE>client.loadClientConfig(model_config_path);<NEW_LINE>String result = client.predict(feed_data, fetch, true, 0);<NEW_LINE>System.out.println(result);<NEW_LINE>return true;<NEW_LINE>}
addIntegerArguments(0).build();
1,795,749
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 7));<NEW_LINE>if (cards.isEmpty()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>TargetCard target = new TargetCard(Zone.LIBRARY, filter);<NEW_LINE>target.setNotTarget(true);<NEW_LINE>controller.choose(Outcome.PutCreatureInPlay, cards, target, game);<NEW_LINE>Card card = cards.get(target.getFirstTarget(), game);<NEW_LINE>if (card == null) {<NEW_LINE>controller.putCardsOnBottomOfLibrary(cards, game, source, false);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {<NEW_LINE>cards.remove(card);<NEW_LINE>}<NEW_LINE>Permanent permanent = game.getPermanent(card.getId());<NEW_LINE>if (permanent == null) {<NEW_LINE>controller.putCardsOnBottomOfLibrary(cards, game, source, false);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new ViviensInvocationDamageEffect(new MageObjectReference(permanent, game)), false, "it deals damage equals to its power to target creature an opponent controls");<NEW_LINE>ability<MASK><NEW_LINE>game.fireReflexiveTriggeredAbility(ability, source);<NEW_LINE>controller.putCardsOnBottomOfLibrary(cards, game, source, false);<NEW_LINE>return true;<NEW_LINE>}
.addTarget(new TargetOpponentsCreaturePermanent());
783,535
private List<Point2D> routeLoopEdge(Vertex2d start, Vertex2d end, double x) {<NEW_LINE>// going backwards<NEW_LINE>List<Point2D> articulations = new ArrayList<>();<NEW_LINE>int startRow = start.rowIndex;<NEW_LINE>int endRow = end.rowIndex;<NEW_LINE>if (startRow > endRow) {<NEW_LINE>// going upwards<NEW_LINE>endRow = start.rowIndex;<NEW_LINE>startRow = end.rowIndex;<NEW_LINE>}<NEW_LINE>int delta = endRow - startRow;<NEW_LINE>// adding the delta makes overlap less likely<NEW_LINE>x += delta;<NEW_LINE>Point2D startVertexPoint = start.center;<NEW_LINE>double y1 = startVertexPoint.getY();<NEW_LINE>Point2D first = new <MASK><NEW_LINE>articulations.add(first);<NEW_LINE>// loop second point - same y coord as destination;<NEW_LINE>// x is the col after the outermost dominated vertex<NEW_LINE>Point2D endVertexPoint = end.center;<NEW_LINE>double y2 = endVertexPoint.getY();<NEW_LINE>Point2D second = new Point2D.Double(x, y2);<NEW_LINE>articulations.add(second);<NEW_LINE>return articulations;<NEW_LINE>}
Point2D.Double(x, y1);
930,789
private void handleOverlappingFunctionsConflict(ListingMergePanel listingPanel, Address addr, int currentConflictOption, TaskMonitor monitor) throws CancelledException {<NEW_LINE>currentConflictType = FunctionConflictType.FUNCTION_OVERLAP_CONFLICT;<NEW_LINE>boolean askUser = (overlapChoice == ASK_USER) && currentConflictOption == ListingMergeConstants.ASK_USER;<NEW_LINE>if (askUser && mergeManager != null) {<NEW_LINE>VariousChoicesPanel choicesPanel = createOverlapConflictPanel(addr, monitor);<NEW_LINE>boolean useForAll = (overlapChoice != ASK_USER);<NEW_LINE>choicesPanel.setUseForAll(useForAll);<NEW_LINE>choicesPanel.setConflictType("Function Overlap");<NEW_LINE>setupAddressSetConflictPanel(listingPanel, choicesPanel, addr, overlapConflicts<MASK><NEW_LINE>monitor.checkCanceled();<NEW_LINE>} else {<NEW_LINE>// If we have a function overlap choice then a "Use For All" has already occurred.<NEW_LINE>int optionToUse = (overlapChoice == ASK_USER) ? currentConflictOption : overlapChoice;<NEW_LINE>mergeOverlap(addr, optionToUse, monitor);<NEW_LINE>}<NEW_LINE>}
.get(addr), monitor);
579,244
protected void doRefresh() {<NEW_LINE>try {<NEW_LINE>reference.refresh(api);<NEW_LINE>} catch (NessieNotFoundException e) {<NEW_LINE>throw new RuntimeException("Failed to refresh as ref is no longer valid.", e);<NEW_LINE>}<NEW_LINE>String metadataLocation = null;<NEW_LINE>try {<NEW_LINE>Content content = api.getContent().key(key).reference(reference.getReference()).get().get(key);<NEW_LINE>LOG.debug("Content '{}' at '{}': {}", key, reference.getReference(), content);<NEW_LINE>if (content == null) {<NEW_LINE>if (currentMetadataLocation() != null) {<NEW_LINE>throw new NoSuchTableException("No such table %s in %s", key, reference.getReference());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.table = content.unwrap(IcebergTable.class).orElseThrow(() -> new IllegalStateException("Cannot refresh iceberg table: " + String.<MASK><NEW_LINE>metadataLocation = table.getMetadataLocation();<NEW_LINE>}<NEW_LINE>} catch (NessieNotFoundException ex) {<NEW_LINE>if (currentMetadataLocation() != null) {<NEW_LINE>throw new NoSuchTableException(ex, "No such table %s", key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>refreshFromMetadataLocation(metadataLocation, 2);<NEW_LINE>}
format("Nessie points to a non-Iceberg object for path: %s.", key)));
717,150
final UpdateResourceSetResult executeUpdateResourceSet(UpdateResourceSetRequest updateResourceSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateResourceSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UpdateResourceSetRequest> request = null;<NEW_LINE>Response<UpdateResourceSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateResourceSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateResourceSetRequest));<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, "Route53 Recovery Readiness");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateResourceSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateResourceSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateResourceSetResultJsonUnmarshaller());<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.ClientExecuteTime);
1,823,238
private void addPrefetchAttribute(Attribute attribute, SDField field, Schema schema) {<NEW_LINE>if (attribute.getPrefetchValue() == null) {<NEW_LINE>// Prefetch by default - unless any summary makes this dynamic<NEW_LINE>// Check if there is an implicit dynamic definition<NEW_LINE>SummaryField fieldSummaryField = field.getSummaryField(attribute.getName());<NEW_LINE>if (fieldSummaryField != null && fieldSummaryField.getTransform().isDynamic())<NEW_LINE>return;<NEW_LINE>// Check if an explicit class makes it dynamic (first is enough, as all must be the same, checked later)<NEW_LINE>SummaryField explicitSummaryField = schema.getExplicitSummaryField(attribute.getName());<NEW_LINE>if (explicitSummaryField != null && explicitSummaryField.getTransform().isDynamic())<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DocumentSummary summary = getOrCreateAttributePrefetchSummary(schema);<NEW_LINE>SummaryField attributeSummaryField = new SummaryField(attribute.getName(), attribute.getDataType());<NEW_LINE>attributeSummaryField.<MASK><NEW_LINE>attributeSummaryField.addDestination("attributeprefetch");<NEW_LINE>attributeSummaryField.setTransform(SummaryTransform.ATTRIBUTE);<NEW_LINE>summary.add(attributeSummaryField);<NEW_LINE>}
addSource(attribute.getName());
926,005
public void greet(String name) {<NEW_LINE>logger.info("Will try to greet " + name + " ...");<NEW_LINE>HelloRequest request = HelloRequest.newBuilder().setName(name).build();<NEW_LINE>HelloReply response;<NEW_LINE>SpanBuilder spanBuilder = tracer.spanBuilder("client").setRecordEvents(true).setSampler(Samplers.alwaysSample());<NEW_LINE>try (Scope scope = spanBuilder.startScopedSpan()) {<NEW_LINE>tracer.getCurrentSpan().addAnnotation("Saying Hello to Server.");<NEW_LINE><MASK><NEW_LINE>tracer.getCurrentSpan().addAnnotation("Received response from Server.");<NEW_LINE>} catch (StatusRuntimeException e) {<NEW_LINE>tracer.getCurrentSpan().setStatus(CanonicalCode.valueOf(e.getStatus().getCode().name()).toStatus().withDescription(e.getMessage()));<NEW_LINE>logger.log(Level.WARNING, "RPC failed: {0}", e.getStatus());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>logger.info("Greeting: " + response.getMessage());<NEW_LINE>}
response = blockingStub.sayHello(request);
463,062
protected JXToolBar initToolbar(JXToolBar toolbar) {<NEW_LINE>resizeBtn = UISupport.createToolbarButton(UISupport.createImageIcon("/icon_resize.gif"));<NEW_LINE>resizeBtn.setCursor(new Cursor(Cursor.SE_RESIZE_CURSOR));<NEW_LINE>resizeBtn.setContentAreaFilled(false);<NEW_LINE>resizeBtn.setBorder(null);<NEW_LINE>resizeBtn.setToolTipText("Drag to resize...");<NEW_LINE>resizeBtn.addMouseMotionListener(new MouseMotionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseMoved(MouseEvent e) {<NEW_LINE>// TODO Auto-generated method stub<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseDragged(MouseEvent e) {<NEW_LINE>frame.setSize(frame.getWidth() - mouseX + e.getX(), frame.getHeight() - mouseY + e.getY());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>resizeBtn.addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>public void mousePressed(MouseEvent e) {<NEW_LINE>mouseX = e.getX();<NEW_LINE>mouseY = e.getY();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>toolbar.add(UISupport.createToolbarButton(new SaveXPathAction()), true);<NEW_LINE>toolbar.add(UISupport.createToolbarButton(<MASK><NEW_LINE>toolbar.addGlue();<NEW_LINE>toolbar.add(resizeBtn);<NEW_LINE>toolbar.setFloatable(false);<NEW_LINE>return toolbar;<NEW_LINE>}
new CancelXPathAction()), true);
1,752,491
protected void onPostExecute(Void aVoid) {<NEW_LINE><MASK><NEW_LINE>if (location != null) {<NEW_LINE>Log.d(TAG, String.format("Determined location: latitude %f - longitude %f", location.getLatitude(), location.getLongitude()));<NEW_LINE>new GetCityNameTask().execute(String.valueOf(location.getLatitude()), String.valueOf(location.getLongitude()));<NEW_LINE>} else {<NEW_LINE>Log.e(TAG, "Couldn't determine location. Using last known location.");<NEW_LINE>new GetWeatherTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);<NEW_LINE>new GetLongTermWeatherTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>locationManager.removeUpdates(locationListener);<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>Log.e(TAG, "Couldn't remove location updates. Probably this is an Android (>M) runtime permissions", e);<NEW_LINE>}<NEW_LINE>}
Location location = locationListener.getLocation();
1,512,737
static Mapping gen(Node n1, Node n2, Mapping _mapping, Iso.Mappable mappable, EqualityTest nodeTest) {<NEW_LINE>Mapping mapping = _mapping;<NEW_LINE>Node n1m = mapping.map(n1);<NEW_LINE>if (n1m != null) {<NEW_LINE>// Already mapped<NEW_LINE>if (n1m.equals(n2))<NEW_LINE>// Exact equals after mapping t1 slot.<NEW_LINE>return mapping;<NEW_LINE>// No match.<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (n1.isNodeTriple()) {<NEW_LINE>if (n2.isNodeTriple()) {<NEW_LINE>Triple t1 = n1.getTriple();<NEW_LINE>Triple t2 = n2.getTriple();<NEW_LINE>Tuple<Node> tuple1 = tripleToTuple.apply(t1);<NEW_LINE>Tuple<Node> tuple2 = tripleToTuple.apply(t2);<NEW_LINE>// Whether to records the triple term mapping.<NEW_LINE>return gen(tuple1, tuple2, mapping, mappable, nodeTest);<NEW_LINE>}<NEW_LINE>} else if (n2.isNodeTriple()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Map an atomic term (not triple term)<NEW_LINE>if (mappable.mappable(n1, n2)) {<NEW_LINE>if (mapping.reverseMapped(n2)) {<NEW_LINE>// Already a target.<NEW_LINE>// but not the same (else n1m != null)<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// **** If n2 not already mapped.<NEW_LINE>mapping = new <MASK><NEW_LINE>return mapping;<NEW_LINE>}<NEW_LINE>if (!nodeTest.equal(n1, n2))<NEW_LINE>// No isomorphism.<NEW_LINE>return null;<NEW_LINE>return mapping;<NEW_LINE>}
Mapping(mapping, n1, n2);
1,706,482
public DetectorModelDefinition unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DetectorModelDefinition detectorModelDefinition = new DetectorModelDefinition();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("states", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>detectorModelDefinition.setStates(new ListUnmarshaller<State>(StateJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("initialStateName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>detectorModelDefinition.setInitialStateName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return detectorModelDefinition;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
577,099
private void init() {<NEW_LINE>dataBlockCount = table.getDataBlockCount();<NEW_LINE>if (fields == null) {<NEW_LINE>fields = table.getColNames();<NEW_LINE>}<NEW_LINE>rowReader = table.getRowReader(true);<NEW_LINE>rowDataReader = new ObjectReader(rowReader, table.groupTable.getBlockSize() - GroupTable.POS_SIZE);<NEW_LINE>segmentReader = table.getSegmentObjectReader();<NEW_LINE>blockSize = table.groupTable.getBlockSize() - GroupTable.POS_SIZE;<NEW_LINE>isPrimaryTable = table.parent == null;<NEW_LINE>int len = this.fields.length;<NEW_LINE>String[] fields;<NEW_LINE>if (isPrimaryTable) {<NEW_LINE>len += 2;<NEW_LINE>fields = Arrays.copyOf(this.fields, len);<NEW_LINE>fields[len - 2] = SEQ_FIELDNAME;<NEW_LINE>fields[len - 1] = POS_FIELDNAME;<NEW_LINE>} else {<NEW_LINE>len += 3;<NEW_LINE>fields = Arrays.copyOf(this.fields, len);<NEW_LINE>fields[len - 3] = SEQ_FIELDNAME;<NEW_LINE>fields[len - 2] = POS_FIELDNAME + 0;<NEW_LINE>fields[len - 1] = POS_FIELDNAME + 1;<NEW_LINE>}<NEW_LINE>ds = new DataStruct(fields);<NEW_LINE>if (!isPrimaryTable) {<NEW_LINE>String[] field = Arrays.copyOf(table.parent.getSortedColNames(), 1);<NEW_LINE>parentCursor = new RTableCursor(table.parent, field, ctx, null);<NEW_LINE>Sequence pkeyData = parentCursor.fetch(1);<NEW_LINE>curPkey = (Record) pkeyData.get(1);<NEW_LINE>pseq = (<MASK><NEW_LINE>}<NEW_LINE>int colCount = this.fields.length;<NEW_LINE>String[] fullFields = table.getAllColNames();<NEW_LINE>fieldsIndex = new int[colCount];<NEW_LINE>needRead = new boolean[fullFields.length];<NEW_LINE>fullDs = new DataStruct(fullFields);<NEW_LINE>for (int i = 0; i < colCount; ++i) {<NEW_LINE>int id = fullDs.getFieldIndex(fields[i]);<NEW_LINE>fieldsIndex[i] = id;<NEW_LINE>if (id >= 0)<NEW_LINE>needRead[id] = true;<NEW_LINE>}<NEW_LINE>if (filter != null) {<NEW_LINE>parseFilter(filter.getHome());<NEW_LINE>}<NEW_LINE>}
Long) curPkey.getNormalFieldValue(1);
908,713
final ListOrganizationPortfolioAccessResult executeListOrganizationPortfolioAccess(ListOrganizationPortfolioAccessRequest listOrganizationPortfolioAccessRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listOrganizationPortfolioAccessRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListOrganizationPortfolioAccessRequest> request = null;<NEW_LINE>Response<ListOrganizationPortfolioAccessResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListOrganizationPortfolioAccessRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listOrganizationPortfolioAccessRequest));<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, "ListOrganizationPortfolioAccess");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListOrganizationPortfolioAccessResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListOrganizationPortfolioAccessResultJsonUnmarshaller());<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, "Service Catalog");
883,267
private void loadNode839() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.AuditHistoryRawModifyDeleteEventType_StartTime, new QualifiedName(0, "StartTime"), new LocalizedText("en", "StartTime"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UtcTime, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.AuditHistoryRawModifyDeleteEventType_StartTime, Identifiers.HasTypeDefinition, Identifiers.PropertyType<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.AuditHistoryRawModifyDeleteEventType_StartTime, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.AuditHistoryRawModifyDeleteEventType_StartTime, Identifiers.HasProperty, Identifiers.AuditHistoryRawModifyDeleteEventType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
243,158
// This seems way too complicated<NEW_LINE>private void registerNotifyCallback(CallbackContext callbackContext, UUID serviceUUID, UUID characteristicUUID) {<NEW_LINE>if (gatt == null) {<NEW_LINE>callbackContext.error("BluetoothGatt is null");<NEW_LINE>commandCompleted();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean success = false;<NEW_LINE>BluetoothGattService service = gatt.getService(serviceUUID);<NEW_LINE>if (service == null) {<NEW_LINE>callbackContext.error("Service " + serviceUUID + " not found.");<NEW_LINE>commandCompleted();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BluetoothGattCharacteristic characteristic = findNotifyCharacteristic(service, characteristicUUID);<NEW_LINE>if (characteristic == null) {<NEW_LINE>callbackContext.error("Characteristic " + characteristicUUID + " not found.");<NEW_LINE>commandCompleted();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String key = generateHashKey(serviceUUID, characteristic);<NEW_LINE>notificationCallbacks.put(key, new SequentialCallbackContext(callbackContext));<NEW_LINE>if (!gatt.setCharacteristicNotification(characteristic, true)) {<NEW_LINE>callbackContext.error("Failed to register notification for " + characteristicUUID);<NEW_LINE>commandCompleted();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Why doesn't setCharacteristicNotification write the descriptor?<NEW_LINE>BluetoothGattDescriptor descriptor = characteristic.getDescriptor(CLIENT_CHARACTERISTIC_CONFIGURATION_UUID);<NEW_LINE>if (descriptor == null) {<NEW_LINE>callbackContext.error("Set notification failed for " + characteristicUUID);<NEW_LINE>commandCompleted();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// prefer notify over indicate<NEW_LINE>if ((characteristic.getProperties() & BluetoothGattCharacteristic.PROPERTY_NOTIFY) != 0) {<NEW_LINE>descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);<NEW_LINE>} else if ((characteristic.getProperties() & BluetoothGattCharacteristic.PROPERTY_INDICATE) != 0) {<NEW_LINE>descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);<NEW_LINE>} else {<NEW_LINE>LOG.w(TAG, "Characteristic %s does not have NOTIFY or INDICATE property set", characteristicUUID);<NEW_LINE>}<NEW_LINE>if (!gatt.writeDescriptor(descriptor)) {<NEW_LINE><MASK><NEW_LINE>commandCompleted();<NEW_LINE>}<NEW_LINE>}
callbackContext.error("Failed to set client characteristic notification for " + characteristicUUID);
249,778
public static void showCopyMoveConflictDialog(final Activity activity, final String fileName, final String destName, final boolean multiple, final Callback.a1<Integer> callback) {<NEW_LINE>final SearchOrCustomTextDialog.DialogOptions dopt = new SearchOrCustomTextDialog.DialogOptions();<NEW_LINE>baseConf(activity, dopt);<NEW_LINE>dopt.positionCallback = (result) -> callback.callback(result.get(0));<NEW_LINE>final List<String> data = new ArrayList<>();<NEW_LINE>// Order of options here should be synchronized with WrMarkorSingleton._moveOrCopySelected<NEW_LINE>data.add(activity.getString(R.string.keep_both));<NEW_LINE>data.add(activity.getString(R.string.overwrite));<NEW_LINE>data.add(activity.getString(R.string.skip));<NEW_LINE>if (multiple) {<NEW_LINE>data.add(activity.getString<MASK><NEW_LINE>data.add(activity.getString(R.string.overwrite_all));<NEW_LINE>data.add(activity.getString(R.string.skip_all));<NEW_LINE>}<NEW_LINE>dopt.data = data;<NEW_LINE>dopt.isSearchEnabled = false;<NEW_LINE>dopt.dialogWidthDp = WindowManager.LayoutParams.WRAP_CONTENT;<NEW_LINE>dopt.dialogHeightDp = WindowManager.LayoutParams.WRAP_CONTENT;<NEW_LINE>dopt.messageText = activity.getString(R.string.copy_move_conflict_message, fileName, destName);<NEW_LINE>dopt.dialogWidthDp = WindowManager.LayoutParams.WRAP_CONTENT;<NEW_LINE>dopt.dialogHeightDp = WindowManager.LayoutParams.WRAP_CONTENT;<NEW_LINE>SearchOrCustomTextDialog.showMultiChoiceDialogWithSearchFilterUI(activity, dopt);<NEW_LINE>}
(R.string.keep_both_all));
1,491,946
public void marshall(ListDeviceFleetsRequest listDeviceFleetsRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (listDeviceFleetsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(listDeviceFleetsRequest.getNextToken(), NEXTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(listDeviceFleetsRequest.getMaxResults(), MAXRESULTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(listDeviceFleetsRequest.getCreationTimeAfter(), CREATIONTIMEAFTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(listDeviceFleetsRequest.getCreationTimeBefore(), CREATIONTIMEBEFORE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(listDeviceFleetsRequest.getLastModifiedTimeBefore(), LASTMODIFIEDTIMEBEFORE_BINDING);<NEW_LINE>protocolMarshaller.marshall(listDeviceFleetsRequest.getNameContains(), NAMECONTAINS_BINDING);<NEW_LINE>protocolMarshaller.marshall(listDeviceFleetsRequest.getSortBy(), SORTBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(listDeviceFleetsRequest.getSortOrder(), SORTORDER_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
listDeviceFleetsRequest.getLastModifiedTimeAfter(), LASTMODIFIEDTIMEAFTER_BINDING);
1,255,527
public void allocate(Object value, long batchSize) {<NEW_LINE>long newBufferSize = 0;<NEW_LINE>long sizeOfBatch = arrayHeaderSize + batchSize;<NEW_LINE>if (batchSize > 0) {<NEW_LINE>newBufferSize = sizeOfBatch;<NEW_LINE>}<NEW_LINE>if ((batchSize > 0) && (bufferOffset != -1) && (newBufferSize < bytesToAllocate)) {<NEW_LINE>bytesToAllocate = newBufferSize;<NEW_LINE>}<NEW_LINE>if (bufferOffset == -1) {<NEW_LINE>final T hostArray = cast(value);<NEW_LINE>if (batchSize <= 0) {<NEW_LINE>bytesToAllocate = sizeOf(hostArray);<NEW_LINE>} else {<NEW_LINE>bytesToAllocate = sizeOfBatch;<NEW_LINE>}<NEW_LINE>if (bytesToAllocate <= 0) {<NEW_LINE>throw new TornadoMemoryException("[ERROR] Bytes Allocated <= 0: " + bytesToAllocate);<NEW_LINE>}<NEW_LINE>assert hostArray != null;<NEW_LINE>bufferOffset = deviceContext.getMemoryManager().tryAllocate(<MASK><NEW_LINE>if (Tornado.FULL_DEBUG) {<NEW_LINE>info("allocated: array kind=%s, size=%s, length offset=%d, header size=%d, bo=0x%x", kind.getJavaName(), humanReadableByteCount(bytesToAllocate, true), arrayLengthOffset, arrayHeaderSize, bufferOffset);<NEW_LINE>info("allocated: %s", toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
bytesToAllocate, arrayHeaderSize, getAlignment());
46,442
public void onCurrencyChange(final I_C_Payment payment) {<NEW_LINE>final int C_Invoice_ID = payment.getC_Invoice_ID();<NEW_LINE>final int C_Order_ID = payment.getC_Order_ID();<NEW_LINE>// Get Currency Info<NEW_LINE>final CurrencyId currencyId = CurrencyId.ofRepoIdOrNull(payment.getC_Currency_ID());<NEW_LINE>final CurrencyId invoiceCurrencyId = fetchC_Currency_Invoice_ID(payment);<NEW_LINE>final LocalDate convDate = TimeUtil.asLocalDate(payment.getDateTrx());<NEW_LINE>final CurrencyConversionTypeId conversionTypeId = CurrencyConversionTypeId.ofRepoIdOrNull(payment.getC_ConversionType_ID());<NEW_LINE>final ClientId clientId = ClientId.ofRepoId(payment.getAD_Client_ID());<NEW_LINE>final OrgId orgId = OrgId.ofRepoId(payment.getAD_Org_ID());<NEW_LINE>// Get Currency Rate<NEW_LINE>BigDecimal currencyRate = BigDecimal.ONE;<NEW_LINE>if (currencyId != null && invoiceCurrencyId != null && !currencyId.equals(invoiceCurrencyId)) {<NEW_LINE>currencyRate = currencyBL.getCurrencyRate(invoiceCurrencyId, currencyId, convDate, conversionTypeId, clientId, orgId).getConversionRate();<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>BigDecimal DiscountAmt = payment.getDiscountAmt();<NEW_LINE>BigDecimal WriteOffAmt = payment.getWriteOffAmt();<NEW_LINE>BigDecimal OverUnderAmt = payment.getOverUnderAmt();<NEW_LINE>final CurrencyPrecision precision = currencyId != null ? currencyDAO.getStdPrecision(currencyId) : CurrencyPrecision.TWO;<NEW_LINE>PayAmt = precision.round(PayAmt.multiply(currencyRate));<NEW_LINE>payment.setPayAmt(PayAmt);<NEW_LINE>DiscountAmt = precision.round(DiscountAmt.multiply(currencyRate));<NEW_LINE>payment.setDiscountAmt(DiscountAmt);<NEW_LINE>WriteOffAmt = precision.round(WriteOffAmt.multiply(currencyRate));<NEW_LINE>payment.setWriteOffAmt(WriteOffAmt);<NEW_LINE>OverUnderAmt = precision.round(OverUnderAmt.multiply(currencyRate));<NEW_LINE>payment.setOverUnderAmt(OverUnderAmt);<NEW_LINE>// No Invoice or Order - Set Discount, Witeoff, Under/Over to 0<NEW_LINE>if (C_Invoice_ID <= 0 && C_Order_ID <= 0) {<NEW_LINE>if (ZERO.compareTo(DiscountAmt) != 0) {<NEW_LINE>payment.setDiscountAmt(ZERO);<NEW_LINE>}<NEW_LINE>if (ZERO.compareTo(WriteOffAmt) != 0) {<NEW_LINE>payment.setWriteOffAmt(ZERO);<NEW_LINE>}<NEW_LINE>if (ZERO.compareTo(OverUnderAmt) != 0) {<NEW_LINE>payment.setOverUnderAmt(ZERO);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
BigDecimal PayAmt = payment.getPayAmt();
1,368,162
public void reload() {<NEW_LINE>Validate.notNull(item, "Cannot apply settings for a non-existing SlimefunItem");<NEW_LINE>Slimefun.getItemCfg().setDefaultValue(item.getId() + '.' + getKey(), getDefaultValue());<NEW_LINE>Object configuredValue = Slimefun.getItemCfg().getValue(item.getId() + '.' + getKey());<NEW_LINE>if (defaultValue.getClass().isInstance(configuredValue) || (configuredValue instanceof List && defaultValue instanceof List)) {<NEW_LINE>// We can do an unsafe cast here, we did an isInstance(...) check before!<NEW_LINE>T newValue = (T) configuredValue;<NEW_LINE>if (validateInput(newValue)) {<NEW_LINE>this.value = newValue;<NEW_LINE>} else {<NEW_LINE>// @formatter:off<NEW_LINE>item.warn("We have found an invalid config setting in your Items.yml!" + "\n at \"" + item.getId() + "." + getKey() + "\"" + "\n " + configuredValue + " is not a valid input!" + "\n" + getErrorMessage());<NEW_LINE>// @formatter:on<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.value = defaultValue;<NEW_LINE>String found = configuredValue == null ? "null" : configuredValue<MASK><NEW_LINE>// @formatter:off<NEW_LINE>item.warn("We have found an invalid config setting in your Items.yml!" + "\nPlease only use settings that are valid." + "\n at \"" + item.getId() + "." + getKey() + "\"" + "\n Expected \"" + defaultValue.getClass().getSimpleName() + "\" but found: \"" + found + "\"");<NEW_LINE>// @formatter:on<NEW_LINE>}<NEW_LINE>}
.getClass().getSimpleName();
1,433,783
public void userEventTriggered(ChannelHandlerContext ctx, Object event) throws Exception {<NEW_LINE>if (event instanceof ConnectionEventType) {<NEW_LINE>ConnectionEventType eventType = (ConnectionEventType) event;<NEW_LINE>Channel channel = ctx.channel();<NEW_LINE>if (channel == null) {<NEW_LINE>logger.warn("channel null when handle user triggered event in ConnectionEventHandler! eventType: {}", eventType.name());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Connection connection = channel.attr(Connection.CONNECTION).get();<NEW_LINE>if (connection == null) {<NEW_LINE>logger.error("[BUG]connection is null when handle user triggered event in ConnectionEventHandler! eventType: {}", eventType.name());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String remoteAddress = RemotingUtil.<MASK><NEW_LINE>final String localAddress = RemotingUtil.parseLocalAddress(ctx.channel());<NEW_LINE>logger.info("trigger user event, local[{}], remote[{}], event: {}", localAddress, remoteAddress, eventType.name());<NEW_LINE>switch(eventType) {<NEW_LINE>case CONNECT:<NEW_LINE>onEvent(connection, connection.getUrl().getOriginUrl(), ConnectionEventType.CONNECT);<NEW_LINE>break;<NEW_LINE>case CONNECT_FAILED:<NEW_LINE>case CLOSE:<NEW_LINE>case EXCEPTION:<NEW_LINE>submitReconnectTaskIfNecessary(connection.getUrl());<NEW_LINE>onEvent(connection, connection.getUrl().getOriginUrl(), eventType);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>logger.error("[BUG]unknown event: {}", eventType.name());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>super.userEventTriggered(ctx, event);<NEW_LINE>}<NEW_LINE>}
parseRemoteAddress(ctx.channel());
1,614,178
private boolean checkForCacheInvalidity(Path balaPath) {<NEW_LINE>Path nightlyFilePath = balaPath.resolve(ProjectDirConstants.NIGHTLY_BUILD);<NEW_LINE>// Check if the cached module was pulled from a nightly, if not return false<NEW_LINE>if (!Files.exists(nightlyFilePath)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Get modified of the module zip file.<NEW_LINE>Date modifiedDate = new Date(nightlyFilePath.toFile().lastModified());<NEW_LINE>// Set the cache invalidation time as the midnight of today<NEW_LINE>Calendar cal = Calendar.getInstance();<NEW_LINE>cal.<MASK><NEW_LINE>cal.set(Calendar.MINUTE, 0);<NEW_LINE>cal.set(Calendar.SECOND, 0);<NEW_LINE>Date midnightDate = cal.getTime();<NEW_LINE>// If the module was not pulled before the cache invalidation time and if it was pulled on the same day, return<NEW_LINE>// false<NEW_LINE>if (!modifiedDate.before(midnightDate)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// The module cached has been invalidated so clean the directory and pull again.<NEW_LINE>try {<NEW_LINE>// Delete the metadata file<NEW_LINE>deleteFiles(balaPath);<NEW_LINE>// Delete all the empty directories<NEW_LINE>deleteEmptyParentDirs(balaPath, this.getRoot());<NEW_LINE>} catch (IOException ignore) {<NEW_LINE>// An I/O exception occurs when deleting the files inside the downloaded mod. Since<NEW_LINE>// this is done during dependency resolution, we don't throw an exception to the user so instead we<NEW_LINE>// return an empty stream.<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
set(Calendar.HOUR_OF_DAY, 0);
760,906
public static void manipulateKey(CommandType type, OutputStream outputStream, String outFormat, InputStream inputStream, String inFormat, String masterKeyUri, String credentialPath, int keyId) throws GeneralSecurityException, IOException {<NEW_LINE>KeysetManager manager = KeysetManager.withKeysetHandle(getKeysetHandle(inputStream, inFormat, masterKeyUri, credentialPath));<NEW_LINE>switch(type) {<NEW_LINE>case DELETE_KEY:<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case DESTROY_KEY:<NEW_LINE>manager = manager.destroy(keyId);<NEW_LINE>break;<NEW_LINE>case DISABLE_KEY:<NEW_LINE>manager = manager.disable(keyId);<NEW_LINE>break;<NEW_LINE>case ENABLE_KEY:<NEW_LINE>manager = manager.enable(keyId);<NEW_LINE>break;<NEW_LINE>case PROMOTE_KEY:<NEW_LINE>manager = manager.setPrimary(keyId);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new GeneralSecurityException("invalid command");<NEW_LINE>}<NEW_LINE>writeKeyset(manager.getKeysetHandle(), outputStream, outFormat, masterKeyUri, credentialPath);<NEW_LINE>}
manager = manager.delete(keyId);
735,123
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_viewpagertab2);<NEW_LINE>setSupportActionBar((Toolbar) findViewById(R.id.toolbar));<NEW_LINE>ViewCompat.setElevation(findViewById(R.id.header), getResources().getDimension(R.dimen.toolbar_elevation));<NEW_LINE>mToolbarView = findViewById(R.id.toolbar);<NEW_LINE>mPagerAdapter = new NavigationAdapter(getSupportFragmentManager());<NEW_LINE>mPager = (ViewPager) <MASK><NEW_LINE>mPager.setAdapter(mPagerAdapter);<NEW_LINE>// Padding for ViewPager must be set outside the ViewPager itself<NEW_LINE>// because with padding, EdgeEffect of ViewPager become strange.<NEW_LINE>final int tabHeight = getResources().getDimensionPixelSize(R.dimen.tab_height);<NEW_LINE>findViewById(R.id.pager_wrapper).setPadding(0, getActionBarSize() + tabHeight, 0, 0);<NEW_LINE>SlidingTabLayout slidingTabLayout = (SlidingTabLayout) findViewById(R.id.sliding_tabs);<NEW_LINE>slidingTabLayout.setCustomTabView(R.layout.tab_indicator, android.R.id.text1);<NEW_LINE>slidingTabLayout.setSelectedIndicatorColors(getResources().getColor(R.color.accent));<NEW_LINE>slidingTabLayout.setDistributeEvenly(true);<NEW_LINE>slidingTabLayout.setViewPager(mPager);<NEW_LINE>ViewConfiguration vc = ViewConfiguration.get(this);<NEW_LINE>mSlop = vc.getScaledTouchSlop();<NEW_LINE>mInterceptionLayout = (TouchInterceptionFrameLayout) findViewById(R.id.container);<NEW_LINE>mInterceptionLayout.setScrollInterceptionListener(mInterceptionListener);<NEW_LINE>}
findViewById(R.id.pager);
605,837
private void shutdown() {<NEW_LINE>logger.fine("AMX Startup Service: Shutting down AMX MBeans");<NEW_LINE>unloadAMXMBeans();<NEW_LINE>final ObjectName allAMXPattern = AMXUtil.newObjectName(AMXGlassfish.DEFAULT.amxJMXDomain(), "*");<NEW_LINE>final Set<ObjectName> remainingAMX = mMBeanServer.queryNames(allAMXPattern, null);<NEW_LINE>if (!remainingAMX.isEmpty()) {<NEW_LINE>logger.log(Level.WARNING, AMXLoggerInfo.shutdownNotUnregistered, remainingAMX);<NEW_LINE>try {<NEW_LINE>Thread.sleep(1000);<NEW_LINE>} catch (final InterruptedException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FeatureAvailability<MASK><NEW_LINE>logger.log(Level.INFO, "AMX Startup Service: AMX MBeans shutdown: {0}.", mMBeanServer.queryNames(allAMXPattern, null));<NEW_LINE>}
.getInstance().deRegisterFeatures();
836,654
public void marshall(Analysis analysis, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (analysis == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(analysis.getAnalysisId(), ANALYSISID_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(analysis.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(analysis.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(analysis.getErrors(), ERRORS_BINDING);<NEW_LINE>protocolMarshaller.marshall(analysis.getDataSetArns(), DATASETARNS_BINDING);<NEW_LINE>protocolMarshaller.marshall(analysis.getThemeArn(), THEMEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(analysis.getCreatedTime(), CREATEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(analysis.getLastUpdatedTime(), LASTUPDATEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(analysis.getSheets(), SHEETS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
analysis.getArn(), ARN_BINDING);
336,648
public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {<NEW_LINE>final Optional<PoWSolverInputs> solver = miner.getWorkDefinition();<NEW_LINE>if (solver.isPresent()) {<NEW_LINE>final <MASK><NEW_LINE>final byte[] dagSeed = DirectAcyclicGraphSeed.dagSeed(rawResult.getBlockNumber(), epochCalculator);<NEW_LINE>final String[] result = { rawResult.getPrePowHash().toHexString(), "0x" + BaseEncoding.base16().lowerCase().encode(dagSeed), rawResult.getTarget().toHexString(), Quantity.create(rawResult.getBlockNumber()) };<NEW_LINE>return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), result);<NEW_LINE>} else {<NEW_LINE>LOG.trace("Mining is not operational, eth_getWork request cannot be processed");<NEW_LINE>return new JsonRpcErrorResponse(requestContext.getRequest().getId(), JsonRpcError.NO_MINING_WORK_FOUND);<NEW_LINE>}<NEW_LINE>}
PoWSolverInputs rawResult = solver.get();
1,531,171
private static CrashlyticsReport.Session parseSession(@NonNull JsonReader jsonReader) throws IOException {<NEW_LINE>final CrashlyticsReport.Session.Builder builder = CrashlyticsReport.Session.builder();<NEW_LINE>jsonReader.beginObject();<NEW_LINE>while (jsonReader.hasNext()) {<NEW_LINE>String name = jsonReader.nextName();<NEW_LINE>switch(name) {<NEW_LINE>case "generator":<NEW_LINE>builder.setGenerator(jsonReader.nextString());<NEW_LINE>break;<NEW_LINE>case "identifier":<NEW_LINE>builder.setIdentifierFromUtf8Bytes(Base64.decode(jsonReader.nextString(), Base64.NO_WRAP));<NEW_LINE>break;<NEW_LINE>case "startedAt":<NEW_LINE>builder.<MASK><NEW_LINE>break;<NEW_LINE>case "endedAt":<NEW_LINE>builder.setEndedAt(jsonReader.nextLong());<NEW_LINE>break;<NEW_LINE>case "crashed":<NEW_LINE>builder.setCrashed(jsonReader.nextBoolean());<NEW_LINE>break;<NEW_LINE>case "user":<NEW_LINE>builder.setUser(parseUser(jsonReader));<NEW_LINE>break;<NEW_LINE>case "app":<NEW_LINE>builder.setApp(parseApp(jsonReader));<NEW_LINE>break;<NEW_LINE>case "os":<NEW_LINE>builder.setOs(parseOs(jsonReader));<NEW_LINE>break;<NEW_LINE>case "device":<NEW_LINE>builder.setDevice(parseDevice(jsonReader));<NEW_LINE>break;<NEW_LINE>case "events":<NEW_LINE>builder.setEvents(parseArray(jsonReader, CrashlyticsReportJsonTransform::parseEvent));<NEW_LINE>break;<NEW_LINE>case "generatorType":<NEW_LINE>builder.setGeneratorType(jsonReader.nextInt());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>jsonReader.skipValue();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonReader.endObject();<NEW_LINE>return builder.build();<NEW_LINE>}
setStartedAt(jsonReader.nextLong());
1,424,212
public void mapPartition(Iterable<Tuple2<Integer, Integer>> values, Collector<Tuple3<Integer, Integer, Integer>> out) throws Exception {<NEW_LINE>int numPartitions = getRuntimeContext().getNumberOfParallelSubtasks();<NEW_LINE>List<Tuple2<Integer, Integer>> itemCounts = new ArrayList<>();<NEW_LINE>for (Tuple2<Integer, Integer> v : values) {<NEW_LINE>itemCounts.add(v);<NEW_LINE>}<NEW_LINE>itemCounts.sort((o1, o2) -> {<NEW_LINE>int cmp = Long.compare(o2.f1, o1.f1);<NEW_LINE>return cmp == 0 ? Integer.compare(o1.f0, o2.f0) : cmp;<NEW_LINE>});<NEW_LINE>// queue of tuple: partition, count<NEW_LINE>PriorityQueue<Tuple2<Integer, Double>> queue = new PriorityQueue<>(numPartitions, Comparator.comparingDouble(o -> o.f1));<NEW_LINE>for (int i = 0; i < numPartitions; i++) {<NEW_LINE>queue.add(Tuple2.of(i, 0.0));<NEW_LINE>}<NEW_LINE>List<Double> scaledItemCount = new ArrayList<>(itemCounts.size());<NEW_LINE>for (int i = 0; i < itemCounts.size(); i++) {<NEW_LINE>Tuple2<Integer, Integer> item = itemCounts.get(i);<NEW_LINE>double pos = (double) i / ((double) itemCounts.size());<NEW_LINE>double score = pos * item.f1.doubleValue();<NEW_LINE>scaledItemCount.add(score);<NEW_LINE>}<NEW_LINE>List<Integer> order = new ArrayList<>(itemCounts.size());<NEW_LINE>for (int i = 0; i < itemCounts.size(); i++) {<NEW_LINE>order.add(i);<NEW_LINE>}<NEW_LINE>order.sort((o1, o2) -> {<NEW_LINE>double s1 = scaledItemCount.get(o1);<NEW_LINE>double s2 = scaledItemCount.get(o2);<NEW_LINE>return Double.compare(s2, s1);<NEW_LINE>});<NEW_LINE>// greedily assign partition number to each item<NEW_LINE>for (int i = 0; i < itemCounts.size(); i++) {<NEW_LINE>Tuple2<Integer, Integer> item = itemCounts.get(order.get(i));<NEW_LINE>double score = scaledItemCount.get(order.get(i));<NEW_LINE>Tuple2<Integer, Double<MASK><NEW_LINE>int targetPartition = target.f0;<NEW_LINE>target.f1 += score;<NEW_LINE>queue.add(target);<NEW_LINE>out.collect(Tuple3.of(item.f0, order.get(i), targetPartition));<NEW_LINE>}<NEW_LINE>}
> target = queue.poll();
868,161
public boolean processReceivedPacket(VelbusDevice device, VelbusPacket packet) {<NEW_LINE>VelbusPacket.InboundCommand packetCommand = VelbusPacket.InboundCommand.fromCode(packet.getCommand());<NEW_LINE>if (packetCommand == VelbusPacket.InboundCommand.BLIND_STATUS) {<NEW_LINE>// Extract channel info<NEW_LINE>int channelNumber = <MASK><NEW_LINE>int blindPos = device.getDeviceType() == VelbusDeviceType.VMB2BLE ? packet.getByte(5) & 0xFF : 0;<NEW_LINE>int stateValue = packet.getByte(3) & 0xFF;<NEW_LINE>ChannelState state = stateValue == 0 ? ChannelState.HALT : stateValue == 1 ? ChannelState.UP : ChannelState.DOWN;<NEW_LINE>LedState ledStateDown = LedState.fromCode(packet.getByte(4) & 0xFF);<NEW_LINE>LedState ledStateUp = LedState.fromCode(packet.getByte(4) << 4 & 0xFF);<NEW_LINE>ChannelSetting setting = ChannelSetting.fromCode(packet.getByte(6) & 0xFF);<NEW_LINE>boolean locked = setting == ChannelSetting.LOCKED;<NEW_LINE>boolean inhibited = setting == ChannelSetting.INHIBITED;<NEW_LINE>boolean inhibitedUp = setting == ChannelSetting.INHIBITED_UP;<NEW_LINE>boolean inhibitedDown = setting == ChannelSetting.INHIBITED_DOWN;<NEW_LINE>// Push to device cache<NEW_LINE>device.setProperty("CH" + channelNumber, state);<NEW_LINE>device.setProperty("CH" + channelNumber + "_POSITION", blindPos);<NEW_LINE>device.setProperty("CH" + channelNumber + "_SETTING", setting);<NEW_LINE>device.setProperty("CH" + channelNumber + "_LED_DOWN", ledStateDown);<NEW_LINE>device.setProperty("CH" + channelNumber + "_LED_UP", ledStateUp);<NEW_LINE>device.setProperty("CH" + channelNumber + "_LOCKED", locked);<NEW_LINE>device.setProperty("CH" + channelNumber + "_INHIBITED", inhibited);<NEW_LINE>device.setProperty("CH" + channelNumber + "_INHIBITED_UP", inhibitedUp);<NEW_LINE>device.setProperty("CH" + channelNumber + "_INHIBITED_DOWN", inhibitedDown);<NEW_LINE>return true;<NEW_LINE>// Don't use push button status as it only provides relay on/off info<NEW_LINE>// case PUSH_BUTTON_STATUS:<NEW_LINE>// // Update each of the dimmer channels<NEW_LINE>// int onByte = packet.getByte(1) & 0xFF;<NEW_LINE>// int offByte = packet.getByte(2) & 0xFF;<NEW_LINE>//<NEW_LINE>// for (int i = 1; i <= ChannelProcessor.getMaxChannelNumber(device); i++) {<NEW_LINE>// if ((onByte & 0x01) == 1) {<NEW_LINE>// device.setProperty("CH" + i, BlindProcessor.ChannelState.ON);<NEW_LINE>// } else if ((offByte & 0x01) == 1) {<NEW_LINE>// device.setProperty("CH" + i, BlindProcessor.ChannelState.OFF);<NEW_LINE>// }<NEW_LINE>//<NEW_LINE>// onByte = onByte >>> 1;<NEW_LINE>// offByte = offByte >>> 1;<NEW_LINE>// }<NEW_LINE>// return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
packet.getByte(1) & 0xFF;
240,147
private static CoocurranceMatrices updateCooccurrenceMatrices(CoocurranceMatrices matrices, final SimpleImage ip, final SimpleImage bpMask, final int xx, final int yy, final int ww, final int hh, final int nBins, double minValue, double maxValue, final int d) {<NEW_LINE>// Create matrices if necessary<NEW_LINE>if (matrices == null)<NEW_LINE>matrices = new CoocurranceMatrices(nBins);<NEW_LINE>// Dimensions<NEW_LINE>int width = ip.getWidth();<NEW_LINE>int height = ip.getHeight();<NEW_LINE>double binDepth = (maxValue - minValue) / nBins;<NEW_LINE>// Loop through pixels<NEW_LINE>boolean noMask = bpMask == null;<NEW_LINE>for (int y = yy; y < yy + hh; y++) {<NEW_LINE>for (int x = xx; x < xx + ww; x++) {<NEW_LINE>if (!noMask && bpMask.getValue(x, y) == 0)<NEW_LINE>continue;<NEW_LINE>// Extract binned pixel value<NEW_LINE>int binValue = getBinValue(ip, x, <MASK><NEW_LINE>if (binValue < 0)<NEW_LINE>continue;<NEW_LINE>// Test neighbors<NEW_LINE>if (x < width - d && (noMask || bpMask.getValue(x + d, y) != 0))<NEW_LINE>matrices.put0(binValue, getBinValue(ip, x + d, y, minValue, binDepth, nBins));<NEW_LINE>if (y < height - d && (noMask || bpMask.getValue(x, y + d) != 0))<NEW_LINE>matrices.put90(binValue, getBinValue(ip, x, y + d, minValue, binDepth, nBins));<NEW_LINE>// Note (Pete): The angles here may differ from the original paper<NEW_LINE>// Switching the order may help, but note that put45 and put135 are also called in another method (below)<NEW_LINE>// so this change has been reverted for consistency... we may want to consider modifying this (or just renaming the methods) at some point<NEW_LINE>// Here, it is assumed that the zero angle is -> (horizontal, left to right), and rotations are clockwise<NEW_LINE>if (x < width - d && y < height - d && (noMask || bpMask.getValue(x + d, y + d) != 0))<NEW_LINE>// J check with Haralick paper<NEW_LINE>matrices.put45(binValue, getBinValue(ip, x + d, y + d, minValue, binDepth, nBins));<NEW_LINE>if (x >= d && y < height - d && (noMask || bpMask.getValue(x - d, y + d) != 0))<NEW_LINE>matrices.put135(binValue, getBinValue(ip, x - d, y + d, minValue, binDepth, nBins));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return matrices;<NEW_LINE>}
y, minValue, binDepth, nBins);
296,221
private Mono<Response<DeleteOperationResultInner>> deleteWithResponseAsync(String resourceGroupName, String profileName, 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 (profileName == null) {<NEW_LINE>return Mono.<MASK><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>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, profileName, this.client.getApiVersion(), this.client.getSubscriptionId(), context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter profileName is required and cannot be null."));
869,190
private void initSelectionToolbar() {<NEW_LINE>selectionToolbar = findViewById(R.id.library_selection_toolbar);<NEW_LINE>selectionToolbar.getMenu().clear();<NEW_LINE>selectionToolbar.inflateMenu(R.menu.library_selection_menu);<NEW_LINE>Helper.tryShowMenuIcons(this, selectionToolbar.getMenu());<NEW_LINE>editNameMenu = selectionToolbar.getMenu().findItem(R.id.action_edit_name);<NEW_LINE>deleteMenu = selectionToolbar.getMenu().findItem(R.id.action_delete);<NEW_LINE>completedMenu = selectionToolbar.getMenu().findItem(R.id.action_completed);<NEW_LINE>shareMenu = selectionToolbar.getMenu().<MASK><NEW_LINE>archiveMenu = selectionToolbar.getMenu().findItem(R.id.action_archive);<NEW_LINE>changeGroupMenu = selectionToolbar.getMenu().findItem(R.id.action_change_group);<NEW_LINE>folderMenu = selectionToolbar.getMenu().findItem(R.id.action_open_folder);<NEW_LINE>redownloadMenu = selectionToolbar.getMenu().findItem(R.id.action_redownload);<NEW_LINE>downloadMenu = selectionToolbar.getMenu().findItem(R.id.action_download);<NEW_LINE>streamMenu = selectionToolbar.getMenu().findItem(R.id.action_stream);<NEW_LINE>coverMenu = selectionToolbar.getMenu().findItem(R.id.action_set_cover);<NEW_LINE>mergeMenu = selectionToolbar.getMenu().findItem(R.id.action_merge);<NEW_LINE>splitMenu = selectionToolbar.getMenu().findItem(R.id.action_split);<NEW_LINE>}
findItem(R.id.action_share);
87,761
private static int scanForSemicolon(Document doc, int[] offset, int start, int end) throws BadLocationException {<NEW_LINE>TokenHierarchy<Document> th = doc != null ? TokenHierarchy.get(doc) : null;<NEW_LINE>List<TokenSequence<?>> embeddedSequences = th != null ? th.embeddedTokenSequences(offset[0], false) : null;<NEW_LINE>TokenSequence<?> seq = embeddedSequences != null ? embeddedSequences.get(embeddedSequences.<MASK><NEW_LINE>if (seq == null) {<NEW_LINE>return offset[0];<NEW_LINE>}<NEW_LINE>seq.move(start);<NEW_LINE>int semicolon = -1;<NEW_LINE>while (seq.moveNext()) {<NEW_LINE>int tokenOffset = seq.offset();<NEW_LINE>if (tokenOffset > end) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>Token<?> t = seq.token();<NEW_LINE>if (t != null && t.id() == JavaTokenId.SEMICOLON) {<NEW_LINE>semicolon = tokenOffset;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return semicolon;<NEW_LINE>}
size() - 1) : null;
383,212
public void close() {<NEW_LINE>if (closed) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>closed = true;<NEW_LINE>probe = null;<NEW_LINE>// In case of early termination (before operator is finished) release partition consumption to avoid a deadlock<NEW_LINE>if (partitionedConsumption == null) {<NEW_LINE>partitionedConsumption = lookupSourceFactory.finishProbeOperator(lookupJoinsCount);<NEW_LINE>addSuccessCallback(partitionedConsumption, consumption -> consumption.beginConsumption().forEachRemaining(Partition::release));<NEW_LINE>}<NEW_LINE>currentPartition.ifPresent(Partition::release);<NEW_LINE>currentPartition = Optional.empty();<NEW_LINE>if (lookupPartitions != null) {<NEW_LINE>while (lookupPartitions.hasNext()) {<NEW_LINE>lookupPartitions.next().release();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try (Closer closer = Closer.create()) {<NEW_LINE>// `afterClose` must be run last.<NEW_LINE>// Closer is documented to mimic try-with-resource, which implies close will happen in reverse order.<NEW_LINE>closer.register(afterClose::run);<NEW_LINE>closer.register(pageBuilder::reset);<NEW_LINE>closer.register(() -> Optional.ofNullable(lookupSourceProvider)<MASK><NEW_LINE>spiller.ifPresent(closer::register);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
.ifPresent(LookupSourceProvider::close));
1,693,321
public boolean add(@ParametricNullness E object) {<NEW_LINE>if (needsAllocArrays()) {<NEW_LINE>allocArrays();<NEW_LINE>}<NEW_LINE>Set<E> delegate = delegateOrNull();<NEW_LINE>if (delegate != null) {<NEW_LINE>return delegate.add(object);<NEW_LINE>}<NEW_LINE>int[] entries = requireEntries();<NEW_LINE>@Nullable<NEW_LINE>Object[] elements = requireElements();<NEW_LINE>// current size, and pointer to the entry to be appended<NEW_LINE>int newEntryIndex = this.size;<NEW_LINE>int newSize = newEntryIndex + 1;<NEW_LINE>int hash = smearedHash(object);<NEW_LINE>int mask = hashTableMask();<NEW_LINE>int tableIndex = hash & mask;<NEW_LINE>int next = CompactHashing.tableGet(requireTable(), tableIndex);<NEW_LINE>if (next == UNSET) {<NEW_LINE>// uninitialized bucket<NEW_LINE>if (newSize > mask) {<NEW_LINE>// Resize and add new entry<NEW_LINE>mask = resizeTable(mask, CompactHashing.newCapacity(mask), hash, newEntryIndex);<NEW_LINE>} else {<NEW_LINE>CompactHashing.tableSet(requireTable(), tableIndex, newEntryIndex + 1);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int entryIndex;<NEW_LINE>int entry;<NEW_LINE>int hashPrefix = <MASK><NEW_LINE>int bucketLength = 0;<NEW_LINE>do {<NEW_LINE>entryIndex = next - 1;<NEW_LINE>entry = entries[entryIndex];<NEW_LINE>if (CompactHashing.getHashPrefix(entry, mask) == hashPrefix && Objects.equal(object, elements[entryIndex])) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>next = CompactHashing.getNext(entry, mask);<NEW_LINE>bucketLength++;<NEW_LINE>} while (next != UNSET);<NEW_LINE>if (bucketLength >= MAX_HASH_BUCKET_LENGTH) {<NEW_LINE>return convertToHashFloodingResistantImplementation().add(object);<NEW_LINE>}<NEW_LINE>if (newSize > mask) {<NEW_LINE>// Resize and add new entry<NEW_LINE>mask = resizeTable(mask, CompactHashing.newCapacity(mask), hash, newEntryIndex);<NEW_LINE>} else {<NEW_LINE>entries[entryIndex] = CompactHashing.maskCombine(entry, newEntryIndex + 1, mask);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>resizeMeMaybe(newSize);<NEW_LINE>insertEntry(newEntryIndex, object, hash, mask);<NEW_LINE>this.size = newSize;<NEW_LINE>incrementModCount();<NEW_LINE>return true;<NEW_LINE>}
CompactHashing.getHashPrefix(hash, mask);
1,369,302
public void process() {<NEW_LINE>JMeterContext context = getThreadContext();<NEW_LINE>Sampler sam = context.getCurrentSampler();<NEW_LINE><MASK><NEW_LINE>HTTPSamplerBase sampler;<NEW_LINE>HTTPSampleResult result;<NEW_LINE>if (!(sam instanceof HTTPSamplerBase) || !(res instanceof HTTPSampleResult)) {<NEW_LINE>log.info("Can't apply HTML Link Parser when the previous" + " sampler run is not an HTTP Request.");<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>sampler = (HTTPSamplerBase) sam;<NEW_LINE>result = (HTTPSampleResult) res;<NEW_LINE>}<NEW_LINE>List<HTTPSamplerBase> potentialLinks = new ArrayList<>();<NEW_LINE>String responseText = result.getResponseDataAsString();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>int index = responseText.indexOf('<');<NEW_LINE>if (index == -1) {<NEW_LINE>index = 0;<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Check for matches against: " + sampler.toString());<NEW_LINE>}<NEW_LINE>Document html = (Document) HtmlParsingUtils.getDOM(responseText.substring(index));<NEW_LINE>addAnchorUrls(html, result, sampler, potentialLinks);<NEW_LINE>addFormUrls(html, result, sampler, potentialLinks);<NEW_LINE>addFramesetUrls(html, result, sampler, potentialLinks);<NEW_LINE>if (!potentialLinks.isEmpty()) {<NEW_LINE>HTTPSamplerBase url = potentialLinks.get(ThreadLocalRandom.current().nextInt(potentialLinks.size()));<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Selected: " + url.toString());<NEW_LINE>}<NEW_LINE>sampler.setDomain(url.getDomain());<NEW_LINE>sampler.setPath(url.getPath());<NEW_LINE>if (url.getMethod().equals(HTTPConstants.POST)) {<NEW_LINE>for (JMeterProperty jMeterProperty : sampler.getArguments()) {<NEW_LINE>Argument arg = (Argument) jMeterProperty.getObjectValue();<NEW_LINE>modifyArgument(arg, url.getArguments());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>sampler.setArguments(url.getArguments());<NEW_LINE>}<NEW_LINE>sampler.setProtocol(url.getProtocol());<NEW_LINE>} else {<NEW_LINE>log.debug("No matches found");<NEW_LINE>}<NEW_LINE>}
SampleResult res = context.getPreviousResult();
295,765
private long visitDateTimeConstructor() {<NEW_LINE>DateFormat format = new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss z", Locale.ENGLISH);<NEW_LINE>verifyToken(JsonTokenType.LEFT_PAREN);<NEW_LINE>JsonToken token = popToken();<NEW_LINE>if (token.getType() == JsonTokenType.RIGHT_PAREN) {<NEW_LINE>return <MASK><NEW_LINE>} else if (token.getType() == JsonTokenType.STRING) {<NEW_LINE>verifyToken(JsonTokenType.RIGHT_PAREN);<NEW_LINE>String s = token.getValue(String.class);<NEW_LINE>ParsePosition pos = new ParsePosition(0);<NEW_LINE>Date dateTime = format.parse(s, pos);<NEW_LINE>if (dateTime != null && pos.getIndex() == s.length()) {<NEW_LINE>return dateTime.getTime();<NEW_LINE>} else {<NEW_LINE>throw new JsonParseException("JSON reader expected a date in 'EEE MMM dd yyyy HH:mm:ss z' format but found '%s'.", s);<NEW_LINE>}<NEW_LINE>} else if (token.getType() == JsonTokenType.INT32 || token.getType() == JsonTokenType.INT64) {<NEW_LINE>long[] values = new long[7];<NEW_LINE>int pos = 0;<NEW_LINE>while (true) {<NEW_LINE>if (pos < values.length) {<NEW_LINE>values[pos++] = token.getValue(Long.class);<NEW_LINE>}<NEW_LINE>token = popToken();<NEW_LINE>if (token.getType() == JsonTokenType.RIGHT_PAREN) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (token.getType() != JsonTokenType.COMMA) {<NEW_LINE>throw new JsonParseException("JSON reader expected a ',' or a ')' but found '%s'.", token.getValue());<NEW_LINE>}<NEW_LINE>token = popToken();<NEW_LINE>if (token.getType() != JsonTokenType.INT32 && token.getType() != JsonTokenType.INT64) {<NEW_LINE>throw new JsonParseException("JSON reader expected an integer but found '%s'.", token.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pos == 1) {<NEW_LINE>return values[0];<NEW_LINE>} else if (pos < 3 || pos > 7) {<NEW_LINE>throw new JsonParseException("JSON reader expected 1 or 3-7 integers but found %d.", pos);<NEW_LINE>}<NEW_LINE>Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));<NEW_LINE>calendar.set(Calendar.YEAR, (int) values[0]);<NEW_LINE>calendar.set(Calendar.MONTH, (int) values[1]);<NEW_LINE>calendar.set(Calendar.DAY_OF_MONTH, (int) values[2]);<NEW_LINE>calendar.set(Calendar.HOUR_OF_DAY, (int) values[3]);<NEW_LINE>calendar.set(Calendar.MINUTE, (int) values[4]);<NEW_LINE>calendar.set(Calendar.SECOND, (int) values[5]);<NEW_LINE>calendar.set(Calendar.MILLISECOND, (int) values[6]);<NEW_LINE>return calendar.getTimeInMillis();<NEW_LINE>} else {<NEW_LINE>throw new JsonParseException("JSON reader expected an integer or a string but found '%s'.", token.getValue());<NEW_LINE>}<NEW_LINE>}
new Date().getTime();
666,740
public static TrifocalTensor createTrifocal(Se3_F64 P2, Se3_F64 P3, @Nullable TrifocalTensor ret) {<NEW_LINE>if (ret == null)<NEW_LINE>ret = new TrifocalTensor();<NEW_LINE>DMatrixRMaj R2 = P2.getR();<NEW_LINE>DMatrixRMaj R3 = P3.getR();<NEW_LINE>Vector3D_F64 T2 = P2.getT();<NEW_LINE>Vector3D_F64 T3 = P3.getT();<NEW_LINE>for (int col = 0; col < 3; col++) {<NEW_LINE>DMatrixRMaj T = ret.getT(col);<NEW_LINE>int index = 0;<NEW_LINE>for (int i = 0; i < 3; i++) {<NEW_LINE>double a_left = R2.unsafe_get(i, col);<NEW_LINE>double a_right = T2.getIdx(i);<NEW_LINE>for (int j = 0; j < 3; j++) {<NEW_LINE>T.data[index++] = a_left * T3.getIdx(j) - a_right * <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
R3.unsafe_get(j, col);
470,335
private PartialPath deleteOneTimeseriesUpdateStatisticsAndDropTrigger(PartialPath path) throws MetadataException, IOException {<NEW_LINE>Pair<PartialPath, IMeasurementMNode> <MASK><NEW_LINE>IMeasurementMNode measurementMNode = pair.right;<NEW_LINE>removeFromTagInvertedIndex(measurementMNode);<NEW_LINE>PartialPath storageGroupPath = pair.left;<NEW_LINE>// drop trigger with no exceptions<NEW_LINE>TriggerEngine.drop(pair.right);<NEW_LINE>IMNode node = measurementMNode.getParent();<NEW_LINE>if (node.isUseTemplate() && node.getSchemaTemplate().hasSchema(measurementMNode.getName())) {<NEW_LINE>// measurement represent by template doesn't affect the MTree structure and memory control<NEW_LINE>return storageGroupPath;<NEW_LINE>}<NEW_LINE>while (node.isEmptyInternal()) {<NEW_LINE>mNodeCache.invalidate(node.getPartialPath());<NEW_LINE>node = node.getParent();<NEW_LINE>}<NEW_LINE>timeseriesStatistics.deleteTimeseries(1);<NEW_LINE>return storageGroupPath;<NEW_LINE>}
pair = mtree.deleteTimeseriesAndReturnEmptyStorageGroup(path);
1,590,741
private static List<PositionRegion> collectRegions(Document doc, int startPos, int endPos) throws BadLocationException {<NEW_LINE>final GuardedDocument gdoc = (doc instanceof GuardedDocument) ? (GuardedDocument) doc : null;<NEW_LINE>int pos = startPos;<NEW_LINE>if (gdoc != null) {<NEW_LINE>pos = gdoc.getGuardedBlockChain().adjustToBlockEnd(pos);<NEW_LINE>}<NEW_LINE>LinkedList<PositionRegion> regions = new LinkedList<PositionRegion>();<NEW_LINE>while (pos < endPos) {<NEW_LINE>int stopPos = endPos;<NEW_LINE>if (gdoc != null) {<NEW_LINE>// adjust to start of the next guarded block<NEW_LINE>stopPos = gdoc.getGuardedBlockChain().adjustToNextBlockStart(pos) - 1;<NEW_LINE>if (stopPos < 0 || stopPos > endPos) {<NEW_LINE>stopPos = endPos;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pos < stopPos) {<NEW_LINE>regions.addFirst(new PositionRegion(doc, pos, stopPos));<NEW_LINE>pos = stopPos;<NEW_LINE>} else {<NEW_LINE>// ensure to make progress<NEW_LINE>pos++;<NEW_LINE>}<NEW_LINE>if (gdoc != null) {<NEW_LINE>// adjust to end of current block<NEW_LINE>pos = gdoc.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return regions;<NEW_LINE>}
getGuardedBlockChain().adjustToBlockEnd(pos);
988,551
public String createXmlRepresentation(HttpResponse response) {<NEW_LINE>try {<NEW_LINE>if (response == null || response.getContentAsString() == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String content = response.getContentAsString().trim();<NEW_LINE>if (!StringUtils.hasContent(content)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// remove nulls - workaround for bug in xmlserializer!?<NEW_LINE>content = content.replaceAll("\\\\u0000", "");<NEW_LINE>JSON json = new JsonUtil().parseTrimmedText(content);<NEW_LINE>JsonXmlSerializer serializer = new JsonXmlSerializer();<NEW_LINE>serializer.setTypeHintsEnabled(false);<NEW_LINE>serializer.setRootName(HttpUtils.isErrorStatus(response.getStatusCode()) ? "Fault" : "Response");<NEW_LINE>URL url = response.getURL();<NEW_LINE>String originalUri = readOriginalUriFrom(response.getRequest());<NEW_LINE>String namespaceUri = originalUri != <MASK><NEW_LINE>serializer.setNamespace("", namespaceUri);<NEW_LINE>content = serializer.write(json);<NEW_LINE>content = XmlUtils.prettyPrintXml(content);<NEW_LINE>return content;<NEW_LINE>} catch (JSONException ignore) {<NEW_LINE>// if the content is not valid JSON, empty XML will be returned<NEW_LINE>} catch (Exception e) {<NEW_LINE>SoapUI.logError(e);<NEW_LINE>}<NEW_LINE>return "<xml/>";<NEW_LINE>}
null ? originalUri : makeNamespaceUriFrom(url);
1,337,893
public void run() {<NEW_LINE>// NOI18N<NEW_LINE>ProgressHandle progress = getProgressHandle();<NEW_LINE>JComponent bar = ProgressHandleFactory.createProgressComponent(progress);<NEW_LINE>// NOI18N<NEW_LINE>stopButton = new JButton(org.openide.util.NbBundle.getMessage(WizardStepProgressSupport.class, "BK2022"));<NEW_LINE>stopButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>cancel();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>panel<MASK><NEW_LINE>progressComponent = new JPanel();<NEW_LINE>progressComponent.setLayout(new BorderLayout(6, 0));<NEW_LINE>progressLabel = new JLabel();<NEW_LINE>progressLabel.setText(WizardStepProgressSupport.super.getDisplayName());<NEW_LINE>progressComponent.add(progressLabel, BorderLayout.NORTH);<NEW_LINE>progressComponent.add(bar, BorderLayout.CENTER);<NEW_LINE>progressComponent.add(stopButton, BorderLayout.LINE_END);<NEW_LINE>WizardStepProgressSupport.super.startProgress();<NEW_LINE>panel.setVisible(true);<NEW_LINE>panel.add(progressComponent);<NEW_LINE>panel.revalidate();<NEW_LINE>}
.setLayout(new BorderLayout());
1,038,469
public void train(ClassificationDataSet dataSet, boolean parallel) {<NEW_LINE>if (dataSet.getNumCategoricalVars() != 0)<NEW_LINE>throw new FailedToFitException("KNN requires vector data only");<NEW_LINE>mode = Mode.CLASSIFICATION;<NEW_LINE>this.predicting = dataSet.getPredicting();<NEW_LINE>List<VecPaired<Vec, Double>> dataPoints = new ArrayList<VecPaired<Vec, Double><MASK><NEW_LINE>// Add all the data points<NEW_LINE>for (int i = 0; i < dataSet.getClassSize(); i++) {<NEW_LINE>for (DataPoint dp : dataSet.getSamples(i)) {<NEW_LINE>// We want to include the category in this case, so we will add it to the vector<NEW_LINE>// bug? why isnt this auto boxed to double w/o a cast?<NEW_LINE>dataPoints.add(new VecPaired(dp.getNumericalValues(), (double) i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TrainableDistanceMetric.trainIfNeeded(distanceMetric, dataSet, parallel);<NEW_LINE>vecCollection.build(parallel, dataPoints, distanceMetric);<NEW_LINE>}
>(dataSet.size());
57,690
public static boolean downloadFile(HttpServletResponse response, File file) {<NEW_LINE>if (file == null || !file.exists()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean result = true;<NEW_LINE>response.reset();<NEW_LINE>response.addHeader("Content-Disposition", "attachment;filename=" + file.getName());<NEW_LINE>response.setContentType("application/octet-stream");<NEW_LINE>response.addHeader("Content-Length", "" + file.length());<NEW_LINE>try (InputStream fis = new <MASK><NEW_LINE>OutputStream toClient = new BufferedOutputStream(response.getOutputStream())) {<NEW_LINE>copyLarge(fis, toClient);<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>log.error("file not found:" + file.getAbsolutePath(), e);<NEW_LINE>result = false;<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("read file error:" + file.getAbsolutePath(), e);<NEW_LINE>result = false;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
BufferedInputStream(new FileInputStream(file));
922,490
final DeleteDomainResult executeDeleteDomain(DeleteDomainRequest deleteDomainRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDomainRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDomainRequest> request = null;<NEW_LINE>Response<DeleteDomainResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDomainRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDomainRequest));<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, "DeleteDomain");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDomainResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new DeleteDomainResultJsonUnmarshaller());
503,710
private static JPanel createNotificationPanel(final URL url) {<NEW_LINE>JPanel panel = new JPanel();<NEW_LINE>// NOI18N<NEW_LINE>JLabel msgLabel = new JLabel("<html>" + NbBundle.getMessage(JiraUpdater.class, "MSG_PROJECT_NEEDS_JIRA"));<NEW_LINE>JButton linkButton = new org.netbeans.modules<MASK><NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(linkButton, NbBundle.getMessage(JiraUpdater.class, "MSG_PROJECT_NEEDS_JIRA_LINK"));<NEW_LINE>if (url != null) {<NEW_LINE>linkButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>HtmlBrowser.URLDisplayer displayer = HtmlBrowser.URLDisplayer.getDefault();<NEW_LINE>if (displayer != null) {<NEW_LINE>displayer.showURL(url);<NEW_LINE>} else {<NEW_LINE>// XXX nice error message?<NEW_LINE>// NOI18N<NEW_LINE>Support.LOG.warning("No URLDisplayer found.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>linkButton.setVisible(false);<NEW_LINE>}<NEW_LINE>GroupLayout layout = new GroupLayout(panel);<NEW_LINE>panel.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(msgLabel, GroupLayout.PREFERRED_SIZE, 470, Short.MAX_VALUE).addComponent(linkButton)).addContainerGap());<NEW_LINE>layout.setVerticalGroup(layout.createSequentialGroup().addContainerGap().addComponent(msgLabel).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(linkButton).addContainerGap(25, Short.MAX_VALUE));<NEW_LINE>return panel;<NEW_LINE>}
.bugtracking.commons.LinkButton();
1,057,686
private TransformationStatus transformWithRegex(TransformWork work) throws IOException, ValidationException {<NEW_LINE>// Optimize by only visiting files within rootPath<NEW_LINE>Path rootPath = work.getCheckoutDir().resolve(getRoot(before)).normalize();<NEW_LINE>if (!Files.isDirectory(rootPath)) {<NEW_LINE>return TransformationStatus.<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>boolean atLeastOneFileMatched = CopyMoveRegexVisitor.run(rootPath, before, after, paths.relativeTo(rootPath), work.getCheckoutDir(), overwrite, isCopy);<NEW_LINE>if (!atLeastOneFileMatched) {<NEW_LINE>return TransformationStatus.noop("Transformation '" + this + "' was a no-op because it didn't match any file");<NEW_LINE>}<NEW_LINE>} catch (FileAlreadyExistsException e) {<NEW_LINE>throw new ValidationException(String.format("Cannot move file to '%s' because it already exists", e.getFile()), e);<NEW_LINE>}<NEW_LINE>return TransformationStatus.success();<NEW_LINE>}
noop("Transformation '" + this + "' was a no-op because it didn't match any file");
705,066
public static void modelBake(ModelBakeEvent evt) {<NEW_LINE>IELogger.logger.debug("Baking models");<NEW_LINE>for (Entry<ModelWithTransforms, UnbakedModel> unbaked : unbakedModels.entrySet()) {<NEW_LINE>ModelRequest conf = unbaked.getKey().model;<NEW_LINE>ModelState state;<NEW_LINE>if (unbaked.getKey().transforms.isEmpty())<NEW_LINE>state = BlockModelRotation.by(conf.rotX, conf.rotY);<NEW_LINE>else<NEW_LINE>state = new SimpleUVModelTransform(ImmutableMap.copyOf(unbaked.getKey()<MASK><NEW_LINE>BakedModel baked = unbaked.getValue().bake(evt.getModelLoader(), ModelLoader.defaultTextureGetter(), state, conf.name);<NEW_LINE>for (ModelResourceLocation mrl : requestedModels.get(unbaked.getKey())) evt.getModelRegistry().put(mrl, baked);<NEW_LINE>}<NEW_LINE>}
.transforms), conf.uvLock);
978,591
final DescribeAccountModificationsResult executeDescribeAccountModifications(DescribeAccountModificationsRequest describeAccountModificationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeAccountModificationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeAccountModificationsRequest> request = null;<NEW_LINE>Response<DescribeAccountModificationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeAccountModificationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeAccountModificationsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WorkSpaces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAccountModifications");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeAccountModificationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeAccountModificationsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,273,168
protected void decompilerActionPerformed(DecompilerActionContext context) {<NEW_LINE>PluginTool tool = context.getTool();<NEW_LINE>GraphDisplayBroker service = <MASK><NEW_LINE>if (service == null) {<NEW_LINE>Msg.showError(this, tool.getToolFrame(), "AST Graph Failed", "Graph consumer not found: Please add a graph consumer provider to your tool");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// TODO: Options should really be obtained from graph service<NEW_LINE>Options options = tool.getOptions("Graph");<NEW_LINE>boolean reuseGraph = options.getBoolean("Reuse Graph", false);<NEW_LINE>int codeLimitPerBlock = options.getInt("Max Code Lines Displayed", 10);<NEW_LINE>HighFunction highFunction = context.getHighFunction();<NEW_LINE>Address locationAddr = context.getLocation().getAddress();<NEW_LINE>PCodeCfgGraphTask task = new PCodeCfgGraphTask(tool, service, !reuseGraph, codeLimitPerBlock, locationAddr, highFunction, CONTROL_FLOW_GRAPH);<NEW_LINE>new TaskLauncher(task, tool.getToolFrame());<NEW_LINE>}
tool.getService(GraphDisplayBroker.class);
437,199
public ListPricingPlansFilter unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListPricingPlansFilter listPricingPlansFilter = new ListPricingPlansFilter();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Arns", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPricingPlansFilter.setArns(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listPricingPlansFilter;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,141,105
protected ProcessEngine lookupProcessEngine(BeanManager beanManager) {<NEW_LINE>ServiceLoader<ProcessEngineLookup> processEngineServiceLoader = ServiceLoader.load(ProcessEngineLookup.class);<NEW_LINE>Iterator<ProcessEngineLookup<MASK><NEW_LINE>List<ProcessEngineLookup> discoveredLookups = new ArrayList<>();<NEW_LINE>while (serviceIterator.hasNext()) {<NEW_LINE>ProcessEngineLookup serviceInstance = serviceIterator.next();<NEW_LINE>discoveredLookups.add(serviceInstance);<NEW_LINE>}<NEW_LINE>Collections.sort(discoveredLookups, new Comparator<ProcessEngineLookup>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(ProcessEngineLookup o1, ProcessEngineLookup o2) {<NEW_LINE>return (-1) * ((Integer) o1.getPrecedence()).compareTo(o2.getPrecedence());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ProcessEngine processEngine = null;<NEW_LINE>for (ProcessEngineLookup processEngineLookup : discoveredLookups) {<NEW_LINE>processEngine = processEngineLookup.getProcessEngine();<NEW_LINE>if (processEngine != null) {<NEW_LINE>this.processEngineLookup = processEngineLookup;<NEW_LINE>LOGGER.debug("ProcessEngineLookup service {} returned process engine.", processEngineLookup.getClass());<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>LOGGER.debug("ProcessEngineLookup service {} returned 'null' value.", processEngineLookup.getClass());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (processEngineLookup == null) {<NEW_LINE>throw new FlowableException("Could not find an implementation of the org.flowable.cdi.spi.ProcessEngineLookup service " + "returning a non-null processEngine. Giving up.");<NEW_LINE>}<NEW_LINE>FlowableServices services = ProgrammaticBeanLookup.lookup(FlowableServices.class, beanManager);<NEW_LINE>services.setProcessEngine(processEngine);<NEW_LINE>return processEngine;<NEW_LINE>}
> serviceIterator = processEngineServiceLoader.iterator();
1,722,541
public <W, X> java.util.List<X> asList(W e) {<NEW_LINE>return new AbstractList<X>() {<NEW_LINE><NEW_LINE>T element = castTarget(e);<NEW_LINE><NEW_LINE>boolean hasValue = SingleHandler.this.getValue(element) != null;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int size() {<NEW_LINE>return hasValue ? 1 : 0;<NEW_LINE>}<NEW_LINE><NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>@Override<NEW_LINE>public X get(int index) {<NEW_LINE>if (index < 0 || index >= size()) {<NEW_LINE>throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size());<NEW_LINE>}<NEW_LINE>return (X) SingleHandler.this.getValue(element);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public X set(int index, X value) {<NEW_LINE>if (index < 0 || index >= size()) {<NEW_LINE>throw new IndexOutOfBoundsException("Index: " + <MASK><NEW_LINE>}<NEW_LINE>X oldValue = get(0);<NEW_LINE>SingleHandler.this.setValue(element, value);<NEW_LINE>return oldValue;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean add(X value) {<NEW_LINE>if (hasValue) {<NEW_LINE>// single value cannot have more then one value<NEW_LINE>throw new SpoonException("Single value attribute cannot have more then one value");<NEW_LINE>}<NEW_LINE>SingleHandler.this.setValue(element, value);<NEW_LINE>hasValue = true;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public X remove(int index) {<NEW_LINE>if (index < 0 || index >= size()) {<NEW_LINE>throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size());<NEW_LINE>}<NEW_LINE>X oldValue = get(0);<NEW_LINE>if (oldValue != null) {<NEW_LINE>SingleHandler.this.setValue(element, null);<NEW_LINE>}<NEW_LINE>hasValue = false;<NEW_LINE>return oldValue;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean remove(Object value) {<NEW_LINE>if (hasValue == false) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>X oldValue = get(0);<NEW_LINE>if (equals(oldValue, value)) {<NEW_LINE>if (oldValue != null) {<NEW_LINE>SingleHandler.this.setValue(element, null);<NEW_LINE>}<NEW_LINE>hasValue = false;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>private boolean equals(Object v1, Object v2) {<NEW_LINE>if (v1 == v2) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (v1 == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return v1.equals(v2);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
index + ", Size: " + size());
1,342,533
public Polygon createEllipse() {<NEW_LINE>Envelope env = dim.getEnvelope();<NEW_LINE>double xRadius = env.getWidth() / 2.0;<NEW_LINE>double yRadius = env.getHeight() / 2.0;<NEW_LINE>double centreX = env.getMinX() + xRadius;<NEW_LINE>double centreY = env.getMinY() + yRadius;<NEW_LINE>Coordinate[] pts = new Coordinate[nPts + 1];<NEW_LINE>int iPt = 0;<NEW_LINE>for (int i = 0; i < nPts; i++) {<NEW_LINE>double ang = i * (2 * Math.PI / nPts);<NEW_LINE>double x = xRadius * Math.cos(ang) + centreX;<NEW_LINE>double y = yRadius * Math.sin(ang) + centreY;<NEW_LINE>pts[iPt++] = coord(x, y);<NEW_LINE>}<NEW_LINE>pts[iPt] = new Coordinate(pts[0]);<NEW_LINE>LinearRing ring = geomFact.createLinearRing(pts);<NEW_LINE>Polygon <MASK><NEW_LINE>return (Polygon) rotate(poly);<NEW_LINE>}
poly = geomFact.createPolygon(ring);
188,833
public ModelAndView confirmRegistration(final HttpServletRequest request, final ModelMap model, @RequestParam("token") final String token) throws UnsupportedEncodingException {<NEW_LINE>Locale locale = request.getLocale();<NEW_LINE>model.addAttribute("lang", locale.getLanguage());<NEW_LINE>final String result = userService.validateVerificationToken(token);<NEW_LINE>if (result.equals("valid")) {<NEW_LINE>final User user = userService.getUser(token);<NEW_LINE>// if (user.isUsing2FA()) {<NEW_LINE>// model.addAttribute("qr", userService.generateQRUrl(user));<NEW_LINE>// return "redirect:/qrcode.html?lang=" + locale.getLanguage();<NEW_LINE>// }<NEW_LINE>authWithoutPassword(user);<NEW_LINE>model.addAttribute("messageKey", "message.accountVerified");<NEW_LINE>return new ModelAndView("redirect:/console", model);<NEW_LINE>}<NEW_LINE>model.addAttribute("messageKey", "auth.message." + result);<NEW_LINE>model.addAttribute("expired", "expired".equals(result));<NEW_LINE><MASK><NEW_LINE>return new ModelAndView("redirect:/badUser", model);<NEW_LINE>}
model.addAttribute("token", token);
958,100
protected JPanel materialPanel(Material.Type type, String materialString, String finishString, String partName) {<NEW_LINE>JPanel subPanel = new JPanel(new MigLayout());<NEW_LINE>JLabel label = new JLabel(materialString);<NEW_LINE>// // The component material affects the weight of the component.<NEW_LINE>label.setToolTipText(trans.get("RocketCompCfg.lbl.ttip.componentmaterialaffects"));<NEW_LINE>subPanel.add(label, "spanx 4, wrap rel");<NEW_LINE>JComboBox<Material> materialCombo = new JComboBox<Material>(new MaterialModel(subPanel, component, type, partName));<NEW_LINE>// // The component material affects the weight of the component.<NEW_LINE>materialCombo.setToolTipText(trans.get("RocketCompCfg.combo.ttip.componentmaterialaffects"));<NEW_LINE>subPanel.add(materialCombo, "spanx 4, growx, wrap paragraph");<NEW_LINE>if (component instanceof ExternalComponent) {<NEW_LINE>label = new JLabel(finishString);<NEW_LINE>// //<html>The component finish affects the aerodynamic drag of the component.<br><NEW_LINE>String tip = // // The value indicated is the average roughness height of the surface.<NEW_LINE>trans.get("RocketCompCfg.lbl.longA1") + trans.get("RocketCompCfg.lbl.longA2");<NEW_LINE>label.setToolTipText(tip);<NEW_LINE>subPanel.add(label, "spanx 4, wmin 220lp, wrap rel");<NEW_LINE>JComboBox<ExternalComponent.Finish> finishCombo = new JComboBox<ExternalComponent.Finish>(new EnumModel<ExternalComponent.<MASK><NEW_LINE>finishCombo.setToolTipText(tip);<NEW_LINE>subPanel.add(finishCombo, "spanx 4, growx, split");<NEW_LINE>// // Set for all<NEW_LINE>JButton button = new SelectColorButton(trans.get("RocketCompCfg.but.Setforall"));<NEW_LINE>// // Set this finish for all components of the rocket.<NEW_LINE>button.setToolTipText(trans.get("RocketCompCfg.but.ttip.Setforall"));<NEW_LINE>button.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>Finish f = ((ExternalComponent) component).getFinish();<NEW_LINE>try {<NEW_LINE>document.startUndo("Set rocket finish");<NEW_LINE>// Do changes<NEW_LINE>Iterator<RocketComponent> iter = component.getRoot().iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>RocketComponent c = iter.next();<NEW_LINE>if (c instanceof ExternalComponent) {<NEW_LINE>((ExternalComponent) c).setFinish(f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>document.stopUndo();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>subPanel.add(button, "wrap paragraph");<NEW_LINE>}<NEW_LINE>return subPanel;<NEW_LINE>}
Finish>(component, "Finish"));
1,017,175
public Object mergeResults(Map<String, Object> results) throws Exception {<NEW_LINE>if (results.isEmpty())<NEW_LINE>return null;<NEW_LINE>// TODO: DELEGATE MERGE AT EVERY COMMAND<NEW_LINE>final ArrayList<Object> mergedResult = new ArrayList<Object>();<NEW_LINE>final Object firstResult = results.values().iterator().next();<NEW_LINE>for (Map.Entry<String, Object> entry : results.entrySet()) {<NEW_LINE>final <MASK><NEW_LINE>final Object nodeResult = entry.getValue();<NEW_LINE>if (nodeResult instanceof Collection)<NEW_LINE>mergedResult.addAll((Collection<?>) nodeResult);<NEW_LINE>else if (nodeResult instanceof Exception)<NEW_LINE>// RECEIVED EXCEPTION<NEW_LINE>throw (Exception) nodeResult;<NEW_LINE>else<NEW_LINE>mergedResult.add(nodeResult);<NEW_LINE>}<NEW_LINE>Object result = null;<NEW_LINE>if (firstResult instanceof OLegacyResultSet) {<NEW_LINE>// REUSE THE SAME RESULTSET TO AVOID DUPLICATES<NEW_LINE>((OLegacyResultSet) firstResult).clear();<NEW_LINE>((OLegacyResultSet) firstResult).addAll(mergedResult);<NEW_LINE>result = firstResult;<NEW_LINE>} else<NEW_LINE>result = new ArrayList<Object>(mergedResult);<NEW_LINE>return result;<NEW_LINE>}
String nodeName = entry.getKey();