auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testResolvingEmptyKeyValueQueryReturnsNullComparator() { KeyValueQuery<Object> keyValueQuery = new KeyValueQuery<Object>(); HazelcastSortAccessor hazelcastSortAccessor = new HazelcastSortAccessor(); Comparator<Map.Entry<?, ?>> comparator = (Comparator<Map.Entry<?, ?>>) hazelcastSortAccessor.resolve(keyValueQuery); assertNull(comparator); }

Target:
public void testResolvingEmptyKeyValueQueryReturnsNullComparator() { KeyValueQuery<Object> keyValueQuery = new KeyValueQuery<>(); HazelcastSortAccessor hazelcastSortAccessor = new HazelcastSortAccessor(); Comparator<Map.Entry<?, ?>> comparator = hazelcastSortAccessor.resolve(keyValueQuery); assertNull(comparator); }
Source:
public static void main(InputStream is, OutputStream os, Mode mode, boolean performPing, JarCache cache) throws IOException, InterruptedException { ExecutorService executor = Executors.newCachedThreadPool(); ChannelBuilder cb = new ChannelBuilder("channel", executor) .withMode(mode) .withJarCache(cache); if (os instanceof StandardOutputStream) cb.withProperty(StandardOutputStream.class,os); final Channel channel = cb.build(is, os); System.err.println("channel started"); long timeout = 1000 * Long.parseLong( System.getProperty("hudson.remoting.Launcher.pingTimeoutSec", "240")), interval = 1000 * Long.parseLong( System.getProperty("hudson.remoting.Launcher.pingIntervalSec", "600")); boolean pingFailureAnalyzer = Boolean.parseBoolean(System.getProperty("hudson.remoting.Launcher.pingFailureAnalyzer", "false")); if (performPing && timeout > 0 && interval > 0) { new PingThread(channel, timeout, interval, pingFailureAnalyzer) { @Deprecated @Override protected void onDead() { System.err.println("Ping failed. Terminating"); System.exit(-1); } @Override protected void onDead(Throwable diagnosis) { if (this.isPingFailureAnalyzer()) { PingFailureAnalyzer pingFailureAnalyzer = new PingFailureAnalyzer(channel, diagnosis); pingFailureAnalyzer.saveStackTrace(diagnosis); pingFailureAnalyzer.takeThreadDump(); } System.err.println("Ping failed. Terminating"); System.exit(-1); } }.start(); } channel.join(); System.err.println("channel stopped"); }

Target:
public static void main(InputStream is, OutputStream os, Mode mode, boolean performPing, JarCache cache) throws IOException, InterruptedException { ExecutorService executor = Executors.newCachedThreadPool(); ChannelBuilder cb = new ChannelBuilder("channel", executor) .withMode(mode) .withJarCache(cache); if (os instanceof StandardOutputStream) cb.withProperty(StandardOutputStream.class,os); final Channel channel = cb.build(is, os); System.err.println("channel started"); long timeout = 1000 * Long.parseLong( System.getProperty("hudson.remoting.Launcher.pingTimeoutSec", "240")), interval = 1000 * Long.parseLong( System.getProperty("hudson.remoting.Launcher.pingIntervalSec", "600")); final boolean agentFailureAnalyzer = Boolean.getBoolean("hudson.remoting.Launcher.agentFailureAnalyzer"); if (performPing && timeout > 0 && interval > 0) { new PingThread(channel, timeout, interval) { @Deprecated @Override protected void onDead() { System.err.println("Ping failed. Terminating"); System.exit(-1); } @Override protected void onDead(Throwable diagnosis) { if (agentFailureAnalyzer) { AgentFailuresAnalyzer agentFailuresAnalyzer = new AgentFailuresAnalyzer(channel, diagnosis); try { agentFailuresAnalyzer.saveStackTrace(diagnosis); agentFailuresAnalyzer.takeThreadDump(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } } System.err.println("Ping failed. Terminating"); System.exit(-1); } }.start(); } channel.join(); System.err.println("channel stopped"); }
Source:
public static Optional<String> getAttributeValue(FormEntryPrompt prompt, String attributeName) { List<TreeElement> attributes = prompt.getBindAttributes(); Optional<TreeElement> attribute = attributes.stream().filter(attr -> { return attr.getName().equals(attributeName); }).findAny(); return attribute.map(TreeElement::getAttributeValue); }

Target:
public static String getAttributeValue(FormEntryPrompt prompt, String attributeName) { List<TreeElement> attributes = prompt.getBindAttributes(); Optional<TreeElement> attribute = attributes.stream().filter(attr -> attr.getName().equals(attributeName) ).findAny(); return attribute.map(TreeElement::getAttributeValue).orElse(null); }
Source:
public void sendRegistrationToken(String gcmToken) { if (!TextUtils.isEmpty(gcmToken)) { AppLog.i(T.NOTIFS, "Sending GCM token to our remote services: " + gcmToken); if (AccountHelper.isSignedInWordPressDotCom()) { SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); String uuid = preferences.getString(NotificationsUtils.WPCOM_PUSH_DEVICE_UUID, null); if (uuid == null) { uuid = UUID.randomUUID().toString(); preferences.edit().putString(NotificationsUtils.WPCOM_PUSH_DEVICE_UUID, uuid); } preferences.edit().putString(NotificationsUtils.WPCOM_PUSH_DEVICE_TOKEN, gcmToken).apply(); NotificationsUtils.registerDeviceForPushNotifications(this, gcmToken); } HelpshiftHelper.getInstance().registerDeviceToken(this, gcmToken); AnalyticsTracker.registerPushNotificationToken(gcmToken); } else { AppLog.w(T.NOTIFS, "Empty GCM token, can't register the id on remote services"); } }

