auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public final Object doSObject(final Object receiver) { if (VmSettings.SNAPSHOTS_ENABLED) { SnapshotBuffer sb = new SnapshotBuffer(); if (!sb.containsObject(receiver)) { SClass sc = Types.getClassOf(receiver); sc.getSerializer().serialize(receiver, sb); ByteBuffer bb = sb.getBuffer(); short cId = bb.getShort(); <START> SClass clazz = SnapshotBackend.lookupClass(cId); <END> Object o = clazz.getSerializer().deserialize(bb); return o; } } return null; }</code><technical_language>is clazz != sc? strange. expect assert same, if feel need do lookup. Hm, change identity? underlying mixin same, right</technical_language>

Target:
public final Object doSObject(final Object receiver) { if (VmSettings.SNAPSHOTS_ENABLED) { SnapshotBuffer sb = new SnapshotBuffer(); if (!sb.containsObject(receiver)) { SClass clazz = Types.getClassOf(receiver); clazz.serialize(receiver, sb); ByteBuffer bb = sb.getBuffer(); short cId = bb.getShort(); Object o = SnapshotBackend.lookupClass(cId).getSerializer().deserialize(bb); assert Types.getClassOf(o) == clazz; return o; } } return null; }
Source:
<code>void stop() { try { AmazonEC2 ec2 = getCloud().connect(); StopInstancesRequest request = new StopInstancesRequest(Collections.singletonList(getInstanceId())); LOGGER.fine("Sending stop request for " + getInstanceId()); ec2.stopInstances(request); LOGGER.info("EC2 instance stop request sent for " + getInstanceId()); toComputer().disconnect(null); } catch (AmazonClientException e) { Instance i = null; <START> try { <END> i = CloudHelper.getInstanceWithRetry(getInstanceId(), getCloud()); LOGGER.log(Level.WARNING, "Failed to stop EC2 instance: " + getInstanceId() + " info: " + ((i != null) ? i : ""), e); } catch (InterruptedException ie) { LOGGER.fine("InterruptedException while get " + getInstanceId() + " Exception: " + ie); return; } } }</code><technical_language>I thought I replaced call, is not. I a fan of try/Catch in a try/Catch, find a solution ? (call public getInstance)</technical_language>

Target:
void stop() { try { AmazonEC2 ec2 = getCloud().connect(); StopInstancesRequest request = new StopInstancesRequest(Collections.singletonList(getInstanceId())); LOGGER.fine("Sending stop request for " + getInstanceId()); ec2.stopInstances(request); LOGGER.info("EC2 instance stop request sent for " + getInstanceId()); toComputer().disconnect(null); } catch (AmazonClientException e) { LOGGER.log(Level.WARNING, "Failed to stop EC2 instance: " + getInstanceId(), e); } }
Source:
<code>public void clientCallback(final ClientResponse response) throws InterruptedException { if (response.getStatus() != ClientResponse.SUCCESS) { m_es.execute(new Runnable() { @Override public void run() { try { reinsertFailed(m_batchRowList); } catch (Exception e) { loaderLog.error("Failed to re-insert failed batch", e); } } }); } else { m_es.execute(new Runnable() { @Override public void run() { try { for (VoltBulkLoaderRow r : m_batchRowList) { r.m_loader.m_notificationCallBack.callback(r.m_rowHandle, null, response); } } catch (Exception e) { <START> loaderLog.error("Failed to re-insert failed batch", e); <END> } } }); m_batchRowList.get(0).m_loader.m_loaderCompletedCnt.addAndGet(m_batchRowList.size()); m_batchRowList.get(0).m_loader.m_outstandingRowCount.addAndGet(-1 * m_batchRowList.size()); } }</code><technical_language>This is wrong error message</technical_language>

Target:
public void clientCallback(final ClientResponse response) throws InterruptedException { if (response.getStatus() != ClientResponse.SUCCESS) { m_es.execute(new Runnable() { @Override public void run() { try { reinsertFailed(m_batchRowList); } catch (Exception e) { loaderLog.error("Failed to re-insert failed batch", e); } } }); } else { if (m_successCallback != null) { m_es.execute(new Runnable() { @Override public void run() { for (VoltBulkLoaderRow r : m_batchRowList) { m_successCallback.success(r.m_rowHandle, response); } } }); } for (Map.Entry<VoltBulkLoader, Long> e : m_batchSizes.entrySet()) { e.getKey().m_loaderCompletedCnt.addAndGet(e.getValue()); e.getKey().m_outstandingRowCount.addAndGet(-1 * e.getValue()); } } }
Source:
<code>protected ListenableFuture<Map<Long, Long>> getCommitTimestamps( @Nullable TableReference tableRef, Iterable<Long> startTimestamps, boolean shouldWaitForCommitterToComplete, AsyncTransactionService asyncTransactionService) { if (Iterables.isEmpty(startTimestamps)) { return Futures.immediateFuture(ImmutableMap.of()); } <START> Map<Long, Long> startToCommitTimestampMap = Maps.newHashMap(); <END> Set<Long> gets = Sets.newHashSet(); for (long startTs : startTimestamps) { Long cached = timestampValidationReadCache.getCommitTimestampIfPresent(startTs); if (cached != null) { startToCommitTimestampMap.put(startTs, cached); } else { gets.add(startTs); } } if (gets.isEmpty()) { return Futures.immediateFuture(startToCommitTimestampMap); } if (shouldWaitForCommitterToComplete) { waitForCommitterToComplete(tableRef, startTimestamps); } traceGetCommitTimestamps(tableRef, gets); if (gets.size() > transactionConfig.get().getThresholdForLoggingLargeNumberOfTransactionLookups()) { logLargeNumberOfTransactions(tableRef, gets); } getHistogram(AtlasDbMetricNames.NUMBER_OF_TRANSACTIONS_READ_FROM_DB, tableRef).update(gets.size()); return Futures.transform(loadCommitTimestamps(asyncTransactionService, gets), rawResults -> { for (Map.Entry<Long, Long> e : rawResults.entrySet()) { if (e.getValue() != null) { long startTs = e.getKey(); long commitTs = e.getValue(); startToCommitTimestampMap.put(startTs, commitTs); timestampValidationReadCache.putAlreadyCommittedTransaction(startTs, commitTs); } } return startToCommitTimestampMap; }, MoreExecutors.directExecutor()); }</code><technical_language>map</technical_language>

