auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected String[][] formatTableContents() { final ImmutableList.Builder<String[]> builder = ImmutableList.builder(); for (final Contents content : contents) { final String[] arrayEntry = new String[6]; arrayEntry[0] = nullGuard(content.getKey()); arrayEntry[1] = nullGuard(Long.toString(content.getSize())); arrayEntry[2] = nullGuard(content.getOwner().getDisplayName()); arrayEntry[3] = nullGuardFromDate(content.getLastModified(), DATE_FORMAT); arrayEntry[4] = nullGuard(content.getETag()); <START> arrayEntry[5] = nullGuard(content.getVersionId().toString()); <END> builder.add(arrayEntry); } final ImmutableList<String[]> contentStrings = builder.build(); return contentStrings.toArray(new String[contentStrings.size()][]); }</code><technical_language>if getVersionId() is null, calling toString throw null pointer exception</technical_language>

Target:
protected String[][] formatTableContents() { final ImmutableList.Builder<String[]> builder = ImmutableList.builder(); for (final Contents content : contents) { final String[] arrayEntry = new String[6]; arrayEntry[0] = nullGuard(content.getKey()); arrayEntry[1] = nullGuard(Long.toString(content.getSize())); arrayEntry[2] = nullGuard(content.getOwner().getDisplayName()); arrayEntry[3] = nullGuardFromDate(content.getLastModified(), DATE_FORMAT); arrayEntry[4] = nullGuard(content.getETag()); arrayEntry[5] = nullGuard(content.getVersionId()); builder.add(arrayEntry); } final ImmutableList<String[]> contentStrings = builder.build(); return contentStrings.toArray(new String[contentStrings.size()][]); }
Source:
<code>private ZonedDateTime getExpiryDateForAwaitingCaptureRequest() { int chargeExpiryWindowSeconds = FORTY_EIGHT_HOURS; if (StringUtils.isNotBlank(System.getenv(AWAITING_DELAY_CAPTURE_EXPIRY_WINDOW))) { chargeExpiryWindowSeconds = Integer.parseInt(System.getenv(AWAITING_DELAY_CAPTURE_EXPIRY_WINDOW)); <START> } <END> logger.debug("Charge expiry window size in seconds: " + chargeExpiryWindowSeconds); return ZonedDateTime.now().minusSeconds(chargeExpiryWindowSeconds); }</code><technical_language>I this put in config, a default</technical_language>

Target:
private ZonedDateTime getExpiryDateForAwaitingCaptureRequest() { int chargeExpiryWindowSeconds = FORTY_EIGHT_HOURS; if (StringUtils.isNotBlank(System.getenv(AWAITING_DELAY_CAPTURE_EXPIRY_WINDOW))) { chargeExpiryWindowSeconds = Integer.parseInt(System.getenv(AWAITING_DELAY_CAPTURE_EXPIRY_WINDOW)); } logger.debug("Charge expiry window size for awaiting_delay_capture in seconds: " + chargeExpiryWindowSeconds); return ZonedDateTime.now().minusSeconds(chargeExpiryWindowSeconds); }
Source:
<code>public Boolean hasModifierProperty(@NotNull PsiModifierList modifierList, @NotNull String name) { final PsiElement parent = modifierList.getParent(); if (parent instanceof PsiLocalVariable && isVal((PsiLocalVariable) parent)) { <START> return PsiModifier.FINAL.equals(name) ? Boolean.TRUE : null; <END> } return null; }</code><technical_language>check for PsiModifier.FINAL.equals(name) first, checking for instanceof isVal</technical_language>

Target:
public Boolean hasModifierProperty(@NotNull PsiModifierList modifierList, @NotNull String name) { final PsiElement parent = modifierList.getParent(); if (PsiModifier.FINAL.equals(name) && parent instanceof PsiLocalVariable && isVal((PsiLocalVariable) parent)) { return Boolean.TRUE; } return null; }
Source:
<code>private Set<List<JavaFileScannerContext.Location>> flowFromYields(ExplodedGraph.Edge edge) { Set<MethodYield> methodYields = edge.yields(); if (methodYields.isEmpty()) { return ImmutableSet.of(ImmutableList.of()); } List<Integer> argumentIndices = correspondingArgumentIndices(symbolicValues, edge.parent); MethodInvocationTree mit = (MethodInvocationTree) edge.parent.programPoint.syntaxTree(); List<JavaFileScannerContext.Location> passedArgumentsMessages = flowsForPassedArguments(argumentIndices, mit); List<JavaFileScannerContext.Location> changingNameArgumentsMessages = flowsForArgumentsChangingName(argumentIndices, mit); SymbolicValue returnSV = edge.child.programState.peekValue(); if (symbolicValues.contains(returnSV)) { argumentIndices.add(-1); } if (argumentIndices.isEmpty()) { return ImmutableSet.of(ImmutableList.of()); } return methodYields.stream() .map(y -> y.flow(argumentIndices, domains)) .flatMap(Set::stream) .map(flowFromYield -> { ImmutableList.Builder<JavaFileScannerContext.Location> result = ImmutableList.builder(); result.addAll(flowFromYield); <START> if (!flowFromYield.isEmpty()) { <END> result .addAll(changingNameArgumentsMessages) .addAll(passedArgumentsMessages); } return result.build(); }) .collect(Collectors.toSet()); }</code><technical_language>filter out empty flows map</technical_language>

