auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static boolean shouldSlaveBeRetained(JCloudsSlave slave) { String templateName = slave.getId().getTemplateName(); String cloudName = slave.getId().getCloudName(); if (templateName != null && cloudName != null) { JCloudsCloud cloud = JCloudsCloud.getByName(cloudName); if (cloud != null) { JCloudsSlaveTemplate template = cloud.getTemplate(templateName); if (template != null) { SlaveOptions slaveOptions = template.getEffectiveSlaveOptions(); Integer instancesMin = slaveOptions.getInstancesMin(); JCloudsComputer computer = slave.getComputer(); Integer retentionTime = slaveOptions.getRetentionTime(); if (instancesMin > 0 && computer != null) { if (retentionTime != 0 && (template.getActiveNodesTotal(false) - 1) < instancesMin) { return true; } if (retentionTime == 0 && !computer.isUsed() && (template.getActiveNodesTotal(true) - 1) < instancesMin) { return true; } } else { if(computer !=null && retentionTime == 0) { return !Jenkins.getInstanceOrNull().getQueue().getBuildableItems(computer).isEmpty(); } } } } } return false; }

Target:
public static boolean shouldSlaveBeRetained(JCloudsSlave slave) { String templateName = slave.getId().getTemplateName(); String cloudName = slave.getId().getCloudName(); if (templateName != null && cloudName != null) { JCloudsCloud cloud = JCloudsCloud.getByName(cloudName); if (cloud != null) { JCloudsSlaveTemplate template = cloud.getTemplate(templateName); if (template != null) { SlaveOptions slaveOptions = template.getEffectiveSlaveOptions(); Integer instancesMin = slaveOptions.getInstancesMin(); JCloudsComputer computer = slave.getComputer(); Integer retentionTime = slaveOptions.getRetentionTime(); if (instancesMin > 0 && computer != null) { if (retentionTime != 0 && (template.getActiveNodesTotal(false) - 1) < instancesMin) { return true; } if (retentionTime == 0 && !computer.isUsed() && (template.getActiveNodesTotal(true) - 1) < instancesMin) { return true; } } else { if (computer != null && retentionTime == 0 && Jenkins.getInstanceOrNull() != null) { return !Jenkins.getInstanceOrNull().getQueue().getBuildableItems(computer).isEmpty(); } } } } } return false; }
Source:
public void findMissingEnumNames() { boolean foundMissingKeys = false; List<ConfigurationValues> missingKeys = new ArrayList<ConfigurationValues>(); for (ConfigurationValues configValue : ConfigurationValues.values()) { if (!configValuesEnumNames.contains(configValue.toString())) { log.error("Found missing key: {}", configValue); foundMissingKeys = true; missingKeys.add(configValue); break; } } assertFalse("Found missing keys: " + missingKeys, foundMissingKeys); }

Target:
public void findMissingEnumNames() { Set<ConfigurationValues> missingKeys = new TreeSet<ConfigurationValues>(); for (ConfigurationValues configValue : ConfigurationValues.values()) { if (!configValuesEnumNames.contains(configValue.toString())) { log.error("Found missing key: {}", configValue); missingKeys.add(configValue); } } assertTrue("Found missing keys: " + missingKeys, missingKeys.isEmpty()); }
Source:
public void startElement(TagNode node) { node.getAttributes() .stream() .filter(attribute -> StringUtils.startsWith(attribute.getName(), "on")) .filter(attribute -> LITERAL_EXPRESION_PATTERN.matcher(attribute.getValue()).find() && !attribute.getValue().contains(DISPLAY_CONTEXT_ATTRIBUTE)) .forEach(attribute -> createViolation(node.getStartLinePosition(), VIOLATION_MESSAGE)); }

Target:
public void startElement(TagNode node) { node.getAttributes() .stream() .filter(attribute -> StringUtils.startsWith(attribute.getName(), EVENT_ATTRIBUTE_PREFIX)) .filter(this::notContainsDisplayContext) .forEach(attribute -> createViolation(node.getStartLinePosition(), VIOLATION_MESSAGE)); }
Source:
void fetchNext() { while (cursor.hasNext()) { K key = cursor.next(); VersionedValue data = cursor.getValue(); if (data != null) { Object currentValue = data.getCurrentValue(); if (currentValue != null || transactionId != TransactionStore.getTransactionId(data.getOperationId())) { registerCurrent(key, currentValue); return; } } } current = null; }

Target:
void fetchNext() { while (cursor.hasNext()) { K key = cursor.next(); VersionedValue data = cursor.getValue(); if (data != null) { Object currentValue = data.getCurrentValue(); if (currentValue != null) { registerCurrent(key, currentValue); return; } if (useNewSnapshot) { long id = data.getOperationId(); if (id != 0) { int tx = TransactionStore.getTransactionId(id); if (transactionId != tx && !committingTransactions.get(tx)) { registerCurrent(key, currentValue); return; } } } } } current = null; }
Source:
public List<UserMembership> searchUserMembershipsFromQuery(String query){ List<UserMembership> organizations = new ArrayList<>(); String userId = userInfoService.currentUser().getUserId(); List<UserMembership> userMemberships = userMembershipService.getMembershipsOfUser(userId); for(UserMembership userMembership : userMemberships){ if(userMembership.getOrganizationName().toLowerCase().contains(query.toLowerCase())){ organizations.add(userMembership); } } return organizations; }

Target:
public List<UserMembership> searchUserMembershipsFromQuery(String query){ String userId = userInfoService.currentUser().getUserId(); List<UserMembership> userMemberships = new ArrayList<>(userMembershipService.getMembershipsOfUser(userId)); UserMembership personalMembership = new UserMembership(); personalMembership.setId(userId); personalMembership.setAdmin(true); personalMembership.setOrganizationId(userId); personalMembership.setOrganizationName("Personal"); userMemberships.add(personalMembership); Pattern p = Pattern.compile(query, Pattern.LITERAL | Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE); return userMemberships .stream() .filter(userMembership -> p.matcher(userMembership.getOrganizationName()).find()) .collect(Collectors.toList()); }
Source:
public Long runAsync(final ImportContext context, final ImportFilter filter, final boolean init) { RequestAttributes parentRequestAttributes = RequestContextHolder.getRequestAttributes(); Authentication auth = SecurityContextHolder.getContext().getAuthentication(); Thread parentThread = Thread.currentThread(); return jobs.submit(new Job<ImportContext>() { @Override protected ImportContext call(ProgressMonitor monitor) throws Exception { try { RequestContextHolder.setRequestAttributes(parentRequestAttributes); SecurityContextHolder.getContext().setAuthentication(auth); if (init) { init(context, true); } run(context, filter, monitor); return context; } finally { if (Thread.currentThread() != parentThread) { RequestContextHolder.resetRequestAttributes(); } } } @Override public String toString() { return "Processing import " + context.getId(); } }); }

