auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static boolean recursiveDeleteDirectoryContent(File file) { if (file.isDirectory()) { File[] contents = file.listFiles(); if (contents.length > 0) { for (File f : contents) { if(!recursiveDelete(f)) { return false; } } } } return true; }

Target:
private static boolean recursiveDeleteDirectoryContent(File file) { Boolean deleteSuccessful = true; if (file.isDirectory()) { File[] contents = file.listFiles(); if (contents.length > 0) { for (File f : contents) { if(!recursiveDelete(f)) { deleteSuccessful = false; } } } } return deleteSuccessful; }
Source:
public void transportClientClusterHealth() { try (ElasticsearchContainer container = new ElasticsearchContainer()) { container.start(); TcpHost tcpHost = container.getTcpHost(); TransportAddress transportAddress = new TransportAddress(new InetSocketAddress(tcpHost.getHostname(), tcpHost.getPort())); String expectedClusterName = "docker-cluster"; Settings settings = Settings.builder().put("cluster.name", expectedClusterName).build(); try (TransportClient transportClient = new PreBuiltTransportClient(settings) .addTransportAddress(transportAddress)) { ClusterHealthResponse healths = transportClient.admin().cluster().prepareHealth().get(); String clusterName = healths.getClusterName(); assertThat("Wrong cluster name", CoreMatchers.equalTo(clusterName).matches(expectedClusterName)); } } }

Target:
public void transportClientClusterHealth() { try (ElasticsearchContainer container = new ElasticsearchContainer()) { container.start(); TransportAddress transportAddress = new TransportAddress(container.getTcpHost()); String expectedClusterName = "docker-cluster"; Settings settings = Settings.builder().put("cluster.name", expectedClusterName).build(); try (TransportClient transportClient = new PreBuiltTransportClient(settings) .addTransportAddress(transportAddress)) { ClusterHealthResponse healths = transportClient.admin().cluster().prepareHealth().get(); String clusterName = healths.getClusterName(); assertThat(clusterName, is(expectedClusterName)); } } }
Source:
protected RoutesBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { from("direct:moes") .toD("http://localhost:" + PORT + "/moes?throwExceptionOnFailure=false&drink=${header.drink}"); from("direct:joes") .toD("http://localhost:" + PORT + "/joes?throwExceptionOnFailure=false&drink=${header.drink}"); from("direct:vokda") .setHeader(Exchange.HTTP_PATH, constant("shouldnotcauseproblems")) .setHeader(Exchange.HTTP_QUERY, constant("drink=coke")) .toD("http://localhost:" + PORT + "/joes?throwExceptionOnFailure=false&drink=vodka"); } }; }

Target:
protected RoutesBuilder createRouteBuilder() throws Exception { return new RouteBuilder() { @Override public void configure() throws Exception { from("direct:moes") .toD("http://localhost:" + PORT + "/moes?throwExceptionOnFailure=false&drink=${header.drink}"); from("direct:joes") .toD("http://localhost:" + PORT + "/joes?throwExceptionOnFailure=false&drink=${header.drink}"); from("direct:vodka") .setHeader(Exchange.HTTP_PATH, constant("shouldnotcauseproblems")) .setHeader(Exchange.HTTP_QUERY, constant("drink=coke")) .toD("http://localhost:" + PORT + "/joes?throwExceptionOnFailure=false&drink=vodka"); } }; }
Source:
public void propertyChange(PropertyChangeEvent event) { if (event.getPropertyName().equals(DisplayResolutionDependentFBOs.PRE_FBO_REGENERATION)) { refractiveReflectiveFbo.detachDepthBuffer(); } else if (event.getPropertyName().equals(DisplayResolutionDependentFBOs.POST_FBO_REGENERATION)) { lastUpdatedGBuffer.attachDepthBufferTo(refractiveReflectiveFbo); } else { if (event.getPropertyName().equals(RenderingConfig.NORMAL_MAPPING)) { normalMappingIsEnabled = renderingConfig.isNormalMapping(); if (normalMappingIsEnabled) { addDesiredStateChange(setTerrainNormalsInputTexture); if (parallaxMappingIsEnabled) { addDesiredStateChange(setTerrainHeightInputTexture); } } else { removeDesiredStateChange(setTerrainNormalsInputTexture); if (parallaxMappingIsEnabled) { removeDesiredStateChange(setTerrainHeightInputTexture); } } } else if (event.getPropertyName().equals(RenderingConfig.PARALLAX_MAPPING)) { parallaxMappingIsEnabled = renderingConfig.isParallaxMapping(); if (normalMappingIsEnabled) { if (parallaxMappingIsEnabled) { addDesiredStateChange(setTerrainHeightInputTexture); } else { removeDesiredStateChange(setTerrainHeightInputTexture); } } } else if (event.getPropertyName().equals(RenderingConfig.ANIMATE_WATER)) { animatedWaterIsEnabled = renderingConfig.isAnimateWater(); } worldRenderer.requestTaskListRefresh(); } }

Target:
public void propertyChange(PropertyChangeEvent event) { String propertyName = event.getPropertyName(); switch (propertyName) { case PRE_FBO_REGENERATION: refractiveReflectiveFbo.detachDepthBuffer(); return; case POST_FBO_REGENERATION: lastUpdatedGBuffer.attachDepthBufferTo(refractiveReflectiveFbo); return; case RenderingConfig.NORMAL_MAPPING: normalMappingIsEnabled = renderingConfig.isNormalMapping(); if (normalMappingIsEnabled) { addDesiredStateChange(setTerrainNormalsInputTexture); if (parallaxMappingIsEnabled) { addDesiredStateChange(setTerrainHeightInputTexture); } } else { removeDesiredStateChange(setTerrainNormalsInputTexture); if (parallaxMappingIsEnabled) { removeDesiredStateChange(setTerrainHeightInputTexture); } } break; case RenderingConfig.PARALLAX_MAPPING: if (normalMappingIsEnabled) { parallaxMappingIsEnabled = renderingConfig.isParallaxMapping(); if (parallaxMappingIsEnabled) { addDesiredStateChange(setTerrainHeightInputTexture); } else { removeDesiredStateChange(setTerrainHeightInputTexture); } } break; case RenderingConfig.ANIMATE_WATER: animatedWaterIsEnabled = renderingConfig.isAnimateWater(); break; } worldRenderer.requestTaskListRefresh(); }
Source:
public static Double sphericalDistance(OGCGeometry leftGeometry, OGCGeometry rightGeometry) { if (leftGeometry.isEmpty() || rightGeometry.isEmpty()) { return null; } validateSphericalType("ST_Distance", leftGeometry, EnumSet.of(POINT)); validateSphericalType("ST_Distance", rightGeometry, EnumSet.of(POINT)); Point leftPoint = (Point) leftGeometry.getEsriGeometry(); Point rightPoint = (Point) rightGeometry.getEsriGeometry(); return greatCircleDistance(leftPoint.getY(), leftPoint.getX(), rightPoint.getY(), rightPoint.getX()) * 1000; }

