auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean handleDefinedMappings() { boolean errorOccurred = false; Set<String> handledTargets = new HashSet<>(); if ( method.getMappingOptions().hasNestedTargetReferences() ) { errorOccurred = handleDefinedNestedTargetMapping( handledTargets ); } for ( Map.Entry<String, List<Mapping>> entry : methodMappings.entrySet() ) { for ( Mapping mapping : entry.getValue() ) { TargetReference targetReference = mapping.getTargetReference(); if ( !mapping.getTargetName().equals( "." ) && targetReference.isValid() ) { if ( !handledTargets.contains( first( targetReference.getPropertyEntries() ).getFullName() ) ) { if ( handleDefinedMapping( mapping, handledTargets ) ) { errorOccurred = true; } } } else if ( mapping.getTargetName().equals( "." ) && !mapping.getSourceName().isEmpty() ) { applySourcePropertiesToCurrentTarget( mapping ); } else { errorOccurred = true; } } } for ( String handledTarget : handledTargets ) { unprocessedTargetProperties.remove( handledTarget ); unprocessedDefinedTargets.remove( handledTarget ); unprocessedSourceProperties.remove( handledTarget ); } return errorOccurred; }

Target:
private boolean handleDefinedMappings() { boolean errorOccurred = false; Set<String> handledTargets = new HashSet<>(); if ( method.getMappingOptions().hasNestedTargetReferences() ) { errorOccurred = handleDefinedNestedTargetMapping( handledTargets ); } for ( Map.Entry<String, List<Mapping>> entry : methodMappings.entrySet() ) { for ( Mapping mapping : entry.getValue() ) { TargetReference targetReference = mapping.getTargetReference(); if ( !mapping.getTargetName().equals( "." ) && targetReference.isValid() ) { String target = first( targetReference.getPropertyEntries() ).getFullName(); if ( !handledTargets.contains( target ) ) { if ( handleDefinedMapping( mapping, handledTargets ) ) { errorOccurred = true; } } if ( mapping.getSourceReference() != null && mapping.getSourceReference().isValid() ) { List<PropertyEntry> sourceEntries = mapping.getSourceReference().getPropertyEntries(); if ( !sourceEntries.isEmpty() ) { String source = first( sourceEntries ).getFullName(); unprocessedSourceProperties.remove( source ); } } } else if ( mapping.getTargetName().equals( "." ) && !mapping.getSourceName().isEmpty() ) { applySourcePropertiesToCurrentTarget( mapping ); } else { errorOccurred = true; } } } for ( String handledTarget : handledTargets ) { unprocessedTargetProperties.remove( handledTarget ); unprocessedDefinedTargets.remove( handledTarget ); } return errorOccurred; }
Source:
protected Chunk<O> transform(StepContribution contribution, Chunk<I> inputs) throws Exception { Chunk<O> outputs = new Chunk<>(); for (Chunk<I>.ChunkIterator iterator = inputs.iterator(); iterator.hasNext();) { final I item = iterator.next(); O output; Timer.Sample sample = Timer.start(Metrics.globalRegistry); String status = STATUS_SUCCESS; try { output = doProcess(item); } catch (Exception e) { inputs.clear(); status = STATUS_FAILURE; throw e; } finally { stopTimer(sample, contribution.getStepExecution(), "item.process", status, "Item processing"); } if (output != null) { outputs.add(output); } else { iterator.remove(); } } return outputs; }

Target:
protected Chunk<O> transform(StepContribution contribution, Chunk<I> inputs) throws Exception { Chunk<O> outputs = new Chunk<>(); for (Chunk<I>.ChunkIterator iterator = inputs.iterator(); iterator.hasNext();) { final I item = iterator.next(); O output; Timer.Sample sample = BatchMetrics.createTimerSample(); String status = BatchMetrics.STATUS_SUCCESS; try { output = doProcess(item); } catch (Exception e) { inputs.clear(); status = BatchMetrics.STATUS_FAILURE; throw e; } finally { stopTimer(sample, contribution.getStepExecution(), "item.process", status, "Item processing"); } if (output != null) { outputs.add(output); } else { iterator.remove(); } } return outputs; }
Source:
protected final IStatus run(IProgressMonitor monitor) { IStatus status = performJob(monitor); if (status == null || !status.isOK()) { return status; } Action action = getAction(); if (action != null) { if (isModal()) { showResult(action); } else { setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE); setProperty(IProgressConstants.ACTION_PROPERTY, action); return new Status(IStatus.OK, Activator.getPluginId(), IStatus.OK, action.getText(), null); } } return status; }

Target:
protected final IStatus run(IProgressMonitor monitor) { IStatus status = performJob(monitor); if (status == null) { return Activator .createErrorStatus( MessageFormat.format( UIText.RepositoryJob_NullStatus, getName()), new NullPointerException()); } else if (!status.isOK()) { return status; } Action action = getAction(); if (action != null) { if (isModal()) { showResult(action); } else { setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE); setProperty(IProgressConstants.ACTION_PROPERTY, action); return new Status(IStatus.OK, Activator.getPluginId(), IStatus.OK, action.getText(), null); } } return status; }
Source:
@Override public void prefill() { if (this.credential.equals(pool.getPrefillCredential())) { PoolFiller.fillPool(new FillRequest(this, pool.getConfiguration().getInitialSize())); } }

Target:
public void prefill() { if (this.credential.equals(pool.getPrefillCredential()) && pool.getConfiguration().isPrefill() && pool.getConfiguration().getMinSize() > 0) { PoolFiller.fillPool(new FillRequest(this, pool.getConfiguration().getMinSize())); } }
Source:
public void testVendorOptionClipRaster() throws Exception { URL exptectedResponse = this.getClass().getResource("../wms_clip_raster.png"); BufferedImage expectedImage = ImageIO.read(exptectedResponse); String rasterMask = "POLYGON((-14.50804652396198 55.579454354599356,34.53492222603802 55.579454354599356,34.53492222603802 32.400173313532584,-14.50804652396198 32.400173313532584,-14.50804652396198 55.579454354599356))"; String worldBbox130 = "4.769752,-53.384768,57.719733,80.121092"; BufferedImage response = getAsImage( "wms?bbox=" + worldBbox130 + "&styles=&layers=" + "wcs:World" + "&Format=image/png" + "&request=GetMap" + "&width=550" + "&height=250" + "&crs=EPSG:4326" + "&version=1.3.0" + "&clip=" + rasterMask, "image/png"); ImageAssert.assertEquals(expectedImage, response, 100); String rasterMask900913 = "srid=900913;POLYGON ((-1615028.3514525702 7475148.401208023, 3844409.956787858 7475148.401208023, 3844409.956787858 3815954.983140064, -1615028.3514525702 3815954.983140064, -1615028.3514525702 7475148.401208023))"; response = getAsImage( "wms?bbox=" + worldBbox130 + "&styles=&layers=" + "wcs:World" + "&Format=image/png" + "&request=GetMap" + "&width=550" + "&height=250" + "&crs=EPSG:4326" + "&version=1.3.0" + "&clip=" + rasterMask900913, "image/png"); ImageAssert.assertEquals(expectedImage, response, 100); }

