auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected StopMachineDetails<Integer> stopAnyProvisionedMachines() { @SuppressWarnings("unchecked") MachineProvisioningLocation<MachineLocation> provisioner = entity().getAttribute(SoftwareProcess.PROVISIONING_LOCATION); if (Iterables.isEmpty(entity().getLocations())) { log.debug("No machine decommissioning necessary for "+entity()+" - no locations"); <START> return new StopMachineDetails<Integer>("No machine decommissioning necessary for - no locations", 0); <END> } if (provisioner==null) { log.debug("No machine decommissioning necessary for "+entity()+" - did not provision"); return new StopMachineDetails<Integer>("No machine decommissioning necessary for - did not provision", 0); } Location machine = getLocation(null); if (!(machine instanceof MachineLocation)) { log.debug("No decommissioning necessary for "+entity()+" - not a machine location ("+machine+")"); return new StopMachineDetails<Integer>("No machine decommissioning necessary for - not a machine ("+machine+")", 0); } try { entity().removeLocations(ImmutableList.of(machine)); entity().setAttribute(Attributes.HOSTNAME, null); entity().setAttribute(Attributes.ADDRESS, null); entity().setAttribute(Attributes.SUBNET_HOSTNAME, null); entity().setAttribute(Attributes.SUBNET_ADDRESS, null); if (provisioner != null) provisioner.release((MachineLocation)machine); } catch (Throwable t) { throw Exceptions.propagate(t); } return new StopMachineDetails<Integer>("Decommissioned "+machine, 1); }</code><technical_language>delete "for " in message? include entity id in message? for lines below</technical_language>

Target:
protected StopMachineDetails<Integer> stopAnyProvisionedMachines() { @SuppressWarnings("unchecked") MachineProvisioningLocation<MachineLocation> provisioner = entity().getAttribute(SoftwareProcess.PROVISIONING_LOCATION); if (Iterables.isEmpty(entity().getLocations())) { log.debug("No machine decommissioning necessary for "+entity()+" - no locations"); return new StopMachineDetails<Integer>("No machine decommissioning necessary - no locations", 0); } if (provisioner==null) { log.debug("No machine decommissioning necessary for "+entity()+" - did not provision"); return new StopMachineDetails<Integer>("No machine decommissioning necessary - did not provision", 0); } Location machine = getLocation(null); if (!(machine instanceof MachineLocation)) { log.debug("No decommissioning necessary for "+entity()+" - not a machine location ("+machine+")"); return new StopMachineDetails<Integer>("No machine decommissioning necessary - not a machine ("+machine+")", 0); } try { entity().removeLocations(ImmutableList.of(machine)); entity().setAttribute(Attributes.HOSTNAME, null); entity().setAttribute(Attributes.ADDRESS, null); entity().setAttribute(Attributes.SUBNET_HOSTNAME, null); entity().setAttribute(Attributes.SUBNET_ADDRESS, null); if (provisioner != null) provisioner.release((MachineLocation)machine); } catch (Throwable t) { throw Exceptions.propagate(t); } return new StopMachineDetails<Integer>("Decommissioned "+machine, 1); }
Source:
<code>protected void persistCommand(String command) { if (command.isEmpty()) { return; } try { <START> Files.write(pendingFile, Arrays.asList(command), StandardOpenOption.CREATE, StandardOpenOption.APPEND); <END> } catch (IOException e) { throw new IllegalStateException("Cannot write to file " + pendingFile, e); } }</code><technical_language>replace Arrays.asList Collections.singletonList</technical_language>

Target:
protected void persistCommand(String command) { if (command.isEmpty()) { return; } try { Files.write(pendingFile, Collections.singletonList(command), StandardOpenOption.CREATE, StandardOpenOption.APPEND); } catch (IOException e) { throw new IllegalStateException("Cannot write to file " + pendingFile, e); } }
Source:
<code>synchronized void updateMissingMessagesInMetadataResponse(List<MessageInfo> messagesWrittenToStore) { Set<MessageInfo> missingStoreMessages = exchangeMetadataResponse.getMissingStoreMessages(); if (missingStoreMessages != null && !missingStoreMessages.isEmpty()) { Set<StoreKey> keysWrittenToStore = messagesWrittenToStore.stream().map(MessageInfo::getStoreKey).collect(Collectors.toSet()); <START> Set<MessageInfo> missingMessagesFoundInStore = new HashSet<>(); <END> for (MessageInfo messageInfo : missingStoreMessages) { if (keysWrittenToStore.contains(messageInfo.getStoreKey())) { missingMessagesFoundInStore.add(messageInfo); } } exchangeMetadataResponse.removeMissingStoreMessages(missingMessagesFoundInStore); } }</code><technical_language>I need a more clarification here: if messageInfo missingStoreMessages is DELETE/TTLUpdate PUT, do apply updates</technical_language>

Target:
synchronized void updateMissingMessagesInMetadataResponse(List<MessageInfo> messagesWrittenToStore) { Set<MessageInfo> missingStoreMessages = exchangeMetadataResponse.getMissingStoreMessages(); if (missingStoreMessages != null && !missingStoreMessages.isEmpty()) { Set<StoreKey> keysWrittenToStore = messagesWrittenToStore.stream().map(MessageInfo::getStoreKey).collect(Collectors.toSet()); Set<MessageInfo> missingMessagesFoundInStore = missingStoreMessages.stream() .filter(message -> keysWrittenToStore.contains(message.getStoreKey())) .collect(Collectors.toSet()); exchangeMetadataResponse.removeMissingStoreMessages(missingMessagesFoundInStore); } }
Source:
<code>public static synchronized void executeDropinsCapability(String carbonHome, String carbonProfile) throws IOException { Path dropinsDirectoryPath = Paths.get(carbonHome, Constants.OSGI_REPOSITORY, dropinsDirectory); Path bundlesInfoFile = Paths. get(carbonHome, Constants.OSGI_REPOSITORY, Constants.PROFILE_PATH, carbonProfile, "configuration", <START> "org.eclipse.equinox.simpleconfigurator", "bundles.info"); <END> if (newBundlesInfo == null) { newBundlesInfo = getNewBundlesInfo(dropinsDirectoryPath); } if (hasToUpdateBundlesInfoFile(newBundlesInfo, bundlesInfoFile)) { logger.log(Level.INFO, "New file changes detected in " + dropinsDirectory); List<BundleInfo> effectiveNewBundleInfo = mergeDropinsBundleInfo(newBundlesInfo, bundlesInfoFile); logger.log(Level.INFO, "Updating the OSGi bundle information of Carbon Profile: " + carbonProfile + "..."); updateBundlesInfo(effectiveNewBundleInfo, bundlesInfoFile); logger.log(Level.INFO, "Successfully updated the OSGi bundle information of Carbon Profile: " + carbonProfile); } else { logger.log(Level.INFO, "No changes detected in the dropins directory, skipped the OSGi bundle information " + "update for Carbon Profile: " + carbonProfile); } }</code><technical_language>move "bundles.info" a Constant reused (including Tests)</technical_language>