Target:
protected ListenableFuture<Map<Long, Long>> getCommitTimestamps( @Nullable TableReference tableRef, Iterable<Long> startTimestamps, boolean shouldWaitForCommitterToComplete, AsyncTransactionService asyncTransactionService) { if (Iterables.isEmpty(startTimestamps)) { return Futures.immediateFuture(ImmutableMap.of()); } Map<Long, Long> startToCommitTimestamps = Maps.newHashMap(); Set<Long> gets = Sets.newHashSet(); for (long startTs : startTimestamps) { Long cached = timestampValidationReadCache.getCommitTimestampIfPresent(startTs); if (cached != null) { startToCommitTimestamps.put(startTs, cached); } else { gets.add(startTs); } } if (gets.isEmpty()) { return Futures.immediateFuture(startToCommitTimestamps); } if (shouldWaitForCommitterToComplete) { waitForCommitterToComplete(tableRef, startTimestamps); } traceGetCommitTimestamps(tableRef, gets); if (gets.size() > transactionConfig.get().getThresholdForLoggingLargeNumberOfTransactionLookups()) { logLargeNumberOfTransactions(tableRef, gets); } getHistogram(AtlasDbMetricNames.NUMBER_OF_TRANSACTIONS_READ_FROM_DB, tableRef).update(gets.size()); return Futures.transform(loadCommitTimestamps(asyncTransactionService, gets), rawResults -> { for (Map.Entry<Long, Long> e : rawResults.entrySet()) { if (e.getValue() != null) { long startTs = e.getKey(); long commitTs = e.getValue(); startToCommitTimestamps.put(startTs, commitTs); timestampValidationReadCache.putAlreadyCommittedTransaction(startTs, commitTs); } } return startToCommitTimestamps; }, MoreExecutors.directExecutor()); }
Source:
<code>public Collection<UberfireDock> provideDocks(String perspectiveIdentifier) { List<UberfireDock> result = new ArrayList<>(); if (lastActiveContext == null) { lastActiveContext = dataModelerWBContext.getActiveContext(); } if (isGraphicMode(lastActiveContext)) { result.add(new UberfireDock(UberfireDockPosition.EAST, "RANDOM", new DefaultPlaceRequest("DroolsDomainScreen"), perspectiveIdentifier).withSize(450).withLabel(constants.DocksDroolsJBPMTitle())); result.add(new UberfireDock(UberfireDockPosition.EAST, "BRIEFCASE", new DefaultPlaceRequest("JPADomainScreen"), perspectiveIdentifier).withSize(450).withLabel(constants.DocksPersistenceTitle())); result.add(new UberfireDock(UberfireDockPosition.EAST, "COG", new DefaultPlaceRequest("AdvancedDomainScreen"), perspectiveIdentifier).withSize(450).withLabel(constants.DocksAdvancedTitle())); <START> if (authorizationManager.authorize(PLANNER_AVAILABLE, <END> sessionInfo.getIdentity())) { result.add(new UberfireDock(UberfireDockPosition.EAST, ImagesResources.INSTANCE.optaPlannerDisabledIcon(), ImagesResources.INSTANCE.optaPlannerEnabledIcon(), new DefaultPlaceRequest("PlannerDomainScreen"), perspectiveIdentifier) .withSize(450).withLabel(constants.DocksOptaPlannerTitle())); } } return result; }</code><technical_language>I a concern here, introduced PLANNER_AVAILABLE local private constant, while WorkbenchFeatures.PLANNER_AVAILABLE is in org.kie.workbench.common.workbench.client.authz.WorkbenchTreeProvider.createPermissions</technical_language>

Target:
public Collection<UberfireDock> provideDocks(String perspectiveIdentifier) { List<UberfireDock> result = new ArrayList<>(); if (lastActiveContext == null) { lastActiveContext = dataModelerWBContext.getActiveContext(); } if (isGraphicMode(lastActiveContext)) { result.add(new UberfireDock(UberfireDockPosition.EAST, "RANDOM", new DefaultPlaceRequest("DroolsDomainScreen"), perspectiveIdentifier).withSize(450).withLabel(constants.DocksDroolsJBPMTitle())); result.add(new UberfireDock(UberfireDockPosition.EAST, "BRIEFCASE", new DefaultPlaceRequest("JPADomainScreen"), perspectiveIdentifier).withSize(450).withLabel(constants.DocksPersistenceTitle())); result.add(new UberfireDock(UberfireDockPosition.EAST, "COG", new DefaultPlaceRequest("AdvancedDomainScreen"), perspectiveIdentifier).withSize(450).withLabel(constants.DocksAdvancedTitle())); if (authorizationManager.authorize(DataModelerFeatures.PLANNER_AVAILABLE, sessionInfo.getIdentity())) { result.add(new UberfireDock(UberfireDockPosition.EAST, ImagesResources.INSTANCE.optaPlannerDisabledIcon(), ImagesResources.INSTANCE.optaPlannerEnabledIcon(), new DefaultPlaceRequest("PlannerDomainScreen"), perspectiveIdentifier) .withSize(450).withLabel(constants.DocksOptaPlannerTitle())); } } return result; }
Source:
<code>public void onMediaUploaded(OnMediaUploaded event) { if (!isAdded() || event.isError() || event.canceled) { return; } if (event.media == null || event.media.getLocalPostId() == 0 || mSite.getId() != event.media.getLocalSiteId()) { return; } PostModel post = mPostStore.getPostByLocalPostId(event.media.getLocalPostId()); if (post != null) { if ((event.media.isError() || event.canceled)){ <START> if (post != null && !UploadService.isPostUploadingOrQueued(post)) { <END> loadPosts(LoadMode.FORCED); } } else { mPostsListAdapter.updateProgressForPost(post); } } }</code><technical_language>checked post != null above</technical_language>