Target:
public static Double sphericalDistance(OGCGeometry leftGeometry, OGCGeometry rightGeometry) { if (leftGeometry.isEmpty() || rightGeometry.isEmpty()) { return null; } validateSphericalType("ST_Distance", leftGeometry, ALLOWED_SPHERICAL_DISTANCE_TYPES); validateSphericalType("ST_Distance", rightGeometry, ALLOWED_SPHERICAL_DISTANCE_TYPES); Point leftPoint = (Point) leftGeometry.getEsriGeometry(); Point rightPoint = (Point) rightGeometry.getEsriGeometry(); return greatCircleDistance(leftPoint.getY(), leftPoint.getX(), rightPoint.getY(), rightPoint.getX()) * 1000; }
Source:
static void setup() { packages.add("symfony/polyfill-mbstring"); packages.add("psr/log"); packages.add("symfony/polyfill-ctype"); packages.add("guzzlehttp/psr7"); }

Target:
static void setup() { packages.add("symfony/polyfill-mbstring"); packages.add("symfony/polyfill-ctype"); packages.add("guzzlehttp/psr7/library"); packages.add("psr/log"); packages.add("symfony/console"); packages.add("symfony/event-dispatcher/1.2.4-dev/library"); packages.add("symfony/finder"); packages.add("symfony/debug"); packages.add("doctrine/instantiator"); packages.add("symfony/process/v1.3.5-p"); packages.add("psr/http-message"); packages.add("magicbart/zf2-log/library"); packages.add("phpbe/ui-category-tree"); packages.add("zhilayun/bbc/v1.4.6"); packages.add("abdulmatinsanni/api-x"); packages.add("gesagtgetan/krakenoptimizer"); packages.add("razielsd/beanstalk-logger"); packages.add("vargas/translate-bundle/composer-plugin"); packages.add("pidsolutions/logger/project"); packages.add("pidsolutions/request"); packages.add("pidsolutions/i18n"); }
Source:
public long extractTimestamp(Tuple tuple) { StreamlineEvent event = (StreamlineEvent) tuple.getValueByField(StreamlineEvent.STREAMLINE_EVENT); Object ts = event.get(fieldName); if (ts == null) { throw new IllegalArgumentException("Streamline event does not contain field: " + fieldName); } if (!(ts instanceof Number)) { throw new IllegalArgumentException("Streamline event does not contain a long value in field: " + fieldName); } return ((Number) ts).longValue(); }

Target:
public long extractTimestamp(Tuple tuple) { StreamlineEvent event = (StreamlineEvent) tuple.getValueByField(StreamlineEvent.STREAMLINE_EVENT); Object ts = event.get(fieldName); if (ts == null || !(ts instanceof Long)) { throw new IllegalArgumentException("Streamline event does not contain a long value in field: " + fieldName); } return (long) ts; }
Source:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { super.configurePipeline(pipelineConfigurer); FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); if (!S3_LOG.equals(config.logFormat) && !CLF_LOG.equals(config.logFormat) && !CLOUDFRONT_LOG.equals(config.logFormat)) { LOG.error("Log format not currently supported."); collector.addFailure(String.format("Unsupported log format: '%s'", config.logFormat), "Log format must be one of the following: S3, CLF, or CLOUDFRONT.").withConfigProperty("logFormat"); } Schema inputSchema = pipelineConfigurer.getStageConfigurer().getInputSchema(); if (inputSchema != null) { if (!inputSchema.getType().equals(Schema.Type.RECORD)) { collector.addFailure("Only Input Schema of type Schema.Type.RECORD is supported", "Input Schema type should be of type Schema.Type.RECORD"); } Schema.Field inputNameSchema = inputSchema.getField(config.inputName); if (inputNameSchema == null) { collector.addFailure(String.format("Field '%s' is not present in the input schema", config.inputName), String.format("The field '%s' must be provided", config.inputName)) .withConfigProperty("inputName").withInputSchemaField(config.inputName); } else { validateInputSchemaType(inputNameSchema.getSchema().getType(), collector); } } pipelineConfigurer.getStageConfigurer().setOutputSchema(LOG_SCHEMA); }

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) throws IllegalArgumentException { super.configurePipeline(pipelineConfigurer); FailureCollector collector = pipelineConfigurer.getStageConfigurer().getFailureCollector(); if (!S3_LOG.equals(config.logFormat) && !CLF_LOG.equals(config.logFormat) && !CLOUDFRONT_LOG.equals(config.logFormat)) { LOG.error("Log format not currently supported."); collector.addFailure(String.format("Format '%s' is not supported.", config.logFormat), String.format("Supported formats are: %s, %s, and %s.", S3_LOG, CLF_LOG, CLOUDFRONT_LOG)) .withConfigProperty(LOG_FORMAT); } Schema inputSchema = pipelineConfigurer.getStageConfigurer().getInputSchema(); if (inputSchema != null) { if (!inputSchema.getType().equals(Schema.Type.RECORD)) { collector.addFailure("Input schema must be of type record.", null); } else { Schema.Field inputNameSchema = inputSchema.getField(config.inputName); if (inputNameSchema == null) { collector.addFailure( String.format("Field '%s' must be present in the input schema.", config.inputName), null) .withConfigProperty(INPUT_NAME); } else { Schema schema = inputNameSchema.getSchema(); if (schema.isNullable()) { schema = schema.getNonNullable(); } validateInputSchemaType(schema, config.inputName, collector); } } } pipelineConfigurer.getStageConfigurer().setOutputSchema(LOG_SCHEMA); }
Source:
public String toString() { return "SubchainInfo [" + "storageDomainId=" + storageDomainId + ", imageGroupId=" + imageGroupId + ", baseImageId=" + baseImageId + ", topImageId=" + topImageId + ']'; }