Target:
private Set<List<JavaFileScannerContext.Location>> flowFromYields(ExplodedGraph.Edge edge) { Set<MethodYield> methodYields = edge.yields(); if (methodYields.isEmpty()) { return ImmutableSet.of(); } List<Integer> argumentIndices = correspondingArgumentIndices(symbolicValues, edge.parent); MethodInvocationTree mit = (MethodInvocationTree) edge.parent.programPoint.syntaxTree(); List<JavaFileScannerContext.Location> passedArgumentsMessages = flowsForPassedArguments(argumentIndices, mit); List<JavaFileScannerContext.Location> changingNameArgumentsMessages = flowsForArgumentsChangingName(argumentIndices, mit); SymbolicValue returnSV = edge.child.programState.peekValue(); if (symbolicValues.contains(returnSV)) { argumentIndices.add(-1); } if (argumentIndices.isEmpty()) { return ImmutableSet.of(); } return methodYields.stream() .map(y -> y.flow(argumentIndices, domains)) .flatMap(Set::stream) .filter(f -> !f.isEmpty()) .map(flowFromYield -> ImmutableList.<JavaFileScannerContext.Location>builder() .addAll(flowFromYield) .addAll(changingNameArgumentsMessages) .addAll(passedArgumentsMessages) .build()) .collect(Collectors.toSet()); }
Source:
<code>public void testDictIdSeeker() throws Exception { IntBuffer dimConversions = ByteBuffer.allocateDirect(3 * Ints.BYTES).asIntBuffer(); dimConversions.put(0); dimConversions.put(2); dimConversions.put(4); IndexMerger.DictIdSeeker dictIdSeeker = new IndexMerger.DictIdSeeker((IntBuffer) dimConversions.asReadOnlyBuffer().rewind()); Assert.assertEquals(0, dictIdSeeker.seek(0)); Assert.assertEquals(-1, dictIdSeeker.seek(1)); Assert.assertEquals(1, dictIdSeeker.seek(2)); try { dictIdSeeker.seek(1); <START> } <END> catch (ISE ise) { Assert.assertTrue("Only support access in order", true); } Assert.assertEquals(-1, dictIdSeeker.seek(3)); Assert.assertEquals(2, dictIdSeeker.seek(4)); Assert.assertEquals(-1, dictIdSeeker.seek(5)); }</code><technical_language>add Assert.fail(..) else verification happen for case exception is thrown</technical_language>

Target:
public void testDictIdSeeker() throws Exception { IntBuffer dimConversions = ByteBuffer.allocateDirect(3 * Ints.BYTES).asIntBuffer(); dimConversions.put(0); dimConversions.put(2); dimConversions.put(4); IndexMerger.DictIdSeeker dictIdSeeker = new IndexMerger.DictIdSeeker((IntBuffer) dimConversions.asReadOnlyBuffer().rewind()); Assert.assertEquals(0, dictIdSeeker.seek(0)); Assert.assertEquals(-1, dictIdSeeker.seek(1)); Assert.assertEquals(1, dictIdSeeker.seek(2)); try { dictIdSeeker.seek(5); Assert.fail("Only support access in order"); } catch (ISE ise) { Assert.assertTrue("Only support access in order", true); } Assert.assertEquals(-1, dictIdSeeker.seek(3)); Assert.assertEquals(2, dictIdSeeker.seek(4)); Assert.assertEquals(-1, dictIdSeeker.seek(5)); }
Source:
<code><START> public void test_validateLotNotesLists_throwsException() { <END> try { this.errors = new MapBindingResult(new HashMap<String, String>(), String.class.getName()); this.inventoryCommonValidator.validateLotNotes(Collections.singletonList(""), errors); } catch (ApiRequestValidationException e) { assertThat(Arrays.asList(e.getErrors().get(0).getCodes()), hasItem("lot.input.list.notes.null.or.empty")); } }</code><technical_language>@mderamos moved a new class instead of deleted</technical_language>

Target:
public void test_validateLotNotesLists_throwsException() { try { this.errors = new MapBindingResult(new HashMap<String, String>(), String.class.getName()); this.inventoryCommonValidator.validateLotNotes(Collections.singletonList(""), this.errors); } catch (final ApiRequestValidationException e) { assertThat(Arrays.asList(e.getErrors().get(0).getCodes()), hasItem("lot.input.list.notes.null.or.empty")); } }
Source:
<code>public void createDhcpEntryCommandsForVMs(final DomainRouterVO router, final Commands cmds, final long guestNetworkId) { final List<UserVmVO> vms = _userVmDao.listByNetworkIdAndStates(guestNetworkId, VirtualMachine.State.Running, VirtualMachine.State.Migrating, VirtualMachine.State.Stopping); final DataCenterVO dc = _dcDao.findById(router.getDataCenterId()); <START> String _dnsBasicZoneUpdates = _configDao.getValue(Config.DnsBasicZoneUpdates.key()); <END> for (final UserVmVO vm : vms) { if (dc.getNetworkType() == NetworkType.Basic && router.getPodIdToDeployIn().longValue() != vm.getPodIdToDeployIn().longValue() && _dnsBasicZoneUpdates.equalsIgnoreCase("pod")) { continue; } final NicVO nic = _nicDao.findByNtwkIdAndInstanceId(guestNetworkId, vm.getId()); if (nic != null) { s_logger.debug("Creating dhcp entry for vm " + vm + " on domR " + router + "."); createDhcpEntryCommand(router, vm, nic, cmds); } } }</code><technical_language>@wido if _dnsBasicZoneUpdates is a private member, drop _ rename 'dnsBasicZoneUpdates' appropriate</technical_language>

Target:
public void createDhcpEntryCommandsForVMs(final DomainRouterVO router, final Commands cmds, final long guestNetworkId) { final List<UserVmVO> vms = _userVmDao.listByNetworkIdAndStates(guestNetworkId, VirtualMachine.State.Running, VirtualMachine.State.Migrating, VirtualMachine.State.Stopping); final DataCenterVO dc = _dcDao.findById(router.getDataCenterId()); String dnsBasicZoneUpdates = _configDao.getValue(Config.DnsBasicZoneUpdates.key()); for (final UserVmVO vm : vms) { if (dc.getNetworkType() == NetworkType.Basic && router.getPodIdToDeployIn().longValue() != vm.getPodIdToDeployIn().longValue() && dnsBasicZoneUpdates.equalsIgnoreCase("pod")) { continue; } final NicVO nic = _nicDao.findByNtwkIdAndInstanceId(guestNetworkId, vm.getId()); if (nic != null) { s_logger.debug("Creating dhcp entry for vm " + vm + " on domR " + router + "."); createDhcpEntryCommand(router, vm, nic, cmds); } } }
Source:
<code>public Schematic(String name){ this.name = name; this.userDefinedTypes = new HashMap<String, UserDefinedType>(); populateDefaultTypeDefinitions(); this.endpointTypes = new HashMap<String, EndpointType>(); this.nodeTypes = new HashMap<String, NodeType>(); this.connectionTypes = new HashMap<String, ConnectionType>(); <START> this.constraintTypes = new HashMap<String, ConstraintType>(); <END> this.nodes = new HashMap<String, Node>(); this.connections = new HashMap<String, Connection>(); this.constraints = new HashMap<String, Constraint>(); }</code><technical_language>I symbol table class eventually</technical_language>

