auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean hasJackson25() { try { <START> ObjectMapper.class.getMethod("writerFor", Class.class); <END> return true; } catch (NoSuchMethodException e) { return false; } }</code><technical_language>more specifically, try writerFor(JavaType)....but a</technical_language>

Target:
private boolean hasJackson25() { try { ObjectMapper.class.getMethod("writerFor", JavaType.class); return true; } catch (NoSuchMethodException e) { return false; } }
Source:
<code><START> private int doDeliver(ShardProcessingSession session) { <END> ShardIndex index = session.shardIndex(); Timestamp now = Time.currentTime(); Timestamp idempotenceWndStart = Timestamps.subtract(now, idempotenceWindow); Page<InboxMessage> startingPage = inboxStorage.contentsBackwards(index); Optional<Page<InboxMessage>> maybePage = Optional.of(startingPage); int totalMessagesDelivered = 0; while (maybePage.isPresent()) { Page<InboxMessage> currentPage = maybePage.get(); ImmutableList<InboxMessage> messages = currentPage.contents(); if (messages.isEmpty()) { maybePage = currentPage.next(); continue; } MessageClassifier classifier = MessageClassifier.of(messages, idempotenceWndStart); ImmutableList<InboxMessage> toDeliver = classifier.toDeliver(); if (!toDeliver.isEmpty()) { ImmutableList<InboxMessage> idempotenceSource = classifier.idempotenceSource(); ImmutableList<RuntimeException> observedExceptions = deliverByType(toDeliver, idempotenceSource); int deliveredInBatch = toDeliver.size(); totalMessagesDelivered += deliveredInBatch; if (!observedExceptions.isEmpty()) { throw observedExceptions.iterator() .next(); } } ImmutableList<InboxMessage> toRemove = classifier.removals(); inboxStorage.removeAll(toRemove); maybePage = currentPage.next(); } return totalMessagesDelivered; }</code><technical_language>Please split this method pieces. is hard understand in a linear way, is, jumping lines</technical_language>

Target:
private int doDeliver(ShardProcessingSession session) { ShardIndex index = session.shardIndex(); Timestamp now = Time.currentTime(); Timestamp idempotenceWndStart = Timestamps.subtract(now, idempotenceWindow); Page<InboxMessage> startingPage = inboxStorage.readAll(index); Optional<Page<InboxMessage>> maybePage = Optional.of(startingPage); int totalMessagesDelivered = 0; while (maybePage.isPresent()) { Page<InboxMessage> currentPage = maybePage.get(); ImmutableList<InboxMessage> messages = currentPage.contents(); if (!messages.isEmpty()) { MessageClassifier classifier = MessageClassifier.of(messages, idempotenceWndStart); int deliveredInBatch = deliverClassified(classifier); totalMessagesDelivered += deliveredInBatch; ImmutableList<InboxMessage> toRemove = classifier.removals(); inboxStorage.removeAll(toRemove); } maybePage = currentPage.next(); } return totalMessagesDelivered; }
Source:
<code>private int getMateAlignmentStartImpl() { try { if (isAligned && getReadPairedFlag() && !getMateUnmappedFlag()) { Alignment mate = getCurrentAlignment().getMateAlignment(); return (int) mate.getAlignmentPosition() + 1; } } catch (ErrorMsg e) { throw new RuntimeException(e); } <START> return 0; <END> }</code><technical_language>existing constant SAMRecord.NO_ALIGNMENT_START</technical_language>

Target:
private int getMateAlignmentStartImpl() { try { if (isAligned && getReadPairedFlag() && !getMateUnmappedFlag()) { Alignment mate = getCurrentAlignment().getMateAlignment(); return (int) mate.getAlignmentPosition() + 1; } } catch (ErrorMsg e) { throw new RuntimeException(e); } return SAMRecord.NO_ALIGNMENT_START; }
Source:
<code>public ItemsWrapper<SubscriptionEventTypeStats> getSubscriptionStat(final String subscriptionId, final StatsMode statsMode, final Span span) throws InconsistentStateException, NoSuchEventTypeException, NoSuchSubscriptionException, ServiceTemporarilyUnavailableException { final Subscription subscription; try { subscription = subscriptionRepository.getSubscription(subscriptionId); authorizationValidator.authorizeSubscriptionView(subscription); } catch (final ServiceTemporarilyUnavailableException ex) { <START> TracingService.logErrorInSpan(span, ex.getMessage()); <END> throw new InconsistentStateException(ex.getMessage()); } final List<SubscriptionEventTypeStats> subscriptionStat = createSubscriptionStat(subscription, statsMode); return new ItemsWrapper<>(subscriptionStat); }</code><technical_language>In case if ex.getMessage() is Null for some reason, error logged (I is that), sense add method TracingService.logErrorInSpan(span, ex) this problem</technical_language>

Target:
public ItemsWrapper<SubscriptionEventTypeStats> getSubscriptionStat(final String subscriptionId, final StatsMode statsMode, final Span span) throws InconsistentStateException, NoSuchEventTypeException, NoSuchSubscriptionException, ServiceTemporarilyUnavailableException { final Subscription subscription; try { subscription = subscriptionRepository.getSubscription(subscriptionId); authorizationValidator.authorizeSubscriptionView(subscription); } catch (final ServiceTemporarilyUnavailableException ex) { TracingService.logErrorInSpan(span, ex); throw new InconsistentStateException(ex.getMessage()); } final List<SubscriptionEventTypeStats> subscriptionStat = createSubscriptionStat(subscription, statsMode); return new ItemsWrapper<>(subscriptionStat); }
Source:
<code><START> protected static void hashRow(List<DimensionSelector> selectorList, HyperLogLogCollector collector) <END> { final Hasher hasher = hashFn.newHasher(); for (int k = 0; k < selectorList.size(); ++k) { if(k != 0) { hasher.putByte((byte)0); } final DimensionSelector selector = selectorList.get(k); final IndexedInts row = selector.getRow(); final int size = row.size(); if (size == 1) { final String value = selector.lookupName(row.get(0)); hasher.putString(value != null ? value : NULL_STRING); } else if (size == 0) { } else { final String[] values = new String[size]; for (int i = 0; i < size; ++i) { final String value = selector.lookupName(row.get(i)); values[i] = value != null ? value : NULL_STRING; } Arrays.sort(values); for (int i = 0; i < size; ++i) { if(i != 0) { hasher.putChar(SEPARATOR); } final String value = values[i]; hasher.putString(value); } } } collector.add(hasher.hash().asBytes()); }</code><technical_language>general formatting in this file needs fixed also, open source a style guide</technical_language>

