auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private List<VolumeMount> getVolumeMountsFrom(String[] volumes, String workspaceID) { List<VolumeMount> vms = new ArrayList<>(); PersistentVolumeClaim pvc = getClaimCheWorkspace(); if (pvc != null) { VolumeMount vm = new VolumeMountBuilder() <START> .withMountPath("/data") <END> .withName(persistentVolumeClaim) .build(); vms.add(vm); } else { for (String volume : volumes) { String mountPath = volume.split(":",3)[1]; String volumeName = getVolumeName(volume); VolumeMount vm = new VolumeMountBuilder() .withMountPath(mountPath) .withName("ws-" + workspaceID + "-" + volumeName) .build(); vms.add(vm); } } return vms; }</code><technical_language>please extract string "/data" a constant</technical_language>

Target:
private List<VolumeMount> getVolumeMountsFrom(String[] volumes, String workspaceID) { List<VolumeMount> vms = new ArrayList<>(); PersistentVolumeClaim pvc = getClaimCheWorkspace(); if (pvc != null) { for (String volume : volumes) { String mountPath = volume.split(":",3)[1]; if (cheWorkspaceProjectsStorage.equals(mountPath)) { String hostPath = volume.split(":",3)[0]; String subPath = hostPath.replace(cheWorkspaceStorage, ""); if (subPath.startsWith("/")) { subPath = subPath.substring(1); } VolumeMount vm = new VolumeMountBuilder() .withMountPath(mountPath) .withName(workspacesPersistentVolumeClaim) .withSubPath(subPath) .build(); vms.add(vm); } } } else { for (String volume : volumes) { String mountPath = volume.split(":",3)[1]; String volumeName = getVolumeName(volume); VolumeMount vm = new VolumeMountBuilder() .withMountPath(mountPath) .withName("ws-" + workspaceID + "-" + volumeName) .build(); vms.add(vm); } } return vms; }
Source:
<code><START> public void applyHandshakeTimeout() { <END> final ChannelPromise localHandshakePromise = handshakePromise; final long handshakeTimeoutMillis = this.handshakeTimeoutMillis; if (handshakeTimeoutMillis <= 0 || localHandshakePromise.isDone()) { return; } final ScheduledFuture<?> timeoutFuture = ctx.executor().schedule(new Runnable() { @Override public void run() { if (localHandshakePromise.isDone()) { return; } if (localHandshakePromise.tryFailure(HANDSHAKE_TIMED_OUT_EXCEPTION)) { ctx.flush() .fireUserEventTriggered(ClientHandshakeStateEvent.HANDSHAKE_TIMEOUT) .close(); } } }, handshakeTimeoutMillis, TimeUnit.MILLISECONDS); localHandshakePromise.addListener(new FutureListener<Void>() { @Override public void operationComplete(Future<Void> f) throws Exception { timeoutFuture.cancel(false); } }); }</code><technical_language>package-private class is package-private</technical_language>

Target:
private void applyHandshakeTimeout() { final ChannelPromise localHandshakePromise = handshakePromise; if (handshakeTimeoutMillis <= 0 || localHandshakePromise.isDone()) { return; } final Future<?> timeoutFuture = ctx.executor().schedule(new Runnable() { @Override public void run() { if (localHandshakePromise.isDone()) { return; } if (localHandshakePromise.tryFailure(HANDSHAKE_TIMED_OUT_EXCEPTION)) { ctx.flush() .fireUserEventTriggered(ClientHandshakeStateEvent.HANDSHAKE_TIMEOUT) .close(); } } }, handshakeTimeoutMillis, TimeUnit.MILLISECONDS); localHandshakePromise.addListener(new FutureListener<Void>() { @Override public void operationComplete(Future<Void> f) throws Exception { timeoutFuture.cancel(false); } }); }
Source:
<code>public void startTag(final String name, final Attributes atts, final Stack<String> context) { switch( name ) { case NODE: startNode(atts); break; case LINK: startLink(atts); break; case NETWORK: startNetwork(atts); break; case LINKS: startLinks(atts); break; <START> case Attributable.ATTRIBUTES: <END> case Attributable.ATTRIBUTE: attributesDelegate.startTag( name , atts , context , currentAttributes ); break; } }</code><technical_language>this from? wrong place define this. object need care is serialized. If anything, in attributesDelegate</technical_language>

Target:
public void startTag(final String name, final Attributes atts, final Stack<String> context) { switch( name ) { case NODE: startNode(atts); break; case LINK: startLink(atts); break; case NETWORK: startNetwork(atts); break; case LINKS: startLinks(atts); break; case AttributesUtils.ATTRIBUTES: case AttributesUtils.ATTRIBUTE: attributesDelegate.startTag( name , atts , context , currentAttributes ); break; } }
Source:
<code><START> public int allocate() throws IOException { <END> synchronized (Ports.class) { int attempts = 0; int prt; do { prt = random(); ++attempts; if (attempts > 100) { throw new IllegalStateException( String.format( "failed to allocate TCP port after %d attempts", attempts ) ); } } while (Ports.ASSIGNED.contains(prt)); return prt; } }</code><technical_language>@danff declared static</technical_language>

Target:
public static int allocate() throws IOException { synchronized (Ports.class) { int attempts = 0; int prt; do { prt = random(); ++attempts; if (attempts > 100) { throw new IllegalStateException( String.format( "failed to allocate TCP port after %d attempts", attempts ) ); } } while (Ports.ASSIGNED.contains(prt)); return prt; } }
Source:
<code>public FormValidation updateNow() throws IOException { List<JSONObject> jsonList = new ArrayList<>(); for (String site : getUrls()) { String jsonString; try { jsonString = loadJSONHTML(new URL(site + ".html?id=" + URLEncoder.encode(getId(), "UTF-8") + "&version=" + URLEncoder.encode(Jenkins.VERSION, "UTF-8"))); } catch (Exception e) { <START> LOGGER.warning("Could not load json from " + site); <END> continue; } JSONObject o = JSONObject.fromObject(jsonString); if (signatureCheck) { FormValidation e = new JSONSignatureValidator("downloadable '"+id+"'").verifySignature(o); if (e.kind!= Kind.OK) { continue; } } jsonList.add(o); } if (jsonList.size() == 0) { return FormValidation.warning("None of the Update Sites passed the signature check"); } JSONObject reducedJson = reduce(jsonList); return load(reducedJson.toString(), System.currentTimeMillis()); }</code><technical_language>add exception? :ant: FindBugs complain ineffective string concat</technical_language>

