auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testMoveFromServerInMaintenance() { mockDruidServer(druidServer1, "1", "normal", 30L, 100L, segments); mockDruidServer(druidServer2, "2", "normal", 0L, 100L, Collections.emptyMap()); replay(druidServer3); replay(druidServer4); mockCoordinator(coordinator); ServerHolder holder2 = new ServerHolder(druidServer2, peon2, false); BalancerStrategy strategy = EasyMock.createMock(BalancerStrategy.class); EasyMock.expect(strategy.pickSegmentToMove(anyObject())).andReturn(new BalancerSegmentHolder(druidServer1, segment1)).once(); EasyMock.expect(strategy.findNewSegmentHomeBalancer(anyObject(), anyObject())).andReturn(holder2).once(); replay(strategy); DruidCoordinatorRuntimeParams params = defaultRuntimeParamsBuilder( ImmutableList.of(druidServer1, druidServer2), ImmutableList.of(peon1, peon2), ImmutableList.of(true, false) ) .withDynamicConfigs( <START> CoordinatorDynamicConfig.builder().withMaxSegmentsToMove( <END> 1 ).build() ) .withBalancerStrategy(strategy) .build(); params = new DruidCoordinatorBalancerTester(coordinator).run(params); Assert.assertEquals(1, params.getCoordinatorStats().getTieredStat("movedCount", "normal")); Assert.assertEquals(0, peon1.getNumberOfSegmentsInQueue()); Assert.assertEquals(1, peon2.getNumberOfSegmentsInQueue()); }</code><technical_language>Unnecessary breakdown</technical_language>

Target:
public void testMoveFromServerInMaintenance() { mockDruidServer(druidServer1, "1", "normal", 30L, 100L, segments); mockDruidServer(druidServer2, "2", "normal", 0L, 100L, Collections.emptyList()); replay(druidServer3); replay(druidServer4); mockCoordinator(coordinator); ServerHolder holder2 = new ServerHolder(druidServer2, peon2, false); BalancerStrategy strategy = EasyMock.createMock(BalancerStrategy.class); EasyMock.expect(strategy.pickSegmentToMove(anyObject())) .andReturn(new BalancerSegmentHolder(druidServer1, segment1)) .once(); EasyMock.expect(strategy.findNewSegmentHomeBalancer(anyObject(), anyObject())).andReturn(holder2).once(); replay(strategy); DruidCoordinatorRuntimeParams params = defaultRuntimeParamsBuilder( ImmutableList.of(druidServer1, druidServer2), ImmutableList.of(peon1, peon2), ImmutableList.of(true, false) ) .withDynamicConfigs(CoordinatorDynamicConfig.builder().withMaxSegmentsToMove(1).build()) .withBalancerStrategy(strategy) .build(); params = new DruidCoordinatorBalancerTester(coordinator).run(params); Assert.assertEquals(1, params.getCoordinatorStats().getTieredStat("movedCount", "normal")); Assert.assertEquals(0, peon1.getNumberOfSegmentsInQueue()); Assert.assertEquals(1, peon2.getNumberOfSegmentsInQueue()); }
Source:
<code>private ProbeBuilderImpl withMetricTag(String metricName) { <START> return withTag("metric", prefixedMetricName(metricName), true); <END> }</code><technical_language>I name tag. metric compressor skips N chars identical N chars of recorded metric. thinking more this, sorting goals here: 1) supports metric compressor. I order supports is name,unit,metric (what initially order). 2) improves readability of diagnostics logs name,metric,unit. feels sorting concern of MetricsPlugin tokenizing tags</technical_language>

Target:
private ProbeBuilderImpl withMetricTag(String metricName) { return withTag("metric", metricNamePrefix != null ? metricNamePrefix + '.' + metricName : metricName); }
Source:
<code>public static void fireOnCreated(@Nonnull Node node) { for (NodeListener nl: all()) { <START> nl.onCreated(node); <END> } }</code><technical_language>practice: Handle RuntimeExceptions coming implementations, suppress log them. plugin break other instances && node replacement flow</technical_language>

Target:
public static void fireOnCreated(@Nonnull Node node) { for (NodeListener nl: all()) { try { nl.onCreated(node); } catch (Throwable ex) { LOGGER.log(Level.WARNING, "Listener invocation failed", ex); } } }
Source:
<code>protected String composeUniqueNodeName(final String name) { final String originalName = Optional.ofNullable(name).orElse(""); try { final MatchResult nameSuffixMatcher = NAME_SUFFIX_REGEX.exec(originalName); if (nameSuffixMatcher != null) { return buildNameWithIncrementedSuffixIndex(originalName, nameSuffixMatcher); } <START> } catch (Exception e) { <END> LOGGER.warning("There was an issue while parsing node with name " + originalName + " - A fallback will be used for it"); } return joinPrefixWithIndexedSuffix(originalName); }</code><technical_language>Small suggestion investigate avoid a generic exception hard inspect if happen if exec throw exception IndexOutOfBounds buildNameWithIncrementedSuffixIndex throw some exception(bcs skipped)</technical_language>

Target:
protected String composeUniqueNodeName(final String name) { final String originalName = Optional.ofNullable(name).orElse(""); final MatchResult nameSuffixMatcher = NAME_SUFFIX_REGEX.exec(originalName); if (nameSuffixMatcher != null) { return buildNameWithIncrementedSuffixIndex(originalName, nameSuffixMatcher); } return joinPrefixWithIndexedSuffix(originalName); }
Source:
<code>public void endWindow() { try { if (currentWindowId > windowManager.getLargestRecoveryWindow()) { if (currentWindowRecoveryState == null) { currentWindowRecoveryState = new MutablePair<Integer, Integer>(); } MutablePair<Integer, Integer> windowBoundaryPair = new MutablePair<>(lowerBound, lastEmittedRecord); currentWindowRecoveryState = windowBoundaryPair; windowManager.save(currentWindowRecoveryState, operatorId, currentWindowId); } } catch (IOException e) { throw new RuntimeException("saving recovery", e); } <START> currentWindowRecoveryState = new MutablePair<>(); <END> }</code><technical_language>removed</technical_language>

