auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public int compare(ITimeGraphEntry o1, ITimeGraphEntry o2) { if (o1.getParent() != null || o2.getParent() != null) { <START> return o1.getStartTime() < o2.getStartTime() ? -1 : o1.getStartTime() > o2.getStartTime() ? 1 : 0; <END> } int result = 0; if ((o1 instanceof ControlFlowEntry) && (o2 instanceof ControlFlowEntry)) { ControlFlowEntry entry1 = (ControlFlowEntry) o1; ControlFlowEntry entry2 = (ControlFlowEntry) o2; result = entry1.getTrace().getStartTime().compareTo(entry2.getTrace().getStartTime()); if (result == 0) { result = entry1.getTrace().getName().compareTo(entry2.getTrace().getName()); } if (result == 0) { result = entry1.getThreadId() < entry2.getThreadId() ? -1 : entry1.getThreadId() > entry2.getThreadId() ? 1 : 0; } } if (result == 0) { result = o1.getStartTime() < o2.getStartTime() ? -1 : o1.getStartTime() > o2.getStartTime() ? 1 : 0; } return result; }</code><technical_language>Long.Compare(o1.getStart...)</technical_language>

Target:
public int compare(ITimeGraphEntry o1, ITimeGraphEntry o2) { if (o1.getParent() != null || o2.getParent() != null) { return Long.compare(o1.getStartTime(), o2.getStartTime()); } int result = 0; if ((o1 instanceof ControlFlowEntry) && (o2 instanceof ControlFlowEntry)) { ControlFlowEntry entry1 = (ControlFlowEntry) o1; ControlFlowEntry entry2 = (ControlFlowEntry) o2; result = entry1.getTrace().getStartTime().compareTo(entry2.getTrace().getStartTime()); if (result == 0) { result = entry1.getTrace().getName().compareTo(entry2.getTrace().getName()); } if (result == 0) { result = Integer.compare(entry1.getThreadId(), entry2.getThreadId()); } } if (result == 0) { result = Long.compare(o1.getStartTime(), o2.getStartTime()); } return result; }
Source:
<code>public Map<String, Object> getAllocatedIPs() { <START> return allocatedIPs; <END> }</code><technical_language>Remind based conversation bug in scheduler, need this a list</technical_language>