Target:
public FormValidation updateNow() throws IOException { List<JSONObject> jsonList = new ArrayList<>(); for (String site : getUrls()) { String jsonString; try { jsonString = loadJSONHTML(new URL(site + ".html?id=" + URLEncoder.encode(getId(), "UTF-8") + "&version=" + URLEncoder.encode(Jenkins.VERSION, "UTF-8"))); } catch (Exception e) { LOGGER.log(Level.WARNING, "Could not load json from " + site, e ); continue; } JSONObject o = JSONObject.fromObject(jsonString); if (signatureCheck) { FormValidation e = new JSONSignatureValidator("downloadable '"+id+"'").verifySignature(o); if (e.kind!= Kind.OK) { continue; } } jsonList.add(o); } if (jsonList.size() == 0) { return FormValidation.warning("None of the Update Sites passed the signature check"); } JSONObject reducedJson = reduce(jsonList); return load(reducedJson.toString(), System.currentTimeMillis()); }
Source:
<code>private void handleTimeZone() { <START> TimeZoneType timeZoneType = OsRepositoryImpl.INSTANCE.isWindows(getVm().getOs()) ? TimeZoneType.WINDOWS_TIMEZONE : TimeZoneType.GENERAL_TIMEZONE; <END> if (getVm().getTimeZone() != null && !timeZoneType.getTimeZoneList().containsKey(getVm().getTimeZone())) { log.warnFormat("ResourceManager::{0}::Attempting to run VM {1} with incorrect timezone '{2}'. Resetting timezone to engine default.", getClass().getName(), getVmId().toString(), getVm().getTimeZone()); getVm().getStaticData().setTimeZone(null); getVmStaticDAO().update(getVm().getStaticData()); } }</code><technical_language>pls move OsRepositoryImpl a field (my fault I do before) OsRepositoy osRepository = SimpleDependecyInjector.getInstance().get(OsRepository.class)</technical_language>

Target:
private void handleTimeZone() { if (!isVmTimeZoneValid(getVm())) { log.warnFormat("ResourceManager::{0}::Attempting to run VM {1} with incorrect timezone '{2}'. Resetting timezone to engine default.", getClass().getName(), getVmId().toString(), getVm().getTimeZone()); getVm().getStaticData().setTimeZone(null); if (!getVm().isRunOnce()) { getVmStaticDAO().update(getVm().getStaticData()); } } }
Source:
<code>public Vm update(Vm incoming) { validateParameters(incoming); if (incoming.isSetCluster() && (incoming.getCluster().isSetId() || incoming.getCluster().isSetName())) { Guid clusterId = lookupClusterId(incoming); if(!clusterId.toString().equals(get().getCluster().getId())){ performAction(VdcActionType.ChangeVMCluster, new ChangeVMClusterParameters(clusterId, guid, null)); } } if (!isFiltered()) { if (incoming.isSetPlacementPolicy()) { parent.validateAndUpdateHostsInPlacementPolicy(incoming.getPlacementPolicy()); } } else { incoming.setPlacementPolicy(null); } Vm vm = performUpdate( incoming, new QueryIdResolver<>(VdcQueryType.GetVmByVmId, IdQueryParameters.class), VdcActionType.UpdateVm, new UpdateParametersProvider() ); if (isNextRunRequested()) { org.ovirt.engine.core.common.businessentities.VM entity = getEntity(org.ovirt.engine.core.common.businessentities.VM.class, VdcQueryType.GetVmNextRunConfiguration, new IdQueryParameters(guid), id, true); vm = addLinks(populate(VmMapper.map(entity, null, false), entity)); <START> } <END> if (vm != null) { DisplayHelper.adjustDisplayData(this, vm, false); removeRestrictedInfo(vm); } return vm; }</code><technical_language>flag indicating next run configuration is requested is passed backend, 'UpdateParametersProvider' class. I is in backend tested. 'UpdateVm' command return next run data, need changed here</technical_language>

Target:
public Vm update(Vm incoming) { validateParameters(incoming); if (incoming.isSetCluster() && (incoming.getCluster().isSetId() || incoming.getCluster().isSetName())) { Guid clusterId = lookupClusterId(incoming); if(!clusterId.toString().equals(get().getCluster().getId())){ performAction(VdcActionType.ChangeVMCluster, new ChangeVMClusterParameters(clusterId, guid, null)); } } if (!isFiltered()) { if (incoming.isSetPlacementPolicy()) { parent.validateAndUpdateHostsInPlacementPolicy(incoming.getPlacementPolicy()); } } else { incoming.setPlacementPolicy(null); } Vm vm = performUpdate( incoming, new QueryIdResolver<>(VdcQueryType.GetVmNextRunConfiguration, IdQueryParameters.class), VdcActionType.UpdateVm, new UpdateParametersProvider() ); if (vm != null) { DisplayHelper.adjustDisplayData(this, vm, false); removeRestrictedInfo(vm); } return vm; }
Source:
<code>public void validate(TokenCredentials credentials) { CommonHelper.assertNotBlank("secret", secret); final String token = credentials.getToken(); boolean verified = false; SignedJWT signedJWT = null; try { JWT jwt = JWTParser.parse(token); if (jwt instanceof SignedJWT) { signedJWT = (SignedJWT) jwt; } else if (jwt instanceof EncryptedJWT) { <START> JWEObject jweObject = JWEObject.parse(token); <END> jweObject.decrypt(new DirectDecrypter(this.secret.getBytes("UTF-8"))); signedJWT = jweObject.getPayload().toSignedJWT(); } else { throw new TechnicalException("unsupported unsecured jwt"); } verified = signedJWT.verify(new MACVerifier(this.secret)); } catch (final Exception e) { throw new TechnicalException("Cannot decrypt / verify JWT", e); } if (!verified) { final String message = "JWT verification failed: " + token; throw new CredentialsException(message); } try { final JWTClaimsSet claimSet = signedJWT.getJWTClaimsSet(); final UserProfile profile = ProfileHelper.buildProfile(claimSet.getSubject(), claimSet.getClaims()); credentials.setUserProfile(profile); } catch (final Exception e) { throw new TechnicalException("Cannot get claimSet", e); } }</code><technical_language>token parsed once? get object jwt</technical_language>