Target:
protected static void hashRow(List<DimensionSelector> selectorList, HyperLogLogCollector collector) { final Hasher hasher = hashFn.newHasher(); for (int k = 0; k < selectorList.size(); ++k) { if (k != 0) { hasher.putByte((byte) 0); } final DimensionSelector selector = selectorList.get(k); final IndexedInts row = selector.getRow(); final int size = row.size(); if (size == 1) { final String value = selector.lookupName(row.get(0)); hasher.putString(value != null ? value : NULL_STRING); } else if (size != 0) { final String[] values = new String[size]; for (int i = 0; i < size; ++i) { final String value = selector.lookupName(row.get(i)); values[i] = value != null ? value : NULL_STRING; } Arrays.sort(values); for (int i = 0; i < size; ++i) { if (i != 0) { hasher.putChar(SEPARATOR); } hasher.putString(values[i]); } } } collector.add(hasher.hash().asBytes()); }
Source:
<code>private Map<String, ExternalMergeTool> setupPredefinedTools() { Map<String, ExternalMergeTool> tools = new TreeMap<>(); for (PreDefinedMergeTools tool : PreDefinedMergeTools.values()) { tools.put(tool.name(), new PreDefinedMergeTool(tool.name(), tool.getPath(), <START> tool.getParameters(true), tool.getParameters(false), <END> BooleanOption.toConfigured(tool.isExitCodeTrustable()))); } return tools; }</code><technical_language>PreDefinedMergeTool a PreDefinedMergeTools enum object in constructor? I "s" in PreDefinedMergeTools is unusual for enum type naming? code awkward read</technical_language>

Target:
private Map<String, ExternalMergeTool> setupPredefinedTools() { Map<String, ExternalMergeTool> tools = new TreeMap<>(); for (CommandLineMergeTool tool : CommandLineMergeTool.values()) { tools.put(tool.name(), new PreDefinedMergeTool(tool)); } return tools; }
Source:
<code>public boolean equals(Object obj) { if (this == obj) return true; if (obj == null || getClass() != obj.getClass()) return false; AvailabilityZone that = AvailabilityZone.class.cast(obj); <START> return Objects.equal(this.name, that.name) && this.state.equals(that.state); <END> }</code><technical_language>java return Objects.equal(this.name, that.name) && Objects.equal(this.state, that.state);</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null || getClass() != obj.getClass()) return false; AvailabilityZone that = AvailabilityZone.class.cast(obj); return Objects.equal(this.name, that.name) && Objects.equal(this.state, that.state); }
Source:
<code>public void testIfEOModelIsRecognizedAsEngineeringObject_shouldWork() throws Exception { Class<?> eo = registry.loadModel(getEOModelDescription()); <START> assertThat(ModelUtils.isEngineeringObjectClass(eo), is(true)); <END> }</code><technical_language>isEngeneeringObjectMatcher this code more readable; assertThat(eo, is(engineeringObject()));</technical_language>

Target:
public void testIfEOModelIsRecognizedAsEngineeringObject_shouldWork() throws Exception { Class<?> eo = registry.loadModel(getEOModelDescription()); assertThat(SimpleModelWrapper.isEngineeringObjectClass(eo), is(true)); }
Source:
<code>public void testDeleteMavenPathInRepository(@MavenRepository(repositoryId = MAVEN_REPOSITORY_RELEASES, setup = MavenIndexedRepositorySetup.class) Repository repository, @MavenTestArtifact(repositoryId = MAVEN_REPOSITORY_RELEASES, id = "com.artifacts.to.delete.releases:delete-foo", versions = "1.2.1") <START> Path path) <END> throws Exception { deleteRepositoryPath(repository, path); }</code><technical_language>Cosmetic: please align this path parameter annotation above</technical_language>

Target:
public void testDeleteMavenPathInRepository(@MavenRepository(repositoryId = MAVEN_REPOSITORY_RELEASES, setup = MavenIndexedRepositorySetup.class) Repository repository, @MavenTestArtifact(repositoryId = MAVEN_REPOSITORY_RELEASES, id = "com.artifacts.to.delete.releases:delete-foo", versions = "1.2.1") Path path) throws Exception { deleteRepositoryPath(repository, path, false); }
Source:
<code>private List<String> internalListTables(String prefix) { try { <START> List<String> tables; <END> if (prefix.isEmpty()) { tables = client.getTablesList().getTablesList(); } else { tables = client.getTablesList(prefix).getTablesList().stream() .filter(name -> name.startsWith(prefix)).collect(toImmutableList()); } return tables; } catch (KuduException e) { throw new PrestoException(GENERIC_INTERNAL_ERROR, e); } }</code><technical_language>this variable is needed</technical_language>

Target:
private List<String> internalListTables(String prefix) { try { if (prefix.isEmpty()) { return client.getTablesList().getTablesList(); } else { return client.getTablesList(prefix).getTablesList(); } } catch (KuduException e) { throw new PrestoException(GENERIC_INTERNAL_ERROR, e); } }
Source:
<code>public boolean matches(final RelOptRuleCall call) { Preconditions.checkArgument(call.rels.length > 2); VoltPhysicalTableSequentialScan scan = call.rel(call.rels.length - 2); Preconditions.checkArgument(scan.getVoltTable() != null && scan.getVoltTable().getCatalogTable() != null); CatalogMap<Index> indexMap = scan.getVoltTable().getCatalogTable().getIndexes(); <START> return (indexMap != null && !indexMap.isEmpty()) ? <END> true : false; }</code><technical_language>Return condition simplified</technical_language>

