auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void save(StoragePool pool) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("description", pool.getdescription()) .addValue("free_text_comment", pool.getComment()) .addValue("id", pool.getId()) .addValue("is_local", pool.isLocal()) .addValue("name", pool.getName()) .addValue("status", pool.getStatus()) .addValue("master_domain_version", pool.getmaster_domain_version()) .addValue("spm_vds_id", pool.getspm_vds_id()) .addValue("quota_enforcement_type", pool.getQuotaEnforcementType()) .addValue("compatibility_version", pool.getcompatibility_version()); getCallsHandler().executeModification("Insertstorage_pool", parameterSource); }

Target:
public void save(StoragePool pool) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("description", pool.getdescription()) .addValue("free_text_comment", pool.getComment()) .addValue("id", pool.getId()) .addValue("name", pool.getName()) .addValue("is_local", pool.isLocal()) .addValue("status", pool.getStatus()) .addValue("master_domain_version", pool.getmaster_domain_version()) .addValue("spm_vds_id", pool.getspm_vds_id()) .addValue("quota_enforcement_type", pool.getQuotaEnforcementType()) .addValue("compatibility_version", pool.getcompatibility_version()); getCallsHandler().executeModification("Insertstorage_pool", parameterSource); }
Source:
private Properties loadDefaultProperties() throws IOException { Properties merged = new Properties(); try { PGProperty.USER.set(merged, System.getProperty("user.name")); } catch (SecurityException se) { } ClassLoader cl = getClass().getClassLoader(); if (cl == null) { cl = ClassLoader.getSystemClassLoader(); } if (cl == null) { LOGGER.log(Level.FINE, "Can't find a classloader for the Driver; not loading driver configuration"); return merged; } LOGGER.log(Level.FINE, "Loading driver configuration via classloader {0}", cl); ArrayList<URL> urls = new ArrayList<URL>(); Enumeration<URL> urlEnum = cl.getResources("org/postgresql/driverconfig.properties"); while (urlEnum.hasMoreElements()) { urls.add(urlEnum.nextElement()); } for (int i = urls.size() - 1; i >= 0; i--) { URL url = urls.get(i); LOGGER.log(Level.FINE, "Loading driver configuration from: {0}", url); InputStream is = url.openStream(); merged.load(is); is.close(); } return merged; }

Target:
private Properties loadDefaultProperties() throws IOException { Properties merged = new Properties(); try { PGProperty.USER.set(merged, System.getProperty("user.name")); } catch (SecurityException se) { } ClassLoader cl = getClass().getClassLoader(); if (cl == null) { LOGGER.log(Level.FINE, "Can't find our classloader for the Driver; " + "attempt to use the system class loader"); cl = ClassLoader.getSystemClassLoader(); } if (cl == null) { LOGGER.log(Level.WARNING, "Can't find a classloader for the Driver; not loading driver " + "configuration from org/postgresql/driverconfig.properties"); return merged; } LOGGER.log(Level.FINE, "Loading driver configuration via classloader {0}", cl); ArrayList<URL> urls = new ArrayList<URL>(); Enumeration<URL> urlEnum = cl.getResources("org/postgresql/driverconfig.properties"); while (urlEnum.hasMoreElements()) { urls.add(urlEnum.nextElement()); } for (int i = urls.size() - 1; i >= 0; i--) { URL url = urls.get(i); LOGGER.log(Level.FINE, "Loading driver configuration from: {0}", url); InputStream is = url.openStream(); merged.load(is); is.close(); } return merged; }
Source:
public Set<String> upgrade(Map<String, Object> settings) { K9.Theme messageViewTheme = (K9.Theme) settings.get("message_view_theme"); K9.Theme theme = (K9.Theme) settings.get("theme"); if (theme != null && messageViewTheme != null && theme == messageViewTheme) { settings.put("message_view_theme", K9.Theme.USE_GLOBAL); } return null; }

Target:
public Set<String> upgrade(Map<String, Object> settings) { K9.Theme messageViewTheme = (K9.Theme) settings.get("messageViewTheme"); K9.Theme theme = (K9.Theme) settings.get("theme"); if (theme != null && messageViewTheme != null && theme == messageViewTheme) { settings.put("messageViewTheme", K9.Theme.USE_GLOBAL); } return null; }
Source:
public boolean configure(StaplerRequest req, JSONObject json) throws FormException { ignoredWarnings.clear(); if (json.has("ignoredWarnings")) { JSONArray warnings = json.optJSONArray("ignoredWarnings"); if (warnings != null) { for (int i = 0; i < warnings.size(); i++) { ignore(warnings.getString(i)); } } else { ignore(json.getString("ignoredWarnings")); } } return true; }

Target:
public boolean configure(StaplerRequest req, JSONObject json) throws FormException { HashSet<String> newIgnoredWarnings = new HashSet<>(); for (Object key : json.keySet()) { String warningKey = key.toString(); if (!json.getBoolean(warningKey)) { newIgnoredWarnings.add(warningKey); } } this.ignoredWarnings = newIgnoredWarnings; this.save(); return true; }
Source:
public String docs() { return "{clicked: the type of entity being clicked | x: <expression> | y: <expression> | z: <expression> }" + " Fires when a player right clicks an entity. Only cancels Armor Stand interactions." + " {player: the player clicking | clicked | id: the id of the entity" + " | data: if a player is clicked, this will contain their name" + " | position: relative location of the click on the entity}" + " {}" + " {player|clicked|id|data}"; }

Target:
public String docs() { return "{clicked: the type of entity being clicked | x: <expression> offset of clicked location" + " from entity location on the x axis. | y: <expression> | z: <expression> }" + " Fires when a player right clicks an entity. This event is like player_interact_entity but also" + " has the click position, and when cancelled only cancels interactions with Armor Stand entities." + " {player: the player clicking | clicked | id: the id of the entity" + " | data: if a player is clicked, this will contain their name" + " | position: offset of clicked location from entity location in an xyz array.}" + " {}" + " {player|clicked|id|data}"; }
Source:
public void setup() throws IOException, URISyntaxException { canReadFileName = this.getClass().getResource("small_file.txt").toURI().toASCIIString().replaceAll("file:", ""); System.setProperty("org.ovirt.engine.mime.types", this.getClass().getResource("mime.types").toURI().toASCIIString().replaceAll("file:", "")); }