Target:
public Schematic(String name){ this.name = name; this.userDefinedTypes = new HashMap<String, Type>(); populateDefaultTypeDefinitions(); this.endpointTypes = new HashMap<String, EndpointType>(); this.nodeTypes = new HashMap<String, NodeType>(); this.connectionTypes = new HashMap<String, ConnectionType>(); this.constraintTypes = new HashMap<String, ConstraintType>(); this.nodes = new HashMap<String, Node>(); this.connections = new HashMap<String, Connection>(); this.constraints = new HashMap<String, Constraint>(); }
Source:
<code>public void bindTo(MeterRegistry registry) { successTimer = Timer.builder(workspaceMetric("start.time")) .description("The time of workspace start") .tags(withStandardTags("result", "success")) .publishPercentileHistogram() .sla(Duration.ofSeconds(10)) .minimumExpectedValue(Duration.ofSeconds(10)) .maximumExpectedValue(Duration.ofMinutes(15)) .register(registry); failTimer = Timer.builder(workspaceMetric("start.time")) .description("The time of workspace start") .tags(withStandardTags("result", "fail")) .publishPercentileHistogram() .sla(Duration.ofSeconds(10)) .minimumExpectedValue(Duration.ofSeconds(10)) .maximumExpectedValue(Duration.ofMinutes(15)) .register(registry); eventService.subscribe( event -> { if (event.getPrevStatus() == WorkspaceStatus.STOPPED <START> && event.getStatus() == WorkspaceStatus.STARTING) { <END> workspaceStartTime.put(event.getWorkspaceId(), System.currentTimeMillis()); } else if (event.getPrevStatus() == WorkspaceStatus.STARTING) { Long startTime = workspaceStartTime.remove(event.getWorkspaceId()); if (startTime != null) { if (event.getStatus() == WorkspaceStatus.RUNNING) { successTimer.record(Duration.ofMillis(System.currentTimeMillis() - startTime)); } else if (event.getStatus() == WorkspaceStatus.STOPPED) { failTimer.record(Duration.ofMillis(System.currentTimeMillis() - startTime)); } } else { LOG.warn("No workspace start time recorded for workspace {}", event.getWorkspaceId()); } } }, WorkspaceStatusEvent.class); }</code><technical_language>is PrevStatus is STOPPED status is STARTING</technical_language>

Target:
public void bindTo(MeterRegistry registry) { successTimer = Timer.builder(workspaceMetric("start.time")) .description("The time of workspace start") .tags(withStandardTags("result", "success")) .publishPercentileHistogram() .sla(Duration.ofSeconds(10)) .minimumExpectedValue(Duration.ofSeconds(10)) .maximumExpectedValue(Duration.ofMinutes(15)) .register(registry); failTimer = Timer.builder(workspaceMetric("start.time")) .description("The time of workspace start") .tags(withStandardTags("result", "fail")) .publishPercentileHistogram() .sla(Duration.ofSeconds(10)) .minimumExpectedValue(Duration.ofSeconds(10)) .maximumExpectedValue(Duration.ofMinutes(15)) .register(registry); eventService.subscribe(this::handleWorkspaceStatusChange, WorkspaceStatusEvent.class); }
Source:
<code>public Future<RecordMetadata> report(ProcessingContext context) { if (!connConfig.enableErrorLog()) { return CompletableFuture.completedFuture(null); } if (!context.failed()) { return CompletableFuture.completedFuture(null); } log.error(message(context), context.error()); errorHandlingMetrics.recordErrorLogged(); <START> return CompletableFuture.completedFuture(null); <END> }</code><technical_language>creating: private static final Future<RecordMetadata> COMPLETED = CompletableFuture.completedFuture(null); returning instance in of places. completed, immutable, allow cancellation, fine reuse in this LogReporter</technical_language>

Target:
public Future<RecordMetadata> report(ProcessingContext context) { if (!connConfig.enableErrorLog()) { return COMPLETED; } if (!context.failed()) { return COMPLETED; } log.error(message(context), context.error()); errorHandlingMetrics.recordErrorLogged(); return COMPLETED; }
Source:
<code>void initiate() { this.currentNonDurableLastAddConfirmed = lh.pendingAddsSequenceHead; <START> LOG.debug("start force() on ledger capturing ", lh.ledgerId, currentNonDurableLastAddConfirmed); <END> this.currentEnsemble = lh.metadata.currentEnsemble; this.ackSet = lh.distributionSchedule.getAckSetForForceLedger(); this.receivedResponseSet = new BitSet( lh.getLedgerMetadata().getEnsembleSize()); this.receivedResponseSet.set(0, lh.getLedgerMetadata().getEnsembleSize()); DistributionSchedule.WriteSet writeSet = lh.distributionSchedule.getWriteSetForForceLedger(); try { for (int i = 0; i < writeSet.size(); i++) { sendForceLedgerRequest(writeSet.get(i)); } } finally { writeSet.recycle(); } }</code><technical_language>instead of capturing ; clientNonDurableLac {}</technical_language>

Target:
void initiate() { this.currentNonDurableLastAddConfirmed = lh.pendingAddsSequenceHead; if (LOG.isDebugEnabled()) { LOG.debug("force clientNonDurableLac {}", lh.ledgerId, currentNonDurableLastAddConfirmed); } this.currentEnsemble = lh.metadata.currentEnsemble; this.ackSet = lh.distributionSchedule.getEnsembleAckSet(); DistributionSchedule.WriteSet writeSet = lh.getDistributionSchedule() .getEnsembleSet(currentNonDurableLastAddConfirmed); try { for (int i = 0; i < writeSet.size(); i++) { sendForceLedgerRequest(writeSet.get(i)); } } finally { writeSet.recycle(); } }
Source:
<code>public void collectMetrics(Request<?> request, Response<?> response) { final AWSRequestMetrics metrics = request.getAWSRequestMetrics(); if (metrics.isEnabled()) { final String[] tags = getTags(request, response); metrics.getTimingInfo().getAllCounters().forEach((name, count) -> { <START> registry.gauge(registry.createId(counterName(name), tags), count); <END> }); metrics.getTimingInfo().getSubMeasurementsByName().forEach((name, measurements) -> { final Timer timer = registry.timer(timerName(name), tags); measurements .stream() .filter(TimingInfo::isEndTimeKnown) .map(t -> t.getEndTimeNano() - t.getStartTimeNano()) .forEach(t -> timer.record(t, TimeUnit.NANOSECONDS)); }); } }</code><technical_language>care updated if SDK changed burned times in past. lead values reported in confusing consume data needs understand means. If a tradeoff needs I easy for consuming data hard for person reporting it</technical_language>