Target:
public void onMediaUploaded(OnMediaUploaded event) { if (!isAdded() || event.isError() || event.canceled) { return; } if (event.media == null || event.media.getLocalPostId() == 0 || mSite.getId() != event.media.getLocalSiteId()) { return; } PostModel post = mPostStore.getPostByLocalPostId(event.media.getLocalPostId()); if (post != null) { if ((event.media.isError() || event.canceled)){ if (!UploadService.isPostUploadingOrQueued(post)) { loadPosts(LoadMode.FORCED); } } else { mPostsListAdapter.updateProgressForPost(post); } } }
Source:
<code>public void execute() throws MojoExecutionException { if ( "pom".equals( getProject().getPackaging() ) ) { getLog().info( "GWT generateAsync is skipped" ); return; } <START> if (getProject() != null && getGenerateDirectory() != null) { <END> getLog().info( "Anticipate addition of generated directory for automatic integration in eclipse" ); getProject().addCompileSourceRoot(getGenerateDirectory().getAbsolutePath()); } if ( encoding == null ) { getLog().warn( "Encoding is not set, your build will be platform dependent" ); encoding = Charset.defaultCharset().name(); } JavaDocBuilder builder = createJavaDocBuilder(); List<String> sourceRoots = getProject().getCompileSourceRoots(); boolean generated = false; for ( String sourceRoot : sourceRoots ) { try { generated |= scanAndGenerateAsync( new File( sourceRoot ), builder ); } catch ( Throwable e ) { getLog().error( "Failed to generate Async interface", e ); if ( failOnError ) { throw new MojoExecutionException( "Failed to generate Async interface", e ); } } } if ( generated ) { getLog().debug( "add compile source root " + getGenerateDirectory() ); addCompileSourceRoot( getGenerateDirectory() ); } }</code><technical_language>getProject() null failed a lines above. I doubt getGenerateDirectory() null either</technical_language>

Target:
public void execute() throws MojoExecutionException { if ( "pom".equals( getProject().getPackaging() ) ) { getLog().info( "GWT generateAsync is skipped" ); return; } getLog().info( "Anticipate addition of generated directory for automatic integration in eclipse" ); addCompileSourceRoot( getGenerateDirectory() ); if ( encoding == null ) { getLog().warn( "Encoding is not set, your build will be platform dependent" ); encoding = Charset.defaultCharset().name(); } JavaDocBuilder builder = createJavaDocBuilder(); List<String> sourceRoots = getProject().getCompileSourceRoots(); boolean generated = false; for ( String sourceRoot : sourceRoots ) { try { generated |= scanAndGenerateAsync( new File( sourceRoot ), builder ); } catch ( Throwable e ) { getLog().error( "Failed to generate Async interface", e ); if ( failOnError ) { throw new MojoExecutionException( "Failed to generate Async interface", e ); } } } }
Source:
<code>private static Set<String> findExtendedTypes( final Component baseComponent ) { <START> final LinkedList<AbstractType> types = new LinkedList<AbstractType>(); <END> types.add( baseComponent ); final Set<String> typeNames = new LinkedHashSet<String>(); while (!types.isEmpty()) { final AbstractType type = types.removeFirst(); typeNames.add( type.getName() ); if (type instanceof Component) { final Component component = (Component) type; final Component extended = component.getExtendedComponent(); if (extended != null) { types.addLast( extended ); } types.addAll( component.getFacets() ); } else if (type instanceof Facet) { final Facet facet = (Facet) type; types.addAll( facet.getExtendedFacets() ); } } return typeNames; }</code><technical_language>do shorter. ComponentHelpers.findAllExtendedComponents( baseComponent ); ComponentHelpers.findAllFacets( baseComponents );</technical_language>

Target:
private static Set<String> findExtendedTypes( final Component baseComponent ) { final LinkedList<AbstractType> types = new LinkedList<AbstractType>(); types.addAll(ComponentHelpers.findAllExtendedComponents(baseComponent)); types.addAll(ComponentHelpers.findAllFacets(baseComponent)); final Set<String> typeNames = new LinkedHashSet<String>(); for (final AbstractType type : types) { typeNames.add(type.getName()); } return typeNames; }
Source:
<code>private void onDequeue() { <START> router.metrics.totalOperationsInExecution.incrementAndGet(); <END> if (operationQueueStartTime != null) { long queueTime = System.currentTimeMillis() - operationQueueStartTime; router.metrics.operationQueuingTimeInMs.update(queueTime); logger.trace("Operation spent ms in execution queue", queueTime); router.metrics.operationDequeuingRate.mark(); } else { router.metrics.queueStartTimeNotRecordedError.inc(); } }</code><technical_language>this in onDequeue() is called, increment decrement method</technical_language>

Target:
private void onDequeue() { if (operationQueueStartTime != null) { long queueTime = System.currentTimeMillis() - operationQueueStartTime; router.metrics.operationQueuingTimeInMs.update(queueTime); logger.trace("Operation spent ms in execution queue", queueTime); router.metrics.operationDequeuingRate.mark(); } else { router.metrics.queueStartTimeNotRecordedError.inc(); } }
Source:
<code>public boolean equals(final Object obj) { if (!super.equals(obj)) { return false; } if (!(obj instanceof AccessSection)) { return false; } final AccessSection other = (AccessSection) obj; if (permissions.size() != other.permissions.size()) { return false; } final HashSet<Permission> same = new HashSet<Permission>(permissions); final HashSet<Permission> different = new HashSet<Permission>(2 * permissions.size()); different.addAll(permissions); different.addAll(other.permissions); same.retainAll(other.permissions); different.removeAll(same); <START> return different.isEmpty(); <END> }</code><technical_language>this work shorter write: return new HashSet<Permission>(permissions) .equals(new HashSet<Permission>(other.permissions)); HashSet.equals() perform of this mess for internally. I agree hard compare List objects order mismatched</technical_language>

Target:
public boolean equals(final Object obj) { if (!super.equals(obj) || !(obj instanceof AccessSection)) { return false; } return new HashSet<Permission>(permissions).equals(new HashSet<Permission>( ((AccessSection) obj).permissions)); }
Source:
<code>public void testPullTimeoutAndRetry() throws NetworkException, InterruptedException { final CountDownLatch sendLatch = new CountDownLatch(1 + ParameterWorkerImpl.MAX_PULL_RETRY_COUNT); final long gracePeriod = 1000; final int key = 0; doAnswer(invocationOnMock -> { sendLatch.countDown(); return null; }).when(mockSender).sendPullMsg(anyString(), anyObject()); new Thread(() -> { worker.pull(key); <START> }).start(); <END> assertTrue(sendLatch.await(PULL_RETRY_TIMEOUT_MS * ParameterWorkerImpl.MAX_PULL_RETRY_COUNT + gracePeriod, TimeUnit.MILLISECONDS)); verify(mockSender, times(1 + ParameterWorkerImpl.MAX_PULL_RETRY_COUNT)).sendPullMsg(anyString(), any(EncodedKey.class)); }</code><technical_language>a micro optimization, avoid spawning thread Executor if possible</technical_language>

