auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void execute() { final Setting setting = getActionContext().getSetting(); final EObject eObject = setting.getEObject(); final EStructuralFeature eStructuralFeature = setting.getEStructuralFeature(); final List<?> containments = (List<?>) eObject.eGet(eStructuralFeature, true); final List<?> moveDownList = Arrays.asList( ((IStructuredSelection) getTableViewer().getSelection()).toArray()); sortSelectionBasedOnIndex(moveDownList, containments); Collections.reverse(moveDownList); final int maxIndex = containments.size() - 1; final EditingDomain editingDomain = getActionContext().getEditingDomain(); for (final Object moveDownObject : moveDownList) { final int currentIndex = containments.indexOf(moveDownObject); if (currentIndex < 0 || currentIndex == maxIndex) { return; } editingDomain.getCommandStack() .execute( new MoveCommand( editingDomain, eObject, eStructuralFeature, currentIndex, currentIndex + 1)); } }

Target:
public void execute() { final List<?> containments = getContainments(); final List<?> moveDownList = Arrays.asList( ((IStructuredSelection) getTableViewer().getSelection()).toArray()); sortSelectionBasedOnIndex(moveDownList, containments); Collections.reverse(moveDownList); final int maxIndex = containments.size() - 1; final EditingDomain editingDomain = getActionContext().getEditingDomain(); final Setting setting = getActionContext().getSetting(); final EObject eObject = setting.getEObject(); final EStructuralFeature eStructuralFeature = setting.getEStructuralFeature(); for (final Object moveDownObject : moveDownList) { final int currentIndex = containments.indexOf(moveDownObject); if (currentIndex < 0 || currentIndex == maxIndex) { return; } editingDomain.getCommandStack() .execute( new MoveCommand( editingDomain, eObject, eStructuralFeature, currentIndex, currentIndex + 1)); } }
Source:
private static TaskDeploymentDescriptor createTaskDeploymentDescriptor(JobID jobId) throws IOException { final ResultPartitionDeploymentDescriptor taskResultPartitionDescriptor = PartitionTestUtils.createPartitionDeploymentDescriptor(ResultPartitionType.BLOCKING); return TaskExecutorSubmissionTest.createTaskDeploymentDescriptor( jobId, "job", taskResultPartitionDescriptor.getShuffleDescriptor().getResultPartitionID().getProducerId(), new SerializedValue<>(new ExecutionConfig()), "Sender", 1, 0, 1, 0, new Configuration(), new Configuration(), TestingInvokable.class.getName(), Collections.singletonList(taskResultPartitionDescriptor), Collections.emptyList(), Collections.emptyList(), Collections.emptyList(), 0); }

Target:
private static TaskDeploymentDescriptor createTaskDeploymentDescriptor(JobID jobId) throws IOException { return TaskDeploymentDescriptorBuilder.newBuilder(jobId, TestingInvokable.class).build(); }
Source:
public IServer[] getCompatibleServers(IModule module) { ArrayList<IServer> ret = new ArrayList<IServer>(); IServer[] servers = ServerCore.getServers(); IModuleType mt = module.getModuleType(); if (servers != null) { int size = servers.length; for (int i = 0; i < size; i++) { IRuntimeType rtt = servers[i].getServerType().getRuntimeType(); IModuleType[] stmt = rtt == null ? new IModuleType[0] : rtt.getModuleTypes(); if (ServerUtil.isSupportedModule(stmt, mt.getId(), null)) { ret.add(servers[i]); } } } return (IServer[]) ret.toArray(new IServer[ret.size()]); }

Target:
public IServer[] getCompatibleServers(IModule module) { IServer[] servers = ServerCore.getServers(); IModuleType mt = module.getModuleType(); int size = servers.length; if (servers != null && size > 0) { ArrayList<IServer> ret = new ArrayList<IServer>(); for (int i = 0; i < size; i++) { IRuntimeType rtt = servers[i].getServerType().getRuntimeType(); IModuleType[] stmt = rtt == null ? new IModuleType[0] : rtt.getModuleTypes(); if (ServerUtil.isSupportedModule(stmt, mt.getId(), null)) { ret.add(servers[i]); } } return (IServer[]) ret.toArray(new IServer[ret.size()]); } return new IServer[0]; }
Source:
private String decrypt(final String key, final String value) { if (StringExtensions.IsNullOrBlank(key)) { throw new IllegalArgumentException("key is null or blank"); } try { return getStorageHelper().decrypt(value); } catch (GeneralSecurityException | IOException e) { Logger.e(TAG, "Decryption failure", "", ADALError.DECRYPTION_FAILED, e); removeItem(key); Logger.v(TAG, String.format("Decryption error, item removed for key: '%s'", key)); } return null; }

Target:
private String decrypt(final String key, final String value) { if (StringExtensions.IsNullOrBlank(key)) { throw new IllegalArgumentException("key is null or blank"); } try { return getStorageHelper().decrypt(value); } catch (GeneralSecurityException | IOException e) { ClientAnalytics.logEvent(new EncryptionDecryptionFailureEvent(new InstrumentationPropertiesBuilder(e), false)); Logger.e(TAG, "Decryption failure", "", ADALError.DECRYPTION_FAILED, e); removeItem(key); Logger.v(TAG, String.format("Decryption error, item removed for key: '%s'", key)); } return null; }
Source:
public InputStream[] call(CallContext callContext, InputStream[] input) { checkAllowedArgs(callContext.getEndpointState(), callContext.getSessionState(), callContext.getWorkUnit()); return getCaller().arrayCall(getClient(), callContext.getEndpointState(), callContext.getSessionState(), callContext.getWorkUnit(), input); }