Target:
public Long runAsync(final ImportContext context, final ImportFilter filter, final boolean init) { final RequestAttributes parentRequestAttributes = RequestContextHolder.getRequestAttributes(); final Authentication auth = SecurityContextHolder.getContext().getAuthentication(); Thread parentThread = Thread.currentThread(); return jobs.submit(new Job<ImportContext>() { @Override protected ImportContext call(ProgressMonitor monitor) throws Exception { final Authentication oldAuth = SecurityContextHolder.getContext().getAuthentication(); try { RequestContextHolder.setRequestAttributes(parentRequestAttributes); SecurityContextHolder.getContext().setAuthentication(auth); if (init) { init(context, true); } run(context, filter, monitor); return context; } finally { if (Thread.currentThread() != parentThread) { RequestContextHolder.resetRequestAttributes(); SecurityContextHolder.getContext().setAuthentication(oldAuth); } } } @Override public String toString() { return "Processing import " + context.getId(); } }); }
Source:
public MutableBoundedValue<Integer> durability() { return SpongeValueBuilder.boundedBuilder(Keys.ITEM_DURABILITY) .minimum(0) .maximum(Integer.MAX_VALUE) .defaultValue(60) .actualValue(this.durability) .build(); }

Target:
public MutableBoundedValue<Integer> durability() { return SpongeValueBuilder.boundedBuilder(Keys.ITEM_DURABILITY) .minimum(0) .maximum(Integer.MAX_VALUE) .defaultValue(this.defaultDurability) .actualValue(this.durability) .build(); }
Source:
private int getReadCount(FilterSamReads filterTest) throws Exception { final SamReader samReader = SamReaderFactory.makeDefault().open(filterTest.OUTPUT); final SAMRecordIterator iter = samReader.iterator(); int count = 0; while (iter.hasNext()) { iter.next(); ++ count; } iter.close(); samReader.close(); return count; }

Target:
private long getReadCount(FilterSamReads filterTest) throws Exception { final SamReader samReader = SamReaderFactory.makeDefault().open(filterTest.OUTPUT); long count = StreamSupport.stream(samReader.spliterator(), false) .count(); samReader.close(); return count; }
Source:
private void deleteOldPacks(Collection<PackFile> oldPacks, Collection<PackFile> newPacks, boolean ignoreErrors) throws IOException { int deleteOptions = FileUtils.RETRY | FileUtils.SKIP_MISSING; if (ignoreErrors) deleteOptions |= FileUtils.IGNORE_ERRORS; oldPackLoop: for (PackFile oldPack : oldPacks) { String oldName = oldPack.getPackName(); for (PackFile newPack : newPacks) if (oldName.equals(newPack.getPackName())) continue oldPackLoop; FileUtils.delete(nameFor(oldName, ".pack"), deleteOptions); FileUtils.delete(nameFor(oldName, ".idx"), deleteOptions); } }

Target:
private void deleteOldPacks(Collection<PackFile> oldPacks, Collection<PackFile> newPacks, boolean ignoreErrors) throws IOException { int deleteOptions = FileUtils.RETRY | FileUtils.SKIP_MISSING; if (ignoreErrors) deleteOptions |= FileUtils.IGNORE_ERRORS; oldPackLoop: for (PackFile oldPack : oldPacks) { String oldName = oldPack.getPackName(); for (PackFile newPack : newPacks) if (oldName.equals(newPack.getPackName())) continue oldPackLoop; oldPack.close(); FileUtils.delete(nameFor(oldName, ".pack"), deleteOptions); FileUtils.delete(nameFor(oldName, ".idx"), deleteOptions); } }
Source:
public final void testRetrieveRepo() throws Exception { final String name = "reponame"; MatcherAssert.assertThat( new DyRepos(this.region(name)).get(name).name(), Matchers.equalTo(name) ); }

Target:
public void testRetrieveRepo() throws Exception { final String name = "reponame"; MatcherAssert.assertThat( new DyRepos(this.region(name)).get(name).name(), Matchers.equalTo(name) ); }
Source:
static RestSessionCollection sessionCollection( ProjectStore ps, List<StoredSessionWithLastAttempt> sessions) { ProjectMap projs = ps.getProjectsByIdList( sessions.stream() .map(Session::getProjectId) .collect(Collectors.toList())); List<RestSession> collection = sessions.stream() .map(session -> { try { return session(session, projs.get(session.getProjectId()).getName()); } catch (ResourceNotFoundException ex) { return null; } }) .filter(a -> a != null) .collect(Collectors.toList()); return RestSessionCollection.builder() .sessions(collection) .build(); }

Target:
static RestSessionCollection sessionCollection( ProjectStore ps, List<StoredSessionWithLastAttempt> sessions) { ProjectMap projs = ps.getProjectsByIdList( sessions.stream() .map(Session::getProjectId) .collect(Collectors.toList())); List<RestSession> collection = sessions.stream() .map(session -> { try { return session(session, projs.get(session.getProjectId()).getName()); } catch (ResourceNotFoundException ex) { throw new IllegalStateException(String.format(ENGLISH, "An session id=%d references a nonexistent project id=%d", session.getId(), session.getProjectId())); } }) .collect(Collectors.toList()); return RestSessionCollection.builder() .sessions(collection) .build(); }
Source:
public void visitToken(DetailAST ast) { if (isInterfaceMember(ast)) { if (ast.getType() == TokenTypes.METHOD_DEF) { processMethod(ast); } if (ast.getType() == TokenTypes.VARIABLE_DEF) { processField(ast); } if (ast.getType() == TokenTypes.CLASS_DEF || ast.getType() == TokenTypes.INTERFACE_DEF || ast.getType() == TokenTypes.ENUM_DEF) { processNestedType(ast); } } }

