auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void validateInformations(Technology technology) throws BadRequestException { if (technology.getId() == null || technology.getId().equals("")) { throw new BadRequestException(ValidationMessageEnums.TECHNOLOGY_ID_CANNOT_BLANK.message()); } else if (technology.getName() == null || technology.getName().equals("")) { throw new BadRequestException(ValidationMessageEnums.TECHNOLOGY_NAME_CANNOT_BLANK.message()); } else if (technology.getShortDescription() == null <START> || technology.getShortDescription().equals("")) { <END> throw new BadRequestException( ValidationMessageEnums.TECHNOLOGY_SHORT_DESCRIPTION_BLANK.message()); } else if (technology.getDescription() == null || technology.getDescription().equals("")) { throw new BadRequestException(ValidationMessageEnums.TECHNOLOGY_DESCRIPTION_BLANK.message()); } Technology dbTechnology = technologyDAO.findByName(technology.getName()); if (dbTechnology != null) { throw new BadRequestException(ValidationMessageEnums.TECHNOLOGY_NAME_ALREADY_USED.message()); } }</code><technical_language>@jfmedeiros1820 Prefer "".equals(technology.getShortDescription()) this avoid a NullPointerException</technical_language>

Target:
private void validateInformations(Technology technology) throws BadRequestException { if (technology.getId() == null || technology.getId().equals("")) { throw new BadRequestException(ValidationMessageEnums.TECHNOLOGY_ID_CANNOT_BLANK.message()); } else if (technology.getName() == null || technology.getName().equals("")) { throw new BadRequestException(ValidationMessageEnums.TECHNOLOGY_NAME_CANNOT_BLANK.message()); } else if (technology.getShortDescription() == null || "".equals(technology.getShortDescription())) { throw new BadRequestException( ValidationMessageEnums.TECHNOLOGY_SHORT_DESCRIPTION_BLANK.message()); } else if (technology.getDescription() == null || technology.getDescription().equals("")) { throw new BadRequestException(ValidationMessageEnums.TECHNOLOGY_DESCRIPTION_BLANK.message()); } Technology dbTechnology = technologyDAO.findByName(technology.getName()); if (dbTechnology != null) { throw new BadRequestException(ValidationMessageEnums.TECHNOLOGY_NAME_ALREADY_USED.message()); } }
Source:
<code>public void classSetup() { profile = StudentProfileAttributes.builder().build(); profile.googleId = "valid.googleId"; profile.shortName = "shor"; profile.institute = "institute"; profile.email = "valid@email.com"; profile.nationality = "Lebanese"; <START> profile.gender = GenderType.OTHER; <END> profile.moreInfo = "moreInfo can have a lot more than this..."; profile.pictureKey = "profile Pic Key"; }</code><technical_language>Minor: enum</technical_language>

Target:
public void classSetup() { profile = StudentProfileAttributes.builder().build(); profile.googleId = "valid.googleId"; profile.shortName = "shor"; profile.institute = "institute"; profile.email = "valid@email.com"; profile.nationality = "Lebanese"; profile.gender = GenderType.FEMALE; profile.moreInfo = "moreInfo can have a lot more than this..."; profile.pictureKey = "profile Pic Key"; }
Source:
<code>public void notify(final int changeKind) { DDiagramEditorSessionListenerDelegate dDiagramEditorSessionListenerDelegate = new DDiagramEditorSessionListenerDelegate(this, toolFilterWhenRepresentationIsLocked, changeKind); if (Display.getCurrent() == null && changeKind != <START> 4) { <END> EclipseUIUtil.displayAsyncExec(dDiagramEditorSessionListenerDelegate); } else { dDiagramEditorSessionListenerDelegate.run(); } switch (changeKind) { case VSM_UPDATED: modelerDescriptionFilesLoaded(); break; default: break; } }</code><technical_language>SessionListener.ABOUT_TO_BE_REPLACED</technical_language>

Target:
public void notify(final int changeKind) { DDiagramEditorSessionListenerDelegate dDiagramEditorSessionListenerDelegate = new DDiagramEditorSessionListenerDelegate(this, toolFilterWhenRepresentationIsLocked, changeKind); if (Display.getCurrent() == null && changeKind != SessionListener.ABOUT_TO_BE_REPLACED) { EclipseUIUtil.displayAsyncExec(dDiagramEditorSessionListenerDelegate); } else { dDiagramEditorSessionListenerDelegate.run(); } switch (changeKind) { case VSM_UPDATED: modelerDescriptionFilesLoaded(); break; default: break; } }
Source:
<code><START> public long getEmittedObjectCount() <END> { return emittedObjectCount; }</code><technical_language>this protected? testcase in package, accesible protected well</technical_language>

Target:
protected long getEmittedObjectCount() { return emittedObjectCount; }
Source:
<code>public DataGeneratorWithExecutor(DsfExecutor executor) { fExecutor = executor; fExecutor.scheduleAtFixedRate( new DsfRunnable() { public void run() { randomChanges(); } }, fRandom.nextInt(RANDOM_CHANGE_INTERVAL), RANDOM_CHANGE_INTERVAL, <START> TimeUnit.MILLISECONDS); <END> }</code><technical_language>sense either</technical_language>

Target:
public DataGeneratorWithExecutor(DsfExecutor executor) { fExecutor = executor; final Random rand = new Random(); fExecutor.scheduleAtFixedRate( new DsfRunnable() { public void run() { randomChanges(); } }, rand.nextInt(RANDOM_CHANGE_INTERVAL), RANDOM_CHANGE_INTERVAL, TimeUnit.MILLISECONDS); }
Source:
<code>public void sortProcessInstancesVarsByNameTest() { List<ProcessVariableSummary> varList = VariableHelper.adaptCollection(variables, properties, processInstanceId, deploymentId, serverTemplateId, COL_PROCESS_INSTANCE_VAR_ID, false); assertEquals(4, varList.size()); <START> assertEquals(processDefaultVar_name, varList.get(0).getName()); <END> assertEquals(processDefinitionVar1Name, varList.get(1).getName()); assertEquals(processDefinitionVar2Name, varList.get(2).getName()); assertEquals(processDefinitionVar3Name, varList.get(3).getName()); varList = VariableHelper.adaptCollection(variables, properties, processInstanceId, deploymentId, serverTemplateId, COL_PROCESS_INSTANCE_VAR_ID, true); assertEquals(processDefaultVar_name, varList.get(3).getName()); assertEquals(processDefinitionVar1Name, varList.get(2).getName()); assertEquals(processDefinitionVar2Name, varList.get(1).getName()); assertEquals(processDefinitionVar3Name, varList.get(0).getName()); }</code><technical_language>sort order reversed .... variable is called asc, false, happy values in ... ascending order</technical_language>

