auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void querryProvider(IActivityStream activityStream) { try { activityStream.query(null); } catch (CoreException e) { <START> logException(e); <END> } }</code><technical_language>StatusHandler.log() instead</technical_language>

Target:
private void querryProvider(IActivityStream activityStream) { try { activityStream.query(null); } catch (CoreException e) { StatusHandler.log(new Status(IStatus.ERROR, PLUGIN_ID, "Problem occured when querry the TaskActivityProvider.", e)); } }
Source:
<code>static OperatingSystem mapOsType(OsType osType) { OperatingSystem os = OperatingSystem.builder() .description(OsFamily.UNRECOGNIZED.value()) .family(OsFamily.UNRECOGNIZED) .build(); <START> if (os != null) <END> switch (osType) { case WINDOWS: return OperatingSystem.builder() .description(OsFamily.WINDOWS.value()) .family(OsFamily.WINDOWS) .build(); case LINUX: return OperatingSystem.builder() .description(OsFamily.LINUX.value()) .family(OsFamily.LINUX) .build(); } return os; }</code><technical_language>This is null this point</technical_language>

Target:
static OperatingSystem mapOsType(OsType osType) { if (osType != null) switch (osType) { case WINDOWS: return OperatingSystem.builder() .description(OsFamily.WINDOWS.value()) .family(OsFamily.WINDOWS) .build(); case LINUX: return OperatingSystem.builder() .description(OsFamily.LINUX.value()) .family(OsFamily.LINUX) .build(); } return OperatingSystem.builder() .description(OsFamily.UNRECOGNIZED.value()) .family(OsFamily.UNRECOGNIZED) .build(); }
Source:
<code>private KfsVendorDataWrapper createInsuranceCertificateNote(PaymentWorksVendor pmwVendor, KfsVendorDataWrapper kfsVendorDataWrapper) { if (paymentWorksVendorIsPurchaseOrderVendor(pmwVendor) && StringUtils.isNotBlank(pmwVendor.getInsuranceCertificate())) { <START> StringBuilder sbText = new StringBuilder(getConfigurationService().getPropertyValueAsString(PaymentWorksKeyConstants.NEW_VENDOR_PVEN_NOTES_INSURANCE_CERTIFICATE_URL_EXISTS_MESSAGE)); <END> kfsVendorDataWrapper = getPaymentWorksBatchUtilityService().createNoteRecordingAnyErrors(kfsVendorDataWrapper, sbText.toString(), PaymentWorksConstants.ErrorDescriptorForBadKfsNote.INSURANCE_CERTIFICATE.getNoteDescriptionString()); } return kfsVendorDataWrapper; }</code><technical_language>is appended this StringBuilder constructing initial text, this replaced a plain String instead</technical_language>

Target:
private KfsVendorDataWrapper createInsuranceCertificateNote(PaymentWorksVendor pmwVendor, KfsVendorDataWrapper kfsVendorDataWrapper) { if (paymentWorksVendorIsPurchaseOrderVendor(pmwVendor) && StringUtils.isNotBlank(pmwVendor.getInsuranceCertificate())) { kfsVendorDataWrapper = getPaymentWorksBatchUtilityService().createNoteRecordingAnyErrors(kfsVendorDataWrapper, getConfigurationService().getPropertyValueAsString(PaymentWorksKeyConstants.NEW_VENDOR_PVEN_NOTES_INSURANCE_CERTIFICATE_URL_EXISTS_MESSAGE), PaymentWorksConstants.ErrorDescriptorForBadKfsNote.INSURANCE_CERTIFICATE.getNoteDescriptionString()); } return kfsVendorDataWrapper; }
Source:
<code>public void onPlayerCastsSpell(SpellLearnEvent event) { player = dPlayer.mirrorBukkitPlayer(event.getLearner()); spell = new Element(event.getSpell().getName()); source = new Element(event.getSource().name()); cancelled = event.isCancelled(); this.event = event; fire(event); <START> event.setCancelled(cancelled); <END> }</code><technical_language>manually track cancelled state for cancellable events - fire(event) for you</technical_language>

Target:
public void onPlayerCastsSpell(SpellLearnEvent event) { player = dPlayer.mirrorBukkitPlayer(event.getLearner()); spell = new Element(event.getSpell().getName()); source = new Element(event.getSource().name()); this.event = event; fire(event); }
Source:
<code>public void brokerConnectionListenerTests() { MqttService service = new MqttService(); assertFalse(service.isBrokerObservers()); MqttBrokersObserver observer = new MqttBrokersObserver() { @Override public void brokerAdded(MqttBrokerConnection broker) { brokerExisting = true; } @Override public void brokerRemoved(MqttBrokerConnection broker) { brokerExisting = false; } }; service.addBrokersListener(observer); assertTrue(service.isBrokerObservers()); MqttBrokerConnection connection; try { connection = new MqttBrokerConnection("name", "tcp://123.123.123.123", false); } catch (ConfigurationException c) { fail("Couldn't create a MqttBrokerConnection object"); return; } assertTrue(service.addBrokerConnection(connection)); <START> assertTrue(brokerExisting); <END> service.removeBrokerConnection(connection); assertFalse(brokerExisting); service.removeBrokersListener(observer); assertFalse(service.isBrokerObservers()); }</code><technical_language>in MqttBrokerConnectionTests this a shorter a mock MqttBrokersObserver org.mockito.Mockito.vrify</technical_language>

Target:
public void brokerConnectionListenerTests() throws ConfigurationException { MqttService service = new MqttService(); assertFalse(service.isBrokerObservers()); MqttBrokersObserver observer = mock(MqttBrokersObserver.class); service.addBrokersListener(observer); assertTrue(service.isBrokerObservers()); MqttBrokerConnection connection = new MqttBrokerConnection("name", "tcp://123.123.123.123", false); assertTrue(service.addBrokerConnection(connection)); verify(observer).brokerAdded(connection); service.removeBrokerConnection(connection); verify(observer).brokerRemoved(connection); service.removeBrokersListener(observer); assertFalse(service.isBrokerObservers()); }
Source:
<code>private Widget getWidget(final DTCellValue52 defaultValue) { <START> final DTColumnConfig52 column = getPlugin().editingCol(); <END> final Pattern52 pattern = getPlugin().editingPattern(); if (column instanceof ActionSetFieldCol52) { final ActionSetFieldCol52 col52 = (ActionSetFieldCol52) column; return factory().getWidget(pattern, col52, defaultValue); } else if (column instanceof ConditionCol52) { final ConditionCol52 col52 = (ConditionCol52) column; return factory().getWidget(pattern, col52, defaultValue); } else if (column instanceof ActionInsertFactCol52) { final ActionInsertFactCol52 col52 = (ActionInsertFactCol52) column; return factory().getWidget(col52, defaultValue); } return null; }</code><technical_language>"plugins" a Pattern52</technical_language>

