auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void doStart() { Configuration auth = config.getJAASConfiguration(); try { super.doStart(); if (getEndpoint().getConfig().isConnectOnStartup()) { ostream = setupHdfs(true); } SplitStrategy idleStrategy = null; for (SplitStrategy strategy : config.getSplitStrategies()) { if (strategy.type == SplitStrategyType.IDLE) { idleStrategy = strategy; break; } } if (idleStrategy != null) { scheduler = getEndpoint().getCamelContext().getExecutorServiceManager().newSingleThreadScheduledExecutor(this, "HdfsIdleCheck"); log.debug("Creating IdleCheck task scheduled to run every millis", config.getCheckIdleInterval()); scheduler.scheduleAtFixedRate(new IdleCheck(idleStrategy), config.getCheckIdleInterval(), config.getCheckIdleInterval(), TimeUnit.MILLISECONDS); } } catch (Exception e) { LOG.warn("Failed to start the HDFS producer. Caused by: [{}]", e.getMessage()); <START> LOG.trace("", e); <END> throw new RuntimeException(e); } finally { config.setJAASConfiguration(auth); } }</code><technical_language>logging trace level</technical_language>

Target:
protected void doStart() { Configuration auth = HdfsComponent.getJAASConfiguration(); try { super.doStart(); if (getEndpoint().getConfig().isConnectOnStartup()) { ostream = setupHdfs(true); } SplitStrategy idleStrategy = null; for (SplitStrategy strategy : config.getSplitStrategies()) { if (strategy.type == SplitStrategyType.IDLE) { idleStrategy = strategy; break; } } if (idleStrategy != null) { scheduler = getEndpoint().getCamelContext().getExecutorServiceManager().newSingleThreadScheduledExecutor(this, "HdfsIdleCheck"); log.debug("Creating IdleCheck task scheduled to run every millis", config.getCheckIdleInterval()); scheduler.scheduleAtFixedRate(new IdleCheck(idleStrategy), config.getCheckIdleInterval(), config.getCheckIdleInterval(), TimeUnit.MILLISECONDS); } } catch (Exception e) { LOG.warn("Failed to start the HDFS producer. Caused by: [{}]", e.getMessage()); LOG.debug("", e); throw new RuntimeException(e); } finally { HdfsComponent.setJAASConfiguration(auth); } }
Source:
<code>private void checkParameters() { boolean explain = isQuery && sql.startsWith("EXPLAIN"); for (ParameterInterface p : parameters) { <START> if (explain) <END> p.setValue(ValueNull.INSTANCE, false); p.checkSet(); } }</code><technical_language>check flag loop</technical_language>

Target:
private void checkParameters() { if (cmdType != EXPLAIN) { for (ParameterInterface p : parameters) { p.checkSet(); } } }
Source:
<code>public void logoutFunctionTest() { selectAll(); type("dummy").push(KeyCode.TAB); type("dummy").push(KeyCode.TAB); type("test").push(KeyCode.TAB); type("test"); clickOn("Sign in"); sleep(2000); <START> <END> clickOn("File"); clickOn("Logout"); File testConfig = new File(configFileDirectory, testConfigFileName); if (!(testConfig.exists() && testConfig.isFile())) { fail("File not found: " + testConfig.getAbsolutePath()); } Preferences testPref = TestController.loadTestPreferences(); assertEquals("", testPref.getLastLoginUsername()); assertEquals("", testPref.getLastLoginPassword()); }</code><technical_language>Trailing whitespace. set eclipse's save action remove trailing white spaces able detect of manually</technical_language>

Target:
public void logoutFunctionTest() { selectAll(); type("dummy").push(KeyCode.TAB); type("dummy").push(KeyCode.TAB); type("test").push(KeyCode.TAB); type("test"); clickOn("Sign in"); sleep(EVENT_DELAY); clickOn("File"); clickOn("Logout"); File testConfig = new File(configFileDirectory, testConfigFileName); if (!(testConfig.exists() && testConfig.isFile())) { fail("File not found: " + testConfig.getAbsolutePath()); } Preferences testPref = TestController.loadTestPreferences(); assertEquals("", testPref.getLastLoginUsername()); assertEquals("", testPref.getLastLoginPassword()); }
Source:
<code>public void processConcurEventNotifications() { Collection<ConcurEventNotification> concurEventNotifications = concurEventNotificationService.retrieveConcurEventNotificationsForProcessing(); <START> if (concurEventNotifications != null && CollectionUtils.isNotEmpty(concurEventNotifications)) { <END> for (ConcurEventNotification concurEventNotification : concurEventNotifications) { ExpenseDetailedReportDTO expenseDetailedReport = retrieveExpenseDetailedReportFromConcur(concurEventNotification); ConcurAccountInfo concurAccountInfo = extractAccountInfo(expenseDetailedReport); concurAccountValidationService.validateConcurAccountInfo(concurAccountInfo); updateExpenseReportStatusInConcur(); } } }</code><technical_language>body of for loop executed if collection is empty, eliminate CollectionUtils.isNotEmpty check. Also, ObjectUtils.isNotNull for null check</technical_language>

Target:
public void processConcurEventNotifications() { Collection<ConcurEventNotification> concurEventNotifications = concurEventNotificationService.retrieveConcurEventNotificationsForProcessing(); if (ObjectUtils.isNotNull(concurEventNotifications)) { for (ConcurEventNotification concurEventNotification : concurEventNotifications) { ExpenseDetailedReportDTO expenseDetailedReport = retrieveExpenseDetailedReportFromConcur(concurEventNotification); ConcurAccountInfo concurAccountInfo = extractAccountInfo(expenseDetailedReport); concurAccountValidationService.validateConcurAccountInfo(concurAccountInfo); updateExpenseReportStatusInConcur(); } } }
Source:
<code>private HttpRedirect(String url, int code, String keepUri, String fqdn, String zone) { this.url = checkNotNull(url, "url"); checkArgument(code == 301 || code == 302, "code of %s must be 301 or 302", code); <START> checkArgument("Y".equals(keepUri) || "N".equals(keepUri), "code of %s must be 'Y' or 'N'", keepUri); <END> this.code = code; this.keepUri = keepUri; this.fqdn = checkNotNull(fqdn, "fqdn");; this.zone = checkNotNull(zone, "zone"); this.delegate = ImmutableMap.<String, Object> builder() .put("url", url) .put("code", code) .put("keep_uri", keepUri) .put("fqdn", fqdn) .put("zone", zone).build(); }</code><technical_language>uppercase, too? happy lowercase input</technical_language>