Target:
public List<Map<String, Object>> getAllocatedIPs() { return allocatedIPs; }
Source:
<code>protected void onLoginFinished() { AnalyticsUtils.trackAnalyticsSignIn(mAccountStore, mSiteStore, true); if (isSocialLogin) { <START> AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_SUCCESS); <END> mLoginListener.loggedInViaSocialAccount(mOldSitesIDs); } else { mLoginListener.loggedInViaPassword(mOldSitesIDs); } }</code><technical_language>LOGIN_SOCIAL_SUCCESS stat is tracked in [LoginActivity.loggedInViaSocialAccount](<LINK_0>, is called this line. double-counting LOGIN_SOCIAL_SUCCESS. I remove this line</technical_language>

Target:
protected void onLoginFinished() { AnalyticsUtils.trackAnalyticsSignIn(mAccountStore, mSiteStore, true); if (isSocialLogin) { mLoginListener.loggedInViaSocialAccount(mOldSitesIDs); } else { mLoginListener.loggedInViaPassword(mOldSitesIDs); } }
Source:
<code>private static boolean pmExists(PrivateMessage pm) { info("Looking for PM with subject: [" + pm.getMessageSubject() + "]"); <START> List<WebElement> pmList = pmPage.getPmList(); <END> for(WebElement singlePmRow : pmList) { String messageSubject = singlePmRow.findElements(By.cssSelector("a")).get(1).getText(); info("Found subject in the list: [" + StringUtils.left(messageSubject, 7) + "...]"); if(messageSubject.equals(pm.getMessageSubject())) { info("Search result = Required PM. The message exists."); return true; } } info("Expected PM wasn't found"); return false; }</code><technical_language>create a method WebElement findPmWithSubjectInList(String subject) move page object</technical_language>

Target:
private static boolean pmExists(PrivateMessage pm) { try { pmPage.findPmBySubject(pm.getMessageSubject()); info("The message exists."); return true; } catch (NoSuchElementException e) { info("Expected PM wasn't found"); return false; } }
Source:
<code><START> @After public void teardown() throws SQLException { <END> if (conn != null) { conn.close(); } }</code><technical_language>nit: new line</technical_language>

Target:
public void teardown() throws SQLException { if (conn != null) { conn.close(); } }
Source:
<code>private ClientConfig updateProxy(ClientConfig config) { final String proxyHost = System.getProperty("http.proxyHost"); if (proxyHost != null) { config.property(ClientProperties.PROXY_URI, proxyHost + ":" <START> + System.getProperty("http.proxyPort", "8080")); <END> config.property(ClientProperties.REQUEST_ENTITY_PROCESSING, RequestEntityProcessing.BUFFERED); } return config; }</code><technical_language>if checked this property exists, is point in passing argument</technical_language>

Target:
private ClientConfig updateProxy(ClientConfig config) { final String proxyHost = System.getProperty("http.proxyHost"); if (proxyHost != null) { config.property(ClientProperties.PROXY_URI, proxyHost + ":" + checkNotNull(System.getProperty("http.proxyPort"), "http.proxyPort")); config.property(ClientProperties.REQUEST_ENTITY_PROCESSING, RequestEntityProcessing.BUFFERED); } return config; }
Source:
<code>public TurboLabel(String repoId, SerializableLabel label) { this.actualName = label.getActualName(); this.grouping = initGroupMembership(); this.simpleName = initSimpleName(); <START> this.groupName = initGroupName(); <END> this.colour = label.getColour(); this.repoId = repoId; }</code><technical_language>Lot of repetition in constructors. Extract private methods</technical_language>

Target:
public TurboLabel(String repoId, SerializableLabel label) { this(repoId, label.getColour(), label.getFullName()); }
Source:
<code>private Integer getBarWidth() { WebDriverWait wait = new WebDriverWait(driver, 7); wait.until(ExpectedConditions.alertIsPresent()); Alert alert = driver.switchTo().alert(); <START> Integer barWidth = Integer.valueOf(alert.getText().substring(alert.getText().length()-3)); <END> System.out.println(barWidth); alert.accept(); return barWidth; }</code><technical_language>length() - 3</technical_language>

Target:
private Integer getBarWidth() { WebDriverWait wait = new WebDriverWait(driver, 7); wait.until(ExpectedConditions.alertIsPresent()); Alert alert = driver.switchTo().alert(); Integer barWidth = Integer.valueOf(alert.getText().split(": ")[1]); System.out.println(barWidth); alert.accept(); return barWidth; }
Source:
<code>public void getObjsByUris() throws Exception { final MetadataService md = gd.getMetadataService(); final Map<String, String> uris = md.identifiersToUris(project, asList( "attr.person.department", "attr.person.role", "fact.person.shoesize" )); final Collection<Obj> objects = md.getObjsByUris(project, uris.values()); <START> assertThat(objects.stream().map(Obj::getUri).collect(Collectors.toSet()), equalTo(new HashSet<>(uris.values()))); <END> }</code><technical_language>is is instead of equalTo... I insist refactoring</technical_language>

Target:
public void getObjsByUris() throws Exception { final MetadataService md = gd.getMetadataService(); final Map<String, String> uris = md.identifiersToUris(project, asList( "attr.person.department", "attr.person.role", "fact.person.shoesize" )); final Collection<Obj> objects = md.getObjsByUris(project, uris.values()); assertThat(objects.stream().map(Obj::getUri).collect(Collectors.toSet()), is(new HashSet<>(uris.values()))); }
Source:
<code>public void display() { setShowLoginProgress(false); LoginPrefs loginPrefs = preferencesService.getPreferences().getLogin(); String username = loginPrefs.getUsername(); String password = loginPrefs.getPassword(); boolean isAutoLogin = loginPrefs.getAutoLogin(); usernameInput.setText(Strings.nullToEmpty(username)); autoLoginCheckBox.setSelected(isAutoLogin); <START> initializeFuture.thenAccept(aVoid -> { <END> if (loginAllowed == null) { log.error("loginAllowed not set for unknown reason. Possible race condition detected. Enabling login now to preserve user experience."); loginAllowed = true; } if (loginAllowed && loginPrefs.getAutoLogin() && !isNullOrEmpty(username) && !isNullOrEmpty(password)) { login(username, password, true); } else if (isNullOrEmpty(username)) { usernameInput.requestFocus(); } else { passwordInput.requestFocus(); } }); }</code><technical_language>this thenRun</technical_language>

Target:
public void display() { setShowLoginProgress(false); LoginPrefs loginPrefs = preferencesService.getPreferences().getLogin(); String username = loginPrefs.getUsername(); String password = loginPrefs.getPassword(); boolean isAutoLogin = loginPrefs.getAutoLogin(); usernameInput.setText(Strings.nullToEmpty(username)); autoLoginCheckBox.setSelected(isAutoLogin); initializeFuture.thenRun(() -> { if (loginAllowed == null) { log.error("loginAllowed not set for unknown reason. Possible race condition detected. Enabling login now to preserve user experience."); loginAllowed = true; } if (loginAllowed && loginPrefs.getAutoLogin() && !isNullOrEmpty(username) && !isNullOrEmpty(password)) { login(username, password, true); } else if (isNullOrEmpty(username)) { usernameInput.requestFocus(); } else { passwordInput.requestFocus(); } }); }
Source:
<code>private void showCompareForCurrentFile() { view.setEnableNextDiffButton(currentItemIndex != (changedItems.getFilesQuantity() - 1)); view.setEnablePreviousDiffButton(currentItemIndex != 0); changedItems.getProject() .getFile(changedItems.getItemByIndex(currentItemIndex)) .then(file -> { <START> if (file.isPresent()) { <END> if (compareWithLatest) { showCompareWithLatestForFile(file.get(), changedItems.getStatusByIndex(currentItemIndex)); } else { showCompareBetweenRevisionsForFile(file.get(), changedItems.getStatusByIndex(currentItemIndex)); } } }).catchError(error -> { notificationManager.notify(error.getMessage(), FAIL, NOT_EMERGE_MODE); }); }</code><technical_language>if !file.isPresent() means deleted. So, show diff also</technical_language>

Target:
private void showCompareForCurrentFile() { view.setEnableNextDiffButton(currentFileIndex != (alteredFiles.getFilesQuantity() - 1)); view.setEnablePreviousDiffButton(currentFileIndex != 0); alteredFiles .getProject() .getFile(alteredFiles.getFileByIndex(currentFileIndex)) .then( file -> { if (file.isPresent()) { this.comparedFile = file.get(); view.setEnableSaveChangesButton(true); } else { this.comparedFile = null; view.setEnableSaveChangesButton(false); } final Path gitDirLocation = alteredFiles.getProject().getLocation(); final Path relPath = Path.valueOf(alteredFiles.getFileByIndex(currentFileIndex)); if (compareWithLatest) { showCompareWithLatestForFile( gitDirLocation, relPath, alteredFiles.getStatusByIndex(currentFileIndex)); } else { showCompareBetweenRevisionsForFile( gitDirLocation, relPath, alteredFiles.getStatusByIndex(currentFileIndex)); } }) .catchError( error -> { notificationManager.notify(error.getMessage(), FAIL, NOT_EMERGE_MODE); }); }
Source:
<code>public org.atlasapi.media.channel.Channel transform(String str) { String[] split = str.split(","); Channel channel = new Channel(); channel.setTitle(sanitize(split[1])); <START> channel.setUri(uriFor(sanitize(split[0]))); <END> channel.setPublisherDetails(PUB_DETAILS); channel.setChannelType("CHANNEL"); channel.setMediaType("video"); org.atlasapi.media.channel.Channel complex = modelTransformer.transform(channel); complex.addAlias(new Alias(ALIAS_NAMESPACE, sanitize(split[0]))); return complex; }</code><technical_language>integer? validate it</technical_language>

Target:
public org.atlasapi.media.channel.Channel transform(String str) { String[] split = str.split(","); checkArgument(split.length == 2); String stationCode = sanitize(split[0]); String channelTitle = sanitize(split[1]); checkArgument(isValid(stationCode)); Channel channel = new Channel(); channel.setTitle(channelTitle); channel.setUri(uriFor(stationCode)); channel.setPublisherDetails(PUB_DETAILS); channel.setChannelType("CHANNEL"); channel.setMediaType("video"); org.atlasapi.media.channel.Channel complex = modelTransformer.transform(channel); complex.addAlias(new Alias(ALIAS_NAMESPACE, stationCode)); return complex; }
Source:
<code>void fillPolygonInPixels (int[] pointArray) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); checkGC(FILL); if (data.gdipGraphics != 0) { int mode = OS.GetPolyFillMode(handle) == OS.WINDING ? Gdip.FillModeWinding : Gdip.FillModeAlternate; <START> Gdip.Graphics_TranslateTransform(data.gdipGraphics, 1, data.gdipYOffset, Gdip.MatrixOrderPrepend); <END> Gdip.Graphics_FillPolygon(data.gdipGraphics, data.gdipBrush, pointArray, pointArray.length / 2, mode); Gdip.Graphics_TranslateTransform(data.gdipGraphics, -1, -data.gdipYOffset, Gdip.MatrixOrderPrepend); return; } if ((data.style & SWT.MIRRORED) != 0) { for (int i = 0; i < pointArray.length; i+=2) { pointArray[i]--; } } OS.Polygon(handle, pointArray, pointArray.length / 2); if ((data.style & SWT.MIRRORED) != 0) { for (int i = 0; i < pointArray.length; i+=2) { pointArray[i]++; } } }</code><technical_language>I this API translating gdipYOffset? I expect dy parameter 0, for dx parameter data.gdipXOffset + 1</technical_language>