Target:
public void endWindow() { try { if (currentWindowId > windowManager.getLargestRecoveryWindow()) { currentWindowRecoveryState = new MutablePair<>(lowerBound, lastEmittedRow); windowManager.save(currentWindowRecoveryState, operatorId, currentWindowId); } } catch (IOException e) { throw new RuntimeException("saving recovery", e); } if (threadException != null) { store.disconnect(); DTThrowable.rethrow(threadException.get()); } }
Source:
<code>public static void Init() { mUpdateVmsStatic = new ObjectIdentityChecker(VmHandler.class, Arrays.asList(new String[] { "VM", "VmStatic", "VmDynamic" }), VMStatus.class); mUpdateVmsStatic.AddPermittedFields(new String[] { "vmName", "description", "domain", "os", "osType", "creationDate", "numOfMonitors", "allowConsoleReconnect", "usbPolicy", "autoSuspend", "autoStartup", "dedicatedVmForVds", "defaultDisplayType", "priority", "defaultBootSequence", "initrdUrl", "kernelUrl", "kernelParams", "migrationSupport", "minAllocatedMem", "quotaId", "quotaName", "quotaEnforcementType", "cpuPinning", "vmPayload", "balloonEnabled", "smartcardEnabled","deleteProtected","dbGeneration", "images", "interfaces", "useHostCpuFlags", "quotaDefault", <START> "vncKeyboardLayout" <END> }); mUpdateVmsStatic.AddFields( Arrays.asList(new Enum<?>[] { VMStatus.Down }), Arrays.asList(new String[] { "vdsGroupId", "timeZone", "stateless", "niceLevel", "memSizeMb", "numOfSockets", "cpuPerSocket", "isoPath", "userDefinedProperties", "predefinedProperties", "customProperties" })); }</code><technical_language>this, if field is added here, user update while vm is running, is in createVm, if user change running vm, change "dynamicaly" add list below, of fields allowed update vm is</technical_language>

Target:
public static void Init() { mUpdateVmsStatic = new ObjectIdentityChecker(VmHandler.class, Arrays.asList(new String[] { "VM", "VmStatic", "VmDynamic" }), VMStatus.class); mUpdateVmsStatic.AddPermittedFields(new String[] { "vmName", "description", "domain", "os", "osType", "creationDate", "allowConsoleReconnect", "usbPolicy", "autoSuspend", "autoStartup", "dedicatedVmForVds", "priority", "defaultBootSequence", "initrdUrl", "kernelUrl", "kernelParams", "migrationSupport", "minAllocatedMem", "quotaId", "quotaName", "quotaEnforcementType", "cpuPinning", "vmPayload", "balloonEnabled", "smartcardEnabled","deleteProtected","dbGeneration", "images", "interfaces", "useHostCpuFlags", "quotaDefault", "tunnelMigration" }); mUpdateVmsStatic.AddFields( Arrays.asList(new Enum<?>[] { VMStatus.Down }), Arrays.asList(new String[] { "vdsGroupId", "timeZone", "stateless", "niceLevel", "memSizeMb", "numOfSockets", "cpuPerSocket", "isoPath", "userDefinedProperties", "predefinedProperties", "customProperties", "defaultDisplayType", "numOfMonitors", "vncKeyboardLayout" })); }
Source:
<code>private List<TriggerEventRequest> buildCohortQueryTriggers(String configName) { List<TriggerEventRequest> triggers = new ArrayList<>(); List<EventParameterRequest> parameterRequests = new ArrayList<>(); parameterRequests.add(new EventParameterRequest(DisplayNames.PERSON_UUID, Keys.PATIENT_UUID)); parameterRequests.add(new EventParameterRequest(DisplayNames.PATIENT_DISPLAY, Keys.PATIENT_DISPLAY)); parameterRequests.add(new EventParameterRequest(DisplayNames.COHORTQUERY_UUID, Keys.COHORT_QUERY_UUID)); String displayName = DisplayNameHelper.buildDisplayName(DisplayNames.COHORT_REPORTMEMBER, configName); <START> triggers.add(new TriggerEventRequest(displayName, EventKeys.BASE_SUBJECT + "Cohort.ReportMember", null, parameterRequests)); <END> return triggers; }</code><technical_language>constant for event subject</technical_language>

Target:
private List<TriggerEventRequest> buildCohortQueryTriggers(String configName) { List<TriggerEventRequest> triggers = new ArrayList<>(); List<EventParameterRequest> parameterRequests = new ArrayList<>(); parameterRequests.add(new EventParameterRequest(DisplayNames.PERSON_UUID, Keys.PATIENT_UUID)); parameterRequests.add(new EventParameterRequest(DisplayNames.PATIENT_DISPLAY, Keys.PATIENT_DISPLAY)); parameterRequests.add(new EventParameterRequest(DisplayNames.COHORTQUERY_UUID, Keys.COHORT_QUERY_UUID)); String displayName = DisplayNameHelper.buildDisplayName(DisplayNames.COHORT_REPORTMEMBER, configName); triggers.add(new TriggerEventRequest(displayName, EventSubjects.GET_COHORT_QUERY_MEMBER_EVENT, null, parameterRequests)); return triggers; }
Source:
<code>public <E extends Throwable> void expectErrorWithMessage(Class<E> expected, List<String> requiredMessagePartAlternatives) throws Exception { <START> expectErrorWithMessage(expected, requiredMessagePartAlternatives, env.defaultTimeoutMillis(), env.defaultPollTimeoutMillis); <END> }</code><technical_language>env.defaultPollTimeoutMillis()</technical_language>

Target:
public <E extends Throwable> void expectErrorWithMessage(Class<E> expected, List<String> requiredMessagePartAlternatives) throws Exception { expectErrorWithMessage(expected, requiredMessagePartAlternatives, env.defaultTimeoutMillis(), env.defaultPollTimeoutMillis()); }
Source:
<code>public TaskStatus run(final TaskToolbox toolbox) throws Exception { if (indexTaskSpecs == null) { indexTaskSpecs = createIngestionSchema( toolbox, segmentProvider, dimensionsSpec, keepSegmentGranularity, tuningConfig, jsonMapper ).stream() .map(spec -> new IndexTask( getId(), getGroupId(), getTaskResource(), getDataSource(), spec, getContext(), authorizerMapper, chatHandlerProvider, rowIngestionMetersFactory )) .collect(Collectors.toList()); } if (indexTaskSpecs.isEmpty()) { log.warn("Interval[%s] has no segments, nothing to do.", interval); return TaskStatus.failure(getId()); } else { <START> log.info("Generated [%d] compaction task specs: ", indexTaskSpecs.size()); <END> for (IndexTask eachSpec : indexTaskSpecs) { final String json = jsonMapper.writerWithDefaultPrettyPrinter().writeValueAsString(eachSpec); log.info("Running indexSpec: " + json); final TaskStatus eachResult = eachSpec.run(toolbox); if (!eachResult.isSuccess()) { log.warn("Running indexSpec failed. Trying to the next indexSpec."); } } return TaskStatus.success(getId()); } }</code><technical_language>I get rid of trailing colon, is coming it</technical_language>

