auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Geocode() throws IOException { String defaultCountryDatabasePath = "/usr/share/GeoIP/GeoIP2-Country.mmdb"; String defaultCityDatabasePath = "/usr/share/GeoIP/GeoIP2-City.mmdb"; String countryDatabasepath = System.getProperty("maxmind.database.country"); String cityDatabasePath = System.getProperty("maxmind.database.city"); <START> if (countryDatabasepath == null || countryDatabasepath.isEmpty()) <END> countryDatabasepath = defaultCountryDatabasePath; if (cityDatabasePath == null || cityDatabasePath.isEmpty()) cityDatabasePath = defaultCityDatabasePath; LOG.info("Country Database: " + countryDatabasepath); LOG.info("City database: " + cityDatabasePath); countryDatabaseReader = new DatabaseReader.Builder(new File(countryDatabasepath)).build(); cityDatabaseReader = new DatabaseReader.Builder(new File(cityDatabasePath)).build(); }</code><technical_language>call System.getProperty arguments, of is default returned if property is set: System.getProperty("maxmind.database.country", defaultCountryDatabasePath);</technical_language>

Target:
public Geocode() throws IOException { String defaultCountryDatabasePath = "/usr/share/GeoIP/GeoIP2-Country.mmdb"; String defaultCityDatabasePath = "/usr/share/GeoIP/GeoIP2-City.mmdb"; String countryDatabasepath = System.getProperty("maxmind.database.country", defaultCountryDatabasePath); String cityDatabasePath = System.getProperty("maxmind.database.city", defaultCityDatabasePath); LOG.info("Country Database: " + countryDatabasepath); LOG.info("City database: " + cityDatabasePath); countryDatabaseReader = new DatabaseReader.Builder(new File(countryDatabasepath)).build(); cityDatabaseReader = new DatabaseReader.Builder(new File(cityDatabasePath)).build(); }
Source:
<code>public static List<ModeledSegment> makeCalls(final TargetCollection<TargetCoverage> targets, final List<ModeledSegment> segments, final double zThreshold) { Utils.nonNull(segments, "Can't make calls on a null list of segments."); Utils.nonNull(targets, "Can't make calls on a null list of targets."); ParamUtils.isPositiveOrZero(zThreshold, "zThreshold must be positive or zero."); final double nonExtremeCoverage = targets.targets() .stream() .mapToDouble(TargetCoverage::getCoverage) .filter(c -> c < NON_NEUTRAL_THRESHOLD_HIGH && c > NON_NEUTRAL_THRESHOLD_LOW) .toArray(); final double neutralCoverage = new Median().evaluate(nonExtremeCoverage); final double[] nearNeutralCoverage = segments.stream() <START> .filter(s -> (SegmentUtils.meanTargetCoverage(s, targets) - neutralCoverage) < COPY_NEUTRAL_CUTOFF_HIGH && (SegmentUtils.meanTargetCoverage(s, targets) - neutralCoverage) > COPY_NEUTRAL_CUTOFF_LOW) <END> .flatMap(s -> targets.targets(s).stream()) .mapToDouble(TargetCoverage::getCoverage) .toArray(); final double neutralSigma = new StandardDeviation().evaluate(nearNeutralCoverage); for (final ModeledSegment segment : segments) { final double Z = (SegmentUtils.meanTargetCoverage(segment, targets) - neutralCoverage)/neutralSigma; final String call = Z < -zThreshold ? DELETION_CALL: (Z > zThreshold ? AMPLIFICATION_CALL : NEUTRAL_CALL); segment.setCall(call); } return segments; }</code><technical_language>a single cutoff parameter above, filter written a single predicate absolute value</technical_language>

Target:
public static List<ModeledSegment> makeCalls(final TargetCollection<TargetCoverage> targets, final List<ModeledSegment> segments, final double zThreshold) { Utils.nonNull(segments, "Can't make calls on a null list of segments."); Utils.nonNull(targets, "Can't make calls on a null list of targets."); ParamUtils.isPositiveOrZero(zThreshold, "zThreshold must be positive or zero."); final double nonExtremeCoverage = targets.targets() .stream() .mapToDouble(TargetCoverage::getCoverage) .filter(c -> Math.abs(c) < NON_NEUTRAL_THRESHOLD) .toArray(); final double neutralCoverage = new Median().evaluate(nonExtremeCoverage); final double[] nearNeutralCoverage = segments.stream() .filter(s -> Math.abs(SegmentUtils.meanTargetCoverage(s, targets) - neutralCoverage) < COPY_NEUTRAL_CUTOFF) .flatMap(s -> targets.targets(s).stream()) .mapToDouble(TargetCoverage::getCoverage) .toArray(); final double neutralSigma = new StandardDeviation().evaluate(nearNeutralCoverage); for (final ModeledSegment segment : segments) { final double Z = (SegmentUtils.meanTargetCoverage(segment, targets) - neutralCoverage)/neutralSigma; final String call = Z < -zThreshold ? DELETION_CALL: (Z > zThreshold ? AMPLIFICATION_CALL : NEUTRAL_CALL); segment.setCall(call); } return segments; }
Source:
<code>private void initActivityLogUsingAppLogMessage(AppLogLine appLog, String[] tokens) { String actionName = tokens[POSITION_OF_ACTION_NAME]; String actionUrl = tokens[POSITION_OF_ACTION_URL]; long time = appLog.getTimeUsec() / 1000; Builder builder = new Builder(actionName, actionUrl, time); builder.withActionResponse(tokens[POSITION_OF_ACTION_RESPONSE]); builder.withLogId(tokens[POSITION_OF_LOG_ID]); builder.withLogMessage(tokens[POSITION_OF_LOG_MESSAGE]); builder.withMasqueradeUserRole(tokens[POSITION_OF_USER_ROLE].contains(Const.ActivityLog.ROLE_MASQUERADE_POSTFIX)); builder.withUserEmail(tokens[POSITION_OF_USER_EMAIL]); builder.withUserGoogleId(tokens[POSITION_OF_USER_GOOGLEID]); builder.withUserName(tokens[POSITION_OF_USER_NAME]); String userRole = tokens[POSITION_OF_USER_ROLE]; <START> builder.withUserRole(userRole.replace(Const.ActivityLog.ROLE_MASQUERADE_POSTFIX, "")); <END> try { long actionTimeTaken = tokens.length == ActivityLogEntry.POSITION_OF_LOG_TIMETAKEN + 1 ? Long.parseLong(tokens[ActivityLogEntry.POSITION_OF_LOG_TIMETAKEN].trim()) : 0; builder.withActionTimeTaken(actionTimeTaken); } catch (NumberFormatException e) { log.severe(String.format(Const.ActivityLog.MESSAGE_ERROR_LOG_MESSAGE_FORMAT, Arrays.toString(tokens))); } constructFromBuilder(builder); }</code><technical_language>chaining in lines? e.g. java builder.withActionResponse(tokens[POSITION_OF_ACTION_RESPONSE]) .withLogId(tokens[POSITION_OF_LOG_ID])</technical_language>