Target:
private Widget getWidget(final DTCellValue52 defaultValue) { final DTColumnConfig52 column = getPlugin().editingCol(); final Pattern52 pattern = getPlugin().editingPattern(); if (column instanceof ActionSetFieldCol52) { final ActionSetFieldCol52 col52 = (ActionSetFieldCol52) column; return factory().getWidget(pattern, col52, defaultValue); } else if (column instanceof ConditionCol52) { final ConditionCol52 col52 = (ConditionCol52) column; return factory().getWidget(pattern, col52, defaultValue); } else if (column instanceof ActionInsertFactCol52) { final ActionInsertFactCol52 col52 = (ActionInsertFactCol52) column; return factory().getWidget(col52, defaultValue); } throw new UnsupportedOperationException("The column type is not supported by the 'DefaultWidget'"); }
Source:
<code>private List<String> fixMissingIndexes(Map<String, ExecRow> result) throws StandardException { List<String> messages = new LinkedList<>(); DataSet<ExecRow> dataSet = new ControlDataSet<>(result.values().iterator()); PairDataSet dsToWrite = dataSet .map(new IndexTransformFunction(tentativeIndex), null, false, true, "Prepare Index") .index(new KVPairFunction(), false, true, "Add missing indexes"); DataSetWriter writer = dsToWrite.directWriteData() .destConglomerate(tentativeIndex.getIndex().getConglomerate()) .txn(txn) .build(); writer.write(); int i = 0; messages.add(String.format("Create index for the following %d rows from base table %s.%s:", result.size(), schemaName, tableName)); for (Map.Entry<String, ExecRow> entry : result.entrySet()) { if (i >= maxCheckTableErrors) { messages.add("..."); <START> break; <END> } byte[] key = entry.getValue().getKey(); if (tableKeyTemplate.nColumns() > 0) { tableKeyDecoder.set(key, 0, key.length); tableKeyDecoder.decode(tableKeyTemplate); messages.add(tableKeyTemplate.getClone().toString()); } else { messages.add(entry.getKey()); } i++; } return messages; }</code><technical_language>question here, break out fixing remaining rows</technical_language>

Target:
private void fixMissingIndexes(Map<String, ExecRow> result) throws StandardException { List<String> messages = new LinkedList<>(); DataSet<ExecRow> dataSet = new ControlDataSet<>(result.values().iterator()); PairDataSet dsToWrite = dataSet .map(new IndexTransformFunction(tentativeIndex), null, false, true, "Prepare Index") .index(new KVPairFunction(), false, true, "Add missing indexes"); DataSetWriter writer = dsToWrite.directWriteData() .destConglomerate(tentativeIndex.getIndex().getConglomerate()) .txn(txn) .build(); writer.write(); }
Source:
<code>public void testSuccess() { <START> ConcurrentPhaseExecutor phaseExecutor = createConcurrentPhaseExecutor(ImmutableList.of("Q1", "Q2", "Q3"), queryMap, false); phaseExecutor.run(); <END> }</code><technical_language>simplified createConcurrentPhaseExecutor(...).run()</technical_language>

Target:
public void testSuccess() { MockEventClient eventClient = new MockEventClient(); BenchmarkPhaseEvent phaseEvent = createConcurrentPhaseExecutor(false, eventClient).run(false); assertNotNull(phaseEvent); assertBenchmarkPhaseEvent(phaseEvent, SUCCEEDED); List<BenchmarkPhaseEvent> postedEvents = eventClient.getEvents(); assertEquals(postedEvents.size(), 1); assertBenchmarkPhaseEvent(postedEvents.get(0), SUCCEEDED); }
Source:
<code><START> public double modify(double speed) { <END> if (speed > maxSpeed) { speed = maxSpeed; } if (speed < minSpeed) { speed = minSpeed; } return speed; }</code><technical_language>@leijurv pointed out, this is a perfectly fine implementation, for consistency a Util.Range in constructor, call limitValue here</technical_language>

Target:
public double modify(double speed) { return speedCap.limitValue(speed); }
Source:
<code>public void draw(GC gc) { int colorInt = (fColorRGBA != null) ? fColorRGBA.toInt() : <START> OPAQUE.getAlpha(); <END> Color color = getColor(colorInt); for (int i = 0; i < this.fSeriesPoints.size(); i++) { Color prev = gc.getForeground(); int prevAlpha = gc.getAlpha(); gc.setAlpha(colorInt & 0xff); gc.setForeground(color); List<LongPoint> series = fSeriesPoints.get(i); int[] points = new int[series.size() * 2]; for (int point = 0; point < series.size(); point++) { LongPoint longPoint = series.get(point); points[point * 2] = longPoint.x; points[point * 2 + 1] = fBounds.height - (int) ((longPoint.y - fMin) * fScale) + fBounds.y; } gc.drawPolyline(points); gc.setForeground(prev); gc.setAlpha(prevAlpha); } }</code><technical_language>In theory OPAQUE.toInt() in practice same..</technical_language>

Target:
public void draw(GC gc) { int colorInt = (fColorRGBA != null) ? fColorRGBA.toInt() : BLACK.getAlpha(); Color color = getColor(colorInt); for (int i = 0; i < this.fSeriesPoints.size(); i++) { Color prev = gc.getForeground(); int prevAlpha = gc.getAlpha(); gc.setAlpha(colorInt & 0xff); gc.setForeground(color); List<LongPoint> series = fSeriesPoints.get(i); int[] points = new int[series.size() * 2]; for (int point = 0; point < series.size(); point++) { LongPoint longPoint = series.get(point); points[point * 2] = longPoint.x; points[point * 2 + 1] = fBounds.height - (int) ((longPoint.y - fMin) * fScale) + fBounds.y; } gc.drawPolyline(points); gc.setForeground(prev); gc.setAlpha(prevAlpha); } }
Source:
<code>public void run() { WorkDatabasePathHelper.migrateDatabase(mContext); <START> Preferences.migrateLegacyPreferences( mWorkManager.getApplicationContext(), mWorkManager.getWorkDatabase()); IdGenerator.migrateLegacyIdGenerator( mWorkManager.getApplicationContext(), mWorkManager.getWorkDatabase()); <END> Logger.get().debug(TAG, "Performing cleanup operations."); boolean needsScheduling = cleanUp(); if (shouldRescheduleWorkers()) { Logger.get().debug(TAG, "Rescheduling Workers."); mWorkManager.rescheduleEligibleWork(); mWorkManager.getPreferences().setNeedsReschedule(false); } else if (isForceStopped()) { Logger.get().debug(TAG, "Application was force-stopped, rescheduling."); mWorkManager.rescheduleEligibleWork(); } else if (needsScheduling) { Logger.get().debug(TAG, "Found unfinished work, scheduling it."); Schedulers.schedule( mWorkManager.getConfiguration(), mWorkManager.getWorkDatabase(), mWorkManager.getSchedulers()); } mWorkManager.onForceStopRunnableCompleted(); }</code><technical_language>this happen in db migration instead of here? This is hitting disk everytime</technical_language>