Target:
private HttpRedirect(String url, int code, String keepUri, String fqdn, String zone) { this.url = checkNotNull(url, "url"); checkArgument(code == 301 || code == 302, "code must be 301 or 302 but was %s", code); this.code = code; checkNotNull(keepUri, "keepUri"); checkArgument("Y".equalsIgnoreCase(keepUri) || "N".equalsIgnoreCase(keepUri), "keepUri must be 'Y' or 'N' but was %s", keepUri); this.keepUri = keepUri.toUpperCase(); this.fqdn = checkNotNull(fqdn, "fqdn");; this.zone = checkNotNull(zone, "zone"); this.delegate = ImmutableMap.<String, Object> builder() .put("url", url) .put("code", code) .put("keep_uri", keepUri) .put("fqdn", fqdn) .put("zone", zone).build(); }
Source:
<code>private void doGrowVine(EntityRef root, VineNodeComponent nodeComponent, VineDefinitionComponent vineComponent) { if (nodeComponent.length != -1) { <START> if (nodeComponent.length < 20) { <END> recurseGrow(root, vineComponent); } resetDelay(root, vineComponent.minGrowTime, vineComponent.maxGrowTime); } }</code><technical_language>I noticed added a maxLength VineDefinitionComponent anywhere. This 20 is vine's length replacing maxLength implement it</technical_language>

Target:
private void doGrowVine(EntityRef root, VineNodeComponent nodeComponent, VineDefinitionComponent vineComponent) { if (nodeComponent.length != -1) { if (nodeComponent.length < vineComponent.maxLength) { recurseGrow(root, vineComponent); } resetDelay(root, vineComponent.minGrowTime, vineComponent.maxGrowTime); } }
Source:
<code>public String getThemeStyleSheet(ApplicationType type) { if (type == null) { <START> type = DEFAULT_APPLICATION_TYPE; <END> } return brandingProperties.getProperty(type.getCssKey()); }</code><technical_language>I this context parameter</technical_language>

Target:
public String getThemeStyleSheet(ApplicationType type) { return brandingProperties.getProperty(type.getCssKey()); }
Source:
<code>public boolean shouldContinue() { long spent = currentTimeSeconds() - startTime; boolean shouldContinue; if (spent >= totalRuntime) { for (Thread t : workers) { if (t.isAlive()) { try { t.interrupt(); t.join(); } catch (InterruptedException ignored) { } } } shouldContinue = false; } else { int total = workers.size(); int done = 0; for (Thread t : workers) { if (!t.isAlive()) done++; } <START> shouldContinue = !(done == total); <END> } if(!shouldContinue) { out.close(); } return shouldContinue; }</code><technical_language>shouldContinue = (done != total)</technical_language>

Target:
public boolean shouldContinue() { long spent = currentTimeSeconds() - _startTime; boolean shouldContinue; if (spent >= _totalRuntime) { for (Thread t : _workers) { if (t.isAlive()) { try { t.interrupt(); t.join(); } catch (InterruptedException ignored) { } } } shouldContinue = false; } else { int total = _workers.size(); int done = 0; for (Thread t : _workers) { if (!t.isAlive()) { done++; } } shouldContinue = (done != total); } if (!shouldContinue) { _out.close(); } return shouldContinue; }
Source:
<code>public void finalizeTerminationForInstancesWithoutInstanceIds(Long stackId) { try { <START> transactionService.required(() -> { <END> Stack stack = stackService.getByIdWithListsInTransaction(stackId); terminateInstancesWithoutInstanceIds(stack); return null; }); } catch (TransactionExecutionException ex) { LOGGER.info("Failed to terminate cluster infrastructure."); throw new TerminationFailedException(ex); } }</code><technical_language>I need transaction</technical_language>

Target:
public void finalizeTerminationForInstancesWithoutInstanceIds(Long stackId) { Stack stack = stackService.getByIdWithListsInTransaction(stackId); terminateInstancesWithoutInstanceIds(stack); }
Source:
<code>public void selectByQuery_on_empty_list_of_component_uuids() { ComponentQuery dbQuery = ComponentQuery.builder().setQualifiers(Qualifiers.PROJECT).setComponentUuids(emptySet()).build(); List<ComponentDto> result = underTest.selectByQuery(dbSession, dbQuery, 0, 10); int count = underTest.countByQuery(dbSession, dbQuery); <START> <END> assertThat(result).isEmpty(); assertThat(count).isEqualTo(0); }</code><technical_language>Please add project</technical_language>

Target:
public void selectByQuery_on_empty_list_of_component_uuids() { db.components().insertPrivateProject(); ComponentQuery dbQuery = ComponentQuery.builder().setQualifiers(Qualifiers.PROJECT).setComponentUuids(emptySet()).build(); List<ComponentDto> result = underTest.selectByQuery(dbSession, dbQuery, 0, 10); int count = underTest.countByQuery(dbSession, dbQuery); assertThat(result).isEmpty(); assertThat(count).isEqualTo(0); }
Source:
<code>public static File findTemplateDirectory(Class<?> type) { try { String classFolder = type.getName().replace(".", "/"); URL resource = type.getClassLoader().getResource(classFolder); if (resource != null) { return new File(resource.toURI()); } } catch (URISyntaxException ignored) <START> return null; <END> }</code><technical_language>Some issues mixed tabs spaces? Please configure IDE project for spaces only</technical_language>

Target:
private static File findTemplateDirectory(Class<?> type) { try { String classFolder = getPath(type); URL resource = type.getClassLoader().getResource(classFolder); if (resource != null) { return new File(resource.toURI()); } } catch (URISyntaxException ignored) { } return null; }
Source:
<code>public void testWriter() throws SQLException { DbState writer = DbState.writer(DbState.driverManager("jdbc:h2:mem:")); DB<Unit> setup = new DB<Unit>() { @Override public Unit run(Connection c) throws SQLException { Statement s = c.createStatement(); assertThat(s.executeUpdate("CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255))"), is(0)); assertThat(s.executeUpdate("INSERT INTO TEST (ID, NAME) VALUES (10, 'FOO')"), is (1)); return Unit.unit(); } }; DB<Option<Integer>> query = new DB<Option<Integer>>() { @Override public Option<Integer> run(Connection c) throws SQLException { PreparedStatement ps = c.prepareStatement("SELECT ID FROM TEST WHERE NAME = ?"); ps.setString(1, "FOO"); ResultSet rs = ps.executeQuery(); if (rs.next()) { return Option.some(rs.getInt("ID")); } else { return Option.none(); } } }; <START> assertThat(writer.run(setup.bind(v -> query)).some(), is(10)); <END> }</code><technical_language>create a constant for 10 creating insert string</technical_language>