Target:
public String toString() { return ToStringBuilder.forInstance(this) .append("storageDomainId", storageDomainId) .append("imageGroupId", imageGroupId) .append("baseImageId", baseImageId) .append("topImageId", topImageId) .build(); }
Source:
PeerEurekaNode(PeerAwareInstanceRegistry registry, String targetHost, String serviceUrl, HttpReplicationClient replicationClient, EurekaServerConfig config, int batchSize, long maxBatchingDelayMs, long retrySleepTimeMs, long serverUnavailableSleepTimeMs) { this.registry = registry; this.targetHost = targetHost; this.replicationClient = replicationClient; this.serviceUrl = serviceUrl; this.config = config; this.maxProcessingDelayMs = config.getMaxTimeForReplication(); String batcherName = getBatcherName(); ReplicationTaskProcessor taskProcessor = new ReplicationTaskProcessor(targetHost, replicationClient); this.batchingDispatcher = TaskDispatchers.createBatchingTaskDispatcher( batcherName, config.getMaxElementsInPeerReplicationPool(), batchSize, config.getMaxThreadsForPeerReplication(), maxBatchingDelayMs, serverUnavailableSleepTimeMs, retrySleepTimeMs, taskProcessor ); this.nonBatchingDispatcher = TaskDispatchers.createNonBatchingTaskDispatcher( targetHost, config.getMaxElementsInStatusReplicationPool(), config.getMaxThreadsForStatusReplication(), MAX_BATCHING_DELAY_MS, serverUnavailableSleepTimeMs, retrySleepTimeMs, taskProcessor ); }

Target:
PeerEurekaNode(PeerAwareInstanceRegistry registry, String targetHost, String serviceUrl, HttpReplicationClient replicationClient, EurekaServerConfig config, int batchSize, long maxBatchingDelayMs, long retrySleepTimeMs, long serverUnavailableSleepTimeMs) { this.registry = registry; this.targetHost = targetHost; this.replicationClient = replicationClient; this.serviceUrl = serviceUrl; this.config = config; this.maxProcessingDelayMs = config.getMaxTimeForReplication(); String batcherName = getBatcherName(); ReplicationTaskProcessor taskProcessor = new ReplicationTaskProcessor(targetHost, replicationClient); this.batchingDispatcher = TaskDispatchers.createBatchingTaskDispatcher( batcherName, config.getMaxElementsInPeerReplicationPool(), batchSize, config.getMaxThreadsForPeerReplication(), maxBatchingDelayMs, serverUnavailableSleepTimeMs, retrySleepTimeMs, taskProcessor ); this.nonBatchingDispatcher = TaskDispatchers.createNonBatchingTaskDispatcher( targetHost, config.getMaxElementsInStatusReplicationPool(), config.getMaxThreadsForStatusReplication(), maxBatchingDelayMs, serverUnavailableSleepTimeMs, retrySleepTimeMs, taskProcessor ); }
Source:
public static Optional<SortExpressionContext> extractSortExpression(Set<Symbol> buildSymbols, Expression filter) { if (!DeterminismEvaluator.isDeterministic(filter)) { return Optional.empty(); } List<Expression> filterConjuncts = ExpressionUtils.extractConjuncts(filter); SortExpressionVisitor visitor = new SortExpressionVisitor(buildSymbols); List<SortExpressionContext> sortExpressionCandidates = filterConjuncts.stream() .map(visitor::process) .filter(Optional::isPresent) .map(Optional::get) .collect(groupingBy(SortExpressionContext::getSortExpression, reducing(SortExpressionExtractor::merge))) .values() .stream() .map(Optional::get) .collect(toImmutableList()); return sortExpressionCandidates .stream() .sorted(comparing(context -> -context.getSearchExpressions().size())) .findFirst(); }

Target:
public static Optional<SortExpressionContext> extractSortExpression(Set<Symbol> buildSymbols, Expression filter) { List<Expression> filterConjuncts = ExpressionUtils.extractConjuncts(filter); SortExpressionVisitor visitor = new SortExpressionVisitor(buildSymbols); List<SortExpressionContext> sortExpressionCandidates = filterConjuncts.stream() .filter(DeterminismEvaluator::isDeterministic) .map(visitor::process) .filter(Optional::isPresent) .map(Optional::get) .collect(toMap(SortExpressionContext::getSortExpression, identity(), SortExpressionExtractor::merge)) .values() .stream() .collect(toImmutableList()); return sortExpressionCandidates.stream() .sorted(comparing(context -> -1 * context.getSearchExpressions().size())) .findFirst(); }
Source:
public void setBaseUri(String baseUri) { this.baseUri = baseUri; }

Target:
public void setBaseUri(String baseUri) { this.baseUri = baseUri; this.endpoint.setUri(baseUri); }
Source:
public void simpleMoveTest() { String[] inputFile = { "0a", "00" }; runs = new Run[] { move(0), checkPitch(inputFile), move(1), checkPitch(new String[] { "03", "0a" }), move(1), checkPitch(new String[] { "03", "a3" }), move(1), checkPitch(new String[] { "a3", "33" }), move(1), checkPitch(new String[] { "3a", "33" }), move(4), checkPitch(inputFile), quit() }; sessionTest(runs, Input.getFile(inputFile), "rule=90-90-90-90-90"); }

Target:
public void simpleMoveTest() { String[] inputFile = { "0a", "00" }; runs = new Run[] { move(0), checkPitch(inputFile), move(1), checkPitch(new String[] { "00", "0a" }), move(1), checkPitch(new String[] { "00", "a3" }), move(1), checkPitch(new String[] { "a0", "33" }), move(1), checkPitch(new String[] { "3a", "33" }), move(4), checkPitch(inputFile), quit() }; sessionTest(runs, Input.getFile(inputFile), "rule=90-90-90-90-90"); }
Source:
public List<Proxy> select(URI uri) { return (nonProxyHostsPattern == null || !nonProxyHostsPattern.matcher(uri.getHost()).find()) ? Collections.singletonList(new Proxy(proxyType, proxyAddress)) : null; }

