auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testDebugLogPrinting() { Logger logger = createLogger(LogLevel.DEBUG); String debug = "debug"; logger.debug(debug); <START> assertLastMessage(debug); <END> }</code><technical_language>String log = "..."; assertLastMessageIs(log)? for me, assertLastMessage(...) clear assertion is (without method). - edit... assertLastMessageEquals(String...) I guess "equals" is more familiar "is"</technical_language>

Target:
public void testDebugLogPrinting() { Logger logger = createLogger(LogLevel.DEBUG); String message = "debug"; logger.debug(message); assertLastLogMessageEquals(message); }
Source:
<code>public com.alliander.osgp.dto.valueobjects.smartmetering.SpecialDay convert(final SpecialDay source, final Type<? extends com.alliander.osgp.dto.valueobjects.smartmetering.SpecialDay> destinationType) { final com.alliander.osgp.domain.core.valueobjects.smartmetering.CosemDate cosemDate = source .getSpecialDayDate(); <START> return new com.alliander.osgp.dto.valueobjects.smartmetering.SpecialDay(new CosemDate(cosemDate.getYear(), <END> cosemDate.getMonth(), cosemDate.getDayOfMonth(), cosemDate.getDayOfWeek()), source.getDayId()); }</code><technical_language>need for new object SpecialDay guards immutability. A simpler constructor for CosemDate. new com.alliander.osgp.dto.valueobjects.smartmetering.SpecialDay(source.getSpecialDayDate());</technical_language>

Target:
public com.alliander.osgp.dto.valueobjects.smartmetering.SpecialDay convert(final SpecialDay source, final Type<? extends com.alliander.osgp.dto.valueobjects.smartmetering.SpecialDay> destinationType) { return new com.alliander.osgp.dto.valueobjects.smartmetering.SpecialDay(this.mapperFacade.map( source.getSpecialDayDate(), CosemDate.class), source.getDayId()); }
Source:
<code><START> public List<AudioData> speak(String toSpeak) { <END> if (mouth != null && !mute) { try { return mouth.speak(toSpeak); } catch (Exception e) { Logging.logError(e); } } return null; }</code><technical_language>this method here. speech synthesis. Redundant here</technical_language>

Target:
public List<AudioData> speak(String toSpeak) { if (mouth == null) { log.error("Speak is called, but my mouth is NULL..."); return null; } if (!mute) { try { return mouth.speak(toSpeak); } catch (Exception e) { Logging.logError(e); } } return null; }
Source:
<code>public Connection<CL> createConnection() { try { Connection<CL> connection = connFactory.createConnection((HostConnectionPool<CL>) pool, null); connection.open(); availableConnections.add(connection); monitor.incConnectionCreated(host); numActiveConnections.incrementAndGet(); return connection; } catch (DynoConnectException e) { <START> if (monitor.getConnectionCreateFailedCount() % 10000 == 0) { <END> Logger.error("Failed to create connection", e); } monitor.incConnectionCreateFailed(host, e); throw e; } catch (RuntimeException e) { if (monitor.getConnectionCreateFailedCount() % 10000 == 0) { Logger.error("Failed to create connection", e); } monitor.incConnectionCreateFailed(host, e); throw new DynoConnectException(e); } }</code><technical_language>Orthogonal this PR removed debug check worth mentioning - log statements added avoid flooding logs while troubleshooting specific error scenarios (hence debug log level check). removed</technical_language>

Target:
public Connection<CL> createConnection() { try { Connection<CL> connection = connFactory.createConnection((HostConnectionPool<CL>) pool, null); connection.open(); availableConnections.add(connection); monitor.incConnectionCreated(host); numActiveConnections.incrementAndGet(); return connection; } catch (DynoConnectException e) { if (Logger.isDebugEnabled()) { if (monitor.getConnectionCreateFailedCount() % 10000 == 0) { Logger.error("Failed to create connection", e); } } monitor.incConnectionCreateFailed(host, e); throw e; } catch (RuntimeException e) { if (monitor.getConnectionCreateFailedCount() % 10000 == 0) { Logger.error("Failed to create connection", e); } monitor.incConnectionCreateFailed(host, e); throw new DynoConnectException(e); } }
Source:
<code>public void addListener(UnitedServerListener listener) { <START> boolean requiresInit = false; <END> synchronized(this) { if( !list.contains(listener)) { list.add(listener); requiresInit = isInitialized; } } if( requiresInit ) { initializeListener(listener); } }</code><technical_language>imho requiresInit included in sync block</technical_language>

Target:
public void addListener(UnitedServerListener listener) { boolean requiresInit = false; synchronized(this) { if( !list.contains(listener)) { requiresInit = isInitialized(); list.add(listener); } } if( requiresInit ) { initializeListener(listener); } }
Source:
<code>private Promise<Void> initializeChangeMarkersRender() { OrionTextViewOverlay textView = editorWidget.getTextView(); List<OrionExtRulerOverlay> rulers = Arrays.asList(textView.getRulers()); OrionStyleOverlay style = OrionStyleOverlay.create(); <START> style.setStyleClass("vcsChangeMarker"); <END> OrionAttributesOverlay attributesOverlay = OrionAttributesOverlay.create(); attributesOverlay.setAttribute( "style", "width: 8px; position: relative; float: left; background-color: " + org.eclipse.che.ide.api.theme.Style.theme.editorGutterLineNumberBackgroundColor()); style.setAttributes(attributesOverlay); return Promises.create( (resolve, reject) -> OrionExtRulerOverlay.create( editorWidget.getEditor().getAnnotationModel(), style, OrionExtRulerOverlay.RulerLocation.LEFT.getLocation(), OrionExtRulerOverlay.RulerOverview.PAGE.getOverview(), orionExtRulerOverlay -> { int rulerPosition = 0; OrionExtRulerOverlay rulerLines = getRuler(rulers, "ruler lines"); if (rulerLines != null) { rulerPosition = rulers.indexOf(rulerLines) + 1; } else { OrionExtRulerOverlay rulerAnnotations = getRuler(rulers, "ruler annotations"); if (rulerAnnotations != null) { rulerPosition = rulers.indexOf(rulerAnnotations) + 1; } } textView.addRuler(orionExtRulerOverlay, rulerPosition); OrionVcsChangeMarkersRuler orionVcsChangeMarkersRuler = new OrionVcsChangeMarkersRuler( orionExtRulerOverlay, editorWidget.getEditor()); this.vcsChangeMarkerRender = vcsChangeMarkerRenderFactory.create(orionVcsChangeMarkersRuler); resolve.apply(null); })); }</code><technical_language>If set vcsChangeMarker style define in css instead of setting attributes</technical_language>