Target:
public void collectMetrics(Request<?> request, Response<?> response) { final AWSRequestMetrics metrics = request.getAWSRequestMetrics(); if (metrics.isEnabled()) { final Map<String, String> baseTags = getBaseTags(request); final TimingInfo timing = metrics.getTimingInfo(); for (Field counter : COUNTERS) { Optional.ofNullable(timing.getCounter(counter.name())) .filter(v -> v.longValue() > 0) .ifPresent(v -> registry.counter(metricId(counter, baseTags)).increment(v.longValue())); } for (Field timer : TIMERS) { Optional.ofNullable(timing.getLastSubMeasurement(timer.name())) .filter(TimingInfo::isEndTimeKnown) .ifPresent(t -> registry.timer(metricId(timer, baseTags)) .record(t.getEndTimeNano() - t.getStartTimeNano(), TimeUnit.NANOSECONDS)); } notEmpty(metrics.getProperty(Field.ThrottleException)).ifPresent(throttleExceptions -> { final Id throttling = metricId("throttling", baseTags); throttleExceptions.forEach(ex -> registry.counter(throttling.withTag("throttleException", ex.getClass().getSimpleName())) .increment()); }); } }
Source:
<code>public Series<Object, Integer> generateSeries(JudgmentSeriesCriteria judgmentSeriesCriteria, XSettings xsettings) { JudgmentCriteria judgmentCriteria = judgmentSeriesCriteriaConverter.convert(judgmentSeriesCriteria); SolrQuery query = judgmentSearchQueryFactory.createQuery(judgmentCriteria, new Paging(0, 0)); xSettingsFacetQueryApplier.applyXSettingsToQuery(query, xsettings); QueryResponse response = null; try { response = solrServer.query(query); } catch (SolrServerException e) { log.warn("Error in generating series", e); <START> return new Series<Object, Integer>(); <END> } Series<Object, Integer> series = seriesResultsConverter.convertToSeries(response, xsettings.getField()); return series; }</code><technical_language>do it. If get exception (that case) rethrow a runtime exception handle in webapp. Warn returning empty series is misleading user query resulted in empty response. Ideally, create SolrQueryExecutor solrServer internally rethrow SolrServerException runtime SolrSearchExecutionException... this handle exceptions in one, way</technical_language>