Target:
public TaskStatus run(final TaskToolbox toolbox) throws Exception { if (indexTaskSpecs == null) { indexTaskSpecs = createIngestionSchema( toolbox, segmentProvider, dimensionsSpec, keepSegmentGranularity, tuningConfig, jsonMapper ).stream() .map(spec -> new IndexTask( getId(), getGroupId(), getTaskResource(), getDataSource(), spec, getContext(), authorizerMapper, chatHandlerProvider, rowIngestionMetersFactory )) .collect(Collectors.toList()); } if (indexTaskSpecs.isEmpty()) { log.warn("Interval[%s] has no segments, nothing to do.", interval); return TaskStatus.failure(getId()); } else { log.info("Generated [%d] compaction task specs", indexTaskSpecs.size()); for (IndexTask eachSpec : indexTaskSpecs) { final String json = jsonMapper.writerWithDefaultPrettyPrinter().writeValueAsString(eachSpec); log.info("Running indexSpec: " + json); try { final TaskStatus eachResult = eachSpec.run(toolbox); if (!eachResult.isSuccess()) { log.warn("Failed to run indexSpec: [%s].\nTrying the next indexSpec.", json); } } catch (Exception e) { log.warn(e, "Failed to run indexSpec: [%s].\nTrying the next indexSpec.", json); } } return TaskStatus.success(getId()); } }
Source:
<code>public void reportJobCompletion(String pluginId, String elasticAgentId, JobIdentifier jobIdentifier) { VersionedElasticAgentExtension elasticAgentExtension = getVersionedElasticAgentExtension(pluginId); <START> if (elasticAgentExtension.getExtensionVersion() != VERSION_NOT_SUPPORTING_JOB_COMPLETION_REQUEST) { <END> elasticAgentExtension.jobCompletion(pluginId, elasticAgentId, jobIdentifier); } }</code><technical_language>@GaneshSPatil - This call is supported decided versioned extension classes, delegator</technical_language>

Target:
public void reportJobCompletion(String pluginId, String elasticAgentId, JobIdentifier jobIdentifier) { VersionedElasticAgentExtension elasticAgentExtension = getVersionedElasticAgentExtension(pluginId); elasticAgentExtension.jobCompletion(pluginId, elasticAgentId, jobIdentifier); }
Source:
<code>void thread2() { int[] vs1; synchronized (lock) { vs1 = values; state = 1; } int s; do { synchronized (lock) { s = state; } } while (s != 2); int[] vs2; <START> synchronized (lock) { <END> vs2 = values; } int v1 = vs1[0]; int v2 = vs2[0]; System.out.println("b17689750TestMonitor failed: " + v1 + ", " + v2); }</code><technical_language>I delete this synchronized block. Values modified while reading state 2. OK move prior accesses values synchronized blocks currently in, a test that</technical_language>

Target:
void thread2() { int[] vs1; synchronized (lock) { vs1 = values; state = 1; } int s; do { synchronized (lock) { s = state; } } while (s != 2); int[] vs2 = values; int v1 = vs1[0]; int v2 = vs2[0]; System.out.println("b17689750TestMonitor failed: " + v1 + ", " + v2); }
Source:
<code>private void validate(ClientDescriptor clientDescriptor, ValidateStoreManager message) throws ClusterException { validateClientConnected(clientDescriptor); <START> UUID clientId = clientStateMap.get(clientDescriptor).getClientIdentifier(); <END> if (clientId != null) { throw new LifecycleException("Client : " + clientDescriptor + " is already being tracked with Client Id : " + clientId); } if (getTrackedClients().contains(message.getClientId())) { throw new InvalidClientIdException("Client ID : " + message.getClientId() + " is already being tracked."); } ehcacheStateService.validate(message.getConfiguration()); management.clientValidated(clientDescriptor, this.clientStateMap.get(clientDescriptor)); }</code><technical_language>is set of reconnect path</technical_language>

Target:
private void validate(ClientDescriptor clientDescriptor, ValidateStoreManager message) throws ClusterException { validateClientConnected(clientDescriptor); ClientState clientState = clientStateMap.get(clientDescriptor); UUID clientId = clientState.getClientIdentifier(); if (clientId != null) { throw new LifecycleException("Client : " + clientDescriptor + " is already being tracked with Client Id : " + clientId); } if (getTrackedClients().contains(message.getClientId())) { throw new InvalidClientIdException("Client ID : " + message.getClientId() + " is already being tracked."); } ehcacheStateService.validate(message.getConfiguration()); clientState.attach(message.getClientId()); management.clientValidated(clientDescriptor, clientState); }
Source:
<code>public void setup() { String tpch = "tpch"; session = testSessionBuilder() .setCatalog(tpch) .setSchema("sf1000") .setSystemProperty("iterative_optimizer_enabled", iterativeOptimizerEnabled) .build(); queryRunner = new LocalQueryRunner(session); <START> queryRunner.createCatalog(tpch, new TpchConnectorFactory(4), ImmutableMap.of("tpch.column-naming", "standard")); <END> queries = IntStream.rangeClosed(1, 22) .boxed() .filter(i -> i != 15) .map(i -> readResource(String.format("/io/airlift/tpch/queries/q%d.sql", i))) .collect(toImmutableList()); }</code><technical_language>Benchmarking planning for queries is big unit of measure. all, this is micro benchmark framework. big test unit hard catch regressions for individual queries. Instead query number a @Param, planning time for query</technical_language>

Target:
public void setup() { String tpch = "tpch"; session = testSessionBuilder() .setCatalog(tpch) .setSchema("sf1") .setSystemProperty("iterative_optimizer_enabled", iterativeOptimizerEnabled) .build(); queryRunner = new LocalQueryRunner(session); queryRunner.createCatalog(tpch, new TpchConnectorFactory(4), ImmutableMap.of("tpch.column-naming", "standard")); queries = IntStream.rangeClosed(1, 22) .boxed() .filter(i -> i != 15) .map(i -> readResource(String.format("/io/airlift/tpch/queries/q%d.sql", i))) .collect(toImmutableList()); }
Source:
<code>public static synchronized void writeToOneWire(String pvDevicePropertyPath, String pvValue) { int lvAttempt = 1; while (lvAttempt <= cvRetry) { try { logger.debug("Trying to write '{}' to '{}', write attempt={}", <START> new Object[] { pvValue, pvDevicePropertyPath, lvAttempt }); <END> if (checkIfDeviceExists(pvDevicePropertyPath)) { OneWireConnection.getConnection().write(pvDevicePropertyPath, pvValue); return; } else { logger.info("There is no device for path {}, write attempt={}", new Object[] { pvDevicePropertyPath, lvAttempt }); } } catch (OwfsException oe) { logger.error("Writing to path attempt threw an exception", pvValue, pvDevicePropertyPath, lvAttempt, oe); reconnect(); } catch (IOException ioe) { logger.error("Couldn't establish network connection while write attempt to '{}'" + " ip:port={}:{}", lvAttempt, pvDevicePropertyPath, cvIp, cvPort, ioe); reconnect(); } finally { lvAttempt++; } } }</code><technical_language>Instead of new Object [], pass object args, decrease object instantiation/garbage collection</technical_language>

