auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static void run() throws Exception { initializeTest(); checkSubset(getClassloaderDescriptors(null), new String[] { "Ljava/lang/String;", "Ljava/util/TreeSet;" }, "Missing entries for null classloader."); checkEq(getClassloaderDescriptors(null), <START> getClassloaderDescriptors(Object.class.getClassLoader()), <END> "Object not in bcp!"); checkSubset(getClassloaderDescriptors(Test1946.class.getClassLoader()), new String[] { "Lart/Test1946;", "Lart/Test1946$TMP1;", "Lart/Test1946$TMP2;", "Lart/Test1946$TMP3;" }, "Missing entries for current class classloader."); checkEq(getClassloaderDescriptors(makeClassLoaderFrom(TEST_CLASSES, ClassLoader.getSystemClassLoader())), new String[] { "LA;", "LB;", "LC;", "LD;", "LE;" }, "Unexpected classes in custom classloader"); checkEq(getClassloaderDescriptors(makeClassLoaderFrom(TEST_CLASSES, Object.class.getClassLoader())), new String[] { "LA;", "LB;", "LC;", "LD;", "LE;" }, "Unexpected classes in custom classloader"); checkEq(getClassloaderDescriptors(makeClassLoaderFrom(TEST_CLASSES, Test1946.class.getClassLoader())), new String[] { "LA;", "LB;", "LC;", "LD;", "LE;" }, "Unexpected classes in custom classloader"); checkEq(getClassloaderDescriptors(makeClassLoaderFrom(Arrays.asList(TEST_CLASSES, TEST_CLASSES), Test1946.class.getClassLoader())), new String[] { "LA;", "LB;", "LC;", "LD;", "LE;" }, "Unexpected classes in custom classloader"); System.out.println("Passed!"); }</code><technical_language>Is this ClassLoader.getSystemClassLoader()</technical_language>

Target:
public static void run() { System.out.println("Failed! This should not be run. The test is in src-art/art/Test1946.java"); }
Source:
<code>public List<String> getApplicableMethodNames() { <START> return METHODS; <END> }</code><technical_language>if plan add explicit method names here, safe omit this method</technical_language>

Target:
public List<String> getApplicableMethodNames() { return methods; }
Source:
<code>public String post(@SpringBean("patientService") PatientService patientService, @RequestParam(value = "causeOfDeath", required = false) String causeOfDeath, @RequestParam(value = "dead", required = false) Boolean dead, @RequestParam(value = "deathDate", required = false) Date deathDate, @RequestParam("patientId") Patient patient, UiUtils ui, @RequestParam(value = "returnUrl", required = false) String returnUrl) { try { Date date = new Date(); if (dead != null && StringUtils.isNotBlank(causeOfDeath) && deathDate != null && !deathDate.before(patient.getBirthdate()) && !deathDate.after(date)) { patient.setDead(dead); patient.setCauseOfDeath(Context.getConceptService().getConceptByUuid(causeOfDeath)); patient.setDeathDate(deathDate); } else { patient.setDeathDate(null); patient.setDead(false); patient.setCauseOfDeath(null); } patientService.savePatient(patient); if (patient.isDead() && patient.getDeathDate() != null) { <START> actionAfterDeath(patient, patient.getDeathDate()); <END> } return "redirect:" + ui.pageLink("coreapps", "clinicianfacing/patient", SimpleObject.create("patientId", patient.getId(), "returnUrl", returnUrl)); } catch (APIException e) { log.error(e.getMessage(), e); return "redirect:" + ui.pageLink("coreapps", "markPatientDead", SimpleObject.create("patientId", patient.getId(), "returnUrl", returnUrl)); } }</code><technical_language>pass in parameter</technical_language>

Target:
public String post(@SpringBean("patientService") PatientService patientService, @RequestParam(value = "causeOfDeath", required = false) String causeOfDeath, @RequestParam(value = "dead", required = false) Boolean dead, @RequestParam(value = "deathDate", required = false) Date deathDate, @RequestParam("patientId") Patient patient, UiUtils ui, @RequestParam(value = "returnUrl", required = false) String returnUrl) { try { Date date = new Date(); if (dead != null && StringUtils.isNotBlank(causeOfDeath) && deathDate != null && !deathDate.before(patient.getBirthdate()) && !deathDate.after(date)) { patient.setDead(dead); patient.setCauseOfDeath(Context.getConceptService().getConceptByUuid(causeOfDeath)); patient.setDeathDate(deathDate); } else { patient.setDeathDate(null); patient.setDead(false); patient.setCauseOfDeath(null); } patientService.savePatient(patient); if (patient.isDead() && patient.getDeathDate() != null) { closeActiveVisitsAfterDeath(patient); } return "redirect:" + ui.pageLink("coreapps", "clinicianfacing/patient", SimpleObject.create("patientId", patient.getId(), "returnUrl", returnUrl)); } catch (APIException e) { log.error(e.getMessage(), e); return "redirect:" + ui.pageLink("coreapps", "markPatientDead", SimpleObject.create("patientId", patient.getId(), "returnUrl", returnUrl)); } }
Source:
<code>protected QueryParameters makeQueryParametersForExecution(String hql) { final HQLQueryPlan entityGraphHintedQueryPlan; if ( entityGraphQueryHint == null) { entityGraphHintedQueryPlan = null; } else { entityGraphHintedQueryPlan = new HQLQueryPlan( hql, false, getProducer().getLoadQueryInfluencers().getEnabledFilters(), getProducer().getFactory(), entityGraphQueryHint ); } QueryParameters queryParameters = new QueryParameters( getQueryParameterBindings(), getLockOptions(), queryOptions, true, isReadOnly(), cacheable, cacheRegion, comment, dbHints, null, optionalObject, optionalEntityName, optionalId, resultTransformer ); if ( entityGraphHintedQueryPlan != null ) { queryParameters.setQueryPlan( entityGraphHintedQueryPlan ); } else if ( this instanceof QueryImpl ) { QueryImpl hqlQuery = (QueryImpl) this; if ( hql.equals( hqlQuery.getQueryString() ) ) { queryParameters.setQueryPlan( hqlQuery.getQueryPlan() ); } <START> } <END> if ( passDistinctThrough != null ) { queryParameters.setPassDistinctThrough( passDistinctThrough ); } return queryParameters; }</code><technical_language>I improved this reused plan for isSelect() calls</technical_language>