Target:
private Promise<Void> initializeChangeMarkersRender() { OrionTextViewOverlay textView = editorWidget.getTextView(); List<OrionExtRulerOverlay> rulers = Arrays.asList(textView.getRulers()); OrionStyleOverlay style = OrionStyleOverlay.create(); style.setStyleClass("ruler vcs"); return Promises.create( (resolve, reject) -> OrionExtRulerOverlay.create( editorWidget.getEditor().getAnnotationModel(), style, OrionExtRulerOverlay.RulerLocation.LEFT.getLocation(), OrionExtRulerOverlay.RulerOverview.PAGE.getOverview(), orionExtRulerOverlay -> { int rulerPosition; for (rulerPosition = 0; rulerPosition < rulers.size() - 1; rulerPosition++) { String rulerStyleClass = rulers.get(rulerPosition).getStyle().getStyleClass(); if ("ruler lines".equals(rulerStyleClass)) { break; } } textView.addRuler(orionExtRulerOverlay, rulerPosition + 1); OrionVcsChangeMarkersRuler orionVcsChangeMarkersRuler = new OrionVcsChangeMarkersRuler( orionExtRulerOverlay, editorWidget.getEditor()); this.vcsChangeMarkerRender = vcsChangeMarkerRenderFactory.create(orionVcsChangeMarkersRuler); resolve.apply(null); })); }
Source:
<code>public DiskProfile getProfile() { if (profile == null) { <START> if (getParameters().getProfile() == null) { <END> if (getParameters().getProfileId() != null) { profile = getProfileDao().get(getParameters().getProfileId()); } } else { profile = getParameters().getProfile(); } } return profile; }</code><technical_language>consider simplify 'else/if' " if (getParameters().getProfile() != null) { profile = getParameters().getProfile(); } else if (getParameters().getProfileId() != null) { profile = getProfileDao().get(getParameters().getProfileId()); } else { // log something... } "</technical_language>

Target:
public DiskProfile getProfile() { if (profile == null) { if (getParameters().getProfile() != null) { profile = getParameters().getProfile(); } else if (getParameters().getProfileId() != null) { profile = getProfileDao().get(getParameters().getProfileId()); } else { log.error("couldn't find disk profile"); } } return profile; }
Source:
<code>public void process(JSONRequestContext requestContext) { StudentGroupContactLogEntryDAO entryDAO = DAOFactory.getInstance().getStudentGroupContactLogEntryDAO(); Long entryId = requestContext.getLong("entryId"); <START> StudentGroupContactLogEntry entry = entryDAO.findById(entryId); <END> entryDAO.archive(entry); }</code><technical_language>Null-check</technical_language>

Target:
public void process(JSONRequestContext requestContext) { StudentGroupContactLogEntryDAO entryDAO = DAOFactory.getInstance().getStudentGroupContactLogEntryDAO(); Long entryId = requestContext.getLong("entryId"); if (entryId == null) throw new SmvcRuntimeException(StatusCode.UNDEFINED, "EntryId was not defined."); StudentGroupContactLogEntry entry = entryDAO.findById(entryId); entryDAO.archive(entry); }
Source:
<code>public String getCommitStatusFromPatch(Patch patch) throws NotFoundException { PullRequestService pullrequestService = new PullRequestService(gitHubClient); CommitService commitService = new CommitService(gitHubClient); String sha = null; Optional<String> status = null; URL url = patch.getURL(); int patchId = Integer.parseInt(patch.getId()); checkHost(url); RepositoryId repositoryId = RepositoryId.createFromUrl(url); try { List<RepositoryCommit> commits = pullrequestService.getCommits(repositoryId, patchId); if (commits.size() > 0) { sha = commits.get(commits.size() - 1).getSha(); } List<CommitStatus> statuses = commitService.getStatuses(repositoryId, sha); if (statuses.size() > 0) { <START> status = Optional.ofNullable(statuses.get(0).getState()); <END> } } catch (IOException e) { Utils.logException(LOG, e); throw new NotFoundException(e); } if (status.isPresent()) { return status.get(); } else { Utils.logWarnMessage(LOG, "in the " + patch + "commit status is not present"); return null; } }</code><technical_language>statuses in commit comming differents CI builds. get combined statuses <LINK_0> is supported library using. In end need combine status of CommitStatus coming github (either service provided github hand here)</technical_language>

Target:
public org.jboss.set.aphrodite.domain.CommitStatus getCommitStatusFromPatch(Patch patch) throws NotFoundException { PullRequestService pullrequestService = new PullRequestService(gitHubClient); CommitService commitService = new CommitService(gitHubClient); String sha = null; org.jboss.set.aphrodite.domain.CommitStatus status = null; URL url = patch.getURL(); int patchId = Integer.parseInt(patch.getId()); checkHost(url); RepositoryId repositoryId = RepositoryId.createFromUrl(url); try { List<RepositoryCommit> commits = pullrequestService.getCommits(repositoryId, patchId); if (commits.size() > 0) { sha = commits.get(commits.size() - 1).getSha(); } List<CommitStatus> statuses = commitService.getStatuses(repositoryId, sha); if (statuses.size() > 0) { String sta = getCombineStatus(statuses); status = org.jboss.set.aphrodite.domain.CommitStatus.fromString(sta); } } catch (IOException e) { Utils.logException(LOG, e); throw new NotFoundException(e); } if (status != null) { return status; } else { throw new NotFoundException("No commit status found for patch:" + patch.getURL()); } }
Source:
<code>protected ReferencedProjectPickerDialog(final Shell parentShell, IProject project) { super(parentShell, new ColumnLabelProvider() { @Override public String getText(Object element) { IProject project = (IProject) element; return project.getName(); } @Override public Image getImage(Object element) { try { <START> return new Image(parentShell.getDisplay(), new URL("platform:/plugin/org.eclipse.ui.images/eclipse-png/org.eclipse.jdt.ui/icons/full/eview16/projects.png").openStream()); <END> } catch (Exception e) { e.printStackTrace(); return super.getImage(element); } } }); this.project = project; }</code><technical_language>anonymous "new Image()" is a resource leak. Please some kind of resourcepool</technical_language>