Target:
public void setup() throws IOException, URISyntaxException { canReadFileName = this.getClass().getResource("small_file.txt").toURI().toASCIIString().replaceAll("file:", ""); }
Source:
private void completeSnapshotTransfer(LogReplicationEntry message) { topologyConfigId = message.getMetadata().getTopologyConfigId(); logReplicationMetadataManager.setLastSnapshotTransferCompleteTimestamp(topologyConfigId, message.getMetadata().getSnapshotTimestamp()); }

Target:
private void completeSnapshotTransfer(LogReplicationEntry message) { logReplicationMetadataManager.setLastSnapshotTransferCompleteTimestamp(topologyConfigId, message.getMetadata().getSnapshotTimestamp()); }
Source:
public void theReplaceKeysResponseShouldBeReturned(final Map<String, String> responseParameters) throws Throwable { final String correlationUid = (String) ScenarioContext.current().get(PlatformKeys.KEY_CORRELATION_UID); final Map<String, String> extendedParameters = SettingsHelper.addDefault(responseParameters, PlatformKeys.KEY_CORRELATION_UID, correlationUid); try { final ReplaceKeysAsyncRequest replaceKeysAsyncRequest = ReplaceKeysRequestFactory .fromParameterMapAsync(extendedParameters); final ReplaceKeysResponse response = this.smartMeteringConfigurationClient .getReplaceKeysResponse(replaceKeysAsyncRequest); final String expectedResult = responseParameters.get(PlatformKeys.KEY_RESULT); assertNotNull("Result", response.getResult()); assertEquals("Result", expectedResult, response.getResult().name()); } catch (final Exception exception) { ScenarioContext.current().put(PlatformKeys.RESPONSE, exception); } }

Target:
public void theReplaceKeysResponseShouldBeReturned(final Map<String, String> responseParameters) throws Throwable { final String correlationUid = (String) ScenarioContext.current().get(PlatformKeys.KEY_CORRELATION_UID); final Map<String, String> extendedParameters = SettingsHelper.addDefault(responseParameters, PlatformKeys.KEY_CORRELATION_UID, correlationUid); final ReplaceKeysAsyncRequest replaceKeysAsyncRequest = ReplaceKeysRequestFactory .fromParameterMapAsync(extendedParameters); final ReplaceKeysResponse response = this.smartMeteringConfigurationClient .getReplaceKeysResponse(replaceKeysAsyncRequest); final String expectedResult = responseParameters.get(PlatformKeys.KEY_RESULT); assertNotNull("Result", response.getResult()); assertEquals("Result", expectedResult, response.getResult().name()); }
Source:
private void processResponse(String responseText) throws LIRCResponseException { String[] parts = responseText.split("\n"); String command = parts[0]; boolean success = true; int dataLength = 0; String[] data = null; if (parts.length > 1) { if ("SUCCESS".equals(parts[1]) || "ERROR".equals(parts[1])) { success = "SUCCESS".equals(parts[1]); } else { throw new LIRCResponseException("Malformed response"); } } if (parts.length > 2) { if ("DATA".equals(parts[2]) && parts.length > 3) { dataLength = Integer.parseInt(parts[3]); } else { throw new LIRCResponseException("Malformed response"); } } if (parts.length > 4) { data = Arrays.copyOfRange(parts, 4, parts.length); if (data.length != dataLength) { throw new LIRCResponseException(String .format("Data does not match expected length. Expected: %s, Got: %s", dataLength, data.length)); } } LIRCResponse response = new LIRCResponse(); response.setCommand(command); response.setSuccess(success); response.setData(data); connector.sendMessageToListeners(response); }

Target:
private void processResponse(String responseText) throws LIRCResponseException { String[] parts = responseText.split("\n"); String command = parts[0]; boolean success = true; int dataLength = 0; String[] data = null; if (parts.length > 1) { if ("SUCCESS".equals(parts[1]) || "ERROR".equals(parts[1])) { success = "SUCCESS".equals(parts[1]); } else { throw new LIRCResponseException("Malformed response"); } } if (parts.length > 2) { if ("DATA".equals(parts[2]) && parts.length > 3) { dataLength = Integer.parseInt(parts[3]); } else { throw new LIRCResponseException("Malformed response"); } } if (parts.length > 4) { data = Arrays.copyOfRange(parts, 4, parts.length); if (data.length != dataLength) { throw new LIRCResponseException(String .format("Data does not match expected length. Expected: %s, Got: %s", dataLength, data.length)); } } LIRCResponse response = new LIRCResponse(command, success, data); connector.sendMessageToListeners(response); }
Source:
public String[] getComputerNames() { return getActive().stream().map(a -> a.getSimpleName()).collect(Collectors.toList()) .toArray(new String[computers.size()]); }

Target:
public String[] getComputerNames() { return getActiveComputers().stream().map(a -> a.getSimpleName()).collect(Collectors.toList()) .toArray(new String[computers.size()]); }
Source:
private File removeDuplicatesFromJar(File in, List<String> duplicates) { String target = project.getBuild().getOutputDirectory(); File tmp = new File(target, "unpacked-wembedded-jars"); tmp.mkdirs(); File out = new File(tmp, in.getName()); if (out.exists()) { return out; } else { try { out.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } FileOutputStream fos = null; ZipOutputStream jos = null; try { fos = new FileOutputStream(out); jos = new ZipOutputStream(fos); } catch (FileNotFoundException e1) { getLog().error("Cannot remove duplicates : the output file " + out.getAbsolutePath() + " does not found"); return null; } ZipFile inZip = null; try { inZip = new ZipFile(in); Enumeration< ? extends ZipEntry> entries = inZip.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); if (! duplicates.contains(entry.getName())) { jos.putNextEntry(entry); InputStream currIn = inZip.getInputStream(entry); copyStreamWithoutClosing(currIn, jos); currIn.close(); jos.closeEntry(); } } } catch (IOException e) { getLog().error("Cannot removing duplicates : " + e.getMessage()); return null; } try { if (inZip != null) { inZip.close(); } jos.close(); fos.close(); jos = null; fos = null; } catch (IOException e) { } getLog().info(in.getName() + " rewritten without duplicates : " + out.getAbsolutePath()); return out; }