Target:
public boolean matches(final RelOptRuleCall call) { Preconditions.checkArgument(call.rels.length > 2); VoltPhysicalTableSequentialScan scan = call.rel(call.rels.length - 2); Preconditions.checkArgument(scan.getVoltTable() != null && scan.getVoltTable().getCatalogTable() != null); CatalogMap<Index> indexMap = scan.getVoltTable().getCatalogTable().getIndexes(); return indexMap != null && !indexMap.isEmpty(); }
Source:
<code>public BaseTask(final String name, final String taskType) { super(Promises.settable()); _name = truncate(name); final State state = State.INIT; _shallowTraceBuilder = new ShallowTraceBuilder(_id); _shallowTraceBuilder.setName(getName()); _shallowTraceBuilder.setResultType(ResultType.UNFINISHED); if (taskType != null) { _shallowTraceBuilder.setTaskType(taskType); } _stateRef = new AtomicReference<>(state); <START> if (ParSeqGlobalConfiguration.getInstance().isCrossThreadStackTracesEnabled()) { <END> _taskStackTrace = Thread.currentThread().getStackTrace(); } else { _taskStackTrace = null; } }</code><technical_language>ParSeqGlobalConfiguration.getInstance().isCrossThreadStackTracesEnabled() a bit verbose. I static methods in ParSeqGlobalConfiguration is a idea all</technical_language>

Target:
public BaseTask(final String name, final String taskType) { super(Promises.settable()); _name = truncate(name); final State state = State.INIT; _shallowTraceBuilder = new ShallowTraceBuilder(_id); _shallowTraceBuilder.setName(getName()); _shallowTraceBuilder.setResultType(ResultType.UNFINISHED); if (taskType != null) { _shallowTraceBuilder.setTaskType(taskType); } _stateRef = new AtomicReference<>(state); if (ParSeqGlobalConfiguration.isCrossThreadStackTracesEnabled()) { _taskStackTrace = Thread.currentThread().getStackTrace(); } else { _taskStackTrace = null; } }
Source:
<code>private Mono<HttpClientRequest> addAuthorization(Mono<HttpClientRequest> request) { return Mono .zip(request, token) <START> .map(tuple -> tuple.getT1().addHeader(HttpHeaderNames.AUTHORIZATION, tuple.getT2())); <END> }</code><technical_language>Oh! I zip(). token is a Mono. Well, I .block() especially for cached in-memory evil all. I I reason in extra zip for resolving credential demand</technical_language>

Target:
private Mono<HttpClientRequest> addAuthorization(Mono<HttpClientRequest> request) { return Mono .zip(request, this.token) .map(tuple -> tuple.getT1().header(HttpHeaderNames.AUTHORIZATION, tuple.getT2())); }
Source:
<code>private void mapNodes() { if (fNodesList == null) { fNodesMap = new HashMap<>(1); return; } fNodesMap = new HashMap<>(fNodesList.size() * 4 / 3); for (ModelDelta <START> element : <END> fNodesList) { mapNode( element ); } }</code><technical_language>please name 4 loop vars node delta</technical_language>

Target:
private void mapNodes() { if (fNodesList == null) { fNodesMap = new HashMap<>(1); return; } fNodesMap = new HashMap<>(fNodesList.size() * 4 / 3); for (ModelDelta node : fNodesList) { mapNode( node ); } }
Source:
<code>public void sendPutResponse(RequestResponseChannel requestResponseChannel, PutResponse response, Request request, MetricsHistogram responseQueueTime, MetricsHistogram responseSendTime, MetricsHistogram requestTotalTime, long totalTimeSpent, long blobSize, ServerMetrics metrics) throws InterruptedException { <START> if(response.getError() == ServerErrorCode.No_Error){ <END> metrics.markPutBlobRequestRate(blobSize); if (blobSize <= ServerMetrics.smallBlob) { requestResponseChannel.sendResponse(response, request, new NetworkRequestMetrics(responseQueueTime, responseSendTime, requestTotalTime, new HistogramMeasurement(metrics.putSmallBlobProcessingTimeInMs), new HistogramMeasurement(metrics.putSmallBlobTotalTimeInMs), totalTimeSpent)); } else if (blobSize <= ServerMetrics.mediumBlob) { requestResponseChannel.sendResponse(response, request, new NetworkRequestMetrics(responseQueueTime, responseSendTime, requestTotalTime, new HistogramMeasurement(metrics.putMediumBlobProcessingTimeInMs), new HistogramMeasurement(metrics.putMediumBlobTotalTimeInMs), totalTimeSpent)); } else { requestResponseChannel.sendResponse(response, request, new NetworkRequestMetrics(responseQueueTime, responseSendTime, requestTotalTime, new HistogramMeasurement(metrics.putLargeBlobProcessingTimeInMs), new HistogramMeasurement(metrics.putLargeBlobTotalTimeInMs), totalTimeSpent)); } } else{ requestResponseChannel.sendResponse(response, request, new NetworkRequestMetrics(responseQueueTime, responseSendTime, requestTotalTime, null, null, totalTimeSpent)); } }</code><technical_language>'if(' indenting off</technical_language>

Target:
public void sendPutResponse(RequestResponseChannel requestResponseChannel, PutResponse response, Request request, MetricsHistogram responseQueueTime, MetricsHistogram responseSendTime, MetricsHistogram requestTotalTime, long totalTimeSpent, long blobSize, ServerMetrics metrics) throws InterruptedException { if (response.getError() == ServerErrorCode.No_Error) { metrics.markPutBlobRequestRateBySize(blobSize); if (blobSize <= ServerMetrics.smallBlob) { requestResponseChannel.sendResponse(response, request, new NetworkRequestMetrics(responseQueueTime, responseSendTime, requestTotalTime, new HistogramMeasurement(metrics.putSmallBlobProcessingTimeInMs), new HistogramMeasurement(metrics.putSmallBlobTotalTimeInMs), totalTimeSpent)); } else if (blobSize <= ServerMetrics.mediumBlob) { requestResponseChannel.sendResponse(response, request, new NetworkRequestMetrics(responseQueueTime, responseSendTime, requestTotalTime, new HistogramMeasurement(metrics.putMediumBlobProcessingTimeInMs), new HistogramMeasurement(metrics.putMediumBlobTotalTimeInMs), totalTimeSpent)); } else { requestResponseChannel.sendResponse(response, request, new NetworkRequestMetrics(responseQueueTime, responseSendTime, requestTotalTime, new HistogramMeasurement(metrics.putLargeBlobProcessingTimeInMs), new HistogramMeasurement(metrics.putLargeBlobTotalTimeInMs), totalTimeSpent)); } } else { requestResponseChannel.sendResponse(response, request, new NetworkRequestMetrics(responseQueueTime, responseSendTime, requestTotalTime, null, null, totalTimeSpent)); } }
Source:
<code>public static void setupStore() throws Exception { defaultStoreDir = BeanPopulator.getDefaultInstance(ObjectStoreEnvironmentBean.class).getObjectStoreDir(); <START> new MetaObjectStoreEnvironmentBean().setObjectStoreType(storeClassName); <END> Util.emptyObjectStore(); }</code><technical_language>MetaObjectStoreEnvironmentBean added ensure config bean changes backwardly compatible arjPropertyManager approach config (ie break semantics of arjPropertyManager). I code arjPropertyManager instead (but problem is want discourage of arjPropertyManager)</technical_language>