Target:
private static ActivityLogEntry initActivityLogUsingAppLogMessage(AppLogLine appLog, String[] tokens) { String actionName = tokens[POSITION_OF_ACTION_NAME]; String actionUrl = tokens[POSITION_OF_ACTION_URL]; long time = appLog.getTimeUsec() / 1000; Builder builder = new Builder(actionName, actionUrl, time); builder.withActionResponse(tokens[POSITION_OF_ACTION_RESPONSE]) .withLogId(tokens[POSITION_OF_LOG_ID]) .withLogMessage(tokens[POSITION_OF_LOG_MESSAGE]) .withMasqueradeUserRole( tokens[POSITION_OF_USER_ROLE].contains(Const.ActivityLog.ROLE_MASQUERADE_POSTFIX)) .withUserEmail(tokens[POSITION_OF_USER_EMAIL]) .withUserGoogleId(tokens[POSITION_OF_USER_GOOGLEID]) .withUserName(tokens[POSITION_OF_USER_NAME]); String userRole = tokens[POSITION_OF_USER_ROLE]; builder.withUserRole(userRole.replace(Const.ActivityLog.ROLE_MASQUERADE_POSTFIX, "")); try { long actionTimeTaken = tokens.length == ActivityLogEntry.POSITION_OF_LOG_TIMETAKEN + 1 ? Long.parseLong(tokens[ActivityLogEntry.POSITION_OF_LOG_TIMETAKEN].trim()) : 0; builder.withActionTimeTaken(actionTimeTaken); } catch (NumberFormatException e) { log.severe(String.format(Const.ActivityLog.MESSAGE_ERROR_LOG_MESSAGE_FORMAT, Arrays.toString(tokens))); } return builder.build(); }
Source:
<code>public Cluster(String name, String region, Set<String> soloInstances) { Validate.notNull(name); Validate.notNull(region); <START> Validate.notNull(autoScalingGroups); <END> this.name = name; this.region = region; for (String soleInstance : soloInstances) { this.soloInstances.add(soleInstance); } }</code><technical_language>autoScalingGroups soloInstances</technical_language>

Target:
public Cluster(String name, String region, Set<String> soloInstances) { Validate.notNull(name); Validate.notNull(region); Validate.notNull(soloInstances); this.name = name; this.region = region; for (String soleInstance : soloInstances) { this.soloInstances.add(soleInstance); } }
Source:
<code>public String checkIPythonPrerequisite(String pythonExec) { ProcessBuilder processBuilder = new ProcessBuilder(pythonExec, "-m", "pip", "freeze"); File stderrFile = null; File stdoutFile = null; try { stderrFile = File.createTempFile("zeppelin", ".txt"); processBuilder.redirectError(stderrFile); stdoutFile = File.createTempFile("zeppelin", ".txt"); processBuilder.redirectOutput(stdoutFile); Process proc = processBuilder.start(); int ret = proc.waitFor(); if (ret != 0) { return "Fail to run pip freeze.\n" + IOUtils.toString(new FileInputStream(stderrFile)); } <START> try (FileInputStream in = new FileInputStream(stdoutFile)) { <END> String freezeOutput = IOUtils.toString(in); if (!freezeOutput.contains("jupyter-client=")) { return "jupyter-client is not installed."; } if (!freezeOutput.contains("ipykernel=")) { return "ipykernel is not installed"; } if (!freezeOutput.contains("ipython=")) { return "ipython is not installed"; } if (!freezeOutput.contains("grpcio=")) { return "grpcio is not installed"; } if (!freezeOutput.contains("protobuf=")) { return "protobuf is not installed"; } LOGGER.info("IPython prerequisite is met"); } } catch (Exception e) { LOGGER.warn("Fail to checkIPythonPrerequisite", e); return "Fail to checkIPythonPrerequisite: " + ExceptionUtils.getStackTrace(e); } finally { FileUtils.deleteQuietly(stderrFile); FileUtils.deleteQuietly(stdoutFile); } return ""; }</code><technical_language>a bit hard track - this try catch finally</technical_language>

Target:
public String checkIPythonPrerequisite(String pythonExec) { ProcessBuilder processBuilder = new ProcessBuilder(pythonExec, "-m", "pip", "freeze"); try { File stderrFile = File.createTempFile("zeppelin", ".txt"); processBuilder.redirectError(stderrFile); File stdoutFile = File.createTempFile("zeppelin", ".txt"); processBuilder.redirectOutput(stdoutFile); Process proc = processBuilder.start(); int ret = proc.waitFor(); if (ret != 0) { return "Fail to run pip freeze.\n" + IOUtils.toString(new FileInputStream(stderrFile)); } String freezeOutput = IOUtils.toString(new FileInputStream(stdoutFile)); if (!freezeOutput.contains("jupyter-client=")) { return "jupyter-client is not installed."; } if (!freezeOutput.contains("ipykernel=")) { return "ipykernel is not installed"; } if (!freezeOutput.contains("ipython=")) { return "ipython is not installed"; } if (!freezeOutput.contains("grpcio=")) { return "grpcio is not installed"; } if (!freezeOutput.contains("protobuf=")) { return "protobuf is not installed"; } LOGGER.info("IPython prerequisite is met"); } catch (Exception e) { LOGGER.warn("Fail to checkIPythonPrerequisite", e); return "Fail to checkIPythonPrerequisite: " + ExceptionUtils.getStackTrace(e); } return ""; }
Source:
<code>public void createTable(final String tableName, final Set<String> columnFamilies, byte[][] splitKeys) { <START> checkTableAndCf(tableName, columnFamilies); <END> try (final Admin admin = _connection.getAdmin()) { final TableDescriptorBuilder tableBuilder = getTableDescriptorBuilder(tableName, columnFamilies); admin.createTable(tableBuilder.build(),splitKeys); } catch (IOException e) { throw new MetaModelException(e); } }</code><technical_language>I spell out "column families" instead of "cf" abbreviation</technical_language>