Target:
public static synchronized void writeToOneWire(String pvDevicePropertyPath, String pvValue) { int lvAttempt = 1; while (lvAttempt <= cvRetry) { try { logger.debug("Trying to write '{}' to '{}', write attempt={}", pvValue, pvDevicePropertyPath, lvAttempt); if (checkIfDeviceExists(pvDevicePropertyPath)) { OneWireConnection.getConnection().write(pvDevicePropertyPath, pvValue); return; } else { logger.info("There is no device for path {}, write attempt={}", pvDevicePropertyPath, lvAttempt); } } catch (OwfsException oe) { logger.error("Writing to path attempt threw an exception", pvValue, pvDevicePropertyPath, lvAttempt, oe); reconnect(); } catch (IOException ioe) { logger.error("Couldn't establish network connection while write attempt to '{}'" + " ip:port={}:{}", lvAttempt, pvDevicePropertyPath, cvIp, cvPort, ioe); reconnect(); } finally { lvAttempt++; } } }
Source:
<code>private Color getBgColor() { ColorRegistry colorRegistry = JFaceResources.getColorRegistry(); Color bg = colorRegistry.get(INFORMATION_BACKGROUND_COLOR); if (bg == null) { <START> bg = JFaceColors.getInformationViewerForegroundColor(this.getDisplay()); <END> } return bg; }</code><technical_language>this JFaceColors.getInformationViewerBackgroundColor instead</technical_language>

Target:
private Color getBgColor() { ColorRegistry colorRegistry = JFaceResources.getColorRegistry(); Color bg = colorRegistry.get(INFORMATION_BACKGROUND_COLOR); if (bg == null) { bg = getInformationViewerBackgroundColor(this.getDisplay()); } return bg; }
Source:
<code>public boolean setInitialDelay(DebugContext context, IProgressMonitor monitor) throws CoreException { monitor.subTask(NLS.bind("Setting liveness probe initial delay to {0}", INITIAL_DELAY)); IProbe probe = getLivenessProbe(dc); if (probe == null) { return false; } int initialDelay = probe.getInitialDelaySeconds(); <START> if (initialDelay >= INITIAL_DELAY) { <END> OpenShiftServerUtils.setLivenessProbeInitialDelay(initialDelay, context.getServer()); return false; } probe.setInitialDelaySeconds(INITIAL_DELAY); return true; }</code><technical_language>I understand rationale for this case save original annotation in deployment config</technical_language>

Target:
public boolean setInitialDelay(DebugContext context, IProgressMonitor monitor) throws CoreException { monitor.subTask(NLS.bind("Setting liveness probe initial delay to {0}", INITIAL_DELAY)); IProbe probe = getLivenessProbe(dc); if (probe == null) { return false; } int initialDelay = probe.getInitialDelaySeconds(); if (initialDelay >= INITIAL_DELAY) { return false; } OpenShiftServerUtils.setLivenessProbeInitialDelay(initialDelay, context.getServer()); probe.setInitialDelaySeconds(INITIAL_DELAY); return true; }
Source:
<code>public void testStop() throws Exception { CountDownLatch latch = new CountDownLatch(1); DummyServlet servlet = new DummyServlet(Optional.of(latch)); createAndStartServer(servlet); try (HttpClient client = new JettyHttpClient()) { URI uri = URI.create(httpServerInfo.getHttpUri().toASCIIString()); Request request = prepareGet().setUri(uri).build(); HttpResponseFuture<?> future = client.executeAsync(request, createStatusResponseHandler()); while (servlet.getRequestsReceived() == 0) { Thread.sleep(100); } server.stop(); <START> latch.countDown(); <END> try { future.get(5, SECONDS); fail("expected exception"); } catch (ExecutionException e) { assertInstanceOf(e.getCause(), UncheckedIOException.class); } } }</code><technical_language>put a sleep(100) this stop a chance kick in (since server is multithreaded)</technical_language>

Target:
public void testStop() throws Exception { CountDownLatch requestActive = new CountDownLatch(1); DummyServlet servlet = new DummyServlet(requestActive); createAndStartServer(servlet); try (HttpClient client = new JettyHttpClient()) { URI uri = URI.create(httpServerInfo.getHttpUri().toASCIIString() + "/?sleep=50000"); Request request = prepareGet().setUri(uri).build(); HttpResponseFuture<?> future = client.executeAsync(request, createStatusResponseHandler()); requestActive.await(); server.stop(); server.join(); try { future.get(5, SECONDS); throw new AssertionError("expected request to fail", servlet.getException()); } catch (ExecutionException e) { assertInstanceOf(e.getCause(), UncheckedIOException.class); } } }
Source:
<code>public T remove(final int index) { try { return this.origin.remove(index); } catch (final IndexOutOfBoundsException ex) { <START> throw new IllegalArgumentException(this.message, ex); <END> } }</code><technical_language>@Happy-Neko here, IndexOutOfBoundsException custom message</technical_language>

Target:
public T remove(final int index) { try { return this.origin.remove(index); } catch (final IndexOutOfBoundsException ex) { throw this.wrapException(ex); } }
Source:
<code>private String convertToMegaBytes(long bytes) { <START> int oneKiloByte = 1024; <END> return String.valueOf(bytes / oneKiloByte / oneKiloByte) + " MB"; }</code><technical_language>a convention for constants? <LINK_0></technical_language>