Target:
public static void setupStore() throws Exception { defaultStoreDir = BeanPopulator.getDefaultInstance(ObjectStoreEnvironmentBean.class).getObjectStoreDir(); BeanPopulator.getDefaultInstance(ObjectStoreEnvironmentBean.class).setObjectStoreType(storeClassName); BeanPopulator.getNamedInstance(ObjectStoreEnvironmentBean.class, "default").setObjectStoreType(storeClassName); BeanPopulator.getNamedInstance(ObjectStoreEnvironmentBean.class, "communicationStore").setObjectStoreType(storeClassName); Util.emptyObjectStore(); }
Source:
<code>protected void doStart() throws Exception { if( mongoConnection == null ) { mongoConnection = CamelContextHelper.mandatoryLookup(getCamelContext(), connectionBean, MongoClient.class); } <START> log.debug("Resolved the connection with the name as {}", connectionBean, mongoConnection); <END> super.doStart(); }</code><technical_language>this is misleading mongoConnection is unrelated connectionBean parameter</technical_language>

Target:
protected void doStart() throws Exception { if (mongoConnection == null) { mongoConnection = CamelContextHelper.mandatoryLookup(getCamelContext(), connectionBean, MongoClient.class); log.debug("Resolved the connection provided by context reference as {}", connectionBean, mongoConnection); } else { log.debug("Resolved the connection provided by mongoConnection property parameter as {}", mongoConnection); } super.doStart(); }
Source:
<code>private void doMutation(final Mutation mutation) { handleExceptions(); Long sequenceId = sizeManager.registerOperationWithHeapSize(mutation.heapSize()); AccountingFutureCallback callback = new AccountingFutureCallback(mutation, sequenceId); <START> Futures.addCallback(batchExecutor.issueRequest(mutation), callback); <END> }</code><technical_language>This a bit nervous (synchronization blocks happening rpc threadpool). 100% a real problem here, adding callback a separate executor a bad idea (or be, 100% certain)</technical_language>

Target:
private void doMutation(final Mutation mutation) throws RetriesExhaustedWithDetailsException { Long sequenceId = null; try { sequenceId = sizeManager.registerOperationWithHeapSize(mutation.heapSize()); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } AccountingFutureCallback callback = new AccountingFutureCallback(mutation, sequenceId); Futures.addCallback(batchExecutor.issueRequest(mutation), callback); }
Source:
<code>public void visitClassDeclaration(ClassDeclarationTree tree) { <START> privateProperties = new LinkedList<>(); <END> privateMethods = new LinkedList<>(); isFinalClassStack.addLast(isFinalClass(tree)); finalMethodsStack.addLast(getFinalMethods(tree)); super.visitClassDeclaration(tree); isFinalClassStack.removeLast(); finalMethodsStack.removeLast(); }</code><technical_language>@ivandalbosco I lists (btw sets?) elements of stack (like isFinalClassStack finalMethodsStack). Due able cover nested classes (see unit test file)</technical_language>

Target:
public void visitClassDeclaration(ClassDeclarationTree tree) { isFinalClassStack.addLast(isFinalClass(tree)); finalOrPrivateMethodsStack.addLast(getFinalOrPrivateMethods(tree)); privatePropertiesStack.addLast(getPrivateProperties(tree)); super.visitClassDeclaration(tree); isFinalClassStack.removeLast(); finalOrPrivateMethodsStack.removeLast(); privatePropertiesStack.removeLast(); }
Source:
<code>private File getSourceFile() throws IOException { try (OnlineManagementClient client = ManagementClientProvider.createOnlineManagementClient()) { <START> String path = new Operations(client).invoke("take-snapshot", Address.root()).value().asString(); <END> File copyFrom = new File(path); if (!copyFrom.exists()) { throw new IOException("Source config file does not exits: '" + copyFrom.toString() + "'!"); } return copyFrom; } }</code><technical_language>stringValue() instead of .value().asString()</technical_language>

Target:
private File getSourceFile() throws IOException { try (OnlineManagementClient client = ManagementClientProvider.createOnlineManagementClient()) { ModelNodeResult result = new Operations(client).invoke("take-snapshot", Address.root()); String path = result.stringValue(); File copyFrom = new File(path); if (!copyFrom.exists()) { throw new IOException("Source config file does not exits: '" + copyFrom.toString() + "'!"); } return copyFrom; } }
Source:
<code>void setBlkioDeviceOptionss(Instance instance, Map<String, Object> fromInspect) { List<String> fields = Arrays.asList(READ_IOPS, WRITE_IOPS, READ_BPS, WRITE_BPS, WEIGHT); Map<String, BlkioDeviceOption> target = new HashMap<>(); for (String field : fields) { List<Map> deviceOptions = null; try { <START> deviceOptions = (List<Map>)CollectionUtils.toList(CollectionUtils.getNestedValue(fromInspect, "HostConfig", field)); <END> } catch (Exception e) { continue; } if (deviceOptions == null || deviceOptions.isEmpty()) { continue; } for (Map deviceOption : deviceOptions) { String path = null; Integer value = null; try { path = (String)deviceOption.get("Path"); value = (Integer)(field == WEIGHT ? deviceOption.get("Weight") : deviceOption.get("Rate")); } catch (Exception e) { } if (path != null && value != null) { BlkioDeviceOption targetDevOpt = target.get(path); if (targetDevOpt == null) { targetDevOpt = new BlkioDeviceOption(); target.put(path, targetDevOpt); } switch (field) { case READ_IOPS: targetDevOpt.setReadIops(value); break; case WRITE_IOPS: targetDevOpt.setWriteIops(value); break; case READ_BPS: targetDevOpt.setReadBps(value); break; case WRITE_BPS: targetDevOpt.setWriteBps(value); break; case WEIGHT: targetDevOpt.setWeight(value); break; } } } } if (!target.isEmpty()) { setField(instance, FIELD_BLKIO_DEVICE_OPTIONS, target); } }</code><technical_language>Nit: is HostConfig a constant anywhere? reference instead of hardcoding</technical_language>

