auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetValueAt() { final DetailAST node = tree.getFirstChild() .getNextSibling() .getNextSibling() .getNextSibling(); final ParseTreeTablePModel parseTree = new ParseTreeTablePModel(null); final Object treeModel = parseTree.getValueAt(node, 0); final String type = (String) parseTree.getValueAt(node, 1); final int line = (int) parseTree.getValueAt(node, 2); final int column = (int) parseTree.getValueAt(node, 3); final String text = (String) parseTree.getValueAt(node, 4); Assert.assertEquals("IDENT", type); Assert.assertEquals(4, line); Assert.assertEquals(6, column); Assert.assertEquals("InputJavadocAttributesAndMethods", text); Assert.assertNull(treeModel); try { parseTree.getValueAt(node, 231); Assert.fail("IllegalStateException expected"); } catch (IllegalStateException ex) { Assert.assertEquals("Unknown column", ex.getMessage()); } }

Target:
public void testGetValueAt() { final DetailAST node = tree.getFirstChild() .getNextSibling() .getNextSibling() .getNextSibling(); Assert.assertNotNull("Expected a non-null identifier node here", node); Assert.assertEquals("Expected identifier token", TokenTypes.IDENT, node.getType()); final ParseTreeTablePModel parseTree = new ParseTreeTablePModel(null); final Object treeModel = parseTree.getValueAt(node, 0); final String type = (String) parseTree.getValueAt(node, 1); final int line = (int) parseTree.getValueAt(node, 2); final int column = (int) parseTree.getValueAt(node, 3); final String text = (String) parseTree.getValueAt(node, 4); Assert.assertEquals("Node should be an Identifier", "IDENT", type); Assert.assertEquals("Class identifier should start on line 4", 4, line); Assert.assertEquals("Class name should start from column 6", 6, column); Assert.assertEquals("Wrong class name", "InputJavadocAttributesAndMethods", text); Assert.assertNull("Root node should have null value", treeModel); try { parseTree.getValueAt(node, parseTree.getColumnCount()); Assert.fail("IllegalStateException expected"); } catch (IllegalStateException ex) { Assert.assertEquals("Unknown column", ex.getMessage()); } }
Source:
public long getMaxPutLatency() { return maxPutLatencyNanos; }

Target:
public long getMaxPutLatency() { return convertNanosToMillis(maxPutLatencyNanos); }
Source:
public void withRPlumber(String userAction, final Command command) { withDependencies( "Plumber", userAction, new Dependency[] { Dependency.cranPackage("plumber", "0.4.5") }, true, new CommandWithArg<Boolean>() { @Override public void execute(Boolean succeeded) { if (succeeded) command.execute(); } } ); }

Target:
public void withRPlumber(String userAction, final Command command) { withDependencies( "Plumber", userAction, new Dependency[] { Dependency.embeddedPackage("plumber") }, true, new CommandWithArg<Boolean>() { @Override public void execute(Boolean succeeded) { if (succeeded) command.execute(); } } ); }
Source:
private void writeHelperInvocation(JavaClassName helperClassName, String parameterName, Name methodName) { javaBuffer.addImport(InvocationTargetException.class); String helperMethodName = "get" + javaNames.getJavaClassStyleName(methodName) + "Signature"; javaBuffer.addLine("try {"); javaBuffer.addLine("return (Response)(" + helperClassName.getSimpleName() + "." + helperMethodName + "(" + parameterName + ").invoke(this, " + parameterName + "));"); javaBuffer.addLine("}"); javaBuffer.addLine("catch(InvocationTargetException e) {"); javaBuffer.addLine("throw (RuntimeException)e.getTargetException();"); javaBuffer.addLine("}"); javaBuffer.addLine("catch(IllegalAccessException | IllegalArgumentException | NoSuchMethodException | SecurityException e) {"); javaBuffer.addLine("throw new IllegalStateException(\"Failed to find or invoke API method. The failure is in auto-generated code and indicates a bug in the JAX-RS intrafaces generation process\", e);"); javaBuffer.addLine("}"); }

Target:
private void writeHelperInvocation(JavaClassName helperClassName, String parameterName, Name methodName) { javaBuffer.addImport(InvocationTargetException.class); String helperMethodName = "get" + javaNames.getJavaClassStyleName(methodName) + "Signature"; javaBuffer.addLine("try {"); javaBuffer.addLine("return (Response)(" + helperClassName.getSimpleName() + "." + helperMethodName + "(" + parameterName + ").invoke(this, " + parameterName + "));"); javaBuffer.addLine("}"); javaBuffer.addLine("catch(InvocationTargetException e) {"); javaBuffer.addLine("throw (RuntimeException)e.getTargetException();"); javaBuffer.addLine("}"); javaBuffer.addLine("catch(IllegalAccessException | NoSuchMethodException | SecurityException e) {"); javaBuffer.addLine("throw new IllegalStateException(\"Failed to find or invoke API method. The failure is in auto-generated code and indicates a bug in the JAX-RS intrafaces generation process\", e);"); javaBuffer.addLine("}"); }
Source:
public NodeMetadata apply(final ServerWithExternalIp serverWithExternalIp) { NodeMetadataBuilder builder = new NodeMetadataBuilder(); Server server = serverWithExternalIp.server(); builder.ids(server.id()); builder.name(server.name()); builder.hostname(serverWithExternalIp.server().description()); if (server.datacenterId() != null) { builder.location(find(locations.get(), idEquals(nullToEmpty(server.datacenterId())))); } builder.group(nodeNamingConvention.groupInUniqueNameOrNull(server.name())); BaseImage baseImage = getBaseImage(server.sourceImageId()); builder.hardware(baseImageToHardware.apply(baseImage)); Image image = baseImageToImage.apply(baseImage); if (image != null) { builder.imageId(image.getId()); builder.operatingSystem(image.getOperatingSystem()); } if (server.state() != null) { builder.status(serverStateToNodeStatus.get(server.state())); } String privateAddress = null; if (server.networkInfo() != null && server.networkInfo().primaryNic() != null && server.networkInfo().primaryNic().privateIpv4() != null) { privateAddress = server.networkInfo().primaryNic().privateIpv4(); builder.privateAddresses(ImmutableSet.of(privateAddress)); } if (privateAddress != null && serverWithExternalIp.externalIp() != null) { builder.publicAddresses(ImmutableSet.of(serverWithExternalIp.externalIp())); } Credentials credentials = credentialStore.get("node#" + server.id()); if (credentials instanceof LoginCredentials) { builder.credentials(LoginCredentials.class.cast(credentials)); } return builder.build(); }