Target:
public static synchronized void executeDropinsCapability(String carbonHome, String carbonProfile) throws IOException { Path dropinsDirectoryPath = Paths.get(carbonHome, Constants.OSGI_REPOSITORY, Constants.DROPINS); Path bundlesInfoFile = Paths. get(carbonHome, Constants.OSGI_REPOSITORY, Constants.PROFILE_PATH, carbonProfile, "configuration", "org.eclipse.equinox.simpleconfigurator", Constants.BUNDLES_INFO); if (newBundlesInfo == null) { logger.log(Level.FINE, "Loading the new OSGi bundle information from " + Constants.DROPINS + " folder..."); newBundlesInfo = getNewBundlesInfo(dropinsDirectoryPath); logger.log(Level.FINE, "Successfully loaded the new OSGi bundle information from " + Constants.DROPINS + " folder"); } else { logger.log(Level.FINE, "The OSGi bundle information from " + Constants.DROPINS + " folder are " + "already loaded"); } if (hasToUpdateBundlesInfoFile(newBundlesInfo, bundlesInfoFile)) { logger.log(Level.INFO, "New file changes detected in " + Constants.DROPINS + " folder"); List<BundleInfo> effectiveNewBundleInfo = mergeDropinsBundleInfo(newBundlesInfo, bundlesInfoFile); logger.log(Level.INFO, "Updating the OSGi bundle information of Carbon Profile: " + carbonProfile + "..."); updateBundlesInfo(effectiveNewBundleInfo, bundlesInfoFile); logger.log(Level.INFO, "Successfully updated the OSGi bundle information of Carbon Profile: " + carbonProfile); } else { logger.log(Level.INFO, "No changes detected in the dropins directory, skipped the OSGi bundle information " + "update for Carbon Profile: " + carbonProfile); } }
Source:
<code>private void findSingletons(BitSet restriction) { for (int i = restriction.nextSetBit(0); i >= 0; i = restriction.nextSetBit(i + 1)) { <START> if (graph.getPredOf(i).size() * graph.getSuccOf(i).size() == 0) { <END> nodeSCC[i] = nbSCC; sccFirstNode[nbSCC++] = i; restriction.clear(i); } } }</code><technical_language>I suggest: if (graph.getPredOf(i).size() == 0 || graph.getSuccOf(i).size() == 0) {</technical_language>

Target:
private void findSingletons(BitSet restriction) { for (int i = restriction.nextSetBit(0); i >= 0; i = restriction.nextSetBit(i + 1)) { if (graph.getPredOf(i).size() == 0 || graph.getSuccOf(i).size() == 0) { nodeSCC[i] = nbSCC; sccFirstNode[nbSCC++] = i; restriction.clear(i); } } }
Source:
<code>private CopyFileOption copySecretPropertiesOption() { Path carbonYmlFilePath; String basedir = System.getProperty("basedir"); if (basedir == null) { basedir = Paths.get(".").toString(); } <START> carbonYmlFilePath = Paths.get(basedir, "src", "test", "resources", "property-resolve", <END> SECRET_PROPERTIES_FILENAME); return new CopyFileOption(carbonYmlFilePath, Paths.get("conf", SECRET_PROPERTIES_FILENAME)); }</code><technical_language>name of resources directory is "property-resolve" ? a meaningful name test cases</technical_language>

Target:
private CopyFileOption copySecretPropertiesOption() { Path carbonYmlFilePath; String basedir = System.getProperty("basedir"); if (basedir == null) { basedir = Paths.get(".").toString(); } carbonYmlFilePath = Paths.get(basedir, "src", "test", "resources", "carbon-config", SECRET_PROPERTIES_FILENAME); return new CopyFileOption(carbonYmlFilePath, Paths.get("conf", SECRET_PROPERTIES_FILENAME)); }
Source:
<code>public Comparator<Integer> getComparator() { <START> return REVESE_COMPARATOR; <END> }</code><technical_language>Comparator.reverseOrder()</technical_language>

Target:
public Comparator<Integer> getComparator() { return Comparator.reverseOrder(); }
Source:
<code>public void deleteCredential(String credentialName) throws RealmUnavailableException { Assert.checkNotNullParam("credentialName", credentialName); if (!exists()) { throw log.ldapRealmIdentityNotExists(name); } <START> Assert.unsupported(); END> }</code><technical_language>This method is ineffective is preceded throw</technical_language>

Target:
public void deleteCredential(String credentialName) throws RealmUnavailableException { Assert.checkNotNullParam("credentialName", credentialName); if (!exists()) { throw log.ldapRealmIdentityNotExists(name); } throw Assert.unsupported(); }
Source:
<code>private void createActionCombos(Composite parent) { actionComposite = getWidgetFactory().createComposite(parent); GridData actionCompositeLayoutData = new GridData(GridData.FILL, 0, true, false); actionCompositeLayoutData.horizontalSpan = 3; actionComposite.setLayoutData(actionCompositeLayoutData); RowLayout layout = new RowLayout(); layout.fill = true; actionComposite.setLayout(layout); getWidgetFactory().createCLabel(actionComposite, "Algorithm: "); algorithmCombo = new Combo(actionComposite, SWT.SINGLE | SWT.READ_ONLY); algorithmCombo.addListener(SWT.Selection, event -> { removeContentAdapter(); if (ECCHelpers.EMPTY_FIELD.equals(algorithmCombo.getText())) { BasicFBType fb = <START> ECCHelpers.getFBType(getType()); <END> if (null != fb) { executeCommand(new ChangeAlgorithmCommand(getType(), fb.getAlgorithm().get(algorithmCombo.indexOf(algorithmCombo.getText())))); } } else { executeCommand(new ChangeAlgorithmCommand(getType(), null)); } algorithmGroup.setAlgorithm(getAlgorithm()); algorithmList.refresh(); addContentAdapter(); }); getWidgetFactory().createCLabel(actionComposite, "Output Event: "); outputEventCombo = new Combo(actionComposite, SWT.SINGLE | SWT.READ_ONLY); outputEventCombo.addListener(SWT.Selection, event -> { removeContentAdapter(); executeCommand(new ChangeOutputCommand(getType(), events.get(outputEventCombo.getText()))); addContentAdapter(); }); }</code><technical_language>this code fragment is a lot. I improve readability extract private method getFBType() for this class</technical_language>

Target:
private void createActionCombos(Composite parent) { actionComposite = getWidgetFactory().createComposite(parent); GridData actionCompositeLayoutData = new GridData(GridData.FILL, 0, true, false); actionCompositeLayoutData.horizontalSpan = 3; actionComposite.setLayoutData(actionCompositeLayoutData); RowLayout layout = new RowLayout(); layout.fill = true; actionComposite.setLayout(layout); getWidgetFactory().createCLabel(actionComposite, "Algorithm: "); algorithmCombo = new Combo(actionComposite, SWT.SINGLE | SWT.READ_ONLY); algorithmCombo.addListener(SWT.Selection, event -> { removeContentAdapter(); if (ECCContentAndLabelProvider.EMPTY_FIELD.equals(algorithmCombo.getText())) { executeCommand(new ChangeAlgorithmCommand(getType(), null)); } else { BasicFBType fb = getFBType(); if (null != fb) { executeCommand(new ChangeAlgorithmCommand(getType(), fb.getAlgorithm().get(algorithmCombo.indexOf(algorithmCombo.getText())))); } } algorithmGroup.setAlgorithm(getAlgorithm()); algorithmList.refresh(); addContentAdapter(); }); getWidgetFactory().createCLabel(actionComposite, "Output Event: "); outputEventCombo = new Combo(actionComposite, SWT.SINGLE | SWT.READ_ONLY); outputEventCombo.addListener(SWT.Selection, event -> { removeContentAdapter(); executeCommand(new ChangeOutputCommand(getType(), ECCContentAndLabelProvider.getOutputEvents(getFBType()).get(outputEventCombo.indexOf(outputEventCombo.getText())))); addContentAdapter(); }); }
Source:
<code>public List<JPAObject> query(QueryRequest request) throws EDBException { synchronized (entityManager) { LOGGER.debug("Perform query with the query object: {}", request); CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<JPAObject> criteriaQuery = criteriaBuilder.createQuery(JPAObject.class); Root<JPAObject> from = criteriaQuery.from(JPAObject.class); List<Predicate> predicates = convertRequestToPredicateList(request, from, criteriaBuilder); predicates.add(criteriaBuilder.notEqual(from.get("isDeleted"), Boolean.TRUE)); Subquery<Long> subquery = criteriaQuery.subquery(Long.class); Root subFrom = subquery.from(JPAObject.class); Expression<Long> maxExpression = criteriaBuilder.max(subFrom.get("timestamp")); subquery.select(maxExpression); Predicate p1 = criteriaBuilder.equal(subFrom.get("oid"), from.get("oid")); Predicate p2 = criteriaBuilder.le(subFrom.get("timestamp"), request.getTimestamp()); subquery.where(criteriaBuilder.and(p1, p2)); predicates.add(criteriaBuilder.equal(from.get("timestamp"), subquery)); <START> criteriaQuery.where(predicates.toArray(new Predicate[predicates.size()])); <END> TypedQuery<JPAObject> typedQuery = entityManager.createQuery(criteriaQuery); return typedQuery.getResultList(); } }</code><technical_language>guava Iterables.toArray method fit here</technical_language>

Target:
public List<JPAObject> query(QueryRequest request) throws EDBException { synchronized (entityManager) { LOGGER.debug("Perform query with the query object: {}", request); CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<JPAObject> criteriaQuery = criteriaBuilder.createQuery(JPAObject.class); Root<JPAObject> from = criteriaQuery.from(JPAObject.class); List<Predicate> predicates = convertRequestToPredicateList(request, from, criteriaBuilder); predicates.add(criteriaBuilder.notEqual(from.get("isDeleted"), Boolean.TRUE)); Subquery<Long> subquery = criteriaQuery.subquery(Long.class); Root subFrom = subquery.from(JPAObject.class); Expression<Long> maxExpression = criteriaBuilder.max(subFrom.get("timestamp")); subquery.select(maxExpression); Predicate p1 = criteriaBuilder.equal(subFrom.get("oid"), from.get("oid")); Predicate p2 = criteriaBuilder.le(subFrom.get("timestamp"), request.getTimestamp()); subquery.where(criteriaBuilder.and(p1, p2)); predicates.add(criteriaBuilder.equal(from.get("timestamp"), subquery)); criteriaQuery.where(Iterables.toArray(predicates, Predicate.class)); TypedQuery<JPAObject> typedQuery = entityManager.createQuery(criteriaQuery); return typedQuery.getResultList(); } }
Source:
<code>public void testListServiceKeys() throws Exception { List<ServiceKey> possibleServiceKeys = api().listServiceKeys(); assertNotNull(possibleServiceKeys, "possibleServiceKeys was not set"); assertTrue(possibleServiceKeys.size() > 0, "Expected at least 1 ServiceKey but list was empty"); ServiceKey possibleServiceKey = Iterables.find(possibleServiceKeys, new Predicate<ServiceKey>() { @Override public boolean apply(ServiceKey arg0) { return (arg0.key().equals(serviceKey)) ? true : false; } <START> }); <END> assertNotNull(possibleServiceKey, "Expected but could not find ServiceKey amongst " + possibleServiceKeys.size() + " found"); }</code><technical_language>find method fail if find result. instead: java assertTrue(any(possibleServiceKeys, new Predicate<ServiceKey>() { @Override public boolean apply(ServiceKey input) { return input.key().equals(serviceKey); } }, "Expected find ServiceKey " + possibleServiceKeys.size() + " found");</technical_language>

Target:
public void testListServiceKeys() throws Exception { List<ServiceKey> possibleServiceKeys = api().listServiceKeys(); assertNotNull(possibleServiceKeys, "possibleServiceKeys was not set"); assertTrue(possibleServiceKeys.size() > 0, "Expected at least 1 ServiceKey but list was empty"); ServiceKey possibleServiceKey = Iterables.find(possibleServiceKeys, new Predicate<ServiceKey>() { @Override public boolean apply(ServiceKey arg0) { return arg0.key().equals(serviceKey); } }, null); assertNotNull(possibleServiceKey, "Expected but could not find ServiceKey amongst " + possibleServiceKeys.size() + " found"); }
Source:
<code>public void hook(ExtensionHook extensionHook) { super.hook(extensionHook); ScriptEngine se = getGroovyScriptEngine(); if (se != null) { <START> getExtScript().registerScriptEngineWrapper(new GroovyEngineWrapper(se)); <END> } else { LOGGER.error("No Groovy engine found"); } }</code><technical_language>worth checking script extension is loaded, getExtScript returns non-null</technical_language>

Target:
public void hook(ExtensionHook extensionHook) { super.hook(extensionHook); groovyEngine = new GroovyEngineWrapper(); getExtScript().registerScriptEngineWrapper(groovyEngine); }
Source:
<code>void recordStorageCacheBehavior(MetaData metaData) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { File cacheDir = appContext.getCacheDir(); try { <START> boolean tombstone = storageManager.isCacheBehaviorTombstone(cacheDir); <END> boolean group = storageManager.isCacheBehaviorGroup(cacheDir); metaData.addToTab(INTERNAL_DIAGNOSTICS_TAB, "cacheTombstone", tombstone); metaData.addToTab(INTERNAL_DIAGNOSTICS_TAB, "cacheGroup", group); } catch (IOException exc) { Logger.warn("Failed to record cache behaviour, skipping diagnostics", exc); } } }</code><technical_language>this in deceptively false, e.g. if storageManager.isCacheBehaviorTombstone(cacheDir) == false storageManager.isCacheBehaviorTombstone(cacheDir + "/bugsnag-errors") == true</technical_language>

Target:
void recordStorageCacheBehavior(MetaData metaData) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { File cacheDir = appContext.getCacheDir(); File errDir = new File(cacheDir, "bugsnag-errors"); try { boolean tombstone = storageManager.isCacheBehaviorTombstone(errDir); boolean group = storageManager.isCacheBehaviorGroup(errDir); metaData.addToTab(INTERNAL_DIAGNOSTICS_TAB, "cacheTombstone", tombstone); metaData.addToTab(INTERNAL_DIAGNOSTICS_TAB, "cacheGroup", group); } catch (IOException exc) { Logger.warn("Failed to record cache behaviour, skipping diagnostics", exc); } } }
Source:
<code>public void query_explain_multipleIndexes_invalidIndexName() { StubMappingScope scope = indexManager.createScope( otherIndexManager ); LuceneSearchQuery<DocumentReference> query = scope.query().extension( LuceneExtension.get() ) .where( f -> f.id().matching( FIRST_ID ) ) .toQuery(); Assertions.assertThatThrownBy( () -> query.explain( "NotAMappedTypeName", FIRST_ID ) ) .isInstanceOf( SearchException.class ) .hasMessageContaining( "mapped type name 'NotAMappedTypeName' is not among the mapped types targeted by this query: [", <START> TYPE_NAME, OTHER_INDEX_NAME, "]" <END> ); }</code><technical_language>OTHER_INDEX_NAME => OTHER_TYPE_NAME? surprised test passed, way..</technical_language>