Target:
public void run() { WorkDatabasePathHelper.migrateDatabase(mContext); PreferenceUtils.migrateLegacyPreferences(mContext, mWorkManager.getWorkDatabase()); IdGenerator.migrateLegacyIdGenerator(mContext, mWorkManager.getWorkDatabase()); Logger.get().debug(TAG, "Performing cleanup operations."); boolean needsScheduling = cleanUp(); if (shouldRescheduleWorkers()) { Logger.get().debug(TAG, "Rescheduling Workers."); mWorkManager.rescheduleEligibleWork(); mWorkManager.getPreferenceUtils().setNeedsReschedule(false); } else if (isForceStopped()) { Logger.get().debug(TAG, "Application was force-stopped, rescheduling."); mWorkManager.rescheduleEligibleWork(); } else if (needsScheduling) { Logger.get().debug(TAG, "Found unfinished work, scheduling it."); Schedulers.schedule( mWorkManager.getConfiguration(), mWorkManager.getWorkDatabase(), mWorkManager.getSchedulers()); } mWorkManager.onForceStopRunnableCompleted(); }
Source:
<code>public void snapshot(String snapshotName, TableName tableName) throws IOException, SnapshotCreationException, IllegalArgumentException { try { connection.getSession().getInstanceAdminClient() .waitForOperation(snapshotTable(snapshotName, tableName)); } catch (TimeoutException e) { throw new IOException("Timed out waiting for snapshot creation to finish", e); } catch (InterruptedException e) { <START> Thread.currentThread().interrupt(); <END> throw new IOException("Interrupted while waiting for snapshot creation to finish"); } }</code><technical_language>why</technical_language>

Target:
public void snapshot(String snapshotName, TableName tableName) throws IOException, SnapshotCreationException, IllegalArgumentException { Operation operation = snapshotTable(snapshotName, tableName); try { connection.getSession().getInstanceAdminClient().waitForOperation(operation); } catch (TimeoutException e) { throw new IOException("Timed out waiting for snapshot creation to finish", e); } }
Source:
<code>public InterpreterResult interpretInput(String code, InterpreterContext context) { SparkEnv.set(env); Console.setOut(context.out); ByteArrayOutputStream replOutput = new ByteArrayOutputStream(); out.setInterpreterOutput(replOutput); context.out.clear(); scala.tools.nsc.interpreter.Results.Result res; try { res = interpret(code); Code r = getResultCode(res); if (r == Code.ERROR) { return new InterpreterResult(r, ""); } if (r == Code.INCOMPLETE) { res = interpret(code + "\nprint(\"\")"); r = getResultCode(res); } if (r == Code.INCOMPLETE) { return new InterpreterResult(r, "Incomplete expression"); } else { putLatestVarInResourcePool(context); return new InterpreterResult(Code.SUCCESS); } } catch (Exception e) { logger.info("Interpreter exception", e); return new InterpreterResult(Code.ERROR, InterpreterUtils.getMostRelevantMessage(e)); } finally { <START> try { <END> context.out.setType(InterpreterResult.Type.TEXT); context.out.write(replOutput.toByteArray()); } catch (IOException e) { System.out.println(ExceptionUtils.getStackTrace(e)); } out.setInterpreterOutput(null); } }</code><technical_language>TEXT ? other type</technical_language>

Target:
public InterpreterResult interpretInput(String code, InterpreterContext context) { SparkEnv.set(env); Console.setOut(context.out); ByteArrayOutputStream replOutput = new ByteArrayOutputStream(); out.setInterpreterOutput(replOutput); context.out.clear(); try { scala.tools.nsc.interpreter.Results.Result res = interpret(code); Code r = getResultCode(res); if (r == Code.ERROR) { return new InterpreterResult(r, ""); } else if (r == Code.INCOMPLETE) { return new InterpreterResult(r, "Incomplete expression"); } else { putLatestVarInResourcePool(context); return new InterpreterResult(Code.SUCCESS); } } catch (Exception e) { logger.info("Interpreter exception", e); return new InterpreterResult(Code.ERROR, InterpreterUtils.getMostRelevantMessage(e)); } finally { try { context.out.setType(InterpreterResult.Type.TEXT); context.out.write(replOutput.toByteArray()); } catch (IOException e) { logger.error(e.getMessage(), e); } out.setInterpreterOutput(null); } }
Source:
<code>public Optional<WetData> createFrom(DataHolder dataHolder) { <START> if (dataHolder instanceof ItemStack) { <END> ItemStack stack = (ItemStack) dataHolder; if (stack.getItem().equals(ItemTypes.SPONGE)) { SpongeWetData data = new SpongeWetData(stack.getItemDamage() == 1); return Optional.<WetData>of(data); } } else if (dataHolder instanceof EntityWolf) { EntityWolf wolf = (EntityWolf) dataHolder; SpongeWetData data = new SpongeWetData(wolf.isWet()); return Optional.<WetData>of(data); } return Optional.absent(); }</code><technical_language>Fix formatting, tabs in some places, 3 spaces in others, etc</technical_language>