Target:
public void sortProcessInstancesVarsByNameTest() { List<ProcessVariableSummary> varList = VariableHelper.adaptCollection(variables, properties, processInstanceId, deploymentId, serverTemplateId, COL_PROCESS_INSTANCE_VAR_ID, true); assertEquals(4, varList.size()); assertEquals(processDefaultVar_name, varList.get(0).getName()); assertEquals(processDefinitionVar1Name, varList.get(1).getName()); assertEquals(processDefinitionVar2Name, varList.get(2).getName()); assertEquals(processDefinitionVar3Name, varList.get(3).getName()); varList = VariableHelper.adaptCollection(variables, properties, processInstanceId, deploymentId, serverTemplateId, COL_PROCESS_INSTANCE_VAR_ID, false); assertEquals(processDefaultVar_name, varList.get(3).getName()); assertEquals(processDefinitionVar1Name, varList.get(2).getName()); assertEquals(processDefinitionVar2Name, varList.get(1).getName()); assertEquals(processDefinitionVar3Name, varList.get(0).getName()); }
Source:
<code>public MyPlacesLayersServiceMybatisImpl(DataSource dataSource) { if (dataSource == null) { <START> LOG.error("Couldn't get datasource for userlayer"); <END> } else { this.factory = initializeMyBatis(dataSource); } }</code><technical_language>suggestion LOG.error("Couldn't get datasource for myplaces");</technical_language>

Target:
public MyPlacesLayersServiceMybatisImpl(DataSource dataSource) { if (dataSource == null) { LOG.error("Couldn't get datasource for myplaces"); } else { this.factory = initializeMyBatis(dataSource); } }
Source:
<code>public List<Tree.Kind> nodesToVisit() { <START> return ImmutableList.of(Tree.Kind.METHOD, Tree.Kind.METHOD_INVOCATION); <END> }</code><technical_language>Subscribing METHOD is introducing confusion, problem rule. Subscribing METHOD_INVOCATION enough. hitting a method invocation, map if exist for symbol. If case, retrieve parameters names add a new entry map. check for parameter names</technical_language>

Target:
public List<Tree.Kind> nodesToVisit() { return Collections.singletonList(Tree.Kind.METHOD_INVOCATION); }
Source:
<code>public void onCreate() { super.onCreate(); initExceptionHandling(); Fresco.initialize(this); bus = new Bus(); <START> registerSavedPageObserver(); <END> refreshSavedPages(); final Resources resources = getResources(); ViewAnimations.init(resources); screenDensity = resources.getDisplayMetrics().density; currentTheme = unmarshalCurrentTheme(); appLanguageState = new AppLanguageState(this); funnelManager = new FunnelManager(this); sessionFunnel = new SessionFunnel(this); editTokenStorage = new EditTokenStorage(this); cookieManager = new SharedPreferenceCookieManager(); database = new Database(this); enableWebViewDebugging(); Api.setConnectionFactory(new OkHttpConnectionFactory(this)); zeroHandler = new WikipediaZeroHandler(this); pageCache = new PageCache(this); AccountUtil.createAccountForLoggedInUser(); }</code><technical_language>I this cookie manager initialized, if later</technical_language>

Target:
public void onCreate() { super.onCreate(); initExceptionHandling(); Fresco.initialize(this); bus = new Bus(); final Resources resources = getResources(); ViewAnimations.init(resources); screenDensity = resources.getDisplayMetrics().density; currentTheme = unmarshalCurrentTheme(); appLanguageState = new AppLanguageState(this); funnelManager = new FunnelManager(this); sessionFunnel = new SessionFunnel(this); editTokenStorage = new EditTokenStorage(this); cookieManager = new SharedPreferenceCookieManager(); database = new Database(this); enableWebViewDebugging(); Api.setConnectionFactory(new OkHttpConnectionFactory(this)); zeroHandler = new WikipediaZeroHandler(this); pageCache = new PageCache(this); AccountUtil.createAccountForLoggedInUser(); }
Source:
<code>public boolean callFinishWithBatch(T batch) { try { finish(batch); return true; <START> }catch (Exception e){ <END> return false; } }</code><technical_language>Please do catch a generic exception. consumer of this library call finish own</technical_language>

Target:
public boolean callFinishWithBatch(T batch) { finish(batch); return true; }
Source:
<code><START> public Map<String, Optional<?>> getResolvedAttributes(String nodeId, Alien4CloudApplication toscaApplication) { <END> Map<String, Optional<?>> resolvedAttributes = MutableMap.of(); Optional<PaaSNodeTemplate> optionalPaaSNodeTemplate = getPaasNodeTemplate(nodeId, toscaApplication); if (optionalPaaSNodeTemplate.isPresent()) { Map<String, PaaSNodeTemplate> allNodes = getAllNodes(toscaApplication); final Map<String, IValue> attributes = getIndexedNodeTemplate(nodeId, toscaApplication).getAttributes(); for (Map.Entry<String, IValue> attribute : attributes.entrySet()) { String key = attribute.getKey().replaceAll("\\s+", "."); Object value = resolveAttribute(attribute, toscaApplication, nodeId, optionalPaaSNodeTemplate.get(), allNodes); resolvedAttributes.put(key, Optional.fromNullable(value)); } } return resolvedAttributes; }</code><technical_language>is benefit of returning Optional values simply including in map. caller of this method discards absent values</technical_language>