Target:
void setBlkioDeviceOptionss(Instance instance, Map<String, Object> fromInspect) { List<String> fields = Arrays.asList(READ_IOPS, WRITE_IOPS, READ_BPS, WRITE_BPS, WEIGHT); Map<String, BlkioDeviceOption> target = new HashMap<>(); for (String field : fields) { List<Map> deviceOptions = null; try { deviceOptions = (List<Map>)CollectionUtils.toList(CollectionUtils.getNestedValue(fromInspect, HOST_CONFIG, field)); } catch (Exception e) { continue; } if (deviceOptions == null || deviceOptions.isEmpty()) { continue; } for (Map deviceOption : deviceOptions) { String path = null; Integer value = null; try { path = (String)deviceOption.get("Path"); value = (Integer)(field == WEIGHT ? deviceOption.get("Weight") : deviceOption.get("Rate")); } catch (Exception e) { } if (path != null && value != null) { BlkioDeviceOption targetDevOpt = target.get(path); if (targetDevOpt == null) { targetDevOpt = new BlkioDeviceOption(); target.put(path, targetDevOpt); } switch (field) { case READ_IOPS: targetDevOpt.setReadIops(value); break; case WRITE_IOPS: targetDevOpt.setWriteIops(value); break; case READ_BPS: targetDevOpt.setReadBps(value); break; case WRITE_BPS: targetDevOpt.setWriteBps(value); break; case WEIGHT: targetDevOpt.setWeight(value); break; } } } } if (!target.isEmpty()) { setField(instance, FIELD_BLKIO_DEVICE_OPTIONS, target); } }
Source:
<code>private void addResearchTask(List<Block> blockList, Block result, EntityRef player, EntityRef laboratory) { List<String> blockNameList = new ArrayList<>(); for (Block block : blockList) { blockNameList.add(block.getURI().toString()); } Task researchTask = new ResearchTask(blockNameList, result.getURI().toString()); researchTask.requiredBuildingEntityID = laboratory.getId(); TaskComponent taskComponent = new TaskComponent(); taskComponent.assignedTaskType = AssignedTaskType.Research; taskComponent.task = researchTask; ConstructedBuildingComponent buildingComponent = laboratory.getComponent(ConstructedBuildingComponent.class); <START> taskComponent.taskRegion = buildingComponent.boundingRegions.get(16); <END> taskManagementSystem.addTask(player, entityManager.create(taskComponent)); }</code><technical_language>magic number -- 16 mean? a constant</technical_language>

Target:
private void addResearchTask(List<Block> blockList, Block result, EntityRef player, EntityRef laboratory) { List<String> blockNameList = new ArrayList<>(); for (Block block : blockList) { blockNameList.add(block.getURI().toString()); } Task researchTask = new ResearchTask(blockNameList, result.getURI().toString()); researchTask.requiredBuildingEntityID = laboratory.getId(); TaskComponent taskComponent = new TaskComponent(); taskComponent.assignedTaskType = AssignedTaskType.Research; taskComponent.task = researchTask; ConstructedBuildingComponent buildingComponent = laboratory.getComponent(ConstructedBuildingComponent.class); taskComponent.taskRegion = buildingComponent.boundingRegions.get(Constants.LABORATORY_SLAB_REGION); taskManagementSystem.addTask(player, entityManager.create(taskComponent)); }
Source:
<code>public void clientTest() { client.addFlow(flow); List<FloodlightOFFlow> flows = client.getFlows(SWITCH_ID); Assert.assertEquals("Flows size must be 1", 1, flows.size()); Assert.assertEquals("getFlows() must contain the created flow", flows.get(0).getName(), flow.getName()); Assert.assertEquals("getFlows() must contain the created flow action", flow.getActions().get(0).getValue(), <START> flows.get(0).getActions().get(0).getValue()); <END> }</code><technical_language>I clearer assert flows contains flow. Assert.assertTrue("getFlows() created flow",flows.contains(flow)); Is reason for that? Is equals method working correctly returned flows</technical_language>

Target:
public void clientTest() throws InterruptedException { client.addFlow(flow); List<FloodlightOFFlow> flows = client.getFlows(SWITCH_ID); Assert.assertEquals("Flows size must be 1", 1, flows.size()); Assert.assertEquals("getFlows() must contain the created flow", flows.get(0).getName(), flow.getName()); Assert.assertEquals("getFlows() must contain the created flow action", flow.getActions().get(0).getValue(), flows.get(0).getActions().get(0).getValue()); }
Source:
<code>public static void prepareUser() { try { workflowControllerService = new ServiceManager().getWorkflowControllerService(); } catch (Exception e) { User user = new User(); <START> workflowControllerService.setUser(user); <END> } }</code><technical_language>Is setting a new empty user object correct solution in case exception is thrown initialising test suite</technical_language>

Target:
public static void prepareUser() { Helper.setCurrentUser(new User()); workflowControllerService = new ServiceManager().getWorkflowControllerService(); }
Source:
<code>private BibEntry jsonItemToBibEntry(JSONObject item) throws ParseException { try { BibEntry entry = new BibEntry(); <START> entry.setType(convertType(item.getString("type"))); <END> entry.setField(StandardField.TITLE, item.getString("title")); entry.setField(StandardField.AUTHOR, toAuthors(item.optJSONArray("author"))); entry.setField(StandardField.YEAR, Optional.ofNullable(item.optJSONObject("issued")) .map(array -> array.optJSONArray("date-parts")) .map(array -> array.optJSONArray(0)) .map(array -> array.optInt(0)) .map(year -> Integer.toString(year)).orElse("")); entry.setField(StandardField.DOI, item.getString("DOI")); entry.setField(StandardField.PAGES, item.optString("page")); entry.setField(StandardField.ISSN, item.optString("ISSN")); entry.setField(StandardField.JOURNAL, item.optString("container-title")); entry.setField(StandardField.PUBLISHER, item.optString("publisher")); entry.setField(StandardField.URL, item.optString("URL")); entry.setField(StandardField.VOLUME, item.optString("volume")); return entry; } catch (JSONException exception) { throw new ParseException("mEdRA API JSON format has changed", exception); } }</code><technical_language>do a chaining of setField? java return new BibEntry(convertType(item.getString("type"))) .withField(StandardField.TITLE, item.getString("title")) .withField... ..</technical_language>