Target:
public void validate(TokenCredentials credentials) { CommonHelper.assertNotBlank("secret", secret); final String token = credentials.getToken(); boolean verified = false; SignedJWT signedJWT = null; try { JWT jwt = JWTParser.parse(token); if (jwt instanceof SignedJWT) { signedJWT = (SignedJWT) jwt; } else if (jwt instanceof EncryptedJWT) { JWEObject jweObject = (JWEObject) jwt; jweObject.decrypt(new DirectDecrypter(this.secret.getBytes("UTF-8"))); signedJWT = jweObject.getPayload().toSignedJWT(); } else { throw new TechnicalException("unsupported unsecured jwt"); } verified = signedJWT.verify(new MACVerifier(this.secret)); } catch (final Exception e) { throw new TechnicalException("Cannot decrypt / verify JWT", e); } if (!verified) { final String message = "JWT verification failed: " + token; throw new CredentialsException(message); } try { final JWTClaimsSet claimSet = signedJWT.getJWTClaimsSet(); final UserProfile profile = ProfileHelper.buildProfile(claimSet.getSubject(), claimSet.getClaims()); credentials.setUserProfile(profile); } catch (final Exception e) { throw new TechnicalException("Cannot get claimSet", e); } }
Source:
<code>private JobTreeElement[] findJobsToRemove(JobTreeElement info) { if (info.isJobInfo()) { Job myJob = ((JobInfo) info).getJob(); if (myJob != null) { Object prop = myJob <START> .getProperty(ProgressManagerUtil.KEEPONE_PROPERTY); <END> if (prop instanceof Boolean && ((Boolean) prop).booleanValue()) { ArrayList found = null; JobTreeElement[] all; all = (JobTreeElement[]) keptjobinfos.toArray(new JobTreeElement[keptjobinfos.size()]); for (JobTreeElement jte : all) { if (jte != info && jte.isJobInfo()) { Job job = ((JobInfo) jte).getJob(); if (job != null && job != myJob && job.belongsTo(myJob)) { if (found == null) { found = new ArrayList(); } found.add(jte); } } } if (found != null) { return (JobTreeElement[]) found .toArray(new JobTreeElement[found.size()]); } } } } return null; }</code><technical_language>Fit in line</technical_language>

Target:
private JobTreeElement[] findJobsToRemove(JobTreeElement info) { if (info.isJobInfo()) { Job myJob = ((JobInfo) info).getJob(); if (myJob != null) { Object prop = myJob.getProperty(ProgressManagerUtil.KEEPONE_PROPERTY); if (prop instanceof Boolean && ((Boolean) prop).booleanValue()) { ArrayList found = null; JobTreeElement[] all; all = (JobTreeElement[]) keptjobinfos.toArray(new JobTreeElement[keptjobinfos.size()]); for (JobTreeElement jobTreeElement : all) { if (jobTreeElement != info && jobTreeElement.isJobInfo()) { Job job = ((JobInfo) jobTreeElement).getJob(); if (job != null && job != myJob && job.belongsTo(myJob)) { if (found == null) { found = new ArrayList(); } found.add(jobTreeElement); } } } if (found != null) { return (JobTreeElement[]) found .toArray(new JobTreeElement[found.size()]); } } } } return null; }
Source:
<code>protected void executeQueryCommand() { Map<String, Network> clusterNetworksByName = networkDao.getAllForCluster(getParameters().getId()) .stream() .collect(Collectors.toMap(Network::getName, Function.identity())); <START> boolean isOutOfSync = interfaceDao.getAllInterfacesByClusterId(getParameters().getId()) <END> .stream() .filter(iface -> Objects.nonNull(clusterNetworksByName.get(iface.getNetworkName()))) .map(iface -> util.calculateNetworkImplementationDetails(iface, clusterNetworksByName.get(iface.getNetworkName()))) .filter(Objects::nonNull) .anyMatch(implementationDetails -> implementationDetails.isManaged() && !implementationDetails.isInSync()); getQueryReturnValue().setReturnValue(isOutOfSync); }</code><technical_language>talk reusing code of SyncAllHostNetworksCommand? a util for 'getUnSyncNetworkAttachmentsByHost'</technical_language>

Target:
protected void executeQueryCommand() { Map<String, Network> clusterNetworksByName = networkDao.getAllForCluster(getParameters().getId()) .stream() .collect(Collectors.toMap(Network::getName, Function.identity())); boolean isOutOfSync = interfaceDao.getAllInterfacesByClusterId(getParameters().getId()) .stream() .map(iface -> util.calculateNetworkImplementationDetails(iface, clusterNetworksByName.get(iface.getNetworkName()))) .filter(Objects::nonNull) .anyMatch(implementationDetails -> implementationDetails.isManaged() && !implementationDetails.isInSync()); getQueryReturnValue().setReturnValue(isOutOfSync); }
Source:
<code>public static String getStatusMessageColor(String statusMessage) { try { StatusMessageColor color = getStatusMessageColorsList().get(StringHelper.removeVariables(statusMessage)); switch (color) { case SUCCESS: return "success"; case WARNING: return "warning"; case DANGER: return "danger"; case INFO: default: return "info"; } <START> } catch (Exception e) { <END> return "info"; } }</code><technical_language>Swallowing a totally unexpected exception pretending happened is good. assertion here</technical_language>

Target:
public static String getStatusMessageColor(String statusMessage) { try { StatusMessageColor color = getStatusMessageColorsList().get(StringHelper.removeVariables(statusMessage)); switch (color) { case SUCCESS: return "success"; case WARNING: return "warning"; case DANGER: return "danger"; case INFO: default: return "info"; } } catch (Exception e) { assert false : Const.StatusCodes.STATUS_MESSAGE_NOT_FOUND_IN_HASHMAP; return "info"; } }
Source:
<code>private void resumeSuspended(final Collection<TopicPartition> assignment) { final Set<TaskId> suspendedTasks = partitionsToTaskSet(assignment); suspendedTasks.removeAll(addedActiveTasks.keySet()); final List<TopicPartition> closedTaskChangelogs = new ArrayList<>(); for (final TaskId taskId : suspendedTasks) { final Set<TopicPartition> partitions = assignedActiveTasks.get(taskId); try { if (!active.maybeResumeSuspendedTask(taskId, partitions, closedTaskChangelogs)) { addedActiveTasks.put(taskId, partitions); } } catch (final StreamsException e) { log.error("Failed to resume an active task due to the following error:", taskId, e); throw e; } } if (!closedTaskChangelogs.isEmpty()) { changelogReader.remove(closedTaskChangelogs); <START> if (!restoreConsumerAssignedStandbys) { <END> final Set<TopicPartition> updatedAssignment = new HashSet<>(restoreConsumer.assignment()); updatedAssignment.removeAll(closedTaskChangelogs); restoreConsumer.assign(updatedAssignment); } } }</code><technical_language>right, code-wise if current restore consumer contains partitions of standby tasks updatedAssignment.removeAll(closedTaskChangelogs); a no-op updatedAssignment of closedTaskChangelogs (well, assign active standby of task thread, is worse)</technical_language>