Target:
public void sendRegistrationToken(String gcmToken) { if (!TextUtils.isEmpty(gcmToken)) { AppLog.i(T.NOTIFS, "Sending GCM token to our remote services: " + gcmToken); if (AccountHelper.isSignedInWordPressDotCom()) { SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); String uuid = preferences.getString(NotificationsUtils.WPCOM_PUSH_DEVICE_UUID, null); if (uuid == null) { uuid = UUID.randomUUID().toString(); preferences.edit().putString(NotificationsUtils.WPCOM_PUSH_DEVICE_UUID, uuid).apply(); } preferences.edit().putString(NotificationsUtils.WPCOM_PUSH_DEVICE_TOKEN, gcmToken).apply(); NotificationsUtils.registerDeviceForPushNotifications(this, gcmToken); } HelpshiftHelper.getInstance().registerDeviceToken(this, gcmToken); AnalyticsTracker.registerPushNotificationToken(gcmToken); } else { AppLog.w(T.NOTIFS, "Empty GCM token, can't register the id on remote services"); PreferenceManager.getDefaultSharedPreferences(this).edit().remove(NotificationsUtils.WPCOM_PUSH_DEVICE_TOKEN).apply(); } }
Source:
public void testLoadContentError() { ArgumentCaptor<ServiceCallback> callbackArgumentCaptor = forClass(ServiceCallback.class); tested.loadContent(); verify(projectDiagramServices, times(1)).getByPath(eq(path), callbackArgumentCaptor.capture()); callbackArgumentCaptor.getValue().onError(new ClientRuntimeError(new DefinitionNotFoundException())); verify(placeManager, times( 1)).forceClosePlace(any(PathPlaceRequest.class)); ArgumentCaptor<Consumer> consumerArgumentCaptor = forClass(Consumer.class); verify(diagramClientErrorHandler, times(1)).handleError(any(ClientRuntimeError.class), consumerArgumentCaptor.capture()); consumerArgumentCaptor.getValue().accept("error message"); verify(errorPopupPresenter, times( 1)).showMessage(anyString()); }

Target:
public void testLoadContentError() { ArgumentCaptor<ServiceCallback> callbackArgumentCaptor = forClass(ServiceCallback.class); tested.loadContent(); verify(projectDiagramServices, times(1)).getByPath(eq(path), callbackArgumentCaptor.capture()); callbackArgumentCaptor.getValue().onError(new ClientRuntimeError(new DefinitionNotFoundException())); verify(placeManager, times(1)).forceClosePlace(any(PathPlaceRequest.class)); ArgumentCaptor<Consumer> consumerArgumentCaptor = forClass(Consumer.class); verify(diagramClientErrorHandler, times(1)).handleError(any(ClientRuntimeError.class), consumerArgumentCaptor.capture()); consumerArgumentCaptor.getValue().accept("error message"); verify(errorPopupPresenter, times(1)).showMessage("error message"); }
Source:
public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties = super.getJobMessageProperties(); jobProperties.put(VdcObjectType.Snapshot.name().toLowerCase(), (getSnapshotName() == null) ? "" : getSnapshotName()); } return jobProperties; }

Target:
public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties = super.getJobMessageProperties(); jobProperties.put(VdcObjectType.Snapshot.name().toLowerCase(), StringUtils.defaultString(getSnapshotName())); } return jobProperties; }
Source:
protected boolean canDoAction() { if (getVds() == null) { return failCanDoAction(VdcBllMessages.VDS_NOT_EXIST); } if (getVds().getStatus() != VDSStatus.Up) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_NOT_UP); } StoragePool storagePool = getStoragePoolDAO().getForVds(getVds().getId()); if (storagePool == null) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_NOT_IN_POOL); } setStoragePool(storagePool); if (getVds().getSpmStatus() != VdsSpmStatus.None) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_ALREADY_SPM); } if (getVds().getVdsSpmPriority() == BusinessEntitiesDefinitions.HOST_MIN_SPM_PRIORITY) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_MARKED_AS_NEVER_SPM); } if (isAsyncTasksRunningOnPool(getStoragePool().getId())) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_STORAGE_POOL_HAS_RUNNING_TASKS); } return true; }

Target:
protected boolean canDoAction() { if (getVds() == null) { return failCanDoAction(VdcBllMessages.VDS_NOT_EXIST); } if (getVds().getStatus() != VDSStatus.Up) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_NOT_UP); } if (getStoragePoolForVds() == null) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_NOT_IN_POOL); } if (getVds().getSpmStatus() != VdsSpmStatus.None) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_ALREADY_SPM); } if (getVds().getVdsSpmPriority() == BusinessEntitiesDefinitions.HOST_MIN_SPM_PRIORITY) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_VDS_MARKED_AS_NEVER_SPM); } if (isAsyncTasksRunningOnPool(getStoragePoolForVds().getId())) { return failCanDoAction(VdcBllMessages.CANNOT_FORCE_SELECT_SPM_STORAGE_POOL_HAS_RUNNING_TASKS); } return true; }
Source:
public void destroy() throws Exception { SubscriptionListDTO subsDTO = restAPIStore.getAllSubscriptionsOfApplication(applicationID); for (SubscriptionDTO subscriptionDTO : subsDTO.getList()) { restAPIStore.removeSubscription(subscriptionDTO.getSubscriptionId()); } restAPIStore.deleteApplication(applicationID, null); restAPIPublisher.deleteAPI(apiId); if (userManagementClient != null) { userManagementClient.deleteUser(USER_SAM); userManagementClient.deleteUser(USER_MIKE); userManagementClient.deleteRole(SUBSCRIBER_ROLE); } super.cleanUp(); }

Target:
public void destroy() throws Exception { SubscriptionListDTO subsDTO = restAPIStore.getAllSubscriptionsOfApplication(applicationID); for (SubscriptionDTO subscriptionDTO : subsDTO.getList()) { restAPIStore.removeSubscription(subscriptionDTO.getSubscriptionId()); } restAPIStore.deleteApplication(applicationID); restAPIPublisher.deleteAPI(apiId); if (userManagementClient != null) { userManagementClient.deleteUser(USER_SAM); userManagementClient.deleteUser(USER_MIKE); userManagementClient.deleteRole(SUBSCRIBER_ROLE); } super.cleanUp(); }
Source:
private void getImageChildren(Guid snapshot, List<Guid> children) { List<Guid> snapshotIds = diskImageDao.getAllSnapshotsForParent(snapshot).stream() .map(s -> s.getImageId()).collect(Collectors.toList()); children.addAll(snapshotIds); snapshotIds.stream().forEach(id -> getImageChildren(id, children)); }

Target:
private void getImageChildren(Guid snapshot, List<Guid> children) { List<Guid> snapshotIds = diskImageDao.getAllSnapshotsForParent(snapshot).stream() .map(DiskImage::getImageId).collect(Collectors.toList()); children.addAll(snapshotIds); snapshotIds.forEach(id -> getImageChildren(id, children)); }
Source:
public boolean touchDragged(int screenX, int screenY, int pointer) { if (!pointerNavigationAllowed()) { return false; } if (viewport != null) { sharedVector.x = screenX; sharedVector.y = screenY; viewport.toWorldCoordinates(sharedVector); screenX = (int) sharedVector.x; screenY = (int) sharedVector.y; } updateLastInputSource(screenX, screenY); lastMouseX = screenX; lastMouseY = screenY; if(passThroughMouseMovement) { renderTree.mouseMoved(screenX, screenY); return false; } return renderTree.mouseMoved(screenX, screenY); }