Target:
public void visitToken(DetailAST ast) { if (ScopeUtil.isInInterfaceBlock(ast) && !ScopeUtil.isInCodeBlock(ast)) { switch (ast.getType()) { case TokenTypes.METHOD_DEF: processMethod(ast); break; case TokenTypes.VARIABLE_DEF: processField(ast); break; case TokenTypes.CLASS_DEF: case TokenTypes.INTERFACE_DEF: case TokenTypes.ENUM_DEF: processNestedType(ast); break; default: throw new IllegalStateException(ast.toString()); } } }
Source:
public Object setFlag(HttpServletRequest request, HttpServletResponse responseToClient, @PathVariable(value = "action") String action, @RequestParam(value = "categoryTerm", required = true) String categoryTerm, @RequestParam(value = "articleDoi", required = true) String articleDoi) throws IOException { ApiAddress.Builder address = ApiAddress.builder("articles").embedDoi(articleDoi).addToken("categories") .addParameter("flag", action) .addParameter("categoryTerm", categoryTerm); String authId = request.getRemoteUser(); if (authId != null) { String userId = userApi.getUserIdFromAuthId(authId); address.addParameter("userId", userId); } articleApi.postObject(address.build(), null); return ImmutableMap.of(); }

Target:
public void setFlag(HttpServletRequest request, HttpServletResponse responseToClient, @PathVariable(value = "action") String action, @RequestParam(value = "categoryTerm", required = true) String categoryTerm, @RequestParam(value = "articleDoi", required = true) String articleDoi) throws IOException { ApiAddress.Builder address = ApiAddress.builder("articles").embedDoi(articleDoi).addToken("categories") .addParameter("flag", action) .addParameter("categoryTerm", categoryTerm); String authId = request.getRemoteUser(); if (authId != null) { String userId = userApi.getUserIdFromAuthId(authId); address.addParameter("userId", userId); } articleApi.postObject(address.build(), null); }
Source:
public boolean isOvershadowed(Interval interval, VersionType version) { TimelineEntry entry = completePartitionsTimeline.get(interval); if (entry != null) { return versionComparator.compare(version, entry.getVersion()) < 0; } Interval lower = completePartitionsTimeline.floorKey( new Interval(interval.getStartMillis(), JodaUtils.MAX_INSTANT)); if (lower == null || !lower.overlaps(interval)) { return false; } Interval prev = null; Interval curr = lower; do { if (curr == null || (prev != null && curr.getStartMillis() > prev.getEndMillis()) || versionComparator.compare(version, completePartitionsTimeline.get(curr).getVersion()) >= 0 ) { return false; } prev = curr; curr = completePartitionsTimeline.higherKey(curr); } while (interval.getEndMillis() > prev.getEndMillis()); return true; }

Target:
public boolean isOvershadowed(Interval interval, VersionType version) { try { lock.readLock().lock(); TimelineEntry entry = completePartitionsTimeline.get(interval); if (entry != null) { return versionComparator.compare(version, entry.getVersion()) < 0; } Interval lower = completePartitionsTimeline.floorKey( new Interval(interval.getStartMillis(), JodaUtils.MAX_INSTANT) ); if (lower == null || !lower.overlaps(interval)) { return false; } Interval prev = null; Interval curr = lower; do { if (curr == null || (prev != null && curr.getStartMillis() > prev.getEndMillis()) || versionComparator.compare(version, completePartitionsTimeline.get(curr).getVersion()) >= 0 ) { return false; } prev = curr; curr = completePartitionsTimeline.higherKey(curr); } while (interval.getEndMillis() > prev.getEndMillis()); return true; } finally { lock.readLock().unlock(); } }
Source:
public static Slice substr(@SqlType(StandardTypes.VARBINARY) Slice slice, @SqlType(StandardTypes.BIGINT) long start) { if (start == 0 || slice.length() == 0) { return Slices.EMPTY_SLICE; } int startByte = Ints.saturatedCast(start); if (startByte > 0) { int indexStart = startByte - 1; if (indexStart >= slice.length()) { return Slices.EMPTY_SLICE; } return slice.slice(indexStart, slice.length() - indexStart); } startByte += slice.length(); if (startByte < 0) { return Slices.EMPTY_SLICE; } return slice.slice(startByte, slice.length() - startByte); }

Target:
public static Slice substr(@SqlType(StandardTypes.VARBINARY) Slice slice, @SqlType(StandardTypes.BIGINT) long start) { return substr(slice, start, slice.length() - start + 1); }
Source:
private void addIpv6BootProtocol(Map<String, Object> opts, HostNetwork attachment) { final Ipv6BootProtocol ipv6BootProtocol = attachment.getIpv6BootProtocol(); opts.put(DHCPV6_BOOT_PROTOCOL, IPV6_DHCP_PROTOCOL_SET.contains(ipv6BootProtocol)); opts.put(DHCPV6_AUTOCONF, IPV6_AUTOCONF_PROTOCOL_SET.contains(ipv6BootProtocol)); if (Ipv6BootProtocol.STATIC_IP == ipv6BootProtocol) { putIfNotEmpty(opts, "ipv6addr", getIpv6Address(attachment)); opts.put("ipv6gateway", attachment.isDefaultRoute() && attachment.getIpv6Gateway() != null ? attachment.getIpv6Gateway() : IpAddressPredicate.UNSPECIFIED_IPV6); } }

Target:
private void addIpv6BootProtocol(Map<String, Object> opts, HostNetwork attachment) { final Ipv6BootProtocol ipv6BootProtocol = attachment.getIpv6BootProtocol(); opts.put(DHCPV6_BOOT_PROTOCOL, IPV6_DHCP_PROTOCOL_SET.contains(ipv6BootProtocol)); opts.put(DHCPV6_AUTOCONF, IPV6_AUTOCONF_PROTOCOL_SET.contains(ipv6BootProtocol)); if (Ipv6BootProtocol.STATIC_IP == ipv6BootProtocol) { putIfNotEmpty(opts, "ipv6addr", getIpv6Address(attachment)); opts.put("ipv6gateway", selectIpv6Gateway(attachment)); } }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SexGenotypeContigPairKey that = (SexGenotypeContigPairKey) o; if (sexGenotype != null ? !sexGenotype.equals(that.sexGenotype) : that.sexGenotype != null) return false; return contig != null ? contig.equals(that.contig) : that.contig == null; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SexGenotypeContigPairKey that = (SexGenotypeContigPairKey) o; if (sexGenotype.equals(that.sexGenotype) && contig.equals(that.contig)) { return true; } else { return false; } }
Source:
public void testConfirmFlagEffects() { new MockUp<sqlline.Commands>() { @Mock private int getUserAnswer( String question, int... allowedAnswers) throws IOException { return 'y'; } }; SqlLine line = new SqlLine(); assertEquals(Boolean.FALSE, line.getOpts().getConfirm()); assertEquals("default", line.getOpts().getConfirmPattern()); String script = "CREATE TABLE dummy_test(pk int);\n" + "INSERT INTO dummy_test(pk) VALUES(1);\n" + "INSERT INTO dummy_test(pk) VALUES(2);\n" + "INSERT INTO dummy_test(pk) VALUES(3);\n" + "DELETE FROM dummy_test;\n" + "DROP TABLE dummy_test;\n"; checkScriptFile(script, true, equalTo(SqlLine.Status.OK), containsString(" ")); script = "!set confirm true\n" + script; checkScriptFile(script, true, equalTo(SqlLine.Status.OK), containsString(" ")); }