Target:
public Map<String, Object> getResolvedAttributes(String nodeId, Alien4CloudApplication toscaApplication) { Map<String, Object> resolvedAttributes = MutableMap.of(); Optional<PaaSNodeTemplate> optionalPaaSNodeTemplate = getPaasNodeTemplate(nodeId, toscaApplication); if (optionalPaaSNodeTemplate.isPresent()) { Map<String, PaaSNodeTemplate> allNodes = getAllNodes(toscaApplication); final Map<String, IValue> attributes = getIndexedNodeTemplate(nodeId, toscaApplication).getAttributes(); for (Map.Entry<String, IValue> attribute : attributes.entrySet()) { String key = attribute.getKey().replaceAll("\\s+", "."); Object value = resolveAttribute(attribute, toscaApplication, nodeId, optionalPaaSNodeTemplate.get(), allNodes); if (value == null) { LOG.warn("Unable to resolve value for attribute {}", key); continue; } resolvedAttributes.put(key, value); } } return resolvedAttributes; }
Source:
<code>private static String generateThreadDump() { StringBuilder threadDumps = new StringBuilder(); ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); <START> ThreadInfo[] threadInfos = threadMXBean.getThreadInfo(threadMXBean.getAllThreadIds(), 100); <END> for (ThreadInfo t : threadInfos) { threadDumps.append(t); } return threadDumps.toString(); }</code><technical_language>Integer.MAX_VALUE request entire stack dumped</technical_language>

Target:
private static String generateThreadDump() { StringBuilder threadDumps = new StringBuilder(); ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); ThreadInfo[] threadInfos = threadMXBean.dumpAllThreads(true, true); for (ThreadInfo t : threadInfos) { threadDumps.append(t); } return threadDumps.toString(); }
Source:
<code>ScriptEngine getEngineForScript(ScriptMetadata metadata) { return metadata.language().map( (language) -> { <START> return scriptEnginesByLanguage.computeIfAbsent(language, (lang) -> { <END> ScriptEngine engine = scriptEngineManager.getEngineByName(lang); if (engine == null) { throw log.noEngineForScript(metadata.name()); } else { return engine; } }); }).orElseGet(() -> { return scriptEnginesByExtension.computeIfAbsent(metadata.extension(), (ext) -> { ScriptEngine engine = scriptEngineManager.getEngineByExtension(ext); if (engine == null) { throw log.noEngineForScript(metadata.name()); } else { return engine; } }); }); }</code><technical_language>a matter of preference, I regular control a lot of nesting. move noEngineForScript check end, end this: ScriptEngine engine; if (metadata.language().isPresent()) { engine = scriptEnginesByLanguage .computeIfAbsent(metadata.language().get(), scriptEngineManager::getEngineByName); } else { engine = scriptEnginesByExtension .computeIfAbsent(metadata.extension(), scriptEngineManager::getEngineByExtension); } if (engine == null) { throw log.noEngineForScript(metadata.name()); } else { return engine; }</technical_language>

Target:
ScriptEngine getEngineForScript(ScriptMetadata metadata) { ScriptEngine engine; if (metadata.language().isPresent()) { engine = scriptEnginesByLanguage.computeIfAbsent(metadata.language().get(), scriptEngineManager::getEngineByName); } else { engine = scriptEnginesByExtension.computeIfAbsent(metadata.extension(), scriptEngineManager::getEngineByExtension); } if (engine == null) { throw log.noEngineForScript(metadata.name()); } else { return engine; } }
Source:
<code><START> public String getExternalMetadata() throws JsonProcessingException { <END> return MAPPER.writeValueAsString(externalMetadata); }</code><technical_language>@JsonSerialize(using = ExternalMetadataSerialiser.class)</technical_language>