Target:
public boolean touchDragged(int screenX, int screenY, int pointer) { if (!pointerNavigationAllowed()) { return false; } if (viewport != null) { SHARED_VECTOR.x = screenX; SHARED_VECTOR.y = screenY; viewport.toWorldCoordinates(SHARED_VECTOR); screenX = MathUtils.round(SHARED_VECTOR.x); screenY = MathUtils.round(SHARED_VECTOR.y); } updateLastInputSource(screenX, screenY); lastMouseX = screenX; lastMouseY = screenY; if(passThroughMouseMovement) { renderTree.mouseMoved(screenX, screenY); return false; } return renderTree.mouseMoved(screenX, screenY); }
Source:
public DefaultTimestampCache(MetricRegistry metricRegistry, Supplier<Long> size) { this.size = size; startToCommitTimestampCache = createCache(size.get()); evictionPolicy = startToCommitTimestampCache.policy().eviction().get(); AtlasDbMetrics.registerCache(metricRegistry, startToCommitTimestampCache, MetricRegistry.name(DefaultTimestampCache.class, "startToCommitTimestamp")); }

Target:
public DefaultTimestampCache(MetricRegistry metricRegistry, Supplier<Long> size) { this.size = size; startToCommitTimestampCache = createCache(size.get()); evictionPolicy = startToCommitTimestampCache.policy().eviction().get(); AtlasDbMetrics.registerCache(metricRegistry, startToCommitTimestampCache, MetricRegistry.name(TimestampCache.class, "startToCommitTimestamp")); }
Source:
protected DiskShare getShare(String shareName) { DiskShare share = shareCache.get(shareName); if (share == null) { share = (DiskShare) session.connectShare(shareName); if (!(share instanceof DiskShare)) { close(); throw new RuntimeIOException("The share " + shareName + " is not a disk share"); } shareCache.put(shareName, share); } return share; }

Target:
protected DiskShare getShare(String shareName) { Share share = session.connectShare(shareName); if (!(share instanceof DiskShare)) { close(); throw new RuntimeIOException("The share " + shareName + " is not a disk share"); } return (DiskShare) share; }
Source:
private UnfilteredPartitionIterator querySourceOnKey(int i, DecoratedKey key) { BTreeSet.Builder<Clustering> builder = rowsToFetch.get(i).get(key); assert builder != null; Replica source = sources.get(i); NavigableSet<Clustering> clusterings = builder.build(); tableMetrics.replicaSideFilteringProtectionRequests.mark(); if (logger.isTraceEnabled()) logger.trace("Requesting rows in partition from for replica-side filtering protection", clusterings, key, source); Tracing.trace("Requesting rows in partition from for replica-side filtering protection", clusterings.size(), key, source); ClusteringIndexFilter filter = new ClusteringIndexNamesFilter(clusterings, command.isReversed()); SinglePartitionReadCommand cmd = SinglePartitionReadCommand.create(command.metadata(), command.nowInSec(), key, command.columnFilter(), filter); ReplicaPlan.ForTokenRead replicaPlan = ReplicaPlans.forSingleReplicaRead(keyspace, key.getToken(), source); ReplicaPlan.SharedForTokenRead sharedReplicaPlan = ReplicaPlan.shared(replicaPlan); try { return executeReadCommand(cmd, source, sharedReplicaPlan); } catch (ReadTimeoutException e) { int blockFor = consistency.blockFor(keyspace); throw new ReadTimeoutException(consistency, blockFor - 1, blockFor, true); } catch (UnavailableException e) { int blockFor = consistency.blockFor(keyspace); throw UnavailableException.create(consistency, blockFor, e.alive); } }

Target:
private UnfilteredPartitionIterator querySourceOnKey(int i, DecoratedKey key) { BTreeSet.Builder<Clustering> builder = rowsToFetch.get(i).get(key); assert builder != null; Replica source = sources.get(i); NavigableSet<Clustering> clusterings = builder.build(); tableMetrics.replicaSideFilteringProtectionRequests.mark(); if (logger.isTraceEnabled()) logger.trace("Requesting rows in partition from for replica-side filtering protection", clusterings, key, source); Tracing.trace("Requesting rows in partition from for replica-side filtering protection", clusterings.size(), key, source); DataLimits limits = clusterings.isEmpty() ? DataLimits.cqlLimits(1) : DataLimits.NONE; ClusteringIndexFilter filter = new ClusteringIndexNamesFilter(clusterings, command.isReversed()); SinglePartitionReadCommand cmd = SinglePartitionReadCommand.create(command.metadata(), command.nowInSec(), command.columnFilter(), RowFilter.NONE, limits, key, filter); ReplicaPlan.ForTokenRead replicaPlan = ReplicaPlans.forSingleReplicaRead(keyspace, key.getToken(), source); ReplicaPlan.SharedForTokenRead sharedReplicaPlan = ReplicaPlan.shared(replicaPlan); try { return executeReadCommand(cmd, source, sharedReplicaPlan); } catch (ReadTimeoutException e) { int blockFor = consistency.blockFor(keyspace); throw new ReadTimeoutException(consistency, blockFor - 1, blockFor, true); } catch (UnavailableException e) { int blockFor = consistency.blockFor(keyspace); throw UnavailableException.create(consistency, blockFor, blockFor - 1); } }
Source:
private void unmarkLastUsedStubIfNecessary() { List<Invocation> all = registeredInvocations.getAll(); if (all.isEmpty()) { return; } Invocation lastInvocation = all.get(all.size() - 1); for (StubbedInvocationMatcher s : stubbed) { if (Arrays.equals(s.getInvocation().getRawArguments(), lastInvocation.getRawArguments())) { s.markStubUsed(null); lastInvocation.markStubbed(null); return; } } }