Target:
public void createTable(final String tableName, final Set<String> columnFamilies, byte[][] splitKeys) { checkTableAndColumnFamilies(tableName, columnFamilies); try (final Admin admin = _connection.getAdmin()) { final TableDescriptorBuilder tableBuilder = getTableDescriptorBuilder(tableName, columnFamilies); admin.createTable(tableBuilder.build(),splitKeys); } catch (IOException e) { throw new MetaModelException(e); } }
Source:
<code>public void selectLocalRevision(long timeStamp){ IFileRevision entry = null; if (entries != null) { for (IFileRevision entrie : entries) { if (entrie.getTimestamp() == timeStamp) { entry = entrie; break; } } }else if (cvsFileHistory != null) { IFileRevision[] tempEntries = cvsFileHistory.getFileRevisions(); for (IFileRevision <START> tempEntrie : <END> tempEntries) { if (tempEntrie.getTimestamp() == timeStamp) { entry = tempEntrie; break; } } } if (entry != null) { IStructuredSelection selection = new StructuredSelection(entry); treeViewer.getTree().setRedraw(false); treeViewer.setSelection(selection, true); treeViewer.getTree().setRedraw(true); } else { treeViewer.getTree().deselectAll(); } }</code><technical_language>Entry</technical_language>

Target:
public void selectLocalRevision(long timeStamp){ IFileRevision entry = null; if (entries != null) { for (IFileRevision e : entries) { if (e.getTimestamp() == timeStamp) { entry = e; break; } } }else if (cvsFileHistory != null) { IFileRevision[] tempEntries = cvsFileHistory.getFileRevisions(); for (IFileRevision tempEntry : tempEntries) { if (tempEntry.getTimestamp() == timeStamp) { entry = tempEntry; break; } } } if (entry != null) { IStructuredSelection selection = new StructuredSelection(entry); treeViewer.getTree().setRedraw(false); treeViewer.setSelection(selection, true); treeViewer.getTree().setRedraw(true); } else { treeViewer.getTree().deselectAll(); } }
Source:
<code>private Builder merge(Builder other) { Optional<Currency> common = currencies.keySet() .stream() .filter(other.currencies::containsKey) .findFirst(); <START> if (!common.isPresent()) { <END> throw new IllegalArgumentException("There are no currencies in common between " + currencies.keySet() + " and " + other.currencies.keySet()); } Currency commonCurrency = common.get(); other.currencies.entrySet() .stream() .filter(e -> !e.getKey().equals(commonCurrency) && !currencies.containsKey(e.getKey())) .forEach(e -> addCurrencyPair(commonCurrency, e.getKey(), other.getRate(commonCurrency, e.getKey()))); return this; }</code><technical_language>Currency commonCurrency = common.orElseThrow(() -> new IllegalArgumentException(...))</technical_language>

Target:
private Builder merge(Builder other) { Optional<Currency> common = currencies.keySet() .stream() .filter(other.currencies::containsKey) .findFirst(); Currency commonCurrency = common.orElseThrow(() -> new IllegalArgumentException("There are no currencies in common between " + currencies.keySet() + " and " + other.currencies.keySet())); other.currencies.entrySet() .stream() .filter(isNewCurrency(commonCurrency)) .forEach(e -> addCurrencyPair(commonCurrency, e.getKey(), other.getRate(commonCurrency, e.getKey()))); return this; }
Source:
<code>public StubSchemaManagementWorkAssert matches(StubSchemaManagementWork expected) { ToStringTreeBuilder builder = new ToStringTreeBuilder( ToStringStyle.multilineDelimiterStructure() ); builder.startObject(); boolean hasAnyMismatch; boolean mismatch = checkForMismatch( builder, "type", expected.getType(), actual.getType() ); <START> hasAnyMismatch = mismatch; <END> builder.endObject(); if ( hasAnyMismatch ) { Assert.fail( messageBase + builder.toString() ); } return this; }</code><technical_language>Do need mismatch variable? assign result of checkForMismatch hasAnyMismatch</technical_language>

Target:
public StubSchemaManagementWorkAssert matches(StubSchemaManagementWork expected) { ToStringTreeBuilder builder = new ToStringTreeBuilder( ToStringStyle.multilineDelimiterStructure() ); builder.startObject(); boolean hasAnyMismatch = checkForMismatch( builder, "type", expected.getType(), actual.getType() ); builder.endObject(); if ( hasAnyMismatch ) { Assert.fail( messageBase + builder.toString() ); } return this; }
Source:
<code>public void saveState(FileTailerState state) throws FileTailerStateProcessorException { createDirs(stateDirPath); LOG.debug("Start saving File Tailer state .."); try { <START> FileOutputStream fileOut = new FileOutputStream(stateDirPath + "/" + stateFileName); <END> ObjectOutputStream out = new ObjectOutputStream(fileOut); out.writeObject(state); out.close(); fileOut.close(); LOG.debug("File Tailer state saved successfully"); } catch (IOException e) { LOG.error("Can not save File Tailer state: {}", e.getMessage()); throw new FileTailerStateProcessorException(e.getMessage()); } }</code><technical_language>stream properly closed is exception. close a finally block</technical_language>

Target:
public void saveState(FileTailerState state) throws FileTailerStateProcessorException { try { Preconditions.checkNotNull(state); } catch (NullPointerException e) { LOG.info("Cannot save null state"); return; } createDirs(stateDir); LOG.debug("Start saving File Tailer state .."); try { JsonWriter jsonWriter = new JsonWriter(Files.newWriter(stateFile, UTF_8)); try { GSON.toJson(state, FileTailerState.class, jsonWriter); LOG.debug("File Tailer state saved successfully"); } finally { try { jsonWriter.close(); } catch (IOException e) { LOG.error("Cannot close JSON Writer for file {}: {}", stateFile.getAbsolutePath(), e.getMessage(), e); } } } catch (IOException e) { LOG.error("Cannot close JSON Writer for file {}: {}", stateFile.getAbsolutePath(), e.getMessage(), e); } }
Source:
<code>public static void setUser(@Nullable final byte[] idBytes, @Nullable final byte[] emailBytes, @Nullable final byte[] nameBytes) { <START> String id = new String(idBytes, Charset.defaultCharset()); <END> String email = new String(emailBytes, Charset.defaultCharset()); String name = new String(nameBytes, Charset.defaultCharset()); setUser(id, email, name); }</code><technical_language>this throw a NPE idBytes is marked nullable</technical_language>