Target:
public void testPullTimeoutAndRetry() throws NetworkException, InterruptedException { final CountDownLatch sendLatch = new CountDownLatch(1 + ParameterWorkerImpl.MAX_PULL_RETRY_COUNT); final long gracePeriodMs = 100; final ExecutorService pool = Executors.newSingleThreadExecutor(); final int key = 0; doAnswer(invocationOnMock -> { sendLatch.countDown(); return null; }).when(mockSender).sendPullMsg(anyString(), anyObject()); pool.execute(() -> worker.pull(key)); pool.shutdown(); assertTrue(sendLatch.await((PULL_RETRY_TIMEOUT_MS + gracePeriodMs) * ParameterWorkerImpl.MAX_PULL_RETRY_COUNT, TimeUnit.MILLISECONDS)); verify(mockSender, times(1 + ParameterWorkerImpl.MAX_PULL_RETRY_COUNT)).sendPullMsg(anyString(), any(EncodedKey.class)); }
Source:
<code>protected boolean anyTimedOut(List<String> nodesUrl) { boolean timeout = false; for (String nodeUrl : nodesUrl) { <START> timeout = timeout || pnTimeout.get(nodeUrl); <END> } return timeout; }</code><technical_language>short circuit soon possible: java for (String nodeUrl : nodesUrl) { if (pnTimeout.get(nodeUrl)) { return true; } } return false;</technical_language>