Target:
private BibEntry jsonItemToBibEntry(JSONObject item) throws ParseException { try { return new BibEntry(convertType(item.getString("type"))) .withField(StandardField.TITLE, item.getString("title")) .withField(StandardField.AUTHOR, toAuthors(item.optJSONArray("author"))) .withField(StandardField.YEAR, Optional.ofNullable(item.optJSONObject("issued")) .map(array -> array.optJSONArray("date-parts")) .map(array -> array.optJSONArray(0)) .map(array -> array.optInt(0)) .map(year -> Integer.toString(year)).orElse("")) .withField(StandardField.DOI, item.getString("DOI")) .withField(StandardField.PAGES, item.optString("page")) .withField(StandardField.ISSN, item.optString("ISSN")) .withField(StandardField.JOURNAL, item.optString("container-title")) .withField(StandardField.PUBLISHER, item.optString("publisher")) .withField(StandardField.URL, item.optString("URL")) .withField(StandardField.VOLUME, item.optString("volume")); } catch (JSONException exception) { throw new ParseException("mEdRA API JSON format has changed", exception); } }
Source:
<code>public <T> T readValue(@Nonnull final IMAPResponse[] content, @Nonnull final Class<T> valueType) <START> throws ImapAsyncClientException, ProtocolException, IOException { <END> if (valueType == Capability.class) { return (T) parser.parseToCapabilities(content); } if (valueType == AppendUID.class) { return (T) parser.parseToAppendUid(content); } if (valueType == CopyUID.class) { return (T) parser.parseToCopyUid(content); } if (valueType == ExtensionMailboxInfo.class) { return (T) parser.parseToExtensionMailboxInfo(content); } if (valueType == MailboxInfo.class) { return (T) parser.parseToMailboxInfo(content); } if (valueType == ListInfoList.class) { return (T) parser.parseToListInfoList(content); } if (valueType == Status.class) { return (T) parser.parseToStatus(content); } if (valueType == IdResult.class) { return (T) parser.parseToIdResult(content); } if (valueType == SearchResult.class) { return (T) parser.parseToSearchResult(content); } return readValue(content, valueType, EMPTY_FETCH_ITEMS); }</code><technical_language>IOException is thrown. Remove it</technical_language>

Target:
public <T> T readValue(@Nonnull final IMAPResponse[] content, @Nonnull final Class<T> valueType) throws ImapAsyncClientException, ProtocolException { if (valueType == Capability.class) { return (T) parser.parseToCapabilities(content); } if (valueType == AppendUID.class) { return (T) parser.parseToAppendUid(content); } if (valueType == CopyUID.class) { return (T) parser.parseToCopyUid(content); } if (valueType == ExtensionMailboxInfo.class) { return (T) parser.parseToExtensionMailboxInfo(content); } if (valueType == MailboxInfo.class) { return (T) parser.parseToMailboxInfo(content); } if (valueType == ListInfoList.class) { return (T) parser.parseToListInfoList(content); } if (valueType == Status.class) { return (T) parser.parseToStatus(content); } if (valueType == IdResult.class) { return (T) parser.parseToIdResult(content); } if (valueType == SearchResult.class) { return (T) parser.parseToSearchResult(content); } return readValue(content, valueType, EMPTY_FETCH_ITEMS); }
Source:
<code>PdlBuilder writeJson(Object value) throws IOException { DefaultPrettyPrinter prettyPrinter = new DefaultPrettyPrinter(); <START> prettyPrinter.indentObjectsWith(new DefaultIndenter(" ", DefaultIndenter.SYS_LF + getIndentSpaces())); <END> _jsonCodec.setPrettyPrinter(prettyPrinter); return super.writeJson(value); }</code><technical_language>this spaces? SPACE * INDENT_WIDTH</technical_language>

Target:
PdlBuilder writeJson(Object value) throws IOException { JacksonDataCodec jsonCodec = new JacksonDataCodec(); DefaultPrettyPrinter prettyPrinter = new DefaultPrettyPrinter(); prettyPrinter.indentObjectsWith( new DefaultIndenter(getIndentSpaces(1), DefaultIndenter.SYS_LF + getIndentSpaces(_indentDepth))); jsonCodec.setPrettyPrinter(prettyPrinter); write(toJson(value, jsonCodec)); return this; }
Source:
<code>protected boolean handleFailureImpl(StateExecution execution) { <START> logger.warn("Cron workflow " + getType() + " / " + execution.getWorkflowInstanceId() + "work failed"); <END> return true; }</code><technical_language>suggestion logger.warn("Cron workflow / work failed", getType(), execution.getWorkflowInstanceId());</technical_language>

Target:
protected boolean handleFailureImpl(StateExecution execution) { logger.error("Cron workflow / work failed", getType(), execution.getWorkflowInstanceId()); return true; }
Source:
<code><START> public ResultValidator expectExceptionMessage(String exceptionMessage) { <END> StringDescription description = new StringDescription( new StringBuilder("Given exception message is null!")); if (exceptionMessage == null) { reporter.reportWrongExceptionMessage(actualException, description); return this; } description = new StringDescription(new StringBuilder(exceptionMessage)); if (actualException != null && !exceptionMessage.equals(actualException.getMessage())) { reporter.reportWrongExceptionMessage(actualException, description); } return this; }</code><technical_language>Curious: sense call ResultValidator expectExceptionMessage(Matcher<?>) function this ResultValidator expectExceptionMessage(String) function? real difference is this function equals other calls matches()</technical_language>

Target:
public ResultValidator expectExceptionMessage(String exceptionMessage) { return expectExceptionMessage(equalTo(exceptionMessage)); }
Source:
<code>private Builder(CuratorFramework client, String path) { this.client = client; <START> this.path = path; <END> }</code><technical_language>Please PathUtils.validatePath path is valid accepting it</technical_language>