Target:
private String convertToMegaBytes(long bytes) { final int ONE_KILO_BYTE = 1024; return String.valueOf(bytes / ONE_KILO_BYTE / ONE_KILO_BYTE) + " MB"; }
Source:
<code>protected DMNModel retrieveDMNModel(DMNRuntime dmnRuntime) { if(namespace != null && modelName != null) { return Optional .ofNullable(dmnRuntime.getModel(namespace, modelName)) .orElseThrow(() -> new IllegalStateException("Cannot find a DMN model with namespace=" + namespace + " and modelName=" + modelName)); } else if(resourcePath != null) { return dmnRuntime.getModels().stream() .filter(model -> Objects.equals(resourcePath, model.getResource().getSourcePath())) .findFirst() .orElseThrow(() -> new IllegalStateException("Cannot find a DMN model with resource=" + resourcePath)); } <START> throw new IllegalStateException("This should not happen"); <END> }</code><technical_language>I this moved here, please change error message here. This anything. E.g. "Cannot retrieve model! Resource path model name is set properly."</technical_language>

Target:
protected DMNModel retrieveDMNModel(DMNRuntime dmnRuntime) { if(namespace != null && modelName != null) { return Optional .ofNullable(dmnRuntime.getModel(namespace, modelName)) .orElseThrow(() -> new IllegalStateException("Cannot find a DMN model with namespace=" + namespace + " and modelName=" + modelName)); } else if(resourcePath != null) { return dmnRuntime.getModels().stream() .filter(model -> Objects.equals(resourcePath, model.getResource().getSourcePath())) .findFirst() .orElseThrow(() -> new IllegalStateException("Cannot find a DMN model with resource=" + resourcePath)); } throw new IllegalStateException("Both resourcePath and namespace+modelName are not set, this should not happen"); }
Source:
<code><START> private static RelNode toIndexJoin(VoltPhysicalJoin join, RelNode outerScan, RelNode innerChild, String indexName) { <END> return new VoltPhysicalNestLoopIndexJoin( join.getCluster(), join.getTraitSet(), outerScan, innerChild, join.getCondition(), join.getVariablesSet(), join.getJoinType(), join.isSemiJoinDone(), ImmutableList.copyOf(join.getSystemFieldList()), join.getSplitCount(), indexName); }</code><technical_language>Join type check consolidated in logical phase</technical_language>

Target:
private static RelNode toIndexJoin(VoltPhysicalJoin join, RelNode outerScan, RelNode innerChild, String indexName) { return new VoltPhysicalNestLoopIndexJoin( join.getCluster(), join.getTraitSet(), outerScan, innerChild, join.getCondition(), join.getVariablesSet(), join.getJoinType(), join.isSemiJoinDone(), ImmutableList.copyOf(join.getSystemFieldList()), indexName); }
Source:
<code>public Object getPropertyValue(Object id) { if (sfName.equals(id)) { return getName(); } if (sfPath.equals(id)) { return getPath().toString(); } if (sfLocation.equals(id)) { return getLocation().toString(); } if (sfExperimentType.equals(id)) { if (getTraceType() != null) { IConfigurationElement ce = sfTraceTypeAttributes.get(getTraceType()); <START> return (ce != null) ? (getCategory(ce) + ':' + ce.getAttribute(TmfTraceType.NAME_ATTR)) : new String(); <END> } } return null; }</code><technical_language>In Properties view, selecting a generic experiment shows type [no category]:Generic Experiment. I good show Generic Experiment. do think</technical_language>

Target:
public Object getPropertyValue(Object id) { if (sfName.equals(id)) { return getName(); } if (sfPath.equals(id)) { return getPath().toString(); } if (sfLocation.equals(id)) { return getLocation().toString(); } if (sfExperimentType.equals(id)) { if (getTraceType() != null) { IConfigurationElement ce = sfTraceTypeAttributes.get(getTraceType()); if (ce == null) { return ""; } String categoryId = ce.getAttribute(TmfTraceType.CATEGORY_ATTR); if (categoryId != null) { IConfigurationElement category = sfTraceCategories.get(categoryId); if (category != null) { return category.getAttribute(TmfTraceType.NAME_ATTR) + ':' + ce.getAttribute(TmfTraceType.NAME_ATTR); } } return ce.getAttribute(TmfTraceType.NAME_ATTR); } } return null; }
Source:
<code>if (!IgniteSystemProperties.getBoolean(IGNITE_JETTY_LOG_NO_OVERRIDE)) { <START> Properties p = new Properties(); <END> System.setProperty("org.eclipse.jetty.LEVEL", "WARN"); System.setProperty("org.eclipse.jetty.util.log.LEVEL", "OFF"); System.setProperty("org.eclipse.jetty.util.component.LEVEL", "OFF"); try { Class<?> logCls = Class.forName("org.apache.log4j.Logger"); String ctgrJetty = "org.eclipse.jetty"; String ctgrJettyUtil = "org.eclipse.jetty.util.log"; String ctgrJettyUtilComp = "org.eclipse.jetty.util.component"; Object logJetty = logCls.getMethod("getLogger", String.class).invoke(logCls, ctgrJetty); Object logJettyUtil = logCls.getMethod("getLogger", String.class).invoke(logCls, ctgrJettyUtil); Object logJettyUtilComp = logCls.getMethod("getLogger", String.class).invoke(logCls, ctgrJettyUtilComp); Class<?> lvlCls = Class.forName("org.apache.log4j.Level"); Object warnLvl = lvlCls.getField("WARN").get(null); Object errLvl = lvlCls.getField("ERROR").get(null); logJetty.getClass().getMethod("setLevel", lvlCls).invoke(logJetty, warnLvl); logJettyUtil.getClass().getMethod("setLevel", lvlCls).invoke(logJetty, errLvl); logJettyUtilComp.getClass().getMethod("setLevel", lvlCls).invoke(logJetty, errLvl); } catch (Exception ignored) { } }</code><technical_language>left unused</technical_language>