Target:
public Optional<WetData> createFrom(DataHolder dataHolder) { if (dataHolder instanceof ItemStack) { ItemStack stack = (ItemStack) dataHolder; if (stack.getItem().equals(ItemTypes.SPONGE)) { SpongeWetData data = new SpongeWetData(stack.getItemDamage() == 1); return Optional.<WetData>of(data); } } else if (dataHolder instanceof EntityWolf) { EntityWolf wolf = (EntityWolf) dataHolder; SpongeWetData data = new SpongeWetData(wolf.isWet()); return Optional.<WetData>of(data); } return Optional.empty(); }
Source:
<code>private Collection<Pair<String, String>> parseFeatures(String[] features) throws InfrastructureException { Map<String, Pair<String, String>> featuresNameVersion = new HashMap<>(); for (String feature : features) { String[] featureAndVersion = feature.split("/", 2); if (featureAndVersion.length != 2 || featureAndVersion[0].isEmpty() || featureAndVersion[1] .isEmpty()) { throw new InfrastructureException( "Features format is illegal. Problematic feature entry:" + feature); } String key = featureAndVersion[0] + '/' + featureAndVersion[1]; if (featuresNameVersion.containsKey(key)) { throw new InfrastructureException( format("Invalid Workspace.Next configuration: feature %s is duplicated", key)); } <START> featuresNameVersion.put(key, Pair.of(featureAndVersion[0], featureAndVersion[1])); <END> } return featuresNameVersion.values(); }</code><technical_language>I guess feature instead of contacting separated values</technical_language>

Target:
private Collection<Pair<String, String>> parseFeatures(String[] features) throws InfrastructureException { Map<String, Pair<String, String>> featuresNameVersion = new HashMap<>(); for (String feature : features) { String[] featureAndVersion = feature.split("/"); if (featureAndVersion.length != 2 || featureAndVersion[0].isEmpty() || featureAndVersion[1].isEmpty()) { throw new InfrastructureException( "Features format is illegal. Problematic feature entry:" + feature); } String key = featureAndVersion[0] + '/' + featureAndVersion[1]; if (featuresNameVersion.containsKey(key)) { throw new InfrastructureException( format("Invalid Workspace.Next configuration: feature %s is duplicated", key)); } featuresNameVersion.put(key, Pair.of(featureAndVersion[0], featureAndVersion[1])); } return featuresNameVersion.values(); }
Source:
<code>public Tuple next() throws IOException { if (fragments == null) { return null; } while(scanIt.hasNext()) { <START> Tuple outTuple = new VTuple(outColumnNum); <END> Tuple t = scanIt.next(); projector.eval(t, outTuple); outTuple.setOffset(t.getOffset()); return outTuple; } return null; }</code><technical_language>outTuple created for input row</technical_language>

Target:
public Tuple next() throws IOException { if (fragments == null) { return null; } Tuple tuple; Tuple outTuple = new VTuple(outColumnNum); if (!plan.hasQual()) { if ((tuple = scanner.next()) != null) { projector.eval(tuple, outTuple); outTuple.setOffset(tuple.getOffset()); return outTuple; } else { return null; } } else { while ((tuple = scanner.next()) != null) { if (qual.eval(tuple).isTrue()) { projector.eval(tuple, outTuple); return outTuple; } } return null; } }
Source:
<code>public void processFiles(RuleSetFactory ruleSetFactory, List<DataSource> files, RuleContext ctx, List<Renderer> renderers) { RuleSets rs = createRuleSets(ruleSetFactory, ctx.getReport()); configuration.getAnalysisCache().checkValidity(rs, configuration.getClassLoader()); SourceCodeProcessor processor = new SourceCodeProcessor(configuration); for (DataSource dataSource : files) { String niceFileName = filenameFrom(dataSource); runAnalysis(new PmdRunnable(dataSource, niceFileName, renderers, ctx, rs, processor)); } <START> for (DataSource dataSource : files) { <END> if (dataSource instanceof ZipDataSource) { IOUtils.closeQuietly((ZipDataSource) dataSource); } } renderReports(renderers, ctx.getReport()); collectReports(renderers); }</code><technical_language>DataSource implement Closable a default empty implementation, deal details for plausible implementation</technical_language>

Target:
public void processFiles(RuleSetFactory ruleSetFactory, List<DataSource> files, RuleContext ctx, List<Renderer> renderers) { RuleSets rs = createRuleSets(ruleSetFactory, ctx.getReport()); configuration.getAnalysisCache().checkValidity(rs, configuration.getClassLoader()); SourceCodeProcessor processor = new SourceCodeProcessor(configuration); for (DataSource dataSource : files) { String realFileName = dataSource.getNiceFileName(false, null); runAnalysis(new PmdRunnable(dataSource, realFileName, renderers, ctx, rs, processor)); } renderReports(renderers, ctx.getReport()); collectReports(renderers); for (DataSource dataSource : files) { IOUtils.closeQuietly(dataSource); } }
Source:
<code>public Map<String, Set<String>> getGlobalTags() { Map<String, Set<String>> tags = new HashMap<>(); List<String> globalTagsLines = DatadogUtilities.linesToList(globalTags); for (String globalTagsLine : globalTagsLines) { List<String> tagList = DatadogUtilities.cstrToList(globalTagsLine); if (tagList.isEmpty()) { continue; } for (int i = 1; i < tagList.size(); i++) { String[] tagItem = tagList.get(i).split(":"); <START> if(tagItem.length == 2) { <END> String tagName = tagItem[0]; String tagValue = tagItem[1]; Set<String> tagValues = tags.containsKey(tagName) ? tags.get(tagName) : new HashSet<String>(); tagValues.add(tagValue.toLowerCase()); tags.put(tagName, tagValues); } } } return tags; }</code><technical_language>if length is 2 ? split : remaining element ? a tag a key is valid</technical_language>

Target:
public String getGlobalTags() { return globalTags; }
Source:
<code>public void performHaResevationCheck() { log.debugFormat("HA Reservation check timer entered."); List<VDSGroup> clusters = DbFacade.getInstance().getVdsGroupDao().getAll(); if (clusters != null) { for (VDSGroup cluster : clusters) { if (cluster.supportsHaReservation()) { List<VDS> returnedFailedHosts = new ArrayList<VDS>(); boolean status = <START> new HaReservationHandling().checkHaReservationStatusForCluster(cluster, returnedFailedHosts); <END> if (!status) { AuditLogableBase logable = new AuditLogableBase(); logable.setVdsGroupId(cluster.getId()); logable.addCustomValue("ClusterName", cluster.getName()); StringBuilder failedHostsStr = new StringBuilder(); int commaCount = returnedFailedHosts.size() - 1; for (VDS host : returnedFailedHosts) { failedHostsStr.append(host.getName()); if (commaCount > 0) { failedHostsStr.append(", "); commaCount--; } } logable.addCustomValue("Hosts", failedHostsStr.toString()); AlertDirector.Alert(logable, AuditLogType.CLUSTER_ALERT_HA_RESERVATION); } } } } }</code><technical_language>creating new instance for cluster</technical_language>