Target:
public InputStream[] call(CallContext callContext, InputStream[] input) { try { return getResponseData(callContext, input, false); } catch(Exception ex) { throw new InternalError("Exception occurred while fetching data"); } }
Source:
public boolean onLongPressEvent(PointF point) { if (!view.getSettings().SCROLL_MAP_BY_GESTURES.get()) { if (!selectedObjects.isEmpty()) view.showMessage(activity.getNavigationHint(latLon)); return true; } if(OsmandPlugin.getEnabledPlugin(PlanningPlugin.class) != null){ if(OsmandPlugin.getEnabledPlugin(PlanningPlugin.class).getPlanningMode()) return false; } if(pressedInTextView(point.x, point.y) == 2){ setLocation(null, ""); view.refreshMap(); return true; } if(pressedInTextView(point.x, point.y) == 1) return false; LatLon pressedLoc = view.getLatLonFromScreenPoint(point.x, point.y); selectedObjects.clear(); List<Object> s = new ArrayList<Object>(); LatLon latLon = null; for(OsmandMapLayer l : view.getLayers()){ if(l instanceof ContextMenuLayer.IContextMenuProvider){ s.clear(); ((ContextMenuLayer.IContextMenuProvider) l).collectObjectsFromPoint(point, s); for(Object o : s) { selectedObjects.put(o, ((ContextMenuLayer.IContextMenuProvider) l)); if(latLon == null) { latLon = ((ContextMenuLayer.IContextMenuProvider) l).getObjectLocation(o); } } } } if(latLon == null) { latLon = pressedLoc; } String description = getSelectedObjectDescription(); setLocation(latLon, description); view.refreshMap(); return true; }