Target:
if (!IgniteSystemProperties.getBoolean(IGNITE_JETTY_LOG_NO_OVERRIDE)) { System.setProperty("org.eclipse.jetty.LEVEL", "WARN"); System.setProperty("org.eclipse.jetty.util.log.LEVEL", "OFF"); System.setProperty("org.eclipse.jetty.util.component.LEVEL", "OFF"); try { Class<?> logCls = Class.forName("org.apache.log4j.Logger"); String ctgrJetty = "org.eclipse.jetty"; String ctgrJettyUtil = "org.eclipse.jetty.util.log"; String ctgrJettyUtilComp = "org.eclipse.jetty.util.component"; Object logJetty = logCls.getMethod("getLogger", String.class).invoke(logCls, ctgrJetty); Object logJettyUtil = logCls.getMethod("getLogger", String.class).invoke(logCls, ctgrJettyUtil); Object logJettyUtilComp = logCls.getMethod("getLogger", String.class).invoke(logCls, ctgrJettyUtilComp); Class<?> lvlCls = Class.forName("org.apache.log4j.Level"); Object warnLvl = lvlCls.getField("WARN").get(null); Object errLvl = lvlCls.getField("ERROR").get(null); logJetty.getClass().getMethod("setLevel", lvlCls).invoke(logJetty, warnLvl); logJettyUtil.getClass().getMethod("setLevel", lvlCls).invoke(logJetty, errLvl); logJettyUtilComp.getClass().getMethod("setLevel", lvlCls).invoke(logJetty, errLvl); } catch (Exception ignored) { } }
Source:
<code>protected void reportTracedLeak(String resourceType, String records) { <START> leaked.set(true); <END> super.reportTracedLeak(resourceType, records); }</code><technical_language>I if store resourceType records easier debug ? include in AssertationError</technical_language>

Target:
protected synchronized void reportTracedLeak(String resourceType, String records) { leaks.add(records); }
Source:
<code>public void onLocationNotFound(String id) { <START> if (createLocationFailures.keySet().contains(id)) { <END> } else { String errmsg = "location '"+id+"' not found"; locationNotFoundFailures.put(id, new IllegalStateException(errmsg)); onErrorImpl(errmsg); } }</code><technical_language>containsKey(id) in preference</technical_language>

Target:
public void onLocationNotFound(String id) { if (creationFailedLocations.contains(id)) { } else { String errmsg = "location '"+id+"' not found"; exceptions.add(new IllegalStateException(errmsg)); onErrorImpl(errmsg); } }
Source:
<code>private void initializeServerAndConfiguration() { try { Executor executor = Executor.newInstance(); File configurationFile = new File(settings.getServerConfigurationLocalFile()); if (configurationFile.exists()) { configuration = ServerConfiguration.loadFromFile(configurationFile); } else { configuration = ServerConfiguration.download(new URI("<LINK_0>"), executor); ServerConfiguration.saveToFile(configurationFile, configuration); } server = new AeriServer(executor, configuration, settings); } catch (Exception e) { <START> log(WARN_CONFIGURATION_DOWNLOAD_FAILED, e); <END> } }</code><technical_language>disable system</technical_language>

Target:
private void initializeServerAndConfiguration() { try { Executor executor = Executor.newInstance(); File configurationFile = new File(settings.getServerConfigurationLocalFile()); if (configurationFile.exists()) { configuration = AeriServer.loadFromFile(configurationFile); } else { configuration = AeriServer.download(new URI("<LINK_0>"), executor); AeriServer.saveToFile(configurationFile, configuration); } server = new AeriServer(executor, configuration, settings); } catch (UnknownHostException e) { settings.setAction(SendAction.IGNORE); settings.setRememberSendAction(RememberSendAction.RESTART); } catch (Exception e) { log(WARN_CONFIGURATION_DOWNLOAD_FAILED, e); settings.setAction(SendAction.IGNORE); settings.setRememberSendAction(RememberSendAction.RESTART); } }
Source:
<code>public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { if (!config.getConfig(Constants.Compat.WAILA_CONFIG_BLOOD_TANK)) return currenttip; <START> if (accessor.getPlayer().isSneaking() || config.getConfig(Constants.Compat.WAILA_CONFIG_BYPASS_SNEAK)) <END> { if (accessor.getBlock() instanceof BlockBloodTank && accessor.getTileEntity() instanceof TileBloodTank) { TileBloodTank bloodTank = (TileBloodTank) accessor.getTileEntity(); currenttip.add(TextHelper.localizeEffect("tooltip.BloodMagic.tier", bloodTank.getBlockMetadata() + 1)); currenttip.add(TextHelper.localizeEffect("tooltip.BloodMagic.fluid.capacity") + ": " + bloodTank.getCapacity() + "mB"); NBTTagCompound tag = bloodTank.getUpdateTag().getCompoundTag(Constants.NBT.TANK); if (!Strings.isNullOrEmpty(tag.getString("FluidName")) && FluidStack.loadFluidStackFromNBT(tag) != null) { currenttip.add(TextHelper.localizeEffect("tooltip.BloodMagic.fluid.type") + ": " + FluidStack.loadFluidStackFromNBT(tag).getLocalizedName()); currenttip.add(TextHelper.localizeEffect("tooltip.BloodMagic.fluid.amount") + ": " + tag.getInteger("Amount") + "/" + bloodTank.getCapacity() + "mB"); } } } else { currenttip.add(TextHelper.localizeEffect("waila.BloodMagic.sneak")); } return currenttip; }</code><technical_language>This bit is wrong. access a Tiles NBT here. Write need tag in #getNBTData read accessor#getNBTData. I need fix other implementations do this. altar impl for example</technical_language>

Target:
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { if (!config.getConfig(Constants.Compat.WAILA_CONFIG_BLOOD_TANK)) return currenttip; if (accessor.getPlayer().isSneaking() || config.getConfig(Constants.Compat.WAILA_CONFIG_BYPASS_SNEAK)) { if (accessor.getBlock() instanceof BlockBloodTank && accessor.getTileEntity() instanceof TileBloodTank) { TileBloodTank bloodTank = (TileBloodTank) accessor.getTileEntity(); NBTTagCompound tag = accessor.getNBTData(); int capacity = tag.getInteger(Constants.NBT.ALTAR_CAPACITY); currenttip.add(TextHelper.localizeEffect("tooltip.BloodMagic.tier", bloodTank.getBlockMetadata() + 1)); currenttip.add(TextHelper.localizeEffect("tooltip.BloodMagic.fluid.capacity") + ": " + capacity + "mB"); tag = tag.getCompoundTag(Constants.NBT.TANK); FluidStack fluidStack = FluidStack.loadFluidStackFromNBT(tag); if (!Strings.isNullOrEmpty(tag.getString("FluidName")) && fluidStack != null) { currenttip.add(TextHelper.localizeEffect("tooltip.BloodMagic.fluid.type") + ": " + fluidStack.getLocalizedName()); currenttip.add(TextHelper.localizeEffect("tooltip.BloodMagic.fluid.amount") + ": " + tag.getInteger("Amount") + "/" + capacity + "mB"); } } } else { currenttip.add(TextHelper.localizeEffect("waila.BloodMagic.sneak")); } return currenttip; }
Source:
<code>protected Instance createEmptyParameterExpression(final Instance validator, final Model model) { Instance expression; <START> if (isBonitaGroovyBasedValidator(validator)) { <END> expression = StringToExpressionConverter.createExpressionInstance(model, "", "", Boolean.class.getName(), ExpressionConstants.CONSTANT_TYPE, true); } else { expression = StringToExpressionConverter.createExpressionInstance(model, "", "", String.class.getName(), ExpressionConstants.CONSTANT_TYPE, false); } return expression; }</code><technical_language>return StringToExpressionConverter.createExpressionInstance(model, "", "", isBonitaGroovyBasedValidator(validator) ? Boolean.class.getName() : String.class.getName, ExpressionConstants.CONSTANT_TYPE, isBonitaGroovyBasedValidator(validator));</technical_language>