Target:
protected QueryParameters makeQueryParametersForExecution(String hql) { final HQLQueryPlan entityGraphHintedQueryPlan; if ( entityGraphQueryHint == null) { entityGraphHintedQueryPlan = null; } else { entityGraphHintedQueryPlan = new HQLQueryPlan( hql, false, getProducer().getLoadQueryInfluencers().getEnabledFilters(), getProducer().getFactory(), entityGraphQueryHint ); } QueryParameters queryParameters = new QueryParameters( getQueryParameterBindings(), getLockOptions(), queryOptions, true, isReadOnly(), cacheable, cacheRegion, comment, dbHints, null, optionalObject, optionalEntityName, optionalId, resultTransformer ); appendQueryPlanToQueryParameters( hql, queryParameters, entityGraphHintedQueryPlan ); if ( passDistinctThrough != null ) { queryParameters.setPassDistinctThrough( passDistinctThrough ); } return queryParameters; }
Source:
<code>private void registerInstances(Collection<InstanceMonitor> instances) throws JMException { synchronized (_instanceMonitorMap) { for (InstanceMonitor monitor : instances) { String instanceName = monitor.getInstanceName(); String beanName = getInstanceBeanName(instanceName); <START> unregister(getObjectName(beanName)); <END> monitor.register(); _instanceMonitorMap.put(instanceName, monitor); } } }</code><technical_language>oldMonitor = _instanceMonitorMap.remove(instanceName); if (oldMonitor != null) { oldMonitor.unregister(); } monitor.register(); _instanceMonitorMap.put(instanceName, monitor);</technical_language>

Target:
private void registerInstances(Collection<InstanceMonitor> instances) throws JMException { synchronized (_instanceMonitorMap) { for (InstanceMonitor monitor : instances) { String instanceName = monitor.getInstanceName(); InstanceMonitor removedMonitor = _instanceMonitorMap.remove(instanceName); if (removedMonitor != null) { removedMonitor.unregister(); } monitor.register(); _instanceMonitorMap.put(instanceName, monitor); } } }
Source:
<code>public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) { RoleBasedAuthorizationStrategy strategy = (RoleBasedAuthorizationStrategy)source; Map<String, RoleMap> maps = strategy.getRoleMaps(); for (Map.Entry<String, RoleMap> map : maps.entrySet()) { RoleMap roleMap = map.getValue(); writer.startNode("roleMap"); writer.addAttribute("type", map.getKey()); for (Map.Entry<Role, Set<String>> grantedRole : roleMap.getGrantedRoles().entrySet()) { Role role = grantedRole.getKey(); if (role != null) { writer.startNode("role"); writer.addAttribute("name", role.getName()); writer.addAttribute("pattern", role.getPattern().pattern()); writer.startNode("permissions"); for (Permission permission : role.getPermissions()) { if(permission!=null) { writer.startNode("permission"); writer.setValue(permission.getId()); writer.endNode(); } else{ <START> throw new NullPointerException("Cannot process the permissions as they have been incorrectly configured in the script"); <END> } } writer.endNode(); writer.startNode("assignedSIDs"); for (String sid : grantedRole.getValue()) { writer.startNode("sid"); writer.setValue(sid); writer.endNode(); } writer.endNode(); writer.endNode(); } } writer.endNode(); } }</code><technical_language>I recommend explicitly null permission discovered in list of permission, preferable a reference Role type name</technical_language>

Target:
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) { RoleBasedAuthorizationStrategy strategy = (RoleBasedAuthorizationStrategy)source; Map<String, RoleMap> maps = strategy.getRoleMaps(); for (Map.Entry<String, RoleMap> map : maps.entrySet()) { RoleMap roleMap = map.getValue(); writer.startNode("roleMap"); writer.addAttribute("type", map.getKey()); for (Map.Entry<Role, Set<String>> grantedRole : roleMap.getGrantedRoles().entrySet()) { Role role = grantedRole.getKey(); if (role != null) { writer.startNode("role"); writer.addAttribute("name", role.getName()); writer.addAttribute("pattern", role.getPattern().pattern()); writer.startNode("permissions"); for (Permission permission : role.getPermissions()) { writer.startNode("permission"); writer.setValue(permission.getId()); writer.endNode(); } writer.endNode(); writer.startNode("assignedSIDs"); for (String sid : grantedRole.getValue()) { writer.startNode("sid"); writer.setValue(sid); writer.endNode(); } writer.endNode(); writer.endNode(); } } writer.endNode(); } }
Source:
<code>private Category(String name, Type type) { Objects.nonNull(name); <START> Objects.nonNull(type); <END> this.name = name; this.type = type; }</code><technical_language>This removed</technical_language>

Target:
private Category(String name, Type type) { this.name = name; this.type = type; }
Source:
<code>public void init() throws ServletException { ServerConfigurationService scs = (ServerConfigurationService) ComponentManager.get(ServerConfigurationService.class); if(scs != null) { <START> DEFAULT_LIST_PAGE_SIZE = scs.getInt("citations.default.list.page.size", 50); <END> } else { logger.warn("Failed to get default list page size as ServerConfigurationService is null. Defaulting to " + DEFAULT_LIST_PAGE_SIZE); } }</code><technical_language>Introduction of a magic number (see L468)</technical_language>

Target:
public void init() throws ServletException { ServerConfigurationService scs = (ServerConfigurationService) ComponentManager.get(ServerConfigurationService.class); if(scs != null) { defaultListPageSize = scs.getInt("citations.default.list.page.size", 50); } else { logger.warn("Failed to get default list page size as ServerConfigurationService is null. Defaulting to " + defaultListPageSize); defaultListPageSize = 50; } }
Source:
<code>protected String createHttpRequestURL() { String bugUrl = getUrlSuffix(); LoginToken token = ((BugzillaRestHttpClient) getClient()).getLoginToken(); <START> if (token != null && bugUrl.length() > 0) { <END> if (!bugUrl.endsWith("?")) { bugUrl += "&"; } bugUrl += "token=" + token.getToken(); } else { String apiKey = ((BugzillaRestHttpClient) getClient()).getApiKey(); if (apiKey != null && bugUrl.length() > 0) { if (!bugUrl.endsWith("?")) { bugUrl += "&"; } bugUrl += "api_key=" + apiKey; } } return baseUrl() + bugUrl; }</code><technical_language>other request code prefers api keys tokens, I behaviour consistent. I is I enough this connector, inconsistency problems</technical_language>