Target:
protected ReferencedProjectPickerDialog(final Shell parentShell, IProject project) { super(parentShell, new ColumnLabelProvider() { @Override public String getText(Object element) { IProject project = (IProject) element; return project.getName(); } @Override public Image getImage(Object element) { return imgProject; } }); this.project = project; }
Source:
<code>public void doPatchProcessing(Context context, Request currentRequest, InProgressSubmission source, Operation op, SubmissionStepConfig stepConf) throws Exception { String instance = ""; if ("remove".equals(op.getOp())) { if (op.getPath().contains(UPLOAD_STEP_METADATA_PATH)) { instance = UPLOAD_STEP_METADATA_OPERATION_ENTRY; } else if (op.getPath().contains(UPLOAD_STEP_ACCESSCONDITIONS_OPERATION_ENTRY)) { instance = UPLOAD_STEP_ACCESSCONDITIONS_OPERATION_ENTRY; } else { instance = UPLOAD_STEP_REMOVE_OPERATION_ENTRY; } } else if ("move".equals(op.getOp())) { if (op.getPath().contains(UPLOAD_STEP_METADATA_PATH)) { instance = UPLOAD_STEP_METADATA_OPERATION_ENTRY; } else { instance = UPLOAD_STEP_MOVE_OPERATION_ENTRY; } } else { if (op.getPath().contains(UPLOAD_STEP_ACCESSCONDITIONS_OPERATION_ENTRY)) { instance = UPLOAD_STEP_ACCESSCONDITIONS_OPERATION_ENTRY; } else { instance = UPLOAD_STEP_METADATA_OPERATION_ENTRY; } } PatchOperation<?> patchOperation = new PatchOperationFactory().instanceOf(instance, op.getOp()); if (instance.equals(AbstractRestProcessingStep.UPLOAD_STEP_METADATA_OPERATION_ENTRY)) { DCInputSet inputConfig = inputReader.getInputsByFormName(UploadStep.UPLOAD_STEP_METADATA_SECTION); String[] split = patchOperation.getAbsolutePath(op.getPath()).split("/"); String metadata = findMetadata(split); if (inputConfig.isFieldPresent(metadata)) { patchOperation.perform(context, currentRequest, source, op); } else { <START> throw new UnprocessableEntityException("The attribute " + metadata + " does not present in section " <END> + UploadStep.UPLOAD_STEP_METADATA_SECTION); } } else { patchOperation.perform(context, currentRequest, source, op); } }</code><technical_language>Again, say: "The field " + metadata + " is present in section "</technical_language>

Target:
public void doPatchProcessing(Context context, Request currentRequest, InProgressSubmission source, Operation op, SubmissionStepConfig stepConf) throws Exception { String instance = null; if ("remove".equals(op.getOp())) { if (op.getPath().contains(UPLOAD_STEP_METADATA_PATH)) { instance = UPLOAD_STEP_METADATA_OPERATION_ENTRY; } else if (op.getPath().contains(UPLOAD_STEP_ACCESSCONDITIONS_OPERATION_ENTRY)) { instance = UPLOAD_STEP_ACCESSCONDITIONS_OPERATION_ENTRY; } else { instance = UPLOAD_STEP_REMOVE_OPERATION_ENTRY; } } else if ("move".equals(op.getOp())) { if (op.getPath().contains(UPLOAD_STEP_METADATA_PATH)) { instance = UPLOAD_STEP_METADATA_OPERATION_ENTRY; } else { instance = UPLOAD_STEP_MOVE_OPERATION_ENTRY; } } else { if (op.getPath().contains(UPLOAD_STEP_ACCESSCONDITIONS_OPERATION_ENTRY)) { instance = UPLOAD_STEP_ACCESSCONDITIONS_OPERATION_ENTRY; } else if (op.getPath().contains(UPLOAD_STEP_METADATA_PATH)) { instance = UPLOAD_STEP_METADATA_OPERATION_ENTRY; } } if (instance == null) { throw new UnprocessableEntityException("The path " + op.getPath() + " is not supported by the operation " + op.getOp()); } PatchOperation<?> patchOperation = new PatchOperationFactory().instanceOf(instance, op.getOp()); patchOperation.perform(context, currentRequest, source, op); }
Source:
<code>public PathSpecification(Optional<NodeLocation> location, List<PathElement> path) { super(location); <START> this.path = ImmutableList.copyOf(path); <END> }</code><technical_language>requireNonNull(path, "path is null)"</technical_language>

Target:
public PathSpecification(Optional<NodeLocation> location, List<PathElement> path) { super(location); this.path = ImmutableList.copyOf(requireNonNull(path, "path is null")); }
Source:
<code>private void validateModelsOnChangeEvent() { <START> getSnapshotName().getEntityChangedEvent().addListener(new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { validate("modelPropertiesChanged"); } }); getDaysOfTheWeek().getSelectedItemChangedEvent().addListener(new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { validate("modelPropertiesChanged"); } }); getDaysOfMonth().getSelectedItemChangedEvent().addListener(new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { validate("modelPropertiesChanged"); } }); getEndDate().getEntityChangedEvent().addListener(new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { validate("modelPropertiesChanged"); } }); <END> }</code><technical_language>listener for entities, thought listeners of same</technical_language>

Target:
private void validateModelsOnChangeEvent() { IEventListener<EventArgs> onPropertyChangeValidate = new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { validate("modelPropertiesChanged"); } }; getSnapshotName().getEntityChangedEvent().addListener(onPropertyChangeValidate); getDaysOfTheWeek().getSelectedItemChangedEvent().addListener(onPropertyChangeValidate); getDaysOfMonth().getSelectedItemChangedEvent().addListener(onPropertyChangeValidate); getEndDate().getEntityChangedEvent().addListener(onPropertyChangeValidate); }
Source:
<code>public PooledConnection borrowConnection(ServerLocation server, long acquireTimeout, boolean onlyUseExistingCnx) throws AllConnectionsInUseException, NoAvailableServersException, ServerConnectivityException { PooledConnection connection; logger.trace("Connection borrowConnection single hop connection"); long waitStart = NOT_WAITING; try { long timeout = System.nanoTime() + MILLISECONDS.toNanos(acquireTimeout); while (true) { connection = availableConnectionManager.useFirst((c) -> c.getServer().equals(server)); if (null != connection) { return connection; } if (connectionAccounting.tryCreate()) { try { connection = createPooledConnection(server); } catch (GemFireSecurityException e) { throw new ServerOperationException(e); } finally { if (connection == null) { connectionAccounting.cancelTryCreate(); if (connectionAccounting.isUnderMinimum()) { startBackgroundPrefill(); } } } if (null != connection) { return connection; } <START> throw new ServerConnectivityException(BORROW_CONN_ERROR_MSG + server); <END> } if (!onlyUseExistingCnx) { connection = forceCreateConnection(server); if (null != connection) { return connection; } throw new ServerConnectivityException(BORROW_CONN_ERROR_MSG + server); } if (checkShutdownInterruptedOrTimeout(timeout)) { break; } waitStart = beginConnectionWaitStatIfNotStarted(waitStart); Thread.yield(); } } finally { endConnectionWaitStatIfStarted(waitStart); } cancelCriterion.checkCancelInProgress(null); throw new AllConnectionsInUseException(); }</code><technical_language>If tryCreate() is true, for reason, unable create connection, in loop timeout (server-timeout), right? throwing exception return wait time</technical_language>