Target:
public Series<Object, Integer> generateSeries(JudgmentSeriesCriteria judgmentSeriesCriteria, XSettings xsettings) { Preconditions.checkNotNull(judgmentSeriesCriteria); Preconditions.checkNotNull(xsettings); JudgmentCriteria judgmentCriteria = judgmentSeriesCriteriaConverter.convert(judgmentSeriesCriteria); SolrQuery query = judgmentSearchQueryFactory.createQuery(judgmentCriteria, new Paging(0, 0)); xSettingsToQueryApplier.applyXSettingsToQuery(query, xsettings); QueryResponse response = solrQueryExecutor.executeQuery(query); Series<Object, Integer> series = seriesResultConverter.convertToSeries(response, xsettings.getField()); return series; }
Source:
<code>public DagBuilder(final String name, final DagProcessor dagProcessor) { requireNonNull(name, "The name of the DagBuilder can't be null"); <START> requireNonNull(name, "The dagProcessor of the DagBuilder can't be null"); <END> this.dag = new Dag(name, dagProcessor); }</code><technical_language>this requireNonNull(dagProcessor,</technical_language>

Target:
public DagBuilder(final String name, final DagProcessor dagProcessor) { requireNonNull(name, "The name of the DagBuilder can't be null"); requireNonNull(dagProcessor, "The dagProcessor of the DagBuilder can't be null"); this.dag = new Dag(name, dagProcessor); }
Source:
<code>public boolean isContainsOwnerPostsOnly() { for (Post post : getDisplayedPosts()) { <START> if (post.getUserCreated().getId() != topicStarter.getId()) { <END> return false; } } return true; }</code><technical_language>compare users equals method</technical_language>

Target:
public boolean isContainsOwnerPostsOnly() { for (Post post : getDisplayedPosts()) { if (post.getUserCreated().equals(topicStarter)) { return false; } } return true; }
Source:
<code>public void testImageNoUrl() { builder.beginDocument(); builder.characters("a "); builder.image(new ImageAttributes(), null); builder.characters(" test"); builder.endDocument(); String markup = out.toString(); TestUtil.println(markup); assertEquals("a <START> !! test\n\n", <END> markup); }</code><technical_language>this want - !! is character content, image. thinking image src represented in Confluence, leave out !!. do think</technical_language>

Target:
public void testImageNoUrl() { builder.beginDocument(); builder.characters("a "); builder.image(new ImageAttributes(), null); builder.characters(" test"); builder.endDocument(); String markup = out.toString(); TestUtil.println(markup); assertEquals("a test\n\n", markup); }
Source:
<code>private FeedbackResponseCommentAttributes restoreFrCommentFromDataBundle(String existingFrCommentInDataBundle) { FeedbackResponseCommentAttributes existingFrComment = dataBundle.feedbackResponseComments.get(existingFrCommentInDataBundle); <START> FeedbackResponseCommentAttributes frComment = FeedbackResponseCommentAttributes.builder( <END> existingFrComment.courseId, existingFrComment.feedbackSessionName) .withGiverEmail(existingFrComment.giverEmail) .withFeedbackQuestionId(existingFrComment.feedbackQuestionId) .withFeedbackResponseId(existingFrComment.feedbackResponseId) .withCommentText(existingFrComment.commentText) .withCreatedAt(existingFrComment.createdAt) .build(); restoreFrCommentIdFromExistingOne(frComment, existingFrComment); return frComment; }</code><technical_language>move .builder( next line</technical_language>

Target:
private FeedbackResponseCommentAttributes restoreFrCommentFromDataBundle(String existingFrCommentInDataBundle) { FeedbackResponseCommentAttributes existingFrComment = dataBundle.feedbackResponseComments.get(existingFrCommentInDataBundle); FeedbackResponseCommentAttributes frComment = FeedbackResponseCommentAttributes .builder(existingFrComment.courseId, existingFrComment.feedbackSessionName, existingFrComment.giverEmail, existingFrComment.commentText) .withFeedbackQuestionId(existingFrComment.feedbackQuestionId) .withFeedbackResponseId(existingFrComment.feedbackResponseId) .withCreatedAt(existingFrComment.createdAt) .build(); restoreFrCommentIdFromExistingOne(frComment, existingFrComment); return frComment; }
Source:
<code>private double getCellScrollDeltaY(final GridWidget gridWidget, final boolean isHeaderCellSelected) { final GridData gridModel = gridWidget.getModel(); <START> final GridData.SelectedCell origin = getSelectedCellOrigin(gridModel, isHeaderCellSelected); <END> final int uiRowIndex = origin.getRowIndex(); double dy = 0; final Bounds bounds = gridLayer.getVisibleBounds(); final double rowHeight = gridModel.getRow(uiRowIndex).getHeight(); final double headerHeight = gridWidget.getRenderer().getHeaderHeight(); final double gridCellY = gridWidget.getY() + headerHeight + gridWidget.getRendererHelper().getRowOffset(uiRowIndex); if (gridCellY + rowHeight >= bounds.getY() + bounds.getHeight()) { dy = bounds.getY() + bounds.getHeight() - gridCellY - rowHeight; } else if (gridCellY <= bounds.getY() + headerHeight) { dy = bounds.getY() + headerHeight - gridCellY; } return dy; }</code><technical_language>This breaks DMN a header multiple rows (I suspect break _scesim_ columns multi-row headers). This [line](<LINK_0> uiRowIndex get height of a _row_. For example if grid zero row header rows clicking in header row attempting keyboard operations, uiRowIndex equals 1 rows list is completely empty index 0. getCellScrollDeltaY(..) method needs perform operations depending rows "selected cell" header "selected cell"</technical_language>

Target:
private double getCellScrollDeltaY(final GridWidget gridWidget, final boolean isHeaderCellSelected) { final GridData gridModel = gridWidget.getModel(); final GridData.SelectedCell origin = getSelectedCellOrigin(gridModel, isHeaderCellSelected); final int uiRowIndex = origin.getRowIndex(); double dy = 0; final Bounds bounds = gridLayer.getVisibleBounds(); final int headerRowCount = gridModel.getHeaderRowCount(); final double headerHeight = gridWidget.getRenderer().getHeaderHeight(); final double rowHeight = isHeaderCellSelected ? gridWidget.getRenderer().getHeaderRowHeight() : gridModel.getRow(uiRowIndex).getHeight(); final double headerYOffset = isHeaderCellSelected ? headerHeight - headerRowCount * rowHeight : headerHeight; final double rowOffset = isHeaderCellSelected ? rowHeight * uiRowIndex : gridWidget.getRendererHelper().getRowOffset(uiRowIndex); final double gridCellY = gridWidget.getY() + headerYOffset + rowOffset; if (gridCellY + rowHeight >= bounds.getY() + bounds.getHeight()) { dy = bounds.getY() + bounds.getHeight() - gridCellY - rowHeight; } else if (gridCellY <= bounds.getY() + headerYOffset) { dy = bounds.getY() + headerYOffset - gridCellY; } return dy; }
Source:
<code>public void setConnectionFactory(ConnectionFactory connectionFactory) { super.setConnectionFactory(connectionFactory); if (!this.receiveTimeoutExplicitlySet) { if (connectionFactory instanceof CachingConnectionFactory && ((CachingConnectionFactory) connectionFactory).isCacheConsumers()) { super.setReceiveTimeout(JmsDestinationAccessor.RECEIVE_TIMEOUT_NO_WAIT); } else { <START> super.setReceiveTimeout(1000); <END> } } }</code><technical_language>Sonar bark a "magic" number; a constant</technical_language>

Target:
public void setConnectionFactory(ConnectionFactory connectionFactory) { super.setConnectionFactory(connectionFactory); if (!this.receiveTimeoutExplicitlySet) { if (connectionFactory instanceof CachingConnectionFactory && ((CachingConnectionFactory) connectionFactory).isCacheConsumers()) { super.setReceiveTimeout(JmsDestinationAccessor.RECEIVE_TIMEOUT_NO_WAIT); } else { super.setReceiveTimeout(NO_CACHING_RECEIVE_TIMEOUT); } } }
Source:
<code>private void InitVdsBroker() { log.infoFormat("Initialize vdsBroker ({0},{1})", _vds.getHostName(), _vds.getPort()); int clientTimeOut = Config.<Integer> getValue(ConfigValues.vdsTimeout) * 1000; int connectionTimeOut = Config.<Integer> getValue(ConfigValues.vdsConnectionTimeout) * 1000; int clientRetries = Config.<Integer> getValue(ConfigValues.vdsRetries); <START> if (_vds.getProtocol() == 1) { <END> _vdsProxy = new JsonRpcVdsServer(JsonRpcUtils.createStompClient(_vds.getHostName(), _vds.getPort(), connectionTimeOut, clientTimeOut, clientRetries, Config.<Boolean> getValue(ConfigValues.EncryptHostCommunication))); } else if (_vds.getProtocol() == 0){ Pair<VdsServerConnector, HttpClient> returnValue = XmlRpcUtils.getConnection(_vds.getHostName(), _vds.getPort(), clientTimeOut, connectionTimeOut, clientRetries, VdsServerConnector.class, Config.<Boolean> getValue(ConfigValues.EncryptHostCommunication)); _vdsProxy = new VdsServerWrapper(returnValue.getFirst(), returnValue.getSecond()); } }</code><technical_language>well, of I read code understand, - still, enum is better</technical_language>

Target:
private void InitVdsBroker() { log.infoFormat("Initialize vdsBroker ({0},{1})", _vds.getHostName(), _vds.getPort()); int clientTimeOut = Config.<Integer> getValue(ConfigValues.vdsTimeout) * 1000; int connectionTimeOut = Config.<Integer> getValue(ConfigValues.vdsConnectionTimeout) * 1000; int clientRetries = Config.<Integer> getValue(ConfigValues.vdsRetries); if (VdsProtocol.STOMP == _vds.getProtocol()) { _vdsProxy = new JsonRpcVdsServer(JsonRpcUtils.createStompClient(_vds.getHostName(), _vds.getPort(), connectionTimeOut, clientTimeOut, clientRetries, Config.<Boolean> getValue(ConfigValues.EncryptHostCommunication))); } else if (VdsProtocol.XML == _vds.getProtocol()){ Pair<VdsServerConnector, HttpClient> returnValue = XmlRpcUtils.getConnection(_vds.getHostName(), _vds.getPort(), clientTimeOut, connectionTimeOut, clientRetries, VdsServerConnector.class, Config.<Boolean> getValue(ConfigValues.EncryptHostCommunication)); _vdsProxy = new VdsServerWrapper(returnValue.getFirst(), returnValue.getSecond()); } }
Source:
<code>private void updateAndPropagate(Map<VElement, VDiagnostic> controlDiagnosticMap) { for (final Map.Entry<VElement, VDiagnostic> next : controlDiagnosticMap.entrySet()) { next.getKey().setDiagnostic(next.getValue()); <START> reevaluateToTop(next.getKey().eContainer(), controlDiagnosticMap); <END> } }</code><technical_language>checking parent multiple times, sense set diagnostic collect unique parents propagating? change propagation decrease amount of calculations do? collect unique parent level hand update diagnostic</technical_language>

Target:
private void updateAndPropagate(Map<VElement, VDiagnostic> controlDiagnosticMap) { controlDiagnosticMap.forEach(VElement::setDiagnostic); final NavigableMap<Integer, Set<VElement>> depthMap = mapByDepth(controlDiagnosticMap.keySet()); reevaluateToTop(depthMap, controlDiagnosticMap); }
Source:
<code>public <T> T createInstance(PartitionHandlingConfiguration config) { String mergePolicyClass = config.mergePolicyClass(); if (mergePolicyClass == null) return null; try { return (T) policies.computeIfAbsent(mergePolicyClass, k -> new CompletableFuture<>()).get(TIMEOUT_SECONDS, TimeUnit.SECONDS); } catch (InterruptedException | ExecutionException e) { throw new IllegalStateException("An error occurred while processing the deployment", e); } catch (TimeoutException e) { InfinispanLogger.ROOT_LOGGER.loadingCustomMergePolicyTimeout(mergePolicyClass); } <START> return null; <END> }</code><technical_language>right ignore timeouts here, means cache started a merge policy</technical_language>

Target:
public <T> T createInstance(PartitionHandlingConfiguration config) { EntryMergePolicy mergePolicy = config.mergePolicy(); if (mergePolicy == null) return null; if (mergePolicy instanceof DeployedMergePolicy) { DeployedMergePolicy wrapper = (DeployedMergePolicy) mergePolicy; try { return (T) policies.computeIfAbsent(wrapper.getClassName(), k -> new CompletableFuture<>()).get(TIMEOUT_SECONDS, TimeUnit.SECONDS); } catch (InterruptedException | ExecutionException e) { throw new IllegalStateException("An error occurred while processing the deployment", e); } catch (TimeoutException e) { InfinispanLogger.ROOT_LOGGER.loadingCustomMergePolicyTimeout(wrapper.getClassName()); throw new CacheException(e); } } return (T) mergePolicy; }
Source:
<code>public void doBefore() { lastComment = null; final EventListener el = this; eventDesc = new EventListenerDescriptor() { @Override public Set<String> getEvents() { return Sets.newHashSet(LifeCycleConstants.TRANSITION_EVENT); } @Override public EventListener asEventListener() { <START> return el; <END> } @Override public void initListener() { } }; eventService.addEventListener(eventDesc); }</code><technical_language>need a local variable el, do return TransitionTest.this</technical_language>

Target:
public void doBefore() { lastComment = null; eventDesc = new EventListenerDescriptor() { @Override public Set<String> getEvents() { return Sets.newHashSet(LifeCycleConstants.TRANSITION_EVENT); } @Override public EventListener asEventListener() { return TransitionTest.this; } @Override public void initListener() { } }; eventService.addEventListener(eventDesc); }
Source:
<code>private void logEnabledExtensions() { <START> log.info("Start of enabled extensions list: "); <END> for (ExtensionEntry entry: loadedEntries.values()) { Map<ExtensionProperties, Object> context = entry.extension.getContext(); if (entry.extension != null) { log.info(String.format( "Name: %1$s Author %2$s Version %3$s Home: %4$s License: %5$s File: %6$s", emptyIfNull(context.get(ExtensionProperties.EXTENSION_NAME)), emptyIfNull(context.get(ExtensionProperties.AUTHOR)), emptyIfNull(context.get(ExtensionProperties.VERSION)), emptyIfNull(context.get(ExtensionProperties.HOME)), emptyIfNull(context.get(ExtensionProperties.LICENSE)), emptyIfNull(entry.file) ) ); } } log.info("End of enabled extensions list"); }</code><technical_language>picky... nede for ": "</technical_language>

Target:
private void logEnabledExtensions() { log.info("Start of enabled extensions list"); for (ExtensionEntry entry: loadedEntries.values()) { Map<ExtensionProperties, Object> context = entry.extension.getContext(); if (entry.extension != null) { log.info(String.format( "Name: '%1$s', Author '%2$s', Version '%3$s', Home: '%4$s' License: '%5$s' File: '%6$s'", emptyIfNull(context.get(ExtensionProperties.EXTENSION_NAME)), emptyIfNull(context.get(ExtensionProperties.AUTHOR)), emptyIfNull(context.get(ExtensionProperties.VERSION)), emptyIfNull(context.get(ExtensionProperties.HOME)), emptyIfNull(context.get(ExtensionProperties.LICENSE)), emptyIfNull(entry.file) ) ); } } log.info("End of enabled extensions list"); }
Source:
<code>default <T> SearchHit<T> queryForObject(Query query, Class<T> clazz, IndexCoordinates index) { SearchHits<T> searchHits = queryForList(query, clazz, index); <START> return searchHits.hasSearchHits() ? searchHits.getSearchHit(0) : null; <END> }</code><technical_language>torn naming. Spring Data typically adapts store-specific operation naming stay close original operations in store. names queryForList, queryForObject, originate in Spring's JDBC Template method expresses intent execution/result intent formulated query (SQL in case of JDBC). For Elastic, this search (or searchOne). if deprecate queryForObject (and leave method signature as-is) introduce new methods? simplify migration introduce methods follow in store itself</technical_language>

Target:
default <T> T queryForObject(Query query, Class<T> clazz, IndexCoordinates index) { return (T) SearchHitSupport.unwrapSearchHits(searchOne(query, clazz, index)); }
Source:
<code>public SystemAdmin getSystemAdmin(String systemName, String adminLabel) { <START> if (systemAdminMap.isEmpty() || (systemAdminMap.containsKey(systemName) && systemAdminMap.get(systemName).isStopped())) { <END> systemAdminMap.clear(); } return getSystemAdmins(adminLabel).get(systemName); }</code><technical_language>need for isEmpty() check</technical_language>

Target:
public SystemAdmin getSystemAdmin(String systemName, String adminLabel) { if (systemAdminMap.containsKey(systemName) && systemAdminMap.get(systemName).isStopped()) { systemAdminMap.clear(); } return getSystemAdmins(adminLabel).get(systemName); }
Source:
<code>private void persistWorkbenchModel() { Job[] cleanAndSaveJobs = Job.getJobManager().find(WORKBENCH_AUTO_SAVE_BACKGROUND_JOB); <START> if (cleanAndSaveJobs != null && cleanAndSaveJobs.length > 0) { <END> return; } final MApplication appCopy = (MApplication) EcoreUtil.copy((EObject) application); if (detectWorkbenchCorruption(appCopy)) { return; } final IModelResourceHandler handler = e4Context.get(IModelResourceHandler.class); Job cleanAndSaveJob = new Job(WORKBENCH_AUTO_SAVE_BACKGROUND_JOB) { @Override protected IStatus run(IProgressMonitor monitor) { final Resource res = handler.createResourceWithApp(appCopy); cleanUpCopy(appCopy, e4Context); try { if (!detectWorkbenchCorruption((MApplication) res.getContents().get(0))) { res.save(null); } } catch (IOException e) { } finally { res.unload(); res.getResourceSet().getResources().remove(res); } return Status.OK_STATUS; } @Override public boolean belongsTo(Object family) { return WORKBENCH_AUTO_SAVE_BACKGROUND_JOB == family; } }; cleanAndSaveJob.setPriority(Job.SHORT); cleanAndSaveJob.setSystem(true); cleanAndSaveJob.schedule(); }</code><technical_language>this result in loosing data? If a job is running, a change system want save again, lock loose new data</technical_language>

Target:
private void persistWorkbenchModel() { try { Job.getJobManager().join(WORKBENCH_AUTO_SAVE_JOB, new NullProgressMonitor()); } catch (OperationCanceledException e) { } catch (InterruptedException e) { } final MApplication appCopy = (MApplication) EcoreUtil.copy((EObject) application); if (detectWorkbenchCorruption(appCopy)) { return; } final IModelResourceHandler handler = e4Context.get(IModelResourceHandler.class); Job cleanAndSaveJob = new Job(WORKBENCH_AUTO_SAVE_BACKGROUND_JOB) { @Override protected IStatus run(IProgressMonitor monitor) { final Resource res = handler.createResourceWithApp(appCopy); cleanUpCopy(appCopy, e4Context); try { if (!detectWorkbenchCorruption((MApplication) res.getContents().get(0))) { res.save(null); } } catch (IOException e) { } finally { res.unload(); res.getResourceSet().getResources().remove(res); } return Status.OK_STATUS; } @Override public boolean belongsTo(Object family) { return WORKBENCH_AUTO_SAVE_JOB.equals(family); } }; cleanAndSaveJob.setPriority(Job.SHORT); cleanAndSaveJob.setSystem(true); cleanAndSaveJob.schedule(); }
Source:
<code><START> private static boolean isBuiltIn(String sql, String builtIn) { return sql.regionMatches(true, 0, builtIn, 0, builtIn.length()); } <END></code><technical_language>copies of this method, of needs removed. place this method in StringUtils class instead some generic name, startsWithIgnoreCase(String string, String prefix). Please send a license statement <LINK_1> mailing list: <LINK_0>!forum/h2-database</technical_language>

Target:
public static boolean isBuiltIn(String sql, String builtIn) { return sql.regionMatches(true, 0, builtIn, 0, builtIn.length()); }
Source:
<code>public Intersection(SimpleFeature intersectionFeature, AttributeGetter getter) { this.point = (Point) intersectionFeature.getDefaultGeometry(); this.attGet = getter; this.transectId = (Integer) attGet.getValue(TRANSECT_ID_ATTR, intersectionFeature); this.distance = (Double) attGet.getValue(DISTANCE_ATTR, intersectionFeature); <START> this.isMeanHighWater = getBooleanFromMhwAttribute(attGet.getValue(MHW_ATTR, intersectionFeature)); <END> this.feature = intersectionFeature; }</code><technical_language>suggestion, this useful put in AttributeGetter code is a special case for this attribute. I issues though</technical_language>

Target:
public Intersection(SimpleFeature intersectionFeature, AttributeGetter getter) { this.point = (Point) intersectionFeature.getDefaultGeometry(); this.attGet = getter; this.transectId = (Integer) attGet.getValue(TRANSECT_ID_ATTR, intersectionFeature); this.distance = (Double) attGet.getValue(DISTANCE_ATTR, intersectionFeature); this.isMeanHighWater = attGet.getBooleanFromMhwAttribute(attGet.getValue(MHW_ATTR, intersectionFeature)); this.feature = intersectionFeature; }
Source:
<code>public void allowSnapshot(Path path) throws IOException { dfs.allowSnapshot(path); if (dfs.isSnapshotTrashRootEnabled()) { try { dfs.provisionSnapshotTrash(path, TRASH_PERMISSION); } catch (FileAlreadyExistsException ex) { <START> LOG.warn(ex.getMessage()); <END> LOG.info("You can safely ignore the above warning if you are allowing " + "snapshot on an encryption zone, as the EZ already has a trash."); } } }</code><technical_language>I 2 approaches instead of ignoring FileAlreadyExists exception: 1) validate existing Trash path is a directory validate permissions throw FileAlreadyExists exception in DistributedFileSystem.java#provisionSnapshotTrash 2) If trash path exists right permissions, check if path is encryption zone throw FileAlreadyExists exception if encryption zone. Similar change required for making snapshottable dir encryption zone. I ok of approaches. I ignoring exception work in case. existing path is a directory right permissions</technical_language>

Target:
public void allowSnapshot(Path path) throws IOException { dfs.allowSnapshot(path); if (dfs.isSnapshotTrashRootEnabled()) { dfs.provisionSnapshotTrash(path, TRASH_PERMISSION); } }
Source:
<code>public ValueNode replaceIndexExpression(ResultColumnList childRCL) throws StandardException { ValueNodeList newList = (ValueNodeList) getNodeFactory().getNode( C_NodeTypes.VALUE_NODE_LIST, getContextManager()); for (Object leftItem : leftOperandList) { newList.addValueNode(((ValueNode) leftItem).replaceIndexExpression(childRCL)); } leftOperandList = newList; <START> return this; <END> }</code><technical_language>need check rightOperandList also</technical_language>

Target:
public ValueNode replaceIndexExpression(ResultColumnList childRCL) throws StandardException { if (leftOperandList != null) { leftOperandList = leftOperandList.replaceIndexExpression(childRCL); } if (rightOperandList != null) { rightOperandList = rightOperandList.replaceIndexExpression(childRCL); } return this; }
Source:
<code>public void setShowBuffering(boolean showBuffering) { <START> setShowBuffering(showBuffering ? SHOW_BUFFERING_ALWAYS : SHOW_BUFFERING_NEVER); <END> }</code><technical_language>SHOW_BUFFERING_WHEN_PLAYING SHOW_BUFFERING_ALWAYS, behavior of this method change</technical_language>

Target:
public void setShowBuffering(boolean showBuffering) { setShowBuffering(showBuffering ? SHOW_BUFFERING_WHEN_PLAYING : SHOW_BUFFERING_NEVER); }
Source:
<code>public void oneGardenSecondStudent() { String student = "Bob"; String plants = "VVCCGG\nVVCCGG"; Plant[] expected = {Plant.CLOVER, Plant.CLOVER, Plant.CLOVER, Plant.CLOVER}; <START> assertEquals(expected, <END> new KindergartenGarden(plants).getPlantsOfStudent(student)); }</code><technical_language>I find readable argument a new line; asserEquals( expected, new KindergartenGarden(plants).getPlantsOfStudents(student) ); preference, feel free ignore if disagree :) important is avoid overly long lines line breaks in places, done :)</technical_language>