Target:
private void unmarkLastUsedStubIfNecessary() { synchronized (stubbed) { Invocation invocation = invocationForStubbing.getInvocation(); for (StubbedInvocationMatcher s : stubbed) { if (s.matches(invocation)) { s.markStubUsed(null); invocation.markStubbed(null); return; } } } }
Source:
protected static String fullyEscapeValue(String value) { String escapedValue = value.replace("&", "&amp;"); escapedValue = escapedValue.replace("<", "&lt;"); escapedValue = escapedValue.replace(">", "&gt;"); escapedValue = escapedValue.replace("\"", "&quot;"); escapedValue = escapedValue.replace("\n", "&#10;"); escapedValue = escapedValue.replace("\t", "&#09;"); return escapedValue; }

Target:
protected static String fullyEscapeValue(String value) { String escapedValue = value.replace("&", "&amp;"); escapedValue = escapedValue.replace("<", "&lt;"); escapedValue = escapedValue.replace(">", "&gt;"); escapedValue = escapedValue.replace("\"", "&quot;"); escapedValue = escapedValue.replace("\n", "&#10;"); escapedValue = escapedValue.replace("\t", "&#9;"); return escapedValue; }
Source:
protected void executeCommand() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.ResetGlusterVolumeOptions, new ResetGlusterVolumeOptionsVDSParameters(upServer.getId(), getGlusterVolumeName(), getParameters().getVolumeOption(), getParameters().isForceAction())); setSucceeded(returnValue.getSucceeded()); if (getSucceeded()) { if (getParameters().getVolumeOption() != null && !(getParameters().getVolumeOption().getKey().isEmpty())) { GlusterVolumeOptionEntity entity = getGlusterVolume().getOption(getParameters().getVolumeOption().getKey()); removeOptionInDb(getGlusterVolume().getOption(getParameters().getVolumeOption().getKey())); isResetAllOptions = false; getParameters().getVolumeOption().setValue((entity.getValue() != null) ? entity.getValue() : ""); } else { for (GlusterVolumeOptionEntity option : getGlusterVolume().getOptions()) { removeOptionInDb(option); } isResetAllOptions = true; } } else { handleVdsError(AuditLogType.GLUSTER_VOLUME_OPTIONS_RESET_FAILED, returnValue.getVdsError().getMessage()); return; } }

Target:
protected void executeCommand() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.ResetGlusterVolumeOptions, new ResetGlusterVolumeOptionsVDSParameters(upServer.getId(), getGlusterVolumeName(), getParameters().getVolumeOption(), getParameters().isForceAction())); setSucceeded(returnValue.getSucceeded()); if (getSucceeded()) { if (getParameters().getVolumeOption() != null && !(getParameters().getVolumeOption().getKey().isEmpty())) { GlusterVolumeOptionEntity entity = getGlusterVolume().getOption(getParameters().getVolumeOption().getKey()); String optionValue = entity.getValue(); removeOptionInDb(entity); isResetAllOptions = false; getParameters().getVolumeOption().setValue(optionValue != null ? optionValue : ""); } else { for (GlusterVolumeOptionEntity option : getGlusterVolume().getOptions()) { removeOptionInDb(option); } isResetAllOptions = true; } } else { handleVdsError(AuditLogType.GLUSTER_VOLUME_OPTIONS_RESET_FAILED, returnValue.getVdsError().getMessage()); return; } }
Source:
void setPendingMsgsMax(int max) { mu.lock(); try { if (conn == null) { throw new IllegalStateException(ERR_BAD_SUBSCRIPTION); } this.dlvWorkerLock(); pMsgsMax = (max <= 0) ? 0 : max; this.dlvWorkerUnlock(); } finally { mu.unlock(); } }

Target:
void setPendingMsgsMax(int max) { mu.lock(); try { if (this.closed) { throw new IllegalStateException(ERR_BAD_SUBSCRIPTION); } pMsgsMax = (max <= 0) ? 0 : max; } finally { mu.unlock(); } }
Source:
public void restore(final IProgressMonitor monitor) { String branch = getBranch(); if (branch != null) { restore(branch, monitor); } }

Target:
public void restore(final IProgressMonitor monitor) { String branch = getBranch(); if (branch != null) restore(branch, monitor); }
Source:
private CompletableFuture<Acknowledge> internalSubmitJob(JobGraph jobGraph) { log.info("Submitting job ({}).", jobGraph.getJobID(), jobGraph.getName()); final CompletableFuture<Acknowledge> persistAndRunFuture = waitForTerminatingJobManager(jobGraph.getJobID(), jobGraph, this::persistAndRunJob) .thenApply(ignored -> Acknowledge.get()); return persistAndRunFuture.handleAsync((acknowledge, throwable) -> { if (throwable != null) { cleanUpJobData(jobGraph.getJobID(), true); ClusterEntryPointExceptionUtils.tryEnrichClusterEntryPointError(throwable); final Throwable strippedThrowable = ExceptionUtils.stripCompletionException(throwable); log.error("Failed to submit job {}.", jobGraph.getJobID(), strippedThrowable); throw new CompletionException( new JobSubmissionException(jobGraph.getJobID(), "Failed to submit job.", strippedThrowable)); } else { return acknowledge; } }, getRpcService().getExecutor()); }

Target:
private CompletableFuture<Acknowledge> internalSubmitJob(JobGraph jobGraph) { log.info("Submitting job ({}).", jobGraph.getJobID(), jobGraph.getName()); final CompletableFuture<Acknowledge> persistAndRunFuture = waitForTerminatingJob(jobGraph.getJobID(), jobGraph, this::persistAndRunJob) .thenApply(ignored -> Acknowledge.get()); return persistAndRunFuture.handleAsync((acknowledge, throwable) -> { if (throwable != null) { cleanUpJobData(jobGraph.getJobID(), true); ClusterEntryPointExceptionUtils.tryEnrichClusterEntryPointError(throwable); final Throwable strippedThrowable = ExceptionUtils.stripCompletionException(throwable); log.error("Failed to submit job {}.", jobGraph.getJobID(), strippedThrowable); throw new CompletionException( new JobSubmissionException(jobGraph.getJobID(), "Failed to submit job.", strippedThrowable)); } else { return acknowledge; } }, getRpcService().getExecutor()); }
Source:
public void onNext(final AggregationMessage aggregationMessage) { final AvroClockMsg avroClockMsg = codec.decode(aggregationMessage.getData().array()); switch (avroClockMsg.getType()) { case ReplyInitClockMsg: globalMinimumClock = avroClockMsg.getReplyInitClockMsg().getGlobalMinClock(); workerClock = avroClockMsg.getReplyInitClockMsg().getInitClock(); latch.countDown(); break; case BroadcastMinClockMsg: globalMinimumClock = avroClockMsg.getBroadcastMinClockMsg().getGlobalMinClock(); default: } }