Target:
public List<Proxy> select(URI uri) { return (nonProxyHostsPattern == null || !nonProxyHostsPattern.matcher(uri.getHost()).matches()) ? Collections.singletonList(new Proxy(proxyType, proxyAddress)) : null; }
Source:
public void recalculateJobStates(CuratorFramework client, PathChildrenCache jobDeployments) throws Exception { for (Iterator<String> iterator = new ChildPathIterator<String>(deploymentNameConverter, jobDeployments); iterator.hasNext();) { String jobName = iterator.next(); Job job = deploymentLoader.loadJob(client, jobName, jobFactory); if (job != null) { String jobModulesPath = Paths.build(Paths.JOB_DEPLOYMENTS, jobName); List<ModuleDeploymentStatus> statusList = new ArrayList<ModuleDeploymentStatus>(); List<String> moduleDeployments = client.getChildren().forPath(jobModulesPath); for (String moduleDeployment : moduleDeployments) { JobDeploymentsPath jobDeploymentsPath = new JobDeploymentsPath( Paths.build(jobModulesPath, moduleDeployment)); statusList.add(new ModuleDeploymentStatus( jobDeploymentsPath.getContainer(), new ModuleDescriptor.Key(jobName, ModuleType.job, jobDeploymentsPath.getModuleLabel()), ModuleDeploymentStatus.State.deployed, null)); } DeploymentUnitStatus status = stateCalculator.calculate(job, new JobModuleDeploymentPropertiesProvider(job), statusList); logger.info("Deployment state for job: {}", status); String statusPath = Paths.build(Paths.JOB_DEPLOYMENTS, job.getName(), Paths.STATUS); if (client.checkExists().forPath(statusPath) != null) { client.delete().forPath(statusPath); } client.create().withMode(CreateMode.EPHEMERAL).forPath(statusPath, ZooKeeperUtils.mapToBytes(status.toMap())); } } }

Target:
public void recalculateJobStates(CuratorFramework client, PathChildrenCache jobDeployments) throws Exception { for (Iterator<String> iterator = new ChildPathIterator<String>(deploymentNameConverter, jobDeployments); iterator.hasNext();) { String jobName = iterator.next(); Job job = deploymentLoader.loadJob(client, jobName, jobFactory); if (job != null) { String jobModulesPath = Paths.build(Paths.JOB_DEPLOYMENTS, jobName); List<ModuleDeploymentStatus> statusList = new ArrayList<ModuleDeploymentStatus>(); List<String> moduleDeployments = client.getChildren().forPath(jobModulesPath); for (String moduleDeployment : moduleDeployments) { JobDeploymentsPath jobDeploymentsPath = new JobDeploymentsPath( Paths.build(jobModulesPath, moduleDeployment)); statusList.add(new ModuleDeploymentStatus( jobDeploymentsPath.getContainer(), new ModuleDescriptor.Key(jobName, ModuleType.job, jobDeploymentsPath.getModuleLabel()), ModuleDeploymentStatus.State.deployed, null)); } DeploymentUnitStatus status = stateCalculator.calculate(job, new JobModuleDeploymentPropertiesProvider(job), statusList); logger.info("Deployment status for job '{}': {}", job.getName(), status); String statusPath = Paths.build(Paths.JOB_DEPLOYMENTS, job.getName(), Paths.STATUS); Stat stat = client.checkExists().forPath(statusPath); if (stat != null) { logger.warn("Found unexpected path {}; stat: {}", statusPath, stat); client.delete().forPath(statusPath); } client.create().withMode(CreateMode.EPHEMERAL).forPath(statusPath, ZooKeeperUtils.mapToBytes(status.toMap())); } } }
Source:
private void doRuntimeExceptionRouterTest(RestMethod restMethod) throws Exception { RestRequest restRequest = createRestRequest(restMethod, "/", null, null); RestResponseChannel restResponseChannel = new MockRestResponseChannel(); try { switch (restMethod) { case GET: case DELETE: case HEAD: doOperation(restRequest, restResponseChannel); fail(restMethod + " should have detected a RestServiceException because of a bad router"); break; case POST: JSONObject headers = new JSONObject(); setAmbryHeaders(headers, 0, Utils.Infinite_Time, false, "test-serviceID", "text/plain", "test-ownerId"); restRequest = createRestRequest(restMethod, "/", headers, null); doOperation(restRequest, restResponseChannel); fail("POST should have detected a RestServiceException because of a bad router"); break; case PUT: headers = new JSONObject(); setAmbryHeaders(headers, 0, Utils.Infinite_Time, false, "test-serviceID", "text/plain", "test-ownerId"); restRequest = createRestRequest(restMethod, "/", headers, null); try { doOperation(restRequest, restResponseChannel); } catch (RestServiceException e) { assertEquals("Unexpected error message", "PUT is not supported", e.getMessage()); } break; default: throw new IllegalArgumentException("Unrecognized RestMethod: " + restMethod); } } catch (RuntimeException e) { assertEquals("Unexpected error message", InMemoryRouter.OPERATION_THROW_EARLY_RUNTIME_EXCEPTION, e.getMessage()); } }

Target:
private void doRuntimeExceptionRouterTest(RestMethod restMethod) throws Exception { RestRequest restRequest = createRestRequest(restMethod, "/", null, null); RestResponseChannel restResponseChannel = new MockRestResponseChannel(); try { switch (restMethod) { case GET: case DELETE: case HEAD: doOperation(restRequest, restResponseChannel); fail(restMethod + " should have detected a RestServiceException because of a bad router"); break; case POST: JSONObject headers = new JSONObject(); setAmbryHeaders(headers, 0, Utils.Infinite_Time, false, "test-serviceID", "text/plain", "test-ownerId"); restRequest = createRestRequest(restMethod, "/", headers, null); doOperation(restRequest, restResponseChannel); fail("POST should have detected a RestServiceException because of a bad router"); break; default: throw new IllegalArgumentException("Unrecognized RestMethod: " + restMethod); } } catch (RuntimeException e) { assertEquals("Unexpected error message", InMemoryRouter.OPERATION_THROW_EARLY_RUNTIME_EXCEPTION, e.getMessage()); } }
Source:
public final synchronized JaxRsClientFactory addFeatureToGroup(JaxRsFeatureGroup group, Class<? extends Feature>... features) { Preconditions.checkState(!started, "Already started building clients"); classFeatureMap.putAll(group, Arrays.asList(features)); LOG.trace("Group registers feature {}", group, features); return this; }

Target:
public final synchronized JaxRsClientFactory addFeatureToGroup(JaxRsFeatureGroup group, Class<? extends Feature>... features) { Preconditions.checkState(!started, "Already started building clients"); classFeatureMap.putAll(group, Arrays.asList(features)); LOG.trace("Group registers features {}", group, features); return this; }
Source:
public Mono<Void> send(Flux<?> flux) { MonoProcessor<Void> sendResult = MonoProcessor.create(); disposable = flux .doOnError(e -> this.log.error("Error during processing: ", e)) .retry() .subscribe( consumer, sendResult::onError, sendResult::onComplete); return sendResult; }