Target:
public void testConfirmFlagEffects() { new MockUp<sqlline.Commands>() { @Mock public int getUserAnswer( String question, int... allowedAnswers) { return 'n'; } }; SqlLine line = new SqlLine(); assertEquals(Boolean.FALSE, line.getOpts().getConfirm()); assertEquals("default", line.getOpts().getConfirmPattern()); String script = "CREATE TABLE dummy_test(pk int);\n" + "INSERT INTO dummy_test(pk) VALUES(1);\n" + "INSERT INTO dummy_test(pk) VALUES(2);\n" + "INSERT INTO dummy_test(pk) VALUES(3);\n" + "DELETE FROM dummy_test;\n" + "DROP TABLE dummy_test;\n"; checkScriptFile(script, true, equalTo(SqlLine.Status.OK), containsString(" ")); script = "!set confirm true\n" + script; checkScriptFile(script, true, equalTo(SqlLine.Status.OTHER), containsString(line.loc("abort-action"))); }
Source:
public void testNoAttachmentOnEdgeSelectionWithPreferenceDisabled() { }

Target:
public void testNoAttachmentOnEdgeSelectionWithPreferenceDisabled() { testAttachmentOnEdgeSelection(false); }
Source:
public void readLevels(String levelPath, boolean isCustom) { try { DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance(); DocumentBuilder dBuilder = factory.newDocumentBuilder(); Document doc = dBuilder.parse(new File(levelPath)); doc.getDocumentElement().normalize(); NodeList levels = doc.getElementsByTagName("LevelName"); for (int i = 0; i < levels.getLength(); i++) { Node n = levels.item(i); String custom; if (isCustom) { custom = "/Custom"; } else { custom = ""; } String s = "src/main/resources/level/" + custom + n.getTextContent(); levelList.add(s); } currentLevel = 0; } catch (Exception e) { e.printStackTrace(); } }

Target:
public void readLevels(String levelPath, boolean isCustom) { try { DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance(); DocumentBuilder dBuilder = factory.newDocumentBuilder(); Document doc = dBuilder.parse(new File(levelPath)); doc.getDocumentElement().normalize(); NodeList levels = doc.getElementsByTagName("LevelName"); for (int i = 0; i < levels.getLength(); i++) { Node n = levels.item(i); String custom; if (isCustom) { custom = "Custom/"; } else { custom = ""; } String s = "src/main/resources/level/" + custom + n.getTextContent(); levelList.add(s); } currentLevel = 0; } catch (Exception e) { e.printStackTrace(); } }
Source:
public void wsdlToWsImportTest() { ImportFromFileSystemWizard.openWizard() .setPath("resources/wsdl") .setFolder(PROJECT_NAME) .selectFile("Hello.wsdl") .finish(); WsdlWebImportWizard.openWizard() .setModelName("WsdlToWS") .setProject(PROJECT_NAME) .importFromWorkspace(PROJECT_NAME,"Hello.wsdl") .nextPage() .nextPage() .nextPage() .nextPage() .finish(); new WorkbenchShell(); WsdlWebImportWizard.openWizard() .setModelName("WsdlToWS2") .setProject(PROJECT_NAME) .importFromURL("<LINK_0>", null, null, false) .nextPage() .nextPage() .nextPage() .nextPage() .finish(); assertTrue(modelExplorer.containsItem(PROJECT_NAME,"WsdlToWS.xmi")); assertTrue(modelExplorer.containsItem(PROJECT_NAME,"WsdlToWS2Responses.xmi")); }

Target:
public void wsdlToWsImportTest() { Properties properties = teiidServer.getServerConfig().getConnectionProfile(ConnectionProfileConstants.SOAP).asProperties(); ImportFromFileSystemWizard.openWizard() .setPath("resources/wsdl") .setFolder(PROJECT_NAME) .selectFile("Hello.wsdl") .finish(); WsdlWebImportWizard.openWizard() .setModelName("WsdlToWS") .setProject(PROJECT_NAME) .importFromWorkspace(PROJECT_NAME,"Hello.wsdl") .nextPage() .nextPage() .nextPage() .nextPage() .finish(); new WorkbenchShell(); WsdlWebImportWizard.openWizard() .setModelName("WsdlToWS2") .setProject(PROJECT_NAME) .importFromURL(properties.getProperty("url"), null, null, false) .nextPage() .nextPage() .nextPage() .nextPage() .finish(); assertTrue(modelExplorer.containsItem(PROJECT_NAME,"WsdlToWS.xmi")); assertTrue(modelExplorer.containsItem(PROJECT_NAME,"WsdlToWS2Responses.xmi")); }
Source:
public void setup() throws IOException { complexGeometry = GeoFunctions.stGeometryFromText(Slices.utf8Slice(loadPolygon("large_polygon.txt"))); simpleGeometry = GeoFunctions.stGeometryFromText(Slices.utf8Slice("POLYGON ((1 1, 4 1, 1 4))")); }

Target:
public void setup() throws IOException { complexGeometry = stGeometryFromText(utf8Slice(loadPolygon("large_polygon.txt"))); simpleGeometry = stGeometryFromText(utf8Slice("POLYGON ((1 1, 4 1, 1 4))")); }
Source:
public void testNestedLoad() throws IOException { File tempFile = File.createTempFile("json", null); tempFile.deleteOnExit(); FileWriter writer = new FileWriter(tempFile); writer.write("{\"entities\":{\"hashtags\":[{\"indices\":[0,0],\"text\":\"test1\"},{\"indices\":[0,0],\"text\":\"test2\"}],\"user_mentions\":[],\"urls\":[]}}"); writer.close(); PigServer pigServer = UnitTestUtil.makePigServer(); logAndRegisterQuery(pigServer, "data = load '" + tempFile.getAbsolutePath() + "' using com.twitter.elephantbird.pig.load.JsonLoader() as (json: map[]);"); logAndRegisterQuery(pigServer, "a = foreach data generate json#'entities'#'hashtags' as h;"); logAndRegisterQuery(pigServer, "b = foreach a generate flatten(h) as h;"); logAndRegisterQuery(pigServer, "c = foreach b generate h#'text' as h;"); Iterator<Tuple> tuples = pigServer.openIterator("c"); int count = 0; String[] hashtags = {"test1","test2"}; while(tuples.hasNext()) { Tuple t = tuples.next(); Assert.assertEquals(hashtags[count], t.get(0).toString()); count++; } Assert.assertEquals(2, count); }