Target:
private void resumeSuspended(final Collection<TopicPartition> assignment) { final Set<TaskId> suspendedTasks = partitionsToTaskSet(assignment); suspendedTasks.removeAll(addedActiveTasks.keySet()); for (final TaskId taskId : suspendedTasks) { final Set<TopicPartition> partitions = assignedActiveTasks.get(taskId); try { if (!active.maybeResumeSuspendedTask(taskId, partitions)) { addedActiveTasks.put(taskId, partitions); } } catch (final StreamsException e) { log.error("Failed to resume an active task due to the following error:", taskId, e); throw e; } } }
Source:
<code>protected void executeVmCommand() { super.executeVmCommand(); if (getReturnValue().getSucceeded() && getParameters().isEdited()) { editedVM.setId(getVmId()); editedVM.setVmCreationDate(getVm().getVmCreationDate()); editedVM.setCreatedByUserId(getVm().getCreatedByUserId()); getParameters().setVm(editedVM); getParameters().setVmId(editedVM.getId()); ActionReturnValue returnValue = runInternalAction( ActionType.UpdateVm, <START> getParameters()); <END> returnValue.setActionReturnValue(getReturnValue().getActionReturnValue()); setReturnValue(returnValue); } }</code><technical_language>parameters modified command. So, if need pass parameters a subcommand, need copy them</technical_language>

Target:
protected void executeVmCommand() { super.executeVmCommand(); if (getReturnValue().getSucceeded() && getParameters().isEdited()) { ActionReturnValue returnValue = runInternalAction( ActionType.UpdateVm, createUpdateVmParameters(), createUpdateVmContext(editedVM.getStaticData())); returnValue.setActionReturnValue(getReturnValue().getActionReturnValue()); setReturnValue(returnValue); } }
Source:
<code><START> public Class<? extends PayoutEvent> getEventClass() { <END> return eventClass; }</code><technical_language>this return optional event class</technical_language>

Target:
public Optional<Class<? extends PayoutEvent>> getEventClass() { return Optional.ofNullable(eventClass); }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } <START> final IdleCost idleCost = (IdleCost) o; <END> return Objects.equals(machine, idleCost.machine) && activePeriodAfterIdle == idleCost.activePeriodAfterIdle && cost == idleCost.cost; }</code><technical_language>nitpick: other variable name</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final IdleCost other = (IdleCost) o; return Objects.equals(machine, other.machine) && activePeriodAfterIdle == other.activePeriodAfterIdle && cost == other.cost; }
Source:
<code>MetastoreErrorCode(int code, ErrorType type) { <START> errorCode = new ErrorCode(code + 0x0100_0000, name(), type); <END> }</code><technical_language>0x0100_0000 a constant in MetastoreErrorCode HiveErrorCode</technical_language>

Target:
MetastoreErrorCode(int code, ErrorType type) { errorCode = new ErrorCode(code + ERROR_CODE_MASK, name(), type); }
Source:
<code>public static <T> GenericIndexed<T> read(ByteBuffer buffer, ObjectStrategy<T> strategy) { byte versionFromBuffer = buffer.get(); if (version_one == versionFromBuffer) { return createVersionOneGenericIndexed(buffer, strategy); } else if (version_three == versionFromBuffer) { throw new IAE( "use read(ByteBuffer buffer, ObjectStrategy<T> strategy, SmooshedFileMapper fileMapper) to read version 3 indexed.", versionFromBuffer ); } throw new IAE("Unknown version[%s]", versionFromBuffer); <START> } <END></code><technical_language>this read(buffer,strategy,null) error msg updated in other read if necessary.</technical_language>

Target:
public static <T> GenericIndexed<T> read(ByteBuffer buffer, ObjectStrategy<T> strategy) { byte versionFromBuffer = buffer.get(); if (VERSION_ONE == versionFromBuffer) { return createVersionOneGenericIndexed(buffer, strategy); } else if (VERSION_TWO == versionFromBuffer) { throw new IAE( "use read(ByteBuffer buffer, ObjectStrategy<T> strategy, SmooshedFileMapper fileMapper)" + " to read version 2 indexed.", versionFromBuffer ); } throw new IAE("Unknown version[%s]", versionFromBuffer); }
Source:
<code>public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final ArArchiveEntry other = (ArArchiveEntry) obj; if (name == null) { return other.name == null; <START> } else return name.equals(other.name); <END> }</code><technical_language>please add braces for else block</technical_language>

Target:
public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } final ArArchiveEntry other = (ArArchiveEntry) obj; if (name == null) { return other.name == null; } else { return name.equals(other.name); } }
Source:
<code>private void checkViolations(final H canvasHandler, final Collection<DiagramElementViolation<RuleViolation>> elementViolations) { final String uuid = canvasHandler.getUuid(); final Diagram diagram = canvasHandler.getDiagram(); final String name = diagram.getName(); final String title = diagram.getMetadata().getTitle(); final boolean[] valid = {true}; elementViolations .stream() <START> .filter(v -> v.getDomainViolations().stream().map(DomainViolation::getMessage).anyMatch(StringUtils::nonEmpty) <END> || v.getGraphViolations().stream().map(ElementViolation::getMessage).anyMatch(StringUtils::nonEmpty) || v.getModelViolations().stream().map(ModelBeanViolation::getMessage).anyMatch(StringUtils::nonEmpty)) .forEach(v -> { if (checkViolation(canvasHandler, v)) { valid[0] = false; } }); if (valid[0]) { validationSuccessEvent.fire(new CanvasValidationSuccessEvent(uuid, name, title)); } else { validationFailEvent.fire(new CanvasValidationFailEvent(uuid, name, title, elementViolations)); } }</code><technical_language>A refactoring of this filtering conditions v.getDomainViolations().stream().map(DomainViolation::getMessage).anyMatch(StringUtils::nonEmpty) nice</technical_language>