Target:
protected String createHttpRequestURL() { String bugUrl = getUrlSuffix(); if (bugUrl.length() > 0 && authenticationRequired) { RepositoryLocation location = getClient().getLocation(); if (Boolean.parseBoolean(location.getProperty(IBugzillaRestConstants.REPOSITORY_USE_API_KEY))) { bugUrl += MessageFormat.format("{1}Bugzilla_api_key={0}", new Object[] { location.getProperty(IBugzillaRestConstants.REPOSITORY_API_KEY), bugUrl.endsWith("?") ? "" : "&" }); } else { if (!bugUrl.endsWith("?")) { bugUrl += "&"; } UserCredentials credentials = location.getCredentials(AuthenticationType.REPOSITORY); if (credentials == null) { throw new IllegalStateException("Authentication requested without valid credentials"); } bugUrl += MessageFormat.format("Bugzilla_login={0}&Bugzilla_password={1}", new Object[] { credentials.getUserName(), credentials.getPassword() }); } } return baseUrl() + bugUrl; }
Source:
<code>private Map<String, String> configProperties() { Map<String, String> props = new HashMap<>(); props.put("connector.class", "JdbcSourceConnector"); props.put(CONNECTION_URL_CONFIG, MSSQL_URL); props.put(CONNECTION_USER_CONFIG, "sa"); props.put(CONNECTION_PASSWORD_CONFIG, "reallyStrongPwd123"); props.put(TABLE_WHITELIST_CONFIG, MSSQL_Table); props.put(TIMESTAMP_COLUMN_NAME_CONFIG, "start_time"); props.put(TOPIC_PREFIX_CONFIG, "test-"); props.put(POLL_INTERVAL_MS_CONFIG, "30"); props.put("tasks.max", Integer.toString(TASKS_MAX)); props.put("key.converter", StringConverter.class.getName()); props.put("value.converter", StringConverter.class.getName()); <START> props.put("confluent.topic.bootstrap.servers", connect.kafka().bootstrapServers()); props.put("confluent.topic.replication.factor", "1"); <END> return props; }</code><technical_language>I need (this connector require a license)</technical_language>