Target:
public void testWriter() throws SQLException { final int TEN = 10; DbState writer = DbState.writer(DbState.driverManager("jdbc:h2:mem:")); DB<Unit> setup = new DB<Unit>() { @Override public Unit run(Connection c) throws SQLException { Statement s = null; try { s = c.createStatement(); assertThat(s.executeUpdate("CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255))"), is(0)); assertThat(s.executeUpdate("INSERT INTO TEST (ID, NAME) VALUES (" + TEN + ", 'FOO')"), is(1)); } finally { DbUtils.closeQuietly(s); } return Unit.unit(); } }; DB<Option<Integer>> query = new DB<Option<Integer>>() { @Override public Option<Integer> run(Connection c) throws SQLException { PreparedStatement ps = null; ResultSet rs = null; try { ps = c.prepareStatement("SELECT ID FROM TEST WHERE NAME = ?"); ps.setString(1, "FOO"); rs = ps.executeQuery(); if (rs.next()) { return Option.some(rs.getInt("ID")); } else { return Option.none(); } } finally { DbUtils.closeQuietly(rs); DbUtils.closeQuietly(ps); } } }; assertThat(writer.run(setup.bind(v -> query)).some(), is(TEN)); }
Source:
<code>private PutChunk getChunkToFill() { if (latestFillerChunk != null && latestFillerChunk.isBuilding()) { return latestFillerChunk; } else { for (PutChunk chunk : putChunks) { if (chunk.isFree()) { chunkCounter++; chunk.prepareForBuilding(chunkCounter, getSizeOfChunkAt(chunkCounter)); latestFillerChunk = chunk; <START> return chunk; <END> } } } return null; }</code><technical_language>avoid multiple return paths especially nested loops</technical_language>

Target:
private PutChunk getChunkToFill() { if (chunkToFill != null && chunkToFill.isBuilding()) { return chunkToFill; } chunkToFill = null; for (PutChunk chunk : putChunks) { if (chunk.isFree()) { chunkCounter++; chunk.prepareForBuilding(chunkCounter, getSizeOfChunkAt(chunkCounter)); chunkToFill = chunk; break; } } return chunkToFill; }
Source:
<code>public void start() { List<Encounter> mVisitNoteEncounters = new EncounterDAO().getAllEncountersByType(mPatient.getId(), new EncounterType(EncounterType.VISIT_NOTE)); <START> mPatientDiagnosisView.setDiagnosesToDisplay(getAllDiagnosis(mVisitNoteEncounters)); <END> }</code><technical_language>@tmarzeion I extract this separate method e.g. loadDiagnosis() call start(). loadDiagnosis method reused</technical_language>

Target:
public void start() { loadDiagnosis(); }
Source:
<code>public List<OAIRecord> findOaiRecordsBySetName(String setName, Date from, Date until, boolean excludeSet) { <START> String queryString ="SELECT object(h) from OAIRecord as h where h.id is not null"; <END> if (setName != null) { if (excludeSet) { queryString += " and h.setName is not null and h.setName != '' and h.setName != :setName"; } else { queryString += " and h.setName = :setName"; } } else { queryString += " and h.setName is null"; } queryString += from != null ? " and h.lastUpdateTime >= :from" : ""; queryString += until != null ? " and h.lastUpdateTime<=:until" : ""; queryString += " order by h.globalId"; logger.fine("Query: "+queryString); Query query = em.createQuery(queryString); if (setName != null) { query.setParameter("setName",setName); } if (from != null) { query.setParameter("from",from,TemporalType.TIMESTAMP); } if (until != null) { if (until.getTime() % (24 * 3600 * 1000) == 0) { logger.fine("plain date. incrementing by one day"); until.setTime(until.getTime()+(24 * 3600 * 1000)); } else { logger.fine("date and time. incrementing by one second"); until.setTime(until.getTime()+1000); } query.setParameter("until",until,TemporalType.TIMESTAMP); } try { return query.getResultList(); } catch (Exception ex) { logger.fine("Caught exception; returning null."); return null; } }</code><technical_language>Line 307, h is inconsistent line 291 is removed</technical_language>

Target:
public List<OAIRecord> findOaiRecordsBySetName(String setName, Date from, Date until, boolean excludeSet) { String queryString ="SELECT object(h) from OAIRecord h where h.id is not null"; if (setName != null) { if (excludeSet) { queryString += " and h.setName is not null and h.setName != '' and h.setName != :setName"; } else { queryString += " and h.setName = :setName"; } } else { queryString += " and h.setName is null"; } queryString += from != null ? " and h.lastUpdateTime >= :from" : ""; queryString += until != null ? " and h.lastUpdateTime<=:until" : ""; queryString += " order by h.globalId"; logger.fine("Query: "+queryString); Query query = em.createQuery(queryString); if (setName != null) { query.setParameter("setName",setName); } if (from != null) { query.setParameter("from",from,TemporalType.TIMESTAMP); } if (until != null) { if (until.getTime() % (24 * 3600 * 1000) == 0) { logger.fine("plain date. incrementing by one day"); until.setTime(until.getTime()+(24 * 3600 * 1000)); } else { logger.fine("date and time. incrementing by one second"); until.setTime(until.getTime()+1000); } query.setParameter("until",until,TemporalType.TIMESTAMP); } try { return query.getResultList(); } catch (Exception ex) { logger.fine("Caught exception; returning null."); return null; } }
Source:
<code>protected boolean checkIfLunDiskCanBeAdded(DiskValidator diskValidator) { LunDisk lunDisk = ((LunDisk) getParameters().getDiskInfo()); LUNs lun = lunDisk.getLun(); switch (lun.getLunType()) { case UNKNOWN: return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE); case ISCSI: if (lun.getLunConnections() == null || lun.getLunConnections().isEmpty()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_ISCSI_MISSING_CONNECTION_PARAMS); } for (StorageServerConnections conn : lun.getLunConnections()) { if (StringUtils.isEmpty(conn.getiqn()) || StringUtils.isEmpty(conn.getconnection()) || StringUtils.isEmpty(conn.getport())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_ISCSI_MISSING_CONNECTION_PARAMS); } } break; } if (getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_IS_ALREADY_IN_USE); } if (getVm() != null && !(isVmNotLocked() && isVmNotInPreviewSnapshot())) { return false; } if (!validate(diskValidator.isVirtIoScsiValid(getVm()))) { return false; } if (!validate(diskValidator.isDiskInterfaceSupported(getVm()))) { return false; } if (getVds() != null && !validate(diskValidator.isLunDiskVisible(lun, getVds()))) { return false; } ValidationResult validationResult = diskValidator.isUsingScsiReservationValid(getVm(), lunDisk); if (!validate(validationResult)) { <START> return false; <END> } return true; }</code><technical_language>please change validate(diskValidator.isUsingScsiReservationValid(getVm(), lunDi sk)) align rest of method, need for variable</technical_language>