Target:
public boolean onLongPressEvent(PointF point) { if ((Build.VERSION.SDK_INT < 14) && !view.getSettings().SCROLL_MAP_BY_GESTURES.get()) { if (!selectedObjects.isEmpty()) view.showMessage(activity.getNavigationHint(latLon)); return true; } if(OsmandPlugin.getEnabledPlugin(PlanningPlugin.class) != null){ if(OsmandPlugin.getEnabledPlugin(PlanningPlugin.class).getPlanningMode()) return false; } if(pressedInTextView(point.x, point.y) == 2){ setLocation(null, ""); view.refreshMap(); return true; } if(pressedInTextView(point.x, point.y) == 1) return false; LatLon pressedLoc = view.getLatLonFromScreenPoint(point.x, point.y); selectedObjects.clear(); List<Object> s = new ArrayList<Object>(); LatLon latLon = null; for(OsmandMapLayer l : view.getLayers()){ if(l instanceof ContextMenuLayer.IContextMenuProvider){ s.clear(); ((ContextMenuLayer.IContextMenuProvider) l).collectObjectsFromPoint(point, s); for(Object o : s) { selectedObjects.put(o, ((ContextMenuLayer.IContextMenuProvider) l)); if(latLon == null) { latLon = ((ContextMenuLayer.IContextMenuProvider) l).getObjectLocation(o); } } } } if(latLon == null) { latLon = pressedLoc; } String description = getSelectedObjectDescription(); setLocation(latLon, description); view.refreshMap(); return true; }
Source:
public void testPublishFullPost() { String title = "Hello Espresso!"; String content = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod " + "tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud " + "exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."; String category = "Android Test"; long now = Instant.now().toEpochMilli(); String tag = "Tag " + now; loginIfNecessary(); MasterbarComponent mb = new MasterbarComponent().goToMySitesTab(); sleep(); mb.clickBlogPosts(); new MySitesPage() .startNewPost(E2E_WP_COM_USER_SITE_ADDRESS); EditorPage editorPage = new EditorPage(); editorPage.enterTitle(title); editorPage.enterContent(content); editorPage.enterImage(); editorPage.openSettings(); editorPage.addACategory(category); editorPage.addATag(tag); editorPage.setFeaturedImage(); checkViewHasText(onView(withId(R.id.post_categories)), category); checkViewHasText(onView(withId(R.id.post_tags)), tag); waitForElementToNotBeDisplayed(onView(withText(R.string.post_settings_set_featured_image))); pressBack(); boolean isPublished = editorPage.publishPost(); assertTrue(isPublished); }

Target:
public void testPublishFullPost() { String title = "Hello Espresso!"; String content = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod " + "tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud " + "exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."; String category = "Android Test"; long now = Instant.now().toEpochMilli(); String tag = "Tag " + now; MasterbarComponent mb = new MasterbarComponent().goToMySitesTab(); sleep(); mb.clickBlogPosts(); new MySitesPage() .startNewPost(E2E_WP_COM_USER_SITE_ADDRESS); EditorPage editorPage = new EditorPage(); editorPage.enterTitle(title); editorPage.enterContent(content); editorPage.enterImage(); editorPage.openSettings(); editorPage.addACategory(category); editorPage.addATag(tag); editorPage.setFeaturedImage(); checkViewHasText(onView(withId(R.id.post_categories)), category); checkViewHasText(onView(withId(R.id.post_tags)), tag); waitForElementToNotBeDisplayed(onView(withText(R.string.post_settings_set_featured_image))); pressBack(); boolean isPublished = editorPage.publishPost(); assertTrue(isPublished); }
Source:
public void validateFolderName(final Folder folder) throws DotDataException { if (UtilMethods.isSet(folder.getParentPermissionable()) && folder.getParentPermissionable() instanceof Host && UtilMethods.isSet(folder.getName()) && reservedFolderNames.contains(folder.getName().toUpperCase())) { throw new InvalidFolderNameException("Folder can't be saved. You entered a reserved folder name"); } }

Target:
public void validateFolderName(final Folder folder) throws DotDataException { if (UtilMethods.isSet(folder.getParentPermissionable()) && folder.getParentPermissionable() instanceof Host && UtilMethods.isSet(folder.getName()) && reservedFolderNames.contains(folder.getName().toUpperCase())) { throw new InvalidFolderNameException("Folder can't be saved. You entered a reserved folder name: " + folder.getName()); } }
Source:
public String toString() { return "GameObject [body=" + body + ", physics=" + physics + ", health=" + health + ", weapon=" + weapon + ", id=" + id + "]"; }

Target:
public String toString() { return String.format("GameObject [body=%s, physics=%s, health=%s, weapon=%s, id=%s, destroyed=%s]", body, physics, health, weapon, id, destroyed); }
Source:
void localize() { applicationTitle.setText(dynamicMessages.applicationTitle()); copyrightNotice.setText(dynamicMessages.copyRightNotice()); versionLabel.setText(constants.versionAboutLabel()); userNameLabel.setText(constants.userNameAboutLabel()); }

Target:
void localize() { applicationTitle.setText(dynamicMessages.applicationTitle()); copyrightNotice.setText(dynamicMessages.copyRightNotice()); }
Source:
@Ignore @Test public void annotatedArrayTypeInVarargsParameter() { TypeName type = ArrayTypeName.of(ArrayTypeName.of(ClassName.get(Object.class)) .annotated(TYPE_USE_ANNOTATION)); MethodSpec varargsMethod = MethodSpec.methodBuilder("m") .addParameter( ParameterSpec.builder(type, "p") .build()) .varargs() .build(); assertThat(varargsMethod.toString()).isEqualTo("" + "void m(\n" + " java.lang.Object[] @" + TUA + " ... p) {\n" + "}\n"); }

Target:
@Test public void annotatedArrayTypeInVarargsParameter() { TypeName type = ArrayTypeName.of(ArrayTypeName.of(ClassName.get(Object.class)) .annotated(TYPE_USE_ANNOTATION)); MethodSpec varargsMethod = MethodSpec.methodBuilder("m") .addParameter( ParameterSpec.builder(type, "p") .build()) .varargs() .build(); assertThat(varargsMethod.toString()).isEqualTo("" + "void m(java.lang.Object[] @" + TUA + " ... p) {\n" + "}\n"); }
Source:
public void setGuideLayout(@Nonnull SlimefunGuideLayout layout) { this.layout = layout; }

Target:
public void setGuideLayout(@Nonnull SlimefunGuideLayout layout) { Validate.notNull(layout, "You must specify a layout that is not-null!"); this.layout = layout; }
Source:
private DruidPredicateFactory getPredicateFactory() { return new DruidPredicateFactory() { @Override public Predicate<String> makeStringPredicate() { if (extractionFn != null) { return new Predicate<String>() { @Override public boolean apply(String input) { return values.contains(Strings.nullToEmpty(extractionFn.apply(input))); } }; } else { return new Predicate<String>() { @Override public boolean apply(String input) { return values.contains(Strings.nullToEmpty(input)); } }; } } @Override public DruidLongPredicate makeLongPredicate() { if (extractionFn != null) { return new DruidLongPredicate() { @Override public boolean applyLong(long input) { return values.contains(extractionFn.apply(input)); } }; } else { return longPredicateSupplier.get(); } } @Override public DruidFloatPredicate makeFloatPredicate() { if (extractionFn != null) { return new DruidFloatPredicate() { @Override public boolean applyFloat(float input) { return values.contains(extractionFn.apply(input)); } }; } else { return floatPredicateSupplier.get(); } } @Override public DruidDoublePredicate makeDoublePredicate() { if (extractionFn != null) { return input -> values.contains(extractionFn.apply(input)); } return input -> floatPredicateSupplier.get().applyFloat((float) input); } }; }

Target:
private DruidPredicateFactory getPredicateFactory() { return new DruidPredicateFactory() { @Override public Predicate<String> makeStringPredicate() { if (extractionFn != null) { return input -> values.contains(Strings.nullToEmpty(extractionFn.apply(input))); } else { return input -> values.contains(Strings.nullToEmpty(input)); } } @Override public DruidLongPredicate makeLongPredicate() { if (extractionFn != null) { return input -> values.contains(extractionFn.apply(input)); } else { return longPredicateSupplier.get(); } } @Override public DruidFloatPredicate makeFloatPredicate() { if (extractionFn != null) { return input -> values.contains(extractionFn.apply(input)); } else { return floatPredicateSupplier.get(); } } @Override public DruidDoublePredicate makeDoublePredicate() { if (extractionFn != null) { return input -> values.contains(extractionFn.apply(input)); } return input -> doublePredicateSupplier.get().applyDouble(input); } }; }
Source:
public void stopServerListRefreshing() { if (eurekaClientProvider != null) { EurekaClient eurekaClient = eurekaClientProvider.get(); if (eurekaClient != null) { eurekaClient.unregisterEventListener(updateListener); } } serverListUpdateService.shutdown(); }

Target:
public void stopServerListRefreshing() { if (eurekaClientProvider != null) { EurekaClient eurekaClient = eurekaClientProvider.get(); if (eurekaClient != null) { eurekaClient.unregisterEventListener(updateListener); } } }
Source:
private void restoreState() { _isNewUI = _prefStore.getBoolean(ITourbookPreferences.IMPORT_IS_NEW_UI); _actionRemoveToursWhenClosed.setChecked(Util.getStateBoolean( _state, STATE_IS_REMOVE_TOURS_WHEN_VIEW_CLOSED, true)); final boolean isMergeTracks = _state.getBoolean(STATE_IS_MERGE_TRACKS); _rawDataMgr.setMergeTracks(isMergeTracks); final boolean isCreateTourIdWithTime = _state.getBoolean(STATE_IS_CREATE_TOUR_ID_WITH_TIME); _rawDataMgr.setState_CreateTourIdWithTime(isCreateTourIdWithTime); final boolean isIgnoreInvalidFile = _state.getBoolean(STATE_IS_IGNORE_INVALID_FILE); _rawDataMgr.setState_IsIgnoreInvalidFile(isIgnoreInvalidFile); final boolean isSetBodyWeight = _state.getBoolean(STATE_IS_SET_BODY_WEIGHT); _rawDataMgr.setState_IsSetBodyWeight(isSetBodyWeight); final boolean isAutoOpenLogView = Util.getStateBoolean(_state, STATE_IS_AUTO_OPEN_IMPORT_LOG_VIEW, RawDataView.STATE_IS_AUTO_OPEN_IMPORT_LOG_VIEW_DEFAULT); _rawDataMgr.setState_IsOpenImportLogView(isAutoOpenLogView); final boolean isValidation = _state.getBoolean(STATE_IS_CHECKSUM_VALIDATION); _rawDataMgr.setIsChecksumValidation(isValidation); updateToolTipState(); Display.getCurrent().asyncExec(new Runnable() { @Override public void run() { reimportAllImportFiles(true); } }); }

Target:
private void restoreState() { _isNewUI = _prefStore.getBoolean(ITourbookPreferences.IMPORT_IS_NEW_UI); _actionRemoveToursWhenClosed.setChecked(Util.getStateBoolean( _state, STATE_IS_REMOVE_TOURS_WHEN_VIEW_CLOSED, true)); final boolean isMergeTracks = _state.getBoolean(STATE_IS_MERGE_TRACKS); _rawDataMgr.setMergeTracks(isMergeTracks); final boolean isCreateTourIdWithTime = _state.getBoolean(STATE_IS_CREATE_TOUR_ID_WITH_TIME); _rawDataMgr.setState_CreateTourIdWithTime(isCreateTourIdWithTime); final boolean isIgnoreInvalidFile = _state.getBoolean(STATE_IS_IGNORE_INVALID_FILE); _rawDataMgr.setState_IsIgnoreInvalidFile(isIgnoreInvalidFile); final boolean isSetBodyWeight = Util.getStateBoolean(_state, STATE_IS_SET_BODY_WEIGHT, STATE_IS_SET_BODY_WEIGHT_DEFAULT); _rawDataMgr.setState_IsSetBodyWeight(isSetBodyWeight); final boolean isAutoOpenLogView = Util.getStateBoolean(_state, STATE_IS_AUTO_OPEN_IMPORT_LOG_VIEW, RawDataView.STATE_IS_AUTO_OPEN_IMPORT_LOG_VIEW_DEFAULT); _rawDataMgr.setState_IsOpenImportLogView(isAutoOpenLogView); final boolean isValidation = _state.getBoolean(STATE_IS_CHECKSUM_VALIDATION); _rawDataMgr.setIsChecksumValidation(isValidation); updateToolTipState(); Display.getCurrent().asyncExec(new Runnable() { @Override public void run() { reimportAllImportFiles(true); } }); }
Source:
boolean shouldRetryForGone(int statusCode, int subStatusCode) { if (statusCode == StatusCodes.GONE && (subStatusCode == SubStatusCodes.PARTITION_KEY_RANGE_GONE || subStatusCode == SubStatusCodes.NAME_CACHE_IS_STALE) && this.attemptedRetries < MAX_RETRIES) { this.attemptedRetries++; return true; } return false; }

Target:
boolean shouldRetryForGone(int statusCode, int subStatusCode) { if (statusCode == StatusCodes.GONE && (subStatusCode == SubStatusCodes.PARTITION_KEY_RANGE_GONE || subStatusCode == SubStatusCodes.NAME_CACHE_IS_STALE || subStatusCode == SubStatusCodes.COMPLETING_SPLIT || subStatusCode == SubStatusCodes.COMPLETING_PARTITION_MIGRATION) && this.attemptedRetries < MAX_RETRIES) { this.attemptedRetries++; if (subStatusCode == SubStatusCodes.NAME_CACHE_IS_STALE) { refreshCollectionCache(); } return true; } return false; }
Source:
public void cleanUp() throws Exception { File supportDir = new File(j.getInstance().getRootDir(), "support"); File cacheDir = new File(supportDir, "winsw"); DumbSlave slave1 = j.createOnlineSlave(); DumbSlave slave2 = j.createOnlineSlave(); generateBundle(); assertNotNull("The cache directory is empty", cacheDir.list()); for (int i = 0; i < 10; i++) { int cacheDirsCount = cacheDir.list().length; if (cacheDir.list() != null && cacheDirsCount == 2) { break; } else { Thread.sleep(1000 * 10); } } assertEquals(cacheDir.list().length, 2); j.getInstance().removeNode(slave2); generateBundle(); for (int i = 0; i < 10; i++) { int cacheDirsCount = cacheDir.list().length; if (cacheDir.list() != null && cacheDirsCount == 1) { break; } else { Thread.sleep(1000 * 10); } } assertEquals(cacheDir.list().length, 1); }

Target:
public void cleanUp() throws Exception { File supportDir = new File(j.getInstance().getRootDir(), "support"); File cacheDir = new File(supportDir, "winsw"); DumbSlave slave1 = j.createOnlineSlave(); DumbSlave slave2 = j.createOnlineSlave(); generateBundle(); assertNotNull("The cache directory is empty", cacheDir.list()); for (int i = 0; i < 10; i++) { int cacheDirsCount = cacheDir.list().length; if (cacheDirsCount == 2) { break; } else { Thread.sleep(1000 * 10); } } assertEquals(cacheDir.list().length, 2); j.getInstance().removeNode(slave2); generateBundle(); for (int i = 0; i < 10; i++) { int cacheDirsCount = cacheDir.list().length; if (cacheDirsCount == 1) { break; } else { Thread.sleep(1000 * 10); } } assertEquals(cacheDir.list().length, 1); }
Source:
protected void onSetUpBeforeClosingWelcomePage() throws Exception { String[] fileNames = { VSM, SESSION_FILE, ECORE_FILE }; for (final String fileName : fileNames) { EclipseTestsSupportHelper.INSTANCE.copyFile(Activator.PLUGIN_ID, DATA_UNIT_DIR + fileName, getProjectName() + "/" + fileName); } }

Target:
protected void onSetUpBeforeClosingWelcomePage() throws Exception { copyFileToTestProject(Activator.PLUGIN_ID, DATA_UNIT_DIR, ECORE_FILE, SESSION_FILE, VSM); }
Source:
void processEntry(CanonicalTreeParser m, DirCacheBuildIterator i, WorkingTreeIterator f) throws IOException { if (m != null) { if (!isValidPath(m)) throw new InvalidPathException(m.getEntryPathString()); if (i == null) { if (f != null && !FileMode.TREE.equals(f.getEntryFileMode()) && !f.isEntryIgnored()) { conflicts.add(walk.getPathString()); } else update(m.getEntryPathString(), m.getEntryObjectId(), m.getEntryFileMode()); } else if (f == null || !m.idEqual(i)) { update(m.getEntryPathString(), m.getEntryObjectId(), m.getEntryFileMode()); } else if (i.getDirCacheEntry() != null) { if (f.isModified(i.getDirCacheEntry(), true) || i.getDirCacheEntry().getStage() != 0) update(m.getEntryPathString(), m.getEntryObjectId(), m.getEntryFileMode()); else keep(i.getDirCacheEntry(), f); } else keep(i.getDirCacheEntry(), null); } else { if (f != null) { if (walk.isDirectoryFileConflict()) { conflicts.add(walk.getPathString()); } else { if (i != null) { remove(i.getEntryPathString()); conflicts.remove(i.getEntryPathString()); } else { } } } else { } } }

Target:
void processEntry(CanonicalTreeParser m, DirCacheBuildIterator i, WorkingTreeIterator f) throws IOException { if (m != null) { if (!isValidPath(m)) throw new InvalidPathException(m.getEntryPathString()); if (i == null) { if (f != null && !FileMode.TREE.equals(f.getEntryFileMode()) && !f.isEntryIgnored()) { conflicts.add(walk.getPathString()); } else update(m.getEntryPathString(), m.getEntryObjectId(), m.getEntryFileMode()); } else if (f == null || !m.idEqual(i)) { update(m.getEntryPathString(), m.getEntryObjectId(), m.getEntryFileMode()); } else if (i.getDirCacheEntry() != null) { if (f.isModified(i.getDirCacheEntry(), true) || i.getDirCacheEntry().getStage() != 0) update(m.getEntryPathString(), m.getEntryObjectId(), m.getEntryFileMode()); else { DirCacheEntry entry = i.getDirCacheEntry(); if (entry.getLastModified() == 0) entry.setLastModified(f.getEntryLastModified()); keep(entry); } } else keep(i.getDirCacheEntry()); } else { if (f != null) { if (walk.isDirectoryFileConflict()) { conflicts.add(walk.getPathString()); } else { if (i != null) { remove(i.getEntryPathString()); conflicts.remove(i.getEntryPathString()); } else { } } } else { } } }
Source:
public void testBlobIdIsEncrypted() throws Exception { }

Target:
public void testBlobIdIsEncrypted() throws Exception { BlobId blobIdV1 = getRandomBlobId(BLOB_ID_V1); BlobId blobIdV2 = getRandomBlobId(BLOB_ID_V2); BlobId blobIdV3 = getRandomBlobId(BLOB_ID_V3); assertFalse("V1 encrypted bit should be false", BlobId.isEncrypted(blobIdV1.getID())); assertFalse("V2 encrypted bit should be false", BlobId.isEncrypted(blobIdV2.getID())); assertFalse("V3 encrypted bit should be false", BlobId.isEncrypted(blobIdV3.getID())); assertTrue("V3 should return true if blobIdString has encrypted bit", BlobId.isEncrypted("AAME")); assertTrue("V3 should return true if blobIdString has encrypted bit", BlobId.isEncrypted("AAMF")); assertFalse("V3 should return false if blobIdString has no encrypted", BlobId.isEncrypted("AAMA")); assertFalse("V3 should return false if blobIdString has no encrypted", BlobId.isEncrypted("AAMB")); boolean[] isEncryptedValues = {true, false}; for (boolean isEncrypted : isEncryptedValues) { BlobId blobIdV4 = new BlobId(BLOB_ID_V4, random.nextBoolean() ? BlobIdType.NATIVE : BlobIdType.CRAFTED, (byte) 1, (short) 1, (short) 1, referenceClusterMap.getWritablePartitionIds().get(random.nextInt(3)), isEncrypted); assertEquals("V4 should return true or false based on its encrypted bit", isEncrypted, BlobId.isEncrypted(blobIdV4.getID())); } }
Source:
public Response sequenceGet(String apiName, String label, String apiId, MessageContext messageContext) { InMemoryAPIDeployer inMemoryApiDeployer = new InMemoryAPIDeployer(); GatewayAPIDTO gatewayAPIDTO = inMemoryApiDeployer.getAPIArtifact(apiId, label); JSONObject responseObj = new JSONObject(); JSONArray sequencesArray = new JSONArray(); if (gatewayAPIDTO != null) { if (gatewayAPIDTO.getSequenceToBeAdd() != null ) { SequenceAdminServiceProxy sequenceAdminServiceProxy = new SequenceAdminServiceProxy(gatewayAPIDTO.getTenantDomain()); for (GatewayContentDTO sequence : gatewayAPIDTO.getSequenceToBeAdd()) { try { if (sequenceAdminServiceProxy.isExistingSequence(sequence.getName())) { sequencesArray.put(sequenceAdminServiceProxy.getSequence(sequence.getName())); } else { log.error(sequence.getName() + " was not deployed in the gateway"); } } catch (AxisFault axisFault) { log.error("Error in fetching deployed sequences from Synapse Configuration." , axisFault); } } } responseObj.put("Sequence", sequencesArray); String responseStringObj = String.valueOf(responseObj); return Response.ok().entity(responseStringObj).build(); } else { responseObj.put("Message", "Error"); String responseStringObj = String.valueOf(responseObj); return Response.serverError().entity(responseStringObj).build(); } }

Target:
public Response sequenceGet(String apiName, String label, String apiId, MessageContext messageContext) { InMemoryAPIDeployer inMemoryApiDeployer = new InMemoryAPIDeployer(); GatewayAPIDTO gatewayAPIDTO = inMemoryApiDeployer.getAPIArtifact(apiId, label); JSONObject responseObj = new JSONObject(); if (gatewayAPIDTO != null) { try { JSONArray sequencesArray = new JSONArray(); JSONArray undeployedsequencesArray = new JSONArray(); if (gatewayAPIDTO.getSequenceToBeAdd() != null ) { SequenceAdminServiceProxy sequenceAdminServiceProxy = new SequenceAdminServiceProxy(gatewayAPIDTO.getTenantDomain()); for (GatewayContentDTO sequence : gatewayAPIDTO.getSequenceToBeAdd()) { if(sequenceAdminServiceProxy.isExistingSequence(sequence.getName())) { sequencesArray.put(sequenceAdminServiceProxy.getSequence(sequence.getName())); } else { log.error(sequence.getName() + " was not deployed in the gateway"); undeployedsequencesArray.put(sequence.getContent()); } } } } catch (AxisFault e) { String errorMessage = "Error in fetching deployed artifacts from Synapse Configuration"; log.error(errorMessage, e); RestApiUtil.handleInternalServerError(errorMessage, e, log); } String responseStringObj = String.valueOf(responseObj); return Response.ok().entity(responseStringObj).build(); } else { responseObj.put("Message", "Error"); String responseStringObj = String.valueOf(responseObj); return Response.serverError().entity(responseStringObj).build(); } }
Source:
public void saveNewCharge() { ChargesPayload chargesPayload = new ChargesPayload(); chargesPayload.setAmount(etAmoutDue.getEditableText().toString()); chargesPayload.setLocale(etChargeLocale.getEditableText().toString()); chargesPayload.setDueDate(duedateString); chargesPayload.setDateFormat("dd MMMM yyyy"); chargesPayload.setChargeId(chargeId); initiateChargesCreation(chargesPayload); getDialog().dismiss(); }

Target:
public void saveNewCharge() { ChargesPayload chargesPayload = new ChargesPayload(); chargesPayload.setAmount(etAmoutDue.getEditableText().toString()); chargesPayload.setLocale(etChargeLocale.getEditableText().toString()); chargesPayload.setDueDate(duedateString); chargesPayload.setDateFormat("dd MMMM yyyy"); chargesPayload.setChargeId(chargeId); initiateChargesCreation(chargesPayload); }
Source:
private void checkSplitOrStartNext() throws IOException { if (currentReader != null) { return; } final FileSourceSplit nextSplit = splits.poll(); if (nextSplit == null) { throw new IOException("Cannot fetch from another split - no split remaining"); } currentSplitId = nextSplit.splitId(); currentReader = nextSplit.skippedRecordCount() == 0 ? readerFactory.createReader(config, nextSplit.path(), nextSplit.offset(), nextSplit.length()) : readerFactory.createReader(config, nextSplit.path(), nextSplit.offset(), nextSplit.length(), nextSplit.skippedRecordCount()); }

Target:
private void checkSplitOrStartNext() throws IOException { if (currentReader != null) { return; } final FileSourceSplit nextSplit = splits.poll(); if (nextSplit == null) { throw new IOException("Cannot fetch from another split - no split remaining"); } currentSplitId = nextSplit.splitId(); final Optional<CheckpointedPosition> position = nextSplit.getReaderPosition(); currentReader = position.isPresent() ? readerFactory.restoreReader(config, nextSplit.path(), nextSplit.offset(), nextSplit.length(), position.get()) : readerFactory.createReader(config, nextSplit.path(), nextSplit.offset(), nextSplit.length()); }
Source:
protected void onEvent(final PluginsAddedEvent event) { if (instances == null) { initInstances(); return; } List<PT> list = new LinkedList<>(); event.getItems().forEach(info -> { try { PT instance = getPluginType().cast(pluginService() .createInstance(info)); list.add(instance); } catch (ClassCastException exc) { } }); filterInstances(list).forEach(instance -> { @SuppressWarnings("unchecked") final Class<? extends PT> ptClass = (Class<? extends PT>) instance .getClass(); instanceMap.putIfAbsent(ptClass, instance); if (!instances.contains(instance)) { instances.add(instance); } }); }

Target:
protected void onEvent(final PluginsAddedEvent event) { if (instances == null) { initInstances(); return; } List<PT> list = new LinkedList<>(); event.getItems().forEach(info -> { try { PT instance = getPluginType().cast(pluginService() .createInstance(info)); list.add(instance); } catch (ClassCastException exc) { } }); filterInstances(list).forEach(instance -> { @SuppressWarnings("unchecked") final Class<? extends PT> ptClass = (Class<? extends PT>) instance .getClass(); PT oldInstance = instanceMap.get(ptClass); if (oldInstance != null) { instances.remove(oldInstance); } instanceMap.put(ptClass, instance); instances.add(instance); }); }
Source:
public void testDeserialize() throws IOException, UndeclaredIdentifierException { final String IN_NODE_NAME = "in_node"; final String OUT_NODE_NAME = "out_node"; final String DIGITAL_IN_PORT_NAME = "digital_in"; final String DIGITAL_OUT_PORT_NAME = "digital_out"; URL url = Resources.getResource( "org/manifold/compiler/serialization/data/" + "deserialization-types-test.json"); JsonObject json = new JsonParser().parse( Resources.toString(url, Charsets.UTF_8)).getAsJsonObject(); Schematic sch = new SchematicDeserializer().deserialize(json); Map<String, PortTypeValue> outNodePorts = sch.getNodeType(OUT_NODE_NAME) .getPorts(); Map<String, PortTypeValue> inNodePorts = sch.getNodeType(IN_NODE_NAME) .getPorts(); PortTypeValue digitalIn = sch.getPortType(DIGITAL_IN_PORT_NAME); PortTypeValue digitalOut = sch.getPortType(DIGITAL_OUT_PORT_NAME); assertEquals("dogematics", sch.getName()); assertEquals(sch.getUserDefinedType("Int"), digitalIn.getAttributes().get( "width")); assertEquals(digitalIn, inNodePorts.get("in1")); assertEquals(digitalIn, inNodePorts.get("in2")); assertEquals(digitalOut, outNodePorts.get("out2")); assertEquals(digitalOut, outNodePorts.get("out2")); }

Target:
public void testDeserialize() throws IOException, UndeclaredIdentifierException { final String IN_NODE_NAME = "in_node"; final String OUT_NODE_NAME = "out_node"; final String DIGITAL_IN_PORT_NAME = "digital_in"; final String DIGITAL_OUT_PORT_NAME = "digital_out"; URL url = Resources.getResource( "org/manifold/compiler/serialization/data/" + "deserialization-types-test.json"); JsonObject json = new JsonParser().parse( Resources.toString(url, Charsets.UTF_8)).getAsJsonObject(); Schematic sch = new SchematicDeserializer().deserialize(json); Map<String, PortTypeValue> outNodePorts = sch.getNodeType(OUT_NODE_NAME) .getPorts(); Map<String, PortTypeValue> inNodePorts = sch.getNodeType(IN_NODE_NAME) .getPorts(); PortTypeValue digitalIn = sch.getPortType(DIGITAL_IN_PORT_NAME); PortTypeValue digitalOut = sch.getPortType(DIGITAL_OUT_PORT_NAME); assertEquals(TEST_SCHEMATIC_NAME, sch.getName()); assertEquals(sch.getUserDefinedType("Int"), digitalIn.getAttributes().get( "width")); assertEquals(digitalIn, inNodePorts.get("in1")); assertEquals(digitalIn, inNodePorts.get("in2")); assertEquals(digitalOut, outNodePorts.get("out2")); assertEquals(digitalOut, outNodePorts.get("out2")); }
Source:
public String getDefaultLicenseInfoHeaderText() throws IOException { String defaultLicenseInfoHeader = IOUtils.toString(this.getClass().getResourceAsStream(DEFAULT_LICENSE_INFO_HEADER_FILE), "UTF-8"); defaultLicenseInfoHeader = defaultLicenseInfoHeader.replaceAll("(?m)^#.*\\n", ""); return defaultLicenseInfoHeader; }

Target:
public String getDefaultLicenseInfoHeaderText() { return DEFAULT_LICENSE_INFO_TEXT; }
Source:
public void runWithExpectedCount(int theExpectedCount, Runnable r) { this.clear(); this.setExpectedCount(theExpectedCount); r.run(); try { this.awaitExpected(); } catch (InterruptedException theE) { ourLog.error("InterruptedException while awaiting invocation of {}", this.myPointcut.name()); theE.printStackTrace(); } }

Target:
public void runWithExpectedCount(int theExpectedCount, Runnable r) throws InterruptedException { this.setExpectedCount(theExpectedCount); r.run(); this.awaitExpected(); }
Source:
public MotechUserProfile changeExpiredPassword(String userName, String oldPassword, String newPassword) { MotechUser motechUser = allMotechUsers.findByUserName(userName); validatePassword(newPassword); if (motechUser != null && UserStatus.MUST_CHANGE_PASSWORD.equals(motechUser.getUserStatus()) && passwordEncoder.isPasswordValid(motechUser.getPassword(), oldPassword)) { if (passwordEncoder.isPasswordValid(motechUser.getPassword(), newPassword)) { return null; } motechUser.setPassword(passwordEncoder.encodePassword(newPassword)); motechUser.setUserStatus(UserStatus.ACTIVE); allMotechUsers.update(motechUser); return new MotechUserProfile(motechUser); } incrementFailureLogin(motechUser); return null; }

Target:
public MotechUserProfile changeExpiredPassword(String userName, String oldPassword, String newPassword) { MotechUser motechUser = allMotechUsers.findByUserName(userName); validatePassword(newPassword); if (motechUser != null && UserStatus.MUST_CHANGE_PASSWORD.equals(motechUser.getUserStatus()) && passwordEncoder.isPasswordValid(motechUser.getPassword(), oldPassword)) { if (passwordEncoder.isPasswordValid(motechUser.getPassword(), newPassword)) { return null; } motechUser.setPassword(passwordEncoder.encodePassword(newPassword)); motechUser.setUserStatus(UserStatus.ACTIVE); allMotechUsers.update(motechUser); return new MotechUserProfile(motechUser); } else { incrementFailureLoginCount(motechUser); } return null; }
Source:
public PartitionKey(final Object key) { if (!(key instanceof PartitionKey)) { this.internalPartitionKey = PartitionKeyInternal.fromObjectArray(new Object[] {key}, true); } else{ this.internalPartitionKey = ((PartitionKey) key).internalPartitionKey; } }

Target:
public PartitionKey(final Object key) { this.internalPartitionKey = PartitionKeyInternal.fromObjectArray(new Object[] {key}, true); }
Source:
public InstanceId deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { JsonObject o = json.getAsJsonObject(); return new InstanceId( InstanceId.Status.parse(getString(o, MEMBER_STATUS)), Error.parse(getString(o, MEMBER_ERROR)), getString(o, MEMBER_INSTANCE_ID)); }

Target:
public InstanceId deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { JsonObject o = json.getAsJsonObject(); return new InstanceId( InstanceId.Status.parse(getMandatoryString(o, MEMBER_STATUS)), Error.parse(getString(o, MEMBER_ERROR)), getString(o, MEMBER_INSTANCE_ID)); }
Source:
public void onReceive(Context context, Intent intent) { final String registrationId = intent.getStringExtra("registration_id"); if (!SwrveHelper.isNullOrEmpty(registrationId)) { workaroundRegistrationId = registrationId; } ComponentName comp = new ComponentName(context.getPackageName(), intentServiceClass.getName()); startWakefulService(context, (intent.setComponent(comp))); if (!intent.hasExtra(SwrveGcmNotification.GCM_BUNDLE)) { setResultCode(Activity.RESULT_OK); } }

Target:
public void onReceive(Context context, Intent intent) { if (intent != null) { final String registrationId = intent.getStringExtra("registration_id"); if (!SwrveHelper.isNullOrEmpty(registrationId)) { workaroundRegistrationId = registrationId; } ComponentName comp = new ComponentName(context.getPackageName(), intentServiceClass.getName()); startWakefulService(context, (intent.setComponent(comp))); if (!intent.hasExtra(SwrveGcmNotification.GCM_BUNDLE)) { setResultCode(Activity.RESULT_OK); } } }
Source:
private void generateAddSignature(Method method) { generateDoc(method); Parameter mainParameter = JaxrsGeneratorUtils.getMainAddParameter(method); if (mainParameter == null) { System.err.println("Method \"" + method + "\" doesn't have any struct parameter"); return; } Type mainType = mainParameter.getType(); JavaTypeReference mainTypeReference = schemaNames.getXjcTypeReference(mainType); String parameterName = javaNames.getJavaMemberStyleName(mainParameter.getName()); String methodName = concatenateName(method, method.getBase().getName()); javaBuffer.addLine("default Response " + methodName + "(%s %s) {", mainTypeReference.getText(), parameterName); javaBuffer.addLine("throw new UnsupportedOperationException();"); javaBuffer.addLine("}"); javaBuffer.addLine(); }

Target:
private void generateAddSignature(Method method) { generateDoc(method); Parameter mainParameter = jaxrsGeneratorUtils.getMainAddParameter(method); if (mainParameter == null) { throw new IllegalStateException("Method \"" + method + "\" doesn't have any struct parameter"); } Type mainType = mainParameter.getType(); JavaTypeReference mainTypeReference = schemaNames.getXjcTypeReference(mainType); javaBuffer.addImports(mainTypeReference.getImports()); String parameterName = javaNames.getJavaMemberStyleName(mainParameter.getName()); String methodName = javaNames.getJavaMemberStyleName(names.concatenate(method.getBase().getName(), method.getName())); javaBuffer.addLine("default Response %s(%s %s) {", methodName, mainTypeReference.getText(), parameterName); javaBuffer.addLine("throw new UnsupportedOperationException();"); javaBuffer.addLine("}"); javaBuffer.addLine(); }
Source:
public void onAccountChanged(OnAccountChanged event) { if (!isAdded()) { return; } if (mChangePasswordProgressDialog != null) { showChangePasswordProgressDialog(false); if (event.isError()) { ToastUtils.showToast(getActivity(), event.error.message, ToastUtils.Duration.LONG); AppLog.e(T.SETTINGS, event.error.message); } else { ToastUtils.showToast(getActivity(), R.string.change_password_confirmation, ToastUtils.Duration.LONG); refreshAccountDetails(); } } else { showChangePasswordProgressDialog(false); if (event.isError()) { switch (event.error.type) { case SETTINGS_FETCH_ERROR: ToastUtils.showToast(getActivity(), R.string.error_fetch_account_settings, ToastUtils.Duration.LONG); break; case SETTINGS_POST_ERROR: ToastUtils.showToast(getActivity(), R.string.error_post_account_settings, ToastUtils.Duration.LONG); checkIfEmailChangeIsPending(); break; } } else { refreshAccountDetails(); } } }

Target:
public void onAccountChanged(OnAccountChanged event) { if (!isAdded()) { return; } if (mChangePasswordProgressDialog != null) { showChangePasswordProgressDialog(false); if (event.isError()) { ToastUtils.showToast(getActivity(), event.error.message, ToastUtils.Duration.LONG); AppLog.e(T.SETTINGS, event.error.message); } else { ToastUtils.showToast(getActivity(), R.string.change_password_confirmation, ToastUtils.Duration.LONG); refreshAccountDetails(); } } else { if (event.isError()) { switch (event.error.type) { case SETTINGS_FETCH_ERROR: ToastUtils.showToast(getActivity(), R.string.error_fetch_account_settings, ToastUtils.Duration.LONG); break; case SETTINGS_POST_ERROR: ToastUtils.showToast(getActivity(), R.string.error_post_account_settings, ToastUtils.Duration.LONG); checkIfEmailChangeIsPending(); break; } } else { refreshAccountDetails(); } } }
Source:
public Constraints add(int index, Actor actor) { return add(index, actor, 0); }

Target:
public TrackConstraints add(int index, Actor actor) { return add(index, actor, 0); }
Source:
public synchronized byte[] generate(long position) { random.setSeed(seed + position); int randPercent = random.nextInt(100); int curPercent = 0; RandomGeneratorConfig gen = components.get(0); for (RandomGeneratorConfig generator : components) { curPercent += generator.percent(); if (curPercent > randPercent) { gen = generator; break; } } return gen.component().generate(position); }

Target:
public byte[] generate(long position) { int randPercent; synchronized (random) { random.setSeed(seed + position); randPercent = random.nextInt(100); } int curPercent = 0; RandomComponent com = components.get(0); for (RandomComponent component : components) { curPercent += component.percent(); if (curPercent > randPercent) { com = component; break; } } return com.component().generate(position); }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + fChildren.hashCode(); result = prime * result + fDepth; result = prime * result + (int) (fEnd ^ (fEnd >>> 32)); ICalledFunction parent = fParent; result = prime * result + ((parent == null) ? 0 : parent.hashCode()); result = prime * result + (int) (fSelfTime ^ (fSelfTime >>> 32)); result = prime * result + (int) (fStart ^ (fStart >>> 32)); result = prime * result + getSymbol().hashCode(); return result; }

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + fDepth; result = prime * result + (int) (fEnd ^ (fEnd >>> 32)); ICalledFunction parent = fParent; result = prime * result + ((parent == null) ? 0 : parent.hashCode()); result = prime * result + (int) (fSelfTime ^ (fSelfTime >>> 32)); result = prime * result + (int) (fStart ^ (fStart >>> 32)); result = prime * result + getSymbol().hashCode(); return result; }
Source:
private boolean checkEvaluation(ICPPASTExpression expr) { ICPPEvaluation eval = expr.getEvaluation(); if (eval instanceof EvalTypeId) { ICPPFunction evalFunc = ((EvalTypeId) eval).getConstructor(); if (evalFunc != null && evalFunc.isNoDiscard()) { return true; } } else if (eval instanceof EvalFunctionCall) { ICPPFunction evalFunc = ((EvalFunctionCall) eval).resolveFunctionBinding(); if (evalFunc == null) return false; if (evalFunc.isNoDiscard()) { return true; } else { ICPPFunctionType fType = evalFunc.getType(); IType retType = SemanticUtil.getNestedType(fType.getReturnType(), SemanticUtil.TDEF); if (CPPTemplates.isDependentType(retType)) { return false; } if (retType instanceof ICPPReferenceType || retType instanceof IPointerType) return false; retType = SemanticUtil.getUltimateType(retType, true); if (retType instanceof ICPPClassType) { return ((ICPPClassType) retType).isNoDiscard(); } else if (retType instanceof ICPPEnumeration) { return ((ICPPEnumeration) retType).isNoDiscard(); } else if (retType instanceof ICPPEnumerationSpecialization) { return ((ICPPEnumerationSpecialization) retType).isNoDiscard(); } } } return false; }