Target:
public PooledConnection borrowConnection(ServerLocation server, long acquireTimeout, boolean onlyUseExistingCnx) throws AllConnectionsInUseException, NoAvailableServersException, ServerConnectivityException { PooledConnection connection; logger.trace("Connection borrowConnection single hop connection"); long waitStart = NOT_WAITING; try { long timeout = System.nanoTime() + MILLISECONDS.toNanos(acquireTimeout); while (true) { connection = availableConnectionManager.useFirst((c) -> c.getServer().equals(server)); if (null != connection) { return connection; } if (!onlyUseExistingCnx) { connection = forceCreateConnection(server); if (null != connection) { return connection; } throw new ServerConnectivityException(BORROW_CONN_ERROR_MSG + server); } if (checkShutdownInterruptedOrTimeout(timeout)) { break; } waitStart = beginConnectionWaitStatIfNotStarted(waitStart); Thread.yield(); } } finally { endConnectionWaitStatIfStarted(waitStart); } cancelCriterion.checkCancelInProgress(null); throw new AllConnectionsInUseException(); }
Source:
<code>default Direction getBubbleElevatorDirection() { Block block = this.getBlockState().getBlock(); if (block == Blocks.BUBBLE_COLUMN) { <START> return this.getBlockState().get(BubbleColumnBlock.DRAG) ? Direction.DOWN : Direction.UP; <END> } else { return block.getBubbleElevatorDirection(this.getBlockState()); } }</code><technical_language>This logic in default implementation</technical_language>

Target:
default Direction getBubbleElevatorDirection() { return this.getBlockState().getBlock().getBubbleElevatorDirection(this.getBlockState()); }
Source:
<code>public <T> T sendMessage(final String msg, final ResponseHandler<T> handler) { final StringBuilder response = new StringBuilder(); final Socket socket = new Socket(); try { socket.connect(new InetSocketAddress(hostname, port), timeout); final InputStreamReader in = new InputStreamReader( socket.getInputStream(), US_ASCII); final OutputStreamWriter out = new OutputStreamWriter( socket.getOutputStream(), US_ASCII); logger.debug(">> {}", msg); out.write(msg); out.write(0); out.flush(); int l; while ((l = in.read()) > 0) { response.append((char) l); <START> } <END> } catch (final IOException e) { logger.error( "Failed to connect to neohub [host '{}' port '{}' timeout '{}']", new Object[] { hostname, port, timeout }); logger.debug("Failed to connect to neohub.", e); return null; } finally { try { socket.close(); } catch (IOException e) { } } final String responseStr = response.toString(); logger.debug("<< {}", responseStr); if (handler != null) { return handler.onResponse(responseStr); } else return null; }</code><technical_language>apache.commons.IOUtils provide some useful helper methods here</technical_language>

Target:
public <T> T sendMessage(final String msg, final ResponseHandler<T> handler) { final StringBuilder response = new StringBuilder(); final Socket socket = new Socket(); try { socket.connect(new InetSocketAddress(hostname, port), timeout); final InputStreamReader in = new InputStreamReader( socket.getInputStream(), US_ASCII); final OutputStreamWriter out = new OutputStreamWriter( socket.getOutputStream(), US_ASCII); logger.debug(">> {}", msg); out.write(msg); out.write(0); out.flush(); int l; while ((l = in.read()) > 0) { response.append((char) l); } } catch (final IOException e) { logger.error( "Failed to connect to neohub [host '{}' port '{}' timeout '{}']", new Object[] { hostname, port, timeout }); logger.debug("Failed to connect to neohub.", e); return null; } finally { IOUtils.closeQuietly(socket); } final String responseStr = response.toString(); logger.debug("<< {}", responseStr); if (handler != null) { return handler.onResponse(responseStr); } else return null; }
Source:
<code>public void testValidDataSizeAfterPuts() throws InterruptedException, StoreException, IOException { state.advanceTime(Time.MsPerSec); long timeInMsBeforePuts = state.time.milliseconds(); long totalLogSegmentValidSizeBeforePuts = verifyLogSegmentValidSize(new TimeRange(timeInMsBeforePuts, 0L)); long totalContainerValidSizeBeforePuts = verifyContainerValidSize(); state.addPutEntries(3, CuratedLogIndexState.PUT_RECORD_SIZE, Utils.Infinite_Time); state.advanceTime(Time.MsPerSec); long timeInMsAfterPuts = state.time.milliseconds(); <START> verifyLogSegmentValidSize(new TimeRange(timeInMsAfterPuts, 0L)); <END> long totalLogSegmentValidSizeAfterPuts = verifyLogSegmentValidSize(new TimeRange(timeInMsAfterPuts, 0L)); long totalContainerValidSizeAfterPuts = verifyContainerValidSize(); long expectedIncrement = 3 * CuratedLogIndexState.PUT_RECORD_SIZE; assertEquals("Put entries are not properly counted for log segment valid size", totalLogSegmentValidSizeAfterPuts, totalLogSegmentValidSizeBeforePuts + expectedIncrement); assertEquals("Put entries are not properly counted for container valid size", totalContainerValidSizeAfterPuts, totalContainerValidSizeBeforePuts + expectedIncrement); }</code><technical_language>this line is required</technical_language>