Target:
public Mono<Void> send(Flux<?> flux) { MonoProcessor<Void> sendResult = MonoProcessor.create(); this.disposable = flux .doOnError(e -> this.log.error("Error during processing: ", e)) .retry() .subscribe( this.consumer, sendResult::onError, sendResult::onComplete); return sendResult; }
Source:
public void testClassicComparisonVsRange() { final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("classicComparisonVsRange.dmn", this.getClass()); final DMNModel dmnModel = runtime.getModel("<LINK_0>", "Drawing 1"); assertThat(dmnModel, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false)); Random random = new Random(); for (int i = 1; i <= 100; i++) { BigDecimal value = new BigDecimal(random.nextInt(101)); BigDecimal threshold = new BigDecimal(random.nextInt(101)); String expectedResult = value.compareTo(threshold) >= 0 ? "At or Above threshold" : "Lower than threshold"; LOG.info("Execution value threshold expectedResult {}", i, value, threshold, expectedResult); final DMNContext context = DMNFactory.newContext(); context.set("value", value); context.set("threshold", threshold); final DMNResult dmnResult = runtime.evaluateAll(dmnModel, context); LOG.debug("{}", dmnResult); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.hasErrors(), is(false)); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.getDecisionResultByName("classic comparison").getResult(), is(expectedResult)); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.getDecisionResultByName("using range").getResult(), is(expectedResult)); } }

Target:
public void testClassicComparisonVsRange() { final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("classicComparisonVsRange.dmn", this.getClass()); final DMNModel dmnModel = runtime.getModel("<LINK_0>", "Drawing 1"); assertThat(dmnModel, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false)); for (int i = 1; i <= 10; i++) { for (int j = 1; j <= 10; j++) { BigDecimal value = new BigDecimal(i); BigDecimal threshold = new BigDecimal(j); String expectedResult = value.compareTo(threshold) >= 0 ? "At or Above threshold" : "Lower than threshold"; LOG.info("Execution value threshold expectedResult {}", i, value, threshold, expectedResult); final DMNContext context = DMNFactory.newContext(); context.set("value", value); context.set("threshold", threshold); final DMNResult dmnResult = runtime.evaluateAll(dmnModel, context); LOG.debug("{}", dmnResult); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.hasErrors(), is(false)); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.getDecisionResultByName("classic comparison").getResult(), is(expectedResult)); assertThat(DMNRuntimeUtil.formatMessages(dmnResult.getMessages()), dmnResult.getDecisionResultByName("using range").getResult(), is(expectedResult)); } } }
Source:
public RequestIdPolicy() { requestIdSupplier = null; }

Target:
public RequestIdPolicy() { requestIdSupplier = () -> new HttpHeaders().put(REQUEST_ID_HEADER, UUID.randomUUID().toString()); }
Source:
public RemoteInvocationAwareMessageConverterAdapter(MessageConverter delegate) { Assert.notNull(delegate, "'delegate' converter cannot be null"); this.delegate = delegate; }

Target:
public RemoteInvocationAwareMessageConverterAdapter(MessageConverter delegate) { Assert.notNull(delegate, "'delegate' converter cannot be null"); this.delegate = delegate; this.shouldSetClassLoader = false; }
Source:
public String toString() { return "TransactionImp{" + "xid=" + xid + ", status=" + Util.transactionStatusToString(status) + '}'; }

Target:
public String toString() { return "TransactionImpl{" + "xid=" + xid + ", status=" + Util.transactionStatusToString(status) + '}'; }
Source:
public void run() { long startTime = System.currentTimeMillis(); try { mimeMsg = mailSender.createMimeMessage(); msg = new MimeMessageHelper(mimeMsg, MimeMessageHelper.MULTIPART_MODE_MIXED); } catch (MessagingException e) { log.error("Failed to send email to " + userEmail + " for update " + importFile.getAbsolutePath(), e); } try { initializeXMLReader(); processUpdates(); log.info("Finished metadata import for objects in {}ms for user {}", new Object[] {objectCount, System.currentTimeMillis() - startTime, username}); sendCompletedEmail(updated, failed); } catch (FileNotFoundException | XMLStreamException e) { log.info("Errors reading XML during update " + username, e); failed.put(importFile.getAbsolutePath(), "The import file contains XML errors"); sendValidationFailureEmail(failed); } catch (UpdateException e) { log.error("Submitted document is not a bulk-metadata-update doc"); failed.put(importFile.getAbsolutePath(), "File is not a bulk-metadata-update doc"); sendValidationFailureEmail(failed); } finally { close(); cleanup(); } }

Target:
public void run() { long startTime = System.currentTimeMillis(); try { mimeMsg = mailSender.createMimeMessage(); msg = new MimeMessageHelper(mimeMsg, MimeMessageHelper.MULTIPART_MODE_MIXED); } catch (MessagingException e) { log.error("Failed to send email to " + userEmail + " for update " + importFile.getAbsolutePath(), e); } try { initializeXMLReader(); processUpdates(); log.info("Finished metadata import for objects in {}ms for user {}", new Object[] {objectCount, System.currentTimeMillis() - startTime, username}); sendCompletedEmail(updated, failed); } catch (XMLStreamException e) { log.info("Errors reading XML during update " + username, e); failed.put(importFile.getAbsolutePath(), "The import file contains XML errors"); sendValidationFailureEmail(failed); } catch (UpdateException e) { log.error("Submitted document is not a bulk-metadata-update doc"); failed.put(importFile.getAbsolutePath(), "File is not a bulk-metadata-update doc"); sendValidationFailureEmail(failed); } catch (FileNotFoundException e) { log.error("The import file could not be found on the server"); failed.put(importFile.getAbsolutePath(), "Import file could not be found on the server"); sendValidationFailureEmail(failed); } finally { close(); cleanup(); } }
Source:
private void activateActionHandler(String actionDefinitionID) { if (PlatformUI.isWorkbenchRunning()) { setActionDefinitionId(actionDefinitionID); @SuppressWarnings("cast") IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage().getActivePart().getSite() .getService(IHandlerService.class); if (handlerService != null) { handlerService.activateHandler(actionDefinitionID, new ActionHandler(this)); } } }

Target:
private void activateActionHandler(String actionDefinitionID) { if (PlatformUI.isWorkbenchRunning()) { setActionDefinitionId(actionDefinitionID); final IHandlerService handlerService = getHandlerService(); if (handlerService != null) { activatedHandler = handlerService.activateHandler(actionDefinitionID, new ActionHandler(this)); } } }
Source:
private void openFileSystemsInBackground() throws CaseActionCancelledException { if (backgroundOpenFileSystemsFuture != null && !backgroundOpenFileSystemsFuture.isDone()) { backgroundOpenFileSystemsFuture.cancel(true); } BackgroundOpenFileSystemsTask backgroundTask = new BackgroundOpenFileSystemsTask(this.caseDb, new LoggingProgressIndicator()); backgroundOpenFileSystemsFuture = startIngestJobsExecutor.submit(backgroundTask); }