Target:
public void testNestedLoad() throws IOException { File tempFile = File.createTempFile("json", null); tempFile.deleteOnExit(); FileWriter writer = new FileWriter(tempFile); writer.write( "{" + " \"entities\": {" + " \"hashtags\": [" + " {\"indices\": [0,0], \"text\": \"test1\"}," + " {\"indices\": [0,0], \"text\": \"test2\"}" + " ]," + " \"user_mentions\": []," + " \"urls\": []" + " }" + "}"); writer.close(); PigServer pigServer = UnitTestUtil.makePigServer(); pigServer.getPigContext().getProperties().setProperty(JsonLoader.NESTED_LOAD_KEY, "true"); logAndRegisterQuery(pigServer, "data = load '" + tempFile.getAbsolutePath() + "' using com.twitter.elephantbird.pig.load.JsonLoader() as (json: map[]);"); logAndRegisterQuery(pigServer, "a = foreach data generate json#'entities'#'hashtags' as h;"); logAndRegisterQuery(pigServer, "b = foreach a generate flatten(h) as h;"); logAndRegisterQuery(pigServer, "c = foreach b generate h#'text' as h;"); Iterator<Tuple> tuples = pigServer.openIterator("c"); int count = 0; String[] hashtags = {"test1","test2"}; while(tuples.hasNext()) { Tuple t = tuples.next(); Assert.assertEquals(hashtags[count], t.get(0).toString()); count++; } Assert.assertEquals(2, count); }
Source:
void should_fail_if_actual_does_not_contain_any_files_matching_the_given_pathMatcherPattern() { Path fooDir = createDirectory(tempDir, "foo", "foo2.data"); createDirectory(fooDir, "foo3"); expectAssertionError( () -> files.assertIsDirectoryRecursivelyContaining(INFO, tempDirAsFile, TXT_EXTENSION_PATTERN)); verify(failures) .failure(INFO, directoryShouldContain(tempDirAsFile, toAbsolutePaths(list(new File(tempDirAsFile, "foo"), new File(tempDirAsFile, "foo/foo2.data"), new File(tempDirAsFile, "foo/foo3") )), TXT_EXTENSION_PATTERN_DESCRIPTION)); }

Target:
void should_fail_if_actual_does_not_contain_any_files_matching_the_given_pathMatcherPattern() { Path fooDir = createDirectory(tempDir, "foo", "foo2.data"); createDirectory(fooDir, "foo3"); expectAssertionError( () -> files.assertIsDirectoryRecursivelyContaining(INFO, tempDirAsFile, TXT_EXTENSION_PATTERN)); verify(failures) .failure(INFO, directoryShouldContainRecursively(tempDirAsFile, toAbsolutePaths(list(new File(tempDirAsFile, "foo"), new File(tempDirAsFile, "foo/foo2.data"), new File(tempDirAsFile, "foo/foo3") )), TXT_EXTENSION_PATTERN_DESCRIPTION)); }
Source:
private void setUpdatedVersions(Set<Version> prevVersions, Set<Version> versions, DateTime now) { Map<String, Broadcast> prevBroadcasts = previousBroadcasts(prevVersions); Map<String, Location> prevLocations = previousLocations(prevVersions); for (Version version : versions) { for (Broadcast broadcast : version.getBroadcasts()) { Broadcast prevBroadcast = prevBroadcasts.get(broadcast.getSourceId()); if(prevBroadcast == null || !equal(prevBroadcast, broadcast)) { broadcast.setLastUpdated(now); } else { broadcast.setLastUpdated(prevBroadcast.getLastUpdated()); } } for (Encoding encoding : version.getManifestedAs()) { for (Location location : encoding.getAvailableAt()) { Location prevLocation = prevLocations.get(location.getUri()); if(prevLocation == null || !equal(prevLocation, location)) { location.setLastUpdated(now); } else { location.setLastUpdated(prevLocation.getLastUpdated()); } } } } }

Target:
private void setUpdatedVersions(Set<Version> prevVersions, Set<Version> versions, DateTime now) { Map<String, Version> prevVersionsMap = prevVersionsMap(prevVersions); Map<String, Broadcast> prevBroadcasts = previousBroadcasts(prevVersions); for (Version version : versions) { Version prevVersion = prevVersionsMap.get(version.getCanonicalUri()); setLastUpdatedTime(version, prevVersion, now); for (Broadcast broadcast : version.getBroadcasts()) { Broadcast prevBroadcast = prevBroadcasts.get(broadcast.getSourceId()); if(prevBroadcast != null && equal(prevBroadcast, broadcast) && prevBroadcast.getLastUpdated() != null) { broadcast.setLastUpdated(prevBroadcast.getLastUpdated()); } else { broadcast.setLastUpdated(now); } } Set<Encoding> prevEncodings = getPreviousEncodings(prevVersion); for (Encoding encoding : version.getManifestedAs()) { Optional<Encoding> prevEncoding = Iterables.tryFind(prevEncodings, isEqualTo(encoding)); setLastUpdatedTime(encoding, prevEncoding, now); setLocationsLastUpdatedTime(prevEncoding, encoding.getAvailableAt(), now); } } }
Source:
private int getEnvClasspathIndex(String[] env) { if (env != null) { for (int i = 0; i < env.length; i++) { if (env[i].regionMatches(true, 0, "CLASSPATH=", 0, 10)) { return i; } } } return -1; }

Target:
private int getEnvClasspathIndex(String[] env) { if (env != null) { for (int i = 0; i < env.length; i++) { if (env[i].regionMatches(true, 0, CLASSPATH_ENV_VAR_PREFIX, 0, 10)) { return i; } } } return -1; }
Source:
public Invalid(E error) { this.error = error; }

Target:
private Invalid(E error) { this.error = error; }
Source:
public void validatePartitionAssignmentSupported(Datastream datastream) throws DatastreamValidationException { try { String connectorName = datastream.getConnectorName(); ConnectorInfo connectorInfo = _connectors.get(connectorName); if (connectorInfo == null) { throw new DatastreamValidationException("Invalid connector: " + connectorName); } if (!(connectorInfo.getAssignmentStrategy() instanceof StickyPartitionAssignmentStrategy)) { throw new DatastreamValidationException("Invalid Partition assignment strategy " + connectorName); } } catch (Exception e) { _dynamicMetricsManager.createOrUpdateMeter(MODULE, "isPartitionAssignmentSupported", NUM_ERRORS, 1); throw e; } }