Target:
protected boolean anyTimedOut(List<String> nodesUrl) { for (String nodeUrl : nodesUrl) { if (pnTimeout.get(nodeUrl)) { return true; } } return false; }
Source:
<code>public void postCollectionDefaultBitstreamReadGroupCreateDefaultBitstreamReadGroupUnProcessableName() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); groupRest.setName("Fail"); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); groupRest.setMetadata(metadataRest); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(post("/api/core/collections/" + collection.getID() + "/bitstreamReadGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isUnprocessableEntity()); <START> <END> }</code><technical_language>double check group created default anonymous permission</technical_language>

Target:
public void postCollectionDefaultBitstreamReadGroupCreateDefaultBitstreamReadGroupUnProcessableName() throws Exception { ObjectMapper mapper = new ObjectMapper(); GroupRest groupRest = new GroupRest(); groupRest.setName("Fail"); MetadataRest metadataRest = new MetadataRest(); metadataRest.put("dc.description", new MetadataValueRest("testingDescription")); metadataRest.put("dc.subject", new MetadataValueRest("testSubject")); groupRest.setMetadata(metadataRest); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(post("/api/core/collections/" + collection.getID() + "/bitstreamReadGroup") .content(mapper.writeValueAsBytes(groupRest)) .contentType(contentType)) .andExpect(status().isUnprocessableEntity()); Group anon = groupService.findByName(context, Group.ANONYMOUS); getClient(token).perform(get("/api/core/collections/" + collection.getID() + "/bitstreamReadGroup")) .andExpect(status().isOk()) .andExpect( jsonPath("$", GroupMatcher.matchGroupEntry(anon.getID(), anon.getName()))); }
Source:
<code>void should_pass_if_duration_has_matching_days() { <START> assertThat(Duration.ofDays(4L)).hasDays(4L); <END> }</code><technical_language>a matter of style, converting more more tests GIVEN/WHEN/THEN structure, great for newly tests</technical_language>

Target:
void should_pass_if_duration_has_matching_days() { Duration duration = Duration.ofDays(4L); AbstractDurationAssert<?> durationAssert = assertThat(duration); assertThat(duration).hasDays(4L); }
Source:
<code>public Command(Parcel in) throws Exception{ <START> commandID = in.readString(); <END> this.targetID = in.readParcelable(TypedID.class.getClassLoader()); this.issuerID = in.readParcelable(TypedID.class.getClassLoader()); this.aliasActions = new ArrayList<>(); in.readList(this.aliasActions, AliasAction.class.getClassLoader()); this.aliasActionResults = new ArrayList<>(); in.readList(this.aliasActionResults, AliasActionResult.class.getClassLoader()); this.commandState = (CommandState)in.readSerializable(); this.firedByTriggerID = in.readString(); this.created = (Long)in.readValue(Command.class.getClassLoader()); this.modified = (Long)in.readValue(Command.class.getClassLoader()); this.title = in.readString(); this.description = in.readString(); String metadata = in.readString(); if (!TextUtils.isEmpty(metadata)) { this.metadata = new JSONObject(metadata); }else{ this.metadata = null; } if (this.targetID == null) { throw new IllegalArgumentException("targetID is null"); } if (this.issuerID == null) { throw new IllegalArgumentException("issuerID is null"); } if (this.aliasActions == null || this.aliasActions.size() == 0) { throw new IllegalArgumentException("actions is null or empty"); } }</code><technical_language>I removing this is better</technical_language>

Target:
public Command(Parcel in) throws Exception{ this.commandID = in.readString(); this.targetID = in.readParcelable(TypedID.class.getClassLoader()); this.issuerID = in.readParcelable(TypedID.class.getClassLoader()); this.aliasActions = new ArrayList<>(); in.readList(this.aliasActions, AliasAction.class.getClassLoader()); this.aliasActionResults = new ArrayList<>(); in.readList(this.aliasActionResults, AliasActionResult.class.getClassLoader()); this.commandState = (CommandState)in.readSerializable(); this.firedByTriggerID = in.readString(); this.created = (Long)in.readValue(Command.class.getClassLoader()); this.modified = (Long)in.readValue(Command.class.getClassLoader()); this.title = in.readString(); this.description = in.readString(); String metadata = in.readString(); if (!TextUtils.isEmpty(metadata)) { this.metadata = new JSONObject(metadata); }else{ this.metadata = null; } if (this.targetID == null) { throw new IllegalArgumentException("targetID is null"); } if (this.issuerID == null) { throw new IllegalArgumentException("issuerID is null"); } if (this.aliasActions == null || this.aliasActions.size() == 0) { throw new IllegalArgumentException("actions is null or empty"); } }
Source:
<code>private boolean checkKeyPermissions(List<KeyOperation> operations, KeyOperation keyOperation) { <START> if (operations.contains(keyOperation)) { <END> return true; } return false; }</code><technical_language>return if case statement</technical_language>

Target:
private boolean checkKeyPermissions(List<KeyOperation> operations, KeyOperation keyOperation) { return operations.contains(keyOperation); }
Source:
<code>protected PlannerBenchmarkResult readPlannerBenchmarkResult(File plannerBenchmarkResultFile) { if (!plannerBenchmarkResultFile.exists()) { throw new IllegalArgumentException("The plannerBenchmarkResultFile (" + plannerBenchmarkResultFile + ") does not exist."); } PlannerBenchmarkResult plannerBenchmarkResult; Reader reader = null; try { reader = new InputStreamReader(new FileInputStream(plannerBenchmarkResultFile), "UTF-8"); plannerBenchmarkResult = (PlannerBenchmarkResult) xStream.fromXML(reader); } catch (ConversionException e) { logger.warn( "Problem reading plannerBenchmarkResultFile (" + plannerBenchmarkResultFile + ").", e); String benchmarkReportDirectoryName = plannerBenchmarkResultFile.getParentFile().getName(); plannerBenchmarkResult = PlannerBenchmarkResult.createUnmarshallingFailedResult( benchmarkReportDirectoryName); } catch (IOException e) { throw new IllegalArgumentException( "Problem reading plannerBenchmarkResultFile (" + plannerBenchmarkResultFile + ").", e); } finally { IOUtils.closeQuietly(reader); } plannerBenchmarkResult.setBenchmarkReportDirectory(plannerBenchmarkResultFile.getParentFile()); restoreOmittedBidirectionalFields(plannerBenchmarkResult); return plannerBenchmarkResult; <START> } <END></code><technical_language>Important. Deleting this runtime exception XStreamException remove actual filename stacktrace message a user a bug in solver configuration. leave user clueless (= good)</technical_language>

Target:
protected PlannerBenchmarkResult readPlannerBenchmarkResult(File plannerBenchmarkResultFile) { if (!plannerBenchmarkResultFile.exists()) { throw new IllegalArgumentException("The plannerBenchmarkResultFile (" + plannerBenchmarkResultFile + ") does not exist."); } PlannerBenchmarkResult plannerBenchmarkResult; Reader reader = null; try { reader = new InputStreamReader(new FileInputStream(plannerBenchmarkResultFile), "UTF-8"); plannerBenchmarkResult = (PlannerBenchmarkResult) xStream.fromXML(reader); } catch (ConversionException e) { logger.warn( "Problem reading plannerBenchmarkResultFile (" + plannerBenchmarkResultFile + ").", e); String benchmarkReportDirectoryName = plannerBenchmarkResultFile.getParentFile().getName(); plannerBenchmarkResult = PlannerBenchmarkResult.createUnmarshallingFailedResult( benchmarkReportDirectoryName); } catch (XStreamException e) { throw new IllegalArgumentException( "Problem reading plannerBenchmarkResultFile (" + plannerBenchmarkResultFile + ").", e); } catch (IOException e) { throw new IllegalArgumentException( "Problem reading plannerBenchmarkResultFile (" + plannerBenchmarkResultFile + ").", e); } finally { IOUtils.closeQuietly(reader); } plannerBenchmarkResult.setBenchmarkReportDirectory(plannerBenchmarkResultFile.getParentFile()); restoreOmittedBidirectionalFields(plannerBenchmarkResult); return plannerBenchmarkResult; }
Source:
<code>public void saveAllWorlds(boolean dontLog) { <START> if (!enableSaving) { <END> return; } for (WorldServer worldserver : this.worlds) { if (worldserver != null && !worldserver.disableLevelSaving) { if (this.isDedicatedServer() && this.isServerRunning()) { final IMixinWorldServer spongeWorld = (IMixinWorldServer) worldserver; final int autoSaveInterval = spongeWorld.getActiveConfig().getConfig().getWorld().getAutoSaveInterval(); final boolean logAutoSave = spongeWorld.getActiveConfig().getConfig().getLogging().worldAutoSaveLogging(); if (autoSaveInterval <= 0 || ((WorldProperties) worldserver.getWorldInfo()).getSerializationBehavior() != SerializationBehaviors.AUTOMATIC) { if (logAutoSave) { LOGGER.warn("Auto-saving has been disabled for level \'" + worldserver.getWorldInfo().getWorldName() + "\'/" + worldserver.provider.getDimensionType().getName() + ". " + "No chunk data will be auto-saved - to re-enable auto-saving set 'auto-save-interval' to a value greater than" + " zero in the corresponding world config."); } continue; } if (this.tickCounter % autoSaveInterval != 0) { continue; } if (logAutoSave) { LOGGER.info("Auto-saving chunks for level \'" + worldserver.getWorldInfo().getWorldName() + "\'/" + worldserver.provider.getDimensionType().getName()); } } else if (!dontLog) { LOGGER.info("Saving chunks for level \'" + worldserver.getWorldInfo().getWorldName() + "\'/" + worldserver.provider.getDimensionType().getName()); } try { WorldManager.saveWorld(worldserver, false); } catch (MinecraftException ex) { ex.printStackTrace(); } } } }</code><technical_language>this</technical_language>

Target:
public void saveAllWorlds(boolean dontLog) { if (!this.enableSaving) { return; } for (WorldServer worldserver : this.worlds) { if (worldserver != null && !worldserver.disableLevelSaving) { if (this.isDedicatedServer() && this.isServerRunning()) { final IMixinWorldServer spongeWorld = (IMixinWorldServer) worldserver; final int autoSaveInterval = spongeWorld.getActiveConfig().getConfig().getWorld().getAutoSaveInterval(); final boolean logAutoSave = spongeWorld.getActiveConfig().getConfig().getLogging().worldAutoSaveLogging(); if (autoSaveInterval <= 0 || ((WorldProperties) worldserver.getWorldInfo()).getSerializationBehavior() != SerializationBehaviors.AUTOMATIC) { if (logAutoSave) { LOGGER.warn("Auto-saving has been disabled for level \'" + worldserver.getWorldInfo().getWorldName() + "\'/" + worldserver.provider.getDimensionType().getName() + ". " + "No chunk data will be auto-saved - to re-enable auto-saving set 'auto-save-interval' to a value greater than" + " zero in the corresponding world config."); } continue; } if (this.tickCounter % autoSaveInterval != 0) { continue; } if (logAutoSave) { LOGGER.info("Auto-saving chunks for level \'" + worldserver.getWorldInfo().getWorldName() + "\'/" + worldserver.provider.getDimensionType().getName()); } } else if (!dontLog) { LOGGER.info("Saving chunks for level \'" + worldserver.getWorldInfo().getWorldName() + "\'/" + worldserver.provider.getDimensionType().getName()); } try { WorldManager.saveWorld(worldserver, false); } catch (MinecraftException ex) { ex.printStackTrace(); } } } }
Source:
<code>public void searchTrucks(final String query) { if (query == null || query.isEmpty()) { forceClusterRender(activeTruckMarkers.values()); } else { <START> Thread t = new Thread(new Runnable() { <END> @Override public void run() { SimpleSearchRequest request = new SimpleSearchRequest(query, null, null); try { SimpleSearchResponse response = searchService.simpleSearch(request); searchResultMarkers = new HashMap<>(); List<SearchResponse> searchResponses = response.searchResponse; for (int i = 0, max = searchResponses.size(); i < max; i++) { String truckId = searchResponses.get(i).truck.id; TruckCluster currentMarker = activeTruckMarkers.get(truckId); if (currentMarker != null) { searchResultMarkers.put(truckId, activeTruckMarkers.get(truckId)); } } getActivity().runOnUiThread(new Runnable() { @Override public void run() { forceClusterRender(searchResultMarkers.values()); } }); } catch (ApiException e) { Timber.e("Got an error while searching for trucks."); } } }); t.start(); } }</code><technical_language>This done in IntentService. This approach is lead issues rotation</technical_language>

Target:
public void searchTrucks(final String query) { if (query == null || query.isEmpty()) { serviceHelper.clearSearchQueryMatches(getActivity()); } else { getActivity().startService(SimpleSearchService.newIntent(getActivity(), query)); } }
Source:
<code>public String getLayoutType(SpaceReference layoutSpaceRef) { BaseObject layoutPropertyObj = getLayoutPropertyObj(layoutSpaceRef); if ((layoutPropertyObj != null) && (layoutPropertyObj.getStringValue( ICellsClassConfig.LAYOUT_TYPE_FIELD) != null)) { <START> return layoutPropertyObj.getStringValue(ICellsClassConfig.LAYOUT_TYPE_FIELD); <END> } return ICellsClassConfig.PAGE_LAYOUT_VALUE; }</code><technical_language>afaik com.xpn.xwiki.objects.BaseCollection.getStringValue(String) returns null</technical_language>

Target:
public String getLayoutType(SpaceReference layoutSpaceRef) { BaseObject layoutPropertyObj = getLayoutPropertyObj(layoutSpaceRef); if (layoutPropertyObj != null) { return layoutPropertyObj.getStringValue(ICellsClassConfig.LAYOUT_TYPE_FIELD); } return ICellsClassConfig.PAGE_LAYOUT_VALUE; }
Source:
<code>public InputFormat getInputFormat() throws IOException { <START> if (inputFormat != null) { <END> return inputFormat; } else { try { inputFormat = (FileInputFormat) PigContext.resolveClassName(inputFormatClassName).newInstance(); return inputFormat; } catch (InstantiationException e) { throw new IOException("Failed creating input format " + inputFormatClassName, e); } catch (IllegalAccessException e) { throw new IOException("Failed creating input format " + inputFormatClassName, e); } } }</code><technical_language>This return (InputFormat) PigContext.resolveClassName(inputFormatName).newInstance(); resolveClassName throws IOException</technical_language>

Target:
public InputFormat getInputFormat() throws IOException { try { return (FileInputFormat) PigContext.resolveClassName(inputFormatClassName).newInstance(); } catch (InstantiationException e) { throw new IOException("Failed creating input format " + inputFormatClassName, e); } catch (IllegalAccessException e) { throw new IOException("Failed creating input format " + inputFormatClassName, e); } }
Source:
<code>void queueMutations(final MutationSet mutationsToSend) { <START> queueThreadPool.submit(new Runnable() { <END> public void run() { addMutations(mutationsToSend); } }); }</code><technical_language>I simpler a producer/consumer model for MutationSet's a single consumer thread instead of constantly submitting new Runnable's. consumer thread essentially do thing: poll for a MutationSet, run addMutations object. eliminates need for another ExecutorService repeatedly creating new Runnables. able implement some back-pressure client Queue well</technical_language>

Target:
void queueMutations(final MutationSet mutationsToSend) throws InterruptedException { if (null == mutationsToSend) return; binningThreadPool.execute(new Runnable() { @Override public void run() { if (null != mutationsToSend) { try { log.trace("{} - binning mutations", Thread.currentThread().getName(), mutationsToSend.size()); addMutations(mutationsToSend); } catch (Exception e) { updateUnknownErrors("Error processing mutation set", e); } } } }); }
Source:
<code>public void addTextOutput(TextOutput listener) { <START> listener.onCues(currentCues); <END> textOutputs.add(listener); }</code><technical_language>check for null sending cues listener</technical_language>

Target:
public void addTextOutput(TextOutput listener) { if(currentCues != null) { listener.onCues(currentCues); } textOutputs.add(listener); }
Source:
<code>public void readGraph() throws IOException { <START> graphStorage.create(1000); <END> processJunctions(); processRoads(); }</code><technical_language>In early version gave a hint large graph get, this is longer necessary. removed in another issue ;)</technical_language>

Target:
public void readGraph() { graphStorage.create(1000); processJunctions(); processRoads(); }
Source:
<code>InputStream getInputStream() throws IOException; Object getAttribute(String name); void setAttribute(String name, Object value); String getPathInfo(); String getContextPath(); <START> String getServletPath(); <END> StringBuffer getRequestURL(); String getRequestURI(); String getQueryString(); WrappedSession getWrappedSession(); WrappedSession getWrappedSession(boolean allowSessionCreation); String getContentType(); Locale getLocale(); String getRemoteAddr(); boolean isSecure(); String getHeader(String headerName); VaadinService getService(); Cookie[] getCookies(); String getAuthType(); String getRemoteUser(); Principal getUserPrincipal(); boolean isUserInRole(String role); void removeAttribute(String name); Enumeration<String> getAttributeNames(); Enumeration<Locale> getLocales(); String getRemoteHost(); int getRemotePort(); String getCharacterEncoding(); BufferedReader getReader() throws IOException; String getMethod(); long getDateHeader(String name); Enumeration<String> getHeaderNames(); Enumeration<String> getHeaders(String name); static VaadinRequest getCurrent() { return CurrentInstance.get(VaadinRequest.class); }</code><technical_language>Shoudn't this in VaadinServletRequest instead ? VaadinRequest is basis for VaadinPortletRequest (not in this project though) API servlet</technical_language>

Target:
InputStream getInputStream() throws IOException; Object getAttribute(String name); void setAttribute(String name, Object value); String getPathInfo(); String getContextPath(); StringBuffer getRequestURL(); String getRequestURI(); String getQueryString(); WrappedSession getWrappedSession(); WrappedSession getWrappedSession(boolean allowSessionCreation); String getContentType(); Locale getLocale(); String getRemoteAddr(); boolean isSecure(); String getHeader(String headerName); VaadinService getService(); Cookie[] getCookies(); String getAuthType(); String getRemoteUser(); Principal getUserPrincipal(); boolean isUserInRole(String role); void removeAttribute(String name); Enumeration<String> getAttributeNames(); Enumeration<Locale> getLocales(); String getRemoteHost(); int getRemotePort(); String getCharacterEncoding(); BufferedReader getReader() throws IOException; String getMethod(); long getDateHeader(String name); Enumeration<String> getHeaderNames(); Enumeration<String> getHeaders(String name); static VaadinRequest getCurrent() { return CurrentInstance.get(VaadinRequest.class); }
Source:
<code><START> public static void testUpdateFail(String sqlText, <END> List<String> expectedErrors, SpliceWatcher methodWatcher) throws AssertionError { try { methodWatcher.executeUpdate(sqlText); String failMsg = format("Update not expected to succeed.\n%s", sqlText); fail(failMsg); } catch (Exception e) { boolean found = expectedErrors.contains(e.getMessage()); if (!found) fail(format("\n + Unexpected error message: %s + \n", e.getMessage())); } }</code><technical_language>This change is warranted. DropTableIT extend SpliceUnitTest call testUpdateFail(). DecimalIT example</technical_language>

Target:
protected void testUpdateFail(String sqlText, List<String> expectedErrors, SpliceWatcher methodWatcher) throws AssertionError { try { methodWatcher.executeUpdate(sqlText); String failMsg = format("Update not expected to succeed.\n%s", sqlText); fail(failMsg); } catch (Exception e) { boolean found = expectedErrors.contains(e.getMessage()); if (!found) fail(format("\n + Unexpected error message: %s + \n", e.getMessage())); } }
Source:
<code>public void run() { InternalMigrationStatus migrationStatus = new VersionOneToVersionTwoMigrationStatus(MigrationStatus.Status.DB_NOT_PRESENT); if (!databasePath.exists()) { onUpdate(migrationStatus); return; } SQLiteDatabase sqLiteDatabase = SQLiteDatabase.openDatabase(databasePath.getAbsolutePath(), null, 0); SqlDatabaseWrapper database = new SqlDatabaseWrapper(sqLiteDatabase); PartialDownloadMigrationExtractor partialDownloadMigrationExtractor = new PartialDownloadMigrationExtractor(database); MigrationExtractor migrationExtractor = new MigrationExtractor(database); DownloadsPersistence downloadsPersistence = RoomDownloadsPersistence.newInstance(context); InternalFilePersistence internalFilePersistence = new InternalFilePersistence(); internalFilePersistence.initialiseWith(context); LocalFilesDirectory localFilesDirectory = new AndroidLocalFilesDirectory(context); UnlinkedDataRemover unlinkedDataRemover = new UnlinkedDataRemover(downloadsPersistence, localFilesDirectory); unlinkedDataRemover.remove(); migrationStatus.markAsExtracting(); onUpdate(migrationStatus); Log.d(TAG, "about to extract migrations, time is " + System.nanoTime()); <START> Log.d(TAG, "partial migrations are all EXTRACTED, time is " + System.nanoTime()); <END> migratePartialDownloads(database, partialDownloadMigrationExtractor, downloadsPersistence); migrateCompleteDownloads(migrationStatus, database, migrationExtractor, downloadsPersistence, internalFilePersistence); }</code><technical_language>this logged out migratePartialDownloads() (just a couple lines )</technical_language>

Target:
public void run() { InternalMigrationStatus migrationStatus = new VersionOneToVersionTwoMigrationStatus(MigrationStatus.Status.DB_NOT_PRESENT); if (!databasePath.exists()) { onUpdate(migrationStatus); return; } SQLiteDatabase sqLiteDatabase = SQLiteDatabase.openDatabase(databasePath.getAbsolutePath(), null, 0); SqlDatabaseWrapper database = new SqlDatabaseWrapper(sqLiteDatabase); PartialDownloadMigrationExtractor partialDownloadMigrationExtractor = new PartialDownloadMigrationExtractor(database); MigrationExtractor migrationExtractor = new MigrationExtractor(database); DownloadsPersistence downloadsPersistence = RoomDownloadsPersistence.newInstance(context); InternalFilePersistence internalFilePersistence = new InternalFilePersistence(); internalFilePersistence.initialiseWith(context); LocalFilesDirectory localFilesDirectory = new AndroidLocalFilesDirectory(context); UnlinkedDataRemover unlinkedDataRemover = new UnlinkedDataRemover(downloadsPersistence, localFilesDirectory); unlinkedDataRemover.remove(); migrationStatus.markAsExtracting(); onUpdate(migrationStatus); Log.d(TAG, "about to extract migrations, time is " + System.nanoTime()); migratePartialDownloads(database, partialDownloadMigrationExtractor, downloadsPersistence); migrateCompleteDownloads(migrationStatus, database, migrationExtractor, downloadsPersistence, internalFilePersistence); }
Source:
<code>protected void onExportChanged() { boolean externalNetwork = (Boolean) getExport().getEntity(); getExternalProviders().setIsChangable(externalNetwork); getIsVmNetwork().setIsChangable(!externalNetwork); getHasMtu().setIsChangable(!externalNetwork); if (externalNetwork) { getIsVmNetwork().setEntity(true); getHasMtu().setEntity(false); } Iterable<NetworkClusterModel> networkClusters = getNetworkClusterList().getItems(); if (networkClusters != null) { <START> for (NetworkClusterModel networkCluster : getNetworkClusterList().getItems()) { <END> if (!(Boolean) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.SupportCustomDeviceProperties, networkCluster.getEntity().getcompatibility_version().getValue())) { networkCluster.setIsChangable(!externalNetwork); networkCluster.setAttached(!externalNetwork); } networkCluster.setRequired(!externalNetwork); } } super.onExportChanged(); }</code><technical_language>Please networkClusters instead of getNetworkClusterList().getItems()</technical_language>