Target:
public static void setUser(@Nullable final byte[] idBytes, @Nullable final byte[] emailBytes, @Nullable final byte[] nameBytes) { String id = idBytes == null ? null : new String(idBytes, UTF8Charset); String email = emailBytes == null ? null : new String(emailBytes, UTF8Charset); String name = nameBytes == null ? null : new String(nameBytes, UTF8Charset); setUser(id, email, name); }
Source:
<code>private boolean doRemove(Iterator<? extends Lifecycle> it, String storeType, Lifecycle wrapper, Lifecycle actual) { if (actual.getClass().getName().equals(storeType)) { wrapper.stop(); if (actual != wrapper) { actual.stop(); } <START> it.remove(); <END> return true; } return false; }</code><technical_language>instead of adding additional if in removeCacheWriter removeCacheLoader, calling storeStatuses.remove(wrapper);</technical_language>

Target:
private void doRemove(Iterator<? extends Lifecycle> it, String storeType, Lifecycle wrapper, Lifecycle actual) { if (actual.getClass().getName().equals(storeType)) { wrapper.stop(); if (actual != wrapper) { actual.stop(); } it.remove(); storeStatuses.remove(wrapper); } }
Source:
<code>public void testPackageSearch(@NugetRepository(storageId = STORAGE_ID, repositoryId = REPOSITORY_RELEASES_1) Repository repository, @NugetTestArtifact(storageId = STORAGE_ID, repositoryId = REPOSITORY_RELEASES_1, id = "Org.Carlspring.Strongbox.Nuget.Test.Search", versions = "1.0.0") Path packagePath) throws Exception { final String storageId = repository.getStorage().getId(); final String repositoryId = repository.getId(); String url = getContextBaseUrl() + "/storages/{storageId}/{repositoryId}/Search()/$count?searchTerm={searchTerm}&targetFramework="; mockMvc.header(HttpHeaders.USER_AGENT, "NuGet/*") .when() .get(url, storageId, repositoryId, "Test.Search") .then() .statusCode(HttpStatus.OK.value()) .and() .log().body() .and() .assertThat() .body(equalTo("1")); NugetArtifactCoordinates coordinates = (NugetArtifactCoordinates) RepositoryFiles.readCoordinates( (RepositoryPath) packagePath.normalize()); url = getContextBaseUrl() + "/storages/{storageId}/{repositoryId}/Search()?$skip={skip}&$top={stop}&searchTerm={searchTerm}&targetFramework="; MockMvcResponse response = mockMvc.header(HttpHeaders.USER_AGENT, "NuGet/*") .when() .get(url, storageId, repositoryId, 0, 30, "Test.Search") .then() .statusCode(HttpStatus.OK.value()) .extract().response(); <START> <END> XmlPath doc = new XmlPath(response.body().asString()); assertEquals(doc.getString("atom:feed.title"), "Packages"); assertEquals(doc.getString("atom:feed.entry[0].title"), coordinates.getId()); }</code><technical_language>@savaliyagautam is purpose of this change</technical_language>

Target:
public void testPackageSearch(@NugetRepository(storageId = STORAGE_ID, repositoryId = REPOSITORY_RELEASES_1) Repository repository, @NugetTestArtifact(storageId = STORAGE_ID, repositoryId = REPOSITORY_RELEASES_1, id = "Org.Carlspring.Strongbox.Nuget.Test.Search", versions = "1.0.0") Path packagePath) throws Exception { final String storageId = repository.getStorage().getId(); final String repositoryId = repository.getId(); String url = getContextBaseUrl() + "/storages/{storageId}/{repositoryId}/Search()/$count?searchTerm={searchTerm}&targetFramework="; mockMvc.header(HttpHeaders.USER_AGENT, "NuGet/*") .when() .get(url, storageId, repositoryId, "Test.Search") .then() .statusCode(HttpStatus.OK.value()) .and() .log().body() .and() .assertThat() .body(equalTo("1")); NugetArtifactCoordinates coordinates = (NugetArtifactCoordinates) RepositoryFiles.readCoordinates( (RepositoryPath) packagePath.normalize()); url = getContextBaseUrl() + "/storages/{storageId}/{repositoryId}/Search()?$skip={skip}&$top={stop}&searchTerm={searchTerm}&targetFramework="; mockMvc.header(HttpHeaders.USER_AGENT, "NuGet/*") .when() .get(url, storageId, repositoryId, 0, 30, "Test.Search") .then() .statusCode(HttpStatus.OK.value()) .and() .assertThat() .body("feed.title", equalTo("Packages")) .and() .assertThat() .body("feed.entry[0].title", equalTo(coordinates.getId())); }
Source:
<code>public void setup() { when(version.getValue()).thenReturn(CLUSTER_VERSION); <START> when(osRepository.getNetworkDevices(0, any(Version.class))).thenReturn(NETWORK_DEVICES); <END> when(osRepository.getNetworkDevices(0, null)).thenReturn(NETWORK_DEVICES); validator = new VmNicValidator(nic, version); validatorType = new VmNicValidator(nic, version, 0); }</code><technical_language>this line replaced with: when(osRepository.getNetworkDevices(any(Integer.class), any(Version.class))).thenReturn(NETWORK_DEVICES);</technical_language>

Target:
public void setup() { when(version.getValue()).thenReturn(CLUSTER_VERSION); when(osRepository.getNetworkDevices(eq(0), any(Version.class))).thenReturn(NETWORK_DEVICES); SimpleDependecyInjector.getInstance().bind(OsRepository.class, osRepository); validator = new VmNicValidator(nic, version); validatorType = new VmNicValidator(nic, version, 0); }
Source:
<code>public Response add(SchedulingPolicy schedulingPolicy) { if (!schedulingPolicy.isSetName()){ schedulingPolicy.setName(schedulingPolicy.getPolicy()); <START> } <END> validateParameters(schedulingPolicy, "name"); return performCreate(VdcActionType.AddClusterPolicy, new ClusterPolicyCRUDParameters(null, map(schedulingPolicy)), queryIdResolver); }</code><technical_language>This is done mapper, need do here. In addition need support "policy" attribute adding scheduling policies, changing policy of a cluster</technical_language>