Target:
private void openFileSystemsInBackground() { if (backgroundOpenFileSystemsFuture != null && !backgroundOpenFileSystemsFuture.isDone()) { backgroundOpenFileSystemsFuture.cancel(true); } BackgroundOpenFileSystemsTask backgroundTask = new BackgroundOpenFileSystemsTask(this.caseDb, new LoggingProgressIndicator()); backgroundOpenFileSystemsFuture = openFileSystemsExecutor.submit(backgroundTask); }
Source:
private void updateFavPointBox() { if (cache.getFavoritePoints() > 0) { favoriteLine.left.setVisibility(View.VISIBLE); final StringBuilder favoriteString = new StringBuilder(String.valueOf(cache.getFavoritePoints())); if (cache.getFavoritePoints() > 0 && cache.getFindsCount() > 0) { favoriteString.append(" (" + Math.round((float) cache.getFavoritePoints() / cache.getFindsCount() * 100) + "%)"); } favoriteLine.right.setText(favoriteString.toString()); } else { favoriteLine.left.setVisibility(View.GONE); } final LinearLayout layout = ButterKnife.findById(view, R.id.favpoint_box); final boolean supportsFavoritePoints = cache.supportsFavoritePoints(); layout.setVisibility(supportsFavoritePoints ? View.VISIBLE : View.GONE); if (!supportsFavoritePoints || cache.isOwner() || !Settings.isGCPremiumMember()) { return; } final ImageButton buttonAdd = ButterKnife.findById(view, R.id.add_to_favpoint); final ImageButton buttonRemove = ButterKnife.findById(view, R.id.remove_from_favpoint); final TextView text = ButterKnife.findById(view, R.id.favpoint_text); if (cache.isFavorite()) { buttonAdd.setVisibility(View.GONE); buttonRemove.setVisibility(View.VISIBLE); text.setText(R.string.cache_favpoint_on); } else { buttonAdd.setVisibility(View.VISIBLE); buttonRemove.setVisibility(View.GONE); text.setText(R.string.cache_favpoint_not_on); } if (!cache.isFound()) { buttonAdd.setEnabled(false); buttonAdd.setVisibility(View.GONE); buttonRemove.setEnabled(false); buttonRemove.setVisibility(View.GONE); } }

Target:
private void updateFavPointBox() { final int favCount = cache.getFavoritePoints(); if (favCount >= 0) { favoriteLine.left.setVisibility(View.VISIBLE); final int findsCount = cache.getFindsCount(); if (findsCount > 0) { favoriteLine.right.setText(res.getString(R.string.favorite_count_percent, favCount, (float) (favCount * 100) / findsCount)); } else { favoriteLine.right.setText(res.getString(R.string.favorite_count, favCount)); } } else { favoriteLine.left.setVisibility(View.GONE); } final LinearLayout layout = ButterKnife.findById(view, R.id.favpoint_box); final boolean supportsFavoritePoints = cache.supportsFavoritePoints(); layout.setVisibility(supportsFavoritePoints ? View.VISIBLE : View.GONE); if (!supportsFavoritePoints || cache.isOwner() || !Settings.isGCPremiumMember()) { return; } final ImageButton buttonAdd = ButterKnife.findById(view, R.id.add_to_favpoint); final ImageButton buttonRemove = ButterKnife.findById(view, R.id.remove_from_favpoint); final TextView text = ButterKnife.findById(view, R.id.favpoint_text); if (cache.isFavorite()) { buttonAdd.setVisibility(View.GONE); buttonRemove.setVisibility(View.VISIBLE); text.setText(R.string.cache_favpoint_on); } else { buttonAdd.setVisibility(View.VISIBLE); buttonRemove.setVisibility(View.GONE); text.setText(R.string.cache_favpoint_not_on); } if (!cache.isFound()) { buttonAdd.setEnabled(false); buttonAdd.setVisibility(View.GONE); buttonRemove.setEnabled(false); buttonRemove.setVisibility(View.GONE); } }
Source:
public CachePartitionFullCountersMap(CachePartitionFullCountersMap other) { if(other.initialUpdCntrs != null) initialUpdCntrs = Arrays.copyOf(other.initialUpdCntrs, other.initialUpdCntrs.length); if(updCntrs != null) updCntrs = Arrays.copyOf(other.updCntrs, other.updCntrs.length); }

Target:
public CachePartitionFullCountersMap(CachePartitionFullCountersMap other) { if (other.initialUpdCntrs != null) initialUpdCntrs = Arrays.copyOf(other.initialUpdCntrs, other.initialUpdCntrs.length); if (other.updCntrs != null) updCntrs = Arrays.copyOf(other.updCntrs, other.updCntrs.length); }
Source:
public O compute2(final I kernel, final Dimensions paddedDimensions) { Dimensions paddedFFTMethodsInputDimensions = FFTMethodsUtility .getPaddedInputDimensionsRealToComplex(fast, paddedDimensions); final Interval kernelConvolutionInterval = ops().filter() .paddingIntervalCentered(kernel, paddedFFTMethodsInputDimensions); final Interval kernelConvolutionIntervalOrigin = ops().filter() .paddingIntervalOrigin(kernel, kernelConvolutionInterval); return (O) Views.interval(Views.extendPeriodic(Views.interval(Views .extendValue(kernel, Util.getTypeFromInterval(kernel).createVariable()), kernelConvolutionInterval)), kernelConvolutionIntervalOrigin); }

Target:
public O compute2(final I kernel, final Dimensions paddedDimensions) { Dimensions paddedFFTMethodsInputDimensions = FFTMethodsUtility .getPaddedInputDimensionsRealToComplex(fast, paddedDimensions); final Interval kernelConvolutionInterval = paddingIntervalCentered.compute2( kernel, paddedFFTMethodsInputDimensions); final Interval kernelConvolutionIntervalOrigin = paddingIntervalOrigin .compute2(kernel, kernelConvolutionInterval); return (O) Views.interval(Views.extendPeriodic(Views.interval(Views .extendValue(kernel, Util.getTypeFromInterval(kernel).createVariable()), kernelConvolutionInterval)), kernelConvolutionIntervalOrigin); }
Source:
public void testEnsureSize() { assertEquals(ensureSize(null, 42).length(), 42); Slice fourBytes = wrappedBuffer(new byte[] {1, 2, 3, 4}); assertSame(ensureSize(fourBytes, 3), fourBytes); Slice slice = ensureSize(fourBytes, 8); assertEquals(slice.length(), 8); assertEquals(slice.getBytes(), new byte[] {1, 2, 3, 4, 0, 0, 0, 0}); slice = ensureSize(fourBytes, 5); assertEquals(slice.length(), 8); assertEquals(slice.getBytes(), new byte[] {1, 2, 3, 4, 0, 0, 0, 0}); slice = ensureSize(allocate(Integer.MAX_VALUE - 100), Integer.MAX_VALUE - 50); assertEquals(slice.length(), Slices.MAX_ARRAY_SIZE); }