Target:
private void checkViolations(final H canvasHandler, final Collection<DiagramElementViolation<RuleViolation>> elementViolations) { final String uuid = canvasHandler.getUuid(); final Diagram diagram = canvasHandler.getDiagram(); final String name = diagram.getName(); final String title = diagram.getMetadata().getTitle(); final boolean valid = elementViolations .stream() .flatMap(v -> Stream.of(v.getDomainViolations(), v.getGraphViolations(), v.getModelViolations())) .flatMap(Collection::stream) .filter(v -> v instanceof ElementViolation) .map(v -> (ElementViolation) v) .map(v -> applyViolation(canvasHandler, v)) .anyMatch(Boolean.FALSE::equals); if (valid) { validationSuccessEvent.fire(new CanvasValidationSuccessEvent(uuid, name, title)); } else { validationFailEvent.fire(new CanvasValidationFailEvent(uuid, name, title, elementViolations)); } }
Source:
<code>public int compareTo(InsightCard o) { final InsightCard compareObject = (InsightCard) o; final DateTime compareTimestamp = compareObject.timestamp; final DateTime objectTimestamp = this.timestamp; <START> return (int) (objectTimestamp.getMillis() - compareTimestamp.getMillis()); END> }</code><technical_language>a good idea Guava's comparator. Disclaimer: myself. java return ComparisonChain.start() .compare(this.timetamp, that.timestamp) .result();</technical_language>

Target:
public int compareTo(InsightCard o) { final InsightCard compareObject = (InsightCard) o; return ComparisonChain.start() .compare(this.timestamp, compareObject.timestamp) .result(); }
Source:
<code>public String getNoResponseTextInHtml(String giverEmail, String recipientEmail, FeedbackSessionResultsBundle bundle, FeedbackQuestionAttributes question) { StringBuilder noResponseHtml = new StringBuilder(); noResponseHtml.append("<i>").append(Const.INSTRUCTOR_FEEDBACK_RESULTS_MISSING_RESPONSE).append("</i>"); if (giverEmail.equals(recipientEmail) && hasPerceivedContribution(recipientEmail, question, bundle)) { noResponseHtml.append(getPerceivedContributionHtml(question, recipientEmail, bundle)); } <START> return noResponseHtml.toString(); <END> }</code><technical_language>also, I shortened this: java return "<i>" + Const.* + "<i>" + (condition ? getPerceivedContributionHtml(...) : ""); if more readable way, though</technical_language>

Target:
public String getNoResponseTextInHtml(String giverEmail, String recipientEmail, FeedbackSessionResultsBundle bundle, FeedbackQuestionAttributes question) { boolean isPerceivedContributionShown = giverEmail.equals(recipientEmail) && hasPerceivedContribution(recipientEmail, question, bundle); return "<i>" + Const.INSTRUCTOR_FEEDBACK_RESULTS_MISSING_RESPONSE + "</i>" + (isPerceivedContributionShown ? getPerceivedContributionHtml(question, recipientEmail, bundle) : ""); }
Source:
<code>public static void dropItems(final Block block, final Collection<ItemStack> items) { for (final ItemStack item : items) { if(item.getType() != Material.AIR) { <START> block.getWorld().dropItem(block.getLocation(), item);continue; <END> } } }</code><technical_language>split this line multiple lines pesant</technical_language>

Target:
public static void dropItems(final Block block, final Collection<ItemStack> items) { for (final ItemStack item : items) { if(item.getType() != Material.AIR) { block.getWorld().dropItem(block.getLocation(), item); } } }
Source:
<code>public void delegatesLockRequest() { <START> LockRequest lockRequest = mock(LockRequest.class); <END> when(timelockService.leasableLock(lockRequest)).thenReturn( LeasableLockResponse.of(LOCK_RESPONSE, getLease())); timelockClient.lock(lockRequest); verify(timelockService).leasableLock(lockRequest); }</code><technical_language>mock() static method, instead add @RunWith(MockitoJUnitRunner.class) class create mocks fields, @Mock private LockRequest lockRequest; why? Mockito if mocking unnecessarily (i.e. get called), is a sign of bugs</technical_language>

Target:
public void delegatesLockRequest() { when(timelockRpcClient.lockV2(lockRequest)).thenReturn( LeasableLockResponse.of(LOCK_RESPONSE, getLease())); timelockService.lock(lockRequest); }
Source:
<code>private CompletableFuture<Void> doDelete(String name) throws InfrastructureException { try { final PodResource<Pod, DoneablePod> podResource = clientFactory.create().pods().inNamespace(namespace).withName(name); final CompletableFuture<Void> deleteFuture = new CompletableFuture<>(); final Watch watch = podResource.watch(new DeleteWatcher(deleteFuture)); podResource.delete(); return deleteFuture .thenAccept((v) -> watch.close()) .exceptionally( <START> e -> { <END> watch.close(); return null; }); } catch (KubernetesClientException ex) { throw new InfrastructureException(ex.getMessage(), ex); } }</code><technical_language>log exception</technical_language>

Target:
private CompletableFuture<Void> doDelete(String name) throws InfrastructureException { try { final PodResource<Pod, DoneablePod> podResource = clientFactory.create().pods().inNamespace(namespace).withName(name); final CompletableFuture<Void> deleteFuture = new CompletableFuture<>(); final Watch watch = podResource.watch(new DeleteWatcher(deleteFuture)); podResource.delete(); return deleteFuture.handle( (v, e) -> { if (e != null) { LOG.warn("Failed to remove pod cause {}", name, e.getMessage()); } watch.close(); return null; }); } catch (KubernetesClientException ex) { throw new InfrastructureException(ex.getMessage(), ex); } }
Source:
<code>XmlManifest(RepoCommand command, IncludedFileReader includedReader, String filename, String baseUrl, String groups) { this.command = command; this.includedReader = includedReader; this.filename = filename; <START> this.xmlInRead = 0; <END> int lastIndex = baseUrl.length() - 1; while (lastIndex >= 0 && baseUrl.charAt(lastIndex) == '/') lastIndex--; this.baseUrl = baseUrl.substring(0, lastIndex + 1); remotes = new HashMap<String, String>(); projects = new ArrayList<Project>(); plusGroups = new HashSet<String>(); minusGroups = new HashSet<String>(); if (groups == null || groups.length() == 0 || groups.equals("default")) { minusGroups.add("notdefault"); } else { for (String group : groups.split(",")) { if (group.startsWith("-")) minusGroups.add(group.substring(1)); else plusGroups.add(group); } } }</code><technical_language>0 is default for int field. do assignments default values in constructors</technical_language>