Target:
public NodeMetadata apply(final ServerWithExternalIp serverWithExternalIp) { NodeMetadataBuilder builder = new NodeMetadataBuilder(); Server server = serverWithExternalIp.server(); builder.ids(server.id()); builder.name(server.name()); builder.location(find(locations.get(), idEquals(nullToEmpty(server.datacenterId())))); builder.group(nodeNamingConvention.groupInUniqueNameOrNull(server.name())); builder.hardware(serverToHardware.apply(serverWithExternalIp.server())); builder.imageId(server.sourceImageId()); builder.operatingSystem(operatingSystemToOperatingSystem.apply(server.guest().operatingSystem())); builder.status(serverStateToNodeStatus.get(server.state())); Set<String> privateAddresses = new HashSet<String>(); if (server.networkInfo() != null) { if (server.networkInfo().primaryNic() != null && server.networkInfo().primaryNic().privateIpv4() != null) { privateAddresses.add(server.networkInfo().primaryNic().privateIpv4()); } if (!server.networkInfo().additionalNic().isEmpty()) { privateAddresses.addAll(Sets.newHashSet( Iterables.transform(server.networkInfo().additionalNic(), new Function<NIC, String>() { @Override public String apply(NIC nic) { return nic.privateIpv4(); } }))); } } builder.privateAddresses(privateAddresses); if (serverWithExternalIp.externalIp() != null) { builder.publicAddresses(ImmutableSet.of(serverWithExternalIp.externalIp())); } return builder.build(); }
Source:
public LeadershipToken blockOnBecomingLeader() throws InterruptedException { try { return batcher.apply(null).get(); } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } throw new RuntimeException(e); } }

Target:
public LeadershipToken blockOnBecomingLeader() throws InterruptedException { try { return batcher.apply(null).get(); } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } throw new RuntimeException(cause); } }
Source:
public T newInstance(Object... params) throws InvocationTargetException, IllegalAccessException { try { return constructor.newInstance(params); } catch (InstantiationException e) { throw new RuntimeException(e); } }

Target:
T newInstance(Object... params) { return throwingOnlyUnchecked(() -> constructor.newInstance(params)); }
Source:
private boolean isVmMigrationValid(Cluster cluster, VM candidateVm) { boolean canMove = schedulingManager.canSchedule(cluster, candidateVm, Collections.emptyList(), Collections.emptyList(), new ArrayList<>()); if (canMove) { log.debug("VM is a viable candidate for solving affinity group violation situation.", candidateVm.getId()); return true; } log.debug("VM is NOT a viable candidate for solving affinity group violation situation.", candidateVm.getId()); return false; }

Target:
private boolean isVmMigrationValid(Cluster cluster, VM candidateVm) { List<Guid> vdsBlackList = candidateVm.getRunOnVds() == null ? Collections.emptyList() : Arrays.asList(candidateVm.getRunOnVds()); boolean canMove = schedulingManager.canSchedule(cluster, candidateVm, vdsBlackList, Collections.emptyList(), new ArrayList<>()); if (canMove) { log.debug("VM is a viable candidate for solving affinity group violation situation.", candidateVm.getId()); return true; } log.debug("VM is NOT a viable candidate for solving affinity group violation situation.", candidateVm.getId()); return false; }
Source:
public void test_valid_region_variant() throws IOException, SAXException { JSONObject response = jenkinsRule.getJSON("i18n/resourceBundle?baseName=hudson.logging.Messages&language=de_DE_cloudBees").getJSONObject(); Assert.assertEquals("ok", response.getString("status")); JSONObject data = response.getJSONObject("data"); Assert.assertEquals("Initialisiere Log-Rekorder", data.getString("LogRecorderManager.init")); }

Target:
public void test_valid_region_variant() throws IOException, SAXException { JSONObject response = jenkinsRule.getJSON("i18n/resourceBundle?baseName=jenkins.i18n.Messages&language=en_AU_variant").getJSONObject(); Assert.assertEquals("ok", response.getString("status")); JSONObject data = response.getJSONObject("data"); Assert.assertEquals("value_au_variant", data.getString("Key")); }
Source:
public static boolean isWellFormedUrl(final String input) { UrlValidator validator = new UrlValidator(); return validator.isValid(input); }

Target:
public static boolean isWellFormedUrl(final String input) { return urlValidator.isValid(input); }
Source:
private Authentication createAuthentication() { val principal = createPrincipal(); val attributes = new HashMap<String, Object>(); attributes.put("attribute", "value"); val mock = mock(Authentication.class); when(mock.getAttributes()).thenReturn(attributes); when(mock.getPrincipal()).thenReturn(principal); return mock; }

Target:
private Authentication createAuthentication() { val attributes = CoreAuthenticationTestUtils.getAttributes(); attributes.put("attribute", "value"); return CoreAuthenticationTestUtils.getAuthentication("principal", attributes); }
Source:
public void testPushForMasterWithApprovals() throws GitAPIException, IOException, RestApiException { PushOneCommit.Result r = pushTo("refs/for/master/%l=Code-Review"); r.assertOkStatus(); ChangeInfo ci = get(r.getChangeId()); LabelInfo cr = ci.labels.get("Code-Review"); assertThat(cr.all).hasSize(1); assertThat(cr.all.get(0).name).isEqualTo("Administrator"); assertThat(cr.all.get(0).value.intValue()).isEqualTo(1); PushOneCommit push = pushFactory.create(db, admin.getIdent(), PushOneCommit.SUBJECT, "b.txt", "anotherContent", r.getChangeId()); r = push.to(git, "refs/for/master/%l=Code-Review+2"); ci = get(r.getChangeId()); cr = ci.labels.get("Code-Review"); assertThat(cr.all).hasSize(1); assertThat(cr.all.get(0).name).isEqualTo("Administrator"); assertThat(cr.all.get(0).value.intValue()).isEqualTo(2); }