Target:
public void testVendorOptionClipRaster() throws Exception { URL exptectedResponse = this.getClass().getResource("../wms_clip_raster.png"); BufferedImage expectedImage = ImageIO.read(exptectedResponse); String rasterMask = "POLYGON((-0.4455465239619838 49.03915485780325,27.679453476038034 48.692256255310134,34.53492222603802 32.400173313532584,5.355234726038036 37.161881019039605,-0.4455465239619838 49.03915485780325))"; String worldBbox130 = "4.769752,-53.384768,57.719733,80.121092"; BufferedImage response = getAsImage( "wms?bbox=" + worldBbox130 + "&styles=&layers=" + "wcs:World" + "&Format=image/png" + "&request=GetMap" + "&width=550" + "&height=250" + "&crs=EPSG:4326" + "&version=1.3.0" + "&clip=" + rasterMask, "image/png"); ImageAssert.assertEquals(expectedImage, response, 100); String rasterMask900913 = "srid=900913;POLYGON ((-49598.01217216109 6281507.767506711, 3081262.66638866 6222804.1297836965, 3844409.956787858 3815954.983140064, 596142.0027810101 4461694.998093233, -49598.01217216109 6281507.767506711))"; response = getAsImage( "wms?bbox=" + worldBbox130 + "&styles=&layers=" + "wcs:World" + "&Format=image/png" + "&request=GetMap" + "&width=550" + "&height=250" + "&crs=EPSG:4326" + "&version=1.3.0" + "&clip=" + rasterMask900913, "image/png"); ImageAssert.assertEquals(expectedImage, response, 100); }
Source:
public void modify(Object element, String property, Object value) { System.out.println(element + " - " + property + " - " + value); String data = (String) ((TableItem) element).getData(); if (property == KEY) { String v = (String) value; if (v == null || v.isEmpty()) { model.getEnvironment().remove(data); } else { String currentVal = model.getEnvironment().get(data); model.getEnvironment().remove(data); model.getEnvironment().put((String) value, currentVal); } } else if (property == VALUE) { String v = (String) value; if (v == null || v.isEmpty()) { model.getEnvironment().remove(data); } else { model.getEnvironment().put(data, (String) value); } } tv.refresh(); }

Target:
public void modify(Object element, String property, Object value) { String data = (String) ((TableItem) element).getData(); if (property == KEY) { String v = (String) value; if (v == null || v.isEmpty()) { model.getEnvironment().remove(data); } else { String currentVal = model.getEnvironment().get(data); model.getEnvironment().remove(data); model.getEnvironment().put((String) value, currentVal); } } else if (property == VALUE) { String v = (String) value; if (v == null || v.isEmpty()) { model.getEnvironment().remove(data); } else { model.getEnvironment().put(data, (String) value); } } tv.refresh(); }
Source:
public static void createJob( String projectId, String tenantId, String companyId, String requisitionId) throws IOException { try (JobServiceClient jobServiceClient = JobServiceClient.create()) { TenantOrProjectName parent = TenantName.of(projectId, tenantId); ArrayList<String> customJobAttributes = new ArrayList<>(Arrays.asList("Internship", "Apprenticeship")); CustomAttribute customAttribute = CustomAttribute.newBuilder() .addAllStringValues(customJobAttributes) .setFilterable(true) .build(); Job job = Job.newBuilder() .setCompany(companyId) .setTitle("Software Developer I") .setDescription("This is a description of this <i>wonderful</i> job!") .putCustomAttributes("FOR_STUDENTS", customAttribute) .setRequisitionId(requisitionId) .setLanguageCode("en-US") .build(); CreateJobRequest request = CreateJobRequest.newBuilder().setParent(parent.toString()).setJob(job).build(); Job response = jobServiceClient.createJob(request); System.out.printf("Created job: %s\n", response.getName()); } }

Target:
public static void createJob( String projectId, String tenantId, String companyId, String requisitionId) throws IOException { try (JobServiceClient jobServiceClient = JobServiceClient.create()) { TenantOrProjectName parent = TenantName.of(projectId, tenantId); CustomAttribute customAttribute = CustomAttribute.newBuilder() .addStringValues("Internship") .addStringValues("Apprenticeship") .setFilterable(true) .build(); Job job = Job.newBuilder() .setCompany(companyId) .setTitle("Software Developer I") .setDescription("This is a description of this <i>wonderful</i> job!") .putCustomAttributes("FOR_STUDENTS", customAttribute) .setRequisitionId(requisitionId) .setLanguageCode("en-US") .build(); CreateJobRequest request = CreateJobRequest.newBuilder().setParent(parent.toString()).setJob(job).build(); Job response = jobServiceClient.createJob(request); System.out.printf("Created job: %s\n", response.getName()); } }
Source:
public void verifyConnectionTimeoutSettingWorks() throws IOException { String testPathPrefix = IntegrationTestConfigContext.generateBasePath( config, this.getClass().getSimpleName()); Instant start = null; Instant stop; try (MantaClient client = new MantaClient(config)) { start = Instant.now(); client.head(testPathPrefix); } catch(InterruptedIOException e){ Assert.assertEquals(e.getClass().getSimpleName(), "ConnectTimeoutException"); ExceptionUtils.getStackTrace(e); } finally { stop = Instant.now(); } Duration totalTime = Duration.between(start, stop); if (totalTime.getSeconds() != 1) { String msg = String.format("Expected total connection time duration " + "to be 1 second. Actually [%d] ms", totalTime.toMillis()); Assert.fail(msg); } }

Target:
public void verifyConnectionTimeoutSettingWorks() throws IOException { String testPathPrefix = IntegrationTestConfigContext.generateBasePath( config, this.getClass().getSimpleName()); Instant start = null; Instant stop; try (MantaClient client = new MantaClient(config)) { start = Instant.now(); client.head(testPathPrefix); } catch (InterruptedIOException e) { Assert.assertEquals(e.getClass().getSimpleName(), "ConnectTimeoutException", "Expected exception ConnectTimeoutException was not thrown. Actual Exception:\n" + ExceptionUtils.getStackTrace(e)); } finally { stop = Instant.now(); } Duration totalTime = Duration.between(start, stop); if (totalTime.getSeconds() != 1) { String msg = String.format("Expected total connection time duration " + "to be 1 second. Actually [%d] ms", totalTime.toMillis()); Assert.fail(msg); } }
Source:
public HpccRemoteFileReader(DataPartition dp, FieldDef originalRD, IRecordBuilder recBuilder, int connectTimeout) throws Exception { this(dp,originalRD,recBuilder,connectTimeout,-1); }