Target:
public void performHaResevationCheck() { log.debugFormat("HA Reservation check timer entered."); List<VDSGroup> clusters = DbFacade.getInstance().getVdsGroupDao().getAll(); if (clusters != null) { HaReservationHandling haReservationHandling = new HaReservationHandling(); for (VDSGroup cluster : clusters) { if (cluster.supportsHaReservation()) { List<VDS> returnedFailedHosts = new ArrayList<VDS>(); boolean status = haReservationHandling.checkHaReservationStatusForCluster(cluster, returnedFailedHosts); if (!status) { AuditLogableBase logable = new AuditLogableBase(); logable.setVdsGroupId(cluster.getId()); logable.addCustomValue("ClusterName", cluster.getName()); String failedHostsStr = StringUtils.join(returnedFailedHosts, ", "); logable.addCustomValue("Hosts", failedHostsStr); AlertDirector.Alert(logable, AuditLogType.CLUSTER_ALERT_HA_RESERVATION); } } } } }
Source:
<code>public static void checkAndEnableBluetooth(Context context, BluetoothAdapter adapter) throws BluetoothNotEnabledException, BluetoothNotSupportedException { if (adapter != null) { if (!adapter.isEnabled()) { Toaster.iToast(context, R.string.enable_bluetooth); boolean enableStarted = adapter.enable(); boolean enabled = false; if (enableStarted) { <START> int retrySeconds = 5; <END> int retryPauseMS = 500; int retries = (retrySeconds * 1000) / retryPauseMS; int retry = 0; do { try { Thread.sleep(retryPauseMS); } catch (InterruptedException e) { } enabled = adapter.isEnabled(); } while (!enabled && retry++ < retries); } if (!enabled) { throw new BluetoothNotEnabledException(); } } } else { throw new BluetoothNotSupportedException(); } }</code><technical_language>this determined trial error</technical_language>

Target:
public static void checkAndEnableBluetooth(Context context, BluetoothAdapter adapter) throws BluetoothNotEnabledException, BluetoothNotSupportedException { if (adapter != null) { if (!adapter.isEnabled()) { Toaster.iToast(context, R.string.enable_bluetooth); boolean enableStarted = adapter.enable(); boolean enabled = false; if (enableStarted) { int retries = (ENABLE_CHECK_RETRY_SECONDS * 1000) / ENABLE_CHECK_RETRY_PAUSE_MILLISECONDS; int retry = 0; do { try { Thread.sleep(ENABLE_CHECK_RETRY_PAUSE_MILLISECONDS); } catch (InterruptedException e) { } enabled = adapter.isEnabled(); } while (!enabled && retry++ < retries); } if (!enabled) { throw new BluetoothNotEnabledException(); } } } else { throw new BluetoothNotSupportedException(); } }
Source:
<code>public void testLaunchClusterWithDomainName() throws RunNodesException { int numNodes = 1; final String name = "node"; ComputeServiceContext context = ContextBuilder.newBuilder("softlayer").credentials(identity, credential) .modules(ImmutableSet.of(new SLF4JLoggingModule(), new SshjSshClientModule())) .build(ComputeServiceContext.class); for (ComputeMetadata computeMetadata : context.getComputeService().listNodes()) { <START> System.out.println(computeMetadata); <END> } TemplateBuilder templateBuilder = context.getComputeService().templateBuilder(); Template template = templateBuilder.build(); SoftLayerTemplateOptions options = template.getOptions().as(SoftLayerTemplateOptions.class); options.domainName("live.org"); options.tags(ImmutableList.of("jclouds")); Set<? extends NodeMetadata> nodes = context.getComputeService().createNodesInGroup(name, numNodes, template); assertEquals(numNodes, nodes.size(), "wrong number of nodes"); for (NodeMetadata node : nodes) { logger.debug("Created Node: %s", node); SshClient client = context.utils().sshForNode().apply(node); client.connect(); ExecResponse hello = client.exec("mount"); logger.debug(hello.getOutput().trim()); context.getComputeService().destroyNode(node.getId()); } }</code><technical_language>getAnonymousLogger() instead if want print feedback running tests</technical_language>

Target:
public void testLaunchClusterWithDomainName() throws RunNodesException { int numNodes = 1; final String name = "node"; Template template = view.getComputeService().templateBuilder().build(); SoftLayerTemplateOptions options = template.getOptions().as(SoftLayerTemplateOptions.class); options.domainName("live.org"); options.tags(ImmutableList.of("jclouds")); Set<? extends NodeMetadata> nodes = view.getComputeService().createNodesInGroup(name, numNodes, template); assertEquals(numNodes, nodes.size(), "wrong number of nodes"); for (NodeMetadata node : nodes) { logger.debug("Created Node: %s", node); SshClient client = view.utils().sshForNode().apply(node); client.connect(); ExecResponse hello = client.exec("mount"); logger.debug(hello.getOutput().trim()); view.getComputeService().destroyNode(node.getId()); } }
Source:
<code>public void onActivate(ActivateEvent event, EntityRef entity) { <START> LASTeam baseTeamComponent = entity.getComponent(LASTeam.class); <END> EntityRef player = event.getInstigator(); CharacterHeldItemComponent characterHeldItemComponent = player.getComponent(CharacterHeldItemComponent.class); EntityRef heldItem = characterHeldItemComponent.selectedItem; if (baseTeamComponent.team.equals(baseTeamComponent.RED) && heldItem.hasComponent(FlagComponent.class) && heldItem.getComponent(LASTeam.class).team.equals("black")) { score.getComponent(ScoreComponent.class).redScore++; } if (baseTeamComponent.team.equals(baseTeamComponent.BLACK) && heldItem.hasComponent(FlagComponent.class) && heldItem.getComponent(LASTeam.class).team.equals("red")) { score.getComponent(ScoreComponent.class).blackScore++; } }</code><technical_language>LASTeam.class required in list of components here</technical_language>