Target:
public void onNext(final AggregationMessage aggregationMessage) { final AvroClockMsg avroClockMsg = codec.decode(aggregationMessage.getData().array()); switch (avroClockMsg.getType()) { case ReplyInitClockMsg: globalMinimumClock = avroClockMsg.getReplyInitClockMsg().getGlobalMinClock(); workerClock = avroClockMsg.getReplyInitClockMsg().getInitClock(); latch.countDown(); break; case BroadcastMinClockMsg: globalMinimumClock = avroClockMsg.getBroadcastMinClockMsg().getGlobalMinClock(); break; default: throw new RuntimeException("Unexpected message type: " + avroClockMsg.getType().toString()); } }
Source:
private static TmfView getNarrowestView(TmfTimeViewAlignmentInfo alignmentInfo) { IWorkbenchPage page = getWorkbenchWindow(alignmentInfo.getShell()).getActivePage(); int smallestWidth = Integer.MAX_VALUE; TmfView smallest = null; for (IViewReference ref : page.getViewReferences()) { IViewPart view = ref.getView(false); if (view instanceof TmfView && view instanceof ITmfTimeAligned) { TmfView tmfView = (TmfView) view; ITmfTimeAligned alignedView = (ITmfTimeAligned) view; Composite parentComposite = tmfView.getParentComposite(); TmfTimeViewAlignmentInfo timeViewAlignmentInfo = alignedView.getTimeViewAlignmentInfo(); int availableWidth = alignedView.getAvailableWidth(alignmentInfo.getTimeAxisOffset()); if (parentComposite != null && parentComposite.isVisible() && timeViewAlignmentInfo != null && isViewLocationNear(parentComposite.toDisplay(0, 0), alignmentInfo.getViewLocation()) && availableWidth < smallestWidth && availableWidth > 0) { smallestWidth = availableWidth; smallest = tmfView; } } } return smallest; }

Target:
private static TmfView getNarrowestView(TmfTimeViewAlignmentInfo alignmentInfo) { IWorkbenchPage page = getWorkbenchWindow(alignmentInfo.getShell()).getActivePage(); int narrowestWidth = Integer.MAX_VALUE; TmfView narrowestView = null; for (IViewReference ref : page.getViewReferences()) { IViewPart view = ref.getView(false); if (isTimeAlignedView(view)) { TmfView tmfView = (TmfView) view; if (isCandidateForNarrowestView(tmfView, alignmentInfo, narrowestWidth)) { narrowestWidth = ((ITmfTimeAligned) tmfView).getAvailableWidth(getClampedTimeAxisOffset(alignmentInfo)); narrowestWidth = getClampedTimeAxisWidth(alignmentInfo, narrowestWidth); narrowestView = tmfView; } } } return narrowestView; }
Source:
public Optional<Raid> getRaid() { return Optional.ofNullable((Raid) shadow$getRaid()); }

Target:
public Optional<Raid> getRaid() { return Optional.ofNullable((Raid) this.shadow$getRaid()); }
Source:
private void migrateToPropertyStore() { adminForDc.forEach((dcName, helixAdmin) -> { logger.info("Starting property store migration in {}", dcName); ClusterMapConfig config = getClusterMapConfig(clusterName, dcName, null); InstanceConfigToDataNodeConfigAdapter.Converter instanceConfigConverter = new InstanceConfigToDataNodeConfigAdapter.Converter(config); HelixPropertyStore<ZNRecord> propertyStore = createHelixPropertyStore(dcName); try { PropertyStoreToDataNodeConfigAdapter propertyStoreAdapter = new PropertyStoreToDataNodeConfigAdapter(propertyStore, config, dcName); List<String> instanceNames = helixAdmin.getInstancesInCluster(clusterName); logger.info("Found instances in cluster", instanceNames.size()); instanceNames.forEach(instanceName -> { logger.info("Copying config for node {}", instanceName); InstanceConfig instanceConfig = helixAdmin.getInstanceConfig(clusterName, instanceName); DataNodeConfig dataNodeConfig = instanceConfigConverter.convert(instanceConfig); logger.debug("Writing to property store in {}", dataNodeConfig, dcName); if (!propertyStoreAdapter.set(dataNodeConfig)) { logger.error("Failed to persist config for node in the property store.", dataNodeConfig.getInstanceName()); } }); } finally { propertyStore.stop(); } }); }

Target:
private void migrateToPropertyStore() throws InterruptedException { CountDownLatch migrationComplete = new CountDownLatch(adminForDc.size()); adminForDc.forEach((dcName, helixAdmin) -> Utils.newThread(() -> { try { logger.info("Starting property store migration in {}", dcName); ClusterMapConfig config = getClusterMapConfig(clusterName, dcName, null); InstanceConfigToDataNodeConfigAdapter.Converter instanceConfigConverter = new InstanceConfigToDataNodeConfigAdapter.Converter(config); HelixPropertyStore<ZNRecord> propertyStore = createHelixPropertyStore(dcName); try { PropertyStoreToDataNodeConfigAdapter propertyStoreAdapter = new PropertyStoreToDataNodeConfigAdapter(propertyStore, config); List<String> instanceNames = helixAdmin.getInstancesInCluster(clusterName); logger.info("Found instances in cluster", instanceNames.size()); instanceNames.forEach(instanceName -> { logger.info("Copying config for node {}", instanceName); InstanceConfig instanceConfig = helixAdmin.getInstanceConfig(clusterName, instanceName); DataNodeConfig dataNodeConfig = instanceConfigConverter.convert(instanceConfig); logger.debug("Writing to property store in {}", dataNodeConfig, dcName); if (!propertyStoreAdapter.set(dataNodeConfig)) { logger.error("Failed to persist config for node in the property store.", dataNodeConfig.getInstanceName()); } }); } finally { propertyStore.stop(); } logger.error("Successfully migrated to property store in {}", dcName); } catch (Throwable t) { logger.error("Error while migrating to property store in {}", dcName, t); } finally { migrationComplete.countDown(); } }, false).start()); migrationComplete.await(); }
Source:
public void doChange(ScoreDirector<TaskAssigningSolution> scoreDirector) { final User workingUser = scoreDirector.lookUpWorkingObjectOrReturnNull(user); if (workingUser != null) { scoreDirector.beforeProblemPropertyChanged(workingUser); workingUser.setEnabled(false); scoreDirector.afterProblemPropertyChanged(workingUser); releaseNonPinnedTasks(workingUser, scoreDirector); scoreDirector.triggerVariableListeners(); } }