Target:
private File removeDuplicatesFromJar(File in, List<String> duplicates) { String target = project.getBuild().getOutputDirectory(); File tmp = new File(target, "unpacked-embedded-jars"); tmp.mkdirs(); File out = new File(tmp, in.getName()); if (out.exists()) { return out; } else { try { out.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } FileOutputStream fos = null; ZipOutputStream jos = null; try { fos = new FileOutputStream(out); jos = new ZipOutputStream(fos); } catch (FileNotFoundException e1) { getLog().error("Cannot remove duplicates : the output file " + out.getAbsolutePath() + " does not found"); return null; } ZipFile inZip = null; try { inZip = new ZipFile(in); Enumeration< ? extends ZipEntry> entries = inZip.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); if (! duplicates.contains(entry.getName())) { jos.putNextEntry(entry); InputStream currIn = inZip.getInputStream(entry); copyStreamWithoutClosing(currIn, jos); currIn.close(); jos.closeEntry(); } } } catch (IOException e) { getLog().error("Cannot removing duplicates : " + e.getMessage()); return null; } try { if (inZip != null) { inZip.close(); } jos.close(); fos.close(); jos = null; fos = null; } catch (IOException e) { } getLog().info(in.getName() + " rewritten without duplicates : " + out.getAbsolutePath()); return out; }
Source:
private Properties getJobConfFromFile(RunningJob runningJob) { Properties jobConfProperties = new Properties(); try { log.info("RunningJob Configuration File location: " + runningJob.getJobFile()); Path path = new Path(runningJob.getJobFile()); Configuration conf = new Configuration(false); FileSystem fileSystem = FileSystem.get(new Configuration()); InputStream inputStream = fileSystem.open(path); conf.addResource(inputStream); for (Map.Entry<String, String> entry : conf) { if (entry.getKey().equals("pig.script")) { String script = StringUtils.newStringUtf8(Base64.decodeBase64(entry.getValue())); int lineCounter = 1; script = "<div class=\"jobScript\" id=\"scriptLine" + lineCounter + "\">" + "<span class=\"lineNumber\">" + lineCounter + "</span>" + script; while (script.contains("\n")) { lineCounter++; script = script.replaceFirst("\n", "</div><div class=\"jobScript\" id=\"scriptLine" + lineCounter + "\">" + "<span class=\"lineNumber\">" + lineCounter + "</span>"); } jobConfProperties.setProperty(entry.getKey(), script + "</div>"); } else if (entry.getKey().equals("pig.mapPlan") || entry.getKey().equals("pig.reducePlan")) { jobConfProperties.setProperty(entry.getKey(), ObjectSerializer.deserialize(entry.getValue()).toString()); } else { jobConfProperties.setProperty(entry.getKey(), entry.getValue()); } } } catch (FileNotFoundException e) { log.error("Configuration File Not Found"); } catch (IOException e) { e.printStackTrace(); } return jobConfProperties; }

Target:
private Properties getJobConfFromFile(RunningJob runningJob) { Properties jobConfProperties = new Properties(); try { log.info("RunningJob Configuration File location: " + runningJob.getJobFile()); Path path = new Path(runningJob.getJobFile()); Configuration conf = new Configuration(false); FileSystem fileSystem = FileSystem.get(new Configuration()); InputStream inputStream = fileSystem.open(path); conf.addResource(inputStream); for (Map.Entry<String, String> entry : conf) { if (entry.getKey().equals("pig.mapPlan") || entry.getKey().equals("pig.reducePlan")) { jobConfProperties.setProperty(entry.getKey(), ObjectSerializer.deserialize(entry.getValue()).toString()); } else { jobConfProperties.setProperty(entry.getKey(), entry.getValue()); } } } catch (FileNotFoundException e) { log.warn("Configuration file not found for old jobsflows."); } catch (IOException e) { log.warn("Error occurred when retrieving configuration info.", e); } return jobConfProperties; }
Source:
public synchronized Collection<ModuleDeploymentStatus> getResults() throws InterruptedException { long now = System.currentTimeMillis(); long expiryTime = now + deploymentTimeout.get(); while (pending.size() > 0 && now < expiryTime) { wait(expiryTime - now); now = System.currentTimeMillis(); } for (ContainerModuleKey key : pending) { results.put(key, new ModuleDeploymentStatus(key.container, Integer.valueOf(key.moduleSequence), key.moduleDescriptorKey, ModuleDeploymentStatus.State.failed, String.format("Deployment of module '%s' to container '%s' timed out after %d ms", key.moduleDescriptorKey, key.container, deploymentTimeout))); } return results.values(); }

Target:
public synchronized Collection<ModuleDeploymentStatus> getResults() throws InterruptedException { long now = System.currentTimeMillis(); long expiryTime = now + deploymentTimeout; while (pending.size() > 0 && now < expiryTime) { wait(expiryTime - now); now = System.currentTimeMillis(); } for (ContainerModuleKey key : pending) { results.put(key, new ModuleDeploymentStatus(key.container, Integer.valueOf(key.moduleSequence), key.moduleDescriptorKey, ModuleDeploymentStatus.State.failed, String.format("Deployment of module '%s' to container '%s' timed out after %d ms", key.moduleDescriptorKey, key.container, deploymentTimeout))); } return results.values(); }
Source:
protected JsonNode createPostRequest(GHMRequest ghRequest, Collection<String> outArraysList) { ObjectNode requestJson = objectMapper.createObjectNode(); if (ghRequest.identicalLists) { putPoints(requestJson, "points", ghRequest.getFromPoints()); putStrings(requestJson, "point_hints", ghRequest.getFromPointHints()); putStrings(requestJson, "curbsides", ghRequest.getFromCurbsides()); } else { putPoints(requestJson, "from_points", ghRequest.getFromPoints()); putStrings(requestJson, "from_point_hints", ghRequest.getFromPointHints()); putPoints(requestJson, "to_points", ghRequest.getToPoints()); putStrings(requestJson, "to_point_hints", ghRequest.getToPointHints()); putStrings(requestJson, "from_curbsides", ghRequest.getFromCurbsides()); putStrings(requestJson, "to_curbsides", ghRequest.getToCurbsides()); } putStrings(requestJson, "snap_preventions", ghRequest.getSnapPreventions()); putStrings(requestJson, "out_arrays", outArraysList); requestJson.put("vehicle", ghRequest.getVehicle()); requestJson.put("fail_fast", ghRequest.getFailFast()); Map<String, Object> hintsMap = ghRequest.getHints().toMap(); for (String hintKey : hintsMap.keySet()) { if (ignoreSet.contains(hintKey)) continue; Object hint = hintsMap.get(hintKey); requestJson.put(hintKey, hint.toString()); } return requestJson; }