Target:
private Map<String, String> configProperties() { Map<String, String> props = new HashMap<>(); props.put(CONNECTOR_CLASS_CONFIG, "JdbcSourceConnector"); props.put(CONNECTION_URL_CONFIG, MSSQL_URL); props.put(CONNECTION_USER_CONFIG, "sa"); props.put(CONNECTION_PASSWORD_CONFIG, "reallyStrongPwd123"); props.put(TABLE_WHITELIST_CONFIG, MSSQL_Table); props.put(TIMESTAMP_COLUMN_NAME_CONFIG, "start_time"); props.put(TOPIC_PREFIX_CONFIG, "test-"); props.put(POLL_INTERVAL_MS_CONFIG, "30"); props.put(TASKS_MAX_CONFIG, Integer.toString(TASKS_MAX)); props.put(KEY_CONVERTER_CLASS_CONFIG, StringConverter.class.getName()); props.put(VALUE_CONVERTER_CLASS_CONFIG, StringConverter.class.getName()); return props; }
Source:
<code>public static int getAmountAvailable(Campaign campaign, AmmoType ammoType) { if (campaign.getCampaignOptions().useAmmoByType()) { Predicate<Part> predicate; if (AmmoBin.ALLOWED_BY_TYPE.contains(ammoType.getAmmoType())) { predicate = part -> { return part instanceof AmmoStorage && ammoType.equalsAmmoTypeOnly(((AmmoStorage) part).getType()) && ammoType.getMunitionType() == ((AmmoType) ((AmmoStorage) part).getType()).getMunitionType(); }; } else { predicate = part -> { return part instanceof AmmoStorage && ammoType.equals(((AmmoStorage) part).getType()) && ammoType.getMunitionType() == ((AmmoType) ((AmmoStorage) part).getType()).getMunitionType(); }; } AmmoStorage a = (AmmoStorage) campaign.findSparePart(predicate); return a != null ? a.getShots() : 0; } else { return campaign.streamSpareParts() .filter(part -> part instanceof AmmoStorage && part.isPresent()) .mapToInt(part -> { AmmoStorage a = (AmmoStorage)part; AmmoType aType = (AmmoType)a.getType(); if (aType.equals(ammoType) && ammoType.getMunitionType() == aType.getMunitionType()) { return a.getShots(); <START> } else if (isCompatibleAmmo(campaign, aType, ammoType) && ammoType.getRackSize() != 0) { <END> return (a.getShots() * aType.getRackSize()) / ammoType.getRackSize(); } return 0; }) .sum(); } }</code><technical_language>suggestion } else if (isCompatibleAmmo(campaign, aType, ammoType) && (ammoType.getRackSize() != 0)) {</technical_language>

Target:
public static int getAmountAvailable(Campaign campaign, AmmoType ammoType) { if (campaign.getCampaignOptions().useAmmoByType()) { Predicate<Part> predicate; if (AmmoBin.ALLOWED_BY_TYPE.contains(ammoType.getAmmoType())) { predicate = part -> { return part instanceof AmmoStorage && ammoType.equalsAmmoTypeOnly(((AmmoStorage) part).getType()) && ammoType.getMunitionType() == ((AmmoType) ((AmmoStorage) part).getType()).getMunitionType(); }; } else { predicate = part -> { return part instanceof AmmoStorage && ammoType.equals(((AmmoStorage) part).getType()) && ammoType.getMunitionType() == ((AmmoType) ((AmmoStorage) part).getType()).getMunitionType(); }; } AmmoStorage a = (AmmoStorage) campaign.findSparePart(predicate); return a != null ? a.getShots() : 0; } else { return campaign.streamSpareParts() .filter(part -> part instanceof AmmoStorage && part.isPresent()) .mapToInt(part -> { AmmoStorage a = (AmmoStorage)part; AmmoType aType = (AmmoType)a.getType(); if (aType.equals(ammoType) && (ammoType.getMunitionType() == aType.getMunitionType())) { return a.getShots(); } else if (isCompatibleAmmo(campaign, aType, ammoType) && (ammoType.getRackSize() != 0)) { return (a.getShots() * aType.getRackSize()) / ammoType.getRackSize(); } return 0; }) .sum(); } }
Source:
<code><START> public boolean isUsingScsiReservation() { <END> return usingScsiReservation; }</code><technical_language>this a Boolean, null (when load disk "disk for vm")</technical_language>

Target:
public Boolean isUsingScsiReservation() { return usingScsiReservation; }
Source:
<code>public void verifyQuestionNotPresent(int questionNum) { try { getQuestionResponsesSection(questionNum); <START> throw new RuntimeException("Question " + questionNum + " should not be present."); <END> } catch (NoSuchElementException e) { } }</code><technical_language>Assert.fail instead</technical_language>

Target:
public void verifyQuestionNotPresent(int questionNum) { try { getQuestionResponsesSection(questionNum); fail("Question " + questionNum + " should not be present."); } catch (NoSuchElementException e) { } }
Source:
<code>public static Collection<WorldProperties> getUnloadedWorlds() throws IOException { final Optional<Path> optCurrentSavesDir = getCurrentSavesDirectory(); checkState(optCurrentSavesDir.isPresent(), "Attempt made to get unloaded worlds too early!"); <START> final DirectoryStream<Path> stream = Files.newDirectoryStream(optCurrentSavesDir.get(), LEVEL_AND_SPONGE); <END> final List<WorldProperties> worlds = new ArrayList<>(); for (Path worldFolder : stream) { final String worldFolderName = worldFolder.getFileName().toString(); final WorldInfo worldInfo = new AnvilSaveHandler(DimensionManager.getCurrentSavesDirectory().get().toFile(), worldFolderName, true, ((MinecraftServer) Sponge.getServer()).getDataFixer()).loadWorldInfo(); if (worldInfo != null) { worlds.add((WorldProperties) worldInfo); } } return worlds; }</code><technical_language>close this stream, e.g. simply putting a try-with-resources statement (without a catch clause)</technical_language>

Target:
public static Collection<WorldProperties> getUnloadedWorlds() throws IOException { final Optional<Path> optCurrentSavesDir = getCurrentSavesDirectory(); checkState(optCurrentSavesDir.isPresent(), "Attempt made to get unloaded worlds too early!"); final List<WorldProperties> worlds = new ArrayList<>(); try (final DirectoryStream<Path> stream = Files.newDirectoryStream(optCurrentSavesDir.get(), LEVEL_AND_SPONGE)) { for (Path worldFolder : stream) { final String worldFolderName = worldFolder.getFileName().toString(); final WorldInfo worldInfo = new AnvilSaveHandler(DimensionManager.getCurrentSavesDirectory().get().toFile(), worldFolderName, true, ((MinecraftServer) Sponge.getServer()).getDataFixer()).loadWorldInfo(); if (worldInfo != null) { worlds.add((WorldProperties) worldInfo); } } } return worlds; }
Source:
<code>public String getMimeType() { String returnString = ""; if(!Files.isDirectory(path)) { TikaConfig tc = TikaConfig.getDefaultConfig(); <START> Detector detector = tc.getDetector(); <END> TikaInputStream stream = null; try { stream = TikaInputStream.get(new FileInputStream(new File(path.toString()))); } catch (FileNotFoundException e) { e.printStackTrace(); } Metadata metadata = new Metadata(); metadata.add(Metadata.RESOURCE_NAME_KEY, path.getFileName().toString()); try { MediaType mediaType = detector.detect(stream, metadata); returnString = mediaType.toString(); } catch (IOException e) { e.printStackTrace(); } } return returnString; }</code><technical_language>note: static final</technical_language>

Target:
public String getMimeType() { String returnString = ""; if(!Files.isDirectory(path)) { TikaConfig tc = TikaConfig.getDefaultConfig(); Detector detector = tc.getDetector(); try (TikaInputStream stream = TikaInputStream.get(new FileInputStream(new File(path.toString())))) { Metadata metadata = new Metadata(); metadata.add(Metadata.RESOURCE_NAME_KEY, path.getFileName().toString()); MediaType mediaType = detector.detect(stream, metadata); returnString = mediaType.toString(); } catch (IOException e) { e.printStackTrace(); } } return returnString; }
Source:
<code>public CloudBigtableScanConfiguration build() { if (request == null) { if(scan == null){ scan = new Scan(); } <START> request = new RequestWithScanValueProvider(scan.getStartRow(), scan.getStopRow(), <END> scan.getMaxVersions(), scan.getFilter()); } return new CloudBigtableScanConfiguration(projectId, instanceId, tableId, request, additionalConfiguration); }</code><technical_language>a BIgtableExtendedScan needs considered here. This approach work</technical_language>

Target:
public CloudBigtableScanConfiguration build() { RowSet rowSet = null; if (request == null) { if (scan == null) { scan = new Scan(); } BigtableExtendedScan extendedScan = new BigtableExtendedScan(); extendedScan.addRange(scan.getStartRow(), scan.getStopRow()); extendedScan.setMaxVersions(scan.getMaxVersions()); extendedScan.setFilter(scan.getFilter()); rowSet = extendedScan.getRowSet(); } return new CloudBigtableScanConfiguration(projectId, instanceId, tableId, request, rowSet, additionalConfiguration); }
Source:
<code>public void prepare() throws Exception { String phpRepoLocation = "<LINK_0>"; List<ProjectConfigDto> list = new ArrayList<>(); List<String> projects = Arrays.asList( NAME_OF_PROJECT_FOR_CHECKING_GIT_SOFT_RESET, NAME_OF_PROJECT_FOR_CHECKING_GIT_HARD_RESET, NAME_OF_PROJECT_FOR_CHECKING_GIT_MIX_RESET); SourceStorageDto sourceStorage = DtoFactory.getInstance() .createDto(SourceStorageDto.class) .withLocation(phpRepoLocation) .withType("git"); projects.forEach(item -> list.add(configureTestProject(item, sourceStorage))); WorkspaceConfigDto workspace = workspaceDtoDeserializer.deserializeWorkspaceTemplate(DEFAULT); workspace.setProjects(list); testWorkspace = <START> new TestWorkspaceImpl( <END> NameGenerator.generate("check-resetting-test", 4), testUser, 4, workspace, workspaceServiceClient); ide.open(testWorkspace); projects.forEach(item -> projectExplorer.waitItem(item)); notificationsPopupPanel.waitPopupPanelsAreClosed(); projectExplorer.quickExpandWithJavaScript(); }</code><technical_language>create test workspace pragmatically in test</technical_language>

Target:
public void prepare() throws Exception { List<String> projects = Arrays.asList( NAME_OF_PROJECT_FOR_CHECKING_GIT_SOFT_RESET, NAME_OF_PROJECT_FOR_CHECKING_GIT_HARD_RESET, NAME_OF_PROJECT_FOR_CHECKING_GIT_MIX_RESET); ide.open(ws); projects.forEach(item -> projectExplorer.waitItem(item)); notificationsPopupPanel.waitPopupPanelsAreClosed(); projectExplorer.quickExpandWithJavaScript(); }
Source:
<code>public List<String> getRawTerms(Document articleXml) throws IOException { ArrayList<String> rawTerms = new ArrayList<>(); rawTerms.add("dummy raw term"); <START> return rawTerms; <END> }</code><technical_language>Guava's ImmutableList.of(...) save a typing in cases this</technical_language>

Target:
public List<String> getRawTerms(Document articleXml) throws IOException { return ImmutableList.of("dummy raw term"); }
Source:
<code>public SimpleFeatureType retrieveSchema(Name name) throws IOException { if (name == null) { return null; } File schemaFile = schemaFile(name); if (!schemaFile.canRead()) { return null; } BufferedReader reader = new BufferedReader(new FileReader(schemaFile)); <START> return MongoSchemaStore.super.getSimpleFeatureType(reader, name); <END> }</code><technical_language>'MongoSchemaStore.super' access instance is needed breaks class override capability in a future case, getSimpleFeatureType is a default method inherited default</technical_language>

Target:
public SimpleFeatureType retrieveSchema(Name name) throws IOException { if (name == null) { return null; } File schemaFile = schemaFile(name); if (!schemaFile.canRead()) { return null; } BufferedReader reader = new BufferedReader(new FileReader(schemaFile)); return MongoUtil.getSimpleFeatureType(reader, name); }
Source:
<code>public static Locator createLocatorFromPathComponents(String tenantId, String... parts) throws IllegalArgumentException { if(StringUtils.isEmpty(tenantId) || parts == null) <START> throw new IllegalArgumentException("'tenantId' is null or empty OR 'parts' is null."); <END> return new Locator(tenantId + METRIC_TOKEN_SEPARATOR + StringUtils.join(parts, METRIC_TOKEN_SEPARATOR)); }</code><technical_language>throwing exception instead of logging error? happen thread if exception is thrown? server down? fine checking inputs received parties, adding exceptions this code dangerous knowing consequences. i missing something</technical_language>

Target:
public static Locator createLocatorFromPathComponents(String tenantId, String... parts) throws IllegalArgumentException { if(StringUtils.isEmpty(tenantId) || parts == null) log.error("'tenantId' is null or empty OR 'parts' is null."); return new Locator(tenantId + METRIC_TOKEN_SEPARATOR + StringUtils.join(parts, METRIC_TOKEN_SEPARATOR)); }
Source:
<code>private static void cwl(List<String> args) { if (args.isEmpty()) { kill("Please provide a container."); } String[] parts = args.get(0).split(":"); String path = parts[0]; String tag = (parts.length > 1) ? parts[1] : null; out("TAG: " + tag); try { <START> Container container = containersApi.getContainerByPath(path); <END> if (container.getHasCollab()) { try { FileResponse collab = containersApi.cwl(container.getId(), tag); if (collab.getContent() != null && !collab.getContent().isEmpty()) { out(collab.getContent()); } else { out("No cwl file found."); } } catch (ApiException ex) { if (ex.getCode() == HttpStatus.SC_BAD_REQUEST) { out("Invalid tag"); } else { out("No cwl file found."); } } } else { out("No cwl file found."); } } catch (ApiException ex) { out("Could not find container"); } }</code><technical_language>In of error conditions, method return immediately (for clarity) CLI return a non-zero exit code</technical_language>

Target:
private static void cwl(List<String> args) { if (args.isEmpty()) { kill("Please provide a container."); } String[] parts = args.get(0).split(":"); String path = parts[0]; String tag = (parts.length > 1) ? parts[1] : null; try { Container container = containersApi.getContainerByPath(path); if (container.getHasCollab()) { try { SourceFile file = containersApi.cwl(container.getId(), tag); if (file.getContent() != null && !file.getContent().isEmpty()) { out(file.getContent()); } else { kill("No cwl file found."); } } catch (ApiException ex) { if (ex.getCode() == HttpStatus.SC_BAD_REQUEST) { kill("Invalid tag"); } else { kill("No cwl file found."); } } } else { kill("No cwl file found."); } } catch (ApiException ex) { kill("Could not find container"); } }
Source:
<code>public void refresh(Detail detail, TreeReference reference, int index) { <START> EntityDetailPagerAdapter mEntityDetailPagerAdapter = <END> new EntityDetailPagerAdapter(mContext.getSupportFragmentManager(), detail, index, reference, new ListItemViewStriper(this.mOddColor, this.mEvenColor)); mViewPager.setAdapter(mEntityDetailPagerAdapter); if (!detail.isCompound()) { if (mViewPageTabStrip != null) { mViewPageTabStrip.setVisibility(GONE); } } }</code><technical_language>'m' prefix longer a member variable</technical_language>

Target:
public void refresh(Detail detail, TreeReference reference, int index) { EntityDetailPagerAdapter entityDetailPagerAdapter = new EntityDetailPagerAdapter(mContext.getSupportFragmentManager(), detail, index, reference, new ListItemViewStriper(this.mOddColor, this.mEvenColor)); mViewPager.setAdapter(entityDetailPagerAdapter); if (!detail.isCompound()) { if (mViewPageTabStrip != null) { mViewPageTabStrip.setVisibility(GONE); } } }
Source:
<code>public void testCreate() { Invoice invoiceCreated = api.create( new InvoiceRequest() .addItem("Product", 1, "Detail", 1000) .customer( new CustomerRequest() .email("vavagner.vieira@moip.com.br")) .checkoutPreferences( new CheckoutPreferencesRequest() .fundingInstruments( new FundingInstrumentRequest() .supressBoleto(true)) .addInstallment( new int[]{1, 2}) .addInstallment( new int[]{6, 9}) .supressShippingAddress(true))); assertEquals("INV-B36128A22351", invoiceCreated.getId()); assertEquals(Integer.valueOf(1000), invoiceCreated.getAmount().getTotal()); <START> assertEquals("My Invoice Product", invoiceCreated.getItems().get(0).getProduct()); <END> assertEquals("My Invoice Detail", invoiceCreated.getItems().get(0).getDetail()); }</code><technical_language>product detail asserts ok? create invoice a text..</technical_language>

Target:
public void testCreate() { Invoice invoiceCreated = api.create( new InvoiceRequest() .addItem("My Invoice Product", 1, "My Invoice Detail", 1000) .customer( new CustomerRequest() .email("vavagner.vieira@moip.com.br")) .checkoutPreferences( new CheckoutPreferencesRequest() .fundingInstruments( new FundingInstrumentRequest() .suppressBoleto(true)) .addInstallment( new int[]{1, 2}) .addInstallment( new int[]{6, 9}) .supressShippingAddress(true))); assertEquals("INV-B36128A22351", invoiceCreated.getId()); assertEquals(Integer.valueOf(1000), invoiceCreated.getAmount().getTotal()); assertEquals("My Invoice Product", invoiceCreated.getItems().get(0).getProduct()); assertEquals("My Invoice Detail", invoiceCreated.getItems().get(0).getDetail()); }
Source:
<code>public void testPushWithoutOptions() throws Exception { <START> try (Git git = new Git(db); Git git2 = new Git(createBareRepository())) { final StoredConfig config = constructConfig(git, git2); config.save(); <END> final StoredConfig config2 = git2.getRepository().getConfig(); config2.setBoolean("receive", null, "pushoptions", true); config2.save(); RevCommit commit = setupCommit(git); git.checkout().setName("not-pushed").setCreateBranch(true).call(); git.checkout().setName("branchtopush").setCreateBranch(true).call(); assertNull(git2.getRepository().resolve("refs/heads/branchtopush")); assertNull(git2.getRepository().resolve("refs/heads/not-pushed")); assertNull(git2.getRepository().resolve("refs/heads/master")); PushCommand pushCommand = git.push().setRemote("test"); pushCommand.call(); assertEquals(commit.getId(), git2.getRepository().resolve("refs/heads/branchtopush")); assertNull(git2.getRepository().resolve("refs/heads/not-pushed")); assertNull(git2.getRepository().resolve("refs/heads/master")); } }</code><technical_language>"constructConfig" convey meaning. returned config.save(), suggest a single "void connectLocalToRemote(Git local, Git remote)" helper function (which static). s/git/local/ s/git2/remote/ improve readability</technical_language>

Target:
public void testPushWithoutOptions() throws Exception { try (Git git = new Git(db); Git git2 = new Git(createBareRepository())) { connectLocalToRemote(git, git2); final StoredConfig config2 = git2.getRepository().getConfig(); config2.setBoolean("receive", null, "pushoptions", true); config2.save(); RevCommit commit = addCommit(git); git.checkout().setName("not-pushed").setCreateBranch(true).call(); git.checkout().setName("branchtopush").setCreateBranch(true).call(); assertNull(git2.getRepository().resolve("refs/heads/branchtopush")); assertNull(git2.getRepository().resolve("refs/heads/not-pushed")); assertNull(git2.getRepository().resolve("refs/heads/master")); PushCommand pushCommand = git.push().setRemote("test"); pushCommand.call(); assertEquals(commit.getId(), git2.getRepository().resolve("refs/heads/branchtopush")); assertNull(git2.getRepository().resolve("refs/heads/not-pushed")); assertNull(git2.getRepository().resolve("refs/heads/master")); } }
Source:
<code>public List<Tree.Kind> nodesToVisit() { <START> return ImmutableList.of(Tree.Kind.METHOD, Tree.Kind.METHOD_INVOCATION, Tree.Kind.NEW_CLASS); <END> }</code><technical_language>If correct end Method Lambda subscribed kinds</technical_language>

Target:
public List<Tree.Kind> nodesToVisit() { return ImmutableList.of(Tree.Kind.METHOD, Tree.Kind.LAMBDA_EXPRESSION); }
Source:
<code>private String executeRequest(String request, String command, boolean login) throws RWESmarthomeSessionExpiredException { if(!login && "".equals(sessionId)) throw new RWESmarthomeSessionExpiredException(); String sReturn = ""; try { sReturn = client.execute(hostname, clientId, request, command); if (sReturn.contains("IllegalSessionId")) { logger.warn("Session expired!"); sessionId = ""; throw new RWESmarthomeSessionExpiredException(sReturn); } } catch (ClientProtocolException ex) { logger.error(ex.getClass().getSimpleName(), ex); } catch (IOException ex) { logger.error(ex.getClass().getSimpleName(), ex); } finally { <START> } <END> return sReturn; }</code><technical_language>remove finally-block</technical_language>

Target:
private String executeRequest(String request, String command, boolean login) throws RWESmarthomeSessionExpiredException { if(!login && "".equals(sessionId)) { throw new RWESmarthomeSessionExpiredException(); } String sReturn = ""; try { sReturn = client.execute(hostname, clientId, request, command); if (sReturn.contains("IllegalSessionId")) { logger.info("Session expired!"); sessionId = ""; throw new RWESmarthomeSessionExpiredException(sReturn); } logger.trace("XMLResponse:" + sReturn); } catch (ClientProtocolException ex) { logger.error(ex.getClass().getSimpleName(), ex); } catch (IOException ex) { logger.error(ex.getClass().getSimpleName(), ex); } return sReturn; }
Source:
<code>ExecMetrics() { <START> this.registry = SERVICE_PROVIDER.getInstance(MetricsManager.class).getRegistry(); <END> setupStaticMetrics(); }</code><technical_language>Sort of MetricManager in parameter this case</technical_language>

Target:
ExecMetrics() { this.registry = SERVICE_PROVIDER.getInstance(MetricRegistry.class); setupStaticMetrics(); }
Source:
<code>public void testRecordSubmoduleLabels() throws Exception { try ( Repository remoteDb = createBareRepository(); Repository tempDb = createWorkRepository()) { StringBuilder xmlContent = new StringBuilder(); xmlContent .append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") .append("<manifest>") .append("<remote name=\"remote1\" fetch=\".\" />") .append("<default revision=\"master\" remote=\"remote1\" />") .append("<project path=\"test\" ") .append("revision=\"master\" ") .append("name=\"").append(notDefaultUri).append("\" ") .append("groups=\"a1,a2\" />") .append("</manifest>"); JGitTestUtil.writeTrashFile(tempDb, "manifest.xml", xmlContent.toString()); RepoCommand command = new RepoCommand(remoteDb); command.setPath(tempDb.getWorkTree().getAbsolutePath() + "/manifest.xml") .setURI(rootUri) .setRecordSubmoduleLabels(true) .call(); File directory = createTempDirectory("testBareRepo"); try (Repository localDb = Git.cloneRepository() .setDirectory(directory) .setURI(remoteDb.getDirectory().toURI().toString()).call() .getRepository();) { File gitmodules = new File(localDb.getWorkTree(), ".gitmodules"); assertTrue("The .gitmodules file should exist", gitmodules.exists()); FileBasedConfig c = new FileBasedConfig(gitmodules, FS.DETECTED); c.load(); String[] expect = new String[] {"a1", "a2"}; <START> assertArrayEquals("recording <END> labels works", expect, c.getStringList("submodule", "test", "label")); } } }</code><technical_language>order array matter here? If I convert a set check members more sense here</technical_language>