Target:
public void testValidDataSizeAfterPuts() throws InterruptedException, StoreException, IOException { advanceTimeToNextSecond(); long timeInMsBeforePuts = state.time.milliseconds(); long totalLogSegmentValidSizeBeforePuts = verifyAndGetLogSegmentValidSize(new TimeRange(timeInMsBeforePuts, 0L)); long totalContainerValidSizeBeforePuts = verifyAndGetContainerValidSize(); state.addPutEntries(3, CuratedLogIndexState.PUT_RECORD_SIZE, Utils.Infinite_Time); long timeInMsAfterPuts = state.time.milliseconds(); long totalLogSegmentValidSizeAfterPuts = verifyAndGetLogSegmentValidSize(new TimeRange(timeInMsAfterPuts, 0L)); long totalContainerValidSizeAfterPuts = verifyAndGetContainerValidSize(); long expectedIncrement = 3 * CuratedLogIndexState.PUT_RECORD_SIZE; assertEquals("Put entries are not properly counted for log segment valid size", totalLogSegmentValidSizeAfterPuts, totalLogSegmentValidSizeBeforePuts + expectedIncrement); assertEquals("Put entries are not properly counted for container valid size", totalContainerValidSizeAfterPuts, totalContainerValidSizeBeforePuts + expectedIncrement); }
Source:
<code>public void processBuffer() { for (LogReplicationEntry entry : buffer.values()) { LogReplicationEntryMetadata metadata = entry.getMetadata(); if (metadata.getTimestamp() < lastProcessedSeq) { <START> buffer.remove(metadata.getPreviousTimestamp()); <END> } else if (metadata.getPreviousTimestamp() <= lastProcessedSeq && metadata.getTimestamp() > lastProcessedSeq) { sinkManager.processMessage(entry); ackCnt++; buffer.remove(lastProcessedSeq); lastProcessedSeq = getCurrentSeq(entry); } } }</code><technical_language>remove metadata.getTimestamp</technical_language>

Target:
public void processBuffer() { for (LogReplicationEntry entry : buffer.values()) { LogReplicationEntryMetadata metadata = entry.getMetadata(); if (metadata.getTimestamp() <= lastProcessedSeq) { buffer.remove(metadata.getPreviousTimestamp()); } else if (metadata.getPreviousTimestamp() <= lastProcessedSeq && metadata.getTimestamp() > lastProcessedSeq) { sinkManager.processMessage(entry); ackCnt++; buffer.remove(lastProcessedSeq); lastProcessedSeq = getCurrentSeq(entry); } } }
Source:
<code>public void publishModel(int tenantId, String userName, long modelId) throws InvalidRequestException, MLModelPublisherException { InputStream in = null; <START> String errorMsg = "Failed to publish the model [id] "; <END> try { MLStorage storage = databaseService.getModelStorage(modelId); if (storage == null) { throw new InvalidRequestException("Invalid model ID: " + modelId); } String storageType = storage.getType(); String storageLocation = storage.getLocation(); MLIOFactory ioFactory = new MLIOFactory(mlProperties); MLInputAdapter inputAdapter = ioFactory.getInputAdapter(storageType + MLConstants.IN_SUFFIX); in = inputAdapter.read(storageLocation); if (in == null) { throw new InvalidRequestException("Invalid model [id] " + modelId); } MLCoreServiceValueHolder valueHolder = MLCoreServiceValueHolder.getInstance(); String modelName = databaseService.getModel(tenantId, userName, modelId).getName(); String registryPath = "/" + valueHolder.getModelRegistryLocation() + "/" + modelName; RegistryOutputAdapter registryOutputAdapter = new RegistryOutputAdapter(); registryOutputAdapter.write(registryPath, in); } catch (DatabaseHandlerException e) { throw new MLModelPublisherException(errorMsg + modelId, e); } catch (MLInputAdapterException e) { throw new MLModelPublisherException(errorMsg + modelId, e); } catch (MLOutputAdapterException e) { throw new MLModelPublisherException(errorMsg + modelId, e); } finally { if (in != null) { try { in.close(); } catch (IOException ignore) { } } } }</code><technical_language>model id right? add message here</technical_language>

Target:
public void publishModel(int tenantId, String userName, long modelId) throws InvalidRequestException, MLModelPublisherException { InputStream in = null; String errorMsg = "Failed to publish the model [id] " + modelId; try { MLStorage storage = databaseService.getModelStorage(modelId); if (storage == null) { throw new InvalidRequestException("Invalid model [id] " + modelId); } String storageType = storage.getType(); String storageLocation = storage.getLocation(); MLIOFactory ioFactory = new MLIOFactory(mlProperties); MLInputAdapter inputAdapter = ioFactory.getInputAdapter(storageType + MLConstants.IN_SUFFIX); in = inputAdapter.read(storageLocation); if (in == null) { throw new InvalidRequestException("Invalid model [id] " + modelId); } MLCoreServiceValueHolder valueHolder = MLCoreServiceValueHolder.getInstance(); String modelName = databaseService.getModel(tenantId, userName, modelId).getName(); String registryPath = "/" + valueHolder.getModelRegistryLocation() + "/" + modelName; RegistryOutputAdapter registryOutputAdapter = new RegistryOutputAdapter(); registryOutputAdapter.write(registryPath, in); } catch (DatabaseHandlerException e) { throw new MLModelPublisherException(errorMsg, e); } catch (MLInputAdapterException e) { throw new MLModelPublisherException(errorMsg, e); } catch (MLOutputAdapterException e) { throw new MLModelPublisherException(errorMsg, e); } finally { if (in != null) { try { in.close(); } catch (IOException ignore) { } } } }
Source:
<code>public static String[] listSerialPorts() { ArrayList<String> serialPorts = new ArrayList<String>(); <START> Enumeration<CommPortIdentifier> comPorts = CommPortIdentifier.getPortIdentifiers(); <END> while (comPorts.hasMoreElements()) { CommPortIdentifier identifier = (CommPortIdentifier)comPorts.nextElement(); String strName = identifier.getName(); serialPorts.add(strName); } return serialPorts.toArray(new String[serialPorts.size()]); }</code><technical_language>Check comPorts null</technical_language>