Target:
public void validatePartitionAssignmentSupported(Datastream datastream) throws DatastreamValidationException { try { String connectorName = datastream.getConnectorName(); ConnectorInfo connectorInfo = _connectors.get(connectorName); if (connectorInfo == null) { throw new DatastreamValidationException("Invalid connector: " + connectorName); } Connector connectorInstance = connectorInfo.getConnector().getConnectorInstance(); if (!(connectorInstance.getDatastreamPartitions().containsKey(DatastreamUtils.getGroupName(datastream)))) { String msg = String.format("Partition assignment is not managed by connector, datastream %s", datastream.getName()); _log.error(msg); throw new DatastreamValidationException(msg); } } catch (Exception e) { _dynamicMetricsManager.createOrUpdateMeter(MODULE, "isPartitionAssignmentSupported", NUM_ERRORS, 1); throw e; } }
Source:
protected void handleMessage(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessage responseMessage, final OsgpException osgpException) throws FunctionalException { if (responseMessage.getDataObject() instanceof ArrayList) { @SuppressWarnings("unchecked") final List<FirmwareVersionDto> firmwareVersionList = (List<FirmwareVersionDto>) responseMessage .getDataObject(); this.configurationService.handleUpdateFirmwareResponse(deviceMessageMetadata, responseMessage.getResult(), osgpException, firmwareVersionList); } else { throw new FunctionalException(FunctionalExceptionType.VALIDATION_ERROR, ComponentType.DOMAIN_SMART_METERING, new OsgpException(ComponentType.DOMAIN_SMART_METERING, "DataObject for response message should be of type ArrayList")); } }

Target:
protected void handleMessage(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessage responseMessage, final OsgpException osgpException) throws FunctionalException { if (responseMessage.getDataObject() instanceof List) { @SuppressWarnings("unchecked") final List<FirmwareVersionDto> firmwareVersionList = (List<FirmwareVersionDto>) responseMessage .getDataObject(); this.configurationService.handleUpdateFirmwareResponse(deviceMessageMetadata, responseMessage.getResult(), osgpException, firmwareVersionList); } else { throw new FunctionalException(FunctionalExceptionType.VALIDATION_ERROR, ComponentType.DOMAIN_SMART_METERING, new OsgpException(ComponentType.DOMAIN_SMART_METERING, "DataObject for response message should be of type ArrayList")); } }
Source:
private Message getOldUOMAnnouncement() { boolean mainJarAvailable = transitionMainJarFetcher == null ? false : transitionMainJarFetcher.fetched(); return DMT.createUOMAnnouncement(updateURI.toString(), revocationURI .toString(), revocationChecker.hasBlown(), mainJarAvailable ? TRANSITION_VERSION : -1, revocationChecker.lastSucceededDelta(), revocationChecker .getRevocationDNFCounter(), revocationChecker .getBlobSize(), mainJarAvailable ? transitionMainJarFetcher.getBlobSize() : -1, (int) node.nodeStats.getNodeAveragePingTime(), (int) node.nodeStats.getBwlimitDelayTime()); }

Target:
private Message getOldUOMAnnouncement() { boolean mainJarAvailable = transitionMainJarFetcher == null ? false : transitionMainJarFetcher.fetched(); return DMT.createUOMAnnouncement(transitionMainJarURIAsUSK.toString(), revocationURI .toString(), revocationChecker.hasBlown(), mainJarAvailable ? TRANSITION_VERSION : -1, revocationChecker.lastSucceededDelta(), revocationChecker .getRevocationDNFCounter(), revocationChecker .getBlobSize(), mainJarAvailable ? transitionMainJarFetcher.getBlobSize() : -1, (int) node.nodeStats.getNodeAveragePingTime(), (int) node.nodeStats.getBwlimitDelayTime()); }
Source:
public ZooKeeperInstance(UUID instanceId, String zooKeepers) { this(null, instanceId.toString(), zooKeepers, -1, new ZooCacheFactory()); }

Target:
public ZooKeeperInstance(UUID instanceId, String zooKeepers) { this(ClientConfiguration.loadDefault().withInstance(instanceId).withZkHosts(zooKeepers)); }
Source:
void verifyTimeDurationComputationWithSecondsRemaining() { final Instant banExpiry = CURRENT_TIME.plus(20, ChronoUnit.SECONDS); final String result = PlayerIsMutedMessage.muteDurationRemainingToString.apply( Clock.fixed(CURRENT_TIME, ZoneOffset.UTC), banExpiry); assertThat(result, is("20 seconds")); }

Target:
void verifyTimeDurationComputationWithSecondsRemaining() { final Instant banExpiry = CURRENT_TIME.plus(20, ChronoUnit.SECONDS); final String result = formattingFunction.apply(banExpiry); assertThat(result, is("20 seconds")); }
Source:
protected void initInternal() throws LifecycleException { super.initInternal(); if (traceDelay == 0) { throw new LifecycleException("The delay for trace must be greater than 0"); } if (projectId.isEmpty()) { throw new LifecycleException("You must specify a project to store the traces"); } try { traceService = TraceGrpcApiService.builder() .setScheduledDelay(traceDelay) .setProjectId(projectId) .build(); Trace.init(traceService); log.trace("Trace service initialized for project: " + projectId); } catch (IOException e) { log.error("An error occurred during the initialization of the Trace valve", e); throw new LifecycleException(e); } }

Target:
protected void initInternal() throws LifecycleException { super.initInternal(); initTraceService(); }
Source:
public void cssChrome_004_verifyEditSummaryAppearsAndWorks() { WikiBasePageObject wiki = new WikiBasePageObject(driver); wiki.openWikiPage(); CommonFunctions.logInCookie(Properties.userNameStaff, Properties.passwordStaff); SpecialCssPageObject specialCss = wiki.openSpecialCss(); String randomText = specialCss.generateRandomString(); specialCss.sendEditSummaryText(randomText); specialCss.saveCssContent(randomText, wiki); wiki.openArticle(URLsContent.buildUrl(URLsContent.mediaWikiCss, URLsContent.historyAction)); String editSummary = wiki.getFirstCssRevision(); randomText = "(" + randomText + ")"; Assertion.assertEquals(randomText, editSummary); }