Target:
public HpccRemoteFileReader(DataPartition dp, FieldDef originalRD, IRecordBuilder recBuilder, int connectTimeout) throws Exception { this(dp,originalRD,recBuilder,connectTimeout,NO_RECORD_LIMIT); }
Source:
public static GroupList parse(String text, ValidationError.Sink errors) throws IOException { Map<AccountGroup.UUID, GroupReference> groupsByUUID = new HashMap<>(); Map<String, GroupReference> groupsByName = new HashMap<>(); BufferedReader br = new BufferedReader(new StringReader(text)); String s; for (int lineNumber = 1; (s = br.readLine()) != null; lineNumber++) { if (s.isEmpty() || s.startsWith("#")) { continue; } int tab = s.indexOf('\t'); if (tab < 0) { errors.error(new ValidationError(FILE_NAME, lineNumber, "missing tab delimiter")); continue; } AccountGroup.UUID uuid = new AccountGroup.UUID(s.substring(0, tab).trim()); String name = s.substring(tab + 1).trim(); GroupReference ref = new GroupReference(uuid, name); groupsByUUID.put(uuid, ref); groupsByName.put(name, ref); } return new GroupList(groupsByUUID); }

Target:
public static GroupList parse(String text, ValidationError.Sink errors) throws IOException { Map<AccountGroup.UUID, GroupReference> groupsByUUID = new HashMap<>(); BufferedReader br = new BufferedReader(new StringReader(text)); String s; for (int lineNumber = 1; (s = br.readLine()) != null; lineNumber++) { if (s.isEmpty() || s.startsWith("#")) { continue; } int tab = s.indexOf('\t'); if (tab < 0) { errors.error(new ValidationError(FILE_NAME, lineNumber, "missing tab delimiter")); continue; } AccountGroup.UUID uuid = new AccountGroup.UUID(s.substring(0, tab).trim()); String name = s.substring(tab + 1).trim(); GroupReference ref = new GroupReference(uuid, name); groupsByUUID.put(uuid, ref); } return new GroupList(groupsByUUID); }
Source:
public static OverlapDetector<Interval> makeOverlapDetector(final File samFile, final SAMFileHeader header, final File ribosomalIntervalsFile) { OverlapDetector<Interval> ribosomalSequenceOverlapDetector = new OverlapDetector<Interval>(0, 0); if (ribosomalIntervalsFile != null) { final IntervalList ribosomalIntervals = IntervalList.fromFile(ribosomalIntervalsFile); try { SequenceUtil.assertSequenceDictionariesEqual(header.getSequenceDictionary(), ribosomalIntervals.getHeader().getSequenceDictionary()); } catch (SequenceUtil.SequenceListsDifferException e) { throw new PicardException("Sequence dictionaries differ in " + samFile.getAbsolutePath() + " and " + ribosomalIntervalsFile.getAbsolutePath(), e); } ribosomalIntervals.uniqued().getIntervals(); final List<Interval> intervals = ribosomalIntervals.getIntervals(); ribosomalSequenceOverlapDetector.addAll(intervals, intervals); } return ribosomalSequenceOverlapDetector; }

Target:
public static OverlapDetector<Interval> makeOverlapDetector(final File samFile, final SAMFileHeader header, final File ribosomalIntervalsFile) { OverlapDetector<Interval> ribosomalSequenceOverlapDetector = new OverlapDetector<Interval>(0, 0); if (ribosomalIntervalsFile != null) { final IntervalList ribosomalIntervals = IntervalList.fromFile(ribosomalIntervalsFile); try { SequenceUtil.assertSequenceDictionariesEqual(header.getSequenceDictionary(), ribosomalIntervals.getHeader().getSequenceDictionary()); } catch (SequenceUtil.SequenceListsDifferException e) { throw new PicardException("Sequence dictionaries differ in " + samFile.getAbsolutePath() + " and " + ribosomalIntervalsFile.getAbsolutePath(), e); } final IntervalList uniquedRibosomalIntervals = ribosomalIntervals.uniqued(); final List<Interval> intervals = uniquedRibosomalIntervals.getIntervals(); ribosomalSequenceOverlapDetector.addAll(intervals, intervals); } return ribosomalSequenceOverlapDetector; }
Source:
private void checkForCrashHandlerPermission() { boolean shouldPrompt = session_.getSessionInfo().getPromptForCrashHandlerPermission(); if (shouldPrompt) { String message = "Would you like to enable automated crash reporting?\n\nIf RStudio crashes unexpectedly, the " + "stack trace of the crash will be collected and sent to RStudio for analysis and troubleshooting " + "purposes. No personal data is ever collected other than your IP address which will be used " + "to determine the total number of users experiencing a particular crash.\n\nCrash reporting can be " + "disabled at any time under the Global Options."; globalDisplay_.showYesNoMessage(GlobalDisplay.MSG_QUESTION, "Enable Automated Crash Reporting", message, false, new Operation() { @Override public void execute() { server_.setUserCrashHandlerPrompted(true, new SimpleRequestCallback<Void>()); } }, new Operation() { @Override public void execute() { server_.setUserCrashHandlerPrompted(false, new SimpleRequestCallback<Void>()); } }, true); } }

Target:
private void checkForCrashHandlerPermission() { boolean shouldPrompt = session_.getSessionInfo().getPromptForCrashHandlerPermission(); if (shouldPrompt) { String message = "May we upload crash reports to RStudio automatically?\n\nCrash reports don't include " + "any personal information, except for IP addresses which are used to determine how many users " + "are affected by each crash.\n\nCrash reporting can be disabled at any time under the Global Options."; globalDisplay_.showYesNoMessage(GlobalDisplay.MSG_QUESTION, "Enable Automated Crash Reporting", message, false, new Operation() { @Override public void execute() { server_.setUserCrashHandlerPrompted(true, new SimpleRequestCallback<Void>()); } }, new Operation() { @Override public void execute() { server_.setUserCrashHandlerPrompted(false, new SimpleRequestCallback<Void>()); } }, true); } }
Source:
protected EntityRecord newStorageRecord(StgProjectId id) { return EntityRecordStorageTestEnv.newStorageRecord(id, newState(id)); }