Target:
void fillPolygonInPixels (int[] pointArray) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); checkGC(FILL); if (data.gdipGraphics != 0) { int mode = OS.GetPolyFillMode(handle) == OS.WINDING ? Gdip.FillModeWinding : Gdip.FillModeAlternate; Gdip.Graphics_TranslateTransform(data.gdipGraphics, data.gdipXOffset + 1, data.gdipYOffset, Gdip.MatrixOrderPrepend); Gdip.Graphics_FillPolygon(data.gdipGraphics, data.gdipBrush, pointArray, pointArray.length / 2, mode); Gdip.Graphics_TranslateTransform(data.gdipGraphics, data.gdipXOffset -1, -data.gdipYOffset, Gdip.MatrixOrderPrepend); return; } if ((data.style & SWT.MIRRORED) != 0) { for (int i = 0; i < pointArray.length; i+=2) { pointArray[i]--; } } OS.Polygon(handle, pointArray, pointArray.length / 2); if ((data.style & SWT.MIRRORED) != 0) { for (int i = 0; i < pointArray.length; i+=2) { pointArray[i]++; } } }
Source:
<code>public ISerializableEvaluation unmarshalEvaluation() throws CoreException { int oldPos = fPos; short firstBytes = getShort(); <START> if (firstBytes == NULL_TYPE) { <END> return null; } fPos = oldPos; return fLinkage.unmarshalEvaluation(this); }</code><technical_language>sense move this condition PDOMLinkage.unmarshalEvaluation</technical_language>

Target:
public ISerializableEvaluation unmarshalEvaluation() throws CoreException { return fLinkage.unmarshalEvaluation(this); }
Source:
<code>public void stoppedFollowing(Reason reason) { String shownReason; switch (reason) { case FOLLOWEE_LEFT_SESSION: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWEE_LEFT_SESSION; break; case FOLLOWER_CLOSED_OR_SWITCHED_EDITOR: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWER_CLOSED_OR_SWITCHED_EDITOR; break; case FOLLOWER_CLOSED_EDITOR: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWER_CLOSED_EDITOR; break; case FOLLOWER_STOPPED: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWER_STOPPED; break; case FOLLOWER_SWITCHES_FOLLOWEE: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWER_SWITCHES_FOLLOWEE; break; default: shownReason = reason.name(); <START> log.error("Encountered unknown reason for follow mode end. reason: " + reason); <END> } NotificationPanel.showInformation( String.format( Messages.FollowModeNotificationDispatcher_stopped_following_message, followedUser, shownReason), Messages.FollowModeNotificationDispatcher_stopped_following_title); followedUser = null; }</code><technical_language>Warning enough is display logic critical</technical_language>

Target:
public void stoppedFollowing(Reason reason) { String shownReason; switch (reason) { case FOLLOWEE_LEFT_SESSION: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWEE_LEFT_SESSION; break; case FOLLOWER_CLOSED_OR_SWITCHED_EDITOR: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWER_CLOSED_OR_SWITCHED_EDITOR; break; case FOLLOWER_CLOSED_EDITOR: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWER_CLOSED_EDITOR; break; case FOLLOWER_STOPPED: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWER_STOPPED; break; case FOLLOWER_SWITCHES_FOLLOWEE: shownReason = Messages.FollowModeNotificationDispatcher_end_reason_FOLLOWER_SWITCHES_FOLLOWEE; break; default: shownReason = reason.name(); log.warn("Encountered unknown reason for follow mode end. reason: " + reason); } NotificationPanel.showInformation( MessageFormat.format( Messages.FollowModeNotificationDispatcher_stopped_following_message, followedUser, shownReason), Messages.FollowModeNotificationDispatcher_stopped_following_title); followedUser = null; }
Source:
<code>public void onToggleSneak(PlayerToggleSneakEvent e) { if (!e.isSneaking()) return; <START> Player p = e.getPlayer(); <END> if (p.getInventory().getChestplate() != null) { SlimefunItem chestplate = SlimefunItem.getByItem(p.getInventory().getChestplate()); if (chestplate == null || !Slimefun.hasUnlocked(p, chestplate, true)) return; if (chestplate instanceof Jetpack) { double thrust = ((Jetpack) chestplate).getThrust(); if (thrust > 0.2) new JetpackTask(p, thrust).scheduleRepeating(0, 3); } else if (chestplate.getID().equals("PARACHUTE")) new ParachuteTask(p).scheduleRepeating(0, 3); } if (p.getInventory().getBoots() != null) { SlimefunItem boots = SlimefunItem.getByItem(p.getInventory().getBoots()); if (boots instanceof JetBoots && Slimefun.hasUnlocked(p, boots, true)) { double speed = ((JetBoots) boots).getSpeed(); if (speed > 0.2) new JetBootsTask(p, speed).scheduleRepeating(0, 2); } } if (SlimefunManager.containsSimilarItem(p.getInventory(), SlimefunItems.INFUSED_MAGNET, true)) new MagnetTask(p).scheduleRepeating(0, 8); }</code><technical_language>Please fix indentation here</technical_language>