Target:
public void doChange(ScoreDirector<TaskAssigningSolution> scoreDirector) { final User workingUser = scoreDirector.lookUpWorkingObjectOrReturnNull(user); if (workingUser == null) { return; } scoreDirector.beforeProblemPropertyChanged(workingUser); workingUser.setEnabled(false); scoreDirector.afterProblemPropertyChanged(workingUser); releaseNonPinnedTasks(workingUser, scoreDirector); scoreDirector.triggerVariableListeners(); }
Source:
void createTopic() { final String queueName = "some-topic"; final CreateTopicOptions expected = new CreateTopicOptions(queueName) .setAutoDeleteOnIdle(Duration.ofSeconds(15)) .setDefaultMessageTimeToLive(Duration.ofSeconds(50)) .setDeadLetteringOnMessageExpiration(true) .setDuplicateDetectionHistoryTimeWindow(Duration.ofSeconds(13)) .setEnableBatchedOperations(false) .setEnablePartitioning(true) .setForwardTo("Forward-To-This-Queue") .setForwardDeadLetteredMessagesTo("Dead-Lettered-Forward-To") .setLockDuration(Duration.ofSeconds(120)) .setMaxDeliveryCount(15) .setMaxSizeInMegabytes(2048) .setRequiresDuplicateDetection(true) .setRequiresSession(true) .setStatus(EntityStatus.RECEIVE_DISABLED) .setUserMetadata("Test-queue-Metadata"); final TopicProperties actual = EntityHelper.createTopic(expected); assertEquals(expected.getName(), actual.getName()); assertEquals(expected.getAutoDeleteOnIdle(), actual.getAutoDeleteOnIdle()); assertEquals(expected.getDefaultMessageTimeToLive(), actual.getDefaultMessageTimeToLive()); assertEquals(expected.getDuplicateDetectionHistoryTimeWindow(), actual.getDuplicateDetectionHistoryTimeWindow()); assertEquals(expected.enableBatchedOperations(), actual.enableBatchedOperations()); assertEquals(expected.enablePartitioning(), actual.enablePartitioning()); assertEquals(expected.requiresDuplicateDetection(), actual.requiresDuplicateDetection()); assertEquals(expected.getUserMetadata(), actual.getUserMetadata()); assertEquals(expected.getStatus(), actual.getStatus()); }

Target:
void createTopic() { final String queueName = "some-topic"; final CreateTopicOptions expected = new CreateTopicOptions(queueName) .setStatus(EntityStatus.RECEIVE_DISABLED) .setUserMetadata("Test-topic-Metadata"); final TopicDescription actual = EntityHelper.getTopicDescription(expected); assertEquals(expected.getAutoDeleteOnIdle(), actual.getAutoDeleteOnIdle()); assertEquals(expected.getDefaultMessageTimeToLive(), actual.getDefaultMessageTimeToLive()); assertEquals(expected.getDuplicateDetectionHistoryTimeWindow(), actual.getDuplicateDetectionHistoryTimeWindow()); assertEquals(expected.enableBatchedOperations(), actual.isEnableBatchedOperations()); assertEquals(expected.enablePartitioning(), actual.isEnablePartitioning()); assertEquals(expected.getMaxSizeInMegabytes(), actual.getMaxSizeInMegabytes()); assertEquals(expected.getStatus(), actual.getStatus()); assertEquals(expected.requiresDuplicateDetection(), actual.isRequiresDuplicateDetection()); assertEquals(expected.isSupportOrdering(), actual.isSupportOrdering()); assertEquals(expected.getUserMetadata(), actual.getUserMetadata()); }
Source:
public void postOpen(ObserverContext<RegionCoprocessorEnvironment> e) { final RegionCoprocessorEnvironment env = e.getEnvironment(); Logger deprecationLogger = Logger.getLogger("org.apache.hadoop.conf.Configuration.deprecation"); if (deprecationLogger != null) { deprecationLogger.setLevel(Level.WARN); } try { Class.forName(PhoenixDriver.class.getName()); DropChildViewsTask task = new DropChildViewsTask(e.getEnvironment(), timeMaxInterval); executor.scheduleWithFixedDelay(task, initialDelay, timeInterval, TimeUnit.MILLISECONDS); } catch (ClassNotFoundException ex) { LOG.error("ScheduleTask cannot start!", ex); } }

Target:
public void postOpen(ObserverContext<RegionCoprocessorEnvironment> e) { final RegionCoprocessorEnvironment env = e.getEnvironment(); Logger deprecationLogger = Logger.getLogger("org.apache.hadoop.conf.Configuration.deprecation"); if (deprecationLogger != null) { deprecationLogger.setLevel(Level.WARN); } DropChildViewsTask task = new DropChildViewsTask(e.getEnvironment(), timeMaxInterval); executor.scheduleWithFixedDelay(task, initialDelay, timeInterval, TimeUnit.MILLISECONDS); }
Source:
private void updateLaunchConfiguration(ILaunchConfiguration configuration) { try { String projectName = configuration.getAttribute(ATTR_PROJECT_NAME, (String) null); if (projectName == null) { return; } IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); IDEAndroidProject eclipseProject = factory.createAndroidProject(project); if (isAndroidJUnitLaunch(configuration) && eclipseProject.isAndroidProject() && isMavenProject(project)) { final ILaunchConfigurationWorkingCopy workingCopy = addCustomClasspathProvidersTo(configuration); new WorkspaceJob("Update launch configuration") { @Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { workingCopy.doSave(); return Status.OK_STATUS; } }.schedule(); } } catch (CoreException e) { e.printStackTrace(); } }