Target:
private Builder(CuratorFramework client, String path) { this.client = checkNotNull(client); this.path = validatePath(path); }
Source:
<code>@Override public Date read(JsonReader in) throws IOException { if (in.peek() == JsonToken.NULL) { in.nextNull(); return null; } String stringDate = in.nextString(); try { return df.parse(stringDate); } catch (ParseException e) { <START> throw new DateTypeParseException(stringDate); <END> } }</code><technical_language>a runtime exception in sample, in real world this app crash, want encourage. Instead, return a default new Date()</technical_language>

Target:
@Override public Date read(JsonReader in) throws IOException { if (in.peek() == JsonToken.NULL) { in.nextNull(); return null; } String stringDate = in.nextString(); try { return df.parse(stringDate); } catch (ParseException e) { return new Date(); } }
Source:
<code>public void handleVolumeCommand(Command command, ChannelUID channelUID, int zone) throws IOException { if (command instanceof RefreshType) { updateState(channelUID, new DecimalType(connection.getVolume(zone) / 100.0)); } if (command instanceof DecimalType) { <START> connection.setVolume(((DecimalType) command).intValue(), zone); <END> } }</code><technical_language>Check for PercentType instead of DecimalType</technical_language>

Target:
public void handleVolumeCommand(Command command, ChannelUID channelUID, int zone) throws IOException { if (command instanceof RefreshType) { try { logger.debug("handleVolumeCommand RefreshType {}", zone); SonyAudioConnection.SonyAudioVolume result = volumeCache[zone].getValue(); if (result != null) { updateState(channelUID, new PercentType(result.volume)); } } catch (CompletionException ex) { throw new IOException(ex.getCause()); } } if (command instanceof PercentType) { logger.debug("handleVolumeCommand PercentType set {}", zone, command); connection.setVolume(((PercentType) command).intValue(), zone); } if (command instanceof IncreaseDecreaseType) { logger.debug("handleVolumeCommand IncreaseDecreaseType set {}", zone, command); String change = command == IncreaseDecreaseType.INCREASE ? "+1" : "-1"; connection.setVolume(change, zone); } if (command instanceof OnOffType) { logger.debug("handleVolumeCommand OnOffType set {}", zone, command); connection.setMute(((OnOffType) command) == OnOffType.ON, zone); } }
Source:
<code>private SSLContext createSSLContext(final KeyStore keyStore, final KeyStore trustStore) throws NoSuchAlgorithmException, UnrecoverableKeyException, KeyStoreException, KeyManagementException { <START> KeyManager[] keyManagers; <END> KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); char[] pass = keyStoreProperties.getPassword().toCharArray(); keyManagerFactory.init(keyStore, pass); keyManagers = keyManagerFactory.getKeyManagers(); TrustManager[] trustManagers; TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); trustManagerFactory.init(trustStore); trustManagers = trustManagerFactory.getTrustManagers(); SSLContext sslContext; sslContext = SSLContext.getInstance(protocol); sslContext.init(keyManagers, trustManagers, SecureRandom.getInstanceStrong()); return sslContext; }</code><technical_language>define this variable in line 76</technical_language>

Target:
private SSLContext createSSLContext(final KeyStore keyStore, final KeyStore trustStore) throws NoSuchAlgorithmException, UnrecoverableKeyException, KeyStoreException, KeyManagementException { KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); char[] pass = keyStoreProperties.getPassword().toCharArray(); keyManagerFactory.init(keyStore, pass); KeyManager[] keyManagers = keyManagerFactory.getKeyManagers(); TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); trustManagerFactory.init(trustStore); TrustManager[] trustManagers = trustManagerFactory.getTrustManagers(); SSLContext sslContext = SSLContext.getInstance(protocol); sslContext.init(keyManagers, trustManagers, SecureRandom.getInstanceStrong()); return sslContext; }
Source:
<code>protected void doInvokeListener(MessageListener listener, Object data) { Message message = null; try { <START> if (listener instanceof BatchMessageListener) { <END> listener.onMessageBatch((List<Message>) data); } else { message = (Message) data; listener.onMessage(message); } } catch (Exception e) { throw wrapToListenerExecutionFailedExceptionIfNeeded(e, message); } }</code><technical_language>need do slightly opposite? Check for data instance of List call onMessageBatch() is MessageListener anyway</technical_language>

Target:
protected void doInvokeListener(MessageListener listener, Object data) { Message message = null; try { if (data instanceof List) { listener.onMessageBatch((List<Message>) data); } else { message = (Message) data; listener.onMessage(message); } } catch (Exception e) { throw wrapToListenerExecutionFailedExceptionIfNeeded(e, message); } }
Source:
<code>static Try<Void> runRunnable(Runnable runnable) { <START> return run(runnable::run); <END> }</code><technical_language>java Objects.requireNonNull(runnable, "runnable is null");</technical_language>

Target:
static Try<Void> runRunnable(Runnable runnable) { Objects.requireNonNull(runnable, "runnable is null"); return run(runnable::run); }
Source:
<code>public void testRelation(){ String templateUrl = getClasspathUrlForResource("templates/relationship.yaml"); EntitySpec<? extends Application> app = transformer.createApplicationSpec( new ResourceUtils(mgmt).getResourceAsString(templateUrl)); assertNotNull(app); assertEquals(app.getChildren().size(), 2); EntitySpec<TomcatServer> tomcatServer = (EntitySpec<TomcatServer>) app.getChildren().get(0); <START> assertNotNull(tomcatServer.getConfig().get(TomcatServer.JAVA_SYSPROPS)); <END> assertEquals(((Map) tomcatServer.getConfig().get(TomcatServer.JAVA_SYSPROPS)).size(), 1); assertEquals(((Map)tomcatServer.getConfig().get(TomcatServer.JAVA_SYSPROPS)) .get("brooklyn.example.db.url").toString(), DATABASE_DEPENDENCY_INJECTION); }</code><technical_language>This assertion fails. If app children do app.getChildren().get(0) give spec for Tomcat server</technical_language>