Target:
public Response add(SchedulingPolicy schedulingPolicy) { validateParameters(schedulingPolicy, "name"); return performCreate(VdcActionType.AddClusterPolicy, new ClusterPolicyCRUDParameters(null, map(schedulingPolicy)), queryIdResolver); }
Source:
<code>public List<MetricFamilySamples> collect() { GaugeMetricFamily availableCallsFamily = new GaugeMetricFamily( names.getAvailableConcurrentCallsMetricName(), <START> "The number of bulkhead available concurrent calls", <END> LabelNames.NAME ); GaugeMetricFamily maxAllowedCallsFamily = new GaugeMetricFamily( names.getMaxAllowedConcurrentCallsMetricName(), "The number of bulkhead max allowed concurrent calls", LabelNames.NAME ); for (Bulkhead bulkhead: bulkheadsSupplier.get()) { List<String> labelValues = singletonList(bulkhead.getName()); availableCallsFamily.addMetric(labelValues, bulkhead.getMetrics().getAvailableConcurrentCalls()); maxAllowedCallsFamily.addMetric(labelValues, bulkhead.getMetrics().getMaxAllowedConcurrentCalls()); } return asList(availableCallsFamily, maxAllowedCallsFamily); }</code><technical_language>better: number of concurrent calls</technical_language>

Target:
public List<MetricFamilySamples> collect() { GaugeMetricFamily availableCallsFamily = new GaugeMetricFamily( names.getAvailableConcurrentCallsMetricName(), "The number of available concurrent calls", LabelNames.NAME ); GaugeMetricFamily maxAllowedCallsFamily = new GaugeMetricFamily( names.getMaxAllowedConcurrentCallsMetricName(), "The maximum number of allowed concurrent calls", LabelNames.NAME ); for (Bulkhead bulkhead: bulkheadsSupplier.get()) { List<String> labelValues = singletonList(bulkhead.getName()); availableCallsFamily.addMetric(labelValues, bulkhead.getMetrics().getAvailableConcurrentCalls()); maxAllowedCallsFamily.addMetric(labelValues, bulkhead.getMetrics().getMaxAllowedConcurrentCalls()); } return asList(availableCallsFamily, maxAllowedCallsFamily); }
Source:
<code>public void prepare() { configureServices(); logger.debug("Preparing kjar"); KieServices ks = KieServices.Factory.get(); ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION); <START> List<String> processes = new ArrayList<String>(); <END> processes.add("repo/processes/general/SingleHumanTaskWithVarsA.bpmn2"); processes.add("repo/processes/general/SingleHumanTaskWithVarsB.bpmn2"); InternalKieModule kJar1 = createKieJar(ks, releaseId, processes); File pom = new File("target/kmodule", "pom.xml"); pom.getParentFile().mkdir(); try (FileOutputStream fs = new FileOutputStream(pom);) { fs.write(getPom(releaseId).getBytes()); } catch (Exception e) { } KieMavenRepository repository = getKieMavenRepository(); repository.deployArtifact(releaseId, kJar1, pom); assertNotNull(deploymentService); deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION); deploymentService.deploy(deploymentUnit); units.add(deploymentUnit); assertNotNull(processService); processIds = new ArrayList<>(); for (int i = 0; i < 10; i++) { Map<String, Object> inputsA1 = new HashMap<>(); inputsA1.put("var_a", "a" + (i % 3)); inputsA1.put("var_b", (i % 3)); processIds.add(processService.startProcess(deploymentUnit.getIdentifier(), "test.test_A", inputsA1)); } for (int i = 0; i < 10; i++) { Map<String, Object> inputsB1 = new HashMap<>(); inputsB1.put("var_a", "b" + (i % 3)); inputsB1.put("var_b", (i % 3)); processIds.add(processService.startProcess(deploymentUnit.getIdentifier(), "test.test_B", inputsB1)); } }</code><technical_language>ArrayList < String > is redundant. ArrayList<> enough</technical_language>

Target:
public void prepare() { configureServices(); logger.debug("Preparing kjar"); KieServices ks = KieServices.Factory.get(); ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION); List<String> processes = new ArrayList<>(); processes.add("repo/processes/general/SingleHumanTaskWithVarsA.bpmn2"); processes.add("repo/processes/general/SingleHumanTaskWithVarsB.bpmn2"); InternalKieModule kJar1 = createKieJar(ks, releaseId, processes); File pom = new File("target/kmodule", "pom.xml"); pom.getParentFile().mkdir(); try (FileOutputStream fs = new FileOutputStream(pom);) { fs.write(getPom(releaseId).getBytes()); } catch (Exception e) { } KieMavenRepository repository = getKieMavenRepository(); repository.deployArtifact(releaseId, kJar1, pom); assertNotNull(deploymentService); deploymentUnit = new KModuleDeploymentUnit(GROUP_ID, ARTIFACT_ID, VERSION); deploymentService.deploy(deploymentUnit); units.add(deploymentUnit); assertNotNull(processService); processIds = new ArrayList<>(); for (int i = 0; i < 10; i++) { Map<String, Object> inputsA1 = new HashMap<>(); inputsA1.put("var_a", "a" + (i % 3)); inputsA1.put("var_b", (i % 3)); processIds.add(processService.startProcess(deploymentUnit.getIdentifier(), "test.test_A", inputsA1)); } for (int i = 0; i < 10; i++) { Map<String, Object> inputsB1 = new HashMap<>(); inputsB1.put("var_a", "b" + (i % 3)); inputsB1.put("var_b", (i % 3)); processIds.add(processService.startProcess(deploymentUnit.getIdentifier(), "test.test_B", inputsB1)); } }
Source:
<code>protected BatchElementConfiguration collectHistoricDecisionInstanceIds(CommandContext commandContext) { BatchElementConfiguration elementConfiguration = new BatchElementConfiguration(); if (!CollectionUtil.isEmpty(historicDecisionInstanceIds)) { HistoricDecisionInstanceQueryImpl query = new HistoricDecisionInstanceQueryImpl(); <START> query.decisionInstanceIdIn(historicDecisionInstanceIds.toArray(new String[historicDecisionInstanceIds.size()])); <END> elementConfiguration.addDeploymentMappings( commandContext.runWithoutAuthorization(query::listDeploymentIdMappings), historicDecisionInstanceIds); } final HistoricDecisionInstanceQueryImpl decisionInstanceQuery = (HistoricDecisionInstanceQueryImpl) historicDecisionInstanceQuery; if (decisionInstanceQuery != null) { elementConfiguration.addDeploymentMappings(decisionInstanceQuery.listDeploymentIdMappings()); } return elementConfiguration; }</code><technical_language>suggestion query.decisionInstanceIdIn(historicDecisionInstanceIds.toArray(new String[0]));</technical_language>