Target:
public void query_explain_multipleIndexes_invalidIndexName() { StubMappingScope scope = indexManager.createScope( otherIndexManager ); LuceneSearchQuery<DocumentReference> query = scope.query().extension( LuceneExtension.get() ) .where( f -> f.id().matching( FIRST_ID ) ) .toQuery(); Assertions.assertThatThrownBy( () -> query.explain( "NotAnIndexName", FIRST_ID ) ) .isInstanceOf( SearchException.class ) .hasMessageContaining( "mapped type name 'NotAnIndexName' is not among the mapped types targeted by this query: [" + TYPE_NAME + ", " + OTHER_TYPE_NAME + "]" ); }
Source:
<code>public void prepare() { configureServices(); logger.debug("Preparing kjar"); KieServices ks = KieServices.Factory.get(); ReleaseId releaseId = ks.newReleaseId(ADMIN_GROUP_ID, ADMIN_ARTIFACT_ID, ADMIN_VERSION_V1); List<String> processes = new ArrayList<String>(); processes.add("repo/processes/general/humanTask.bpmn"); InternalKieModule kJar1 = createKieJar(ks, releaseId, processes); File pom = new File("target/admin", "pom.xml"); pom.getParentFile().mkdir(); try { FileOutputStream fs = new FileOutputStream(pom); fs.write(getPom(releaseId).getBytes()); fs.close(); } catch (Exception e) { } MavenRepository repository = getMavenRepository(); repository.installArtifact(releaseId, kJar1, pom); userTaskAdminService = new UserTaskAdminServiceImpl(); ((UserTaskAdminServiceImpl) userTaskAdminService).setUserTaskService(userTaskService); ((UserTaskAdminServiceImpl) userTaskAdminService).setRuntimeDataService(runtimeDataService); ((UserTaskAdminServiceImpl) userTaskAdminService).setIdentityProvider(identityProvider); deploymentUnit = new KModuleDeploymentUnit(ADMIN_GROUP_ID, ADMIN_ARTIFACT_ID, ADMIN_VERSION_V1); deploymentService.deploy(deploymentUnit); units.add(deploymentUnit); identityProvider.setName("Administrator"); <START> identityProvider.setRoles(Arrays.asList("")); <END> }</code><technical_language>Collections.singletonList("");</technical_language>