Target:
protected void onExportChanged() { boolean externalNetwork = (Boolean) getExport().getEntity(); getExternalProviders().setIsChangable(externalNetwork); getIsVmNetwork().setIsChangable(!externalNetwork); getHasMtu().setIsChangable(!externalNetwork); if (externalNetwork) { getIsVmNetwork().setEntity(true); getHasMtu().setEntity(false); } Iterable<NetworkClusterModel> networkClusters = getNetworkClusterList().getItems(); if (networkClusters != null) { for (NetworkClusterModel networkCluster : networkClusters) { if (!(Boolean) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.SupportCustomDeviceProperties, networkCluster.getEntity().getcompatibility_version().getValue())) { networkCluster.setIsChangable(!externalNetwork); networkCluster.setAttached(!externalNetwork); } networkCluster.setRequired(!externalNetwork); } } super.onExportChanged(); }
Source:
<code>public Iterable<Relationship> expand( Path path, BranchState<Double> state ) { double thisState = state.getState(); thisSideShortest.setValue( thisState ); if ( NoneStrictMath.compare( thisState + otherSideShortest.doubleValue(), shortestSoFar.doubleValue(), epsilon ) > 0 && stopAfterLowestCost ) { <START> return Iterables.resourceIterable( Collections.emptyList() ); <END> } return source.expand( path, state ); }</code><technical_language>Iterators#emptyResourceIterator method, introduce a Iterables#emptyResourceIterable too</technical_language>