Target:
protected EntityRecord newStorageRecord(StgProjectId id) { return newRecord(id, newState(id)); }
Source:
public void apply(String endpointId, GitChangeEventDto dto) { Tree tree = projectExplorerPresenterProvider.get().getTree(); tree.getNodeStorage() .getAll() .stream() .filter(node -> node instanceof FileNode && ((ResourceNode)node).getData() .getLocation() .equals(Path.valueOf(dto.getPath()))) .forEach(node -> { ((ResourceNode)node).getData().asFile().setVcsStatus(VcsStatus.from(dto.getType().toString())); tree.refresh(node); }); editorAgentProvider.get() .getOpenedEditors() .stream() .filter(editor -> editor.getEditorInput().getFile().getLocation().equals(Path.valueOf(dto.getPath()))) .forEach(editor -> { VcsStatus vcsStatus = VcsStatus.from(dto.getType().toString()); EditorTab tab = multiPartStackProvider.get().getTabByPart(editor); if (vcsStatus != null) { tab.setTitleColor(vcsStatus.getColor()); } }); }

Target:
public void apply(String endpointId, GitChangeEventDto dto) { Tree tree = projectExplorerPresenterProvider.get().getTree(); tree.getNodeStorage() .getAll() .stream() .filter(node -> node instanceof FileNode && ((ResourceNode)node).getData() .getLocation() .equals(Path.valueOf(dto.getPath()))) .forEach(node -> { ((ResourceNode)node).getData().asFile().setVcsStatus(VcsStatus.from(dto.getType().toString())); tree.refresh(node); }); editorAgentProvider.get() .getOpenedEditors() .stream() .filter(editor -> editor.getEditorInput().getFile().getLocation().equals(Path.valueOf(dto.getPath()))) .forEach(editor -> { VcsStatus vcsStatus = VcsStatus.from(dto.getType().toString()); EditorTab tab = multiPartStackProvider.get().getTabByPart(editor); if (vcsStatus != null) { tab.setTitleColor(vcsStatus.getColor()); } }); appContext.getWorkspaceRoot().synchronize(); }
Source:
public static void main(String[] args) { double currentHeading = 0; System.out.println("Starting Path Editor"); try { ArrayList<GpsMeasurement> wayPoints = WayPointUtil.createWayPointsFromLog("logs/", RobobuggyConfigFile.WAYPOINT_SOURCE_LOG_FILE); Gui.getInstance(); for(int i = 0;i<wayPoints.size();i++){ Gui.getInstance().getMainGuiWindow().getAnalyPane().getDataPanel().getGpsPanel(). addPointsToMapTree(Color.BLUE,new LocTuple(wayPoints.get(i).getLatitude(), -wayPoints.get(i).getLongitude())); Gui.getInstance().fixPaint(); } WayPointFollowerPlanner planer = new WayPointFollowerPlanner(NodeChannel.UNKNOWN_CHANNEL,wayPoints); for(int i = 0;i<wayPoints.size();i++){ final double latErrorFinal = 2/111131.745; final double lonErrorFinal = 2/78846.81; for(double latError = -latErrorFinal;latError<=latErrorFinal;latError+=5*latErrorFinal){ for(double lonError = -lonErrorFinal;lonError<=lonErrorFinal;lonError+=5*lonErrorFinal){ double lat = wayPoints.get(i).getLatitude() + latError; double lon = wayPoints.get(i).getLongitude() + lonError; planer.updatePositionEstimate(new GPSPoseMessage(new Date(), lat, lon, currentHeading)); double angle = Math.PI*planer.getCommandedSteeringAngle()/180; Gui.getInstance().getMainGuiWindow().getAnalyPane().getDataPanel().getGpsPanel(). addPointsToMapTree(Color.RED,new LocTuple(lat,-lon)); Gui.getInstance().getMainGuiWindow().getAnalyPane().getDataPanel().getGpsPanel(). addLineToMap(new LocTuple(lat, -lon), angle, Color.RED); } } } } catch (IOException e) { e.printStackTrace(); } }

Target:
public static void main(String[] args) { double currentHeading = 0; final double latErrorFinal = 2/111131.745; final double lonErrorFinal = 2/78846.81; System.out.println("Starting Path Editor"); try { ArrayList<GpsMeasurement> wayPoints = WayPointUtil.createWayPointsFromLog("logs/", RobobuggyConfigFile.WAYPOINT_SOURCE_LOG_FILE); Gui.getInstance(); for(int i = 0;i<wayPoints.size();i++){ Gui.getInstance().getMainGuiWindow().getAnalyPane().getDataPanel().getGpsPanel(). addPointsToMapTree(Color.BLUE,new LocTuple(wayPoints.get(i).getLatitude(), -wayPoints.get(i).getLongitude())); Gui.getInstance().fixPaint(); } WayPointFollowerPlanner planer = new WayPointFollowerPlanner(NodeChannel.UNKNOWN_CHANNEL,wayPoints); for(int i = 0;i<wayPoints.size();i++){ for(double latError = -latErrorFinal;latError<=latErrorFinal;latError+=5*latErrorFinal){ for(double lonError = -lonErrorFinal;lonError<=lonErrorFinal;lonError+=5*lonErrorFinal){ double lat = wayPoints.get(i).getLatitude() + latError; double lon = wayPoints.get(i).getLongitude() + lonError; planer.updatePositionEstimate(new GPSPoseMessage(new Date(), lat, lon, currentHeading)); double angle = Math.PI*planer.getCommandedSteeringAngle()/180; Gui.getInstance().getMainGuiWindow().getAnalyPane().getDataPanel().getGpsPanel(). addPointsToMapTree(Color.RED,new LocTuple(lat,-lon)); Gui.getInstance().getMainGuiWindow().getAnalyPane().getDataPanel().getGpsPanel(). addLineToMap(new LocTuple(lat, -lon), angle, Color.RED); } } } } catch (IOException e) { e.printStackTrace(); } }
Source:
protected void onStop() { Log.d(TAG, "Stopping activity"); unbindService(focusConnection); manager.cleanupMenus(); super.onStop(); }

Target:
protected void onStop() { Log.d(TAG, "Stopping activity"); unbindService(focusConnection); super.onStop(); }
Source:
protected static void logStart(final Logger logger, final DlmsDeviceMessageMetadata messageMetadata, final String methodName) { logger.info(methodName + " called for device: for organisation: {}", messageMetadata.getDeviceIdentification(), messageMetadata.getOrganisationIdentification()); }