Target:
public void testPushForMasterWithApprovals() throws GitAPIException, IOException, RestApiException { PushOneCommit.Result r = pushTo("refs/for/master/%l=Code-Review"); r.assertOkStatus(); ChangeInfo ci = get(r.getChangeId()); LabelInfo cr = ci.labels.get("Code-Review"); assertThat(cr.all).hasSize(1); assertThat(cr.all.get(0).name).isEqualTo("Administrator"); assertThat(cr.all.get(0).value.intValue()).is(1); PushOneCommit push = pushFactory.create(db, admin.getIdent(), PushOneCommit.SUBJECT, "b.txt", "anotherContent", r.getChangeId()); r = push.to(git, "refs/for/master/%l=Code-Review+2"); ci = get(r.getChangeId()); cr = ci.labels.get("Code-Review"); assertThat(cr.all).hasSize(1); assertThat(cr.all.get(0).name).isEqualTo("Administrator"); assertThat(cr.all.get(0).value.intValue()).is(2); }
Source:
private boolean isException(String value) { return value.length() == 4 || Integer.parseInt(value) < 8; }

Target:
private static boolean isException(String value) { return value.length() == 4 || Integer.parseInt(value) < 8; }
Source:
public RunRuleActionHandler(final Action module, final RuleRegistry ruleRegistry) { super(module); final Configuration config = module.getConfiguration(); if (config == null) { throw new IllegalArgumentException("'Configuration' can not be null."); } ruleUIDs = (List<String>) config.get(RULE_UIDS_KEY); if (ruleUIDs == null) { throw new IllegalArgumentException("'ruleUIDs' property can not be null."); } if (config.get(CONSIDER_CONDITIONS_KEY) != null && config.get(CONSIDER_CONDITIONS_KEY) instanceof Boolean) { this.considerConditions = ((Boolean) config.get(CONSIDER_CONDITIONS_KEY)).booleanValue(); } this.ruleRegistry = ruleRegistry; }

Target:
public RunRuleActionHandler(final Action module, final RuleRegistry ruleRegistry) { super(module); final Configuration config = module.getConfiguration(); if (config == null) { throw new IllegalArgumentException("'Configuration' can not be null."); } ruleUIDs = (List<String>) config.get(RULE_UIDS_KEY); if (ruleUIDs == null) { throw new IllegalArgumentException("'ruleUIDs' property must not be null."); } if (config.get(CONSIDER_CONDITIONS_KEY) != null && config.get(CONSIDER_CONDITIONS_KEY) instanceof Boolean) { this.considerConditions = ((Boolean) config.get(CONSIDER_CONDITIONS_KEY)).booleanValue(); } this.ruleRegistry = ruleRegistry; }
Source:
private void setupViews() { backgroundJobStartStop = findViewById(R.id.backgroundJobStartStop); backgroundJobStartStop.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (!backgroundTask.isStarted()) { backgroundTask.start(); } else { backgroundTask.stop(); } updateJobButton(); } }); }

Target:
private void setupViews() { backgroundJobStartStop = findViewById(R.id.backgroundJobStartStop); backgroundJobStartStop.setOnClickListener(v -> { if (!backgroundTask.isStarted()) { backgroundTask.start(); } else { backgroundTask.stop(); } updateJobButton(); }); }
Source:
public void close() { RuntimeException ex = null; try { factsDb.close(); } catch (Exception e) { if (ex == null) { ex = Throwables.propagate(e); } else { ex.addSuppressed(e); } } indexAndOffsets.clear(); aggBuffers.clear(); try { FileUtils.deleteDirectory(tmpDirLocation); } catch(IOException ioe) { if (ex == null) { ex = Throwables.propagate(ioe); } else { ex.addSuppressed(ioe); } } if (selectors != null) { selectors.clear(); } super.close(); if (ex != null) { throw ex; } }

Target:
public void close() { RuntimeException ex = null; try { factsDb.close(); } catch (Exception e) { ex = Throwables.propagate(e); } indexAndOffsets.clear(); aggBuffers.clear(); try { FileUtils.deleteDirectory(tmpDirLocation); } catch(IOException ioe) { if (ex == null) { ex = Throwables.propagate(ioe); } else { ex.addSuppressed(ioe); } } if (selectors != null) { selectors.clear(); } super.close(); if (ex != null) { throw ex; } }
Source:
public Optional<List<LockWatchEvent>> getFromVersion(long version) { return getFromTo(version, nextSequence - 1); }

Target:
public Optional<List<LockWatchEvent>> getFromVersion(long version) { return getFromTo(version, lastVersion()); }
Source:
public void close() { List<ViolationMessage> outputList = new ArrayList<>(this.msgBuffer.values().stream() .filter(msg -> !ignoredLineNumbers.contains(msg.getLineNumber())).collect(Collectors.toList())); Collections.sort(outputList); if (outputList.size() > 0) { String header = getHeader(inputFile, colorOutput, invertColorOutput); if (colorOutput) { AnsiConsole.out.println(Ansi.ansi().render(header)); } else { System.out.println(header); } } if (colorOutput) { for (ViolationMessage output : outputList) { output.setColorOutput(colorOutput); if (invertColorOutput) { output.invertColorOutput(); } output.setLineNumberWidth(String.valueOf(highestLineNumber).length()); output.setColumnNumberWidth(String.valueOf(highestColumnNumber).length()); AnsiConsole.out.println(Ansi.ansi().render(output.toString())); } } else { outputList.forEach(System.out::println); } this.msgBuffer.clear(); }

Target:
public void close() { List<ViolationMessage> outputList = new ArrayList<>(this.msgBuffer.values().stream() .filter(msg -> !ignoredLineNumbers.contains(msg.getLineNumber())).collect(Collectors.toList())); Collections.sort(outputList); if (outputList.size() > 0) { printColoredMessage(getHeader(inputFile, colorSettings)); } if (colorSettings.colorOutput) { for (ViolationMessage output : outputList) { output.setColorSettings(colorSettings); output.setLineNumberWidth(String.valueOf(highestLineNumber).length()); output.setColumnNumberWidth(String.valueOf(highestColumnNumber).length()); AnsiConsole.out.println(Ansi.ansi().render(output.toString())); } } else { outputList.forEach(System.out::println); } this.msgBuffer.clear(); }
Source:
ConstructDate assign( Field field, AnyValue value ) { switch ( field ) { case year: year = assignment( field, year, value ); return this; case quarter: case dayOfQuarter: return new QuarterDate( year, date ).assign( field, value ); case month: case day: return new CalendarDate( year, date ).assign( field, value ); case week: case dayOfWeek: return new WeekDate( year, date ).assign( field, value ); case ordinalDay: return new OrdinalDate( year, date ).assign( field, value ); case date: case datetime: date = assignment( field, date, value ); return this; default: throw new UnsupportedTemporalUnitException( "Not a date field: " + field ); } }