Target:
public static String[] listSerialPorts() { ArrayList<String> serialPorts = new ArrayList<String>(); @SuppressWarnings("unchecked") Enumeration<CommPortIdentifier> comPorts = CommPortIdentifier.getPortIdentifiers(); if (comPorts == null) return serialPorts.toArray(new String[serialPorts.size()]); while (comPorts.hasMoreElements()) { CommPortIdentifier identifier = (CommPortIdentifier)comPorts.nextElement(); if (identifier == null) continue; String strName = identifier.getName(); serialPorts.add(strName); } return serialPorts.toArray(new String[serialPorts.size()]); }
Source:
<code>private static void deleteFileIfExists(File to) throws IOException { <START> boolean fileDoesNotExist = to.exists(); <END> if (fileDoesNotExist) { return; } boolean deleteOk = to.delete(); if (deleteOk) { return; } throw new IOException("Unable to delete file: " + to.getAbsolutePath()); }</code><technical_language>a ! missing</technical_language>

Target:
private static void deleteFileIfExists(File to) throws IOException { boolean fileDoesNotExist = !to.exists(); if (fileDoesNotExist) { return; } boolean deleteOk = to.delete(); if (deleteOk) { return; } throw new IOException("Unable to delete file: " + to.getAbsolutePath()); }
Source:
<code>@Override public void init(long initUpdCntr, @Nullable byte[] cntrUpdData) { super.init(initUpdCntr, cntrUpdData); <START> log.info("[op=init" + <END> ", grpId=" + grp.groupId() + ", grpName=" + grp.cacheOrGroupName() + ", caches=" + grp.caches() + ", atomicity=" + grp.config().getAtomicityMode() + ", syncMode=" + grp.config().getWriteSynchronizationMode() + ", mode=" + grp.config().getCacheMode() + ", partId=" + partId + ", gapsLen=" + (cntrUpdData != null ? cntrUpdData.length : 0) + ", cur=" + toString() + ']'); }</code><technical_language>I instance of object is created log level for this class is DEBUG. log operations in this class in DEBUG level also</technical_language>

Target:
@Override public void init(long initUpdCntr, @Nullable byte[] cntrUpdData) { super.init(initUpdCntr, cntrUpdData); log.debug("[op=init" + ", grpId=" + grp.groupId() + ", grpName=" + grp.cacheOrGroupName() + ", caches=" + grp.caches() + ", atomicity=" + grp.config().getAtomicityMode() + ", syncMode=" + grp.config().getWriteSynchronizationMode() + ", mode=" + grp.config().getCacheMode() + ", partId=" + partId + ", gapsLen=" + (cntrUpdData != null ? cntrUpdData.length : 0) + ", cur=" + toString() + ']'); }
Source:
<code>public void testHttpEnumIngestionInvalidPastCollectionTime() throws IOException, URISyntaxException { long timestamp = System.currentTimeMillis() - TIME_DIFF - Configuration.getInstance().getLongProperty( CoreConfig.BEFORE_CURRENT_COLLECTIONTIME_MS ); final String tenant_id = "333333"; String prefix = getPrefix(); final String metric_name = prefix + "enum_metric_test"; Set<Locator> locators = new HashSet<Locator>(); locators.add(Locator.createLocatorFromPathComponents(tenant_id, metric_name)); HttpResponse response = postMetric(tenant_id, postAggregatedPath, "sample_enums_payload.json", timestamp, prefix ); String[] errors = getBodyArray( response ); assertEquals( 400, response.getStatusLine().getStatusCode() ); <START> assertTrue( Pattern.matches( JSONMetricsContainerTest.PAST_COLLECTION_TIME_REGEX, errors[ 1 ] ) ); <END> }</code><technical_language>pick: move this PAST_COLLECTION_TIME_REGEX a Util class base Test class</technical_language>

Target:
public void testHttpEnumIngestionInvalidPastCollectionTime() throws IOException, URISyntaxException { long timestamp = System.currentTimeMillis() - TIME_DIFF_MS - Configuration.getInstance().getLongProperty( CoreConfig.BEFORE_CURRENT_COLLECTIONTIME_MS ); final String tenant_id = "333333"; String postfix = getPostfix(); final String metric_name = postfix + "enum_metric_test"; Set<Locator> locators = new HashSet<Locator>(); locators.add(Locator.createLocatorFromPathComponents(tenant_id, metric_name)); HttpResponse response = postMetric(tenant_id, postAggregatedPath, "sample_enums_payload.json", timestamp, postfix ); String[] errors = getBodyArray( response ); assertEquals( 400, response.getStatusLine().getStatusCode() ); assertEquals( ERROR_TITLE, errors[ 0 ] ); assertTrue( Pattern.matches( PAST_COLLECTION_TIME_REGEX, errors[ 1 ] ) ); }
Source:
<code>public HostSetupNetworksParameters createSetupNetworkParams(VdsNetworkInterface nic) { HostSetupNetworksParameters parameters = new HostSetupNetworksParameters(host.getId()); NetworkAttachment managementAttachment = new NetworkAttachment(); managementAttachment.setNetworkId(managementNetwork.getId()); managementAttachment.setNicId(nic.getId()); IpConfiguration ipConfiguration = new IpConfiguration(); <START> if (ipConfiguration.hasPrimaryAddressSet()) { <END> ipConfiguration.getPrimaryAddress().setAddress(nic.getAddress()); ipConfiguration.getPrimaryAddress().setNetmask(nic.getSubnet()); ipConfiguration.getPrimaryAddress().setGateway(nic.getGateway()); } ipConfiguration.setBootProtocol(nic.getBootProtocol()); managementAttachment.setIpConfiguration(ipConfiguration); parameters.getNetworkAttachments().add(managementAttachment); return parameters; }</code><technical_language>created a new IpConfiguration() add address, do expect primary address set? code better- <LINK_0></technical_language>