Target:
public void onActivate(ActivateEvent event, EntityRef entity) { LASTeamComponent baseTeamComponent = entity.getComponent(LASTeamComponent.class); EntityRef player = event.getInstigator(); CharacterHeldItemComponent characterHeldItemComponent = player.getComponent(CharacterHeldItemComponent.class); if (characterHeldItemComponent != null) { EntityRef heldItem = characterHeldItemComponent.selectedItem; if (baseTeamComponent.team.equals(baseTeamComponent.RED) && heldItem.getComponent(BlockItemComponent.class).blockFamily.getURI().toString().equals(BLACK_FLAG_URI)) { redScore++; } if (baseTeamComponent.team.equals(baseTeamComponent.BLACK) && heldItem.getComponent(BlockItemComponent.class).blockFamily.getURI().toString().equals(RED_FLAG_URI)) { blackScore++; } } }
Source:
<code>private void bindDataService() { String packageName = getDataServicePackageName(); String className = getDataServiceClassName(); if (TextUtils.isEmpty(packageName)) { loge("Can't find the binding package"); return; } if (TextUtils.equals(packageName, mTargetBindingPackageName)) { if (DBG) log("Service " + packageName + " already bound or being bound."); return; } revokePermissionsFromUnusedDataServices(); if (mIDataService != null && mIDataService.asBinder().isBinderAlive()) { try { mIDataService.removeDataServiceProvider(mPhone.getPhoneId()); } catch (RemoteException e) { loge("Cannot remove data service provider. " + e); } mPhone.getContext().unbindService(mServiceConnection); } grantPermissionsToService(packageName); try { mServiceConnection = new CellularDataServiceConnection(); <START> ComponentName cm = new ComponentName(packageName, className); if (!mPhone.getContext().bindService( new Intent(DataService.SERVICE_INTERFACE).setComponent(cm), <END> mServiceConnection, Context.BIND_AUTO_CREATE)) { loge("Cannot bind to the data service."); return; } mTargetBindingPackageName = packageName; } catch (Exception e) { loge("Cannot bind to the data service. Exception: " + e); } }</code><technical_language>If package name & class name non-empty, call setComponent. If package name is non-empty, call setPackage</technical_language>

Target:
private void bindDataService() { Intent intent = null; String packageName = getDataServicePackageName(); String className = getDataServiceClassName(); if (TextUtils.isEmpty(packageName)) { loge("Can't find the binding package"); return; } if (TextUtils.isEmpty(className)) { intent = new Intent(DataService.SERVICE_INTERFACE); intent.setPackage(packageName); } else { ComponentName cm = new ComponentName(packageName, className); intent = new Intent(DataService.SERVICE_INTERFACE).setComponent(cm); } if (TextUtils.equals(packageName, mTargetBindingPackageName)) { if (DBG) log("Service " + packageName + " already bound or being bound."); return; } revokePermissionsFromUnusedDataServices(); if (mIDataService != null && mIDataService.asBinder().isBinderAlive()) { try { mIDataService.removeDataServiceProvider(mPhone.getPhoneId()); } catch (RemoteException e) { loge("Cannot remove data service provider. " + e); } mPhone.getContext().unbindService(mServiceConnection); } grantPermissionsToService(packageName); try { mServiceConnection = new CellularDataServiceConnection(); if (!mPhone.getContext().bindService( intent, mServiceConnection, Context.BIND_AUTO_CREATE)) { loge("Cannot bind to the data service."); return; } mTargetBindingPackageName = packageName; } catch (Exception e) { loge("Cannot bind to the data service. Exception: " + e); } }
Source:
<code>public String getMeetingUrl() { String url = getBoshURL(); String room = getRoomName(); if(url == null || room == null) { return null; } <START> url = url.substring(0, url.indexOf("http-bind?")); <END> room = room.substring(0, room.indexOf("@")); return url + room; }</code><technical_language>Ugh. This flaky. I "?" present. do "/http-bind" add "/"? add a log message (it easier debug if brakes in future)</technical_language>

Target:
public String getMeetingUrl() { String url = getBoshURL(); String room = getRoomName(); if(url == null || room == null) { return null; } url = url.substring(0, url.indexOf("/http-bind")); room = room.substring(0, room.indexOf("@")); return url + "/" + room; }
Source:
<code>public boolean replaces(LookupExtractorFactoryContainer other) { if (version == null && other.getVersion() == null) { return !this.lookupExtractorFactory.replaces(other.getLookupExtractorFactory()); } <START> if (version == null && other.getVersion() != null) { <END> return false; } if (version != null && other.getVersion() == null) { return true; } return version.compareTo(other.getVersion()) > 0; }</code><technical_language>This block shortened if Ordering.nullsFirst()</technical_language>

Target:
public boolean replaces(LookupExtractorFactoryContainer other) { if (version == null && other.getVersion() == null) { return this.lookupExtractorFactory.replaces(other.getLookupExtractorFactory()); } return VERSION_COMPARATOR.compare(version, other.getVersion()) > 0; }
Source:
<code>public void testMultipleStrategies() { DarkClusterConfigMap configMap = new DarkClusterConfigMap(); <START> DarkClusterStrategyNameArray multiplierStrategyTypeArray = new DarkClusterStrategyNameArray(); <END> multiplierStrategyTypeArray.add(DarkClusterStrategyName.RELATIVE_TRAFFIC); multiplierStrategyTypeArray.add(DarkClusterStrategyName.CONSTANT_QPS); DarkClusterConfig config = new DarkClusterConfig() .setMultiplierStrategyList(multiplierStrategyTypeArray); configMap.put(DARK_CLUSTER_KEY, config); config.setMultiplier(0.0f); config.setDispatcherOutboundTargetRate(0); config.setDispatcherOutboundMaxRate(Integer.MAX_VALUE); DarkClusterConfigMap expectedConfigMap = new DarkClusterConfigMap(); DarkClusterConfig expectedConfig = new DarkClusterConfig(config.data()); expectedConfig.setMultiplier(0); expectedConfigMap.put(DARK_CLUSTER_KEY, expectedConfig); DarkClusterConfigMap resultConfigMap = DarkClustersConverter.toConfig(DarkClustersConverter.toProperties(configMap)); Assert.assertEquals(resultConfigMap, expectedConfigMap); Assert.assertEquals(resultConfigMap.get(DARK_CLUSTER_KEY).getMultiplierStrategyList().get(0), DarkClusterStrategyName.RELATIVE_TRAFFIC, "expected first strategy to be RELATIVE_TRAFFIC"); Assert.assertEquals(resultConfigMap.get(DARK_CLUSTER_KEY).getMultiplierStrategyList().get(1), DarkClusterStrategyName.CONSTANT_QPS, "expected first strategy to be CONSTANT_QPS"); }</code><technical_language>update name</technical_language>