Target:
private boolean checkEvaluation(ICPPASTExpression expr) { ICPPEvaluation eval = expr.getEvaluation(); if (eval instanceof EvalTypeId) { ICPPFunction evalFunc = ((EvalTypeId) eval).getConstructor(); if (evalFunc != null && evalFunc.isNoDiscard()) { return true; } } else if (eval instanceof EvalFunctionCall) { ICPPFunction evalFunc = ((EvalFunctionCall) eval).resolveFunctionBinding(); if (evalFunc == null) return false; if (evalFunc.isNoDiscard()) { return true; } else { ICPPFunctionType fType = evalFunc.getType(); IType retType = SemanticUtil.getNestedType(fType.getReturnType(), SemanticUtil.TDEF); if (CPPTemplates.isDependentType(retType)) { return false; } if (retType instanceof ICPPReferenceType || retType instanceof IPointerType) return false; retType = SemanticUtil.getUltimateType(retType, true); if (retType instanceof ICPPClassType) { return ((ICPPClassType) retType).isNoDiscard(); } else if (retType instanceof ICPPEnumeration) { return ((ICPPEnumeration) retType).isNoDiscard(); } } } return false; }
Source:
private void handleUnknownFeatures(final EObject owner, final FeatureMap featureMap) { final Iterator<FeatureMap.Entry> iter = featureMap.iterator(); List<FeatureMap.Entry> entryList = Lists.newArrayList(); while (iter.hasNext()) { entryList.add(iter.next()); } for (FeatureMap.Entry currentEntry : entryList) { handleFeature(owner, currentEntry.getEStructuralFeature(), currentEntry.getValue()); } }

Target:
private void handleUnknownFeatures(final EObject owner, final FeatureMap featureMap) { List<FeatureMap.Entry> entryList = Lists.newArrayList(featureMap.iterator()); for (FeatureMap.Entry currentEntry : entryList) { handleFeature(owner, currentEntry.getEStructuralFeature(), currentEntry.getValue()); } }