Target:
public Map<String, Object> getExternalMetadata() { return externalMetadata; }
Source:
<code>private void assertDomainN(String domain, String... executables) throws FileNotFoundException { List<ProcessDetails> procs = ProcessDetails.getProcessMap().get(domain); String msg = "Expected 1 or more processes in SELinux domain \"" + domain + "\"" + " Found \"" + procs + "\""; assertNotNull(msg, procs); outer: for (ProcessDetails p : procs) { <START> for (String executable : executables) { <END> if (executable.equals(p.procTitle)) { continue outer; } } fail(p.procTitle + " not in allowed executable list " + Arrays.toString(executables)); } }</code><technical_language>feels cleaner represent this a HashSet, perform a lookup for proc, scanning executables array for proc. This constructed in-method (req's data struct constructions), passed instead of varargs array. debatably more readable jumping labels. 2 cents</technical_language>

Target:
private void assertDomainN(String domain, String... executables) throws FileNotFoundException { List<ProcessDetails> procs = ProcessDetails.getProcessMap().get(domain); String msg = "Expected 1 or more processes in SELinux domain \"" + domain + "\"" + " Found \"" + procs + "\""; assertNotNull(msg, procs); Set<String> execList = new HashSet<String>(Arrays.asList(executables)); for (ProcessDetails p : procs) { msg = "Expected one of \"" + execList + "\" in SELinux domain \"" + domain + "\"" + " Found: \"" + p + "\""; assertTrue(msg, execList.contains(p.procTitle)); } }
Source:
<code>private void deleteStagedFiles(Model m) { NodeIterator ni = m.listObjectsOfProperty(CdrDeposit.stagingLocation); try { while (ni.hasNext()) { RDFNode n = ni.nextNode(); URI stagingUri = URI.create(n.asLiteral().getString()); CleanupPolicy cleanupPolicy = stagingManager.getCleanupPolicy(stagingUri); switch (cleanupPolicy) { case DO_NOTHING: break; case DELETE_INGESTED_FILES: deleteFile(stagingUri); break; case DELETE_INGESTED_FILES_EMPTY_FOLDERS: File parent = deleteFile(stagingUri); if (parent != null && parent.exists()) { <START> if (parent.list().length == 0) { <END> try { Files.delete(parent.toPath()); LOG.info("Deleted parent folder: {}", parent.toPath()); } catch (IOException e) { LOG.error( "Cannot delete an empty staging directory: " + parent.getAbsolutePath(), e); } } } else { LOG.warn("Unable to cleanup parent directory " + parent.getAbsolutePath() + " because it does not exist"); } default: break; } } } finally { ni.close(); } }</code><technical_language>Is some crazy indenting starts here, is me</technical_language>

Target:
private void deleteStagedFiles(Model m) { NodeIterator ni = m.listObjectsOfProperty(CdrDeposit.stagingLocation); try { while (ni.hasNext()) { RDFNode n = ni.nextNode(); URI stagingUri = URI.create(n.asLiteral().getString()); CleanupPolicy cleanupPolicy = stagingPolicyManager.getCleanupPolicy(stagingUri); switch (cleanupPolicy) { case DO_NOTHING: break; case DELETE_INGESTED_FILES: deleteFile(stagingUri); break; case DELETE_INGESTED_FILES_EMPTY_FOLDERS: File parent = deleteFile(stagingUri); try { if (parent != null) { Files.delete(parent.toPath()); LOG.info("Deleted parent folder: {}", parent.toPath()); } } catch (DirectoryNotEmptyException e) { LOG.debug("Parent directory not cleaned up because it is not empty", parent.getAbsolutePath()); } catch (NoSuchFileException e) { LOG.info("Unable to cleanup parent directory because it does not exist", parent.getAbsolutePath()); } catch (IOException e) { failJob(e, "Failed to delete staging directory: {0}", parent.getAbsolutePath()); } default: break; } } } finally { ni.close(); } }
Source:
<code>private boolean isRequestFresh(CruiseConfig cruiseConfig) { <START> EnvironmentConfig config = cruiseConfig.getEnvironments().find(new CaseInsensitiveString(oldEnvironmentName)); <END> boolean freshRequest = hashingService.md5ForEntity(config).equals(md5); if (!freshRequest) { result.stale(LocalizedMessage.string("STALE_RESOURCE_CONFIG", "Environment", oldEnvironmentName)); } return freshRequest; }</code><technical_language>Overload find takes in a String</technical_language>

Target:
private boolean isRequestFresh(CruiseConfig cruiseConfig) { EnvironmentConfig config = cruiseConfig.getEnvironments().find(oldEnvironmentName); boolean freshRequest = hashingService.md5ForEntity(config).equals(md5); if (!freshRequest) { result.stale(LocalizedMessage.string("STALE_RESOURCE_CONFIG", "environment", oldEnvironmentName)); } return freshRequest; }
Source:
<code>private void updateSwimStatus(final EntityRef entity,LocationComponent location, CharacterMovementComponent movementComp) { Vector3f worldPos = location.getWorldPosition(); boolean topUnderwater = false; boolean bottomUnderwater = false; Vector3f top = new Vector3f(worldPos); Vector3f bottom = new Vector3f(worldPos); top.y += 0.25f * movementComp.height; bottom.y -= 0.25f * movementComp.height; topUnderwater = worldProvider.getBlock(top).isLiquid(); final Block bottomBlock= worldProvider.getBlock(bottom); bottomUnderwater = bottomBlock.isLiquid(); boolean newSwimming = topUnderwater && bottomUnderwater; if (!newSwimming && movementComp.isSwimming && movementComp.getVelocity().y > 0) { float len = movementComp.getVelocity().length(); movementComp.getVelocity().scale((len + 8) / len); } if(movementComp.isSwimming != newSwimming){ <START> if(movementComp.isSwimming) <END> entity.send(new FromLiquidEvent(bottomBlock,worldPos)); else entity.send(new IntoLiquidEvent(bottomBlock,worldPos)); } movementComp.isSwimming = newSwimming; }</code><technical_language>Braces please</technical_language>

Target:
private void updateSwimStatus(final EntityRef entity,LocationComponent location, CharacterMovementComponent movementComp) { Vector3f worldPos = location.getWorldPosition(); boolean topUnderwater = false; boolean bottomUnderwater = false; Vector3f top = new Vector3f(worldPos); Vector3f bottom = new Vector3f(worldPos); top.y += 0.25f * movementComp.height; bottom.y -= 0.25f * movementComp.height; topUnderwater = worldProvider.getBlock(top).isLiquid(); final Block bottomBlock= worldProvider.getBlock(bottom); bottomUnderwater = bottomBlock.isLiquid(); boolean newSwimming = topUnderwater && bottomUnderwater; if (!newSwimming && movementComp.isSwimming && movementComp.getVelocity().y > 0) { float len = movementComp.getVelocity().length(); movementComp.getVelocity().scale((len + 8) / len); } if(movementComp.isSwimming != newSwimming){ if (movementComp.isSwimming) { entity.send(new FromLiquidEvent(bottomBlock, worldPos)); } else { entity.send(new IntoLiquidEvent(bottomBlock, worldPos)); } } movementComp.isSwimming = newSwimming; }
Source:
<code>public KeycloakApplication() { try { <START> logger.infov("Using PlatformProvider: {0}", platform.getClass().getName()); <END> logger.debugv("RestEasy provider: {0}", Resteasy.getProvider().getClass().getName()); ServletContext context = Resteasy.getContextData(ServletContext.class); loadConfig(); this.sessionFactory = createSessionFactory(); Resteasy.pushDefaultContextObject(KeycloakApplication.class, this); Resteasy.pushContext(KeycloakApplication.class, this); context.setAttribute(KeycloakSessionFactory.class.getName(), this.sessionFactory); singletons.add(new RobotsResource()); singletons.add(new RealmsResource()); singletons.add(new AdminRoot()); classes.add(ThemeResource.class); classes.add(JsResource.class); classes.add(KeycloakTransactionCommitter.class); classes.add(KeycloakErrorHandler.class); singletons.add(new ObjectMapperResolver(Boolean.parseBoolean(System.getProperty("keycloak.jsonPrettyPrint", "false")))); singletons.add(new WelcomeResource()); platform.onStartup(this::startup); platform.onShutdown(this::shutdown); } catch (Throwable t) { platform.exit(t); } }</code><technical_language>debug level</technical_language>

Target:
public KeycloakApplication() { try { logger.debugv("PlatformProvider: {0}", platform.getClass().getName()); logger.debugv("RestEasy provider: {0}", Resteasy.getProvider().getClass().getName()); ServletContext context = Resteasy.getContextData(ServletContext.class); loadConfig(); this.sessionFactory = createSessionFactory(); Resteasy.pushDefaultContextObject(KeycloakApplication.class, this); Resteasy.pushContext(KeycloakApplication.class, this); context.setAttribute(KeycloakSessionFactory.class.getName(), this.sessionFactory); singletons.add(new RobotsResource()); singletons.add(new RealmsResource()); singletons.add(new AdminRoot()); classes.add(ThemeResource.class); classes.add(JsResource.class); classes.add(KeycloakTransactionCommitter.class); classes.add(KeycloakErrorHandler.class); singletons.add(new ObjectMapperResolver(Boolean.parseBoolean(System.getProperty("keycloak.jsonPrettyPrint", "false")))); singletons.add(new WelcomeResource()); platform.onStartup(this::startup); platform.onShutdown(this::shutdown); } catch (Throwable t) { platform.exit(t); } }
Source:
<code>private static Double priority(final String text) { final String[] parts = MediaType.split(text); final Double priority; if (parts.length > 1) { <START> final String num = CLEANER.matcher(parts[1]).replaceAll(""); <END> if (num.isEmpty()) { priority = 0.0d; } else { priority = Double.parseDouble(num); } } else { priority = 1.0d; } return priority; }</code><technical_language>@Happy-Neko access this field in a static way</technical_language>

Target:
private static Double priority(final String text) { final String[] parts = MediaType.split(text); final Double priority; if (parts.length > 1) { final String num = MediaType.NON_DIGITS.matcher(parts[1]).replaceAll(""); if (num.isEmpty()) { priority = 0.0d; } else { priority = Double.parseDouble(num); } } else { priority = 1.0d; } return priority; }
Source:
<code>public void dispose() { connectionsFactory.close(); <START> if (this.selectedConnection != null) { <END> selectedConnection.enablePromptCredentials(true); } }</code><technical_language>Instead of forcing true, should'nt restore previous flag</technical_language>

Target:
public void dispose() { connectionsFactory.close(); if (this.selectedConnection != null) { selectedConnection.enablePromptCredentials(enablePromptCredentialsBackup); } }
Source:
<code>public boolean isRecycleBinOptionsDisplayed() { <START> return this.getDriver().findElementsWithoutWaiting(By.cssSelector("input[name='shouldSkipRecycleBin']")).size() <END> == 2; }</code><technical_language>checking radio buttons instead of full control? number 2 feels magical</technical_language>

Target:
public boolean isRecycleBinOptionsDisplayed() { try { return this.optionSkipRecycleBin.isDisplayed() && this.optionSkipRecycleBin.isDisplayed(); } catch (NoSuchElementException e) { return false; } }
Source:
<code>public void setInput(Object input) { Assert.isLegal(input == null || input instanceof String || input instanceof BrowserInformationControlInput, input != null ? input.getClass().getName() : <START> ""); END> if (input instanceof String) { setInformation((String)input); return; } fInput= (BrowserInformationControlInput)input; String content= null; if (fInput != null) content= fInput.getHtml(); fBrowserHasContent= content != null && content.length() > 0; if (!fBrowserHasContent) content= "<html><body ></html>"; boolean RTL= (getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0; boolean resizable= isResizable(); String[] styles= null; if (RTL && resizable) styles= new String[] { "direction:rtl;", "overflow:scroll;", "word-wrap:break-word;" }; else if (RTL && !resizable) styles= new String[] { "direction:rtl;", "overflow:hidden;", "word-wrap:break-word;" }; else if (!resizable) styles= new String[] { "overflow:hidden;" }; else styles= new String[] { "overflow:scroll;" }; StringBuffer buffer= new StringBuffer(content); HTMLPrinter.insertStyles(buffer, styles); content= buffer.toString(); fCompleted= false; fBrowser.setText(content); for (IInputChangedListener listener : fInputChangeListeners) { listener.inputChanged(fInput); } }</code><technical_language>put null</technical_language>

Target:
public void setInput(Object input) { Assert.isLegal(input == null || input instanceof String || input instanceof BrowserInformationControlInput, input != null ? input.getClass().getName() : null); if (input instanceof String) { setInformation((String)input); return; } fInput= (BrowserInformationControlInput)input; String content= null; if (fInput != null) content= fInput.getHtml(); fBrowserHasContent= content != null && content.length() > 0; if (!fBrowserHasContent) content= "<html><body ></html>"; boolean RTL= (getShell().getStyle() & SWT.RIGHT_TO_LEFT) != 0; boolean resizable= isResizable(); String[] styles= null; if (RTL && resizable) styles= new String[] { "direction:rtl;", "overflow:scroll;", "word-wrap:break-word;" }; else if (RTL && !resizable) styles= new String[] { "direction:rtl;", "overflow:hidden;", "word-wrap:break-word;" }; else if (!resizable) styles= new String[] { "overflow:hidden;" }; else styles= new String[] { "overflow:scroll;" }; StringBuffer buffer= new StringBuffer(content); HTMLPrinter.insertStyles(buffer, styles); content= buffer.toString(); fCompleted= false; fBrowser.setText(content); for (IInputChangedListener listener : fInputChangeListeners) { listener.inputChanged(fInput); } }
Source:
<code>public boolean isEnumerated() { <START> return enumerators != null && enumerators.length > 0; <END> }</code><technical_language>need check length - if a zero length array, other problems</technical_language>

Target:
public boolean isEnumerated() { return type == Value.ENUM; }
Source:
<code>private void onEditExpenseResult(Intent data) { ExpenseClaim claim = (ExpenseClaim)data.getSerializableExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM); int position = data.getIntExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM_INDEX, -1); listModel.set(position, claim); <START> if(checkFilteredTags()) { <END> setFilteredClaims(); } }</code><technical_language>Style inconsistency: space if</technical_language>