Target:
public HostSetupNetworksParameters createSetupNetworkParams(VdsNetworkInterface nic) { HostSetupNetworksParameters parameters = new HostSetupNetworksParameters(host.getId()); NetworkAttachment managementAttachment = new NetworkAttachment(); managementAttachment.setNetworkId(managementNetwork.getId()); managementAttachment.setNicId(nic.getId()); IpConfiguration ipConfiguration = new IpConfiguration(); ipConfiguration.getIPv4Addresses().add(createIPv4Address(nic)); ipConfiguration.setBootProtocol(nic.getBootProtocol()); managementAttachment.setIpConfiguration(ipConfiguration); parameters.getNetworkAttachments().add(managementAttachment); return parameters; }
Source:
<code>@Override protected PhysicalNode convert(RelOptPlanner planner, RelMetadataQuery mq, LogicalFilter rel) { RelOptCluster cluster = rel.getCluster(); RelTraitSet traits = rel.getTraitSet().replace(IgniteConvention.INSTANCE); RelTraitSet inTraits = rel.getTraitSet().replace(IgniteConvention.INSTANCE); RelNode input = rel.getInput(); Set<CorrelationId> corrIds = RexUtils.extractCorrelationIds(rel.getCondition()); if (!corrIds.isEmpty()) { <START> inTraits = rel.getTraitSet().replace(RewindabilityTrait.REWINDABLE); <END> traits = traits.replace(RewindabilityTrait.REWINDABLE).replace(CorrelationTrait.correlations(corrIds)); } input = RelOptRule.convert(input, inTraits); return new IgniteFilter(cluster, traits, input, rel.getCondition()); }</code><technical_language>inTraits unused in this scope</technical_language>

Target:
@Override protected PhysicalNode convert(RelOptPlanner planner, RelMetadataQuery mq, LogicalFilter rel) { RelOptCluster cluster = rel.getCluster(); RelTraitSet traits = rel.getTraitSet().replace(IgniteConvention.INSTANCE); Set<CorrelationId> corrIds = RexUtils.extractCorrelationIds(rel.getCondition()); if (!corrIds.isEmpty()) traits = traits.replace(CorrelationTrait.correlations(corrIds)); return new IgniteFilter(cluster, traits, rel.getInput(), rel.getCondition()); }
Source:
<code>public static void removeProperty(String name, ModelControllerClient client) { ModelNode modelNode = createOpNode("system-property=" + name, REMOVE); ModelNode result = executeOp(modelNode, client); <START> modelNode.get(OPERATION_HEADERS).get(ALLOW_RESOURCE_SERVICE_RESTART).set(true); <END> log.debugf("Removing property %s. Result: %s.", name, result); }</code><technical_language>This cruft. SystemPropertyRemoveHandler respect this header, in case removing props in test trigger reload-required. If do a bug</technical_language>

Target:
public static void removeProperty(String name, ModelControllerClient client) { ModelNode modelNode = createOpNode("system-property=" + name, REMOVE); ModelNode result = executeOp(modelNode, client); log.debugf("Removing property %s. Result: %s.", name, result); }
Source:
<code>public void updateMetricData() { try (Connection connection = DriverManager.getConnection( dataSourceFactory.getUrl(), dataSourceFactory.getUser(), dataSourceFactory.getPassword())) { connection.setReadOnly(true); <START> try (PreparedStatement statement = connection.prepareStatement("select * from pg_stat_database where datname = ?")) { <END> statement.setString(1, databaseName); if (statement.execute()) { try (ResultSet resultSet = statement.getResultSet()) { if (resultSet.next()) { for (PostgresMetric metric : metrics) { metric.setValueFromResultSet(resultSet); } statsHealthy = 1; return; } } } } } catch (SQLException ignored) { } statsHealthy = 0; }</code><technical_language>try-with-resources merged: java try (Connection connection = DriverManager.getConnection( dataSourceFactory.getUrl(), dataSourceFactory.getUser(), dataSourceFactory.getPassword()); PreparedStatement statement = connection.prepareStatement( "select * pg_stat_database datname = ?")) { This connection.setReadOnly(true) called statement prepared. if this difference</technical_language>

Target:
public void updateMetricData() { statsHealthy = fetchDatabaseMetrics() ? 1 : 0; }
Source:
<code>public void start() throws IOException, InterruptedException { logger.info("Starting processor threads", numProcessorThreads); for (int i = 0; i < numProcessorThreads; i++) { processors.add(i, new Processor(i, maxRequestSize, requestResponseChannel, metrics)); Utils.newThread("ambry-processor-" + port + " " + i, processors.get(i), false).start(); } requestResponseChannel.addResponseListener(new ResponseListener() { @Override public void onResponse(int processorId) { processors.get(processorId).wakeup(); } }); logger.info("Starting acceptor threads"); Acceptor plainTextAcceptor = new Acceptor(host, port, processors, sendBufferSize, recvBufferSize); this.acceptors.add(plainTextAcceptor); Utils.newThread("ambry-acceptor", plainTextAcceptor, false).start(); Iterator<Port> portIterator = ports.iterator(); while (portIterator.hasNext()) { <START> Port extraPort = portIterator.next(); <END> if (extraPort.getPortType() == PortType.SSL) { SSLAcceptor sslAcceptor = new SSLAcceptor(host, extraPort.getPortNo(), processors, sendBufferSize, recvBufferSize); acceptors.add(sslAcceptor); Utils.newThread("ambry-sslacceptor", sslAcceptor, false).start(); } } for (Acceptor acceptor : acceptors) { acceptor.awaitStartup(); } logger.info("Started server"); }</code><technical_language>port fine instead of extraPort</technical_language>

Target:
public void start() throws IOException, InterruptedException { logger.info("Starting processor threads", numProcessorThreads); for (int i = 0; i < numProcessorThreads; i++) { processors.add(i, new Processor(i, maxRequestSize, requestResponseChannel, metrics)); Utils.newThread("ambry-processor-" + port + " " + i, processors.get(i), false).start(); } requestResponseChannel.addResponseListener(new ResponseListener() { @Override public void onResponse(int processorId) { processors.get(processorId).wakeup(); } }); logger.info("Starting acceptor threads"); Acceptor plainTextAcceptor = new Acceptor(host, port, processors, sendBufferSize, recvBufferSize, metrics); this.acceptors.add(plainTextAcceptor); Utils.newThread("ambry-acceptor", plainTextAcceptor, false).start(); Port sslPort = ports.get(PortType.SSL); if (sslPort != null) { SSLAcceptor sslAcceptor = new SSLAcceptor(host, sslPort.getPort(), processors, sendBufferSize, recvBufferSize, metrics); acceptors.add(sslAcceptor); Utils.newThread("ambry-sslacceptor", sslAcceptor, false).start(); } for (Acceptor acceptor : acceptors) { acceptor.awaitStartup(); } logger.info("Started server"); }
Source:
<code>private HealthStatusReport healthStateOfTimeLock( Map<String, ServiceFeedback> organizedFeedbackByServiceName) { int maxAllowedUnhealthyServices = getMaxAllowedUnhealthyServices(organizedFeedbackByServiceName.size()); List<Client> unhealthyClients = KeyedStream.stream(organizedFeedbackByServiceName) .filterEntries((serviceName, serviceFeedback) -> getHealthStatusForService(serviceFeedback) == HealthStatus.UNHEALTHY) .keys() .map(serviceName -> Client.of(serviceName)) .collect(Collectors.toList()); log.info("List of services on which TimeLock is unhealthy - {}", <START> SafeArg.of("unhealthyClients", (Object) unhealthyClients)); <END> if (unhealthyClients.size() > maxAllowedUnhealthyServices) { return ImmutableHealthStatusReport .builder() .status(HealthStatus.UNHEALTHY) .unhealthyClients(unhealthyClients) .message(String.format("TimeLock is unhealthy as %d of %d clients are unhealthy" + ". The highest acceptable number of unhealthy clients is - %d", unhealthyClients.size(), organizedFeedbackByServiceName.size(), maxAllowedUnhealthyServices)) .build(); } return ImmutableHealthStatusReport.builder().status(HealthStatus.HEALTHY).build(); }</code><technical_language>nit: cast Object unnecessary</technical_language>

Target:
private HealthStatusReport healthStateOfTimeLock( Map<String, ServiceFeedback> organizedFeedbackByServiceName) { int maxAllowedUnhealthyServices = getMaxAllowedUnhealthyServices(organizedFeedbackByServiceName.size()); List<Client> unhealthyClients = KeyedStream.stream(organizedFeedbackByServiceName) .filterEntries((serviceName, serviceFeedback) -> getHealthStatusForService(serviceFeedback) == HealthStatus.UNHEALTHY) .keys() .map(serviceName -> Client.of(serviceName)) .collect(Collectors.toList()); log.info("List of services on which TimeLock is unhealthy - {}", SafeArg.of("unhealthyClients", unhealthyClients)); if (unhealthyClients.size() > maxAllowedUnhealthyServices) { return ImmutableHealthStatusReport .builder() .status(HealthStatus.UNHEALTHY) .unhealthyClients(unhealthyClients) .message(String.format("TimeLock is unhealthy as %d of %d clients are unhealthy" + ". The highest acceptable number of unhealthy clients is - %d", unhealthyClients.size(), organizedFeedbackByServiceName.size(), maxAllowedUnhealthyServices)) .build(); } return ImmutableHealthStatusReport.builder().status(HealthStatus.HEALTHY).build(); }
Source:
<code>public void onEntityDamageByEntity(EntityDamageByEntityEvent event) { if (event.getEntity() instanceof Player) { if (event.getDamager() instanceof Player) { Player player = (Player) event.getDamager(); if (player.getGameMode() == GameMode.CREATIVE) { TFM_Util.playerMsg(player, "Creative mode pvp is prohibited.", ChatColor.DARK_RED); event.setCancelled(true); } } if (event.getDamager() instanceof Arrow) { Arrow arrow = (Arrow) event.getDamager(); if (arrow.getShooter() instanceof Player) { Player player = (Player) arrow.getShooter(); if (player.getGameMode() == GameMode.CREATIVE) { <START> TFM_Util.playerMsg(player, "Creative/Godmode pvp is prohibited.", ChatColor.DARK_RED); <END> event.setCancelled(true); } } } } }</code><technical_language>Inconsistent message</technical_language>

Target:
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) { if (event.getEntity() instanceof Player) { if (event.getDamager() instanceof Player) { Player player = (Player) event.getDamager(); if (player.getGameMode() == GameMode.CREATIVE) { TFM_Util.playerMsg(player, "Creative mode pvp is prohibited.", ChatColor.DARK_RED); event.setCancelled(true); } } if (event.getDamager() instanceof Arrow) { Arrow arrow = (Arrow) event.getDamager(); if (arrow.getShooter() instanceof Player) { Player player = (Player) arrow.getShooter(); if (player.getGameMode() == GameMode.CREATIVE) { TFM_Util.playerMsg(player, "Creative mode pvp is prohibited.", ChatColor.DARK_RED); event.setCancelled(true); } } } } }
Source:
<code><START> public void visit(RuleAutomatonDisjunction ruleAutomatonDisjunction) { } <END></code><technical_language>empty block</technical_language>