Target:
protected boolean checkIfLunDiskCanBeAdded(DiskValidator diskValidator) { LunDisk lunDisk = ((LunDisk) getParameters().getDiskInfo()); LUNs lun = lunDisk.getLun(); switch (lun.getLunType()) { case UNKNOWN: return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE); case ISCSI: if (lun.getLunConnections() == null || lun.getLunConnections().isEmpty()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_ISCSI_MISSING_CONNECTION_PARAMS); } for (StorageServerConnections conn : lun.getLunConnections()) { if (StringUtils.isEmpty(conn.getiqn()) || StringUtils.isEmpty(conn.getconnection()) || StringUtils.isEmpty(conn.getport())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_ISCSI_MISSING_CONNECTION_PARAMS); } } break; } if (getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_IS_ALREADY_IN_USE); } if (getVm() != null && !(isVmNotLocked() && isVmNotInPreviewSnapshot())) { return false; } if (!validate(diskValidator.isVirtIoScsiValid(getVm()))) { return false; } if (!validate(diskValidator.isDiskInterfaceSupported(getVm()))) { return false; } if (getVds() != null && !validate(diskValidator.isLunDiskVisible(lun, getVds()))) { return false; } if (!validate(diskValidator.isUsingScsiReservationValid(getVm(), lunDisk))) { return false; } return true; }
Source:
<code>protected boolean canMigrateVm(VM vm) { if (vm == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND); } <START> else { <END> if (vm.getMigrationSupport() == MigrationSupport.PINNED_TO_HOST) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_PINNED_TO_HOST); } if (vm.getMigrationSupport() == MigrationSupport.IMPLICITLY_NON_MIGRATABLE && !forcedMigrationForNonMigratableVM) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NON_MIGRTABLE_AND_IS_NOT_FORCED_BY_USER_TO_MIGRATE); } if (vm.getStatus() == VMStatus.MigratingFrom) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS); } if (vm.getStatus() == VMStatus.NotResponding) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL); } if (vm.getStatus() == VMStatus.Paused) { return failCanDoAction(VdcBllMessages.MIGRATE_PAUSED_VM_IS_UNSUPPORTED); } if (!vm.isQualifyToMigrate()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_RUNNING); } if (getDestinationVds() != null && getDestinationVds().getStatus() != VDSStatus.Up) { addCanDoActionMessage(VdcBllMessages.VAR__HOST_STATUS__UP); return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL); } return validate(new DiskImagesValidator(ImagesHandler.getPluggedImagesForVm(vm.getId())).diskImagesNotLocked()) && validate(new SnapshotsValidator().vmNotDuringSnapshot(vm.getId())) && getVdsSelector().canFindVdsToRunOn(getReturnValue().getCanDoActionMessages(), true); } }</code><technical_language>else is needed if return</technical_language>

Target:
protected boolean canMigrateVm(VM vm) { if (vm == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND); } if (vm.getMigrationSupport() == MigrationSupport.PINNED_TO_HOST) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_PINNED_TO_HOST); } if (vm.getMigrationSupport() == MigrationSupport.IMPLICITLY_NON_MIGRATABLE && !forcedMigrationForNonMigratableVM) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NON_MIGRTABLE_AND_IS_NOT_FORCED_BY_USER_TO_MIGRATE); } if (vm.getStatus() == VMStatus.MigratingFrom) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS); } if (vm.getStatus() == VMStatus.NotResponding) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL); } if (vm.getStatus() == VMStatus.Paused) { return failCanDoAction(VdcBllMessages.MIGRATE_PAUSED_VM_IS_UNSUPPORTED); } if (!vm.isQualifyToMigrate()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_RUNNING); } if (getDestinationVds() != null && getDestinationVds().getStatus() != VDSStatus.Up) { addCanDoActionMessage(VdcBllMessages.VAR__HOST_STATUS__UP); return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL); } return validate(new DiskImagesValidator(ImagesHandler.getPluggedImagesForVm(vm.getId())).diskImagesNotLocked()) && validate(new SnapshotsValidator().vmNotDuringSnapshot(vm.getId())) && getVdsSelector().canFindVdsToRunOn(getReturnValue().getCanDoActionMessages(), true); }
Source:
<code>protected ScheduledExecutorService startKerberosLoginThread() { scheduledExecutorService = Executors.newScheduledThreadPool(1); scheduledExecutorService.schedule(new Callable() { public Object call() throws Exception { if (runKerberosLogin()) { scheduledExecutorService .schedule(this, getTimeAsMs(getKerberosRefreshInterval()), TimeUnit.MILLISECONDS); } else { kinitFailCount++; <START> logger.info("runKerberosLogin failed for " + kinitFailCount + "time"); <END> if (kinitFailCount >= kinitFailThreshold()) { logger.error("runKerberosLogin failed for max attempts, calling close interpreter."); close(); } else { scheduledExecutorService.submit(this); } } return null; } }, getTimeAsMs(getKerberosRefreshInterval()), TimeUnit.MILLISECONDS); return scheduledExecutorService; }</code><technical_language>nit: space "time"</technical_language>