Target:
public void cssChrome_004_verifyEditSummaryAppearsAndWorks() { WikiBasePageObject wiki = new WikiBasePageObject(driver); wiki.openWikiPage(); CommonFunctions.logInCookie(Properties.userNameStaff, Properties.passwordStaff); SpecialCssPageObject specialCss = wiki.openSpecialCss(); String currentTimestamp = specialCss.getTimeStamp(); specialCss.sendEditSummaryText(currentTimestamp); specialCss.saveCssContent(currentTimestamp, wiki); wiki.openArticle(URLsContent.buildUrl(URLsContent.mediaWikiCss, URLsContent.historyAction)); String editSummary = wiki.getFirstCssRevision(); Assertion.assertStringContains(editSummary, currentTimestamp); }
Source:
public boolean isHealthy() { Set<State> unhealthyStates = ImmutableSet.of( UNHEALTHY_SUPERVISOR, UNHEALTHY_TASKS, UNABLE_TO_CONNECT_TO_STREAM, LOST_CONTACT_WITH_STREAM ); return !unhealthyStates.contains(this); }

Target:
public boolean isHealthy() { return healthy; }
Source:
public void checkSourceVideoContent(String desiredContent) { Assertion.assertEquals(getSourceContent().substring(1, 38) + getSourceContent().substring(48), desiredContent.substring(1, 38) + desiredContent.substring(48) ); }

Target:
public void checkSourceVideoContent(String desiredContent) { int fileNameLength = 38; int fileParametersBeginIndex = 48; Assertion.assertEquals(getSourceContent().substring(1, fileNameLength) + getSourceContent().substring(fileParametersBeginIndex), desiredContent.substring(1, fileNameLength) + desiredContent.substring(fileParametersBeginIndex) ); }
Source:
StreamProcessor(String sdkKey, LDConfig config, FeatureRequestor requestor) { this.store = config.featureStore; this.config = config; this.sdkKey = sdkKey; this.requestor = requestor; this.heartbeatDetectorService = Executors.newScheduledThreadPool(1); heartbeatDetectorService.scheduleAtFixedRate(new HeartbeatDetector(), 1, 1, TimeUnit.MINUTES); }

Target:
StreamProcessor(String sdkKey, LDConfig config, FeatureRequestor requestor) { this.store = config.featureStore; this.config = config; this.sdkKey = sdkKey; this.requestor = requestor; ThreadFactory threadFactory = new ThreadFactoryBuilder() .setNameFormat("LaunchDarkly-HeartbeatDetector-%d") .build(); this.heartbeatDetectorService = Executors.newSingleThreadScheduledExecutor(threadFactory); heartbeatDetectorService.scheduleAtFixedRate(new HeartbeatDetector(), 1, 1, TimeUnit.MINUTES); }
Source:
public Map<String, Optional<GameProfile>> lookupByNames(Iterable<String> names) { checkNotNull(names, "names"); Map<String, Optional<GameProfile>> result = Maps.newHashMap(); this.getServer().getGameProfileRepository().findProfilesByNames(Iterables.toArray(names, String.class), Agent.MINECRAFT, new MapProfileLookupCallback(result)); if (!result.isEmpty()) { for (Map.Entry<String, Optional<GameProfile>> entry : result.entrySet()) { if (entry.getValue().isPresent()) { this.addEntry((com.mojang.authlib.GameProfile) entry.getValue().get(), null); } } return ImmutableMap.copyOf(result); } else { return ImmutableMap.of(); } }