Target:
private void onEditExpenseResult(Intent data) { ExpenseClaim claim = (ExpenseClaim)data.getSerializableExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM); int position = data.getIntExtra(ExpenseClaimDetailActivity.EXTRA_EXPENSE_CLAIM_INDEX, -1); listModel.set(position, claim); if (!filteredTagsList.isEmpty()) { setFilteredClaims(); } }
Source:
<code>public List<Page> findPageByURI(Locale fullLocale, Locale languageOnlyLocale, String uri) { Query query; if (languageOnlyLocale == null) { languageOnlyLocale = fullLocale; } query = em.createNamedQuery("BC_READ_PAGE_BY_URI"); query.setParameter("fullLocale", fullLocale); query.setParameter("languageOnlyLocale", languageOnlyLocale); query.setParameter("uri", uri); query.setHint(QueryHints.HINT_CACHEABLE, true); try { return query.getResultList(); } catch (NoResultException | EntityNotFoundException e) { <START> return new ArrayList<>(); <END> } }</code><technical_language>Collections.EMPTY_LIST</technical_language>

Target:
public List<Page> findPageByURI(Locale fullLocale, Locale languageOnlyLocale, String uri) { Query query; if (languageOnlyLocale == null) { languageOnlyLocale = fullLocale; } query = em.createNamedQuery("BC_READ_PAGE_BY_URI"); query.setParameter("fullLocale", fullLocale); query.setParameter("languageOnlyLocale", languageOnlyLocale); query.setParameter("uri", uri); query.setHint(QueryHints.HINT_CACHEABLE, true); try { return query.getResultList(); } catch (NoResultException | EntityNotFoundException e) { return Collections.emptyList(); } }
Source:
<code>protected synchronized boolean ensureCoordinatorReady(final Timer timer) { if (!coordinatorUnknown()) return true; do { if (findCoordinatorException != null && !(findCoordinatorException instanceof RetriableException)) { final RuntimeException fatalException = findCoordinatorException; findCoordinatorException = null; throw fatalException; } final RequestFuture<Void> future = lookupCoordinator(); client.poll(future, timer); if (!future.isDone()) { <START> future.addListener(new RequestFutureListener<Void>() { <END> @Override public void onSuccess(Void value) @Override public void onFailure(RuntimeException e) { findCoordinatorException = e; } }); break; } if (future.failed()) { if (future.isRetriable()) { log.debug("Coordinator discovery failed, refreshing metadata"); client.awaitMetadataUpdate(timer); } else throw future.exception(); } else if (coordinator != null && client.isUnavailable(coordinator)) { markCoordinatorUnknown(); timer.sleep(rebalanceConfig.retryBackoffMs); } } while (coordinatorUnknown() && timer.notExpired()); return !coordinatorUnknown(); }</code><technical_language>Do want this listener coordinator lookup is triggered ensureCoordinatorReady? Other paths future a call ensureCoordinatorReady. Conversely, a future another path here. instead move this logic lookupCoordinator is handled consistently</technical_language>