Target:
protected void logStart(final Logger logger, final DlmsDeviceMessageMetadata messageMetadata, final String methodName) { logger.info("{} called for device: for organisation: {}", methodName, messageMetadata.getDeviceIdentification(), messageMetadata.getOrganisationIdentification()); }
Source:
public void handle(Context withinContext) throws Exception { LOG.info("Processing#{} UpdatePartitionTableColumnStat message : {}", fromEventId(), eventMessageAsJSON); org.apache.hadoop.hive.metastore.api.Table tableObj = eventMessage.getTableObject(); if (tableObj == null) { LOG.debug("Event#{} was an event of type with no table listed", fromEventId(), event.getEventType()); return; } if (!Utils.shouldReplicate(withinContext.replicationSpec, new Table(tableObj), withinContext.hiveConf)) { return; } if (withinContext.replicationSpec.isMetadataOnly()) { return; } if (AcidUtils.isTransactionalTable(tableObj)) { return; } DumpMetaData dmd = withinContext.createDmd(this); dmd.setPayload(eventMessageAsJSON); dmd.write(); }

Target:
public void handle(Context withinContext) throws Exception { LOG.info("Processing#{} UpdatePartitionTableColumnStat message : {}", fromEventId(), eventMessageAsJSON); org.apache.hadoop.hive.metastore.api.Table tableObj = eventMessage.getTableObject(); if (tableObj == null) { LOG.debug("Event#{} was an event of type with no table listed", fromEventId(), event.getEventType()); return; } if (withinContext.replicationSpec.isMetadataOnly()) { return; } if (AcidUtils.isTransactionalTable(tableObj)) { return; } if (!Utils.shouldReplicate(withinContext.replicationSpec, new Table(tableObj), withinContext.hiveConf)) { return; } DumpMetaData dmd = withinContext.createDmd(this); dmd.setPayload(eventMessageAsJSON); dmd.write(); }
Source:
private static boolean hasMethodAnnotation(Method method) { final Optional<Annotation> eventHandler = ReflectTools .getAnnotation(method, "com.vaadin.flow.component.polymertemplate.EventHandler"); return eventHandler.isPresent() || method .isAnnotationPresent(ClientCallable.class); }

Target:
private static boolean hasMethodAnnotation(Method method) { final boolean hasEventHandler = ReflectTools.hasAnnotation(method, "com.vaadin.flow.component.polymertemplate.EventHandler"); return hasEventHandler || method .isAnnotationPresent(ClientCallable.class); }
Source:
public CacheType unparseServiceConfiguration(CacheConfiguration<?, ?> cacheConfiguration, CacheType cacheType) { Collection<DefaultCacheEventListenerConfiguration> serviceConfigs = findAmongst(DefaultCacheEventListenerConfiguration.class, cacheConfiguration.getServiceConfigurations()); if (!serviceConfigs.isEmpty()) { ListenersType listenersType = cacheType.getListeners(); if (listenersType == null) { listenersType = new ListenersType(); cacheType.setListeners(listenersType); } Set<ListenersType.Listener> listeners = serviceConfigs.stream().map(serviceConfig -> { ListenersType.Listener listener = new ListenersType.Listener(); if (serviceConfig.getInstance() != null) { throw new XmlConfigurationException("XML translation when instance is provided is not supported"); } return listener.withClazz(serviceConfig.getClazz().getName()) .withEventFiringMode(EventFiringType.fromValue(serviceConfig.firingMode().name())) .withEventOrderingMode(EventOrderingType.fromValue(serviceConfig.orderingMode().name())) .withEventsToFireOn(serviceConfig.fireOn() .stream() .map(eventType -> EventType.fromValue(eventType.name())) .collect(toSet())); }).collect(toSet()); cacheType.withListeners(listenersType.withListener(listeners)); } return cacheType; }

Target:
public CacheType unparseServiceConfiguration(CacheConfiguration<?, ?> cacheConfiguration, CacheType cacheType) { Collection<DefaultCacheEventListenerConfiguration> serviceConfigs = findAmongst(DefaultCacheEventListenerConfiguration.class, cacheConfiguration.getServiceConfigurations()); if (!serviceConfigs.isEmpty()) { ListenersType listenersType = cacheType.getListeners(); if (listenersType == null) { listenersType = new ListenersType(); cacheType.setListeners(listenersType); } Set<ListenersType.Listener> listeners = serviceConfigs.stream().map(serviceConfig -> { ListenersType.Listener listener = new ListenersType.Listener(); checkNoConcreteInstance(serviceConfig); return listener.withClazz(serviceConfig.getClazz().getName()) .withEventFiringMode(EventFiringType.fromValue(serviceConfig.firingMode().name())) .withEventOrderingMode(EventOrderingType.fromValue(serviceConfig.orderingMode().name())) .withEventsToFireOn(serviceConfig.fireOn() .stream() .map(eventType -> EventType.fromValue(eventType.name())) .collect(toSet())); }).collect(toSet()); cacheType.withListeners(listenersType.withListener(listeners)); } return cacheType; }
Source:
private List<VM> getMigrableVmsRunningOnVds(final Guid hostId, Map<Guid, List<VM>> hostId2HaVmMapping) { List<VM> vms = hostId2HaVmMapping.get(hostId); vms = LinqUtils.filter(vms, new Predicate<VM>() { @Override public boolean eval(VM v) { return v.getMigrationSupport() == MigrationSupport.MIGRATABLE && !hostId.equals(v.getDedicatedVmForVds()); } }); return vms; }

Target:
private List<VM> getMigrableVmsRunningOnVds(final Guid hostId, Map<Guid, List<VM>> hostId2HaVmMapping) { List<VM> vms = hostId2HaVmMapping.get(hostId); vms = LinqUtils.filter(vms, new Predicate<VM>() { @Override public boolean eval(VM v) { return v.getMigrationSupport() == MigrationSupport.MIGRATABLE; } }); return vms; }
Source:
public EhCacheCacheManager(net.sf.ehcache.CacheManager cacheManager) { this(false, cacheManager); }

Target:
public EhCacheCacheManager(net.sf.ehcache.CacheManager cacheManager) { this.cacheManager = cacheManager; }
Source:
protected URL getResourceURL(File file, String resourceName) { try { JarFile jarFile = (JarFile) jarFiles.get(file); if (jarFile == null && file.isDirectory()) { File resource = new File(file, resourceName); if (resource.exists()) { try { return FILE_UTILS.getFileURL(resource); } catch (MalformedURLException ex) { return null; } } } else { return (URL) storeAndConvert(jarFile, file, resourceName, (jar, entry) -> { try { return new URL("jar:" + FILE_UTILS.getFileURL(file) + "!/" + entry); } catch (MalformedURLException ex) { return null; } }); } } catch (Exception e) { String msg = "Unable to obtain resource from " + file + ": "; log(msg + e, Project.MSG_WARN); System.err.println(msg); e.printStackTrace(); } return null; }