Target:
public void prepare() { configureServices(); logger.debug("Preparing kjar"); KieServices ks = KieServices.Factory.get(); ReleaseId releaseId = ks.newReleaseId(ADMIN_GROUP_ID, ADMIN_ARTIFACT_ID, ADMIN_VERSION_V1); List<String> processes = new ArrayList<String>(); processes.add("repo/processes/general/humanTask.bpmn"); InternalKieModule kJar1 = createKieJar(ks, releaseId, processes); File pom = new File("target/admin", "pom.xml"); pom.getParentFile().mkdir(); try { FileOutputStream fs = new FileOutputStream(pom); fs.write(getPom(releaseId).getBytes()); fs.close(); } catch (Exception e) { } MavenRepository repository = getMavenRepository(); repository.installArtifact(releaseId, kJar1, pom); userTaskAdminService = new UserTaskAdminServiceImpl(); ((UserTaskAdminServiceImpl) userTaskAdminService).setUserTaskService(userTaskService); ((UserTaskAdminServiceImpl) userTaskAdminService).setRuntimeDataService(runtimeDataService); ((UserTaskAdminServiceImpl) userTaskAdminService).setIdentityProvider(identityProvider); deploymentUnit = new KModuleDeploymentUnit(ADMIN_GROUP_ID, ADMIN_ARTIFACT_ID, ADMIN_VERSION_V1); deploymentService.deploy(deploymentUnit); units.add(deploymentUnit); identityProvider.setName("Administrator"); identityProvider.setRoles(Collections.singletonList("")); }
Source:
<code><START> String stripInvalidCharacters(String input) { <END> StringBuilder filteredValue = new StringBuilder(input.length()); for (char c : input.toCharArray()) { if (Character.isLetterOrDigit(c)) { filteredValue.append(c); } } return filteredValue.toString(); }</code><technical_language>This method previously private; I suspect access modifier removed in error</technical_language>