Target:
protected BatchElementConfiguration collectHistoricDecisionInstanceIds(CommandContext commandContext) { BatchElementConfiguration elementConfiguration = new BatchElementConfiguration(); if (!CollectionUtil.isEmpty(historicDecisionInstanceIds)) { HistoricDecisionInstanceQueryImpl query = new HistoricDecisionInstanceQueryImpl(); query.decisionInstanceIdIn(historicDecisionInstanceIds.toArray(new String[0])); elementConfiguration.addDeploymentMappings( commandContext.runWithoutAuthorization(query::listDeploymentIdMappings), historicDecisionInstanceIds); } final HistoricDecisionInstanceQueryImpl decisionInstanceQuery = (HistoricDecisionInstanceQueryImpl) historicDecisionInstanceQuery; if (decisionInstanceQuery != null) { elementConfiguration.addDeploymentMappings(decisionInstanceQuery.listDeploymentIdMappings()); } return elementConfiguration; }
Source:
<code>private <T extends Serializable> void sendMessageToLocalRegionAsync(final T body ) throws IOException { if ( sqsAsync == null ) { logger.error( "SQS client is null, perhaps it failed to initialize successfully" ); return; } final String stringBody = toString( body ); String url = getReadQueue().getUrl(); if ( logger.isTraceEnabled() ) { logger.trace( "Publishing Message...{} to url: {}", stringBody, url ); } SendMessageRequest request = new SendMessageRequest( url, stringBody ); sqsAsync.sendMessageAsync( request, new AsyncHandler<SendMessageRequest, SendMessageResult>() { @Override public void onError( final Exception e ) { <START> logger.error("Failed to send this message {}. To this address {}. Error was ", stringBody, url, e); <END> } @Override public void onSuccess( final SendMessageRequest request, final SendMessageResult sendMessageResult ) { if ( logger.isTraceEnabled() ) { logger.trace( "Successfully send... messageBody=[{}], url=[{}]", request.getMessageBody(), request.getQueueUrl() ); } } } ); }</code><technical_language>common format</technical_language>

Target:
private <T extends Serializable> void sendMessageToLocalRegionAsync(final T body ) throws IOException { if ( sqsAsync == null ) { logger.error( "SQS client is null, perhaps it failed to initialize successfully" ); return; } final String stringBody = toString( body ); String url = getReadQueue().getUrl(); if ( logger.isTraceEnabled() ) { logger.trace( "Publishing Message...{} to url: {}", stringBody, url ); } SendMessageRequest request = new SendMessageRequest( url, stringBody ); sqsAsync.sendMessageAsync( request, new AsyncHandler<SendMessageRequest, SendMessageResult>() { @Override public void onError( final Exception e ) { logger.error(FAILED_TO_SEND_MESSAGE, stringBody, url, e); } @Override public void onSuccess( final SendMessageRequest request, final SendMessageResult sendMessageResult ) { if ( logger.isTraceEnabled() ) { logger.trace( "Successfully send... messageBody=[{}], url=[{}]", request.getMessageBody(), request.getQueueUrl() ); } } } ); }
Source:
<code>public void canBuildFromSingleClientLimit() { Map<String, Long> clientLimits = new HashMap<>(1); <START> clientLimits.put("test_client", 10L); <END> assertThat(ImmutableQosServiceRuntimeConfig.builder().clientLimits(clientLimits).build()) .isInstanceOf(QosServiceRuntimeConfig.class); }</code><technical_language>nit: ImmutableMap.of(...)</technical_language>

Target:
public void canBuildFromSingleClientLimit() { ImmutableQosServiceRuntimeConfig.builder() .clientLimits(ImmutableMap.of("test_client", 10L)) .build(); }
Source:
<code>public static File createBundle(File workDir, String actual, String basis) throws IOException, NullPointerException { Git user = Git.open(workDir); Repository repo = user.getRepository(); Ref actualRef = repo.exactRef(actual); <START> if (actualRef == null) throw new IOException(); <END> BundleWriter bundlewriter = new BundleWriter(repo); File bundle = File.createTempFile("file", ".bundle"); OutputStream fos = new FileOutputStream(bundle); ProgressMonitor monitor = NullProgressMonitor.INSTANCE; bundlewriter.include(actualRef); if (basis != "") { RevWalk walk = new RevWalk(repo); try { RevCommit basisCommit = walk.parseCommit(repo.resolve(basis)); bundlewriter.assume(basisCommit); } catch (Exception e) { throw new IOException(); } } bundlewriter.writeBundle(monitor, fos); return bundle; }</code><technical_language>If throw exception please provide a message. IllegalArgumentException</technical_language>

Target:
public static File createBundle(File workDir, String actual, String basis) throws IllegalArgumentException, IOException { Git git; try { git = Git.open(workDir); } catch (IOException e) { throw new IllegalArgumentException("workDir can't be resolved", e); } Repository repo = git.getRepository(); BundleWriter bundlewriter = new BundleWriter(repo); Ref actualRef; try { actualRef = repo.exactRef(actual); } catch (IOException e) { throw new IllegalArgumentException("actual can't be resolved", e); } if (actualRef == null) throw new IllegalArgumentException("actual can't be resolved"); bundlewriter.include("refs/heads/bundle", actualRef.getObjectId()); if (basis != "") { try { RevWalk walk = new RevWalk(repo); RevCommit basisCommit = walk.parseCommit(repo.resolve(basis)); bundlewriter.assume(basisCommit); } catch (Exception e) { throw new IllegalArgumentException("basis can't be resolved", e); } } File bundle; try { bundle = File.createTempFile("file", ".bundle"); OutputStream fos = new FileOutputStream(bundle); ProgressMonitor monitor = NullProgressMonitor.INSTANCE; bundlewriter.writeBundle(monitor, fos); } catch (Exception e) { throw new IOException("failed to write bundle", e); } return bundle; }
Source:
<code><START> synchronized public <T> Action getAction(T subject) { <END> if (!(subject instanceof Source)) { return null; } Source source = (Source) subject; return sourceIdToAction.get(source.getId()); }</code><technical_language>making this <T extends Source> remove need for instanceof casting</technical_language>