Target:
protected URL getResourceURL(File file, String resourceName) { try { JarFile jarFile = (JarFile) jarFiles.get(file); if (jarFile == null && file.isDirectory()) { File resource = new File(file, resourceName); if (resource.exists()) { try { return FILE_UTILS.getFileURL(resource); } catch (MalformedURLException ex) { return null; } } } else { return storeAndConvert(jarFile, file, resourceName, (jar, entry) -> { try { return new URL("jar:" + FILE_UTILS.getFileURL(file) + "!/" + entry); } catch (MalformedURLException ex) { return null; } }); } } catch (Exception e) { String msg = "Unable to obtain resource from " + file + ": "; log(msg + e, Project.MSG_WARN); System.err.println(msg); e.printStackTrace(); } return null; }
Source:
public void ArticleActionsAdmin_001_deleteUndelete() { SpecialUserLoginPageObject login = new SpecialUserLoginPageObject(driver); login.loginAndVerifyOnWiki(credentials.userNameStaff, credentials.passwordStaff, wikiURL); ArticlePageObject article = login.openRandomArticleOnWiki(wikiURL); String articleName = article.getArticleName(); DeleteArticlePageObject deletePage = article.deleteArticleUsingDropdown(); WikiBasePageObject base = deletePage.submitDeletion(); SpecialRestorePageObject restore = base.undeleteArticle(); restore.verifyArticleName(articleName); restore.giveReason(article.getTimeStamp()); restore.restorePage(); article.verifyNotificationMessage(); article.compareTitle(articleName); }

Target:
public void ArticleActionsAdmin_001_deleteUndelete() { SpecialUserLoginPageObject login = new SpecialUserLoginPageObject(driver); login.loginAndVerifyOnWiki(credentials.userNameStaff, credentials.passwordStaff, wikiURL); ArticlePageObject article = login.openRandomArticle(wikiURL); String articleName = article.getArticleName(); DeleteArticlePageObject deletePage = article.deleteArticleUsingDropdown(); WikiBasePageObject base = deletePage.submitDeletion(); SpecialRestorePageObject restore = base.undeleteArticle(); restore.verifyArticleName(articleName); restore.giveReason(article.getTimeStamp()); restore.restorePage(); article.verifyNotificationMessage(); article.verifyArticleTitle(articleName); }
Source:
private List<Integer> getKeys(final Collection<NMFData> dataValues) { final ArrayList<Integer> keys = new ArrayList<>(); final Set<Integer> keySet = Sets.newTreeSet(); for (final NMFData datum : dataValues) { keySet.addAll( datum.getColumns() .stream() .distinct() .map(Pair::getFirst) .collect(Collectors.toList())); } keys.ensureCapacity(keySet.size()); keys.addAll(keySet); return keys; }

Target:
private List<Integer> getKeys(final Collection<NMFData> dataValues) { computeTracer.startTimer(); final ArrayList<Integer> keys = new ArrayList<>(); final Set<Integer> keySet = Sets.newTreeSet(); for (final NMFData datum : dataValues) { keySet.addAll( datum.getColumns() .stream() .distinct() .map(Pair::getFirst) .collect(Collectors.toList())); } keys.ensureCapacity(keySet.size()); keys.addAll(keySet); computeTracer.recordTime(0); return keys; }
Source:
private void populateReviews(List<ITaskReview> reviewContainers) { for (String reviewUrl : reviewUrls) { AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager() .getConnectorForRepositoryTaskUrl(reviewUrl); if (connector == null) { continue; } String repositoryUrl = connector.getRepositoryUrlFromTaskUrl(reviewUrl); String reviewId = connector.getTaskIdFromTaskUrl(reviewUrl); if (repositoryUrl == null || reviewId == null) { continue; } ITask task = taskList.getTask(repositoryUrl, reviewId); TasksUiPlugin.getRepositoryManager() .getConnectorForRepositoryTaskUrl(reviewUrl) .getTaskIdFromTaskUrl(reviewUrl); System.out.println("summary: " + task.getSummary()); reviewContainers.add(new TaskReview(task.getSummary(), task.getAttribute("CODE_REVIEW"), task.getAttribute("VERIFIED"), "")); } }

Target:
private void populateReviews(List<ITaskReview> reviewContainers) { for (String reviewUrl : reviewUrls) { AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager() .getConnectorForRepositoryTaskUrl(reviewUrl); if (connector == null) { continue; } String repositoryUrl = connector.getRepositoryUrlFromTaskUrl(reviewUrl); String reviewId = connector.getTaskIdFromTaskUrl(reviewUrl); if (repositoryUrl == null || reviewId == null) { continue; } ITask task = taskList.getTask(repositoryUrl, reviewId); TasksUiPlugin.getRepositoryManager() .getConnectorForRepositoryTaskUrl(reviewUrl) .getTaskIdFromTaskUrl(reviewUrl); if (task.getSynchronizationState().isIncoming()) { task.getSynchronizationState(); } reviewContainers.add(new TaskReview(task.getSummary(), task.getAttribute("CODE_REVIEW"), task.getAttribute("VERIFIED"), "")); } }
Source:
public <S extends ContainerAttributes> S save(S entity) { CuratorFramework client = zkConnection.getClient(); String path = Paths.build(Paths.CONTAINERS, entity.getId()); try { if (client.checkExists().forPath(path) != null) { client.delete().forPath(path); } } catch (KeeperException.NoNodeException e) { } catch (Exception e) { throw ZooKeeperUtils.wrapThrowable(e); } try { client.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL) .forPath(path, mapBytesUtility.toByteArray(entity)); return entity; } catch (Exception e) { throw ZooKeeperUtils.wrapThrowable(e); } }

Target:
public <S extends ContainerAttributes> S save(S entity) { CuratorFramework client = zkConnection.getClient(); String path = Paths.build(Paths.CONTAINERS, entity.getId()); try { if (client.checkExists().forPath(path) != null) { client.delete().forPath(path); } } catch (Exception e) { ZooKeeperUtils.wrapAndThrowIgnoring(e, KeeperException.NoNodeException.class); } try { client.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL) .forPath(path, mapBytesUtility.toByteArray(entity)); return entity; } catch (Exception e) { throw ZooKeeperUtils.wrapThrowable(e); } }
Source:
private static boolean isIntegerType(@Nullable GoType type) { if (type == null) return false; GoTypeReferenceExpression ref = type.getTypeReferenceExpression(); if (ref == null) return false; PsiElement resolve = ref.getReference().resolve(); return GoPsiImplUtil.builtin(resolve) && INT_TYPE_NAMES.contains(ref.getText()); }