Target:
public void oneGardenSecondStudent() { String student = "Bob"; String plants = "VVCCGG\nVVCCGG"; List<Plant> expected = Arrays.asList(Plant.CLOVER, Plant.CLOVER, Plant.CLOVER, Plant.CLOVER); assertEquals( expected, new KindergartenGarden(plants).getPlantsOfStudent(student) ); }
Source:
<code>public void reset() { <START> init(); <END> }</code><technical_language>Is this method needed? similar init public</technical_language>

Target:
public void reset() { excludeLists = propertyToList(KIE_LISTENER_EXCLUDE); includeLists = propertyToList(KIE_LISTENER_INCLUDE); listeners.clear(); Predicate<String> predicate = createPredicate(); for (NotificationListener listener : listenersLoaded) { if (predicate.test(listener.getClass().getName())) { listeners.add(listener); } } }
Source:
<code>@Override public void send(Bundle input) { try { Bundle output = input; if (fields != null) { output = output.createBundle(); <START> for (int i = 0; i < fields.length; i++) { <END> IndexField fieldIn = fieldsIn[i]; AutoField fieldOut = fieldsOut[i]; fieldOut.setValue(output, fieldIn.getValue(input)); } } queue.put(output); } catch (InterruptedException ex) { firstError.compareAndSet(null, ex); close(); } }</code><technical_language>I iterating sequential index fields is for (BundleField field : bundle.getFormat())</technical_language>