Target:
public void testMultipleStrategies() { DarkClusterConfigMap configMap = new DarkClusterConfigMap(); DarkClusterStrategyNameArray darkClusterStrategyNameArray = new DarkClusterStrategyNameArray(); darkClusterStrategyNameArray.add(DarkClusterStrategyName.RELATIVE_TRAFFIC); darkClusterStrategyNameArray.add(DarkClusterStrategyName.CONSTANT_QPS); DarkClusterConfig config = new DarkClusterConfig() .setDarkClusterStrategyPrioritizedList(darkClusterStrategyNameArray); configMap.put(DARK_CLUSTER_KEY, config); config.setMultiplier(DARK_CLUSTER_DEFAULT_MULTIPLIER); config.setDispatcherOutboundTargetRate(DARK_CLUSTER_DEFAULT_TARGET_RATE); config.setDispatcherOutboundMaxRate(DARK_CLUSTER_DEFAULT_MAX_RATE); DarkClusterConfigMap expectedConfigMap = new DarkClusterConfigMap(); DarkClusterConfig expectedConfig = new DarkClusterConfig(config.data()); expectedConfig.setMultiplier(0); expectedConfigMap.put(DARK_CLUSTER_KEY, expectedConfig); DarkClusterConfigMap resultConfigMap = DarkClustersConverter.toConfig(DarkClustersConverter.toProperties(configMap)); Assert.assertEquals(resultConfigMap, expectedConfigMap); Assert.assertEquals(resultConfigMap.get(DARK_CLUSTER_KEY).getDarkClusterStrategyPrioritizedList().get(0), DarkClusterStrategyName.RELATIVE_TRAFFIC, "expected first strategy to be RELATIVE_TRAFFIC"); Assert.assertEquals(resultConfigMap.get(DARK_CLUSTER_KEY).getDarkClusterStrategyPrioritizedList().get(1), DarkClusterStrategyName.CONSTANT_QPS, "expected first strategy to be CONSTANT_QPS"); }
Source:
<code>public CommonTemplate( Metacard metacard, Map<String, List<Serializable>> securityAttributes) { this.id = safeGet(metacard, Core.ID, String.class); this.title = safeGet(metacard, Core.TITLE, String.class); this.description = safeGet(metacard, Core.DESCRIPTION, String.class); this.created = safeGet(metacard, Core.CREATED, Date.class); this.modified = safeGet(metacard, Core.MODIFIED, Date.class); this.owner = safeGet(metacard, Core.METACARD_OWNER, String.class); <START> this.accessIndividuals = securityAttributes.get(Security.ACCESS_INDIVIDUALS); <END> this.accessGroups = securityAttributes.get(Security.ACCESS_GROUPS); }</code><technical_language>Do need worry this null? i.e. getOrDefault(..., new ArrayList<>())</technical_language>

Target:
public CommonTemplate(Metacard metacard, Map<String, List<Serializable>> securityAttributes) { this.id = safeGet(metacard, Core.ID, String.class); this.title = safeGet(metacard, Core.TITLE, String.class); this.description = safeGet(metacard, Core.DESCRIPTION, String.class); this.created = safeGet(metacard, Core.CREATED, Date.class); this.modified = safeGet(metacard, Core.MODIFIED, Date.class); this.owner = safeGet(metacard, Core.METACARD_OWNER, String.class); this.accessIndividuals = securityAttributes.getOrDefault(Security.ACCESS_INDIVIDUALS, new ArrayList<>()); this.accessGroups = securityAttributes.getOrDefault(Security.ACCESS_GROUPS, new ArrayList<>()); }
Source:
<code>public int read() throws IOException { synchronized ( InfinispanJF.this ) { if ( closed ) { throw new IOException( "Joint: " + jointIdx + "(" + originalThreadName + "): Cannot read from closed stream!" ); } } if ( block.getBuffer().position() == block.getBuffer().limit() ) { try { FileBlock next = filesystem.getNextBlock( block ); <START> block = next; <END> } catch ( final InterruptedException e) { return -1; } } if ( block.isEOF() ) { return -1; } final int result = block.getBuffer().get(); read++; return result & 0xff; }</code><technical_language>need a null check here. If next is null, means hit EOF, I think? other alternative return block again, maybe, EOF check trip</technical_language>

Target:
public int read() throws IOException { synchronized ( InfinispanJF.this ) { if ( closed ) { throw new IOException( "Joint: " + jointIdx + "(" + originalThreadName + "): Cannot read from closed stream!" ); } } if ( block.getBuffer().position() == block.getBuffer().limit() ) { if ( block.isEOF() ) { return -1; } try { FileBlock next = filesystem.getNextBlock( block, metadata ); block = next; if ( block == null ) { return -1; } } catch ( final IOException e ) { return -1; } } final int result = block.getBuffer().get(); read++; return result & 0xff; }
Source:
<code>private void repairIndexRows(Map<byte[], List<Mutation>> indexMutationMap, List<Mutation> indexRowsToBeDeleted, IndexToolVerificationResult verificationResult) throws IOException { try { int batchSize = 0; List<Mutation> indexUpdates = new ArrayList<Mutation>(maxBatchSize); for (List<Mutation> mutationList : indexMutationMap.values()) { indexUpdates.addAll(mutationList); <START> batchSize += mutationList.size(); if (batchSize >= maxBatchSize) { ungroupedAggregateRegionObserver.checkForRegionClosing(); region.batchMutate(indexUpdates.toArray(new Mutation[indexUpdates.size()]), HConstants.NO_NONCE, HConstants.NO_NONCE); batchSize = 0; indexUpdates = new ArrayList<Mutation>(maxBatchSize); } } if (batchSize > 0) { ungroupedAggregateRegionObserver.checkForRegionClosing(); region.batchMutate(indexUpdates.toArray(new Mutation[indexUpdates.size()]), HConstants.NO_NONCE, HConstants.NO_NONCE); } batchSize = 0; indexUpdates = new ArrayList<Mutation>(maxBatchSize); for (Mutation mutation : indexRowsToBeDeleted) { indexUpdates.add(mutation); batchSize ++; if (batchSize >= maxBatchSize) { ungroupedAggregateRegionObserver.checkForRegionClosing(); region.batchMutate(indexUpdates.toArray(new Mutation[indexUpdates.size()]), HConstants.NO_NONCE, HConstants.NO_NONCE); batchSize = 0; indexUpdates = new ArrayList<Mutation>(maxBatchSize); } } if (batchSize > 0) { ungroupedAggregateRegionObserver.checkForRegionClosing(); region.batchMutate(indexUpdates.toArray(new Mutation[indexUpdates.size()]), HConstants.NO_NONCE, HConstants.NO_NONCE); <END> } if (verify) { verificationResult.setRebuiltIndexRowCount(verificationResult.getRebuiltIndexRowCount() + indexMutationMap.size()); } } catch (Throwable t) { ServerUtil.throwIOException(region.getRegionInfo().getRegionNameAsString(), t); } }</code><technical_language>I feel logic of checking if region is closed sending mutations is duplicated in multiple places move a function reduce code duplication</technical_language>