Target:
private String stripInvalidCharacters(String input) { StringBuilder filteredValue = new StringBuilder(input.length()); for (char c : input.toCharArray()) { if (Character.isLetterOrDigit(c)) { filteredValue.append(c); } } return filteredValue.toString(); }
Source:
<code>public String getAccessToken() throws PayPalRESTException { <START> if (accessToken == null) { <END> accessToken = generateAccessToken(); } else if ((accessToken != null) && (expiresIn() <= 0)) { accessToken = generateAccessToken(); } return accessToken; }</code><technical_language>refactor of this if else if condition ? java if (!accessToken || (accessToken && expiresIn() <= 0)) { accessToken = generateAccessToken(); }</technical_language>

Target:
public String getAccessToken() throws PayPalRESTException { if (accessToken == null || expiresIn() <= 0) { accessToken = generateAccessToken(); } return accessToken; }
Source:
<code>public Response deleteRESTConfig(@PathParam("clusterId") String clusterId) { ConfigAccessor accessor = getConfigAccessor(); try { accessor.deleteRESTConfig(clusterId); } catch (HelixException ex) { <START> _logger.info("Failed to delete rest config for cluster " + clusterId <END> + ", cluster rest config is not found, Exception: " + ex); } catch (Exception ex) { _logger.error("Failed to delete rest config, cluster " + clusterId + ", Exception: " + ex); return serverError(ex); } return OK(); }</code><technical_language>Failed delete finally returning OK response? 404 more appropriate</technical_language>

Target:
public Response deleteRESTConfig(@PathParam("clusterId") String clusterId) { ConfigAccessor accessor = getConfigAccessor(); try { accessor.deleteRESTConfig(clusterId); } catch (HelixException ex) { LOG.info("Failed to delete rest config for cluster {}, cluster rest config is not found. Exception: {}.", clusterId, ex); return notFound(ex.getMessage()); } catch (Exception ex) { LOG.error("Failed to delete rest config, cluster {}, Exception: {}.", clusterId, ex); return serverError(ex); } return OK(); }
Source:
<code>public final void setClassLoader(ClassLoader classLoader) { <START> this.loader = classLoader; <END> }</code><technical_language>this is a setter, need update it</technical_language>

Target:
public final void setClassLoader(ClassLoader classLoader) { this.classLoader = classLoader; }
Source:
<code>public List<String> getAvailableTabs(@PathVariable String moduleName) { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); Map<String, List<String>> tabAccessMap = uiFrameworkService.getModuleData(moduleName).getTabAccessMap(); ArrayList<String> availableTabs = new ArrayList<String>(); for (String tab : tabAccessMap.keySet()) { <START> if(tabAccessMap.get(tab).size() == 0) { <END> availableTabs.add(tab); } for (String permission : tabAccessMap.get(tab)) { if (auth.getAuthorities().contains(new SimpleGrantedAuthority(permission))) { if (!availableTabs.contains(tab)) { availableTabs.add(tab); } } } } return availableTabs; }</code><technical_language>treat null permissions zero size</technical_language>

Target:
public List<String> getAvailableTabs(@PathVariable String moduleName) { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); Map<String, List<String>> tabAccessMap = uiFrameworkService.getModuleData(moduleName).getTabAccessMap(); ArrayList<String> availableTabs = new ArrayList<String>(); for (String tab : tabAccessMap.keySet()) { if(tabAccessMap.get(tab) == null || tabAccessMap.get(tab).size() == 0) { availableTabs.add(tab); } else { for (String permission : tabAccessMap.get(tab)) { if (auth.getAuthorities().contains(new SimpleGrantedAuthority(permission))) { if (!availableTabs.contains(tab)) { availableTabs.add(tab); } } } } } return availableTabs; }
Source:
<code>private void parseChangeMessage(PatchSet.Id psId, Account.Id accountId, RevCommit commit) { byte[] raw = commit.getRawBuffer(); int size = raw.length; Charset enc = RawParseUtils.parseEncoding(raw); int subjectStart = RawParseUtils.commitMessage(raw, 0); if (subjectStart < 0 || subjectStart >= size) { return; } int subjectEnd = RawParseUtils.endOfParagraph(raw, subjectStart); if (subjectEnd == size) { return; } int changeMessageStart; if (raw[subjectEnd] == '\n') { changeMessageStart = subjectEnd + 2; } else if (raw[subjectEnd] == '\r') { changeMessageStart = subjectEnd + 4; } else { return; } int ptr = size - 1; int changeMessageEnd = -1; while(ptr > changeMessageStart) { ptr = RawParseUtils.prevLF(raw, ptr, '\r'); if (ptr == -1) { break; } if (raw[ptr] == '\n') { changeMessageEnd = ptr - 1; break; } else if (raw[ptr] == '\r') { changeMessageEnd = ptr - 3; break; } } if (ptr <= changeMessageStart) { return; } String <START> changeMessageString = <END> RawParseUtils.decode(enc, raw, changeMessageStart, changeMessageEnd + 1); ChangeMessage changeMessage = new ChangeMessage(new ChangeMessage.Key(psId.getParentKey(), commit.name()), accountId, new Timestamp(commit.getCommitterIdent().getWhen().getTime()), psId); changeMessage.setMessage(changeMessageString); changeMessages.add(changeMessage); }</code><technical_language>Optional: a shorter name "msg"</technical_language>