Target:
public void testRecordSubmoduleLabels() throws Exception { try ( Repository remoteDb = createBareRepository(); Repository tempDb = createWorkRepository()) { StringBuilder xmlContent = new StringBuilder(); xmlContent .append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") .append("<manifest>") .append("<remote name=\"remote1\" fetch=\".\" />") .append("<default revision=\"master\" remote=\"remote1\" />") .append("<project path=\"test\" ") .append("revision=\"master\" ") .append("name=\"").append(notDefaultUri).append("\" ") .append("groups=\"a1,a2\" />") .append("</manifest>"); JGitTestUtil.writeTrashFile(tempDb, "manifest.xml", xmlContent.toString()); RepoCommand command = new RepoCommand(remoteDb); command.setPath(tempDb.getWorkTree().getAbsolutePath() + "/manifest.xml") .setURI(rootUri) .setRecordSubmoduleLabels(true) .call(); File directory = createTempDirectory("testBareRepo"); try (Repository localDb = Git.cloneRepository() .setDirectory(directory) .setURI(remoteDb.getDirectory().toURI().toString()).call() .getRepository();) { File gitmodules = new File(localDb.getWorkTree(), ".gitmodules"); assertTrue("The .gitmodules file should exist", gitmodules.exists()); FileBasedConfig c = new FileBasedConfig(gitmodules, FS.DETECTED); c.load(); Set<String> expect = new HashSet<String>(); expect.add("a1"); expect.add("a2"); Set<String> actual = new HashSet<String>(); actual.addAll(Arrays.asList(c.getStringList("submodule", "test", "label"))); assertEquals("recording labels works", expect, actual); } } }
Source:
<code>public static void putObject_test14() throws Exception { if (!mintEnv) { System.out.println("Test: putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse) using SSE_S3."); } long startTime = System.currentTimeMillis(); ServerSideEncryption sse = ServerSideEncryption.atRest(); try { String objectName = getRandomName(); try (final InputStream is = new ContentInputStream(1 * MB)) { client.putObject(bucketName, objectName, is, 1 * MB, sse); } client.removeObject(bucketName, objectName); mintSuccessLog("putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse)", <START> "size: 13 MB", startTime); <END> } catch (Exception e) { mintFailedLog("putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse)", "size: 13 MB", startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } }</code><technical_language>Size is 1 MB, please update</technical_language>

Target:
public static void putObject_test14() throws Exception { if (!mintEnv) { System.out.println("Test: putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse) using SSE_S3."); } long startTime = System.currentTimeMillis(); ServerSideEncryption sse = ServerSideEncryption.atRest(); try { String objectName = getRandomName(); try (final InputStream is = new ContentInputStream(1 * MB)) { client.putObject(bucketName, objectName, is, 1 * MB, sse); } client.removeObject(bucketName, objectName); mintSuccessLog("putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse) using SSE_S3.", "size: 1 MB", startTime); } catch (Exception e) { mintFailedLog("putObject(String bucketName, String objectName, InputStream stream, " + "long size, ServerSideEncryption sse) using SSE_S3.", "size: 1 MB", startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } }
Source:
<code>public void endRecord() { ++rowCount; <START> if (rowCount >= rowCountForNextRowCountCheck) { <END> rowCountCheck(); } if (rowCount >= rowCountForNextSizeCheck) { sizeCheck(); } }</code><technical_language>This is in a tight loop, I a bit more careful. I this check size check if statement if guarantee rowCountForNextSizeCheck <= rowCountForNextRowCountCheck ensuring size check count larger row count check. need do test for row</technical_language>

Target:
public void endRecord() { ++rowCount; if (rowCount >= rowCountForNextSizeCheck) { sizeCheck(); } }
Source:
<code>public void serialize(@Nullable Object obj) throws IOException { if (obj == null) { nullRowsBitmap.add(rowCount); <START> writer.add(0L); <END> } else { writer.add(((Number) obj).floatValue()); } rowCount++; }</code><technical_language>0f</technical_language>

Target:
public void serialize(@Nullable Object obj) throws IOException { if (obj == null) { nullRowsBitmap.add(rowCount); writer.add(0f); } else { writer.add(((Number) obj).floatValue()); } rowCount++; }
Source:
<code>public void castFireball() throws SpellCastException { if (this.calculateMagicPower() >= 10.0) { System.out.println(this.toString() + ": a fireball spell is casted"); } else { <START> throw new SpellCastException("Can not cast lighting! Not enough magic power..."); <END> } }</code><technical_language>A typo here, message cast fireball!</technical_language>

Target:
public void castFireball() throws SpellCastException { if (calculateMagicPower() >= 10.0) { System.out.println(toString() + ": a fireball spell is casted"); } else { throw new SpellCastException("Can not cast fire ball! Not enough magic power..."); } }
Source:
<code>public void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); <START> if (instructor == null) { <END> throw new UnauthorizedAccessException("Not instructor of the course"); } gateKeeper.verifyAccessible( instructor, logic.getCourse(courseId), Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR); }</code><technical_language>null check omitted is checked verifyAccessible</technical_language>