Target:
protected void repairIndexRows(Map<byte[], List<Mutation>> indexMutationMap, List<Mutation> indexRowsToBeDeleted, IndexToolVerificationResult verificationResult) throws IOException { updateIndexRows(indexMutationMap, indexRowsToBeDeleted, verificationResult); }
Source:
<code>public String[] getFilePaths(RepoObject repoObject) throws RepoException { <START> String[] paths = null; <END> String s3Url = s3Client.getResourceUrl(repoObject.getBucketName(), repoObject.getChecksum()); if(s3Url != null){ paths = new String[]{s3Url}; } return paths; }</code><technical_language>wrong here, nice consistent return null string array of size 0 other functions (in other classes)</technical_language>

Target:
public String[] getFilePaths(RepoObject repoObject) throws RepoException { String s3Url = s3Client.getResourceUrl(repoObject.getBucketName(), repoObject.getChecksum()); if (s3Url == null) { throw new RepoException(RepoException.Type.ObjectFilePathMissing); } return new String[]{s3Url}; }
Source:
<code>public void validatePatchRequest(JsonNode payload){ List<String> pathCheck = requestValidator.checkIfExistsOrEmpty(payload, FIELD_OPERATION, FIELD_OPERATION_PATH); if(!pathCheck.isEmpty()) throw new ValidationException(pathCheck); String path = payload.findValue(FIELD_OPERATION_PATH).asText().toLowerCase(); if(!VALID_PATHS.contains(path)) throw new ValidationException(Collections.singletonList(format("Operation [%s] not supported for path [%s]", FIELD_OPERATION, path))); switch (path) { case FIELD_NOTIFY_SETTINGS: validateNotifySettingsRequest(payload); break; case FIELD_EMAIL_COLLECTION_MODE: validateEmailCollectionMode(payload); break; case FIELD_ALLOW_WEB_PAYMENTS: validateAllowWebPayment(payload); break; case FIELD_COPORATE_CREDIT_CARD_SURCHARGE_AMOUNT: case FIELD_COPORATE_DEBIT_CARD_SURCHARGE_AMOUNT: case FIELD_COPORATE_PREPAID_CREDIT_CARD_SURCHARGE_AMOUNT: case FIELD_COPORATE_PREPAID_DEBIT_CARD_SURCHARGE_AMOUNT: <START> validateCorporateSurchargePayLoad(payload); break; <END> } }</code><technical_language>this case statement spans lines, I time this switch align more conventional format: java switch (path) { case FIELD_NOTIFY_SETTINGS: validateNotifySettingsRequest(payload); break; case FIELD_EMAIL_COLLECTION_MODE: // }</technical_language>

Target:
public void validatePatchRequest(JsonNode payload){ List<String> pathCheck = requestValidator.checkIfExistsOrEmpty(payload, FIELD_OPERATION, FIELD_OPERATION_PATH); if(!pathCheck.isEmpty()) throw new ValidationException(pathCheck); String path = payload.findValue(FIELD_OPERATION_PATH).asText().toLowerCase(); if(!VALID_PATHS.contains(path)) throw new ValidationException(Collections.singletonList(format("Operation [%s] not supported for path [%s]", FIELD_OPERATION, path))); switch (path) { case FIELD_NOTIFY_SETTINGS: validateNotifySettingsRequest(payload); break; case FIELD_EMAIL_COLLECTION_MODE: validateEmailCollectionMode(payload); break; case FIELD_ALLOW_WEB_PAYMENTS: validateAllowWebPayment(payload); break; case FIELD_CORPORATE_CREDIT_CARD_SURCHARGE_AMOUNT: case FIELD_CORPORATE_DEBIT_CARD_SURCHARGE_AMOUNT: case FIELD_CORPORATE_PREPAID_CREDIT_CARD_SURCHARGE_AMOUNT: case FIELD_CORPORATE_PREPAID_DEBIT_CARD_SURCHARGE_AMOUNT: validateCorporateCardSurchargePayload(payload); break; } }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } <START> return false; <END> }</code><technical_language>Is a reason equals method is fully implemented? returning false for separate object instances description value, return true. IDE able generate for you</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final ID3v2TXXXFrameData other = (ID3v2TXXXFrameData) obj; if (!Objects.equals(this.description, other.description)) { return false; } if (!Objects.equals(this.value, other.value)) { return false; } return true; }
Source:
<code>public SequencerReference get(long id) throws IOException { SequencerReference sr = (SequencerReference) currentSession().get(SequencerReferenceImpl.class, id); SequencerReference preUpgradeSR = getByUpgradedReference(id); if (preUpgradeSR != null) { <START> sr.setPreUpgradeSequencerReference(preUpgradeSR); <END> } return sr; }</code><technical_language>Consider making this relationship unidirectional instead of preUpgradeSequencerReference. is useful (only edit sequencer page think)</technical_language>

Target:
public SequencerReference get(long id) throws IOException { return (SequencerReference) currentSession().get(SequencerReferenceImpl.class, id); }
Source:
<code>public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Pair pair = (Pair) o; if (x != pair.x) return false; <START> return y == pair.y; <END> }</code><technical_language>this return x == pair.x && y == pair.y</technical_language>

Target:
public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Pair pair = (Pair) o; return x == pair.x && y == pair.y; }
Source:
<code>public HttpResponse doDoWipeOutWorkspace() throws IOException, ServletException, InterruptedException { checkPermission(Functions.isWipeOutPermissionEnabled() ? WIPEOUT : BUILD); FilePath ws = getSomeWorkspace(); if (ws!=null) { <START> ws.deleteRecursive(); <END> for (WorkspaceListener wl : WorkspaceListener.all()) { wl.afterDelete(this); } return new HttpRedirect("."); } else { return new ForwardToView(this,"wipeOutWorkspaceBlocked.jelly"); } }</code><technical_language>else virtues of this PR (and a test proving fixes desirable), removal of call processWorkspaceBeforeDeletion means is causing _some_ regression</technical_language>

Target:
public HttpResponse doDoWipeOutWorkspace() throws IOException, ServletException, InterruptedException { checkPermission(Functions.isWipeOutPermissionEnabled() ? WIPEOUT : BUILD); R b = getSomeBuildWithWorkspace(); FilePath ws = b!=null ? b.getWorkspace() : null; if (ws!=null && getScm().processWorkspaceBeforeDeletion(this, ws, b.getBuiltOn())) { ws.deleteRecursive(); for (WorkspaceListener wl : WorkspaceListener.all()) { wl.afterDelete(this); } return new HttpRedirect("."); } else { return new ForwardToView(this,"wipeOutWorkspaceBlocked.jelly"); } }