Target:
public void visit(RuleAutomatonDisjunction ruleAutomatonDisjunction) { throw new UnsupportedOperationException(); }
Source:
<code>public void vuapResolvedStateShoulCloseAfterTapingOncloseButton(Page page, String slot, String videoIframeSelector) { final AdsBaseObject ads = openPageWithVideoInLocalStorage(page, VuapVideos.PORVATA_VAST, VuapVideos.VAST_VIDEO); final AutoplayVuap vuap = new AutoplayVuap(driver, slot, videoIframeSelector); ads.refreshPage(); vuap.replay(); vuap.pause(); <START> vuap.clickOnCloseButton(); <END> VuapAssertions.verifyVideoClosedAndReplyButtonDisplayed(vuap, MAX_AUTOPLAY_MOVIE_DURATION); }</code><technical_language>do renaming this method simple close</technical_language>

Target:
public void vuapResolvedStateShoulCloseAfterTapingOncloseButton(Page page, String slot, String videoIframeSelector) { final AdsBaseObject ads = openPageWithVideoInLocalStorage(page); final AutoplayVuap vuap = new AutoplayVuap(driver, slot, videoIframeSelector); ads.refreshPage(); vuap.replay(); vuap.pause(); vuap.close(); VuapAssertions.verifyReplyButtonDisplayedAfterVideoClose(vuap, MAX_AUTOPLAY_MOVIE_DURATION); }
Source:
<code>protected Object setSkipRemoteGetsAndInvokeNextForManyEntriesCommand(InvocationContext ctx, WriteCommand command, CompletionStage<Void> delay) { if (CompletionStages.isCompletedSuccessfully(delay)) { <START> return asyncValue(delay).thenApply(ctx, command, (rCtx, rCommand, rValue) -> <END> invokeNextAndExceptionally(ctx, command, handleManyWriteReturn)); } return invokeNextAndExceptionally(ctx, command, handleManyWriteReturn); }</code><technical_language>delay is completed</technical_language>

Target:
protected Object setSkipRemoteGetsAndInvokeNextForManyEntriesCommand(InvocationContext ctx, WriteCommand command, CompletionStage<Void> delay) { return makeStage(asyncInvokeNext(ctx, command, delay)).andExceptionally(ctx, command, handleManyWriteReturn); }