Target:
public void onToggleSneak(PlayerToggleSneakEvent e) { if (!e.isSneaking()) return; Player p = e.getPlayer(); if (p.getInventory().getChestplate() != null) { SlimefunItem chestplate = SlimefunItem.getByItem(p.getInventory().getChestplate()); handleChestplate(p, chestplate); } if (p.getInventory().getBoots() != null) { SlimefunItem boots = SlimefunItem.getByItem(p.getInventory().getBoots()); handleBoots(p, boots); } if (SlimefunManager.containsSimilarItem(p.getInventory(), SlimefunItems.INFUSED_MAGNET, true)) new MagnetTask(p).scheduleRepeating(0, 8); }
Source:
<code>private CompositeCommand buildCommand(Diagram diagram) { CompositeCommand reconcileCommand = new CompositeCommand("Reconciling"); if (!DiagramVersioningUtils.isOfCurrentPapyrusVersion(diagram)) { String sourceVersion = DiagramVersioningUtils.getCompatibilityVersion(diagram); Map<String, Collection<DiagramReconciler>> diagramReconcilers = DiagramReconcilersReader .getInstance().load(); String diagramType = diagram.getType(); Collection<DiagramReconciler> reconcilers = new LinkedList<DiagramReconciler>(); if (diagramReconcilers.containsKey(diagramType)) { reconcilers.addAll(diagramReconcilers.get(diagramType)); } <START> boolean someFailed = false; <END> Iterator<DiagramReconciler> reconciler = reconcilers.iterator(); while (reconciler.hasNext() && !someFailed) { DiagramReconciler next = reconciler.next(); if (!next.canReconcileFrom(diagram, sourceVersion)) { continue; } ICommand nextCommand = next.getReconcileCommand(diagram); if (nextCommand == null) { continue; } if (nextCommand.canExecute()) { reconcileCommand.add(nextCommand); } } if (someFailed) { reconcileCommand = null; } } return reconcileCommand; }</code><technical_language>This boolean is set, useless</technical_language>

Target:
private CompositeCommand buildCommand(Diagram diagram) { CompositeCommand reconcileCommand = new CompositeCommand("Reconciling"); if (!DiagramVersioningUtils.isOfCurrentPapyrusVersion(diagram)) { String sourceVersion = DiagramVersioningUtils.getCompatibilityVersion(diagram); Map<String, Collection<DiagramReconciler>> diagramReconcilers = DiagramReconcilersReader .getInstance().load(); String diagramType = diagram.getType(); Collection<DiagramReconciler> reconcilers = new LinkedList<DiagramReconciler>(); if (diagramReconcilers.containsKey(diagramType)) { reconcilers.addAll(diagramReconcilers.get(diagramType)); } boolean someFailed = false; Iterator<DiagramReconciler> reconciler = reconcilers.iterator(); while (reconciler.hasNext() && !someFailed) { DiagramReconciler next = reconciler.next(); if (!next.canReconcileFrom(diagram, sourceVersion)) { continue; } ICommand nextCommand = next.getReconcileCommand(diagram); if (nextCommand == null) { continue; } if (nextCommand.canExecute()) { reconcileCommand.add(nextCommand); } else { CompareDiagramIDEUIPapyrusPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, CompareDiagramIDEUIPapyrusPlugin.PLUGIN_ID, "Diagram reconciler " + next + " failed to reconcile diagram: " + diagram)); someFailed = true; } } if (someFailed) { reconcileCommand = null; } } return reconcileCommand; }
Source:
<code>public String read(int numBytes) throws IOException { char[] strBuffer = new char[numBytes]; int strBufferIndex = 0; int numBytesRemaining = numBytes; if (end - offset > 0) { int length = Math.min(end - offset,numBytesRemaining); System.arraycopy(buffer, offset, strBuffer, strBufferIndex, length); strBufferIndex += length; offset += length; numBytesRemaining -= length; } if (numBytesRemaining > 0) { <START> IOUtils.readFully(is, strBuffer, strBufferIndex); <END> } return new String(strBuffer); }</code><technical_language>readFully surprised I thought exhaust input. this is fine</technical_language>

Target:
public String read(int numBytes) throws IOException { char[] strBuffer = new char[numBytes]; int strBufferIndex = 0; int numBytesRemaining = numBytes; if (end - offset > 0) { int length = Math.min(end - offset,numBytesRemaining); System.arraycopy(buffer, offset, strBuffer, strBufferIndex, length); strBufferIndex += length; offset += length; numBytesRemaining -= length; } if (numBytesRemaining > 0) { IOUtils.readFully(reader, strBuffer, strBufferIndex); } return new String(strBuffer); }
Source:
<code>protected static <T> List<T> merge(List<T> list, List<T> items) { <START> List<T> returnValue = list; <END> if (list != null) { if (items != null) { for (T item : items) { if (!returnValue.contains(item)) { returnValue.add(item); } } } } else { returnValue = items; } return returnValue; }</code><technical_language>This assignment is redundant</technical_language>

Target:
protected static <T> List<T> merge(List<T> list, List<T> items) { if (list != null) { if (items != null) { for (T item : items) { if (!list.contains(item)) { list.add(item); } } } } else { return items; } return list; }
Source:
<code>protected MessageBeans resolveMessage(String msg, Integer idOfMessage) throws InternalErrorException { List<PerunBean> listOfBeans; listOfBeans = AuditParser.parseLog(msg); MessageBeans beans = new MessageBeansImpl(); boolean shouldntAddVo = false; if (msg.matches("Group:[\\d\\D]*created in Vo:[\\d\\D]*")) <START> shouldntAddVo = true; <END> if(!listOfBeans.isEmpty()){ int i=0; for(PerunBean p: listOfBeans) { if (shouldntAddVo && p.getBeanName().equals("Vo")) continue; i++; beans.addBean(p); } } return beans; }</code><technical_language>old-school, I write in a way: boolean suppressAddingVo = msg.matches("Group:[\\d\\D]*created in Vo:[\\d\\D]*");</technical_language>