Target:
ConstructDate assign( Field field, AnyValue value ) { switch ( field ) { case year: year = assignment( field, year, value ); return this; case quarter: case dayOfQuarter: return new QuarterDate( year, date ).assign( field, value ); case month: case day: return new CalendarDate( year, date ).assign( field, value ); case week: case dayOfWeek: return new WeekDate( year, date ).assign( field, value ); case ordinalDay: return new OrdinalDate( year, date ).assign( field, value ); case date: case datetime: date = assignment( field, date, value ); return this; default: throw new IllegalStateException( "Not a date field: " + field ); } }
Source:
public void setGlusterNetwork(ClusterNetworkModel model, boolean value) { if (!isMultiCluster()) { if (value) { if (getGlusterNetwork() != null) { getGlusterNetwork().setGlusterNetwork(false); } glusterNetwork = model; } else { getManagementNetwork().setGlusterNetwork(true); } } model.setGlusterNetwork(value); }

Target:
public void setGlusterNetwork(ClusterNetworkModel model, boolean value) { if (!isMultiCluster()) { if (value) { if (getGlusterNetwork() != null) { getGlusterNetwork().setGlusterNetwork(false); } glusterNetwork = model; } } model.setGlusterNetwork(value); }
Source:
public void setSellOrders(HashMap<String, ArrayList<Order>> sellOrders) { this.sellOrders = sellOrders; }

Target:
private void setSellOrders(HashMap<String, ArrayList<Order>> sellOrders) { this.sellOrders = sellOrders; }
Source:
public static IThenable.ThenOnFulfilledCallbackFn<List<String>, Object> getListObjectThenOnFulfilledCallbackFn(List<String> simpleDataTypes, ListBoxValues dataTypeListBoxValues) { return serverDataTypes -> { List<String> mergedList = new ArrayList<>(simpleDataTypes); for (String type : serverDataTypes) { String displayType = createDataTypeDisplayName(type); getMapDataTypeNamesToDisplayNames().put( displayType, type ); mergedList.add(displayType); } dataTypeListBoxValues.addValues(mergedList); return null; }; }

Target:
static IThenable.ThenOnFulfilledCallbackFn<List<String>, Object> getListObjectThenOnFulfilledCallbackFn(List<String> simpleDataTypes, ListBoxValues dataTypeListBoxValues) { return serverDataTypes -> { List<String> mergedList = new ArrayList<>(simpleDataTypes); for (String type : serverDataTypes) { String displayType = createDataTypeDisplayName(type); getMapDataTypeNamesToDisplayNames().put( displayType, type ); mergedList.add(displayType); } dataTypeListBoxValues.addValues(mergedList); return null; }; }
Source:
public Boolean isPartial() { return isPartial; }

Target:
public boolean isPartial() { return isPartial; }
Source:
public CloudProvisioningRequest(Label label, int workloadToProvision, Collection<? extends Actionable> queue) { this.label = label; this.workloadToProvision = workloadToProvision; this.queue = new ArrayList<Actionable>(queue); }

Target:
CloudProvisioningRequest(Label label, int workloadToProvision, Collection<? extends Actionable> queue) { this.label = label; this.workloadToProvision = workloadToProvision; this.queue = new ArrayList<Actionable>(queue); }
Source:
public static ObjectMapper withDefaultModules(ObjectMapper mapper) { return mapper .registerModule(new GuavaModule()) .registerModule(new Jdk8Module().configureAbsentsAsNulls(true)) .registerModule(new AfterburnerModule()) .registerModule(new JavaTimeModule()) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE) .disable(DeserializationFeature.WRAP_EXCEPTIONS) .disable(SerializationFeature.FAIL_ON_EMPTY_BEANS) .enable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES); }

Target:
public static ObjectMapper withDefaultModules(ObjectMapper mapper) { return mapper .registerModule(new GuavaModule()) .registerModule(new ShimJdk7Module()) .registerModule(new Jdk8Module().configureAbsentsAsNulls(true)) .registerModule(new AfterburnerModule()) .registerModule(new JavaTimeModule()) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE) .disable(DeserializationFeature.WRAP_EXCEPTIONS) .disable(SerializationFeature.FAIL_ON_EMPTY_BEANS) .enable(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES); }
Source:
public void testRefAltAssignmentInRenormalization() { Variant variant = new Variant("1", 1, 1, "", "T"); variant.renormalize(1, 2, "A", "AT"); assertEquals("A", variant.getReference()); assertEquals("AT", variant.getAlternate()); variant = new Variant("1", 1, 1, "T", ""); variant.renormalize(1, 2, "AT", "A"); assertEquals("AT", variant.getReference()); assertEquals("A", variant.getAlternate()); }

Target:
public void testRefAltAssignmentInRenormalization() { Variant variant = new Variant("1", 1, 1, "", "T"); variant.renormalize(1, 2, "A", "AT"); assertEquals("A", variant.getReference()); assertEquals("AT", variant.getAlternate()); }
Source:
public ServerSocket socket() throws IOException { final String port = this.map.get("port"); if (port == null) { throw new IllegalArgumentException("--port must be specified"); } final ServerSocket socket; if (port.matches("\\d+")) { socket = new ServerSocket(Integer.parseInt(port)); } else { final File file = new File(port); if (file.exists()) { final Reader reader = new InputStreamReader( new FileInputStream(file), StandardCharsets.UTF_8 ); try { final char[] chars = new char[8]; if (reader.read(chars) < 0) { throw new HttpException( HttpURLConnection.HTTP_BAD_REQUEST, "The end of the stream has been reached" ); } socket = new ServerSocket( Integer.parseInt(new String(chars)) ); } finally { reader.close(); } } else { socket = new ServerSocket(0); final Writer writer = new OutputStreamWriter( new FileOutputStream(file), StandardCharsets.UTF_8 ); try { writer.append(Integer.toString(socket.getLocalPort())); } finally { writer.close(); } } } return socket; }