Target:
XmlManifest(RepoCommand command, IncludedFileReader includedReader, String filename, String baseUrl, String groups) { this.command = command; this.includedReader = includedReader; this.filename = filename; int lastIndex = baseUrl.length() - 1; while (lastIndex >= 0 && baseUrl.charAt(lastIndex) == '/') lastIndex--; this.baseUrl = baseUrl.substring(0, lastIndex + 1); remotes = new HashMap<String, String>(); projects = new ArrayList<Project>(); plusGroups = new HashSet<String>(); minusGroups = new HashSet<String>(); if (groups == null || groups.length() == 0 || groups.equals("default")) { minusGroups.add("notdefault"); } else { for (String group : groups.split(",")) { if (group.startsWith("-")) minusGroups.add(group.substring(1)); else plusGroups.add(group); } } }
Source:
<code><START> default Validation<T, Seq<? extends E>> swap() { <END> if (isInvalid()) { final Seq<? extends E> error = this.getErrors(); return Validation.valid(error); } else { final T value = this.get(); return Validation.invalid(value); } }</code><technical_language>simplified java default Validation<T, Seq<E>> swap()</technical_language>

Target:
default Validation<T, Seq<E>> swap() { if (isInvalid()) { return Validation.valid(this.getErrors()); } else { final T value = this.get(); return Validation.invalid(value); } }
Source:
<code>public static String convertIP6Address(byte[] bytes) throws KuraException { if ((bytes == null) || (bytes.length != 16)) { <START> throw new KuraException(KuraErrorCode.INVALID_PARAMETER); <END> } String[] items = new String[8]; for (int i = 0; i < 8; i++) { int k = i * 2; int value = (bytes[k] << 8) & 0xFF00; value |= bytes[k + 1] & 0xFF; items[i] = Integer.toHexString(value); } String ipAddress = String.join(":", items); return ipAddress; }</code><technical_language>Runtime</technical_language>

Target:
public static String convertIP6Address(byte[] bytes) { if ((bytes == null) || (bytes.length != 16)) { throw new IllegalArgumentException("bytes is null or invalid"); } String[] items = new String[8]; for (int i = 0; i < 8; i++) { int k = i * 2; int value = (bytes[k] << 8) & 0xFF00; value |= bytes[k + 1] & 0xFF; items[i] = Integer.toHexString(value); } return String.join(":", items); }
Source:
<code>public boolean test(Matrix matrix) { <START> return matrix.rows() == matrix.columns() && matrix.determinant() != 0; <END> }</code><technical_language>0.0 instead of 0</technical_language>

Target:
public boolean test(Matrix matrix) { return matrix.rows() == matrix.columns() && matrix.determinant() != 0.0; }
Source:
<code>public void setProposals(ArrayList<Proposal> proposals) { this.proposals = proposals; int c = 0; String[] items = new String[proposals.size()]; <START> for (Proposal proposal : proposals) { <END> items[c++] = proposal.getDescription(); } list.setItems(items); }</code><technical_language>"normal" for-loop here?! If not, c renamed</technical_language>

Target:
public void setProposals(ArrayList<Proposal> proposals) { this.proposals = proposals; String[] proposalDescriptions = new String[proposals.size()]; for (int i = 0; i < proposals.size(); i++) { proposalDescriptions[i] = proposals.get(i).getDescription(); } list.setItems(proposalDescriptions); }
Source:
<code>private AuthorizationResponse.Reason getReason(AuthsResponse authsResponse) { AuthorizationResponse.Reason reason; if (authsResponse.getReason() == null) { reason = null; } else if (authsResponse.getReason().equals("APPROVED")) { reason = AuthorizationResponse.Reason.APPROVED; } else if (authsResponse.getReason().equals("DISAPPROVED")) { reason = AuthorizationResponse.Reason.DISAPPROVED; } else if (authsResponse.getReason().equals("FRAUDULENT")) { reason = AuthorizationResponse.Reason.FRAUDULENT; } else if (authsResponse.getReason().equals("POLICY")) { reason = AuthorizationResponse.Reason.POLICY; } else if (authsResponse.getReason().equals("PERMISSION")) { reason = AuthorizationResponse.Reason.PERMISSION; } else if (authsResponse.getReason().equals("AUTHENTICATION")) { reason = AuthorizationResponse.Reason.AUTHENTICATION; } else if (authsResponse.getReason().equals("CONFIGURATION")) { reason = AuthorizationResponse.Reason.CONFIGURATION; } else if (authsResponse.getReason().equals("BUSY_LOCAL")) { reason = AuthorizationResponse.Reason.BUSY_LOCAL; <START> } else { <END> reason = AuthorizationResponse.Reason.OTHER; } return reason; }</code><technical_language>a hard requirement, in Python .NET SDK added new SENSOR auth method type in process of adding AMI. add too</technical_language>

Target:
private AuthorizationResponse.Reason getReason(AuthsResponse authsResponse) { AuthorizationResponse.Reason reason; if (authsResponse.getReason() == null) { reason = null; } else if (authsResponse.getReason().equals("APPROVED")) { reason = AuthorizationResponse.Reason.APPROVED; } else if (authsResponse.getReason().equals("DISAPPROVED")) { reason = AuthorizationResponse.Reason.DISAPPROVED; } else if (authsResponse.getReason().equals("FRAUDULENT")) { reason = AuthorizationResponse.Reason.FRAUDULENT; } else if (authsResponse.getReason().equals("POLICY")) { reason = AuthorizationResponse.Reason.POLICY; } else if (authsResponse.getReason().equals("PERMISSION")) { reason = AuthorizationResponse.Reason.PERMISSION; } else if (authsResponse.getReason().equals("AUTHENTICATION")) { reason = AuthorizationResponse.Reason.AUTHENTICATION; } else if (authsResponse.getReason().equals("CONFIGURATION")) { reason = AuthorizationResponse.Reason.CONFIGURATION; } else if (authsResponse.getReason().equals("BUSY_LOCAL")) { reason = AuthorizationResponse.Reason.BUSY_LOCAL; } else if (authsResponse.getReason().equals("SENSOR")) { reason = AuthorizationResponse.Reason.SENSOR; } else { reason = AuthorizationResponse.Reason.OTHER; } return reason; }
Source:
<code>protected boolean isLineInteresting(final String line) { <START> return line.contains("Warning") || line.contains("Error") || line.contains("Remark") || line.contains("Fatal Error"); <END> }</code><technical_language>Unneccessary</technical_language>