Target:
public void testRelation(){ String templateUrl = getClasspathUrlForResource("templates/relationship.yaml"); EntitySpec<? extends Application> app = transformer.createApplicationSpec( new ResourceUtils(mgmt).getResourceAsString(templateUrl)); assertNotNull(app); assertEquals(app.getChildren().size(), 2); EntitySpec<TomcatServer> tomcatServer = (EntitySpec<TomcatServer>) findChildEntitySpecByPlanId(app, "tomcat_server"); assertNotNull(tomcatServer.getConfig().get(TomcatServer.JAVA_SYSPROPS)); assertEquals(((Map) tomcatServer.getConfig().get(TomcatServer.JAVA_SYSPROPS)).size(), 1); assertEquals(((Map)tomcatServer.getConfig().get(TomcatServer.JAVA_SYSPROPS)) .get("brooklyn.example.db.url").toString(), DATABASE_DEPENDENCY_INJECTION); }
Source:
<code>public InfinispanRepository( BaseInfinispanSource source, <START> BasicCacheContainer cacheContainer ) { <END> super(source); this.cacheContainer = source.createCacheContainer(); assert this.cacheContainer != null; Set<String> workspaceNames = new HashSet<String>(); for (String workspaceName : source.getPredefinedWorkspaceNames()) { workspaceNames.add(workspaceName); } this.predefinedWorkspaceNames = Collections.unmodifiableSet(workspaceNames); initialize(); }</code><technical_language>cacheContainer param in ctr (the source is get cache container)</technical_language>

Target:
public InfinispanRepository( BaseInfinispanSource source, BasicCacheContainer cacheContainer ) { super(source); this.cacheContainer = cacheContainer; assert this.cacheContainer != null; Set<String> workspaceNames = new HashSet<String>(); for (String workspaceName : source.getPredefinedWorkspaceNames()) { workspaceNames.add(workspaceName); } this.predefinedWorkspaceNames = Collections.unmodifiableSet(workspaceNames); initialize(); }
Source:
<code>private static synchronized void filter(final Collection<Geocache> caches) { final boolean excludeMine = Settings.isExcludeMyCaches(); final boolean excludeDisabled = Settings.isExcludeDisabledCaches(); final List<Geocache> removeList = new ArrayList<>(); for (final Geocache cache : caches) { <START> if ((excludeMine && (cache.isFound() || cache.isOwner())) || (excludeDisabled && (cache.isDisabled() && cache.isArchived()))) { <END> removeList.add(cache); } } caches.removeAll(removeList); }</code><technical_language>superfluous brace in "excludeDisabled && (cache.isDisabled()"</technical_language>

Target:
private static synchronized void filter(final Collection<Geocache> caches) { final boolean excludeMine = Settings.isExcludeMyCaches(); final boolean excludeDisabled = Settings.isExcludeDisabledCaches(); final List<Geocache> removeList = new ArrayList<>(); for (final Geocache cache : caches) { if ((excludeMine && (cache.isFound() || cache.isOwner())) || (excludeDisabled && (cache.isDisabled() || cache.isArchived()))) { removeList.add(cache); } } caches.removeAll(removeList); }
Source:
<code>public String getBootstrapServers() { if (port == -1) { <START> throw new IllegalStateException("You should start Kafka container first"); <END> } return String.format("PLAINTEXT://%s:%s", getContainerIpAddress(), port); }</code><technical_language>Nice - this fix #1450</technical_language>

Target:
public String getBootstrapServers() { if (port == PORT_NOT_ASSIGNED) { throw new IllegalStateException("You should start Kafka container first"); } return String.format("PLAINTEXT://%s:%s", getContainerIpAddress(), port); }
Source:
<code>public void delete(String workspaceName, String userName) throws Exception { if (!exists(workspaceName, userName)) { return; } Workspace workspace = getByName(workspaceName, userName); if (workspace.getStatus() == STOPPING) { waitStatus(workspaceName, userName, STOPPED); } else if (workspace.getStatus() != STOPPED) { stop(workspaceName, userName); } requestFactory.fromUrl(getIdBasedUrl(workspace.getId())).useDeleteMethod().request(); WaitUtils.waitSuccessCondition( () -> { try { LOG.info( "Check workspace name='{}', id='{}', username='{}' existence", workspaceName, workspace.getId(), userName); return !exists(workspaceName, userName); <START> } catch (Exception e) { <END> throw new RuntimeException( format( "Error of waiting on workspace of name='%s', id='%s', username='%s' is removed.", workspaceName, workspace.getId(), userName), e); } }, TestTimeoutsConstants.PREPARING_WS_TIMEOUT_SEC, 1000, TimeUnit.SECONDS); LOG.info( "Workspace name='{}', id='{}', username='{}' removed", workspaceName, workspace.getId(), userName); }</code><technical_language>Is set some exception</technical_language>

Target:
public void delete(String workspaceName, String userName) throws Exception { if (!exists(workspaceName, userName)) { return; } Workspace workspace = getByName(workspaceName, userName); if (workspace.getStatus() == STOPPING) { waitStatus(workspaceName, userName, STOPPED); } else if (workspace.getStatus() != STOPPED) { stop(workspaceName, userName); } requestFactory.fromUrl(getIdBasedUrl(workspace.getId())).useDeleteMethod().request(); WaitUtils.waitSuccessCondition( () -> { try { return !exists(workspaceName, userName); } catch (Exception e) { throw new RuntimeException( format( "Error of waiting on workspace name='%s', id='%s', username='%s' removal.", workspaceName, workspace.getId(), userName), e); } }, TestTimeoutsConstants.PREPARING_WS_TIMEOUT_SEC, 500, TimeUnit.SECONDS); LOG.info( "Workspace name='{}', id='{}', username='{}' removed", workspaceName, workspace.getId(), userName); }
Source:
<code><START> public LightblueHealth checkHealth() { <END> return null; }</code><technical_language>checkHealth logic <LINK_0></technical_language>

Target:
public CRUDHealth checkHealth() { return new CRUDHealth(true, "Return always healthy for test"); }
Source:
<code>public Optional<Predicate<ItemStackSnapshot>> getIngredientPredicate(int x, int y) { <START> return Optional.ofNullable(ingredients.get(x, y)); <END> }</code><technical_language>this</technical_language>

Target:
public Predicate<ItemStackSnapshot> getIngredientPredicate(int x, int y) { return Optional.ofNullable(this.ingredients.get(x, y)) .orElseThrow(() -> new IndexOutOfBoundsException("Invalid ingredient predicate location")); }
Source:
<code>static int updatedCount(int[] executeBatch) { <START> int sum = 0; <END> for (int count : executeBatch) { sum += count; } return sum; }</code><technical_language>return Arrays.stream(executeBatch).sum();</technical_language>

Target:
static int updatedCount(int[] executeBatch) { return Arrays.stream(executeBatch).sum(); }