Target:
public void testEnsureSize() { Slice fourBytes = wrappedBuffer(new byte[] {1, 2, 3, 4}); assertEquals(ensureSize(null, 42).length(), 42); assertSame(ensureSize(fourBytes, 3), fourBytes); assertEquals(ensureSize(fourBytes, 8), wrappedBuffer(new byte[] {1, 2, 3, 4, 0, 0, 0, 0})); assertEquals(ensureSize(fourBytes, 5), wrappedBuffer(new byte[] {1, 2, 3, 4, 0, 0, 0, 0})); double initialSize = Integer.MAX_VALUE + 100L; while (initialSize > 50_000_000 && initialSize / SLICE_ALLOW_SKEW > SLICE_ALLOC_THRESHOLD) { initialSize /= SLICE_ALLOW_SKEW; } assertEquals(ensureSize(allocate((int) initialSize), Integer.MAX_VALUE - 50).length(), MAX_ARRAY_SIZE); }
Source:
public TestProject(final boolean remove, String path, boolean insidews, File workspaceSupplement) throws CoreException { this.workspaceSupplement = workspaceSupplement; IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProjectDescription description = createDescription(path, insidews, root); project = root.getProject(description.getName()); if (remove) { deleteProject(); } IPath locationBefore = null; URI locationURI = description.getLocationURI(); if (locationURI != null) { locationBefore = URIUtil.toPath(locationURI); } if (locationBefore == null) { locationBefore = root.getRawLocation().append(path); } location = locationBefore.toOSString(); project.create(description, null); project.open(null); javaProject = JavaCore.create(project); binFolder = createBinFolder(); setJavaNature(); javaProject.setRawClasspath(new IClasspathEntry[0], null); createOutputFolder(binFolder); addSystemLibraries(); }

Target:
public TestProject(final boolean remove, String path, boolean insidews, File workspaceSupplement) throws CoreException { this.workspaceSupplement = workspaceSupplement; IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProjectDescription description = createDescription(path, insidews, root); project = root.getProject(description.getName()); if (remove) { TestUtils.deleteProject(project); } IPath locationBefore = null; URI locationURI = description.getLocationURI(); if (locationURI != null) { locationBefore = URIUtil.toPath(locationURI); } if (locationBefore == null) { locationBefore = root.getRawLocation().append(path); } location = locationBefore.toOSString(); project.create(description, null); project.open(null); javaProject = JavaCore.create(project); binFolder = createBinFolder(); setJavaNature(); javaProject.setRawClasspath(new IClasspathEntry[0], null); createOutputFolder(binFolder); addSystemLibraries(); }
Source:
public MetricsEndpoint(MeterRegistryService meterRegistryService) { LOGGER.debug("Starting Metrics endpoint..."); if (meterRegistryService == null) { LOGGER.warn("MeterRegistryService is null!"); } this.meterRegistryService = meterRegistryService; }

Target:
public MetricsEndpoint(MeterRegistryService meterRegistryService) { LOGGER.debug("Starting Metrics endpoint..."); Validate.notNull(meterRegistryService, "Argument meterRegistryService cannot be null"); this.meterRegistryService = meterRegistryService; }
Source:
private List<Pipeline> fetchHydratedPipelines() { List<Pipeline> rawPipelines = front50.getPipelines(); if (rawPipelines == null) { return Collections.EMPTY_LIST; } Map<Boolean, List<Pipeline>> partitionedByTemplated = rawPipelines.stream() .collect(Collectors.partitioningBy(p -> p.getType() != null && p.getType().equals("templatedPipeline"))); List<Pipeline> templatedPipelines = partitionedByTemplated.get(Boolean.TRUE); Map<Boolean, List<Pipeline>> partitionedByV2Schema = templatedPipelines.stream() .filter(p -> p.getSchema() != null) .collect(Collectors.partitioningBy(p -> p.getSchema().equals("v2"))); List<Pipeline> v2Templated = partitionedByV2Schema.get(Boolean.TRUE); List<Pipeline> v1Templated = partitionedByV2Schema.get(Boolean.FALSE); List<Pipeline> plannedV1Templated = v1Templated.stream().filter(Objects::nonNull) .map(p -> orca.plan(objectMapper.convertValue(p, Map.class), false)) .map(m -> objectMapper.convertValue(m, Pipeline.class)) .collect(Collectors.toList()); List<Pipeline> plannedV2Templated = v2Templated.stream().filter(Objects::nonNull) .map(p -> orca.v2Plan(objectMapper.convertValue(p, Map.class))) .map(m -> objectMapper.convertValue(m, Pipeline.class)) .collect(Collectors.toList()); rawPipelines = partitionedByTemplated.get(Boolean.FALSE); rawPipelines.addAll(plannedV1Templated); rawPipelines.addAll(plannedV2Templated); return rawPipelines; }

Target:
private List<Pipeline> fetchHydratedPipelines() { List<Map<String, Object>> rawPipelines = front50.getPipelines(); if (rawPipelines == null) { return Collections.emptyList(); } Predicate<Map<String, Object>> isV2Pipeline = p -> { return p.getOrDefault("type", "").equals("templatedPipeline") && p.getOrDefault("schema", "").equals("v2"); }; return rawPipelines.stream() .map((Map<String, Object> p) -> { if (isV2Pipeline.test(p)) { try { return orca.v2Plan(p); } catch (Exception e) { log.error("Caught exception while planning templated pipeline: {}", p, e); return Collections.emptyMap(); } } else { return p; } }) .filter(m -> !m.isEmpty()) .map(m -> objectMapper.convertValue(m, Pipeline.class)) .collect(Collectors.toList()); }
Source:
public Long getPeerRouterId(String publicMacAddress, final long routerId) { final SearchCriteria<NicVO> sc = PeerRouterSearch.create(); sc.setParameters("instanceId", routerId); sc.setParameters("macAddress", publicMacAddress); sc.setParameters("vmType", VirtualMachine.Type.DomainRouter); NicVO nicVo = findOneBy(sc); if (nicVo != null) { return (new Long(nicVo.getInstanceId())); } return null; }