Target:
public Map<String, Optional<GameProfile>> lookupByNames(Iterable<String> names) { checkNotNull(names, "names"); Map<String, Optional<GameProfile>> result = Maps.newHashMap(); this.getServer().getGameProfileRepository().findProfilesByNames(Iterables.toArray(names, String.class), Agent.MINECRAFT, new MapProfileLookupCallback(result)); if (!result.isEmpty()) { for (Optional<GameProfile> entry : result.values()) { if (entry.isPresent()) { this.addEntry((com.mojang.authlib.GameProfile) entry.get(), null); } } return ImmutableMap.copyOf(result); } else { return ImmutableMap.of(); } }
Source:
public void testFetchWithBlobLimitFilter() throws Exception { InMemoryRepository server2 = newRepo("server2"); try (TestRepository<InMemoryRepository> remote2 = new TestRepository<>( server2)) { RevBlob longBlob = remote2.blob("foobar"); RevBlob shortBlob = remote2.blob("fooba"); RevTree tree = remote2.tree(remote2.file("1", longBlob), remote2.file("2", shortBlob)); RevCommit commit = remote2.commit(tree); remote2.update("master", commit); server2.getConfig().setBoolean("uploadpack", null, "allowfilter", true); testProtocol = new TestProtocol<>(new UploadPackFactory<Object>() { @Override public UploadPack create(Object req, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { UploadPack up = new UploadPack(db); return up; } }, null); uri = testProtocol.register(ctx, server2); try (Transport tn = testProtocol.open(uri, client, "server2")) { tn.setFilterSpec(FilterSpec.withBlobLimit((5))); tn.fetch(NullProgressMonitor.INSTANCE, Collections.singletonList(new RefSpec(commit.name()))); assertFalse( client.getObjectDatabase().has(longBlob.toObjectId())); assertTrue( client.getObjectDatabase().has(shortBlob.toObjectId())); } } }

Target:
public void testFetchWithBlobLimitFilter() throws Exception { InMemoryRepository server2 = newRepo("server2"); try (TestRepository<InMemoryRepository> remote2 = new TestRepository<>( server2)) { RevBlob longBlob = remote2.blob("foobar"); RevBlob shortBlob = remote2.blob("fooba"); RevTree tree = remote2.tree(remote2.file("1", longBlob), remote2.file("2", shortBlob)); RevCommit commit = remote2.commit(tree); remote2.update("master", commit); server2.getConfig().setBoolean("uploadpack", null, "allowfilter", true); testProtocol = new TestProtocol<>(new UploadPackFactory<Object>() { @Override public UploadPack create(Object req, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { UploadPack up = new UploadPack(db); return up; } }, null); uri = testProtocol.register(ctx, server2); try (Transport tn = testProtocol.open(uri, client, "server2")) { tn.setFilterSpec(FilterSpec.withBlobLimit(5)); tn.fetch(NullProgressMonitor.INSTANCE, Collections.singletonList(new RefSpec(commit.name()))); assertFalse( client.getObjectDatabase().has(longBlob.toObjectId())); assertTrue( client.getObjectDatabase().has(shortBlob.toObjectId())); } } }
Source:
Account(Short id, String name, AccountStatus status, Collection<Container> containers) { this.id = id; this.name = name; this.status = status; checkRequiredFieldsForBuild(); if (containers != null) { for (Container container : containers) { updateContainerMap(container); } checkAccountIdInContainers(); checkDuplicateContainerNameOrId(containers); } }

Target:
Account(Short id, String name, AccountStatus status, Collection<Container> containers) throws JSONException { this.id = id; this.name = name; this.status = status; checkRequiredFieldsForBuild(); if (containers != null) { for (Container container : containers) { checkParentAccountIdInContainers(container); checkDuplicateContainerNameOrId(container); updateContainerMap(container); } } }
Source:
public Application edit(Application applicationForLeave, Person person, Optional<String> comment) { if (applicationForLeave.getStatus().compareTo(WAITING) != 0) { throw new EditApplicationForLeaveNotAllowedException("Cannot edit application for leave " + "with id " + applicationForLeave.getId() + " because the status is " + applicationForLeave.getStatus() + " and not waiting."); } applicationForLeave.setStatus(ApplicationStatus.WAITING); applicationForLeave.setEditedDate(LocalDate.now(clock)); final Application savedApplication = applicationService.save(applicationForLeave); commentService.create(savedApplication, ApplicationAction.EDITED, comment, person); applicationMailService.sendEditedApplicationNotification(savedApplication, person); return savedApplication; }

Target:
public Application edit(Application applicationForLeave, Person person, Optional<String> comment) { if (applicationForLeave.getStatus().compareTo(WAITING) != 0) { throw new EditApplicationForLeaveNotAllowedException(String.format("Cannot edit application for leave " + "with id %d because the status is %s and not waiting.", applicationForLeave.getId(), applicationForLeave.getStatus())); } applicationForLeave.setStatus(ApplicationStatus.WAITING); applicationForLeave.setEditedDate(LocalDate.now(clock)); final Application savedApplication = applicationService.save(applicationForLeave); commentService.create(savedApplication, ApplicationAction.EDITED, comment, person); applicationMailService.sendEditedApplicationNotification(savedApplication, person); return savedApplication; }
Source:
public NormalizationBolt(String normalizationProcessorJson) { this(Utils.getObjectFromJson(normalizationProcessorJson, NormalizationProcessor.class)); }

Target:
public NormalizationBolt(String normalizationProcessorJson) { this(Utils.createObjectFromJson(normalizationProcessorJson, NormalizationProcessor.class)); }
Source:
public void start() { ClientConfig clientConfig = new ClientConfig(); clientConfig.getGroupConfig().setName("dev").setPassword("dev-pass"); clientConfig.getNetworkConfig().addAddress(servers.split(";")); hazelcastInstance = HazelcastClient.newHazelcastClient(clientConfig); MembershipListener listener = new MembershipListener() { @Override public void memberAdded(MembershipEvent membershipEvent) { updateMembers(membershipEvent.getMembers()); } @Override public void memberRemoved(MembershipEvent membershipEvent) { updateMembers(membershipEvent.getMembers()); } @Override public void memberAttributeChanged(MemberAttributeEvent memberAttributeEvent) { } }; synchronized (this) { addMembershipListener(listener); updateMembers(hazelcastInstance.getCluster().getMembers()); } }

Target:
public void start() { ClientConfig clientConfig = new ClientConfig(); clientConfig.getGroupConfig().setName(groupName).setPassword(groupPass); clientConfig.getNetworkConfig().addAddress(servers); hazelcastInstance = HazelcastClient.newHazelcastClient(clientConfig); }
Source:
public File execute(SelenideElement proxy, WebElementSource linkWithHref, Object[] args) throws IOException { WebElement link = linkWithHref.findAndAssertElementIsVisible(); long timeout = getTimeout(args); if (Configuration.fileDownload == HTTPGET) { LOG.config("selenide.fileDownload = " + System.getProperty("selenide.fileDownload") + " download file via http get"); return downloadFileWithHttpRequest.download(link, timeout); } else if (!Configuration.proxyEnabled) { throw new IllegalStateException("Cannot download file: proxy server is not enabled. Setup Configuration.proxyEnabled"); } else if (webdriverContainer.getProxyServer() == null) { throw new IllegalStateException("Cannot download file: proxy server is not started"); } else { return downloadFileWithProxyServer.download(linkWithHref, link, webdriverContainer.getProxyServer(), timeout); } }

Target:
public File execute(SelenideElement proxy, WebElementSource linkWithHref, Object[] args) throws IOException { WebElement link = linkWithHref.findAndAssertElementIsVisible(); long timeout = getTimeout(args); if (Configuration.fileDownload == HTTPGET) { LOG.config("selenide.fileDownload = " + System.getProperty("selenide.fileDownload") + " download file via http get"); return downloadFileWithHttpRequest.download(link, timeout); } if (!Configuration.proxyEnabled) { throw new IllegalStateException("Cannot download file: proxy server is not enabled. Setup Configuration.proxyEnabled"); } if (webdriverContainer.getProxyServer() == null) { throw new IllegalStateException("Cannot download file: proxy server is not started"); } return downloadFileWithProxyServer.download(linkWithHref, link, webdriverContainer.getProxyServer(), timeout); }
Source:
protected ToStringBuilder appendAttributes(ToStringBuilder tsb) { return super.appendAttributes(tsb) .append("operations", getOperations()) .append("size", getSize()) .append("url", getUrl()) .append("filename", getFilename()) .append("sparse", isSparse()); }

Target:
protected ToStringBuilder appendAttributes(ToStringBuilder tsb) { return super.appendAttributes(tsb) .append("operations", getOperations()) .append("size", getSize()) .append("url", getUrl()) .append("filename", getFilename()) .append("sparse", isSparse()) .append("transferId", getTransferId()); }
Source:
private Iterable<Volume> collectVolumes(MachineType input) { ImmutableSet.Builder<Volume> volumes = ImmutableSet.builder(); for (MachineType.ScratchDisk disk : input.getScratchDisks()) { volumes.add(new VolumeImpl(null, Volume.Type.LOCAL, new Integer(disk.getDiskGb()).floatValue(), null, true, false)); } return volumes.build(); }

Target:
private Iterable<Volume> collectVolumes(MachineType input) { ImmutableSet.Builder<Volume> volumes = ImmutableSet.builder(); for (MachineType.ScratchDisk disk : input.getScratchDisks()) { volumes.add(new VolumeBuilder() .type(Volume.Type.LOCAL) .size(new Integer(disk.getDiskGb()).floatValue()) .bootDevice(true) .durable(false).build()); } return volumes.build(); }