Target:
private static boolean isIntegerType(@Nullable GoType type) { if (type == null) return false; GoTypeReferenceExpression ref = type.getTypeReferenceExpression(); if (ref == null) return false; return INT_TYPE_NAMES.contains(ref.getText()) && GoPsiImplUtil.builtin(ref.getReference().resolve()); }
Source:
public void testTaskAddUnlockedDependency() { Datastream stream = DatastreamTestUtils.createDatastream("dummy", "dummy", "dummy"); stream.getMetadata().put(DatastreamMetadataConstants.TASK_PREFIX, DatastreamTaskImpl.getTaskPrefix(stream)); DatastreamTaskImpl task = new DatastreamTaskImpl(Collections.singletonList(stream)); ZkAdapter mockZkAdapter = mock(ZkAdapter.class); task.setZkAdapter(mockZkAdapter); DatastreamTaskImpl task0 = new DatastreamTaskImpl(Collections.singletonList(stream)); ZkAdapter mockZkAdapter2 = mock(ZkAdapter.class); task0.setZkAdapter(mockZkAdapter2); task.addDependency(task0); }

Target:
public void testTaskAddUnlockedDependency() { Datastream stream = DatastreamTestUtils.createDatastream("dummy", "dummy", "dummy"); stream.getMetadata().put(DatastreamMetadataConstants.TASK_PREFIX, DatastreamTaskImpl.getTaskPrefix(stream)); DatastreamTaskImpl task = new DatastreamTaskImpl(Collections.singletonList(stream)); ZkAdapter mockZkAdapter = mock(ZkAdapter.class); task.setZkAdapter(mockZkAdapter); Assert.assertThrows(DatastreamTransientException.class, () -> task.addDependency(createDependencyTask(stream, false))); }
Source:
public void addProviderDependencies(PersistenceUnitMetadata pu) { JPA_LOGGER.tracef("second level cache not integrated for Hibernate 4.x - %s", pu.getScopedPersistenceUnitName()); }

Target:
public void addProviderDependencies(PersistenceUnitMetadata pu) { JPA_LOGGER.cannotUseSecondLevelCache(pu.getScopedPersistenceUnitName()); }
Source:
public AbstractArtifactCoordinates(Map<String, String> coordinates) { this.coordinates = coordinates; this.uuid = toPath(); }

Target:
public AbstractArtifactCoordinates(Map<String, String> coordinates) { this.coordinates = coordinates; this.path = toPath(); }
Source:
public void onResponse(@NonNull Call<ZeroConfig> call, @NonNull Response<ZeroConfig> response) { if (response.isSuccessful()) { if (response.body() == null) { cb.failure(call, new JsonParseException("Response missing required field(s)")); } cb.success(call, response.body()); } else { cb.failure(call, RetrofitException.httpError(response, cachedService.retrofit())); } }

Target:
public void onResponse(@NonNull Call<ZeroConfig> call, @NonNull Response<ZeroConfig> response) { if (response.isSuccessful()) { if (response.body() == null) { cb.failure(call, new JsonParseException("Response missing required field(s)")); return; } cb.success(call, response.body()); } else { cb.failure(call, RetrofitException.httpError(response, cachedService.retrofit())); } }
Source:
public void FileOpenTest() throws IOException, BadPcapFileException { PcapTestTrace trace = PcapTestTrace.MOSTLY_TCP; assumeTrue(trace.exists()); PcapFile file = trace.getTrace(); assertEquals(PcapTestTrace.MOSTLY_TCP.getPath(), file.getPath()); assertEquals(2, file.getMajorVersion()); assertEquals(4, file.getMinorVersion()); assertEquals(1, file.getDataLinkType()); assertEquals(65535, file.getSnapLength()); assertEquals(0, file.getTimeAccuracy()); assertEquals(0, file.getTimeZoneCorrection()); assertEquals(ByteOrder.LITTLE_ENDIAN, file.getByteOrder()); assertEquals(43, file.getTotalNbPackets()); }

Target:
public void FileOpenTest() throws IOException, BadPcapFileException { PcapTestTrace trace = PcapTestTrace.MOSTLY_TCP; assumeTrue(trace.exists()); try (PcapFile file = trace.getTrace();) { assertEquals(PcapTestTrace.MOSTLY_TCP.getPath(), file.getPath()); assertEquals(2, file.getMajorVersion()); assertEquals(4, file.getMinorVersion()); assertEquals(1, file.getDataLinkType()); assertEquals(65535, file.getSnapLength()); assertEquals(0, file.getTimeAccuracy()); assertEquals(0, file.getTimeZoneCorrection()); assertEquals(ByteOrder.LITTLE_ENDIAN, file.getByteOrder()); assertEquals(43, file.getTotalNbPackets()); } }
Source:
public boolean canDelete(List<DocumentModel> docs, NuxeoPrincipal principal, boolean checkProxies) { if (docs.isEmpty()) { return false; } return !getInfo(docs, principal, checkProxies, false).docs.isEmpty(); }

Target:
public boolean canDelete(List<DocumentModel> docs, NuxeoPrincipal principal, boolean checkProxies) { if (docs.isEmpty()) { return false; } TrashInfo info = getInfo(docs, principal, checkProxies, false); return !info.docs.isEmpty(); }
Source:
protected CriteriaContext getCriteriaContextForParticipant(Study study, StudyParticipant participant) { RequestInfo info = cacheProvider.getRequestInfo(participant.getId()); ClientInfo clientInfo = (info == null) ? null : info.getClientInfo(); return new CriteriaContext.Builder() .withStudyIdentifier(study.getStudyIdentifier()) .withHealthCode(participant.getHealthCode()) .withUserId(participant.getId()) .withClientInfo(clientInfo) .withUserDataGroups(participant.getDataGroups()) .withUserSubstudyIds(participant.getSubstudyIds()) .withLanguages(participant.getLanguages()).build(); }