Target:
public Iterable<Relationship> expand( Path path, BranchState<Double> state ) { double thisState = state.getState(); thisSideShortest.setValue( thisState ); if ( NoneStrictMath.compare( thisState + otherSideShortest.doubleValue(), shortestSoFar.doubleValue(), epsilon ) > 0 && stopAfterLowestCost ) { return Iterables.emptyResourceIterable(); } return source.expand( path, state ); }
Source:
<code>protected boolean finishPage(IRunnableWithProgress runnable) { IRunnableWithProgress op = new WorkspaceModifyDelegatingOperation(runnable); try { PlatformUI.getWorkbench().getProgressService() .runInUI(getContainer(), op, ResourcesPlugin.getWorkspace().getRoot()); <START> } catch (InvocationTargetException e) { <END> return false; } catch (InterruptedException e) { return false; } return true; }</code><technical_language>merge catches. catch(InvocationTargetException | InterruptionException e) { ... }</technical_language>

Target:
protected boolean finishPage(IRunnableWithProgress runnable) { IRunnableWithProgress op = new WorkspaceModifyDelegatingOperation(runnable); try { PlatformUI.getWorkbench().getProgressService().runInUI( getContainer(), op, ResourcesPlugin.getWorkspace().getRoot()); } catch (InvocationTargetException|InterruptedException e) { return false; } return true; }
Source:
<code><START> ValidationResult notRemovingLabeledNetworks(NetworkAttachment attachment, <END> Map<String, VdsNetworkInterface> existingNics) { Network removedNetwork = existingNetworkRelatedToAttachment(attachment); if (!NetworkUtils.isLabeled(removedNetwork)) { return ValidationResult.VALID; } VdsNetworkInterface nic = existingNics.get(attachment.getNicName()); if (nic != null && !removedBondVdsNetworkInterfaceMap.containsKey(nic.getName())) { if (NetworkUtils.isLabeled(nic) && nic.getLabels().contains(removedNetwork.getLabel())) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_LABELED_NETWORK_FROM_NIC, removedNetwork.getName()); } } return ValidationResult.VALID; }</code><technical_language>I wrote in patch set 8- validation for moving network a new nic. (If network attached previous nic label, moving another nic blocked)</technical_language>