Target:
protected synchronized boolean ensureCoordinatorReady(final Timer timer) { if (!coordinatorUnknown()) return true; do { if (findCoordinatorException != null && !(findCoordinatorException instanceof RetriableException)) { final RuntimeException fatalException = findCoordinatorException; findCoordinatorException = null; throw fatalException; } final RequestFuture<Void> future = lookupCoordinator(); client.poll(future, timer); if (!future.isDone()) { break; } if (future.failed()) { if (future.isRetriable()) { log.debug("Coordinator discovery failed, refreshing metadata"); client.awaitMetadataUpdate(timer); } else throw future.exception(); } else if (coordinator != null && client.isUnavailable(coordinator)) { markCoordinatorUnknown(); timer.sleep(rebalanceConfig.retryBackoffMs); } } while (coordinatorUnknown() && timer.notExpired()); return !coordinatorUnknown(); }
Source:
<code>protected void execute() { logger.debug("execute() method is called!"); for (PowerDogLocalApiBindingProvider provider : providers) { for (String itemName : provider.getInBindingItemNames()) { int refreshInterval = provider.getRefreshInterval(itemName); Long lastUpdateTimeStamp = lastUpdateMap.get(itemName); if (lastUpdateTimeStamp == null) { lastUpdateTimeStamp = 0L; } long age = System.currentTimeMillis() - lastUpdateTimeStamp; boolean itemNeedsUpdate = (age >= refreshInterval); if (itemNeedsUpdate) { logger.debug("Item '{}' is about to be refreshed now", itemName); String unit = provider.getServerId(itemName); PowerDogLocalApiServerConfig server = serverList.get(unit); boolean serverNeedsUpdate = false; if (server == null) { serverNeedsUpdate = false; <START> logger.error("Unknown PowerDog server referenced: " <END> + unit); continue; } else { age = System.currentTimeMillis() - server.lastUpdate; serverNeedsUpdate = (age >= server.refresh); } XmlRpcStruct response = loadPowerDogResponse( serverNeedsUpdate, server); if (response != null) { String value = getVariable(response, provider.getValueId(itemName), provider.getName(itemName)); if (value != null) { Class<? extends Item> itemType = provider .getItemType(itemName); State state = createState(itemType, value); eventPublisher.postUpdate(itemName, state); lastUpdateMap.put(itemName, System.currentTimeMillis()); } } } } } logger.debug("execute() method is finished!"); }</code><technical_language>parameterized logging instead of string concatenation</technical_language>

Target:
protected void execute() { logger.debug("execute() method is called!"); for (PowerDogLocalApiBindingProvider provider : providers) { for (String itemName : provider.getInBindingItemNames()) { int refreshInterval = provider.getRefreshInterval(itemName); Long lastUpdateTimeStamp = lastUpdateMap.get(itemName); if (lastUpdateTimeStamp == null) { lastUpdateTimeStamp = 0L; } long age = System.currentTimeMillis() - lastUpdateTimeStamp; boolean itemNeedsUpdate = (age >= refreshInterval); if (itemNeedsUpdate) { logger.debug("Item '{}' is about to be refreshed now", itemName); String unit = provider.getServerId(itemName); PowerDogLocalApiServerConfig server = serverList.get(unit); boolean serverNeedsUpdate = false; if (server == null) { serverNeedsUpdate = false; logger.error("Unknown PowerDog server referenced: {}", unit); continue; } else { age = System.currentTimeMillis() - server.lastUpdate; serverNeedsUpdate = (age >= server.refresh); } XmlRpcStruct response = loadPowerDogResponse(serverNeedsUpdate, server); if (response != null) { String value = getVariable(response, provider.getValueId(itemName), provider.getName(itemName)); if (value != null) { Class<? extends Item> itemType = provider.getItemType(itemName); State state = createState(itemType, value); eventPublisher.postUpdate(itemName, state); lastUpdateMap.put(itemName, System.currentTimeMillis()); } } } } } logger.debug("execute() method is finished!"); }
Source:
<code><START> public int getAvbPublicKey(AvbPublicKey dst) { <END> try { return mService.getAvbPublicKey(dst); } catch (RemoteException e) { throw new RuntimeException(e.toString()); } }</code><technical_language>I tend a boolean return for consistency,</technical_language>