Target:
public ServerSocket socket() throws IOException { final String port = this.map.get("port"); if (port == null) { throw new IllegalArgumentException("--port must be specified"); } final ServerSocket socket; if (port.matches("\\d+")) { socket = new ServerSocket(Integer.parseInt(port)); } else { final File file = new File(port); if (file.exists()) { final Reader reader = new InputStreamReader( new FileInputStream(file) ); try { final char[] chars = new char[8]; reader.read(chars); socket = new ServerSocket( Integer.parseInt(new String(chars)) ); } finally { reader.close(); } } else { socket = new ServerSocket(0); final Writer writer = new OutputStreamWriter( new FileOutputStream(file) ); try { writer.append(Integer.toString(socket.getLocalPort())); } finally { writer.close(); } } } return socket; }
Source:
public void setResourcesDir(File newResourcesDir) { this.resourcesDir = newResourcesDir; }

Target:
public void setResourcesDir(File newResourcesDir) { resourcesDir = newResourcesDir; }
Source:
public static Calendar ChangeTimezone(Calendar instant, String timezone) { if (Arrays.asList(TimeZone.getAvailableIDs()).contains(timezone)) return instant.setTimeZone(TimeZone.getTimeZone(timezone)); else throw new YailRuntimeError("Your given timezone is not a valid timezone."); }

Target:
public static Calendar ChangeTimezone(Calendar instant, String timezone) { if (timezone == null) throw new YailRuntimeError("No timezones available.", "Runtime Error"); if (timezones.contains(timezone)) { instant.setTimeZone(TimeZone.getTimeZone(timezone)); } else { for (String tz : timezones) { if (tz.equalsIgnoreCase(timezone)) return ChangeTimezone(instant, tz); } throw new YailRuntimeError("Your given timezone is not a valid timezone.", "Sorry to be so picky"); } return instant; }
Source:
void sendMailToWithNotificationAndPersonsAndAdministrator() { when(mailProperties.getAdministrator()).thenReturn("admin@firma.test"); setupMockServletRequest(); final Person hans = new Person(); hans.setEmail("hans@firma.test"); when(personService.getPersonsWithNotificationType(NOTIFICATION_USER)).thenReturn(List.of(hans)); final Person franz = new Person(); franz.setEmail("franz@firma.test"); final String subjectMessageKey = "subject.overtime.created"; final String templateName = "overtime_office"; final Mail mail = Mail.builder() .withRecipient(true) .withRecipient(List.of(franz), true) .withRecipient(NOTIFICATION_USER) .withSubject(subjectMessageKey) .withTemplate(templateName, new HashMap<>()) .build(); sut.send(mail); verify(mailSenderService).sendEmail(eq("no-reply@firma.test"), eq(singletonList("hans@firma.test")), eq("subject"), eq("emailBody")); verify(mailSenderService).sendEmail(eq("no-reply@firma.test"), eq(singletonList("franz@firma.test")), eq("subject"), eq("emailBody")); verify(mailSenderService).sendEmail(eq("no-reply@firma.test"), eq(singletonList("admin@firma.test")), eq("subject"), eq("emailBody")); }

Target:
void sendMailToWithNotificationAndPersonsAndAdministrator() { when(mailProperties.getAdministrator()).thenReturn("admin@firma.test"); setupMockServletRequest(); final Person hans = new Person(); hans.setEmail("hans@firma.test"); when(personService.getPersonsWithNotificationType(NOTIFICATION_USER)).thenReturn(List.of(hans)); final Person franz = new Person(); franz.setEmail("franz@firma.test"); final String subjectMessageKey = "subject.overtime.created"; final String templateName = "overtime_office"; final Mail mail = Mail.builder() .withTechnicalRecipient(true) .withRecipient(List.of(franz)) .withRecipient(NOTIFICATION_USER) .withSubject(subjectMessageKey) .withTemplate(templateName, new HashMap<>()) .build(); sut.send(mail); verify(mailSenderService).sendEmail(eq("no-reply@firma.test"), eq(singletonList("hans@firma.test")), eq("subject"), eq("emailBody")); verify(mailSenderService).sendEmail(eq("no-reply@firma.test"), eq(singletonList("franz@firma.test")), eq("subject"), eq("emailBody")); verify(mailSenderService).sendEmail(eq("no-reply@firma.test"), eq(singletonList("admin@firma.test")), eq("subject"), eq("emailBody")); }
Source:
String getCulpritsOfEmailList(AbstractProject upstreamProject, AbstractBuild<?, ?> currentBuild, TaskListener listener) throws AddressException, UnsupportedEncodingException { AbstractBuild<?,?> upstreamBuild = currentBuild.getUpstreamRelationshipBuild(upstreamProject); AbstractBuild<?,?> previousBuild = currentBuild.getPreviousBuild(); AbstractBuild<?,?> previousBuildUpstreamBuild = previousBuild!=null ? previousBuild.getUpstreamRelationshipBuild(upstreamProject) : null; if(previousBuild==null && upstreamBuild==null) { listener.getLogger().println("Unable to compute the changesets in "+ upstreamProject +". Is the fingerprint configured?"); return null; } if(previousBuild==null || upstreamBuild==null || previousBuildUpstreamBuild==null) { listener.getLogger().println("Unable to compute the changesets in "+ upstreamProject); return null; } AbstractBuild<?,?> b=previousBuildUpstreamBuild; StringBuilder culpritEmails = new StringBuilder(); do { b = b.getNextBuild(); if (b != null) { String userEmails = getUserEmailList(listener, b.getCulprits()); if (culpritEmails.length() > 0) { culpritEmails.append(","); } culpritEmails.append(userEmails); } } while ( b != upstreamBuild && b != null ); return culpritEmails.toString(); }