Target:
protected boolean isLineInteresting(final String line) { return line.contains("Warning") || line.contains("rror") || line.contains("Remark") || line.contains("["); }
Source:
<code>public int getIndex(final ReadableTable tb, final int[] key, final int row) { final long hashcode = HashUtils.hashSubRowLong(tb, key, row); int index = keyHashCodesToIndexes.getIfAbsent(hashcode, ABSENT_VALUE); if (index == ABSENT_VALUE) { return -1; } if (index == COLLIDING_KEY) { IntArrayList collidingIndexes = collidingKeyHashCodesToIndexes.get(hashcode); Preconditions.checkNotNull(collidingIndexes); Preconditions.checkState(collidingIndexes.size() > 1); IntIterator iter = collidingIndexes.intIterator(); while (iter.hasNext()) { int idx = iter.next(); if (TupleUtils.tupleEquals(tb, key, row, data, keyColumns, idx)) { return idx; } } assert false; } <START> return index; <END> }</code><technical_language>if hash code exists (so ABSENT_VALUE) key not? return index of another key hash code</technical_language>

Target:
public int getIndex(final ReadableTable tb, final int[] key, final int row) { final long hashcode = HashUtils.hashSubRowLong(tb, key, row); int index = keyHashCodesToIndexes.getIfAbsent(hashcode, ABSENT_VALUE); if (index == ABSENT_VALUE) { return -1; } if (index == COLLIDING_KEY) { IntArrayList collidingIndexes = collidingKeyHashCodesToIndexes.get(hashcode); Preconditions.checkNotNull(collidingIndexes); Preconditions.checkState(collidingIndexes.size() > 1); IntIterator iter = collidingIndexes.intIterator(); while (iter.hasNext()) { int idx = iter.next(); if (TupleUtils.tupleEquals(tb, key, row, data, keyColumns, idx)) { return idx; } } return -1; } if (TupleUtils.tupleEquals(tb, key, row, data, keyColumns, index)) { return index; } return -1; }
Source:
<code>void buffer( long nodeReference, long relationshipReference, Read read ) { setOwningNode( nodeReference ); setId( NO_ID ); setNext( NO_ID ); try ( PrimitiveIntObjectMap<BufferedGroup> buffer = Primitive.intObjectMap(); PageCursor edgePage = read.relationshipPage( relationshipReference ) ) { BufferedGroup current = null; while ( relationshipReference != NO_ID ) { read.relationshipFull( edge, relationshipReference, edgePage ); BufferedGroup group = buffer.get( edge.getType() ); if ( group == null ) { buffer.put( edge.getType(), current = group = new BufferedGroup( edge, current ) ); } if ( edge.getFirstNode() == nodeReference ) { if ( edge.getSecondNode() == nodeReference ) { group.loop( edge ); } else { group.outgoing( edge ); } relationshipReference = edge.getFirstNextRel(); } else if ( edge.getSecondNode() == nodeReference ) { group.incoming( edge ); relationshipReference = edge.getSecondNextRel(); } else { throw new IllegalStateException( "not a part of the chain! TODO: better exception" ); } } <START> this.hasCheckedTxState = true; <END> this.bufferedGroup = new BufferedGroup( edge, current ); this.read = read; } }</code><technical_language>Aha, right! I before</technical_language>

Target:
void buffer( long nodeReference, long relationshipReference, Read read ) { setOwningNode( nodeReference ); setId( NO_ID ); setNext( NO_ID ); try ( PrimitiveIntObjectMap<BufferedGroup> buffer = Primitive.intObjectMap(); PageCursor edgePage = read.relationshipPage( relationshipReference ) ) { BufferedGroup current = null; while ( relationshipReference != NO_ID ) { read.relationshipFull( edge, relationshipReference, edgePage ); BufferedGroup group = buffer.get( edge.getType() ); if ( group == null ) { buffer.put( edge.getType(), current = group = new BufferedGroup( edge, current ) ); } if ( edge.getFirstNode() == nodeReference ) { if ( edge.getSecondNode() == nodeReference ) { group.loop( edge ); } else { group.outgoing( edge ); } relationshipReference = edge.getFirstNextRel(); } else if ( edge.getSecondNode() == nodeReference ) { group.incoming( edge ); relationshipReference = edge.getSecondNextRel(); } else { throw new IllegalStateException( "not a part of the chain! TODO: better exception" ); } } this.txTypes.clear(); this.txTypeIterator = null; this.hasCheckedTxState = false; this.bufferedGroup = new BufferedGroup( edge, current ); this.read = read; } }
Source:
<code>void shutdownProducer() { Producer<K, V> producer; _producerLock.lock(); try { producer = _kafkaProducer; _kafkaProducer = null; } finally { _producerLock.unlock(); } if (producer != null) { _producerCloseExecutorService.submit(() -> { <START> _log.debug("KafkaProducerWrapper: Closing the Kafka Producer"); <END> producer.close(TIME_OUT, TimeUnit.MILLISECONDS); NUM_PRODUCERS.decrementAndGet(); _log.debug("KafkaProducerWrapper: Kafka Producer is closed"); }); } }</code><technical_language>If in handy debugging produced frequently, a bad idea turn debug logs this block info instead. I experience do logs though</technical_language>

Target:
void shutdownProducer() { Producer<K, V> producer; synchronized (_producerLock) { producer = _kafkaProducer; _kafkaProducer = null; } if (producer != null) { _producerCloseExecutorService.submit(() -> { _log.info("KafkaProducerWrapper: Closing the Kafka Producer"); producer.close(TIME_OUT, TimeUnit.MILLISECONDS); NUM_PRODUCERS.decrementAndGet(); _log.info("KafkaProducerWrapper: Kafka Producer is closed"); }); } }
Source:
<code>public void play(Program program) { try { callVmHookAction(program, VMHook::startPlay); if (program.byTestingSuite()) return; while (!program.isStopped()) { this.step(program); } } catch (RuntimeException e) { program.setRuntimeFailure(e); } catch (StackOverflowError soe){ <START> logger.error("\n!!! VM recursion error: update your java run command with -Xss4M !!!\n", soe); <END> System.exit(-1); } finally { callVmHookAction(program, VMHook::stopPlay); } }</code><technical_language>previous error description</technical_language>