Target:
protected ScheduledExecutorService startKerberosLoginThread() { scheduledExecutorService = Executors.newScheduledThreadPool(1); scheduledExecutorService.schedule(new Callable() { public Object call() throws Exception { if (runKerberosLogin()) { logger.info("Ran runKerberosLogin command successfully."); kinitFailCount = 0; scheduledExecutorService .schedule(this, getTimeAsMs(getKerberosRefreshInterval()), TimeUnit.MILLISECONDS); } else { kinitFailCount++; logger.info("runKerberosLogin failed for " + kinitFailCount + " time(s)."); if (kinitFailCount >= kinitFailThreshold()) { logger.error("runKerberosLogin failed for max attempts, calling close interpreter."); close(); } else { scheduledExecutorService.submit(this); } } return null; } }, getTimeAsMs(getKerberosRefreshInterval()), TimeUnit.MILLISECONDS); return scheduledExecutorService; }
Source:
<code>protected void onBind() { super.onBind(); <START> logger.info("onBind"); END> getModel().retrieveEngineErrata(); getModel().addErrorMessageChangeListener(new IEventListener<PropertyChangedEventArgs>(){ @Override public void eventRaised(Event<? extends PropertyChangedEventArgs> ev, Object sender, PropertyChangedEventArgs args) { logger.info(this.getClass().toString() + " eventRaised"); if (getModel().getMessage() != null && !getModel().getMessage().isEmpty()) { logger.info("bus published message that there was a query error. update view."); getView().showErrorMessage(SafeHtmlUtils.fromString(getModel().getMessage())); } else if (getModel().getMessage() == null || getModel().getMessage().isEmpty()) { logger.info("bus published message that there was not a query error. clearMessage() / show table."); getView().clearErrorMessage(); } } }); }</code><technical_language>debug/trace/remove</technical_language>

Target:
protected void onBind() { super.onBind(); getModel().retrieveEngineErrata(); getModel().addErrorMessageChangeListener(new IEventListener<PropertyChangedEventArgs>(){ @Override public void eventRaised(Event<? extends PropertyChangedEventArgs> ev, Object sender, PropertyChangedEventArgs args) { if (getModel().getMessage() != null && !getModel().getMessage().isEmpty()) { getView().showErrorMessage(SafeHtmlUtils.fromString(getModel().getMessage())); } else if (getModel().getMessage() == null || getModel().getMessage().isEmpty()) { getView().clearErrorMessage(); } } }); }
Source:
<code>private void setSpiceImplementation() { consoleMode = ClientConsoleMode.valueOf((String) AsyncDataProvider.GetConfigValuePreConverted(ConfigurationValues.ClientConsoleModeDefault)); switch (consoleMode) { case Native: setspice((ISpice) TypeResolver.getInstance().Resolve(ISpiceNative.class)); break; case Plugin: setspice((ISpice) TypeResolver.getInstance().Resolve(ISpicePlugin.class)); break; default: ISpicePlugin pluginSpice = (ISpicePlugin) TypeResolver.getInstance().Resolve(ISpicePlugin.class); if (pluginSpice.detectBrowserPlugin()) { setspice(pluginSpice); } else { setspice((ISpice) TypeResolver.getInstance().Resolve(ISpiceNative.class)); <START> } <END> break; } }</code><technical_language>suggestion - replace ternary-if: setspice(pluginSpice.detectBrowserPlugin() ? ...) , shorter more readable</technical_language>

Target:
private void setSpiceImplementation() { consoleMode = ClientConsoleMode.valueOf((String) AsyncDataProvider.GetConfigValuePreConverted(ConfigurationValues.ClientConsoleModeDefault)); switch (consoleMode) { case Native: setspice((ISpice) TypeResolver.getInstance().Resolve(ISpiceNative.class)); break; case Plugin: setspice((ISpice) TypeResolver.getInstance().Resolve(ISpicePlugin.class)); break; default: ISpicePlugin pluginSpice = (ISpicePlugin) TypeResolver.getInstance().Resolve(ISpicePlugin.class); setspice(pluginSpice.detectBrowserPlugin() ? pluginSpice : (ISpice) TypeResolver.getInstance().Resolve(ISpiceNative.class)); break; } }
Source:
<code>private void restoreSavedInstanceState(Bundle savedInstanceState) { boolean isInSearchMode = false; String lastSearch = ""; if (savedInstanceState != null) { mCurrentLocalId = savedInstanceState.getInt(KEY_LOCAL_ID); isInSearchMode = savedInstanceState.getBoolean(KEY_IS_IN_SEARCH_MODE); lastSearch = savedInstanceState.getString(KEY_LAST_SEARCH); mSitePickerMode = (SitePickerMode) savedInstanceState.getSerializable(KEY_SITE_PICKER_MODE); <START> mHashSelectedPositions = (HashSet<Integer>) savedInstanceState.getSerializable(KEY_SELECTED_POSITIONS); <END> mIsInEditMode = savedInstanceState.getBoolean(KEY_IS_IN_EDIT_MODE); mShowMenuEnabled = savedInstanceState.getBoolean(KEY_IS_SHOW_MENU_ENABLED); mHideMenuEnabled = savedInstanceState.getBoolean(KEY_IS_HIDE_MENU_ENABLED); } else if (getIntent() != null) { mCurrentLocalId = getIntent().getIntExtra(KEY_LOCAL_ID, 0); mSitePickerMode = (SitePickerMode) getIntent().getSerializableExtra(KEY_SITE_PICKER_MODE); } setNewAdapter(lastSearch, isInSearchMode); }</code><technical_language>a note here. unchecked cast java.io.Serializable java.util.HashSet<java.lang.Integer> lead aClassCastException if runtime type found. In situations, a Parcelable is avoid this I for this solution this as-is</technical_language>