Target:
private void parseChangeMessage(PatchSet.Id psId, Account.Id accountId, RevCommit commit) { byte[] raw = commit.getRawBuffer(); int size = raw.length; Charset enc = RawParseUtils.parseEncoding(raw); int subjectStart = RawParseUtils.commitMessage(raw, 0); if (subjectStart < 0 || subjectStart >= size) { return; } int subjectEnd = RawParseUtils.endOfParagraph(raw, subjectStart); if (subjectEnd == size) { return; } int changeMessageStart; if (raw[subjectEnd] == '\n') { changeMessageStart = subjectEnd + 2; } else if (raw[subjectEnd] == '\r') { changeMessageStart = subjectEnd + 4; } else { return; } int ptr = size - 1; int changeMessageEnd = -1; while(ptr > changeMessageStart) { ptr = RawParseUtils.prevLF(raw, ptr, '\r'); if (ptr == -1) { break; } if (raw[ptr] == '\n') { changeMessageEnd = ptr - 1; break; } else if (raw[ptr] == '\r') { changeMessageEnd = ptr - 3; break; } } if (ptr <= changeMessageStart) { return; } String changeMsgString = RawParseUtils.decode(enc, raw, changeMessageStart, changeMessageEnd + 1); ChangeMessage changeMessage = new ChangeMessage( new ChangeMessage.Key(psId.getParentKey(), commit.name()), accountId, new Timestamp(commit.getCommitterIdent().getWhen().getTime()), psId); changeMessage.setMessage(changeMsgString); changeMessages.put(psId, changeMessage); }
Source:
<code>public static Map<String,Object> createConfig(String[] args) { String[] cfgItems = { ContextProperties.APP_DIR, ContextProperties.BUNDLE, ContextProperties.KEEP_ARTIFACTS, ContextProperties.TOOLKIT_DIR, ContextProperties.TRACING_LEVEL, JobProperties.GROUP, JobProperties.NAME, JobProperties.OVERRIDE_RESOURCE_LOAD_PROTECTION, JobProperties.DATA_DIRECTORY, JobProperties.PRELOAD_APPLICATION_BUNDLES, }; Map<String,Object> config = new HashMap<String,Object>(); for (String arg : args) { String[] toks = arg.split("=", 2); if (toks.length > 1) { for (String item : cfgItems) { if (toks[0].equals(item)) { String valStr = toks[1]; Object value = valStr; if (item.equals(ContextProperties.BUNDLE)) value = new File(valStr); else if (item.equals(ContextProperties.TRACING_LEVEL)) value = toTracingLevel(valStr); else if (item.equals(ContextProperties.KEEP_ARTIFACTS)) value = Boolean.valueOf(valStr); else if (item.equals(JobProperties.OVERRIDE_RESOURCE_LOAD_PROTECTION)) value = Boolean.valueOf(valStr); else if (item.equals(JobProperties.PRELOAD_APPLICATION_BUNDLES)) value = Boolean.valueOf(valStr); config.put(item, value); <START> System.out.println("Setting config: item="+item+" value="+value+" [arg="+arg+"]"); <END> } } } } return config; }</code><technical_language>This a logger, System.out. System.out is for application output</technical_language>

Target:
public static Map<String,Object> createConfig(String[] args) { String[] cfgItems = { ContextProperties.APP_DIR, ContextProperties.BUNDLE, ContextProperties.KEEP_ARTIFACTS, ContextProperties.TOOLKIT_DIR, ContextProperties.TRACING_LEVEL, JobProperties.GROUP, JobProperties.NAME, JobProperties.OVERRIDE_RESOURCE_LOAD_PROTECTION, JobProperties.DATA_DIRECTORY, JobProperties.PRELOAD_APPLICATION_BUNDLES, }; Map<String,Object> config = new HashMap<String,Object>(); for (String arg : args) { String[] toks = arg.split("=", 2); if (toks.length > 1) { for (String item : cfgItems) { if (toks[0].equals(item)) { String valStr = toks[1]; Object value = valStr; if (item.equals(ContextProperties.BUNDLE)) value = new File(valStr); else if (item.equals(ContextProperties.TRACING_LEVEL)) value = toTracingLevel(valStr); else if (item.equals(ContextProperties.KEEP_ARTIFACTS)) value = Boolean.valueOf(valStr); else if (item.equals(JobProperties.OVERRIDE_RESOURCE_LOAD_PROTECTION)) value = Boolean.valueOf(valStr); else if (item.equals(JobProperties.PRELOAD_APPLICATION_BUNDLES)) value = Boolean.valueOf(valStr); config.put(item, value); LOGGER.info("Setting config: item="+item+" value="+value+" [arg="+arg+"]"); } } } } return config; }
Source:
<code>public IP2Problems check(ObservationElements elements) { Option<ObsContext> opt = elements.getObsContext(); if (opt.isEmpty()) return null; ObsContext ctx = opt.getValue(); P2Problems problems = new P2Problems(); for (ISPProgramNode targetNode : elements.getTargetObsComponentNode()) { for (PwfsGuideProbe pwfs : PwfsGuideProbe.values()) { TargetEnvironment env = ctx.getTargets(); Option<GuideProbeTargets> gtOpt = env.getPrimaryGuideProbeTargets(pwfs); if (gtOpt.isEmpty()) continue; GuideProbeTargets gt = gtOpt.getValue(); Option<SPTarget> primaryOpt = gt.getPrimary(); if (primaryOpt.isEmpty()) continue; SPTarget primary = primaryOpt.getValue(); try { pwfs.checkBoundaries(primary, ctx).foreach(bs -> { switch (bs) { case nearBoundary: <START> problems.addWarning(PREFIX + "WARN", "The " + pwfs.getKey() + WARN, targetNode); <END> break; case inRange: break; case vignetting: case outOfRange: problems.addError(PREFIX + "ERROR", "The " + pwfs.getKey() + ERROR, targetNode); break; } }); } catch (InternalError e) { } } } return problems; }</code><technical_language>So, checkBoundaries returning vignetting limit. renamed this nearBoundary warning message is vignetting. I want vignetting enum here</technical_language>

Target:
public IP2Problems check(ObservationElements elements) { Option<ObsContext> opt = elements.getObsContext(); if (opt.isEmpty()) return null; ObsContext ctx = opt.getValue(); P2Problems problems = new P2Problems(); for (ISPProgramNode targetNode : elements.getTargetObsComponentNode()) { for (PwfsGuideProbe pwfs : PwfsGuideProbe.values()) { TargetEnvironment env = ctx.getTargets(); Option<GuideProbeTargets> gtOpt = env.getPrimaryGuideProbeTargets(pwfs); if (gtOpt.isEmpty()) continue; GuideProbeTargets gt = gtOpt.getValue(); Option<SPTarget> primaryOpt = gt.getPrimary(); if (primaryOpt.isEmpty()) continue; SPTarget primary = primaryOpt.getValue(); try { pwfs.checkBoundaries(primary, ctx).foreach(bs -> { switch (bs) { case vignetting: problems.addWarning(PREFIX + "WARN", "The " + pwfs.getKey() + WARN, targetNode); break; case inRange: break; case outOfRange: problems.addError(PREFIX + "ERROR", "The " + pwfs.getKey() + ERROR, targetNode); break; } }); } catch (InternalError e) { } } } return problems; }
Source:
<code>public void setUp() throws Exception { tmpRoot = Files.createTempDirectory("repo"); tmp = TestUtil.createAndCopyToDirectory(tmpRoot, "dummy", "target/test-classes/dummy_empty_deps"); configurationMap = new DynamicDependencyTypeConfigurationMap(); DependencyType depType = new FakeJPATypeDependency(); configurationMap.addDependencies(depType, depType.getDependencies()); <START> JPA_HIBERNATE_VERSION = configurationMap.getMapping().get(depType.getType()).get(0).getVersion(); <END> }</code><technical_language>jpa here? if a random item.. please try JPA avoid confusion real JPA dependency</technical_language>