Target:
public synchronized <T> Action getAction(T subject) { if (!(subject instanceof Source)) { return null; } Source source = (Source) subject; if (source.getId().equals(sourceId)) { return toAction(); } return null; }
Source:
<code>public void setMold(String mold) { if (this._indeterminate && ("switch".equals(mold) || "toggle".equals(mold))) throw new UiException("Checkbox switch/toggle mold not support indeterminate yet." + this); <START> if (mold.equals("tristate") && _init) { <END> super.setMold(mold); setIndeterminate(true); } else { super.setMold(mold); } }</code><technical_language>"tristate".equals</technical_language>

Target:
public void setMold(String mold) { if (this._indeterminate && ("switch".equals(mold) || "toggle".equals(mold))) throw new UiException("Checkbox switch/toggle mold does not support indeterminate yet." + this); super.setMold(mold); }
Source:
<code>private WifiConfiguration[] loadConfiguredNetworksSorted() { WifiManager wifiManager = (WifiManager) getContext().getSystemService(Context.WIFI_SERVICE); if (wifiManager != null) { List<WifiConfiguration> configuredNetworks = wifiManager.getConfiguredNetworks(); if (configuredNetworks != null) { WifiConfiguration[] result = configuredNetworks.toArray(new WifiConfiguration[configuredNetworks.size()]); Arrays.sort(result, new Comparator<WifiConfiguration>() { @Override public int compare(WifiConfiguration lhs, WifiConfiguration rhs) { String l = lhs != null && lhs.SSID != null ? lhs.SSID : ""; String r = rhs != null && rhs.SSID != null ? rhs.SSID : ""; <START> return l.compareToIgnoreCase(r); <END> } }); return result; } } return null; }</code><technical_language>Is reason check if config is null? issue (and other fix) is SSID null, I handle that. pretty annoying Java a standard method for this, [this code](<LINK_0> shorten (which complicated)</technical_language>

Target:
private WifiConfiguration[] loadConfiguredNetworksSorted() { WifiManager wifiManager = (WifiManager) getContext().getSystemService(Context.WIFI_SERVICE); if (wifiManager != null) { List<WifiConfiguration> configuredNetworks = wifiManager.getConfiguredNetworks(); if (configuredNetworks != null) { WifiConfiguration[] result = configuredNetworks.toArray(new WifiConfiguration[configuredNetworks.size()]); Arrays.sort(result, new Comparator<WifiConfiguration>() { @Override public int compare(WifiConfiguration lhs, WifiConfiguration rhs) { String l = lhs.SSID != null ? lhs.SSID : ""; String r = rhs.SSID != null ? rhs.SSID : ""; return l.compareToIgnoreCase(r); } }); return result; } } return null; }
Source:
<code>public Map<String, String> getOptions() { Map<String, String> options = new LinkedHashMap<>(); ResourceResolver resourceResolver = getHelper().getRequest().getResourceResolver(); if (null != resourceResolver) { PageManager pageManager = resourceResolver.adaptTo(PageManager.class); if (pageManager == null) { LOGGER.debug("Page manager is null, hence exiting the process and returning empty map"); return Collections.emptyMap(); } if (!hasOption(GENERIC_LIST_PATH)) { LOGGER.debug("Generic list path is null, hence exiting the process and returning empty map"); return Collections.emptyMap(); } Optional<String> listPath = getOption(GENERIC_LIST_PATH); <START> Page genericListPage = pageManager.getPage(listPath.get()); <END> if (genericListPage == null) { LOGGER.debug("Generic List Page is null, hence exiting the select options process and returning empty map"); return Collections.emptyMap(); } GenericList itemList = genericListPage.adaptTo(GenericList.class); if (itemList == null) { return Collections.emptyMap(); } options.put(StringUtils.EMPTY, "Select the Option"); itemList.getItems().forEach(item -> options.put(item.getValue(), item.getTitle())); } else { LOGGER.error("Exception occurred while initiating the deck generation"); } return options; }</code><technical_language>if working Optional .map(...) subsequent steps more readable</technical_language>

Target:
public Map<String, String> getOptions() { Map<String, String> options = new LinkedHashMap<>(); if (null != getHelper() && null != getHelper().getRequest() && null != getHelper().getRequest().getResourceResolver()) { ResourceResolver resourceResolver = getHelper().getRequest().getResourceResolver(); PageManager pageManager = resourceResolver.adaptTo(PageManager.class); if (pageManager == null) { LOGGER.debug("Page manager is null, hence exiting the process and returning empty map"); return Collections.emptyMap(); } if (!hasOption(GENERIC_LIST_PATH)) { LOGGER.debug("Generic list path is null, hence exiting the process and returning empty map"); return Collections.emptyMap(); } Optional<String> listPath = getOption(GENERIC_LIST_PATH); if (!listPath.isPresent()){ LOGGER.debug("Generic list path under getOption is null, hence exiting the select options process and returning empty map"); return Collections.emptyMap(); } Page genericListPage = pageManager.getPage(listPath.get()); if (genericListPage == null) { LOGGER.debug("Generic List Page is null, hence exiting the select options process and returning empty map"); return Collections.emptyMap(); } GenericList itemList = genericListPage.adaptTo(GenericList.class); if (itemList == null) { return Collections.emptyMap(); } options.put(StringUtils.EMPTY, "Select the Option"); itemList.getItems().forEach(item -> options.put(item.getValue(), item.getTitle())); } else { LOGGER.error("Resource resolver is null while getting the generic list"); } return options; }
Source:
<code>public String toString() { <START> return "Element [" + timestamp + "/" + offset + "]"; END> }</code><technical_language>'/' ']' avoid need for extra NON-NLS</technical_language>

Target:
public String toString() { return "Element [" + timestamp + '/' + offset + ']'; }
Source:
<code>@Inject public DebugIntentFactory(@IsMockMode boolean isMockMode, @UseExternalApps BooleanPreference useExternalApps) { <START> super(); <END> this.isMockMode = isMockMode; this.useExternalApps = useExternalApps; }</code><technical_language>Delete</technical_language>

Target:
@Inject public DebugIntentFactory(@IsMockMode boolean isMockMode, @UseExternalApps BooleanPreference useExternalApps) { this.isMockMode = isMockMode; this.useExternalApps = useExternalApps; }
Source:
<code>private static boolean doIsTest(IType iType) { <START> ITestContent testContent = TypeParser.parseType(iType); <END> if (testContent.hasTestMethods()) { return true; } IType[] superclasses; try { superclasses = iType.newSupertypeHierarchy(null).getAllSuperclasses(iType); } catch (JavaModelException e) { TestNGPlugin.log("Could not resolve supertype of "+iType.getFullyQualifiedName()); return false; } for (IType superclass : superclasses) { ITestContent superContent = TypeParser.parseType(superclass); if (superContent.hasTestMethods()) { return true; } } return false; }</code><technical_language>a check if iType is abstract beginning of this method: java if (Flags.isAbstract(iType.getFlags())) { return false; }</technical_language>

Target:
private static boolean doIsTest(IType iType) throws JavaModelException { if (Flags.isAbstract(iType.getFlags())) { return false; } ITestContent testContent = TypeParser.parseType(iType); if (testContent.hasTestMethods()) { return true; } IType[] superclasses; try { superclasses = iType.newSupertypeHierarchy(null).getAllSuperclasses(iType); } catch (JavaModelException e) { TestNGPlugin.log("Could not resolve supertype of "+iType.getFullyQualifiedName()); return false; } for (IType superclass : superclasses) { ITestContent superContent = TypeParser.parseType(superclass); if (superContent.hasTestMethods()) { return true; } } return false; }
Source:
<code>private static Map<String, ModuleService> loadModules(Class cls) { Map<String, ModuleService> modules = new HashMap<>(); if(cls != null) { Map<String, ExtensionProxy> proxies = new HashMap<>(); ExtMap context = new ExtMap() .mput(ModuleService.EXTENSIONS_MAP, proxies) .mput(ModuleService.PROGRAM_NAME, PROGRAM_NAME); ServiceLoader<ModuleService> loader = ServiceLoader.load(cls); for (ModuleService module : loader) { modules.put(module.getName(), module); module.setContext(context); } } <START> logger.debug("Loaded modules: {}", StringUtils.join(modules.keySet(), ",")); <END> return modules; }</code><technical_language>need for StringUtils, modules.keySet() work nicely :)</technical_language>