Target:
public void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); gateKeeper.verifyAccessible( instructor, logic.getCourse(courseId), Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR); }
Source:
<code>protected List<? extends Module> getModules() { return ImmutableList.<Module>of( new Module() { @Override public void configure(Binder binder) { binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/internal-hadoop-indexer"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(0); <START> binder.bind(NodeTypeConfig.class).toInstance(new NodeTypeConfig("internal-hadoop-indexer")); <END> MetadataStorageUpdaterJobSpec metadataSpec = getHadoopDruidIndexerConfig().getSchema() .getIOConfig() .getMetadataUpdateSpec(); binder.bind(new TypeLiteral<Supplier<MetadataStorageConnectorConfig>>() {}) .toInstance(metadataSpec); binder.bind(MetadataStorageTablesConfig.class).toInstance(metadataSpec.getMetadataStorageTablesConfig()); binder.bind(IndexerMetadataStorageCoordinator.class).to(IndexerSQLMetadataStorageCoordinator.class).in( LazySingleton.class ); } } ); }</code><technical_language>rename "hadoop-indexer" , consistent command name</technical_language>

Target:
protected List<? extends Module> getModules() { return ImmutableList.<Module>of( new Module() { @Override public void configure(Binder binder) { binder.bindConstant().annotatedWith(Names.named("serviceName")).to("druid/internal-hadoop-indexer"); binder.bindConstant().annotatedWith(Names.named("servicePort")).to(0); binder.bind(NodeTypeConfig.class).toInstance(new NodeTypeConfig("hadoop-indexer")); MetadataStorageUpdaterJobSpec metadataSpec = getHadoopDruidIndexerConfig().getSchema() .getIOConfig() .getMetadataUpdateSpec(); binder.bind(new TypeLiteral<Supplier<MetadataStorageConnectorConfig>>() {}) .toInstance(metadataSpec); binder.bind(MetadataStorageTablesConfig.class).toInstance(metadataSpec.getMetadataStorageTablesConfig()); binder.bind(IndexerMetadataStorageCoordinator.class).to(IndexerSQLMetadataStorageCoordinator.class).in( LazySingleton.class ); } } ); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_dds_style_circles_categorically); mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(@NonNull final MapboxMap mapboxMap) { mapboxMap.setStyle(Style.LIGHT, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { VectorSource vectorSource = new VectorSource( "ethnicity-source", "<LINK_0>" + Mapbox.getAccessToken() ); mapboxMap.getStyle().addSource(vectorSource); CircleLayer circleLayer = new CircleLayer("population", "ethnicity-source"); circleLayer.setSourceLayer("sf2010"); circleLayer.withProperties( circleRadius( interpolate( exponential(1.75f), zoom(), stop(12, 2f), stop(22, 180f) )), circleColor( match(get("ethnicity"), rgb(0, 0, 0), stop("white", rgb(251, 176, 59)), stop("Black", rgb(34, 59, 83)), stop("Hispanic", rgb(229, 94, 94)), stop("Asian", rgb(59, 178, 208)), stop("Other", rgb(204, 204, 204))))); <START> mapboxMap.getStyle().addLayer(circleLayer); <END> } }); } }); }</code><technical_language>callback style instead</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_dds_style_circles_categorically); mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(@NonNull final MapboxMap mapboxMap) { mapboxMap.setStyle(Style.LIGHT, new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { style.addSource(new VectorSource( "ethnicity-source", "<LINK_0>" + Mapbox.getAccessToken() )); CircleLayer circleLayer = new CircleLayer("population", "ethnicity-source"); circleLayer.setSourceLayer("sf2010"); circleLayer.withProperties( circleRadius( interpolate( exponential(1.75f), zoom(), stop(12, 2f), stop(22, 180f) )), circleColor( match(get("ethnicity"), rgb(0, 0, 0), stop("white", rgb(251, 176, 59)), stop("Black", rgb(34, 59, 83)), stop("Hispanic", rgb(229, 94, 94)), stop("Asian", rgb(59, 178, 208)), stop("Other", rgb(204, 204, 204))))); style.addLayer(circleLayer); } }); } }); }
Source:
<code>public Builder implName(String implName) { <START> this.implName = "default".equals( implName ) ? "*Impl" : implName; <END> this.customName = !"*Impl".equals( this.implName ); return this; }</code><technical_language>extract constants for "*" (or end for instead)? easier change :)</technical_language>