Target:
public void setUp() throws Exception { tmpRoot = Files.createTempDirectory("repo"); tmp = TestUtil.createAndCopyToDirectory(tmpRoot, "dummy", "target/test-classes/dummy_empty_deps"); configurationMap = new DynamicDependencyTypeConfigurationMap(); DependencyType depType = new FakeJPATypeDependency(); configurationMap.addDependencies(depType, depType.getDependencies()); FAKE_DEPENDENCY_VERSION = configurationMap.getMapping().get(depType.getType()).get(0).getVersion(); }
Source:
<code>public void onAdEnd(AdResult adResult) { if (mRewardedVideoListener != null) { if (adResult.isCallToActionClicked()) { <START> mRewardedVideoListener.onAdClicked(mMediationRewardedVideoAdAdapter); <END> DuAdMediation.d(TAG, "Dap Rewarded Video clicked."); } if (adResult.isSuccessfulView()) { mRewardedVideoListener.onRewarded(mMediationRewardedVideoAdAdapter, null); } mRewardedVideoListener.onAdClosed(mMediationRewardedVideoAdAdapter); DuAdMediation.d(TAG, "Dap Rewarded Video closed."); } }</code><technical_language>onAdLeftApplication() callback is missing for Rewarded Video Ads. Please [this](<LINK_0> existing adapter for implementation</technical_language>

Target:
public void onAdEnd(AdResult adResult) { if (mRewardedVideoListener != null) { if (adResult.isCallToActionClicked()) { mRewardedVideoListener.onAdClicked(mMediationRewardedVideoAdAdapter); mRewardedVideoListener.onAdLeftApplication(mMediationRewardedVideoAdAdapter); DuAdMediation.d(TAG, "Dap Rewarded Video clicked."); } if (adResult.isSuccessfulView()) { mRewardedVideoListener.onRewarded(mMediationRewardedVideoAdAdapter, null); } mRewardedVideoListener.onAdClosed(mMediationRewardedVideoAdAdapter); DuAdMediation.d(TAG, "Dap Rewarded Video closed."); } }
Source:
<code>private static boolean isIPv4Address(String name) { Matcher m = IPV4_PATTERN.matcher(name); if (!m.matches() || m.groupCount() != 4) { return false; } <START> for (int i = 1; i < 5; i++) { <END> String ipSegment = m.group(i); if (ipSegment == null || ipSegment.length() == 0) { return false; } int iIpSegment = 0; try { iIpSegment = Integer.parseInt(ipSegment); } catch(NumberFormatException e) { return false; } if (iIpSegment > IPV4_MAX_OCTET_VALUE) { return false; } if (ipSegment.length() > 1 && ipSegment.startsWith("0")) { return false; } } return true; }</code><technical_language>IMO more obvious is happening put for (int i = 1; i <= 4; i++) {</technical_language>

Target:
private static boolean isIPv4Address(String name) { Matcher m = IPV4_PATTERN.matcher(name); if (!m.matches() || m.groupCount() != 4) { return false; } for (int i = 1; i <= 4; i++) { String ipSegment = m.group(i); int iIpSegment = Integer.parseInt(ipSegment); if (iIpSegment > IPV4_MAX_OCTET_VALUE) { return false; } if (ipSegment.length() > 1 && ipSegment.startsWith("0")) { return false; } } return true; }
Source:
<code>private RunResult parseResult(ProcessResult processResult, Path path) { <START> Configuration configuration = new Configuration(path); <END> return new CargoResultParser().parse(processResult); }</code><technical_language>Unused variable</technical_language>

Target:
private RunResult parseResult(ProcessResult processResult, Path path) { return new CargoResultParser().parse(processResult); }
Source:
<code>public void testPublishWithNullType() { Response response = resource.publish(key, null, null, null, null, null, null); <START> assertEquals(response.getStatusInfo(), Response.Status.BAD_REQUEST); <END> }</code><technical_language>This test is testPublishWithNullUsername. I meant pass in a non-null username resource.publish()</technical_language>

Target:
public void testPublishWithNullType() { Response response = resource.publish(key, "Test", null, null, null, null, null); assertEquals(response.getStatusInfo(), Response.Status.BAD_REQUEST); }
Source:
<code>public RetryConfig build() { if (intervalFunction != null && intervalBiFunction != null) { throw new IllegalStateException("The intervalFunction was configured twice which could result in an" + " undesired state. Please use either intervalFunction or intervalBiFunction."); } RetryConfig config = new RetryConfig(); <START> config.intervalFunction = Optional.ofNullable(intervalFunction).orElse(IntervalFunction.ofDefaults()); <END> config.maxAttempts = maxAttempts; config.retryOnExceptionPredicate = retryOnExceptionPredicate; config.retryOnResultPredicate = retryOnResultPredicate; config.retryExceptions = retryExceptions; config.ignoreExceptions = ignoreExceptions; config.exceptionPredicate = createExceptionPredicate(); config.intervalBiFunction = intervalBiFunction; return config; }</code><technical_language>config.intervalFunction anymore in RetryImpl. If set IntervalFunction, I code java config.intervalBiFunction = Optional.ofNullable(intervalBiFunction) .orElse(IntervalBiFunction.ofIntervalFunction(intervalFunction));</technical_language>

Target:
public RetryConfig build() { if (intervalFunction != null && intervalBiFunction != null) { throw new IllegalStateException("The intervalFunction was configured twice which could result in an" + " undesired state. Please use either intervalFunction or intervalBiFunction."); } RetryConfig config = new RetryConfig(); config.maxAttempts = maxAttempts; config.retryOnExceptionPredicate = retryOnExceptionPredicate; config.retryOnResultPredicate = retryOnResultPredicate; config.retryExceptions = retryExceptions; config.ignoreExceptions = ignoreExceptions; config.exceptionPredicate = createExceptionPredicate(); config.intervalFunction = createIntervalFunction(); config.intervalBiFunction = Optional.ofNullable(intervalBiFunction) .orElse(IntervalBiFunction.ofIntervalFunction(config.intervalFunction)); return config; }
Source:
<code>public ValidationResult validatePublicKey(String publicKey) { ValidationResult.ValidationResultBuilder validationResultBuilder = ValidationResult.builder(); if (StringUtils.isNotEmpty(publicKey)) { <START> if (!SSH_PUBLIC_KEY_PATTERN.matcher(publicKey.trim()).matches()) { <END> validationResultBuilder.error(String.format( "The uploaded SSH Public Key is invalid. Correct format is <algorithm> <key> <comment> where <algorithm> can be one of" + " %n'%s' and the <comment> is optional.", ALGORITHM_TEXT_LIST)); } } return validationResultBuilder.build(); }</code><technical_language>if determine non-matching character e.g end() give in validation result? methods start() end() give indexes text match starts ends. end() returns index of character end of matching section</technical_language>

Target:
public ValidationResult validatePublicKey(String publicKey) { ValidationResult.ValidationResultBuilder validationResultBuilder = ValidationResult.builder(); if (StringUtils.isNotEmpty(publicKey)) { Matcher matcher = SSH_PUBLIC_KEY_PATTERN.matcher(publicKey.trim()); if (!matcher.matches()) { validationResultBuilder.error(String.format( "The uploaded SSH Public Key is invalid. Correct format is <algorithm> <key> <comment> where <algorithm> can be one of" + " %n'%s' and the <comment> is optional.", ALGORITHM_TEXT_LIST)); } } return validationResultBuilder.build(); }
Source:
<code>public String getStorageAccountKey(String accountName, Configuration rawConfig) throws KeyProviderException { String key = null; try { AbfsConfiguration abfsConfig = new AbfsConfiguration(rawConfig, accountName); key = abfsConfig.getPasswordString(ConfigurationKeys.FS_AZURE_ACCOUNT_KEY_PROPERTY_NAME); } catch(IllegalAccessException | InvalidConfigurationValueException e) { throw new KeyProviderException("Failure to initialize configuration", e); } catch(IOException ioe) { LOG.warn("Unable to get key from credential providers. {}", ioe); } try { validateStorageAccountKey(key); } catch (InvalidConfigurationValueException e) { <START> e.printStackTrace(); <END> } return key; }</code><technical_language>Throw it; want fail fast wait for auth failures talking end</technical_language>

Target:
public String getStorageAccountKey(String accountName, Configuration rawConfig) throws KeyProviderException { String key = null; try { AbfsConfiguration abfsConfig = new AbfsConfiguration(rawConfig, accountName); key = abfsConfig.getPasswordString(ConfigurationKeys.FS_AZURE_ACCOUNT_KEY_PROPERTY_NAME); validateStorageAccountKey(key); } catch (IllegalAccessException | InvalidConfigurationValueException e) { throw new KeyProviderException("Failure to initialize configuration", e); } catch(IOException ioe) { LOG.warn("Unable to get key from credential providers. {}", ioe); } return key; }
Source:
<code><START> public static ArrayList<RiakKvPB.TsCell> convertCellsToPb(Collection<Cell> cells) <END> { final ArrayList<RiakKvPB.TsCell> pbCells = new ArrayList<RiakKvPB.TsCell>(cells.size()); for (Cell cell : cells) { pbCells.add(convertCellToPb(cell)); } return pbCells; }</code><technical_language>is return more generic List return a concrete ArrayList</technical_language>

Target:
public static List<RiakKvPB.TsCell> convertCellsToPb(Collection<Cell> cells) { final ArrayList<RiakKvPB.TsCell> pbCells = new ArrayList<RiakKvPB.TsCell>(cells.size()); for (Cell cell : cells) { pbCells.add(convertCellToPb(cell)); } return pbCells; }
Source:
<code>public boolean visit(IResourceDelta delta) throws CoreException { final IResource resource = delta.getResource(); if (resource.getType() == IResource.ROOT) { return true; } if (resource.getType() == IResource.PROJECT) { final RepositoryMapping mapping = RepositoryMapping .getMapping((IProject) resource); if (mapping == null || mapping.getRepository() != repository) { return false; } return true; } if (resource.isLinked()) { return false; } <START> if (resource instanceof IFolder) { <END> if (delta.getKind() == IResourceDelta.ADDED) { String repoRelativePath = getRepoRelativePath(resource); if (repoRelativePath == null) { return false; } String path = repoRelativePath + "/"; if (isIgnoredInOldIndex(path)) { return true; } filesToUpdate.add(path); resourcesToUpdate.add(resource); } return true; } if (delta.getKind() == IResourceDelta.CHANGED && (delta.getFlags() & INTERESTING_CHANGES) == 0) { return false; } if (resource.getName().equals(GITIGNORE_NAME)) { gitIgnoreChanged = true; return false; } String repoRelativePath = getRepoRelativePath(resource); if (repoRelativePath == null) { resourcesToUpdate.add(resource); return true; } if (isIgnoredInOldIndex(repoRelativePath)) { return false; } filesToUpdate.add(repoRelativePath); resourcesToUpdate.add(resource); return true; }</code><technical_language>resource.getType() == IResource.FOLDER for ROOT</technical_language>

Target:
public boolean visit(IResourceDelta delta) throws CoreException { final IResource resource = delta.getResource(); if (resource.getType() == IResource.ROOT) { return true; } if (resource.getType() == IResource.PROJECT) { final RepositoryMapping mapping = RepositoryMapping .getMapping((IProject) resource); if (mapping == null || mapping.getRepository() != repository) { return false; } return true; } if (resource.isLinked()) { return false; } if (resource.getType() == IResource.FOLDER) { if (delta.getKind() == IResourceDelta.ADDED) { String repoRelativePath = getRepoRelativePath(resource); if (repoRelativePath == null) { return false; } String path = repoRelativePath + "/"; if (isIgnoredInOldIndex(path)) { return true; } filesToUpdate.add(path); resourcesToUpdate.add(resource); } return true; } if (delta.getKind() == IResourceDelta.CHANGED && (delta.getFlags() & INTERESTING_CHANGES) == 0) { return false; } if (resource.getName().equals(GITIGNORE_NAME)) { gitIgnoreChanged = true; return false; } String repoRelativePath = getRepoRelativePath(resource); if (repoRelativePath == null) { resourcesToUpdate.add(resource); return true; } if (isIgnoredInOldIndex(repoRelativePath)) { return false; } filesToUpdate.add(repoRelativePath); resourcesToUpdate.add(resource); return true; }
Source:
<code><START> public boolean equals(Object o) { <END> if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SyncVspCommand that = (SyncVspCommand) o; if (_nuageVspEntity != null ? !_nuageVspEntity.equals(that._nuageVspEntity) : that._nuageVspEntity != null) return false; return true; }</code><technical_language>This equals implementation include attributes Command super class</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SyncVspCommand)) return false; if (!super.equals(o)) return false; SyncVspCommand that = (SyncVspCommand) o; if (_nuageVspEntity != null ? !_nuageVspEntity.equals(that._nuageVspEntity) : that._nuageVspEntity != null) return false; return true; }