Target:
protected JsonNode createPostRequest(GHMRequest ghRequest, Collection<String> outArraysList) { ObjectNode requestJson = objectMapper.createObjectNode(); if (ghRequest.identicalLists) { putPoints(requestJson, "points", ghRequest.getFromPoints()); putStrings(requestJson, "point_hints", ghRequest.getFromPointHints()); putStrings(requestJson, "curbsides", ghRequest.getFromCurbsides()); } else { putPoints(requestJson, "from_points", ghRequest.getFromPoints()); putStrings(requestJson, "from_point_hints", ghRequest.getFromPointHints()); putPoints(requestJson, "to_points", ghRequest.getToPoints()); putStrings(requestJson, "to_point_hints", ghRequest.getToPointHints()); putStrings(requestJson, "from_curbsides", ghRequest.getFromCurbsides()); putStrings(requestJson, "to_curbsides", ghRequest.getToCurbsides()); } putStrings(requestJson, "snap_preventions", ghRequest.getSnapPreventions()); putStrings(requestJson, "out_arrays", outArraysList); requestJson.put("vehicle", ghRequest.getVehicle()); requestJson.put("fail_fast", ghRequest.getFailFast()); Map<String, Object> hintsMap = ghRequest.getHints().toMap(); for (String hintKey : hintsMap.keySet()) { if (ignoreSet.contains(hintKey)) continue; Object hint = hintsMap.get(hintKey); if (hint instanceof String) requestJson.put(hintKey, (String) hint); else requestJson.putPOJO(hintKey, hint); } return requestJson; }
Source:
public PlacementResult(T result, boolean adhering) { this.result = result; this.adhering = adhering; }

Target:
private PlacementResult(T result, boolean adhering) { this.result = result; this.adhering = adhering; }
Source:
public void sourceEntriesEndPointTestNonExistingWithNonExistingVariant() throws URISyntaxException { String url = "/v2/variants/100:0:C:T/sources?species=mmusculus&assembly=grcm38"; ResponseEntity<QueryResponse<QueryResult<VariantSourceEntryWithSampleNames>>> sources = restTemplate. exchange(url, HttpMethod.GET, null, new ParameterizedTypeReference<QueryResponse< QueryResult<VariantSourceEntryWithSampleNames>>>() { }); assertEquals(HttpStatus.NOT_FOUND, sources.getStatusCode()); assertTrue(sources.getBody().getResponse().get(0).getResult().size() == 0); }

Target:
public void sourceEntriesEndPointTestNonExistingWithNonExistingVariant() throws URISyntaxException { String url = "/v2/variants/100:0:C:T/sources?species=mmusculus&assembly=grcm38"; ResponseEntity<QueryResponse<QueryResult<VariantSourceEntryWithSampleNames>>> sources = restTemplate. exchange(url, HttpMethod.GET, null, new ParameterizedTypeReference<QueryResponse< QueryResult<VariantSourceEntryWithSampleNames>>>() { }); assertEquals(HttpStatus.NOT_FOUND, sources.getStatusCode()); assertTrue(sources.getBody().getResponse().get(0).getResult().isEmpty()); }
Source:
public void purge(AutoGenerationOption delegate, RequestContext context) throws ResponseException { throw new ResourceDoesNotSupportOperationException("Purging of AutoGenerationOption is not supported"); }

Target:
public void purge(AutoGenerationOption delegate, RequestContext context) throws ResponseException { Context.getService(IdentifierSourceService.class).purgeAutoGenerationOption(delegate); }
Source:
public void impl(@Nonnull CorfuRuntime runtime) throws OutrankedException, ExecutionException, InterruptedException { runtime.invalidateLayout(); newLayout = runtime.getLayoutView().getLayout(); if (newLayout.getAllActiveServers().contains(request.endpoint)) { for (int i = 0; i < newLayout.getSegments().size() - 1; i++) { StateTransfer.transfer(newLayout, Collections.singleton(request.getEndpoint()), runtime, newLayout.getSegments().get(i)); } final int stripeIndex = 0; runtime.getLayoutManagementView() .addLogUnitReplica( new Layout(newLayout), request.getEndpoint(), stripeIndex); runtime.invalidateLayout(); newLayout = runtime.getLayoutView().getLayout(); } else { throw new IllegalStateException("RestoreRedundancy: " + "Node to be added marked unresponsive."); } }

Target:
public void impl(@Nonnull CorfuRuntime runtime) throws OutrankedException, ExecutionException, InterruptedException { runtime.invalidateLayout(); newLayout = runtime.getLayoutView().getLayout(); if (newLayout.getAllActiveServers().contains(request.endpoint)) { for (int i = 0; i < newLayout.getSegments().size() - 1; i++) { transfer(newLayout, Collections.singleton(request.getEndpoint()), runtime, newLayout.getSegments().get(i)); } final int stripeIndex = 0; runtime.getLayoutManagementView() .addLogUnitReplica( new Layout(newLayout), request.getEndpoint(), stripeIndex); runtime.invalidateLayout(); newLayout = runtime.getLayoutView().getLayout(); } else { throw new IllegalStateException("RestoreRedundancy: " + "Node to be added marked unresponsive."); } }
Source:
private void makeRandomDefaultDir() { File f = new File(RedissonRuntimeEnvironment.tempDir + File.separator + UUID.randomUUID()); if (f.exists()) { makeRandomDefaultDir(); } else { System.out.println("REDIS RUNNER: Making directory " + f.getAbsolutePath()); f.mkdirs(); this.defaultDir = f.getAbsolutePath(); if (RedissonRuntimeEnvironment.isWindows) { defaultDir = "\"" + defaultDir.replace("\\", "\\\\") + "\""; } } }

Target:
private void makeRandomDefaultDir() { File f = new File(RedissonRuntimeEnvironment.tempDir + File.separator + UUID.randomUUID()); if (f.exists()) { makeRandomDefaultDir(); } else { System.out.println("REDIS RUNNER: Making directory " + f.getAbsolutePath()); f.mkdirs(); this.defaultDir = f.getAbsolutePath(); if (RedissonRuntimeEnvironment.isWindows) { defaultDir = defaultDir.replace("\\", "\\\\"); } } }
Source:
public void updateInPerspective(@NotNull ActionEvent event) { CurrentProject prj = appContext.getCurrentProject(); event.getPresentation().setVisible(prj != null); event.getPresentation().setEnabled(prj != null && prj.getProjectDescription().getMixins().contains(OPENSHIFT_PROJECT_TYPE_ID)); }

Target:
public void updateInPerspective(@NotNull ActionEvent event) { CurrentProject currentProject = appContext.getCurrentProject(); event.getPresentation().setVisible(currentProject != null); event.getPresentation().setEnabled(currentProject != null && currentProject.getProjectDescription().getMixins().contains(OPENSHIFT_PROJECT_TYPE_ID)); }
Source:
@Test public void testTouchId() { try { driver.touchId(true); driver.touchId(false); assertEquals(true, true); } catch(Exception e){ assertEquals(true, false); } }