Target:
String getCulpritsOfEmailList(AbstractProject upstreamProject, AbstractBuild<?, ?> currentBuild, TaskListener listener) throws AddressException, UnsupportedEncodingException { AbstractBuild<?,?> upstreamBuild = currentBuild.getUpstreamRelationshipBuild(upstreamProject); AbstractBuild<?,?> previousBuild = currentBuild.getPreviousBuild(); AbstractBuild<?,?> previousBuildUpstreamBuild = previousBuild!=null ? previousBuild.getUpstreamRelationshipBuild(upstreamProject) : null; if(previousBuild==null && upstreamBuild==null && previousBuildUpstreamBuild==null) { listener.getLogger().println("Unable to compute the changesets in "+ upstreamProject +". Is the fingerprint configured?"); return null; } if(previousBuild==null || upstreamBuild==null || previousBuildUpstreamBuild==null) { listener.getLogger().println("Unable to compute the changesets in "+ upstreamProject); return null; } AbstractBuild<?,?> b=previousBuildUpstreamBuild; StringBuilder culpritEmails = new StringBuilder(); do { b = b.getNextBuild(); if (b != null) { String userEmails = getUserEmailList(listener, b.getCulprits()); if (culpritEmails.length() > 0) { culpritEmails.append(","); } culpritEmails.append(userEmails); } } while ( b != upstreamBuild && b != null ); return culpritEmails.toString(); }
Source:
protected Iterable<List<Object>> computeNext() { while (client.isRunning()) { checkInterruption(); QueryStatusInfo results = client.currentStatusInfo(); progressCallback.accept(QueryStats.create(results.getId(), results.getStats())); Iterable<List<Object>> data = client.currentData().getData(); try { client.advance(); } catch (RuntimeException e) { checkInterruption(); throw e; } if (data != null) { return data; } } verify(client.isFinished()); QueryStatusInfo results = client.finalStatusInfo(); progressCallback.accept(QueryStats.create(results.getId(), results.getStats())); if (results.getError() != null) { throw new RuntimeException(resultsException(results)); } return endOfData(); }

Target:
protected Iterable<List<Object>> computeNext() { while (client.isRunning()) { checkInterruption(null); QueryStatusInfo results = client.currentStatusInfo(); progressCallback.accept(QueryStats.create(results.getId(), results.getStats())); Iterable<List<Object>> data = client.currentData().getData(); try { client.advance(); } catch (RuntimeException e) { checkInterruption(e); throw e; } if (data != null) { return data; } } verify(client.isFinished()); QueryStatusInfo results = client.finalStatusInfo(); progressCallback.accept(QueryStats.create(results.getId(), results.getStats())); if (results.getError() != null) { throw new RuntimeException(resultsException(results)); } return endOfData(); }
Source:
public List<Variable> getEnv() { List<Variable> variables = new ArrayList<>(); Set<String> keys = new HashSet<>(); variables.add( Variable .newBuilder() .setName("INHERIT_ENV_VARS") .setValue(Joiner.on(" ").join(inheritVariables)) .build() ); taskInfo .getExecutor() .getCommand() .getEnvironment() .getVariablesList() .forEach( v -> { if (!keys.contains(v.getName())) { variables.add(v); keys.add(v.getName()); } } ); return variables; }

Target:
public List<Variable> getEnv() { List<Variable> variables = new ArrayList<>(); Set<String> keys = new HashSet<>(); taskInfo .getExecutor() .getCommand() .getEnvironment() .getVariablesList() .forEach( v -> { if (!keys.contains(v.getName())) { variables.add(v); keys.add(v.getName()); } } ); return variables; }
Source:
public OperatorFactory createRemoteSource(Session session, int operatorId, PlanNodeId planNodeId, List<Type> types) { Iterator<Page> pagesIterator = null; if (rowInputs.containsKey(planNodeId)) { Iterator<PrestoSparkRow> rowsIterator = rowInputs.get(planNodeId); pagesIterator = transformRowsToPages(rowsIterator, types); } if (pageInputs.containsKey(planNodeId)) { Iterator<Page> iterator = transform(transform(pageInputs.get(planNodeId), PrestoSparkUtils::toSerializedPage), pagesSerde::deserialize); if (pagesIterator == null) { pagesIterator = iterator; } else { pagesIterator = concat(pagesIterator, iterator); } } checkState(pagesIterator != null, "input is missing for plan node: %s", planNodeId); return new SparkRemoteSourceOperatorFactory( operatorId, planNodeId, pagesIterator); }

Target:
public OperatorFactory createRemoteSource(Session session, int operatorId, PlanNodeId planNodeId, List<Type> types) { Iterator<PrestoSparkRow> shuffleInput = shuffleInputs.get(planNodeId); Iterator<PrestoSparkSerializedPage> broadcastInput = broadcastInputs.get(planNodeId); checkArgument(shuffleInput != null || broadcastInput != null, "input not found for plan node with id %s", planNodeId); checkArgument(shuffleInput == null || broadcastInput == null, "single remote source cannot accept both, broadcast and shuffle inputs"); if (broadcastInput != null) { return new SparkRemoteSourceOperatorFactory( operatorId, planNodeId, transform(broadcastInput, sparkSerializedPage -> pagesSerde.deserialize(toSerializedPage(sparkSerializedPage)))); } return new SparkRemoteSourceOperatorFactory( operatorId, planNodeId, transformRowsToPages(shuffleInput, types)); }
Source:
public void remove() { throw new UnsupportedOperationException("Not implemented yet"); }

Target:
public void remove() { throw new UnsupportedOperationException("Iterator is read-only"); }
Source:
private void gcDeletedSnapshot(String name) { final Snapshot.Root deleted; namesystem.readLock(); try { deleted = namesystem.getSnapshotManager().chooseDeletedSnapshot(); } finally { namesystem.readUnlock(); } if (deleted == null) { LOG.trace("{}: no snapshots are marked as deleted.", name); return; } final String snapshotRoot = deleted.getRootFullPathName(); final String snapshotName = deleted.getLocalName(); LOG.info("{}: delete snapshot from {}", name, snapshotName, snapshotRoot); try { namesystem.gcDeletedSnapshot(snapshotRoot, snapshotName); } catch (Throwable e) { LOG.warn("Failed to gcDeletedSnapshot " + deleted.getFullPathName(), e); } }