Target:
private void updateLaunchConfiguration(ILaunchConfiguration configuration) { try { String projectName = configuration.getAttribute(ATTR_PROJECT_NAME, (String) null); if (projectName == null) { debug("Cannot update launch configuration because projectName is null."); return; } IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); IDEAndroidProject eclipseProject = factory.createAndroidProject(project); if (isAndroidJUnitLaunch(configuration) && eclipseProject.isAndroidProject() && isMavenProject(project)) { final ILaunchConfigurationWorkingCopy workingCopy = addCustomClasspathProvidersTo(configuration); new WorkspaceJob("Update launch configuration") { @Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { workingCopy.doSave(); return Status.OK_STATUS; } }.schedule(); } } catch (CoreException e) { e.printStackTrace(); } }
Source:
public void testListAvailabilityZones() { ImmutableList<? extends AvailabilityZone> cinderZones = availabilityZoneApi.list().toList(); assertTrue(cinderZones.size() > 0); for (AvailabilityZone zone : cinderZones) { assertTrue(!Strings.isNullOrEmpty(zone.getName())); assertTrue(zone.getState().available()); } }

Target:
public void testListAvailabilityZones() { ImmutableList<? extends AvailabilityZone> cinderZones = availabilityZoneApi.list().toList(); assertTrue(!cinderZones.isEmpty()); for (AvailabilityZone zone : cinderZones) { assertTrue(!Strings.isNullOrEmpty(zone.getName())); assertTrue(zone.getZoneState().available()); } }
Source:
private Tuple2<Long, CollectCoordinationResponse> getAccumulatorResults() { checkJobClientConfigured(); JobExecutionResult executionResult; try { executionResult = jobClient.getJobExecutionResult(getClass().getClassLoader()).get( DEFAULT_ACCUMULATOR_GET_MILLIS, TimeUnit.MILLISECONDS); } catch (InterruptedException | ExecutionException | TimeoutException e) { throw new RuntimeException("Failed to fetch job execution result", e); } ArrayList<byte[]> accResults = executionResult.getAccumulatorResult(accumulatorName); if (accResults == null) { return null; } try { List<byte[]> serializedResults = SerializedListAccumulator.deserializeList(accResults, BytePrimitiveArraySerializer.INSTANCE); byte[] serializedResult = serializedResults.get(0); return CollectSinkFunction.deserializeAccumulatorResult(serializedResult); } catch (ClassNotFoundException | IOException e) { throw new RuntimeException("Failed to deserialize accumulator results", e); } }

Target:
private Tuple2<Long, CollectCoordinationResponse<T>> getAccumulatorResults() throws IOException { checkJobClientConfigured(); JobExecutionResult executionResult; try { executionResult = jobClient.getJobExecutionResult(getClass().getClassLoader()).get( DEFAULT_ACCUMULATOR_GET_MILLIS, TimeUnit.MILLISECONDS); } catch (InterruptedException | ExecutionException | TimeoutException e) { throw new IOException("Failed to fetch job execution result", e); } ArrayList<byte[]> accResults = executionResult.getAccumulatorResult(accumulatorName); if (accResults == null) { throw new IOException("Job terminated abnormally, no job execution result can be fetched"); } try { List<byte[]> serializedResults = SerializedListAccumulator.deserializeList(accResults, BytePrimitiveArraySerializer.INSTANCE); byte[] serializedResult = serializedResults.get(0); return CollectSinkFunction.deserializeAccumulatorResult(serializedResult); } catch (ClassNotFoundException | IOException e) { throw new IOException("Failed to deserialize accumulator results", e); } }
Source:
public void testRemoveValueUnequalStoreEntryCacheWriterException() throws Exception { final MockStore realStore = new MockStore(Collections.singletonMap("key", "unequalValue")); this.store = spy(realStore); final MockCacheWriter realCache = new MockCacheWriter(Collections.singletonMap("key", "value")); this.cacheWriter = spy(realCache); doThrow(new Exception()).when(this.cacheWriter).delete("key"); final Ehcache<String, String> ehcache = this.getEhcache(this.cacheWriter); assertFalse(ehcache.remove("key", "value")); verify(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); verifyZeroInteractions(this.spiedResilienceStrategy); assertThat(realStore.getMap().get("key"), is(equalTo("unequalValue"))); assertThat(realCache.getEntries().get("key"), is(equalTo("value"))); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.RemoveOutcome.FAILURE)); }

Target:
public void testRemoveValueUnequalStoreEntryCacheWriterException() throws Exception { final FakeStore fakeStore = new FakeStore(Collections.singletonMap("key", "unequalValue")); this.store = spy(fakeStore); final FakeCacheWriter fakeWriter = new FakeCacheWriter(Collections.singletonMap("key", "unequalValue")); this.cacheWriter = spy(fakeWriter); doThrow(new Exception()).when(this.cacheWriter).delete("key"); final Ehcache<String, String> ehcache = this.getEhcache(this.cacheWriter); assertFalse(ehcache.remove("key", "value")); verify(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); verifyZeroInteractions(this.spiedResilienceStrategy); assertThat(fakeStore.getEntryMap().get("key"), is(equalTo("unequalValue"))); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.RemoveOutcome.FAILURE)); }
Source:
public void onStartup(ServletContext sc) throws ServletException { AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext(); context.register(SpringSecurityWebAppConfig.class); sc.addListener(new ContextLoaderListener(context)); DispatcherServlet dispatcherServlet = new DispatcherServlet(context); ServletRegistration.Dynamic dispatcher = sc.addServlet("dispatcher", dispatcherServlet); dispatcher.setLoadOnStartup(1); dispatcher.addMapping("/"); FilterRegistration.Dynamic securityFilter = sc.addFilter(AbstractSecurityWebApplicationInitializer.DEFAULT_FILTER_NAME, DelegatingFilterProxy.class); securityFilter.addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), false, "/*"); FilterRegistration.Dynamic filter = sc.addFilter("stormpathFilter", new DelegatingFilterProxy()); EnumSet<DispatcherType> types = EnumSet.of(DispatcherType.ERROR, DispatcherType.FORWARD, DispatcherType.INCLUDE, DispatcherType.REQUEST); filter.addMappingForUrlPatterns(types, false, "/*"); }