Target:
private static Map<String, ModuleService> loadModules(Class cls) { Map<String, ModuleService> modules = new HashMap<>(); if(cls != null) { Map<String, ExtensionProxy> proxies = new HashMap<>(); ExtMap context = new ExtMap() .mput(ModuleService.EXTENSIONS_MAP, proxies) .mput(ModuleService.PROGRAM_NAME, PROGRAM_NAME); ServiceLoader<ModuleService> loader = ServiceLoader.load(cls); for (ModuleService module : loader) { modules.put(module.getName(), module); module.setContext(context); } } logger.debug("Loaded modules: {}", modules.keySet()); return modules; }
Source:
<code>public void updateLinksPosition(ServoData data) { if (noUpdatePosition) return; for (DHLink l : arm.getLinks()) { if (l.getName().equals(data.name)) { l.addPositionValue(data.pos); <START> l.setVelocity(data.speed); <END> l.setTargetPos(data.targetPos); l.setCurrentPos(data.pos); } } }</code><technical_language>velocity</technical_language>

Target:
public void updateLinksPosition(ServoData data) { if (noUpdatePosition) return; for (DHLink l : arm.getLinks()) { if (l.getName().equals(data.name)) { l.addPositionValue(data.pos); l.setCurrentPos(data.pos); } } }
Source:
<code>private void filterPeaksTemp2(DataPointStream Rpeak_temp2, DataPointStream Rpeak_temp1, double frequency) { Rpeak_temp2.data.addAll(Rpeak_temp1.data); boolean difference = false; while (!difference) { int length_Rpeak_temp2 = Rpeak_temp2.data.size(); <START> List<Long> diffRpeak = new ArrayList<Long>(); <END> for (int j = 1; j < Rpeak_temp2.data.size(); j++) { diffRpeak.add(Rpeak_temp2.data.get(j).timestamp - Rpeak_temp2.data.get(j - 1).timestamp); } List<Integer> eli_index = new ArrayList<Integer>(); for (int j = 0; j < diffRpeak.size(); j++) { if (diffRpeak.get(j) < (AUTOSENSE.RPEAK_INTERPEAK_MULTIPLIER*1000)) { if (Rpeak_temp2.data.get(j).value < Rpeak_temp2.data.get(j + 1).value) { eli_index.add(0); } else { eli_index.add(1); } } else { eli_index.add(-999999); } } for (int j = 0; j < diffRpeak.size(); j++) { if (diffRpeak.get(j) < (AUTOSENSE.RPEAK_INTERPEAK_MULTIPLIER*1000)) { Rpeak_temp2.data.set(j + eli_index.get(j), new DataPoint(0, -999999)); } } for (Iterator<DataPoint> it = Rpeak_temp2.data.iterator(); it.hasNext(); ) { if (it.next().value == -999999) { it.remove(); } } difference = (length_Rpeak_temp2 == Rpeak_temp2.data.size()); } }</code><technical_language>DataPoint data structure removed</technical_language>

Target:
private void filterPeaksTemp2(DataPointStream Rpeak_temp2, DataPointStream Rpeak_temp1, double frequency) { Rpeak_temp2.data.addAll(Rpeak_temp1.data); boolean difference = false; while (!difference) { int length_Rpeak_temp2 = Rpeak_temp2.data.size(); List<Long> diffRpeak = new ArrayList<Long>(); for (int j = 1; j < Rpeak_temp2.data.size(); j++) { diffRpeak.add(Rpeak_temp2.data.get(j).timestamp - Rpeak_temp2.data.get(j - 1).timestamp); } List<Integer> eli_index = new ArrayList<Integer>(); for (int j = 0; j < diffRpeak.size(); j++) { if (diffRpeak.get(j) < (AUTOSENSE.RPEAK_INTERPEAK_LIMIT)) { if (Rpeak_temp2.data.get(j).value < Rpeak_temp2.data.get(j + 1).value) { eli_index.add(0); } else { eli_index.add(1); } } else { eli_index.add(-999999); } } for (int j = 0; j < diffRpeak.size(); j++) { if (diffRpeak.get(j) < (AUTOSENSE.RPEAK_INTERPEAK_LIMIT)) { Rpeak_temp2.data.set(j + eli_index.get(j), new DataPoint(0, -999999)); } } for (Iterator<DataPoint> it = Rpeak_temp2.data.iterator(); it.hasNext(); ) { if (it.next().value == -999999) { it.remove(); } } difference = (length_Rpeak_temp2 == Rpeak_temp2.data.size()); } }