Target:
private void gcDeletedSnapshot(String name) { final Snapshot.Root deleted; namesystem.readLock(); try { deleted = namesystem.getSnapshotManager().chooseDeletedSnapshot(); } catch (Throwable e) { LOG.error("Failed to chooseDeletedSnapshot", e); throw e; } finally { namesystem.readUnlock(); } if (deleted == null) { LOG.trace("{}: no snapshots are marked as deleted.", name); return; } final String snapshotRoot = deleted.getRootFullPathName(); final String snapshotName = deleted.getLocalName(); LOG.info("{}: delete snapshot from {}", name, snapshotName, snapshotRoot); try { namesystem.gcDeletedSnapshot(snapshotRoot, snapshotName); } catch (Throwable e) { LOG.error("Failed to gcDeletedSnapshot " + deleted.getFullPathName(), e); } }
Source:
private void fillRegions(D3 map) { JSONArray countriesFeatures = geoData.countries(); map.style("fill", (d, i, el) -> { Optional<Double> val = geoData.valueByCountry(data, countriesFeatures.get(i)); d3.select(el[i]).attr("class", "fill-region"); if (val.isPresent()) { return colorScale.call(colorScale, val.get()); } return null; }).on("mouseenter", (d, i, el) -> { Optional<Double> val = geoData.valueByCountry(data, countriesFeatures.get(i)); String countryName = geoData.countryName(countriesFeatures.get(i)); mapTooltip.show(countryName, conf.getTitle(), val, conf.getFormatter()); return null; }).on("mousemove", (d, i, el) -> { mapTooltip.move(); return null; }).on("mouseleave", (d, i, el) -> { mapTooltip.hide(); return null; }).on("click", (d, i, el) -> { Optional<Entry<String, Double>> val = geoData.entryByCountry(data, countriesFeatures.get(i)); if (val.isPresent()) { conf.getPathClickHandler().accept(val.get().getKey()); } return null; }); }

Target:
private void fillRegions(D3 map) { Feature[] countriesFeatures = countriesGeoJsonService.getCountries(); map.style("fill", (d, i, el) -> { Optional<Double> val = countriesGeoJsonService.valueByCountry(data, countriesFeatures[i]); d3.select(el[i]).attr("class", "fill-region"); if (val.isPresent()) { return colorScale.call(colorScale, val.get()); } return null; }).on("mouseenter", (d, i, el) -> { Optional<Double> val = countriesGeoJsonService.valueByCountry(data, countriesFeatures[i]); String countryName = countriesGeoJsonService.getCountryName(countriesFeatures[i]); mapTooltip.show(countryName, conf.getTitle(), val, conf.getFormatter()); return null; }).on("mousemove", (d, i, el) -> { mapTooltip.move(); return null; }).on("mouseleave", (d, i, el) -> { mapTooltip.hide(); return null; }).on("click", (d, i, el) -> { countriesGeoJsonService.entryByCountry(data, countriesFeatures[i]) .ifPresent(v -> conf.getPathClickHandler().accept(v.getKey())); return null; }); }
Source:
public final void onStarted(final Run run, final TaskListener listener) { String jobName = run.getParent().getFullName(); Map<String,String> tags = new HashMap<String,String>(); if ( DatadogUtilities.isJobTracked(jobName) ) { logger.fine("Started build!"); Boolean useJobRegex = DatadogUtilities.getDatadogDescriptor().getJobRegex(); if (useJobRegex) { tags.putAll(DatadogUtilities.getRegexJobTags(jobName)); } Queue.Item item = queue.getItem(run.getQueueId()); JSONObject builddata = new JSONObject(); Map<String,String> extraTags = DatadogUtilities.buildExtraTags(run, listener); extraTags.putAll(tags); builddata.put("job", DatadogUtilities.normalizeFullDisplayName(jobName)); builddata.put("number", run.number); builddata.put("result", null); builddata.put("duration", null); builddata.put("waiting", (System.currentTimeMillis() - item.getInQueueSince()) / DatadogBuildListener.THOUSAND_LONG); long starttime = run.getStartTimeInMillis() / DatadogBuildListener.THOUSAND_LONG; builddata.put("timestamp", starttime); try { EnvVars envVars = run.getEnvironment(listener); tags.putAll(DatadogUtilities.parseTagList(run, listener)); builddata.put("hostname", DatadogUtilities.getHostname(envVars)); builddata.put("buildurl", envVars.get("BUILD_URL")); } catch (IOException e) { logger.severe(e.getMessage()); } catch (InterruptedException e) { logger.severe(e.getMessage()); } BuildStartedEventImpl evt = new BuildStartedEventImpl(builddata, tags); DatadogHttpRequests.sendEvent(evt); gauge("jenkins.job.waiting", builddata, "waiting", extraTags); } }

Target:
public final void onStarted(final Run run, final TaskListener listener) { String jobName = run.getParent().getFullName(); logger.fine(String.format("onStarted() called with jobName: %s", jobName)); Map<String,String> tags = new HashMap<String,String>(); if ( DatadogUtilities.isJobTracked(jobName) ) { logger.fine("Started build!"); tags.putAll(DatadogUtilities.getRegexJobTags(jobName)); Queue.Item item = queue.getItem(run.getQueueId()); JSONObject builddata = new JSONObject(); Map<String,String> extraTags = DatadogUtilities.buildExtraTags(run, listener); extraTags.putAll(tags); builddata.put("job", DatadogUtilities.normalizeFullDisplayName(jobName)); builddata.put("number", run.number); builddata.put("result", null); builddata.put("duration", null); builddata.put("waiting", (System.currentTimeMillis() - item.getInQueueSince()) / DatadogBuildListener.THOUSAND_LONG); long starttime = run.getStartTimeInMillis() / DatadogBuildListener.THOUSAND_LONG; builddata.put("timestamp", starttime); try { EnvVars envVars = run.getEnvironment(listener); tags.putAll(DatadogUtilities.parseTagList(run, listener)); builddata.put("hostname", DatadogUtilities.getHostname(envVars)); builddata.put("buildurl", envVars.get("BUILD_URL")); } catch (IOException e) { logger.severe(e.getMessage()); } catch (InterruptedException e) { logger.severe(e.getMessage()); } BuildStartedEventImpl evt = new BuildStartedEventImpl(builddata, tags); DatadogHttpRequests.sendEvent(evt); gauge("jenkins.job.waiting", builddata, "waiting", extraTags); logger.fine("Finished onStarted()"); } }
Source:
public ResourcesRoute(String name, String baseRestPath, String baseResourcePath, ImmutableMap<String, String> aliases, List<CachedResourcePolicy> cachedResourcePolicies) { this.name = checkNotNull(name); this.baseRestPath = ("/" + checkNotNull(baseRestPath) + "/").replaceAll("/+", "/"); this.baseResourcePath = checkNotNull(baseResourcePath) .replace('.', '/').replaceAll("^/", "").replaceAll("/$", "") + "/"; if("/".equals(this.baseResourcePath)){ throw new IllegalArgumentException("Please, avoid using '/' as ResourcesRoute's baseResourcePath as it represents serious security flaws (people will be able to read your classpath configuration files)"); } this.aliases = checkNotNull(aliases); this.cachedResourcePolicies = ImmutableList.copyOf(cachedResourcePolicies); }