Target:
public Builder implName(String implName) { this.implName = implName; this.customName = !DEFAULT_IMPLEMENTATION_CLASS.equals( this.implName ); return this; }
Source:
<code>public int getDeadNodeCount() { return getNodeCount( <START> new NodeStatus(NodeOperationalState.IN_SERVICE, NodeState.DEAD)); <END> }</code><technical_language>Interesting; a node in maintenance mode, switched off? dead? a dead node? I I agree conclusion is a dead node, flagging for others consider</technical_language>

Target:
public int getDeadNodeCount() { return getDeadNodes().size(); }
Source:
<code>public void unregisterConsumer(EventConsumer consumer) { if (consumer == null) { throw new InvalidParameterException("Consumer must not be null"); } regMgmtLock.lock(); try { log.debug("unregisterConsumer " + consumer.getClass().getCanonicalName()); <START> for (Entry<String, RegisteredPublisher> entry : nameToPublisher.entrySet()) { <END> entry.getValue().removeComsumer(consumer); } for (RegisteredConsumer regCon : this.danglingConsumers) { if (regCon.getConsumer().equals(consumer)) { this.danglingConsumers.remove(regCon); break; } } } finally { regMgmtLock.unlock(); } }</code><technical_language>Check isDebugEnabled()</technical_language>

Target:
public void unregisterConsumer(EventConsumer consumer) { if (consumer == null) { throw new InvalidParameterException("Consumer must not be null"); } regMgmtLock.lock(); try { log.debug("unregisterConsumer " + consumer.getClass().getCanonicalName()); for (Entry<String, RegisteredPublisher> entry : nameToPublisher.entrySet()) { entry.getValue().removeComsumer(consumer); } removeDanglingConsumer(consumer); } finally { regMgmtLock.unlock(); } }