Target:
public boolean getAvbPublicKey(AvbPublicKey dst) { try { return mService.getAvbPublicKey(dst); } catch (RemoteException e) { throw new RuntimeException(e.toString()); } }
Source:
<code>public Cluster selectCluster( @Nonnull @NonNull @NotEmpty final Set<Cluster> clusters, @Nonnull @NonNull final JobRequest jobRequest ) throws GenieException { final long selectStart = System.nanoTime(); log.debug("Called"); final Set<Tag> tags = Sets.newHashSet(); try { final CompiledScript script = this.loader.get(); if (script == null) { log.debug("Script not configured"); tags.add(Tag.of(MetricsConstants.TagKeys.STATUS, STATUS_TAG_NOT_CONFIGURED)); return null; } final String clusterId = this.evaluator.evaluate(script, jobRequest, clusters); if (clusterId == null) { tags.add(Tag.of(MetricsConstants.TagKeys.STATUS, STATUS_TAG_NO_PREFERENCE)); log.debug("Script returned null, no preference"); return null; } for (final Cluster cluster : clusters) { if (clusterId.equals(cluster.getId())) { <START> tags.add(Tag.of(MetricsConstants.TagKeys.STATUS, STATUS_TAG_FOUND)); <END> return cluster; } } log.warn("Script returned a cluster not in the input list: {}", clusterId); tags.add(Tag.of(MetricsConstants.TagKeys.STATUS, STATUS_TAG_NOT_FOUND)); return null; } catch (final Exception e) { tags.add(Tag.of(MetricsConstants.TagKeys.STATUS, STATUS_TAG_FAILED)); tags.add(Tag.of(MetricsConstants.TagKeys.EXCEPTION_CLASS, e.getClass().getCanonicalName())); log.error("Unable to execute script due to {}", e.getMessage(), e); return null; } finally { this.registry .timer(SELECT_TIMER_NAME, tags) .record(System.nanoTime() - selectStart, TimeUnit.NANOSECONDS); } }</code><technical_language>tag cluster id selected well</technical_language>

Target:
public Cluster selectCluster( @Nonnull @NonNull @NotEmpty final Set<Cluster> clusters, @Nonnull @NonNull final JobRequest jobRequest ) throws GenieException { final long selectStart = System.nanoTime(); log.debug("Called"); final Set<Tag> tags = Sets.newHashSet(); try { final CompiledScript script = this.loader.get(); if (script == null) { log.debug("Script not configured"); tags.add(Tag.of(MetricsConstants.TagKeys.STATUS, STATUS_TAG_NOT_CONFIGURED)); return null; } final String clusterId = this.evaluator.evaluate(script, jobRequest, clusters); if (clusterId == null) { tags.add(Tag.of(MetricsConstants.TagKeys.STATUS, STATUS_TAG_NO_PREFERENCE)); log.debug("Script returned null, no preference"); return null; } for (final Cluster cluster : clusters) { if (clusterId.equals(cluster.getId())) { tags.add(Tag.of(MetricsConstants.TagKeys.STATUS, STATUS_TAG_FOUND)); tags.add(Tag.of(MetricsConstants.TagKeys.CLUSTER_NAME, cluster.getMetadata().getName())); tags.add(Tag.of(MetricsConstants.TagKeys.CLUSTER_ID, cluster.getId())); return cluster; } } log.warn("Script returned a cluster not in the input list: {}", clusterId); tags.add(Tag.of(MetricsConstants.TagKeys.STATUS, STATUS_TAG_NOT_FOUND)); return null; } catch (final Exception e) { tags.add(Tag.of(MetricsConstants.TagKeys.STATUS, STATUS_TAG_FAILED)); tags.add(Tag.of(MetricsConstants.TagKeys.EXCEPTION_CLASS, e.getClass().getCanonicalName())); log.error("Unable to execute script due to {}", e.getMessage(), e); return null; } finally { this.registry .timer(SELECT_TIMER_NAME, tags) .record(System.nanoTime() - selectStart, TimeUnit.NANOSECONDS); } }
Source:
<code>public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { super.bridgeStatusChanged(bridgeStatusInfo); if (bridgeStatusInfo.getStatus() == ThingStatus.ONLINE) { <START> scheduler.schedule(() -> { <END> coapClient.startObserve(this); }, 0, TimeUnit.SECONDS); } }</code><technical_language>"submit" instead</technical_language>

Target:
public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { super.bridgeStatusChanged(bridgeStatusInfo); if (bridgeStatusInfo.getStatus() == ThingStatus.ONLINE) { scheduler.submit(() -> coapClient.startObserve(this)); } }
Source:
<code>private void markReloadTimerElapsed() { <START> this.reloadTimerElapsed = true; <END> updateReloadButton(); }</code><technical_language>I holiday gotta remove extra this.s</technical_language>

Target:
private void markReloadTimerElapsed() { reloadTimerElapsed = true; updateReloadButton(); }
Source:
<code>private boolean isMessageBlocked(SignalServiceEnvelope envelope, SignalServiceContent content) { <START> SignalServiceAddress source = envelope.getSourceAddress(); <END> ContactInfo sourceContact = getContact(source.getNumber().get()); if (sourceContact != null && sourceContact.blocked) { return true; } if (content != null && content.getDataMessage().isPresent()) { SignalServiceDataMessage message = content.getDataMessage().get(); if (message.getGroupInfo().isPresent()) { SignalServiceGroup groupInfo = message.getGroupInfo().get(); GroupInfo group = getGroup(groupInfo.getGroupId()); if (groupInfo.getType() == SignalServiceGroup.Type.DELIVER && group != null && group.blocked) { return true; } } } return false; }</code><technical_language>signal sealed messages envelope actual source address. This needs additional check: java SignalServiceAddress source; if (!envelope.isUnidentifiedSender() && envelope.hasSource()) { source = envelope.getSourceAddress(); } else if (content != null) { source = content.getSender(); }</technical_language>

Target:
private boolean isMessageBlocked(SignalServiceEnvelope envelope, SignalServiceContent content) { SignalServiceAddress source; if (!envelope.isUnidentifiedSender() && envelope.hasSource()) { source = envelope.getSourceAddress(); } else if (content != null) { source = content.getSender(); } else { return false; } ContactInfo sourceContact = getContact(source.getNumber().get()); if (sourceContact != null && sourceContact.blocked) { return true; } if (content != null && content.getDataMessage().isPresent()) { SignalServiceDataMessage message = content.getDataMessage().get(); if (message.getGroupInfo().isPresent()) { SignalServiceGroup groupInfo = message.getGroupInfo().get(); GroupInfo group = getGroup(groupInfo.getGroupId()); if (groupInfo.getType() == SignalServiceGroup.Type.DELIVER && group != null && group.blocked) { return true; } } } return false; }
Source:
<code>public S3ListResult next() throws IOException { if (firstListing) { firstListing = false; objects = awaitFuture(s3ListResultFuture); fetchNextBatchAsyncIfPresent(); } else { try { if (objectsPrev!= null && !objectsPrev.isTruncated()) { throw new NoSuchElementException("No more results in listing of " + listPath); } objects = awaitFuture(s3ListResultFuture); <START> LOG.debug("[{}], Requesting next objects under {}", <END> listingCount, maxKeys, listPath); fetchNextBatchAsyncIfPresent(); listingCount++; LOG.debug("New listing status: {}", this); } catch (AmazonClientException e) { throw translateException("listObjects()", listPath, e); } } objectsPrev = objects; return objectsPrev; }</code><technical_language>move log fetchNextBatchAsyncIfPresent</technical_language>