Target:
public ResourcesRoute(String name, String baseRestPath, String baseResourcePath, ImmutableMap<String, String> aliases, List<CachedResourcePolicy> cachedResourcePolicies) { this.name = checkNotNull(name); this.baseRestPath = ("/" + checkNotNull(baseRestPath) + "/").replaceAll("/+", "/"); this.baseResourcePath = this.ensureBaseResourcePathValid(baseResourcePath); this.aliases = checkNotNull(aliases); this.cachedResourcePolicies = ImmutableList.copyOf(cachedResourcePolicies); }
Source:
private boolean shouldAction(long time){ if (time < actionTime){ return false; } else { return true; } }

Target:
private boolean shouldAction(long time){ return time >= actionTime; }
Source:
public static void initializePerspectives() { contributedPerspectives = new ArrayList<AbstractPerspectiveFactory>(); final IPerspectiveRegistry perspectives = PlatformUI.getWorkbench().getPerspectiveRegistry(); for (final IPerspectiveDescriptor perspectiveDescriptor : perspectives.getPerspectives()) { System.out.println(perspectiveDescriptor.getId()); } final IConfigurationElement[] extensions = BonitaStudioExtensionRegistryManager.getInstance().getConfigurationElements(PERSPECTIVES_EXTENSION_POINT); for (final IConfigurationElement extension : extensions) { try { System.out.println(extension.getAttribute("id")); final Object perspectiveFactory = extension.createExecutableExtension("class"); if(perspectiveFactory instanceof AbstractPerspectiveFactory){ contributedPerspectives.add((AbstractPerspectiveFactory) perspectiveFactory); } } catch (final Exception ex) { BonitaStudioLog.error(ex); } } }

Target:
public static void initializePerspectives() { contributedPerspectives = new ArrayList<AbstractPerspectiveFactory>(); final IConfigurationElement[] extensions = BonitaStudioExtensionRegistryManager.getInstance().getConfigurationElements(PERSPECTIVES_EXTENSION_POINT); for (final IConfigurationElement extension : extensions) { try { final Object perspectiveFactory = extension.createExecutableExtension("class"); if(perspectiveFactory instanceof AbstractPerspectiveFactory){ contributedPerspectives.add((AbstractPerspectiveFactory) perspectiveFactory); } } catch (final Exception ex) { BonitaStudioLog.error(ex); } } }
Source:
public static URI convertURI(RyaType value) { return new URIImpl(value.getData()); }

Target:
private static URI convertURI(RyaType value) { return new URIImpl(value.getData()); }
Source:
private SlicePredicate getSlicePredicateForSingleColumn(RangeRequest rangeRequest, long startTs) { SlicePredicate predicate; byte[] colName = rangeRequest.getColumnNames().iterator().next(); predicate = SlicePredicates.latestVersionForColumn(colName, startTs); return predicate; }

Target:
private SlicePredicate getSlicePredicateForSingleColumn(RangeRequest rangeRequest, long startTs) { byte[] colName = rangeRequest.getColumnNames().iterator().next(); return SlicePredicates.latestVersionForColumn(colName, startTs); }
Source:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (controller != null && sourcePermanent != null) { String message = "sacrifice a land?"; message = CardUtil.replaceSourceName(message, sourcePermanent.getLogName()); message = Character.toUpperCase(message.charAt(0)) + message.substring(1); if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game) && controller.chooseUse(Outcome.Benefit, message, source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { return true; } } if (source.getSourceObjectZoneChangeCounter() == game.getState().getZoneChangeCounter(source.getSourceId()) && game.getState().getZone(source.getSourceId()) == Zone.BATTLEFIELD) { ContinuousEffect effect = new GiveControlEffect(); effect.setTargetPointer(new FixedTarget(source.getFirstTarget())); game.addEffect(effect, source); game.informPlayers(game.getPlayer(source.getFirstTarget()).getLogName() + " gains control of " + sourcePermanent.getIdName()); } return true; } return false; }

Target:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (controller != null && sourcePermanent != null) { String message = "sacrifice a land?"; message = CardUtil.replaceSourceName(message, sourcePermanent.getLogName()); message = Character.toUpperCase(message.charAt(0)) + message.substring(1); if (cost.canPay(source, source.getSourceId(), source.getControllerId(), game) && controller.chooseUse(Outcome.Benefit, message, source, game)) { cost.clearPaid(); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { return true; } } if (source.getSourceObjectZoneChangeCounter() == game.getState().getZoneChangeCounter(source.getSourceId()) && game.getState().getZone(source.getSourceId()) == Zone.BATTLEFIELD) { ContinuousEffect effect = new GiveControlEffect(); effect.setTargetPointer(new FixedTarget(source.getFirstTarget())); game.addEffect(effect, source); game.informPlayers(game.getPlayer(source.getFirstTarget()).getLogName() + " gains control of " + sourcePermanent.getIdName()); } return true; } return false; }
Source:
public void setSupportedCRS(final String supportedCRS) throws ConfigurationException { Set<String> newSupportedCRS = Sets.newHashSet(); newSupportedCRS.addAll(StringHelper.splitToSet(supportedCRS, Constants.COMMA_STRING)); this.supportedCRS = newSupportedCRS; }

Target:
public void setSupportedCRS(final String supportedCRS) throws ConfigurationException { this.supportedCRS = StringHelper.splitToSet(supportedCRS, Constants.COMMA_STRING); }
Source:
public void install(ITextViewer textViewer) { for (IReconciler iReconciler : fReconcilers) { if(iReconciler != null) { iReconciler.install(textViewer); } } }

Target:
public void install(ITextViewer textViewer) { for (IReconciler iReconciler : fReconcilers) { iReconciler.install(textViewer); } }