Target:
@Test public void testTouchId() { try { driver.performTouchID(true); driver.performTouchID(false); assertEquals(true, true); } catch (Exception e) { throw e; } }
Source:
public static MetadataManager createTestMetadataManager(CatalogManager catalogManager, FeaturesConfig featuresConfig) { TypeManager typeManager = new TypeRegistry(ImmutableSet.of(), featuresConfig); return new MetadataManager( featuresConfig, typeManager, new BlockEncodingManager(typeManager), new SessionPropertyManager(), new SchemaPropertyManager(), new TablePropertyManager(), new ColumnPropertyManager(), InMemoryTransactionManager.createTestTransactionManager(catalogManager)); }

Target:
public static MetadataManager createTestMetadataManager(CatalogManager catalogManager, FeaturesConfig featuresConfig) { TypeManager typeManager = new TypeRegistry(ImmutableSet.of(), featuresConfig); return new MetadataManager( featuresConfig, typeManager, new BlockEncodingManager(typeManager), new SessionPropertyManager(), new SchemaPropertyManager(), new TablePropertyManager(), new ColumnPropertyManager(), createTestTransactionManager(catalogManager)); }
Source:
public String checkOptionalAuth(@Auth Optional<Principal> principalOpt) { return "principal was " + ((principalOpt.isPresent()) ? "" : "not ") + "present"; }

Target:
public String checkOptionalAuth(@Auth Optional<Principal> principalOpt) { return "principal was " + (principalOpt.isPresent() ? "" : "not ") + "present"; }
Source:
private TextAnalyticsPagedResponse<AnalyzeSentimentResult> toTextAnalyticsPagedResponse( SimpleResponse<SentimentResponse> response) { final SentimentResponse sentimentResponse = response.getValue(); final List<AnalyzeSentimentResult> analyzeSentimentResults = new ArrayList<>(); for (DocumentSentiment documentSentiment : sentimentResponse.getDocuments()) { analyzeSentimentResults.add(convertToAnalyzeSentimentResult(documentSentiment)); } for (DocumentError documentError : sentimentResponse.getErrors()) { analyzeSentimentResults.add(new AnalyzeSentimentResultImpl(documentError.getId(), null, toTextAnalyticsError(documentError.getError()), null)); } return new TextAnalyticsPagedResponse<>( response.getRequest(), response.getStatusCode(), response.getHeaders(), analyzeSentimentResults, null, sentimentResponse.getModelVersion(), sentimentResponse.getStatistics() == null ? null : toBatchStatistics(sentimentResponse.getStatistics())); }

Target:
private TextAnalyticsPagedResponse<AnalyzeSentimentResult> toTextAnalyticsPagedResponse( SimpleResponse<SentimentResponse> response) { final SentimentResponse sentimentResponse = response.getValue(); final List<AnalyzeSentimentResult> analyzeSentimentResults = new ArrayList<>(); for (DocumentSentiment documentSentiment : sentimentResponse.getDocuments()) { analyzeSentimentResults.add(convertToAnalyzeSentimentResult(documentSentiment)); } for (DocumentError documentError : sentimentResponse.getErrors()) { if (documentError.getId().isEmpty()) { throw logger.logExceptionAsError( new HttpResponseException(documentError.getError().getInnererror().getMessage(), getEmptyErrorIdHttpResponse(response), documentError.getError().getInnererror().getCode())); } analyzeSentimentResults.add(new AnalyzeSentimentResult(documentError.getId(), null, toTextAnalyticsError(documentError.getError()), null)); } return new TextAnalyticsPagedResponse<>( response.getRequest(), response.getStatusCode(), response.getHeaders(), analyzeSentimentResults, null, sentimentResponse.getModelVersion(), sentimentResponse.getStatistics() == null ? null : toBatchStatistics(sentimentResponse.getStatistics())); }
Source:
static Long selectNextRetryTime(final Long ttlInSeconds) { final long aDay = 60 * 60 * 24L; final long min = Math.min(ttlInSeconds / 2, aDay); final long aSecond = 1L; return Math.max(min, aSecond); }

Target:
static Long selectNextRetryTime(final Long ttlInSeconds) { final long aDay = 60 * 60 * 24L; final long minimum = Math.min(ttlInSeconds / 2, aDay); final long aSecond = 1L; return Math.max(minimum, aSecond); }
Source:
protected void updateDiskSizeByQcowImageInfo(DiskImage diskImage, Guid storageId) { if (storageId != null) { super.updateDiskSizeByQcowImageInfo(diskImage, storageId); return; } List<DiskImage> diskVolumes = diskImageDao.getAllSnapshotsForImageGroup(diskImage.getId()); Iterator<DiskImage> diskVolumesIterator = diskVolumes.iterator(); if (!diskVolumesIterator.hasNext()) { log.warn("found a disk with no volume {}, skipping", diskImage.getId()); return; } DiskImage diskImageFromDatabase = diskVolumesIterator.next(); Iterator<Guid> storageIdsIterator = diskImageFromDatabase.getStorageIds().iterator(); if (!storageIdsIterator.hasNext()) { log.warn("found an image with no storage domain {}, skipping", diskImageFromDatabase.getImageId()); return; } super.updateDiskSizeByQcowImageInfo(diskImage, storageIdsIterator.next()); }

Target:
protected void updateDiskSizeByQcowImageInfo(DiskImage diskImage, Guid storageId) { if (!Guid.isNullOrEmpty(storageId)) { super.updateDiskSizeByQcowImageInfo(diskImage, storageId); return; } List<DiskImage> diskVolumes = diskImageDao.getAllSnapshotsForImageGroup(diskImage.getId()); Iterator<DiskImage> diskVolumesIterator = diskVolumes.iterator(); if (!diskVolumesIterator.hasNext()) { log.warn("found a disk with no volume {}, skipping", diskImage.getId()); return; } DiskImage diskImageFromDatabase = diskVolumesIterator.next(); Iterator<Guid> storageIdsIterator = diskImageFromDatabase.getStorageIds().iterator(); if (!storageIdsIterator.hasNext()) { log.warn("found an image with no storage domain {}, skipping", diskImageFromDatabase.getImageId()); return; } super.updateDiskSizeByQcowImageInfo(diskImage, storageIdsIterator.next()); }
Source:
public static String argsToList(final List<Arguments> arguments) { final StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < arguments.size(); i++) { stringBuilder.append(uncapFirst(arguments.get(i).getName())); if (i < arguments.size() - 1) { stringBuilder.append(", "); } } return stringBuilder.toString(); }