Target:
protected Instance createEmptyParameterExpression(final Instance validator, final Model model) { final boolean isBonitaGroovyBasedValidator = isBonitaGroovyBasedValidator(validator); final String returnType = isBonitaGroovyBasedValidator ? Boolean.class.getName() : String.class.getName(); return StringToExpressionConverter.createExpressionInstance( model, "", "", returnType, ExpressionConstants.CONSTANT_TYPE, isBonitaGroovyBasedValidator); }
Source:
<code>private List<FeedbackResponseAttributes> getSortedExistingResponses(FeedbackQuestionAttributes questionAttributes) { List<FeedbackResponseAttributes> existingResponses = bundle.questionResponseBundle.get(questionAttributes); Map<String, String> emailNamePair = this.bundle.getSortedRecipientList(questionAttributes.getFeedbackQuestionId()); <START> existingResponses.sort(Comparator.comparing(existingResponse -> emailNamePair.get(existingResponse.recipient))); <END> return existingResponses; }</code><technical_language>I debugged out tests failing this line Null Pointer Exception. logs: ![image](<LINK_0></technical_language>

Target:
private List<FeedbackResponseAttributes> getSortedExistingResponses(FeedbackQuestionAttributes questionAttributes) { List<FeedbackResponseAttributes> existingResponses = bundle.questionResponseBundle.get(questionAttributes); Map<String, String> emailNamePair = this.bundle.getSortedRecipientList(questionAttributes.getFeedbackQuestionId()); Comparator<FeedbackResponseAttributes> responsesComparator = (response1, response2) -> { if (emailNamePair.containsKey(response1.recipient) && emailNamePair.containsKey(response2.recipient)) { return emailNamePair.get(response1.recipient).compareTo(emailNamePair.get(response2.recipient)); } else { return response1.recipient.compareTo(response2.recipient); } }; existingResponses.sort(responsesComparator); return existingResponses; }
Source:
<code>static boolean isRejectedCard(String cardNumber) { return REJECTED_CARDS .keySet() .stream() <START> .anyMatch(a -> a.contains(cardNumber)); <END> }</code><technical_language>substring matches</technical_language>

Target:
public static boolean isRejectedCard(String cardNumber) { return REJECTED_CARDS .keySet() .stream() .anyMatch(rejectedCards -> rejectedCards.contains(cardNumber)); }
Source:
<code>public List<Module> instantiate(String moduleClassName) { try { Module module = (Module) Class.forName(moduleClassName).newInstance(); return Collections.singletonList(module); } catch (Exception e) { <START> String message = format("Instantiation of ''{0}'' failed", moduleClassName); <END> logger.log(SEVERE, message, e); } return Collections.emptyList(); }</code><technical_language>I assume if this a fatal error. throw exception fail immediately</technical_language>

Target:
public List<Module> instantiate(String moduleClassName) { try { Module module = (Module) Class.forName(moduleClassName).newInstance(); return Collections.singletonList(module); } catch (Exception e) { String message = format("Instantiation of ''{0}'' failed", moduleClassName); throw new GuiceModuleInstantiationFailed(message, e); } }
Source:
<code>void failOnMatcherError() { String expectedText = "Won't exist"; assertThatThrownBy(() -> new ItemWithText(expectedText) .fail(collection, collection.getElements(), new Exception("Exception message"), 10000)).isInstanceOf(TextsMismatch.class) .hasMessageContaining( <START> String.format(String.format("Texts mismatch" + <END> "%nActual: %s" + "%nExpected: %s", ElementsCollection.texts(collection.getElements()), Collections.singletonList(expectedText)))); }</code><technical_language>I another error message instead of "Texts mismatch". "element text found"</technical_language>

Target:
void failOnMatcherError() { String expectedText = "Won't exist"; assertThatThrownBy(() -> new ItemWithText(expectedText) .fail(collection, collection.getElements(), new Exception("Exception message"), 10000)).isInstanceOf(ElementWithTextNotFound.class) .hasMessageContaining( String.format(String.format("Element with text not found" + "%nActual: %s" + "%nExpected: %s", ElementsCollection.texts(collection.getElements()), Collections.singletonList(expectedText)))); }
Source:
<code>public boolean removeFirst() { if (innerList.size() < 1) { return false; } Node node = innerList.get(0); notifyElementRemoved(0, node); node.setParentNode(null); return innerList.remove(0) != null; <START> } <END></code><technical_language>easier methods NodeList instead of manipulating innerlist</technical_language>

Target:
public N removeFirst() { return remove(0); }
Source:
<code>public void mouseDown(MouseEvent e) { if ((getChartViewer().getWindowDuration() != 0) && (e.button == 1)) { if ((e.stateMask & SWT.CTRL) != 0) { return; } fDragBeginMarker = false; if (((e.stateMask & (SWT.SHIFT | <START> SWT.CTRL)) <END> == 0) || (fEndTime == fBeginTime)) { IAxis xAxis = getChart().getAxisSet().getXAxis(0); fBeginTime = limitXDataCoordinate(xAxis.getDataCoordinate(e.x)); fEndTime = fBeginTime; } else { long selectionBegin = fBeginTime; long selectionEnd = fEndTime; IAxis xAxis = getChart().getAxisSet().getXAxis(0); long time = limitXDataCoordinate(xAxis.getDataCoordinate(e.x)); if (Math.abs(time - selectionBegin) < Math.abs(time - selectionEnd)) { fDragBeginMarker = true; fBeginTime = time; fEndTime = selectionEnd; } else { fBeginTime = selectionBegin; fEndTime = time; } } fIsInternalUpdate = true; } }</code><technical_language>If Ctrl is pressed returns early above</technical_language>

Target:
public void mouseDown(MouseEvent e) { if ((getChartViewer().getWindowDuration() != 0) && (e.button == 1)) { if ((e.stateMask & SWT.CTRL) != 0) { return; } fDragBeginMarker = false; if (((e.stateMask & SWT.SHIFT) == 0) || (fEndTime == fBeginTime)) { IAxis xAxis = getChart().getAxisSet().getXAxis(0); fBeginTime = limitXDataCoordinate(xAxis.getDataCoordinate(e.x)); fEndTime = fBeginTime; } else { long selectionBegin = fBeginTime; long selectionEnd = fEndTime; IAxis xAxis = getChart().getAxisSet().getXAxis(0); long time = limitXDataCoordinate(xAxis.getDataCoordinate(e.x)); if (Math.abs(time - selectionBegin) < Math.abs(time - selectionEnd)) { fDragBeginMarker = true; fBeginTime = time; fEndTime = selectionEnd; } else { fBeginTime = selectionBegin; fEndTime = time; } } fIsInternalUpdate = true; } }
Source:
<code>public void testGenerateStudentCourseJoinEmail() throws IOException, MessagingException { CourseAttributes course = new CourseAttributes("course-id", "Course Name"); StudentAttributes student = new StudentAttributes(); student.name = "Student Name"; student.key = "skxxxxxxxxxks"; student.email = "student@email.tmt"; MimeMessage email = new EmailGenerator().generateStudentCourseJoinEmail(course, student); String subject = String.format(EmailType.STUDENT_COURSE_JOIN.getSubject(), course.getName(), course.getId()); String joinUrl = Config.getAppUrl(student.getRegistrationUrl()).toAbsoluteString(); <START> String textInEmail = "Hello " + student.name + "{*}course <i>" + course.getName() <END> + "{*}" + joinUrl + "{*}" + joinUrl + "{*}"; verifyEmail(email, student.email, subject, textInEmail); }</code><technical_language>minor point, ignore this if want, close <i> tag opened here. disturbing check for opening <i></technical_language>

Target:
public void testGenerateStudentCourseJoinEmail() throws IOException, MessagingException { CourseAttributes course = new CourseAttributes("course-id", "Course Name"); StudentAttributes student = new StudentAttributes(); student.name = "Student Name"; student.key = "skxxxxxxxxxks"; student.email = "student@email.tmt"; MimeMessage email = new EmailGenerator().generateStudentCourseJoinEmail(course, student); String subject = String.format(EmailType.STUDENT_COURSE_JOIN.getSubject(), course.getName(), course.getId()); String joinUrl = Config.getAppUrl(student.getRegistrationUrl()).toAbsoluteString(); String textInEmail = "Hello " + student.name + "{*}" + course.getName() + "{*}" + joinUrl + "{*}" + joinUrl + "{*}"; verifyEmail(email, student.email, subject, textInEmail); }
Source:
<code>public void clearDestinationHost() { nicsMap.values().forEach(nic -> { if (nic.isPartOfBond()) { Guid bondId = getDestinationInterfacesIdByName().get(nic.getBondName()); bondsToRemove.add(bondId); <START> clearAttachments(bondId); <END> } clearAttachments(nic.getId()); }); }</code><technical_language>name of this method is clear (pun intended...) word 'clear' is some collection is emptied. code in clearAttachments, computing attachments remove. this sense, is consistent row 'bondsToRemove.add' is obscured name of clearAttachments. secondly, line in clearAttachments() method is dependent id is passed it. this line there. line 60. rename clearAttachments calcDestAttachmentsToRemove. this flow symetric, consistent, readable</technical_language>

Target:
private void clearDestinationHost() { nicsMap.values().forEach(nic -> { if (nic.isPartOfBond()) { Guid bondId = calcDestinationInterfacesIdByName().get(nic.getBondName()); bondsToRemove.add(bondId); List<Guid> destAttachmentIds = calcDestAttachmentsToRemove(bondId); attachmentsToRemove.addAll(destAttachmentIds); } List<Guid> destAttachmentIds = calcDestAttachmentsToRemove(nic.getId()); attachmentsToRemove.addAll(destAttachmentIds); }); }
Source:
<code>protected LinkedHashMap toStringMapper_RICE20_REFACTORME() { LinkedHashMap m = new LinkedHashMap(); m.put(KFSPropertyConstants.DOCUMENT_NUMBER, this.documentNumber); m.put("categoryCode", this.categoryCode); if (ObjectUtils.isNotNull(this.invoiceDetailIdentifier)) { m.put("invoiceDetailIdentifier", this.invoiceDetailIdentifier.toString()); } if (ObjectUtils.isNotNull(this.totalBudget)) { m.put("totalBudget", this.totalBudget.toString()); } if (ObjectUtils.isNotNull(this.invoiceAmount)) { m.put("invoiceAmount", this.invoiceAmount.toString()); } if (ObjectUtils.isNotNull(this.cumulativeExpenditures)) { m.put("cumulativeExpenditures", this.cumulativeExpenditures.toString()); } <START> m.put("balance", getBudgetRemaining().toString()); <END> if (ObjectUtils.isNotNull(this.totalPreviouslyBilled)) { m.put("totalPreviouslyBilled", this.totalPreviouslyBilled.toString()); } m.put("adjustedCumExpenditures", getTotalAmountBilledToDate().toString()); m.put("adjustedBalance", getAmountRemainingToBill().toString()); return m; }</code><technical_language>"balance" -> "budgetRemaining"</technical_language>

Target:
protected LinkedHashMap toStringMapper_RICE20_REFACTORME() { LinkedHashMap m = new LinkedHashMap(); m.put(KFSPropertyConstants.DOCUMENT_NUMBER, this.documentNumber); m.put("categoryCode", this.categoryCode); if (ObjectUtils.isNotNull(this.invoiceDetailIdentifier)) { m.put("invoiceDetailIdentifier", this.invoiceDetailIdentifier.toString()); } if (ObjectUtils.isNotNull(this.totalBudget)) { m.put("totalBudget", this.totalBudget.toString()); } if (ObjectUtils.isNotNull(this.invoiceAmount)) { m.put("invoiceAmount", this.invoiceAmount.toString()); } if (ObjectUtils.isNotNull(this.cumulativeExpenditures)) { m.put("cumulativeExpenditures", this.cumulativeExpenditures.toString()); } m.put("budgetRemaining", getBudgetRemaining().toString()); if (ObjectUtils.isNotNull(this.totalPreviouslyBilled)) { m.put("totalPreviouslyBilled", this.totalPreviouslyBilled.toString()); } m.put("totalAmountBilledToDate", getTotalAmountBilledToDate().toString()); m.put("amountRemainingToBill", getAmountRemainingToBill().toString()); return m; }