Target:
protected MessageBeans resolveMessage(String msg, Integer idOfMessage) throws InternalErrorException { List<PerunBean> listOfBeans; listOfBeans = AuditParser.parseLog(msg); MessageBeans beans = new MessageBeansImpl(); boolean shouldntAddVo = msg.matches("Group:(.*)created in Vo:(.*)"); if(!listOfBeans.isEmpty()){ int i=0; for(PerunBean p: listOfBeans) { if (shouldntAddVo && p.getBeanName().equals("Vo")) { continue; } i++; beans.addBean(p); } } return beans; }
Source:
<code>private void initUnregisteredVM() { OvfHelper ovfHelper = new OvfHelper(); ovfEntityData = getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (ovfEntityData != null) { try { vmFromConfiguration = ovfHelper.readVmFromOvf(ovfEntityData.getOvfData()); vmFromConfiguration.setVdsGroupId(getParameters().getVdsGroupId()); getParameters().setVm(vmFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); if (getParameters().getDiskMap() != null) { vmFromConfiguration.setDiskMap(getParameters().getDiskMap()); vmFromConfiguration.setImages(getDiskImageListFromDiskMap(getParameters().getDiskMap())); } } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: '{}':\n{}", ovfEntityData.getOvfData(), <START> e.getMessage()); <END> log.debug("Exception", e); } } }</code><technical_language>reorder</technical_language>

Target:
private void initUnregisteredVM() { OvfHelper ovfHelper = new OvfHelper(); ovfEntityData = getUnregisteredOVFDataDao().getByEntityIdAndStorageDomain(getParameters().getContainerId(), getParameters().getStorageDomainId()); if (ovfEntityData != null) { try { vmFromConfiguration = ovfHelper.readVmFromOvf(ovfEntityData.getOvfData()); vmFromConfiguration.setVdsGroupId(getParameters().getVdsGroupId()); getParameters().setVm(vmFromConfiguration); getParameters().setDestDomainId(ovfEntityData.getStorageDomainId()); getParameters().setSourceDomainId(ovfEntityData.getStorageDomainId()); if (getParameters().getDiskMap() != null) { vmFromConfiguration.setDiskMap(getParameters().getDiskMap()); vmFromConfiguration.setImages(getDiskImageListFromDiskMap(getParameters().getDiskMap())); } } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: '{}':\n{}", e.getMessage(), ovfEntityData.getOvfData()); log.debug("Exception", e); } } }
Source:
<code>public void closeAllTestWindows() { <START> Iterator<IWorkbenchWindow> iter = new ArrayList<IWorkbenchWindow>(testWindows).iterator(); <END> while (iter.hasNext()) { IWorkbenchWindow win = iter.next(); win.close(); } testWindows.clear(); }</code><technical_language>Making a new List, contains IWorkbenchWindows Iterator is necessary here. I propose write: for(IWorkbenchWindow testWindow : testWindows){ testWindow.close(); }</technical_language>

Target:
public void closeAllTestWindows() { for (IWorkbenchWindow testWindows : testWindows) { testWindows.close(); } testWindows.clear(); }
Source:
<code>HystrixObservableCommandChain<T> createHystrixCommandChain() { List<HystrixObservableCommand<T>> commands = new ArrayList<HystrixObservableCommand<T>>(2); if (cacheProvider != null) { commands.add(new HystrixCacheObservableCommand<T>(cacheProvider.getCacheProvider(), cacheProvider.getKey(), <START> requestProperties, template.hystrixProperties())); <END> } commands.add(new RibbonHystrixObservableCommand<T>(client, httpRequest, hystrixCacheKey, requestProperties, template.fallbackHandler(), template.responseValidator(), template.getClassType(), template.hystrixProperties())); return new HystrixObservableCommandChain<T>(commands); }</code><technical_language>discussed, Hystrix cache command needs name default properties including time out</technical_language>

Target:
HystrixObservableCommandChain<T> createHystrixCommandChain() { List<HystrixObservableCommand<T>> commands = new ArrayList<HystrixObservableCommand<T>>(2); if (cacheProvider != null) { commands.add(new CacheObservableCommand<T>(cacheProvider.getCacheProvider(), cacheProvider.getKey(), cacheHystrixCacheKey, requestProperties, template.cacheHystrixProperties())); } commands.add(new HttpResourceObservableCommand<T>(client, httpRequest, hystrixCacheKey, requestProperties, template.fallbackHandler(), template.responseValidator(), template.getClassType(), template.hystrixProperties())); return new HystrixObservableCommandChain<T>(commands); }
Source:
<code>public void onEvent(BrokerEvent event) { if (event.getRuntimeId() == null || !workspaceId.equals(event.getRuntimeId().getWorkspaceId())) { return; } switch (event.getStatus()) { case DONE: List<ChePlugin> tooling = event.getTooling(); if (tooling != null) { try { pluginsValidator.validatePluginNames(tooling); } catch (ValidationException e) { brokersResult.error(e); return; } try { <START> brokersResult.brokerResult(tooling); <END> } catch (InfrastructureException e) { LOG.error(e.getLocalizedMessage(), e); } } else { brokersResult.error( new InternalInfrastructureException( format( "Plugin brokering process for workspace `%s` is finished but plugins list is missing", workspaceId))); } break; case FAILED: brokersResult.error( new InfrastructureException( format( "Plugin broking process for workspace %s failed with error: %s", workspaceId, event.getError()))); break; case STARTED: default: } }</code><technical_language>brokersResult.brokerResult a bit unclear. Please consider renaming addResult, registerResult</technical_language>

Target:
public void onEvent(BrokerEvent event) { if (event.getRuntimeId() == null || !workspaceId.equals(event.getRuntimeId().getWorkspaceId())) { return; } switch (event.getStatus()) { case DONE: List<ChePlugin> tooling = event.getTooling(); if (tooling != null) { try { pluginsValidator.validatePluginNames(tooling); } catch (ValidationException e) { brokersResult.error(e); return; } try { brokersResult.addResult(tooling); } catch (InfrastructureException e) { LOG.error(e.getLocalizedMessage(), e); } } else { brokersResult.error( new InternalInfrastructureException( format( "Plugin brokering process for workspace `%s` is finished but plugins list is missing", workspaceId))); } break; case FAILED: brokersResult.error( new InfrastructureException( format( "Plugin broking process for workspace %s failed with error: %s", workspaceId, event.getError()))); break; case STARTED: default: } }
Source:
<code>long getUsedCapacity() { long usedCapacity = 0; for (Map.Entry<String, LogSegment> entry : segmentsByName.entrySet()) { LogSegment segment = entry.getValue(); <START> if (segment != activeSegment) { <END> usedCapacity += segment.getCapacityInBytes(); } else { usedCapacity += segment.getEndOffset(); break; } } return usedCapacity; }</code><technical_language>Guess comparing log segments == != work match for exact reference. wanted add a note</technical_language>

Target:
long getUsedCapacity() { return getDifference(getEndOffset(), new Offset(getFirstSegment().getName(), 0)); }
Source:
<code>public void base64EncodedPasswordAfterAlgorithmShouldFail() { <START> ldapUserDetailsService.setUserDetailsMapper(userDetailsMapper); userDetailsMapper.setBase64EncodedPassword(false); UserDetails ldapUser = ldapUserDetailsService.loadUserByUsername("base64encoded-issue-1840"); assertThat(ldapUser).isInstanceOf(LdapUserDetailsImpl.class); LdapUserDetails ldapUserDetails = (LdapUserDetailsImpl) ldapUser; assertThat(passwordEncoder.matches("password", ldapUserDetails.getPassword())).isEqualTo(false); <END> }</code><technical_language>suggestion ldapUserDetailsService.setUserDetailsMapper(userDetailsMapper); userDetailsMapper.setBase64EncodedPassword(false); UserDetails ldapUser = ldapUserDetailsService.loadUserByUsername("base64encoded-issue-1840"); assertThat(ldapUser).isInstanceOf(LdapUserDetailsImpl.class); LdapUserDetails ldapUserDetails = (LdapUserDetailsImpl) ldapUser; assertThat(passwordEncoder.matches("password", ldapUserDetails.getPassword())).isEqualTo(false);</technical_language>

Target:
public void base64EncodedPasswordAfterAlgorithmShouldFail() { UserDetails ldapUser = ldapUserDetailsService.loadUserByUsername("issue1840-type-1"); assertThat(ldapUser).isInstanceOf(LdapUserDetailsImpl.class); LdapUserDetails ldapUserDetails = (LdapUserDetailsImpl) ldapUser; assertThat(passwordEncoder.matches("password", ldapUserDetails.getPassword())).isEqualTo(false); }
Source:
<code>public void cancel(Throwable cause) { <START> if (state.compareAndSet(CheckpointInProgressRequestState.NEW, CheckpointInProgressRequestState.CANCELLED)) { <END> discardAction.accept(cause); } }</code><technical_language>I concerns cancel: - In CheckpointStartRequest#cancel, targetResult.fail(cause) executed. For case of CheckpointInProgressRequest, do need complete future failure? - #cancel is valid perform executing #execute method of limitation of state condition, #cancel is triggered while performing #execute exceptions. Is considered design? - I guess introduction of state for voiding cancelling multiple times, #execute called more in practice. If so, is necessary bring in state values, need isCancelled state</technical_language>

Target:
public void cancel(Throwable cause) { if (state.compareAndSet(NEW, CANCELLED) || state.compareAndSet(FAILED, CANCELLED)) { discardAction.accept(cause); } }
Source:
<code>public EntityBinding(EntityDictionary dictionary, Class<?> cls, String type, String name) { entityClass = cls; jsonApiType = type; entityName = name; List<AccessibleObject> fieldOrMethodList = new ArrayList<>(); <START> fieldOrMethodList.addAll(Arrays.asList(cls.getDeclaredFields()) <END> .stream() .filter((field) -> ! Modifier.isStatic(field.getModifiers())) .filter((field) -> ! ((Field) field).isSynthetic()) .collect(Collectors.toList())); if (fieldOrMethodList.stream().anyMatch(field -> field.isAnnotationPresent(Id.class))) { accessType = AccessType.FIELD; fieldOrMethodList.addAll(Arrays.asList(cls.getMethods()) .stream() .filter((method) -> !Modifier.isStatic(method.getModifiers())) .filter((method) -> method.isAnnotationPresent(ComputedAttribute.class) || method.isAnnotationPresent(ComputedRelationship.class)) .collect(Collectors.toList())); fieldOrMethodList.forEach(field -> field.setAccessible(true)); } else { accessType = AccessType.PROPERTY; fieldOrMethodList.clear(); fieldOrMethodList.addAll(Arrays.asList(cls.getFields()) .stream() .filter((field) -> ! Modifier.isStatic(field.getModifiers())) .collect(Collectors.toList())); fieldOrMethodList.addAll(Arrays.asList(cls.getMethods()) .stream() .filter((method) -> !Modifier.isStatic(method.getModifiers())) .collect(Collectors.toList())); } bindEntityFields(cls, type, fieldOrMethodList); attributes = dequeToList(attributesDeque); relationships = dequeToList(relationshipsDeque); inheritedTypes = getInheritedTypes(cls); entityPermissions = new EntityPermissions(dictionary, cls, fieldOrMethodList); }</code><technical_language>Arrays.stream(cls.getDeclaredFields())</technical_language>

Target:
public EntityBinding(EntityDictionary dictionary, Class<?> cls, String type, String name) { entityClass = cls; jsonApiType = type; entityName = name; List<AccessibleObject> fieldOrMethodList = new ArrayList<>( getInstanceMembers(cls.getDeclaredFields(), (field) -> !((Field) field).isSynthetic()) ); if (fieldOrMethodList.stream().anyMatch(field -> field.isAnnotationPresent(Id.class))) { accessType = AccessType.FIELD; fieldOrMethodList.addAll( getInstanceMembers(cls.getMethods(), (method) -> method.isAnnotationPresent(ComputedAttribute.class) || method.isAnnotationPresent(ComputedRelationship.class)) ); fieldOrMethodList.forEach(field -> field.setAccessible(true)); } else { accessType = AccessType.PROPERTY; fieldOrMethodList.clear(); fieldOrMethodList.addAll(getInstanceMembers(cls.getFields())); fieldOrMethodList.addAll(getInstanceMembers(cls.getMethods())); } bindEntityFields(cls, type, fieldOrMethodList); attributes = dequeToList(attributesDeque); relationships = dequeToList(relationshipsDeque); inheritedTypes = getInheritedTypes(cls); entityPermissions = new EntityPermissions(dictionary, cls, fieldOrMethodList); }
Source:
<code>public <E> BTreeInsertAndGetFuture<Boolean, E> asyncBopInsertAndGetTrimmed( String key, long bkey, byte[] eFlag, E value, CollectionAttributes attributesForCreate, Transcoder<E> transcoder) { <START> BTreeInsertAndGet<E> get = new BTreeInsertAndGet<E>( <END> BTreeInsertAndGet.Command.INSERT, bkey, eFlag, value, attributesForCreate); return asyncBTreeStoreAndGet(key, get, transcoder); }</code><technical_language>get => insertAndGet (??)</technical_language>

Target:
public <E> BTreeStoreAndGetFuture<Boolean, E> asyncBopInsertAndGetTrimmed( String key, long bkey, byte[] eFlag, E value, CollectionAttributes attributesForCreate, Transcoder<E> transcoder) { BTreeInsertAndGet<E> insertAndGet = new BTreeInsertAndGet<E>( BTreeInsertAndGet.Command.INSERT, bkey, eFlag, value, attributesForCreate); return asyncBTreeInsertAndGet(key, insertAndGet, transcoder); }
Source:
<code>public void createIfMissing(final EventTypeBase eventType, final boolean checkAuth) throws AuthorizationSectionException, TopicCreationException, InternalNakadiException, NoSuchPartitionStrategyException, DuplicatedEventTypeNameException, InvalidEventTypeException, DbWriteOperationsBlockedException, EventTypeOptionsValidationException { try { eventTypeRepository.findByName(eventType.getName()); <START> LOG.info("Event-type already exist", eventType.getName()); <END> } catch (final NoSuchEventTypeException noSuchEventTypeException) { LOG.info("Creating event-type as it is missing", eventType.getName()); create(eventType, checkAuth); } }</code><technical_language>Minor nitpick (s/exist/exists)</technical_language>

Target:
public void createIfMissing(final EventTypeBase eventType, final boolean checkAuth) throws AuthorizationSectionException, TopicCreationException, InternalNakadiException, NoSuchPartitionStrategyException, DuplicatedEventTypeNameException, InvalidEventTypeException, DbWriteOperationsBlockedException, EventTypeOptionsValidationException { try { eventTypeRepository.findByName(eventType.getName()); LOG.info("Event-type already exists", eventType.getName()); } catch (final NoSuchEventTypeException noSuchEventTypeException) { LOG.info("Creating event-type as it is missing", eventType.getName()); create(eventType, checkAuth); } }
Source:
<code>public SettableFuture schedule(SourceScheduler scheduler) { checkState(initialScheduled); checkState(failedTasks.size() < nodeByTaskId.size()); synchronized (this) { newDriverGroupReady = SettableFuture.create(); while (!availableTasks.isEmpty()) { <START> if (driverGroupQueue.isEmpty()) { <END> break; } int taskId = availableTasks.dequeueInt(); if (failedTasks.contains(taskId)) { continue; } int nextDriverGroupId = driverGroupQueue.dequeueInt(); InternalNode nodeForCompletedDriverGroup = bucketNodeMap.getAssignedNode(taskId).orElseThrow(IllegalStateException::new); bucketNodeMap.assignOrUpdateBucketToNode(nextDriverGroupId, nodeForCompletedDriverGroup); scheduler.startLifespan(Lifespan.driverGroup(nextDriverGroupId), partitionHandles.get(nextDriverGroupId)); taskByDriverGroup[nextDriverGroupId] = taskId; runningDriverGroupIdsByTask[taskId].add(nextDriverGroupId); } } return newDriverGroupReady; }</code><technical_language>nit: while condition simply !availableTasks.isEmpty() && !driverGroupQueue.isEmpty()</technical_language>

Target:
public SettableFuture schedule(SourceScheduler scheduler) { checkState(initialScheduled, "schedule should only be called after initial scheduling finished"); checkState(failedTasks.size() < nodeByTaskId.size(), "All tasks have failed"); synchronized (this) { newDriverGroupReady = SettableFuture.create(); while (!availableTasks.isEmpty() && !driverGroupQueue.isEmpty()) { int taskId = availableTasks.dequeueInt(); if (failedTasks.contains(taskId)) { continue; } int nextDriverGroupId = driverGroupQueue.dequeueInt(); InternalNode nodeForCompletedDriverGroup = nodeByTaskId.get(taskId); bucketNodeMap.assignOrUpdateBucketToNode(nextDriverGroupId, nodeForCompletedDriverGroup); scheduler.startLifespan(Lifespan.driverGroup(nextDriverGroupId), partitionHandles.get(nextDriverGroupId)); taskByDriverGroup[nextDriverGroupId] = taskId; runningDriverGroupIdsByTask[taskId].add(nextDriverGroupId); } } return newDriverGroupReady; }
Source:
<code>public static Throwable deleteWithConfirm(File file, boolean expect, Throwable accumulate, RateLimiter rateLimiter) { <START> if (rateLimiter == null) <END> rateLimiter = RateLimiter.create(Double.MAX_VALUE); boolean exists = file.exists(); assert exists || !expect : "attempted to delete non-existing file " + file.getName(); try { rateLimiter.acquire(); if (exists) Files.delete(file.toPath()); } catch (Throwable t) { try { throw new FSWriteError(t, file); } catch (Throwable t2) { accumulate = merge(accumulate, t2); } } return accumulate; }</code><technical_language>Instead of creating a new RateLimiter for file deleted, guard rateLimiter.acquire null check</technical_language>

Target:
public static Throwable deleteWithConfirm(File file, boolean expect, Throwable accumulate, RateLimiter rateLimiter) { boolean exists = file.exists(); assert exists || !expect : "attempted to delete non-existing file " + file.getName(); try { if (rateLimiter != null) { double throttled = rateLimiter.acquire(); if (throttled > 0.0) nospam1m.warn("Throttling file deletion: waited seconds to delete {}", throttled, file); } if (exists) Files.delete(file.toPath()); } catch (Throwable t) { try { throw new FSWriteError(t, file); } catch (Throwable t2) { accumulate = merge(accumulate, t2); } } return accumulate; }
Source:
<code>private void startReaderThread() { Thread thread = new Thread((Runnable) () -> { byte[] bytes = new byte[1024]; try { while (fStream.read(bytes) >= 0) { } } catch (IOException e) { } <START> try { <END> fStream.close(); } catch (IOException e) { } }, DebugCoreMessages.NullStreamsProxy_0); thread.setDaemon(true); thread.start(); }</code><technical_language>try-with-resources? try (InputStream stream = fStream) { while (stream.read(bytes) >= 0) { // do } } catch (IOException e) { }</technical_language>

Target:
private void startReaderThread() { Thread thread = new Thread((Runnable) () -> { byte[] bytes = new byte[1024]; try (InputStream stream = fStream) { while (stream.read(bytes) >= 0) { } } catch (IOException e) { } }, DebugCoreMessages.NullStreamsProxy_0); thread.setDaemon(true); thread.start(); }
Source:
<code>public static void deleteSnapshot(File snpDir, String folderName) { if (!snpDir.exists()) return; assert snpDir.isDirectory() : snpDir; try { List<Path> dirs = new ArrayList<>(); <START> Files.walkFileTree(snpDir.toPath(), new SimpleFileVisitor<Path>() { <END> @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { if (Files.isDirectory(dir) && Files.exists(dir) && folderName.equals(dir.getFileName().toString())) { dirs.add(dir); } return super.preVisitDirectory(dir, attrs); } @Override public FileVisitResult visitFileFailed(Path file, IOException exc) { return FileVisitResult.CONTINUE; } }); dirs.forEach(U::delete); File db = new File(snpDir, DB_DEFAULT_FOLDER); if (!db.exists() || db.list().length == 0) U.delete(snpDir); } catch (IOException e) { throw new IgniteException(e); } }</code><technical_language>simpler understand, if delete explicitly listed dirs: snapshotName/binary_meta/nodeName snapshotName/db/nodeName etc. In current implementation, if name node "db" for example, lose other nodes data</technical_language>

Target:
public static void deleteSnapshot(File snpDir, String folderName) { if (!snpDir.exists()) return; assert snpDir.isDirectory() : snpDir; try { File binDir = resolveBinaryWorkDir(snpDir.getAbsolutePath(), folderName); File dbDir = U.resolveWorkDirectory(snpDir.getAbsolutePath(), databaseRelativePath(folderName), false); U.delete(binDir); U.delete(dbDir); File marshDir = mappingFileStoreWorkDir(snpDir.getAbsolutePath()); Files.walkFileTree(marshDir.toPath(), new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { U.delete(file); return FileVisitResult.CONTINUE; } @Override public FileVisitResult visitFileFailed(Path file, IOException exc) { return FileVisitResult.CONTINUE; } }); File db = new File(snpDir, DB_DEFAULT_FOLDER); if (!db.exists() || db.list().length == 0) U.delete(snpDir); } catch (IOException | IgniteCheckedException e) { throw new IgniteException(e); } }
Source:
<code>public <K, V> void assertAnySatisfy(AssertionInfo info, Map<K, V> actual, BiConsumer<? super K, ? super V> entryRequirements) { checkNotNull(entryRequirements, "The BiConsumer<K, V> expressing the assertions requirements must not be null"); assertNotNull(info, actual); boolean anyMatch = actual.entrySet().stream().anyMatch(e -> { try { entryRequirements.accept(e.getKey(), e.getValue()); } catch (AssertionError ex) { return false; } return true; }); <START> if (!anyMatch) { <END> throw failures.failure(info, elementsShouldSatisfyAny(actual)); } }</code><technical_language>remove block in: if (!anyMatch) throw failures.failure(info, elementsShouldSatisfyAny(actual));</technical_language>

Target:
public <K, V> void assertAnySatisfy(AssertionInfo info, Map<K, V> actual, BiConsumer<? super K, ? super V> entryRequirements) { checkNotNull(entryRequirements, "The BiConsumer<K, V> expressing the assertions requirements must not be null"); assertNotNull(info, actual); boolean anyMatch = actual.entrySet().stream().anyMatch(e -> { try { entryRequirements.accept(e.getKey(), e.getValue()); } catch (AssertionError ex) { return false; } return true; }); if (!anyMatch) throw failures.failure(info, elementsShouldSatisfyAny(actual)); }
Source:
<code>void handleBody(InputStream payload, MessageMetadata messageMetadata) throws IOException, MessageFormatException { if (!successfullyDeserialized) { BlobData blobData = MessageFormatRecord.deserializeBlob(payload); ByteBuffer encryptionKey = messageMetadata == null ? null : messageMetadata.getEncryptionKey(); if (encryptionKey == null) { chunkIndexToBuffer.put(chunkIndex, filterChunkToRange(blobData.getStream().getByteBuffer())); numChunksRetrieved++; blobContentAvailableToProcess = true; } else { state = ChunkState.Decrypting; logger.trace("Marking the chunk's state to and submitting decrypt job for data chunk {}", ChunkState.Decrypting, chunkBlobId); exec.submitJob( new DecryptJob(chunkBlobId, encryptionKey, blobData.getStream().getByteBuffer(), null, cryptoService, kms, (DecryptJob.DecryptJobResult result, Exception exception) -> { logger.trace("Handling decrypt job callback for data chunk {}", chunkBlobId); if (chunkBlobId.equals(result.getBlobId())) { decryptCallbackResult = result; decryptCallbackException = exception; decryptCallbackResultAvailable = true; logger.trace("Successfully stored decrypt job results for data chunk {}", chunkBlobId); } else { <START> logger.error("Ignoring decrypt callback response due to blobId mismatch. Expected : actual {}", <END> chunkBlobId, result.getBlobId()); } })); } successfullyDeserialized = true; } else { } }</code><technical_language>also, if this is error, is happening of a programming error, chunk hang completed</technical_language>

Target:
void handleBody(InputStream payload, MessageMetadata messageMetadata) throws IOException, MessageFormatException { if (!successfullyDeserialized) { BlobData blobData = MessageFormatRecord.deserializeBlob(payload); ByteBuffer encryptionKey = messageMetadata == null ? null : messageMetadata.getEncryptionKey(); if (encryptionKey == null) { chunkIndexToBuffer.put(chunkIndex, filterChunkToRange(blobData.getStream().getByteBuffer())); numChunksRetrieved++; } else { decryptCallbackResultInfo = new DecryptCallBackResultInfo(); progressTracker.initializeDecryptionTracker(); logger.trace("Submitting decrypt job for data chunk {}", chunkBlobId); long startTimeMs = System.currentTimeMillis(); cryptoJobHandler.submitJob( new DecryptJob(chunkBlobId, encryptionKey, blobData.getStream().getByteBuffer(), null, cryptoService, kms, (DecryptJob.DecryptJobResult result, Exception exception) -> { routerMetrics.decryptTimeMs.update(System.currentTimeMillis() - startTimeMs); logger.trace("Handling decrypt job callback for data chunk {}", chunkBlobId); decryptCallbackResultInfo.setResultAndException(result, exception); routerCallback.onPollReady(); })); } successfullyDeserialized = true; } else { } }