Target:
public void onStartup(ServletContext sc) throws ServletException { AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext(); context.register(SpringSecurityWebAppConfig.class); sc.addListener(new ContextLoaderListener(context)); DispatcherServlet dispatcherServlet = new DispatcherServlet(context); ServletRegistration.Dynamic dispatcher = sc.addServlet("dispatcher", dispatcherServlet); dispatcher.setLoadOnStartup(1); dispatcher.addMapping("/"); FilterRegistration.Dynamic securityFilter = sc.addFilter(AbstractSecurityWebApplicationInitializer.DEFAULT_FILTER_NAME, DelegatingFilterProxy.class); securityFilter.addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), false, "/*"); FilterRegistration.Dynamic stormpathFilter = sc.addFilter(StormpathFilter.DEFAULT_FILTER_NAME, DelegatingFilterProxy.class); EnumSet<DispatcherType> types = EnumSet.of(DispatcherType.ERROR, DispatcherType.FORWARD, DispatcherType.INCLUDE, DispatcherType.REQUEST); stormpathFilter.addMappingForUrlPatterns(types, false, "/*"); }
Source:
public void drawSelection(Player player, LocalSession session, @Arg(desc = "The new draw selection state", def = "") Boolean drawSelection) throws WorldEditException { if (!WorldEdit.getInstance().getConfiguration().serverSideCUI) { throw new DisallowedUsageException("This functionality is disabled in the configuration!"); } boolean useServerCui = session.shouldUseServerCUI(); if (drawSelection != null && drawSelection == useServerCui) { player.printError(TranslatableComponent.of(useServerCui ? "worldedit.drawsel.enabled.already" : "worldedit.drawsel.disabled.already")); return; } if (useServerCui) { session.setUseServerCUI(false); session.updateServerCUI(player); player.printInfo(TranslatableComponent.of("worldedit.drawsel.disabled")); } else { session.setUseServerCUI(true); session.updateServerCUI(player); player.printInfo(TranslatableComponent.of("worldedit.drawsel.enabled")); } }

Target:
public void drawSelection(Player player, LocalSession session, @Arg(desc = "The new draw selection state", def = "") Boolean drawSelection) throws WorldEditException { if (!WorldEdit.getInstance().getConfiguration().serverSideCUI) { throw new DisallowedUsageException("This functionality is disabled in the configuration!"); } boolean useServerCui = session.shouldUseServerCUI(); if (drawSelection != null && drawSelection == useServerCui) { player.printError(TranslatableComponent.of("worldedit.drawsel." + (useServerCui ? "enabled" : "disabled") + ".already")); return; } if (useServerCui) { session.setUseServerCUI(false); session.updateServerCUI(player); player.printInfo(TranslatableComponent.of("worldedit.drawsel.disabled")); } else { session.setUseServerCUI(true); session.updateServerCUI(player); player.printInfo(TranslatableComponent.of("worldedit.drawsel.enabled")); } }
Source:
public double overnightIndexRatePeriod(OvernightIndex index, LocalDate startDate, LocalDate endDate) { ArgChecker.notNull(index, "index"); ArgChecker.notNull(startDate, "startDate"); ArgChecker.notNull(endDate, "endDate"); ArgChecker.isTrue(startDate.isBefore(endDate), "start date should be before end date"); ArgChecker.isFalse(valuationDate.isAfter(startDate), "valuation date should be before or on the start date"); double fixingYearFraction = index.getDayCount().yearFraction(startDate, endDate); return multicurve.getSimplyCompoundForwardRate( Legacy.overnightIndex(index), relativeTime(startDate), relativeTime(endDate), fixingYearFraction); }

Target:
public double overnightIndexRatePeriod(OvernightIndex index, LocalDate startDate, LocalDate endDate) { ArgChecker.notNull(index, "index"); ArgChecker.notNull(startDate, "startDate"); ArgChecker.notNull(endDate, "endDate"); ArgChecker.inOrderNotEqual(startDate, endDate, "startDate", "endDate"); ArgChecker.inOrderOrEqual(valuationDate, startDate, "valuationDate", "startDate"); double fixingYearFraction = index.getDayCount().yearFraction(startDate, endDate); return multicurve.getSimplyCompoundForwardRate( Legacy.overnightIndex(index), relativeTime(startDate), relativeTime(endDate), fixingYearFraction); }
Source:
public Set<Diff> getDirectResultingMerges(Diff target, boolean mergeRightToLeft) { final Set<Diff> resulting = new LinkedHashSet<Diff>(); if (mergeRightToLeft) { if (DifferenceSource.LEFT == target.getSource()) { resulting.addAll(target.getImpliedBy()); } else { resulting.addAll(target.getImplies()); } } else { if (DifferenceSource.LEFT == target.getSource()) { resulting.addAll(target.getImplies()); } else { resulting.addAll(target.getImpliedBy()); } } if (target.getEquivalence() != null) { resulting.addAll(target.getEquivalence().getDifferences()); resulting.remove(target); } if (target.getConflict() != null && target.getConflict().getKind() == ConflictKind.PSEUDO) { resulting.addAll(target.getConflict().getDifferences()); resulting.remove(target); } if (target instanceof ReferenceChange && isSet((ReferenceChange)target, mergeRightToLeft)) { final ReferenceChange ref = (ReferenceChange)target; final Match match = target.getMatch(); final Set<Diff> diffsToCheck = new HashSet<Diff>(); for (Diff diff : match.getDifferences()) { diffsToCheck.add(diff); if (diff.getEquivalence() != null) { diffsToCheck.addAll(diff.getEquivalence().getDifferences()); } } final EObject sourceContainer = ComparisonUtil.getExpectedSide(target.getMatch(), target .getSource(), mergeRightToLeft); if (sourceContainer != null) { final Object lvalue = ReferenceUtil.safeEGet(sourceContainer, ref.getReference()); if (lvalue == sourceContainer) { resulting.addAll(findPseudoEquivalentDiffs(diffsToCheck, target, mergeRightToLeft)); } } } return resulting; }

Target:
public Set<Diff> getDirectResultingMerges(Diff target, boolean mergeRightToLeft) { final Set<Diff> resulting = new LinkedHashSet<Diff>(); if (mergeRightToLeft) { if (DifferenceSource.LEFT == target.getSource()) { resulting.addAll(target.getImpliedBy()); } else { resulting.addAll(target.getImplies()); } } else { if (DifferenceSource.LEFT == target.getSource()) { resulting.addAll(target.getImplies()); } else { resulting.addAll(target.getImpliedBy()); } } if (target.getEquivalence() != null) { resulting.addAll(target.getEquivalence().getDifferences()); resulting.remove(target); } if (target.getConflict() != null && target.getConflict().getKind() == ConflictKind.PSEUDO) { resulting.addAll(target.getConflict().getDifferences()); resulting.remove(target); } if (target instanceof ReferenceChange && isSet((ReferenceChange)target, mergeRightToLeft)) { resulting.addAll(findInterlockedOneToOneDiffs((ReferenceChange)target, mergeRightToLeft)); } return resulting; }