Target:
public S3ListResult next() throws IOException { if (firstListing) { firstListing = false; objects = awaitFuture(s3ListResultFuture); fetchNextBatchAsyncIfPresent(); } else { try { if (objectsPrev!= null && !objectsPrev.isTruncated()) { throw new NoSuchElementException("No more results in listing of " + listPath); } objects = awaitFuture(s3ListResultFuture); fetchNextBatchAsyncIfPresent(); listingCount++; LOG.debug("New listing status: {}", this); } catch (AmazonClientException e) { throw translateException("listObjects()", listPath, e); } } objectsPrev = objects; return objectsPrev; }
Source:
<code>public void read(CorfuPayloadMsg<ReadRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { boolean cacheable = msg.getPayload().isCacheReadResult(); if (log.isTraceEnabled()) { log.trace("read: {}, cacheable: {}", msg.getPayload().getAddresses(), cacheable); } ReadResponse rr = new ReadResponse(); long currentRead = Address.NON_ADDRESS; try { <START> for (Long address : msg.getPayload().getAddresses()) { currentRead = address; <END> ILogData logData = dataCache.get(address, cacheable); if (logData == null) { rr.put(address, LogData.getEmpty(address)); } else { rr.put(address, (LogData) logData); } } r.sendResponse(ctx, msg, CorfuMsgType.READ_RESPONSE.payloadMsg(rr)); } catch (DataCorruptionException e) { log.error( "Data corruption exception while reading addresses {}", msg.getPayload().getAddresses(), e); r.sendResponse(ctx, msg, CorfuMsgType.ERROR_DATA_CORRUPTION.payloadMsg(currentRead)); } }</code><technical_language>long instead of Long get rid of currentRead variable</technical_language>

Target:
public void read(CorfuPayloadMsg<ReadRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { boolean cacheable = msg.getPayload().isCacheReadResult(); if (log.isTraceEnabled()) { log.trace("read: {}, cacheable: {}", msg.getPayload().getAddresses(), cacheable); } ReadResponse rr = new ReadResponse(); for (long address : msg.getPayload().getAddresses()) { try { ILogData logData = dataCache.get(address, cacheable); if (logData == null) { rr.put(address, LogData.getEmpty(address)); } else { rr.put(address, (LogData) logData); } } catch (DataCorruptionException e) { log.error( "Data corruption exception while reading addresses {}", msg.getPayload().getAddresses(), e); r.sendResponse(ctx, msg, CorfuMsgType.ERROR_DATA_CORRUPTION.payloadMsg(address)); return; } } r.sendResponse(ctx, msg, CorfuMsgType.READ_RESPONSE.payloadMsg(rr)); }
Source:
<code>public String validate(Model model, @RequestParam String verificationCode) { String redirectUri = "redirect:/"; try { TwoFactorAuthenticationToken authToken = new TwoFactorAuthenticationToken(verificationCode, null); Authentication authentication = authenticationProvider.authenticate(authToken); SecurityContextHolder.getContext().setAuthentication(authentication); } <START> catch (Exception err) <END> { model.addAttribute(MolgenisLoginController.ERROR_MESSAGE_ATTRIBUTE, determineErrorMessage(err)); redirectUri = VIEW_2FA_CONFIGURED_MODAL; } return redirectUri; }</code><technical_language>catch(AuthenticationException e)</technical_language>

Target:
public String validate(Model model, @RequestParam String verificationCode) { String redirectUri = "redirect:/"; try { TwoFactorAuthenticationToken authToken = new TwoFactorAuthenticationToken(verificationCode, null); Authentication authentication = authenticationProvider.authenticate(authToken); SecurityContextHolder.getContext().setAuthentication(authentication); } catch (AuthenticationException err) { model.addAttribute(MolgenisLoginController.ERROR_MESSAGE_ATTRIBUTE, determineErrorMessage(err)); redirectUri = VIEW_2FA_CONFIGURED_MODAL; } return redirectUri; }
Source:
<code>public ArtifactoryClientBuilder addInterceptorLast(HttpRequestInterceptor httpRequestInterceptor) { if (this.requestInterceptorList == null) { <START> this.requestInterceptorList = new ArrayList<>(); <END> } this.requestInterceptorList.add(httpRequestInterceptor); return this; }</code><technical_language>I suggest add initialization in declaration, instead of this if if in line 148: private List<HttpRequestInterceptor> requestInterceptorLis = new ArrayList<>();</technical_language>

Target:
public ArtifactoryClientBuilder addInterceptorLast(HttpRequestInterceptor httpRequestInterceptor) { this.requestInterceptorList.add(httpRequestInterceptor); return this; }
Source:
<code>public void setupVariableContent() { IPathVariableManager pathVariableManager; if (content.getResource() != null) pathVariableManager = content.getResource().getPathVariableManager(); else pathVariableManager = ResourcesPlugin.getWorkspace().getPathVariableManager(); ArrayList items = new ArrayList(); for (String <START> variable : <END> pathVariableManager.getPathVariableNames()) { if (variable.equals("PARENT")) continue; items.add(variable); } items.add(IDEWorkbenchMessages.ImportTypeDialog_editVariables); variableCombo.setItems((String[]) items.toArray(new String[0])); }</code><technical_language>rename 'variableName'</technical_language>

Target:
public void setupVariableContent() { IPathVariableManager pathVariableManager; if (content.getResource() != null) pathVariableManager = content.getResource().getPathVariableManager(); else pathVariableManager = ResourcesPlugin.getWorkspace().getPathVariableManager(); ArrayList items = new ArrayList(); for (String variableName : pathVariableManager.getPathVariableNames()) { if (variableName.equals("PARENT")) continue; items.add(variableName); } items.add(IDEWorkbenchMessages.ImportTypeDialog_editVariables); variableCombo.setItems((String[]) items.toArray(new String[0])); }