Target:
private void restoreSavedInstanceState(Bundle savedInstanceState) { boolean isInSearchMode = false; String lastSearch = ""; if (savedInstanceState != null) { mCurrentLocalId = savedInstanceState.getInt(KEY_LOCAL_ID); isInSearchMode = savedInstanceState.getBoolean(KEY_IS_IN_SEARCH_MODE); lastSearch = savedInstanceState.getString(KEY_LAST_SEARCH); mSitePickerMode = (SitePickerMode) savedInstanceState.getSerializable(KEY_SITE_PICKER_MODE); mSelectedPositions = (HashSet<Integer>) savedInstanceState.getSerializable(KEY_SELECTED_POSITIONS); mIsInEditMode = savedInstanceState.getBoolean(KEY_IS_IN_EDIT_MODE); mShowMenuEnabled = savedInstanceState.getBoolean(KEY_IS_SHOW_MENU_ENABLED); mHideMenuEnabled = savedInstanceState.getBoolean(KEY_IS_HIDE_MENU_ENABLED); } else if (getIntent() != null) { mCurrentLocalId = getIntent().getIntExtra(KEY_LOCAL_ID, 0); mSitePickerMode = (SitePickerMode) getIntent().getSerializableExtra(KEY_SITE_PICKER_MODE); } setNewAdapter(lastSearch, isInSearchMode); }
Source:
<code>public void exportJobXML(String jobId) { String jobXmlUrl = GWT.getModuleBaseURL() + "downloadjobxml?jobId=" + jobId + "&sessionId=" + LoginModel.getInstance().getSessionId(); XMLHttpRequest req = XMLHttpRequest.create(); req.open("HEAD", jobXmlUrl); req.setOnReadyStateChange(xhr -> { if (xhr.getReadyState() == XMLHttpRequest.DONE) { if (xhr.getStatus() == Response.SC_OK) { LogModel.getInstance().logMessage("Downloading XML for job: " + jobId); Window.open(jobXmlUrl, "Download Job XML", ""); } else { String error = xhr.getResponseHeader(HEADER_PA_ERROR); <START> if (xhr.getResponseHeader(HEADER_PA_ERROR) != null) { <END> SC.warn("Could not export job's XML:\n" + error); } else { LogModel.getInstance() .logMessage("Could not download Job XML. Got HTTP response code: " + xhr.getStatus()); } } } }); req.send(); }</code><technical_language>suggestion if (error != null) {</technical_language>

Target:
public void exportJobXML(String jobId) { String jobXmlUrl = GWT.getModuleBaseURL() + "downloadjobxml?jobId=" + jobId + "&sessionId=" + LoginModel.getInstance().getSessionId(); XMLHttpRequest req = XMLHttpRequest.create(); req.open("HEAD", jobXmlUrl); req.setOnReadyStateChange(xhr -> { if (xhr.getReadyState() == XMLHttpRequest.DONE) { if (xhr.getStatus() == Response.SC_OK) { LogModel.getInstance().logMessage("Downloading XML for job: " + jobId); Window.open(jobXmlUrl, "Download Job XML", ""); } else { String error = xhr.getResponseHeader(HEADER_PA_ERROR); if (error != null) { SC.warn("Could not export job's XML:\n" + error); } else { LogModel.getInstance() .logMessage("Could not download Job XML. Got HTTP response code: " + xhr.getStatus()); } } } }); req.send(); }
Source:
<code>public boolean incompleteTransactionsContain(String gtid, long seqNo) { Long s = incompleteTransactions.get(gtid); <START> if (s != null) { <END> return s >= seqNo; } return false; }</code><technical_language>simplified return s != null && s >= seqNo;</technical_language>

Target:
public boolean incompleteTransactionsContain(String gtid, long seqNo) { Long s = incompleteTransactions.get(gtid); return s != null && s >= seqNo; }
Source:
<code>public void registerIntent(Plugin plugin) { Preconditions.checkState( !fired.get(), "Event %s has already been fired", this ); if ( !intents.containsKey( plugin ) ) { intents.put( plugin, new AtomicInteger( 1 ) ); latch.incrementAndGet(); <START> } else if ( intents.get( plugin ).getAndIncrement() == 0 ) <END> { latch.incrementAndGet(); } }</code><technical_language>more sense for latch incremented decremented, reaches zero event is fired</technical_language>

Target:
public void registerIntent(Plugin plugin) { Preconditions.checkState( !fired.get(), "Event %s has already been fired", this ); AtomicInteger intentCount = intents.get( plugin ); if ( intentCount == null ) { intents.put( plugin, new AtomicInteger( 1 ) ); } else { intentCount.incrementAndGet(); } latch.incrementAndGet(); }
Source:
<code>private void doCheck(File[] replicas, ArrayList<String> replicasList, ConcurrentHashMap<String, BlobStatus> blobIdToStatusMap, AtomicLong totalKeysProcessed) throws IOException, InterruptedException { DumpData dumpData = new DumpData(outFile, fileWriter, map); CountDownLatch countDownLatch = new CountDownLatch(replicas.length); AtomicLong totalPutRecords = new AtomicLong(0); AtomicLong totalDeleteRecords = new AtomicLong(0); AtomicLong totalDuplicatePutRecords = new AtomicLong(0); AtomicLong totalDeleteBeforePutRecords = new AtomicLong(0); AtomicLong totalPutAfterDeleteRecords = new AtomicLong(0); <START> AtomicLong totalDuplicateDeleteRecords = new AtomicLong(0); <END> for (File replica : replicas) { Thread thread = new Thread( new ReplicaProcessorForBlobs(replica, replicasList, blobIdToStatusMap, totalKeysProcessed, dumpData, countDownLatch, totalPutRecords, totalDeleteRecords, totalDuplicatePutRecords, totalDeleteBeforePutRecords, totalPutAfterDeleteRecords, totalDuplicateDeleteRecords)); thread.start(); thread.join(); } countDownLatch.await(); logOutput("Total Keys Processed " + totalKeysProcessed.get()); logOutput("Total Put Records " + totalPutRecords.get()); logOutput("Total Delete Records " + totalDeleteRecords.get()); logOutput("Total Duplicate Put Records " + totalDuplicatePutRecords.get()); logOutput("Total Delete before Put Records " + totalDeleteBeforePutRecords.get()); logOutput("Total Put after Delete Records " + totalPutAfterDeleteRecords.get()); }</code><technical_language>want encapsulate of this object</technical_language>

Target:
private void doCheck(File[] replicas, ArrayList<String> replicasList, ConcurrentHashMap<String, BlobStatus> blobIdToStatusMap, AtomicLong totalKeysProcessed) throws IOException, InterruptedException { DumpData dumpData = new DumpData(outFile, fileWriter, map); CountDownLatch countDownLatch = new CountDownLatch(replicas.length); IndexStats indexStats = new IndexStats(); for (File replica : replicas) { Thread thread = new Thread( new ReplicaProcessorForBlobs(replica, replicasList, blobIdToStatusMap, totalKeysProcessed, dumpData, countDownLatch, indexStats)); thread.start(); thread.join(); } countDownLatch.await(); logOutput("Total Keys Processed " + totalKeysProcessed.get()); logOutput("Total Put Records " + indexStats.getTotalPutRecords().get()); logOutput("Total Delete Records " + indexStats.getTotalDeleteRecords().get()); logOutput("Total Duplicate Put Records " + indexStats.getTotalDuplicatePutRecords().get()); logOutput("Total Delete before Put Records " + indexStats.getTotalDeleteBeforePutRecords().get()); logOutput("Total Put after Delete Records " + indexStats.getTotalPutAfterDeleteRecords().get()); logOutput("Total Duplicate Delete Records " + indexStats.getTotalDuplicateDeleteRecords().get()); }
Source:
<code>public void start(Future<Void> startFuture) throws Exception { <START> super.start(startFuture); <END> try { PORT = Integer.parseInt(System.getenv("PORT")); } catch (Exception e) { logger.warn("Environment variable PORT not found or not valid. Defautling to: " + PORT); } HttpServer httpServer = getVertx().createHttpServer(); Router mainRouter = Router.router(getVertx()); mainRouter.route("/*") .handler(StaticHandler.create()); httpServer.requestHandler(mainRouter::accept); httpServer.listen(PORT, handler -> { if (handler.succeeded()) { logger.info("Listening on port: " + PORT); } else { logger.error("Failed to bind on port " + PORT + ". Is it being used?"); } }); }</code><technical_language>call parent impl</technical_language>

Target:
public void start(Future<Void> startFuture) throws Exception { try { PORT = Integer.parseInt(System.getenv("PORT")); } catch (Exception e) { logger.warn("Environment variable PORT not found or not valid. Defautling to: " + PORT); } HttpServer httpServer = getVertx().createHttpServer(); Router mainRouter = Router.router(getVertx()); mainRouter.route("/*") .handler(StaticHandler.create()); httpServer.requestHandler(mainRouter::accept); httpServer.listen(PORT, asyncResult -> { if (asyncResult.succeeded()) { logger.info("Listening on port: " + PORT); startFuture.complete(); } else { logger.error("Failed to bind on port " + PORT + ". Is it being used?"); startFuture.fail(asyncResult.cause()); } }); }
Source:
<code>private synchronized MessageIdTracker getTracker(final InetSocketAddress destination) { MessageIdTracker tracker = trackers.get(destination); if (tracker == null) { tracker = new MessageIdTracker(config); if (!trackers.put(destination, tracker)) { <START> return null; <END> } } return tracker; }</code><technical_language>synchronizing this call check capacity first, instead of instantiating MessageIdTracker throwing if map is full</technical_language>

Target:
private synchronized MessageIdTracker getTracker(final InetSocketAddress destination) { MessageIdTracker tracker = trackers.get(destination); if (tracker == null && 0 < trackers.remainingCapacity()) { tracker = new MessageIdTracker(config); trackers.put(destination, tracker); } return tracker; }
Source:
<code>public InterfaceParams(String name, int index, MacAddress macAddr, int defaultMtu) { <START> checkArgument((index <END> >= 0), "invalid interface index"); this.name = name; this.index = index; this.macAddr = (macAddr != null) ? macAddr : ALL_ZEROS_ADDRESS; this.defaultMtu = (defaultMtu > IPV6_MIN_MTU) ? defaultMtu : IPV6_MIN_MTU; }</code><technical_language>check name is null</technical_language>

Target:
public InterfaceParams(String name, int index, MacAddress macAddr, int defaultMtu) { checkArgument((!TextUtils.isEmpty(name)), "impossible interface name"); checkArgument((index > 0), "invalid interface index"); this.name = name; this.index = index; this.macAddr = (macAddr != null) ? macAddr : ALL_ZEROS_ADDRESS; this.defaultMtu = (defaultMtu > IPV6_MIN_MTU) ? defaultMtu : IPV6_MIN_MTU; }
Source:
<code>public void testCreateSchema() { analyze("CREATE SCHEMA test"); analyze("CREATE SCHEMA test WITH (p1 = 'p1')"); <START> assertFails(DUPLICATE_TABLE_PROPERTIES, "CREATE SCHEMA test WITH (p1 = 'p1', p2 = 'p2', p1 = 'p3')"); <END> assertFails(DUPLICATE_TABLE_PROPERTIES, "CREATE SCHEMA test WITH (p1 = 'p1', \"p1\" = 'p2')"); }</code><technical_language>verify error message</technical_language>

Target:
public void testCreateSchema() throws Exception { analyze("CREATE SCHEMA test"); analyze("CREATE SCHEMA test WITH (p1 = 'p1')"); assertFails(MISSING_ATTRIBUTE, ".*Column 'y' cannot be resolved", "CREATE SCHEMA test WITH (p1 = y)"); assertFails(DUPLICATE_PROPERTY, ".* Duplicate property: p1", "CREATE SCHEMA test WITH (p1 = 'p1', p2 = 'p2', p1 = 'p3')"); assertFails(DUPLICATE_PROPERTY, ".* Duplicate property: p1", "CREATE SCHEMA test WITH (p1 = 'p1', \"p1\" = 'p2')"); }
Source:
<code>public String getJobName() { if (this.jobName == null) { String jobName; if (this.isDeletingAllViews) { jobName = DELETE_ALL_VIEWS; } else if (this.getViewName() != null) { jobName = this.getViewName(); } else { jobName = this.tenantId; } <START> this.jobName = "ViewTTLTool-" + jobName + "-"; <END> } return this.jobName; }</code><technical_language>nit: "PhoenixTTLTool" more messages</technical_language>

Target:
public String getJobName() { if (this.jobName == null) { String jobName; if (this.isDeletingAllViews) { jobName = DELETE_ALL_VIEWS; } else if (this.getViewName() != null) { jobName = this.getViewName(); } else { jobName = this.tenantId; } this.jobName = "PhoenixTTLTool-" + jobName + "-"; } return this.jobName; }
Source:
<code>SymbolStatistics(String symbolName, SymbolStatsEstimate estimate) { <START> this.symbol = new Symbol(symbolName); <END> this.estimate = estimate; }</code><technical_language>this(new Symbol(symbolName), estimate)</technical_language>

Target:
SymbolStatistics(String symbolName, SymbolStatsEstimate estimate) { this(new Symbol(symbolName), estimate); }
Source:
<code>public static JobDetails createDetailsForJob(AccessExecutionGraph job) { JobStatus status = job.getState(); long started = job.getStatusTimestamp(JobStatus.INITIALIZING); long finished = status.isGloballyTerminalState() ? job.getStatusTimestamp(status) : -1L; long duration = (finished >= 0L ? finished : System.currentTimeMillis()) - started; int[] countsPerStatus = new int[ExecutionState.values().length]; long lastChanged = 0; int numTotalTasks = 0; for (AccessExecutionJobVertex ejv : job.getVerticesTopologically()) { <START> AccessExecutionVertex[] vertices = ejv.getTaskVertices(); <END> numTotalTasks += vertices.length; for (AccessExecutionVertex vertex : vertices) { ExecutionState state = vertex.getExecutionState(); countsPerStatus[state.ordinal()]++; lastChanged = Math.max(lastChanged, vertex.getStateTimestamp(state)); } } lastChanged = Math.max(lastChanged, finished); return new JobDetails( job.getJobID(), job.getJobName(), started, finished, duration, status, lastChanged, countsPerStatus, numTotalTasks); }</code><technical_language>suggestion AccessExecutionVertex[] taskVertices = ejv.getTaskVertices(); do this renaming improve readability dealing types of vertices in this code segment</technical_language>

Target:
public static JobDetails createDetailsForJob(AccessExecutionGraph job) { JobStatus status = job.getState(); long started = job.getStatusTimestamp(JobStatus.INITIALIZING); long finished = status.isGloballyTerminalState() ? job.getStatusTimestamp(status) : -1L; long duration = (finished >= 0L ? finished : System.currentTimeMillis()) - started; int[] countsPerStatus = new int[ExecutionState.values().length]; long lastChanged = 0; int numTotalTasks = 0; for (AccessExecutionJobVertex ejv : job.getVerticesTopologically()) { AccessExecutionVertex[] taskVertices = ejv.getTaskVertices(); numTotalTasks += taskVertices.length; for (AccessExecutionVertex taskVertex : taskVertices) { ExecutionState state = taskVertex.getExecutionState(); countsPerStatus[state.ordinal()]++; lastChanged = Math.max(lastChanged, taskVertex.getStateTimestamp(state)); } } lastChanged = Math.max(lastChanged, finished); return new JobDetails( job.getJobID(), job.getJobName(), started, finished, duration, status, lastChanged, countsPerStatus, numTotalTasks); }
Source:
<code>protected boolean addedValid(IConfigurationElement element) { try { String nsURI = element.getAttribute(ATT_NS_URI); int rank = Integer.parseInt(element.getAttribute(ATT_RANKING)); WeightProvider.Descriptor descriptor = new WeightProviderDescriptorImpl((WeightProvider)element <START> .createExecutableExtension(ATT_CLASS), rank, Pattern.compile(nsURI)); <END> WeightProvider.Descriptor previous = weightProviderRegistry.put(nsURI, descriptor); if (previous != null) { log(IStatus.WARNING, element, EMFCompareRCPMessages.getString( "duplicate.extension", weightProviderRegistry.getClass().getName())); } } catch (CoreException e) { log(IStatus.ERROR, element, e.getMessage()); return false; } return true; }</code><technical_language>do create extension, do lazily defer instanciation Registy.get*()</technical_language>

Target:
protected boolean addedValid(IConfigurationElement element) { String className = element.getAttribute(ATT_CLASS); String nsURI = element.getAttribute(ATT_NS_URI); int rank = Integer.parseInt(element.getAttribute(ATT_RANKING)); WeightProvider.Descriptor descriptor = new WeightProviderDescriptorRCPImpl(element, rank, Pattern .compile(nsURI)); WeightProvider.Descriptor previous = weightProviderRegistry.put(className, descriptor); if (previous != null) { log(IStatus.WARNING, element, EMFCompareRCPMessages.getString( "duplicate.extension", weightProviderRegistry.getClass().getName())); } return true; }
Source:
<code>public void afterPropertiesSet() { <START> this.evaluationContext = IntegrationContextUtils.getEvaluationContext(beanFactory); <END> }</code><technical_language>changed ExpressionUtils.createStandardEvaluationContext(beanFactory) - creates StandardEvaluationContext if is in ctx</technical_language>

Target:
public void afterPropertiesSet() { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(beanFactory); }
Source:
<code>public ClientConfiguration setAddresses(String... addrs) { <START> if (addrs != null) { <END> this.addrs = Arrays.copyOf(addrs, addrs.length); addrFinder = () -> this.addrs; } return this; }</code><technical_language>revert move logic ReliableChannel</technical_language>

Target:
public ClientConfiguration setAddresses(String... addrs) { if (addrs != null) this.addrs = Arrays.copyOf(addrs, addrs.length); return this; }
Source:
<code>public SpecificFunctionReference getFunctionType() { <START> return (SpecificFunctionReference)type; <END> }</code><technical_language>Instead of casting letting function throw error (which users catch), prefacing cast returning null error? Requiring users call isFunctionType() isClassType() calling proper getXXXType() method is programmer-friendly; a recipe for hard-to-find bugs</technical_language>

Target:
public SpecificFunctionReference getFunctionType() { return (type instanceof SpecificFunctionReference) ? (SpecificFunctionReference)type : null; }
Source:
<code>public Object parse(ElementInstance instance, Node node, Object value) throws Exception { String wkName = (String) node.getChildValue("WellKnownName"); Stroke stroke = (Stroke) node.getChildValue("Stroke"); Fill fill = (Fill) node.getChildValue("Fill"); Mark mark = styleFactory.createMark(); if (wkName != null) { if (wkName.startsWith("file://")) { URL url = resourceLocator.locateResource(wkName); if (url != null) { wkName = url.toExternalForm(); } } mark.setWellKnownName(filterFactory.literal(wkName)); <START> } <END> mark.setStroke(stroke); mark.setFill(fill); return mark; }</code><technical_language>warning message in case SVG is</technical_language>

Target:
public Object parse(ElementInstance instance, Node node, Object value) throws Exception { String wkName = (String) node.getChildValue("WellKnownName"); Stroke stroke = (Stroke) node.getChildValue("Stroke"); Fill fill = (Fill) node.getChildValue("Fill"); Mark mark = styleFactory.createMark(); if (wkName != null) { if (wkName.startsWith("file://")) { URL url = resourceLocator.locateResource(wkName); if (url != null) { wkName = url.toExternalForm(); } else { LOGGER.log(Level.WARNING, "Could not resolve location of " + wkName); } } mark.setWellKnownName(filterFactory.literal(wkName)); } mark.setStroke(stroke); mark.setFill(fill); return mark; }
Source:
<code>public MetricPublicationArbiter( <START> Map<MetricName, Set<DeduplicatingFilterHolder>> singleMetricFilters) { <END> this.singleMetricFilters = singleMetricFilters; }</code><technical_language>reshuffle a bit - this is a bit strange API DedupFilterHolder is private</technical_language>

Target:
MetricPublicationArbiter(Map<MetricName, Set<DeduplicatingFilterHolder>> singleMetricFilters) { this.singleMetricFilters = singleMetricFilters; }