Target:
private CriteriaContext getCriteriaContextForParticipant(Study study, StudyParticipant participant) { RequestInfo info = cacheProvider.getRequestInfo(participant.getId()); ClientInfo clientInfo = (info == null) ? null : info.getClientInfo(); return new CriteriaContext.Builder() .withStudyIdentifier(study.getStudyIdentifier()) .withHealthCode(participant.getHealthCode()) .withUserId(participant.getId()) .withClientInfo(clientInfo) .withUserDataGroups(participant.getDataGroups()) .withUserSubstudyIds(participant.getSubstudyIds()) .withLanguages(participant.getLanguages()).build(); }
Source:
public Expression implement( RexToLixTranslator translator, RexCall call, List<Expression> expressions) { if (backupMethodName != null) { Type type0 = expressions.get(0).getType(); Type type1 = expressions.get(1).getType(); final SqlBinaryOperator op = (SqlBinaryOperator) call.getOperator(); if (type0 == Object.class || type1 == Object.class) { final Primitive primitive0 = Primitive.of(type0); final Primitive primitive1 = Primitive.of(type1); Expression expression0 = expressions.get(0); Expression expression1 = expressions.get(1); if (primitive0 != null) { expression0 = Expressions.box(expression0, primitive0); } if (primitive1 != null) { expression1 = Expressions.box(expression1, primitive1); } return Expressions.call(SqlFunctions.class, backupMethodName, expression0, expression1); } else { final Primitive primitive = Primitive.ofBoxOr(type0); if (primitive == null || type1 == BigDecimal.class || COMPARISON_OPERATORS.contains(op) && !COMP_OP_TYPES.contains(primitive)) { return Expressions.call(SqlFunctions.class, backupMethodName, expressions); } } } final Type returnType = translator.typeFactory.getJavaClass(call.getType()); return Types.castIfNecessary(returnType, Expressions.makeBinary(expressionType, expressions.get(0), expressions.get(1))); }

Target:
public Expression implement( RexToLixTranslator translator, RexCall call, List<Expression> expressions) { if (backupMethodName != null) { RelDataType leftType = call.getOperands().get(0).getType(); RelDataType rightType = call.getOperands().get(1).getType(); if (leftType.getSqlTypeName().equals(SqlTypeName.ANY) || rightType.getSqlTypeName().equals(SqlTypeName.ANY)) { return callBackupMethodAnyType(translator, call, expressions); } Type type0 = expressions.get(0).getType(); Type type1 = expressions.get(1).getType(); final SqlBinaryOperator op = (SqlBinaryOperator) call.getOperator(); final Primitive primitive = Primitive.ofBoxOr(type0); if (primitive == null || type1 == BigDecimal.class || COMPARISON_OPERATORS.contains(op) && !COMP_OP_TYPES.contains(primitive)) { return Expressions.call(SqlFunctions.class, backupMethodName, expressions); } } final Type returnType = translator.typeFactory.getJavaClass(call.getType()); return Types.castIfNecessary(returnType, Expressions.makeBinary(expressionType, expressions.get(0), expressions.get(1))); }
Source:
static int getSliceArrayRetainedSizeInBytes(Slice[] values) { long sizeInBytes = sizeOf(values); Map<Object, Boolean> uniqueRetained = new IdentityHashMap<>(values.length); boolean emptySliceExists = false; for (Slice value : values) { if (value != null) { if (value.getBase() != null) { if (uniqueRetained.put(value.getBase(), true) == null) { sizeInBytes += value.getRetainedSize(); } } else if (value.equals(EMPTY_SLICE)) { emptySliceExists = true; } } } return intSaturatedCast(sizeInBytes) + (emptySliceExists ? EMPTY_SLICE.getRetainedSize() : 0); }

Target:
static int getSliceArrayRetainedSizeInBytes(Slice[] values) { long sizeInBytes = sizeOf(values); Map<Object, Boolean> uniqueRetained = new IdentityHashMap<>(values.length); for (Slice value : values) { if (value == null) { continue; } if (value.getBase() != null && uniqueRetained.put(value.getBase(), true) == null) { sizeInBytes += value.getRetainedSize(); } } return intSaturatedCast(sizeInBytes); }
Source:
ServerSsdLocalityCostFunction(Configuration conf, MasterServices srv) { super( conf, srv, LocalityType.SERVER, true, LOCALITY_COST_KEY, DEFAULT_LOCALITY_COST ); }

Target:
ServerSsdLocalityCostFunction(Configuration conf, MasterServices srv) { super(conf, srv, LocalityType.SERVER, IncludeStorageType.SSD, LOCALITY_COST_KEY, DEFAULT_LOCALITY_COST); }
Source:
private FeatureMap.Entry getExpectedEntryWhenDiffSourceIsMergeTarget(final Comparison comparison, final FeatureMapChange diff) { final FeatureMap.Entry expectedEntry; final IEqualityHelper equalityHelper = comparison.getEqualityHelper(); final FeatureMap.Entry diffEntry = (FeatureMap.Entry)diff.getValue(); if (comparison.isThreeWay() && isFeatureMapContainment(diff)) { final Match matchValue = comparison.getMatch((EObject)diffEntry.getValue()); EStructuralFeature originKey = null; final List<Object> originList = (List<Object>)safeEGet(matchValue.getOrigin().eContainer(), diff .getAttribute()); for (Object object : originList) { if (object instanceof FeatureMap.Entry && equalityHelper.matchingValues(diffEntry.getValue(), ((FeatureMap.Entry)object) .getValue())) { originKey = ((FeatureMap.Entry)object).getEStructuralFeature(); break; } } expectedEntry = FeatureMapUtil.createEntry(originKey, diffEntry.getValue()); } else { if (((EReference)diffEntry.getEStructuralFeature()).isContainment()) { EStructuralFeature targetReference = getTargetReference(comparison, diff); expectedEntry = FeatureMapUtil.createEntry(targetReference, diffEntry.getValue()); } else { expectedEntry = diffEntry; } } return expectedEntry; }

Target:
private FeatureMap.Entry getExpectedEntryWhenDiffSourceIsMergeTarget(final Comparison comparison, final FeatureMapChange diff) { final FeatureMap.Entry expectedEntry; final IEqualityHelper equalityHelper = comparison.getEqualityHelper(); final FeatureMap.Entry diffEntry = (FeatureMap.Entry)diff.getValue(); if (comparison.isThreeWay() && isFeatureMapContainment(diff)) { final Match matchValue = comparison.getMatch((EObject)diffEntry.getValue()); EStructuralFeature originKey = null; final List<Object> originList = (List<Object>)safeEGet(matchValue.getOrigin().eContainer(), diff .getAttribute()); for (Object object : originList) { if (object instanceof FeatureMap.Entry && equalityHelper.matchingValues(diffEntry.getValue(), ((FeatureMap.Entry)object) .getValue())) { originKey = ((FeatureMap.Entry)object).getEStructuralFeature(); break; } } expectedEntry = FeatureMapUtil.createEntry(originKey, diffEntry.getValue()); } else if (((EReference)diffEntry.getEStructuralFeature()).isContainment()) { EStructuralFeature targetReference = getTargetReference(comparison, diff); expectedEntry = FeatureMapUtil.createEntry(targetReference, diffEntry.getValue()); } else { expectedEntry = diffEntry; } return expectedEntry; }