Target:
@Override public void send(Bundle input) { try { Bundle output; if (fields == null) { output = input; } else { if (fields.length != input.getFormat().getFieldCount()) { throw new IllegalStateException("Expecting " + fields.length + " fields " + Arrays.toString(fields) + " and result from query has " + input.getFormat().getFieldCount() + " fields " + Arrays.toString(fieldNames(input))); } output = formatOut.createBundle(); Iterator<BundleField> fieldsIn = input.getFormat().iterator(); for (int i = 0; i < fields.length; i++) { AutoField fieldOut = fields[i]; fieldOut.setValue(output, input.getValue(fieldsIn.next())); } } queue.put(output); } catch (Exception ex) { firstError.compareAndSet(null, ex); close(); } }
Source:
<code>public String toString() { return new String(this.workspacePath) + <START> "|" + <END> new String(this.fieldDescriptor); }</code><technical_language>This is anti-pattern. a StringBuilder instead. comma instead of |</technical_language>

Target:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append(this.workspacePath); builder.append("|"); builder.append(this.fieldDescriptor); return builder.toString(); }
Source:
<code>private static Bin mergeBins(final List<Bin> bins) { if (bins.isEmpty()) { throw new IllegalArgumentException("Cannot merge empty bins"); } if (bins.size() == 1) { return bins.get(0); } final int referenceSequence = bins.get(0).getReferenceSequence(); final int binNumber = bins.get(0).getBinNumber(); final List<Chunk> allChunks = new ArrayList<>(); for (Bin b : bins) { if (b.getReferenceSequence() != referenceSequence) { throw new IllegalArgumentException("Bins have different reference sequences"); } if (b.getBinNumber() != binNumber) { throw new IllegalArgumentException("Bins have different numbers"); } allChunks.addAll(b.getChunkList()); } Collections.sort(allChunks); final Bin bin = new Bin(referenceSequence, binNumber); for (Chunk newChunk : allChunks) { final long chunkStart = newChunk.getChunkStart(); final long chunkEnd = newChunk.getChunkEnd(); final List<Chunk> oldChunks = bin.getChunkList(); if (!bin.containsChunks()) { bin.addInitialChunk(newChunk); } else { final Chunk lastChunk = bin.getLastChunk(); if (BlockCompressedFilePointerUtil.areInSameOrAdjacentBlocks( lastChunk.getChunkEnd(), chunkStart)) { lastChunk.setChunkEnd(chunkEnd); } else { oldChunks.add(newChunk); bin.setLastChunk(newChunk); } <START> } <END> } return bin; }</code><technical_language>I this block extracted a method Bin.addChunk() replace duplicate code here, CRAMBAIIndexer, BinningIndexBuilder</technical_language>