Target:
public void play(Program program) { try { callVmHookAction(program, VMHook::startPlay); if (program.byTestingSuite()) return; while (!program.isStopped()) { this.step(program); } } catch (RuntimeException e) { program.setRuntimeFailure(e); } catch (StackOverflowError soe){ logger.error("\n !!! StackOverflowError: update your java run command with -Xss2M (-Xss4M for tests) !!!\n", soe); System.exit(-1); } finally { callVmHookAction(program, VMHook::stopPlay); } }
Source:
<code>public CLOption(String opt, String val, String param) { <START> super(); <END> this.opt = opt; this.val = val; this.param = param; }</code><technical_language>nitpick: redundant</technical_language>

Target:
public CLOption(String opt, String val, String param) { this.opt = opt; this.val = val; this.param = param; }
Source:
<code>public boolean equals(Object comparingDefaultKfsAccountForAws) { if (comparingDefaultKfsAccountForAws == null) { return false; } if (!(comparingDefaultKfsAccountForAws instanceof DefaultKfsAccountForAws)) { return false; } final DefaultKfsAccountForAws defaultKfsAccountForAws = (DefaultKfsAccountForAws) comparingDefaultKfsAccountForAws; return ObjectUtils.equals(defaultKfsAccountForAws.getKfsDefaultAccount(), kfsDefaultAccount) && <START> ObjectUtils.equals(defaultKfsAccountForAws.getAwsAccount(), awsAccount) && <END> ObjectUtils.equals(defaultKfsAccountForAws.getUpdatedAt(), updatedAt); }</code><technical_language>I StringUtils</technical_language>

Target:
public boolean equals(Object comparingDefaultKfsAccountForAws) { if (comparingDefaultKfsAccountForAws == null) { return false; } if (!(comparingDefaultKfsAccountForAws instanceof DefaultKfsAccountForAws)) { return false; } final DefaultKfsAccountForAws defaultKfsAccountForAws = (DefaultKfsAccountForAws) comparingDefaultKfsAccountForAws; return StringUtils.equals(defaultKfsAccountForAws.getKfsDefaultAccount(), kfsDefaultAccount) && StringUtils.equals(defaultKfsAccountForAws.getAwsAccount(), awsAccount) && ObjectUtils.equals(defaultKfsAccountForAws.getUpdatedAt(), updatedAt); }
Source:
<code>@Override public void call(final Subscriber<? super Response<T>> subscriber) { final Call<T> call = originalCall.clone(); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { call.cancel(); } })); call.enqueue(new Callback<T>() { @Override public void onResponse(Response<T> response, Retrofit retrofit) { if (subscriber.isUnsubscribed()) { return; } try { subscriber.onNext(response); } catch (Throwable t) { <START> Exceptions.throwIfFatal(t); <END> if (!subscriber.isUnsubscribed()) { subscriber.onError(OnErrorThrowable.addValueAsLastCause(t, call)); } return; } if (!subscriber.isUnsubscribed()) { subscriber.onCompleted(); } } @Override public void onFailure(Throwable t) { Exceptions.throwIfFatal(t); if (subscriber.isUnsubscribed()) { return; } subscriber.onError(OnErrorThrowable.addValueAsLastCause(t, call)); } }); }</code><technical_language>thrown this get swallowed OkHttp</technical_language>

Target:
@Override public void call(final Subscriber<? super Response<T>> subscriber) { final Call<T> call = originalCall.clone(); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { call.cancel(); } })); if (subscriber.isUnsubscribed()) { return; } try { Response<T> response = call.execute(); if (!subscriber.isUnsubscribed()) { subscriber.onNext(response); } } catch (Throwable t) { Exceptions.throwIfFatal(t); if (!subscriber.isUnsubscribed()) { subscriber.onError(t); } return; } if (!subscriber.isUnsubscribed()) { subscriber.onCompleted(); } }
Source:
<code>public static <T, R> R reduce(@Nullable final Collection<T> source, @NonNull final ReduceCallback<T, R> callback, @Nullable final R initialValue) { R acc = initialValue; <START> if (source != null) { <END> for (T val : source) { acc = callback.reduce(acc, val); } } return acc; }</code><technical_language>fail fast: if (source == null) { return initialValue; }</technical_language>

Target:
public static <T, R> R reduce(@Nullable final Collection<T> source, @NonNull final ReduceCallback<T, R> callback, @Nullable final R initialValue) { if (source == null) { return initialValue; } R acc = initialValue; for (T val : source) { acc = callback.reduce(acc, val); } return acc; }
Source:
<code>private BinaryRelation(Kind kind, SymbolicValue v1, SymbolicValue v2) { if (!NORMALIZED_OPERATORS.contains(kind)) { throw new IllegalArgumentException("Relation " + v1 + kind.operand + v2 + " not normalized!"); } this.kind = kind; leftOp = v1; rightOp = v2; <START> hashcode = kind.hashCode() + leftOp.hashCode() + rightOp.hashCode(); <END> }</code><technical_language>of of this one..</technical_language>

Target:
private BinaryRelation(Kind kind, SymbolicValue v1, SymbolicValue v2) { if (!NORMALIZED_OPERATORS.contains(kind)) { throw new IllegalArgumentException("Relation " + v1 + kind.operand + v2 + " not normalized!"); } this.kind = kind; leftOp = v1; rightOp = v2; hashcode = computeHash(); }
Source:
<code><START> private Matcher<byte[]> empty() { <END> return nullValue(byte[].class); }</code><technical_language>static</technical_language>

Target:
private static Matcher<byte[]> empty() { return nullValue(byte[].class); }
Source:
<code>public void stop() { try { exec.shutdownNow(); <START> pathChildrenCache.close(); <END> taskRunner.stop(); log.info("Stopped WorkerTaskMonitor."); } catch (Exception e) { log.makeAlert(e, "Exception stopping WorkerTaskMonitor") .emit(); } }</code><technical_language>this swap places</technical_language>

Target:
public void stop() { synchronized (lifecycleLock) { Preconditions.checkState(started, "not started"); try { exec.shutdownNow(); pathChildrenCache.close(); taskRunner.stop(); started = false; log.info("Stopped WorkerTaskMonitor."); } catch (Exception e) { log.makeAlert(e, "Exception stopping WorkerTaskMonitor") .emit(); } } }