Target:
public static String argsToList(final List<Arguments> arguments) { return arguments.stream().map(i -> uncapFirst(i.getName())).collect(Collectors.joining(", ")); }
Source:
public void manageTopology() throws TopologyRuntimeManagementException, TMasterException, PackingException { String topologyName = Context.topologyName(config); String statemgrClass = Context.stateManagerClass(config); IStateManager statemgr; try { statemgr = ReflectionUtils.newInstance(statemgrClass); } catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) { throw new TopologyRuntimeManagementException(String.format( "Failed to instantiate state manager class '%s'", statemgrClass), e); } try { statemgr.initialize(config); SchedulerStateManagerAdaptor adaptor = new SchedulerStateManagerAdaptor(statemgr, 5000); boolean foundData = validateRuntimeManage(adaptor, topologyName); LOG.log(Level.FINE, "Topology: {0} to be {1}ed", new Object[]{topologyName, command}); Config runtime = Config.newBuilder() .put(Key.TOPOLOGY_NAME, Context.topologyName(config)) .put(Key.SCHEDULER_STATE_MANAGER_ADAPTOR, adaptor) .build(); ISchedulerClient schedulerClient = getSchedulerClient(runtime); callRuntimeManagerRunner(runtime, schedulerClient, foundData); } finally { SysUtils.closeIgnoringExceptions(statemgr); } }

Target:
public void manageTopology() throws TopologyRuntimeManagementException, TMasterException, PackingException { String topologyName = Context.topologyName(config); String statemgrClass = Context.stateManagerClass(config); IStateManager statemgr; try { statemgr = ReflectionUtils.newInstance(statemgrClass); } catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) { throw new TopologyRuntimeManagementException(String.format( "Failed to instantiate state manager class '%s'", statemgrClass), e); } try { statemgr.initialize(config); SchedulerStateManagerAdaptor adaptor = new SchedulerStateManagerAdaptor(statemgr, 5000); boolean hasExecutionData = validateRuntimeManage(adaptor, topologyName); LOG.log(Level.FINE, "Topology: {0} to be {1}ed", new Object[]{topologyName, command}); Config runtime = Config.newBuilder() .put(Key.TOPOLOGY_NAME, Context.topologyName(config)) .put(Key.SCHEDULER_STATE_MANAGER_ADAPTOR, adaptor) .build(); ISchedulerClient schedulerClient = getSchedulerClient(runtime); callRuntimeManagerRunner(runtime, schedulerClient, !hasExecutionData); } finally { SysUtils.closeIgnoringExceptions(statemgr); } }
Source:
public void synchronizeQueueWithPrimaryInvokedAfterProcessEachRegionQueue() { addToMessagesList(); Iterator iterator = messagesList.iterator(); InternalDistributedMember sender = mock(InternalDistributedMember.class); doReturn(sender).when(queueRemovalMessage).getSender(); queueRemovalMessage.processRegionQueues(cache, iterator); verify(queueRemovalMessage).processRegionQueue(iterator, regionName1, region1EventSize, regionQueue1); verify(regionQueue1).synchronizeQueueWithPrimary(sender, cache); verify(queueRemovalMessage).processRegionQueue(iterator, regionName2, region2EventSize, regionQueue2); verify(regionQueue2).synchronizeQueueWithPrimary(sender, cache); verify(queueRemovalMessage).removeQueueEvent(regionName1, regionQueue1, eventID1); verify(queueRemovalMessage).removeQueueEvent(regionName2, regionQueue2, eventID2); verify(queueRemovalMessage).removeQueueEvent(regionName2, regionQueue2, eventID3); }

Target:
public void synchronizeQueueWithPrimaryInvokedAfterProcessEachRegionQueue() { addToMessagesList(); Iterator<Object> iterator = messagesList.iterator(); InternalDistributedMember sender = mock(InternalDistributedMember.class); doReturn(sender).when(queueRemovalMessage).getSender(); queueRemovalMessage.processRegionQueues(cache, iterator); verify(queueRemovalMessage).processRegionQueue(iterator, regionName1, region1EventSize, regionQueue1); verify(regionQueue1).synchronizeQueueWithPrimary(sender, cache); verify(queueRemovalMessage).processRegionQueue(iterator, regionName2, region2EventSize, regionQueue2); verify(regionQueue2).synchronizeQueueWithPrimary(sender, cache); verify(queueRemovalMessage).removeQueueEvent(regionName1, regionQueue1, eventID1); verify(queueRemovalMessage).removeQueueEvent(regionName2, regionQueue2, eventID2); verify(queueRemovalMessage).removeQueueEvent(regionName2, regionQueue2, eventID3); }
Source:
@Override public JsonWriter endObject() throws IOException { promoteValueToNameFailureToken = null; return close(EMPTY_OBJECT, NONEMPTY_OBJECT, "}"); }

Target:
@Override public JsonWriter endObject() throws IOException { promoteValueToName = false; return close(EMPTY_OBJECT, NONEMPTY_OBJECT, "}"); }
Source:
private void writeVmMetadata() { writer.setPrefix(OVIRT_VM_PREFIX, OVIRT_VM_URI); writer.writeStartElement(OVIRT_VM_URI, "vm"); writer.writeNamespace(OVIRT_VM_PREFIX, OVIRT_VM_URI); if (volatileRun) { writer.writeStartElement(OVIRT_VM_URI, "destroy_on_reboot"); writer.writeAttributeString("type", "bool"); writer.writeRaw("True"); writer.writeEndElement(); } writer.writeEndElement(); }