Target:
ValidationResult notRemovingLabeledNetworks(NetworkAttachment attachment, Map<String, VdsNetworkInterface> existingNics) { Network removedNetwork = existingNetworkRelatedToAttachment(attachment); if (!NetworkUtils.isLabeled(removedNetwork)) { return ValidationResult.VALID; } VdsNetworkInterface nic = existingNics.get(attachment.getNicName()); if (nic != null && !removedBondVdsNetworkInterfaceMap.containsKey(nic.getName())) { if (NetworkUtils.isLabeled(nic) && nic.getLabels().contains(removedNetwork.getLabel())) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_CANNOT_REMOVE_LABELED_NETWORK_FROM_NIC, removedNetwork.getName()); } } return ValidationResult.VALID; }
Source:
<code><START> public Iterator<T> iterator() { <END> Iterator<T> inputIterator = fInputBuffer.iterator(); Iterator<T> queueIterator = Iterables.concat(fInnerQueue).iterator(); Iterator<T> outputIterator = fOutputBuffer.iterator(); return checkNotNull(Iterators.concat(inputIterator, queueIterator, outputIterator)); }</code><technical_language>is confusing, Deques internally for buffers (I remember exactly, pretty a reason). guess is that: deque want insert remove buffers (opposite of proper sequence), do iterator iterates inputBuffer (tail) outputBuffer (head), if in proper sequence, weird, for example [I,J,K,L],[[E,F,G,H]],[A,B,C,D]. buffers in proper sequence (insert tail remove head). iterator need a concatenation of descending iterators. need a deep descending iterator for middle queueIterator Iterables, a descending iterator of buffers in queue concatenates descending iterator of buffer... middle iterator is 'incorrectly' in proper sequence of queue a true descending iterator: [P,O,N,M],[[H,G,F,E],[L,K,J,I]],[D,C,B,A]..</technical_language>

Target:
public Iterator<T> iterator() { return new Itr(); }
Source:
<code><START> private void addMismatchReason(String reason) { <END> if (_mismatchReason.length() > 0) { _mismatchReason.append(" "); } _mismatchReason.append(reason); }</code><technical_language>suggestion private void addMismatchReasonInternal(String reason) {</technical_language>

Target:
public void addMismatchReason(String reason) { incrementMismatchCount(); addMismatchReasonInternal(reason); }