Target:
public Long getPeerRouterId(String publicMacAddress, final long routerId) { final SearchCriteria<NicVO> sc = PeerRouterSearch.create(); sc.setParameters("instanceId", routerId); sc.setParameters("macAddress", publicMacAddress); sc.setParameters("vmType", VirtualMachine.Type.DomainRouter); NicVO nicVo = findOneBy(sc); if (nicVo != null) { return nicVo.getInstanceId(); } return null; }
Source:
public SemanticApiReporter(SemanticMetricRegistry registry) { final MetricId base = MetricId.build().tagged("component", COMPONENT); sliQueryLatencyForSmallQueries = registry.histogram( base.tagged("what", "sli-query-latency-for-small-queries", "unit", Units.MILLISECOND)); }

Target:
public SemanticApiReporter(SemanticMetricRegistry registry) { final MetricId base = MetricId.build().tagged("component", COMPONENT); smallQueryLatency = registry.histogram( base.tagged("what", "small-query-latency", "unit", Units.MILLISECOND)); }
Source:
public B setRyaPrefix(String prefix) { Preconditions.checkNotNull(prefix, "Rya prefix cannot be null."); this.prefix = prefix; return confBuilder(); }

Target:
public B setRyaPrefix(String prefix) { this.prefix = prefix; return confBuilder(); }
Source:
public ServiceBuilder<RemoteCacheContainer> build(ServiceTarget target) { Function<RemoteCacheManager, RemoteCacheContainer> mapper = remoteCacheManager -> new ManagedRemoteCacheContainer(this.name, remoteCacheManager); Supplier<RemoteCacheManager> supplier = () -> { Configuration configuration = this.configuration.getValue(); RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configuration); remoteCacheManager.start(); InfinispanLogger.ROOT_LOGGER.debugf("%s remote cache container started", this.name); return remoteCacheManager; }; Consumer<RemoteCacheManager> destroyer = remoteCacheManager -> { remoteCacheManager.stop(); InfinispanLogger.ROOT_LOGGER.debugf("%s remote cache container stopped", this.name); }; Service<RemoteCacheContainer> service = new SuppliedValueService<>(mapper, supplier, destroyer); ServiceBuilder<RemoteCacheContainer> builder = target.addService(this.getServiceName(), service) .setInitialMode(ServiceController.Mode.ON_DEMAND) ; return this.configuration.register(builder); }

Target:
public ServiceBuilder<RemoteCacheContainer> build(ServiceTarget target) { Service<RemoteCacheContainer> service = new SuppliedValueService<>(this, this, this); ServiceBuilder<RemoteCacheContainer> builder = new AsynchronousServiceBuilder<>(this.getServiceName(), service).build(target) .setInitialMode(ServiceController.Mode.ON_DEMAND); return this.configuration.register(builder); }
Source:
private boolean removeMemoryVolumes(String memVols) { List<Guid> guids = GuidUtils.getGuidListFromString(memVols); if (guids.size() != NUM_OF_UUIDS_IN_MEMORY_STATE) { log.warn("Cannot remove memory volumes, invalid format '{}'", memVols); return true; } Guid memoryImageRemovalTaskId = removeMemoryImage(guids); if (memoryImageRemovalTaskId == null) { return false; } Guid confImageRemovalTaskId = removeConfImage(guids); if (startPollingTasks) { if (!Guid.Empty.equals(memoryImageRemovalTaskId)) { enclosingCommand.getCommandCoordinatorUtil().startPollingTask(memoryImageRemovalTaskId); } if (confImageRemovalTaskId != null && !Guid.Empty.equals(confImageRemovalTaskId)) { enclosingCommand.getCommandCoordinatorUtil().startPollingTask(confImageRemovalTaskId); } } return confImageRemovalTaskId != null; }

Target:
private boolean removeMemoryVolumes(String memVols) { List<Guid> guids = GuidUtils.getGuidListFromString(memVols); if (guids.size() != NUM_OF_UUIDS_IN_MEMORY_STATE) { log.warn("Cannot remove memory volumes, invalid format '{}'", memVols); return true; } Guid memoryImageRemovalTaskId = removeMemoryImage(guids); if (memoryImageRemovalTaskId == null) { return false; } Guid confImageRemovalTaskId = removeConfImage(guids); if (startPollingTasks) { if (!Guid.Empty.equals(memoryImageRemovalTaskId)) { commandCoordinatorUtil.startPollingTask(memoryImageRemovalTaskId); } if (confImageRemovalTaskId != null && !Guid.Empty.equals(confImageRemovalTaskId)) { commandCoordinatorUtil.startPollingTask(confImageRemovalTaskId); } } return confImageRemovalTaskId != null; }
Source:
public boolean hasNamedParameter() { for (ParameterBinding binding : bindings) { if (binding.getName() != null) { return true; } } return false; }

Target:
public boolean hasNamedParameter() { return bindings.stream() .anyMatch(b -> b.getName() != null); }
Source:
private void initializeHandler(final Thing thing) { ThingType thingType = thingTypeRegistry.getThingType(thing.getThingTypeUID()); ThingFactoryHelper.applyDefaultConfiguration(thing.getConfiguration(), thingType, configDescriptionRegistry); if (isInitializable(thing, thingType)) { ThingStatusInfo statusInfo = buildStatusInfo(ThingStatus.INITIALIZING, ThingStatusDetail.NONE); setThingStatus(thing, statusInfo); initializeHandler(thing, thing.getHandler()); } else { logger.debug("Thing '{}' not initializable, check required configuration parameters.", thing.getUID()); ThingStatusInfo statusInfo = buildStatusInfo(ThingStatus.UNINITIALIZED, ThingStatusDetail.HANDLER_CONFIGURATION_PENDING); setThingStatus(thing, statusInfo); } }

Target:
private void initializeHandler(final Thing thing) { ThingType thingType = thingTypeRegistry.getThingType(thing.getThingTypeUID()); if (thingType != null) { ThingFactoryHelper.applyDefaultConfiguration(thing.getConfiguration(), thingType, configDescriptionRegistry); } if (isInitializable(thing, thingType)) { ThingStatusInfo statusInfo = buildStatusInfo(ThingStatus.INITIALIZING, ThingStatusDetail.NONE); setThingStatus(thing, statusInfo); initializeHandler(thing, thing.getHandler()); } else { logger.debug("Thing '{}' not initializable, check required configuration parameters.", thing.getUID()); ThingStatusInfo statusInfo = buildStatusInfo(ThingStatus.UNINITIALIZED, ThingStatusDetail.HANDLER_CONFIGURATION_PENDING); setThingStatus(thing, statusInfo); } }