Target:
private void writeVmMetadata() { writer.setPrefix(OVIRT_VM_PREFIX, OVIRT_VM_URI); writer.writeStartElement(OVIRT_VM_URI, "vm"); writer.writeNamespace(OVIRT_VM_PREFIX, OVIRT_VM_URI); writer.writeEndElement(); }
Source:
protected final void startZoomThread(long startTime, long endTime) { try (FlowScopeLog log = new FlowScopeLogBuilder(LOGGER, Level.FINE, "TimeGraphView:ZoomThreadCreated").setCategory(getViewId()).build()) { long clampedStartTime = (fStartTime == Long.MAX_VALUE ? startTime : Math.min(Math.max(startTime, fStartTime), fEndTime)); long clampedEndTime = (fEndTime == Long.MIN_VALUE ? endTime : Math.max(Math.min(endTime, fEndTime), fStartTime)); fDirty.incrementAndGet(); boolean restart = false; if (fZoomThread != null) { fZoomThread.cancel(); if (fZoomThread.fZoomStartTime == clampedStartTime && fZoomThread.fZoomEndTime == clampedEndTime) { restart = true; } } long resolution = Math.max(1, (clampedEndTime - clampedStartTime) / fDisplayWidth); fZoomThread = createZoomThread(clampedStartTime, clampedEndTime, resolution, restart, log.getId()); if (fZoomThread != null) { synchronized (fZoomThreadResultLock) { fZoomThread.start(); } } else { fDirty.decrementAndGet(); } } }

Target:
protected final void startZoomThread(long startTime, long endTime) { try (FlowScopeLog log = new FlowScopeLogBuilder(LOGGER, Level.FINE, "TimeGraphView:ZoomThreadCreated").setCategory(getViewId()).build()) { long clampedStartTime = (fStartTime == Long.MAX_VALUE ? startTime : Math.min(Math.max(startTime, fStartTime), fEndTime)); long clampedEndTime = (fEndTime == Long.MIN_VALUE ? endTime : Math.max(Math.min(endTime, fEndTime), fStartTime)); fDirty.incrementAndGet(); boolean restart = false; ZoomThread zoomThread = fZoomThread; if (zoomThread != null) { zoomThread.cancel(); if (zoomThread.fZoomStartTime == clampedStartTime && zoomThread.fZoomEndTime == clampedEndTime) { restart = true; } } long resolution = Math.max(1, (clampedEndTime - clampedStartTime) / fDisplayWidth); zoomThread = createZoomThread(clampedStartTime, clampedEndTime, resolution, restart); fZoomThread = zoomThread; if (zoomThread != null) { zoomThread.setScopeId(log.getId()); synchronized (fZoomThreadResultLock) { zoomThread.start(); } } else { fDirty.decrementAndGet(); } } }
Source:
public Object clone() throws CloneNotSupportedException { HashPartition hash = (HashPartition) super.clone(); if (columns != null) { hash.columns = new ColumnReferenceExpr[columns.length]; for (int i = 0; i < columns.length; i++) { hash.columns[i] = (ColumnReferenceExpr) columns[i].clone(); } } hash.quantity = quantity; if (specifiers != null) { hash.specifiers = new ArrayList<>(); hash.specifiers.addAll(specifiers.stream().collect(Collectors.toList())); } return hash; }

Target:
public Object clone() throws CloneNotSupportedException { HashPartition hash = (HashPartition) super.clone(); if (columns != null) { hash.columns = new ColumnReferenceExpr[columns.length]; for (int i = 0; i < columns.length; i++) { hash.columns[i] = (ColumnReferenceExpr) columns[i].clone(); } } hash.quantity = quantity; if (specifiers != null) { hash.specifiers = new ArrayList<>(specifiers); } return hash; }
Source:
public void testProject() { PlanNode project = project("project", tableScan("ts", "orderkey"), "string", new Cast(new SymbolReference("orderkey"), "STRING")); Map<String, PlanNodeCostEstimate> costs = ImmutableMap.of("ts", cpuCost(1000)); Map<String, PlanNodeStatsEstimate> stats = ImmutableMap.of("project", statsEstimate(4000), "ts", statsEstimate(1000)); assertCost( project, costs, stats) .cpu(1000 + 4000) .memory(0) .network(0); assertCostEstimatedExchanges( project, costs, stats) .cpu(1000 + 4000) .memory(0) .network(0); assertCostHasUnknownComponentsForUnknownStats(project); }

Target:
public void testProject() { TableScanNode tableScan = tableScan("ts", "orderkey"); PlanNode project = project("project", tableScan, "string", new Cast(new SymbolReference("orderkey"), "STRING")); Map<String, PlanNodeCostEstimate> costs = ImmutableMap.of("ts", cpuCost(1000)); Map<String, PlanNodeStatsEstimate> stats = ImmutableMap.of( "project", statsEstimate(project, 4000), "ts", statsEstimate(tableScan, 1000)); assertCost(project, costs, stats) .cpu(1000 + 4000) .memory(0) .network(0); assertCostEstimatedExchanges(project, costs, stats) .cpu(1000 + 4000) .memory(0) .network(0); assertCostHasUnknownComponentsForUnknownStats(project); }
Source:
public void testGetIntermediateStreamProperties() { Map<String, String> config = new HashMap<>(); KafkaSystemFactory factory = new KafkaSystemFactory(); Map<String, Properties> properties = JavaConversions.mapAsJavaMap( factory.getIntermediateStreamProperties(new MapConfig(config))); assertTrue(properties.isEmpty()); config.put("streams.test.samza.intermediate", "true"); config.put("streams.test.compression.type", "lz4"); config.put(ApplicationConfig.APP_MODE, ApplicationConfig.ApplicationMode.BATCH.name()); KafkaSystemAdmin admin = createSystemAdmin(SYSTEM(), config); StreamSpec spec = new StreamSpec("test", "test", SYSTEM(), config); KafkaStreamSpec kspec = admin.toKafkaSpec(spec); Properties prop = kspec.getProperties(); assertEquals(prop.getProperty("retention.ms"), String.valueOf(KafkaConfig.DEFAULT_RETENTION_MS_FOR_BATCH())); assertEquals(prop.getProperty("compression.type"), "lz4"); }