Target:
private static Bin mergeBins(final List<Bin> bins) { if (bins.isEmpty()) { throw new IllegalArgumentException("Cannot merge empty bins"); } if (bins.size() == 1) { return bins.get(0); } final int referenceSequence = bins.get(0).getReferenceSequence(); final int binNumber = bins.get(0).getBinNumber(); final List<Chunk> allChunks = new ArrayList<>(); for (Bin b : bins) { if (b.getReferenceSequence() != referenceSequence) { throw new IllegalArgumentException(String.format("Bins have different reference sequences, %s and %s.", b.getReferenceSequence(), referenceSequence)); } if (b.getBinNumber() != binNumber) { throw new IllegalArgumentException(String.format("Bins have different numbers, %s and %s.", b.getBinNumber(), binNumber)); } allChunks.addAll(b.getChunkList()); } Collections.sort(allChunks); final Bin bin = new Bin(referenceSequence, binNumber); for (Chunk newChunk : allChunks) { bin.addChunk(newChunk); } return bin; }
Source:
<code>public void shutdownAdminBlobStorageService() throws IOException { adminBlobStorageService.shutdown(); router.close(); <START> } <END></code><technical_language>responseHandler.shutdown()</technical_language>

Target:
public void shutdownAdminBlobStorageService() throws IOException { adminBlobStorageService.shutdown(); responseHandler.shutdown(); router.close(); }