Target:
public void testGetIntermediateStreamProperties() { Map<String, String> config = new HashMap<>(); KafkaSystemFactory factory = new KafkaSystemFactory(); Map<String, Properties> properties = JavaConversions.mapAsJavaMap( factory.getIntermediateStreamProperties(new MapConfig(config))); assertTrue(properties.isEmpty()); config.put("streams.test.samza.intermediate", "true"); config.put("streams.test.compression.type", "lz4"); properties = JavaConversions.mapAsJavaMap( factory.getIntermediateStreamProperties(new MapConfig(config))); assertTrue(properties.isEmpty()); config.put(ApplicationConfig.APP_MODE, ApplicationConfig.ApplicationMode.BATCH.name()); KafkaSystemAdmin admin = createSystemAdmin(SYSTEM(), config); StreamSpec spec = new StreamSpec("test", "test", SYSTEM(), Collections.singletonMap("replication.factor", "1")); KafkaStreamSpec kspec = admin.toKafkaSpec(spec); Properties prop = kspec.getProperties(); assertEquals(prop.getProperty("retention.ms"), String.valueOf(KafkaConfig.DEFAULT_RETENTION_MS_FOR_BATCH())); assertEquals(prop.getProperty("compression.type"), "lz4"); assertEquals(kspec.getReplicationFactor(), 1); assertNull(prop.getProperty("replication.factor")); }
Source:
public boolean aggregate(KeyType key, int keyHash) { final ByteBuffer keyBuffer = keySerde.toByteBuffer(key); if (keyBuffer == null) { return false; } if (keyBuffer.remaining() != keySize) { throw new IAE( "keySerde.toByteBuffer(key).remaining[%s] != keySerde.keySize[%s], buffer was the wrong size?!", keyBuffer.remaining(), keySize ); } int bucket = hashTable.findBucketWithAutoGrowth(keyBuffer, keyHash); if (bucket < 0) { return false; } final int bucketStartOffset = hashTable.getOffsetForBucket(bucket); final boolean bucketWasUsed = hashTable.isBucketUsed(bucket); final ByteBuffer tableBuffer = hashTable.getTableBuffer(); if (!bucketWasUsed) { hashTable.initializeNewBucketKey(bucket, keyBuffer, keyHash); for (int i = 0; i < aggregators.length; i++) { aggregators[i].init(tableBuffer, bucketStartOffset + aggregatorOffsets[i]); } newBucketHook(bucketStartOffset); } if (canSkipAggregate(bucketWasUsed, bucketStartOffset)) { return true; } for (int i = 0; i < aggregators.length; i++) { aggregators[i].aggregate(tableBuffer, bucketStartOffset + aggregatorOffsets[i]); } afterAggregateHook(bucketStartOffset); return true; }

Target:
public AggregateResult aggregate(KeyType key, int keyHash) { final ByteBuffer keyBuffer = keySerde.toByteBuffer(key); if (keyBuffer == null) { return DICTIONARY_FULL; } if (keyBuffer.remaining() != keySize) { throw new IAE( "keySerde.toByteBuffer(key).remaining[%s] != keySerde.keySize[%s], buffer was the wrong size?!", keyBuffer.remaining(), keySize ); } int bucket = hashTable.findBucketWithAutoGrowth(keyBuffer, keyHash); if (bucket < 0) { return HASHTABLE_FULL; } final int bucketStartOffset = hashTable.getOffsetForBucket(bucket); final boolean bucketWasUsed = hashTable.isBucketUsed(bucket); final ByteBuffer tableBuffer = hashTable.getTableBuffer(); if (!bucketWasUsed) { hashTable.initializeNewBucketKey(bucket, keyBuffer, keyHash); for (int i = 0; i < aggregators.length; i++) { aggregators[i].init(tableBuffer, bucketStartOffset + aggregatorOffsets[i]); } newBucketHook(bucketStartOffset); } if (canSkipAggregate(bucketWasUsed, bucketStartOffset)) { return AggregateResult.ok(); } for (int i = 0; i < aggregators.length; i++) { aggregators[i].aggregate(tableBuffer, bucketStartOffset + aggregatorOffsets[i]); } afterAggregateHook(bucketStartOffset); return AggregateResult.ok(); }
Source:
public IAdaptable createElement(IMemento memento) { long branchUuid = 0; if (Strings.isValid(memento.getString(BRANCH_KEY))) { branchUuid = Long.valueOf(memento.getString(BRANCH_KEY)); } Long artUuid = Long.parseLong(memento.getString(ART_KEY_AS_LONG)); String title = memento.getString(TITLE); return new SMAEditorInput(branchUuid, artUuid == null ? 0 : artUuid, title); }

Target:
public IAdaptable createElement(IMemento memento) { long branchUuid = 0; if (Strings.isValid(memento.getString(BRANCH_KEY))) { branchUuid = Long.valueOf(memento.getString(BRANCH_KEY)); } String artKeyAsLong = memento.getString(ART_KEY_AS_LONG); if (Strings.isValid(artKeyAsLong)) { Long artUuid = Long.parseLong(artKeyAsLong); String title = memento.getString(TITLE); return new SMAEditorInput(branchUuid, artUuid == null ? 0 : artUuid, title); } else { throw new OseeCoreException("Did not get valid ART KEY from memento"); } }
Source:
protected void checkWithFailDropStrategy(CoreEvent event) throws FlowBackPressureException { if (!abstractPipeline.getProcessingStrategy().checkBackpressureEmitting(event)) { FlowBackPressureException exception = new FlowBackPressureException(abstractPipeline.getName()); throw exception; } }

Target:
protected void checkWithFailDropStrategy(CoreEvent event) throws FlowBackPressureException { if (!abstractPipeline.getProcessingStrategy().checkBackpressureEmitting(event)) { throw new FlowBackPressureException(abstractPipeline.getName()); } }
Source:
private void addILeappReportToReports(Path iLeappOutputDir, Case currentCase) { List<String> allIndexFiles = new ArrayList<>(); try (Stream<Path> walk = Files.walk(iLeappOutputDir)) { allIndexFiles = walk.map(x -> x.toString()) .filter(f -> f.toLowerCase().endsWith("index.html")).collect(Collectors.toList()); if (allIndexFiles.get(0).length() > 2) { currentCase.addReport(allIndexFiles.get(0), MODULE_NAME, Bundle.ILeappAnalyzerIngestModule_report_name()); } } catch (IOException | TskCoreException ex) { logger.log(Level.WARNING, String.format("Error finding index file in path %s", iLeappOutputDir.toString()), ex); } }

Target:
private void addILeappReportToReports(Path iLeappOutputDir, Case currentCase) { List<String> allIndexFiles = new ArrayList<>(); try (Stream<Path> walk = Files.walk(iLeappOutputDir)) { allIndexFiles = walk.map(x -> x.toString()) .filter(f -> f.toLowerCase().endsWith("index.html")).collect(Collectors.toList()); if (!allIndexFiles.isEmpty()) { currentCase.addReport(allIndexFiles.get(0), MODULE_NAME, Bundle.ILeappAnalyzerIngestModule_report_name()); } } catch (IOException | UncheckedIOException | TskCoreException ex) { logger.log(Level.WARNING, String.format("Error finding index file in path %s", iLeappOutputDir.toString()), ex); } }
Source:
public PregelConfiguration build() { return new PregelConfiguration(this); }

Target:
public PregelConfiguration build() { return new PregelConfiguration(computationClass, vertexCodecClass, dataParserClass, messageCodecClass, userParamList); }