auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void create() throws ResourceAllocationException { NicSecondaryIp result; boolean isIpv4 = true; if (ipAddr != null) { if (!NetUtils.isValidIp4(ipAddr)) { isIpv4 = false; } if (!NetUtils.isValidIp6(ipAddr) && !isIpv4) { throw new InvalidParameterValueException("Invalid ip address " + ipAddr); } } IpAddresses requestedIpPair = new IpAddresses(ipAddr, null); if (!isIpv4) { requestedIpPair = new IpAddresses(null, ipAddr); } try { result = _networkService.allocateSecondaryGuestIP(getNicId(), requestedIpPair); if (result != null) { setEntityId(result.getId()); setEntityUuid(result.getUuid()); } } catch (InsufficientAddressCapacityException e) { throw new InvalidParameterValueException("Allocating guest ip for nic failed : " + e.getMessage()); } if (result == null) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to assign secondary ip to nic"); } }

Target:
public void create() throws ResourceAllocationException { NicSecondaryIp result; IpAddresses requestedIpPair = new IpAddresses(ipAddr, null); if (!NetUtils.isIpv4(ipAddr)) { requestedIpPair = new IpAddresses(null, ipAddr); } try { result = _networkService.allocateSecondaryGuestIP(getNicId(), requestedIpPair); if (result != null) { setEntityId(result.getId()); setEntityUuid(result.getUuid()); } } catch (InsufficientAddressCapacityException e) { throw new InvalidParameterValueException("Allocating guest ip for nic failed : " + e.getMessage()); } if (result == null) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to assign secondary ip to nic"); } }
Source:
public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof GroupChatInvitation)) { return false; } GroupChatInvitation other = (GroupChatInvitation) obj; return Objects.equals(getRoomAddressJid(), other.getRoomAddressJid()) && Objects.equals(getPassword(), other.getPassword()) && Objects.equals(getReason(), other.getReason()) && isContinue() == other.isContinue() && Objects.equals(getThread(), other.getThread()); }

Target:
public boolean equals(Object obj) { return EqualsUtil.equals(this, obj, (equalsBuilder, other) -> equalsBuilder .append(getRoomAddressJid(), other.getRoomAddressJid()) .append(getPassword(), other.getPassword()) .append(getReason(), other.getReason()) .append(isContinue(), other.isContinue()) .append(getThread(), other.getThread())); }
Source:
public void invalidateCacheOnUpdate() throws Exception { EventTypeCache etc = new EventTypeCache(dbRepo, client); EventType et = buildEventType(); Mockito .doReturn(et) .when(dbRepo) .findByName(et.getName()); etc.created(et); etc.get(et.getName()); etc.updated(et.getName()); executeWithRetry(() -> { try { etc.get(et.getName()); verify(dbRepo, times(2)).findByName(et.getName()); } catch (NoSuchEventTypeException e) { fail(); } catch (ExecutionException e) { fail(); } catch (Exception e) { fail(); } }, new RetryForSpecifiedTimeStrategy<Void>(5000).withExceptionsThatForceRetry(AssertionError.class) .withWaitBetweenEachTry(500)); }

Target:
public void invalidateCacheOnUpdate() throws Exception { final EventTypeCache etc = new EventTypeCache(dbRepo, client); final EventType et = buildEventType(); Mockito .doReturn(et) .when(dbRepo) .findByName(et.getName()); etc.created(et.getName()); etc.get(et.getName()); etc.updated(et.getName()); executeWithRetry(() -> { try { etc.get(et.getName()); verify(dbRepo, times(2)).findByName(et.getName()); } catch (Exception e) { fail(); } }, new RetryForSpecifiedTimeStrategy<Void>(5000).withExceptionsThatForceRetry(AssertionError.class) .withWaitBetweenEachTry(500)); }
Source:
public final String getAttribute(String attr) { Supplier<String> attribute = internalGetAttribute(attr); return attribute != null ? attribute.get() : ""; }

Target:
public final String getAttribute(String attr) { Supplier<String> attribute = internalGetAttribute(attr); if (attribute != null) { String attributeValue = attribute.get(); Assert.isNotNull(attributeValue); return attributeValue; } return ""; }
Source:
private UserClient(final String url) { MongoClient mongoClient = null; try { mongoClient = new MongoClient(url); } catch (UnknownHostException e) { LOG.info("Exception: {}", e); } if (mongoClient == null) { return; } database = mongoClient.getDB(DATABASE); }

Target:
private UserClient(final String url) { MongoClient mongoClient = null; try { mongoClient = new MongoClient(url); } catch (UnknownHostException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); } if (mongoClient == null) { return; } database = mongoClient.getDB(DATABASE); }
Source:
public void setUp() { httpClient = createMock(HttpClient.class); taskInfoProvider = createMock(TaskInfoProvider.class); responseHolder = createMock(FullResponseHolder.class); response = createMock(HttpResponse.class); headers = createMock(HttpHeaders.class); client = new TestableKafkaIndexTaskClient(httpClient, objectMapper, taskInfoProvider); expect(taskInfoProvider.getTaskLocation(TEST_ID)) .andReturn(new TaskLocation(TEST_HOST, TEST_PORT, TEST_TLS_PORT)) .anyTimes(); expect(taskInfoProvider.getTaskStatus(TEST_ID)) .andReturn(Optional.of(TaskStatus.running(TEST_ID))) .anyTimes(); for (String testId : TEST_IDS) { expect(taskInfoProvider.getTaskLocation(testId)) .andReturn(new TaskLocation(TEST_HOST, TEST_PORT, TEST_TLS_PORT)) .anyTimes(); expect(taskInfoProvider.getTaskStatus(testId)) .andReturn(Optional.of(TaskStatus.running(testId))) .anyTimes(); } }

Target:
public void setUp() { httpClient = createMock(HttpClient.class); taskInfoProvider = createMock(TaskInfoProvider.class); responseHolder = createMock(FullResponseHolder.class); response = createMock(HttpResponse.class); headers = createMock(HttpHeaders.class); client = new TestableKinesisIndexTaskClient(httpClient, objectMapper, taskInfoProvider); expect(taskInfoProvider.getTaskLocation(TEST_ID)) .andReturn(new TaskLocation(TEST_HOST, TEST_PORT, TEST_TLS_PORT)) .anyTimes(); expect(taskInfoProvider.getTaskStatus(TEST_ID)) .andReturn(Optional.of(TaskStatus.running(TEST_ID))) .anyTimes(); for (String testId : TEST_IDS) { expect(taskInfoProvider.getTaskLocation(testId)) .andReturn(new TaskLocation(TEST_HOST, TEST_PORT, TEST_TLS_PORT)) .anyTimes(); expect(taskInfoProvider.getTaskStatus(testId)) .andReturn(Optional.of(TaskStatus.running(testId))) .anyTimes(); } }
Source:
protected void validate() { getFileSystemProperties(); if (!CombinePathTrackingInputFormat.class.getName().equals(inputFormatClass) && pathField != null) { throw new IllegalArgumentException("pathField can only be used if inputFormatClass is " + CombinePathTrackingInputFormat.class.getName()); } if (!format.matches("[a-zA-Z]+") && !(format.equalsIgnoreCase("text") || (format.equalsIgnoreCase("avro")) || format.equalsIgnoreCase("parquet"))) { throw new IllegalArgumentException("format can only be 'text', 'avro' or 'parquet'"); } }

Target:
protected void validate() { getFileSystemProperties(); if (!CombinePathTrackingInputFormat.class.getName().equals(inputFormatClass) && pathField != null) { throw new IllegalArgumentException("pathField can only be used if inputFormatClass is " + CombinePathTrackingInputFormat.class.getName()); } if (format == null || !(format.equalsIgnoreCase("text") || (format.equalsIgnoreCase("avro")) || format.equalsIgnoreCase("parquet"))) { throw new IllegalArgumentException("Format can only be 'text', 'avro' or 'parquet'"); } if (!format.equalsIgnoreCase("text")) { try { new Schema.Parser().parse(inputSchema); } catch (Exception e){ throw new IllegalArgumentException("Unable to parse schema with error: " + e.getMessage(), e); } } }
Source:
public Map<String, Locale> getLocales() { return Locale.getLocaleMap("en-US", "fr-FR", "es-ES", "de-DE", "nl-NL", "ru-RU", "hi-IN", "it-IT", "fi-FI", "pt-PT"); }

Target:
public Map<String, Locale> getLocales() { Map<String, Locale> ret = new TreeMap<>(); for (BotInfo botInfo : bots.values()) { ret.put(botInfo.locale.getTag(), botInfo.locale); } return ret; }
Source:
public Control createContents(Composite parent) { ScrolledPageContent scrolled = new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL); scrolled.setExpandHorizontal(true); scrolled.setExpandVertical(true); Composite control = new Composite(scrolled, SWT.NONE); GridLayout layout = new GridLayout(); control.setLayout(layout); Composite composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_class_member_order); fillClassMemberOrderSection(composite); composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_function_parameter_order); fillFunctionParameterOrderSection(composite); composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_function_output_parameter_style); fillFunctionOutputParameterStyleSection(composite); composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_const_keyword_placement); fillConstPlacementsSections(composite); composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_function_overrdden_methods); fillOverriddenSection(composite); scrolled.setContent(control); final Point size = control.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrolled.setMinSize(size.x, size.y); return scrolled; }

Target:
public Control createContents(Composite parent) { ScrolledPageContent scrolled = new ScrolledPageContent(parent, SWT.H_SCROLL | SWT.V_SCROLL); scrolled.setExpandHorizontal(true); scrolled.setExpandVertical(true); Composite control = new Composite(scrolled, SWT.NONE); GridLayout layout = new GridLayout(); control.setLayout(layout); Composite composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_class_member_order); fillClassMemberOrderSection(composite); composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_function_parameter_order); fillFunctionParameterOrderSection(composite); composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_function_output_parameter_style); fillFunctionOutputParameterStyleSection(composite); composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_const_keyword_placement); fillConstPlacementsSections(composite); composite = addSubsection(control, PreferencesMessages.CodeStyleBlock_function_overridden_methods); fillOverriddenSection(composite); scrolled.setContent(control); final Point size = control.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrolled.setMinSize(size.x, size.y); return scrolled; }
Source:
public void testAddRegexRoleMapperAggregate() throws Exception { init("TestDomain10"); ServiceName serviceName = Capabilities.SECURITY_DOMAIN_RUNTIME_CAPABILITY.getCapabilityServiceName("TestDomain10"); Assert.assertNotNull(services.getContainer()); Assert.assertNotNull(services.getContainer().getService(serviceName)); SecurityDomain domain = (SecurityDomain) services.getContainer().getService(serviceName).getValue(); Assert.assertNotNull(domain); ServerAuthenticationContext context = domain.createNewAuthenticationContext(); context.setAuthenticationName("user5"); Assert.assertTrue(context.exists()); Assert.assertTrue(context.authorize()); context.succeed(); SecurityIdentity identity = context.getAuthorizedIdentity(); Assert.assertEquals("user5", identity.getPrincipal().getName()); Roles roles = identity.getRoles(); Assert.assertTrue(roles.contains("admin")); Assert.assertTrue(roles.contains("admin")); Assert.assertTrue(roles.contains("guest")); Assert.assertFalse(roles.contains("1-user")); Assert.assertFalse(roles.contains("user")); context = domain.createNewAuthenticationContext(); context.setAuthenticationName("user6"); Assert.assertTrue(context.exists()); Assert.assertTrue(context.authorize()); context.succeed(); identity = context.getAuthorizedIdentity(); Assert.assertEquals("user6", identity.getPrincipal().getName()); roles = identity.getRoles(); Assert.assertFalse(roles.contains("admin")); Assert.assertFalse(roles.contains("random")); }

Target:
public void testAddRegexRoleMapperAggregate() throws Exception { init("TestDomain10"); ServiceName serviceName = Capabilities.SECURITY_DOMAIN_RUNTIME_CAPABILITY.getCapabilityServiceName("TestDomain10"); Assert.assertNotNull(services.getContainer()); Assert.assertNotNull(services.getContainer().getService(serviceName)); SecurityDomain domain = (SecurityDomain) services.getContainer().getService(serviceName).getValue(); Assert.assertNotNull(domain); ServerAuthenticationContext context = domain.createNewAuthenticationContext(); context.setAuthenticationName("user5"); Assert.assertTrue(context.exists()); Assert.assertTrue(context.authorize()); context.succeed(); SecurityIdentity identity = context.getAuthorizedIdentity(); Assert.assertEquals("user5", identity.getPrincipal().getName()); Roles roles = identity.getRoles(); Assert.assertTrue(roles.contains("admin")); Assert.assertTrue(roles.contains("guest")); Assert.assertFalse(roles.contains("1-user")); Assert.assertFalse(roles.contains("user")); context = domain.createNewAuthenticationContext(); context.setAuthenticationName("user6"); Assert.assertTrue(context.exists()); Assert.assertTrue(context.authorize()); context.succeed(); identity = context.getAuthorizedIdentity(); Assert.assertEquals("user6", identity.getPrincipal().getName()); roles = identity.getRoles(); Assert.assertFalse(roles.contains("admin")); Assert.assertFalse(roles.contains("random")); }
Source:
public void throwOnRecordValidationFailure() { final File refFile = new File("src/test/resources/htsjdk/samtools/cram/ce.fa"); final File cramFileWithInvalidRecs = new File("src/test/resources/htsjdk/samtools/cram/ce#containsInvalidRecords.3.0.cram"); final ReferenceSource source = new ReferenceSource(refFile); final SAMRecordIterator cramIteratorOverInvalidRecords = getCramFileIterator(cramFileWithInvalidRecs, source, ValidationStringency.STRICT); try{ while (cramIteratorOverInvalidRecords.hasNext()) { cramIteratorOverInvalidRecords.next(); } } finally { cramIteratorOverInvalidRecords.close(); } }

Target:
public void throwOnRecordValidationFailure() { try (SAMRecordIterator cramIteratorOverInvalidRecords = getCramFileIterator(ValidationStringency.STRICT)) { while (cramIteratorOverInvalidRecords.hasNext()) { cramIteratorOverInvalidRecords.next(); } } }
Source:
public List<AuditLog> getAuditLogs() { return ImmutableList.<AuditLog>copyOf(accountAuditLogs); }

Target:
public List<AuditLog> getAuditLogs() { return accountAuditLogs; }
Source:
public static long extractOffset(String filename) { Matcher m = HdfsSinkConnectorConstants.COMMITTED_FILENAME_PATTERN.matcher(filename); if (!m.matches()) { throw new IllegalArgumentException(filename + " does not match COMMITTED_FILENAME_PATTERN"); } return Long.parseLong(m.group(4)); }

Target:
public static long extractOffset(String filename) { Matcher m = HdfsSinkConnectorConstants.COMMITTED_FILENAME_PATTERN.matcher(filename); if (!m.matches()) { throw new IllegalArgumentException(filename + " does not match COMMITTED_FILENAME_PATTERN"); } return Long.parseLong(m.group(HdfsSinkConnectorConstants.PATTERN_END_OFFSET_GROUP)); }
Source:
public RawPacket reverseTransform(RawPacket pkt) { Integer mediaSSRC = pkt.getSSRC(); ReplayContext replayContext = replayContexts.get(mediaSSRC); if (replayContext == null) { replayContext = new ReplayContext(); replayContexts.put(mediaSSRC, replayContext); } return replayContext.isSeen(pkt) ? null : pkt; }

Target:
public RawPacket reverseTransform(RawPacket pkt) { Long mediaSSRC = pkt.getSSRCAsLong(); Set<Integer> replayContext = replayContexts.get(mediaSSRC); if (replayContext == null) { replayContext = Collections.newSetFromMap( new LRUCache<Integer, Boolean>(SEEN_SET_SZ)); replayContexts.put(mediaSSRC, replayContext); } return replayContext.add(pkt.getSequenceNumber()) ? pkt : null; }
Source:
private void stopWatchSafe(IProject project, IOpenShiftConnection connection, String... kinds) { for (String kind : KINDS) { AtomicReference<IWatcher> watcherRef = watches.remove(new WatchKey(connection, project, kind)); if((watcherRef != null) && (watcherRef.get() != null)) { watcherRef.get().stop(); } } }

Target:
private void stopWatchSafe(IProject project, IOpenShiftConnection connection, String... kinds) { for (String kind : kinds) { AtomicReference<IWatcher> watcherRef = watches.remove(new WatchKey(connection, project, kind)); if((watcherRef != null) && (watcherRef.get() != null)) { watcherRef.get().stop(); } } }
Source:
public void startGanache() throws Exception { String OS = System.getProperty("os.name").toLowerCase(); ProcessBuilder processBuilder = new ProcessBuilder(); final String blockGasLimit = "471238800"; final String blockGasPrice = "1"; final String initialBalanceWei = "100000000000000000000"; final String command = String.format("ganache-cli -l %s -v -g %s --keepAliveTimeout 15000 --account=\"%s,%s\"", blockGasLimit, blockGasPrice, this.privateKey, initialBalanceWei); if (OS.contains("win")) { processBuilder.command("cmd.exe", "/c", command); } else { processBuilder.command("bash", "-c", command); } this.process = processBuilder.start(); Thread.sleep(20000); }

Target:
public void startGanache() throws Exception { String OS = System.getProperty("os.name").toLowerCase(); ProcessBuilder processBuilder = new ProcessBuilder(); final String blockGasLimit = "471238800"; final String blockGasPrice = "1"; final String initialBalanceWei = "100000000000000000000"; final String command = String.format("ganache-cli -l %s -v -g %s --keepAliveTimeout 15000 --account=\"%s,%s\"", blockGasLimit, blockGasPrice, this.privateKey, initialBalanceWei); if (OS.contains("win")) { processBuilder.command("cmd.exe", "/c", command); } else { processBuilder.command("bash", "-c", command); } this.process = processBuilder.start(); Thread.sleep(SLEEP_TIME_MILLIS); }
Source:
public void init(Map<String, Object> conf) { LOG.info("Initialing... Config: " + conf.toString()); LOG.info("Class path: " + System.getProperty("java.class.path")); checkpointRootPath = (String) conf.get(ROOT_PATH_KEY); Configuration hadoopConfig = new Configuration(); try { fileSystem = FileSystem.get(hadoopConfig); LOG.info("URI: " + fileSystem.getUri() + " ; Home Dir: " + fileSystem.getHomeDirectory()); } catch (IOException e) { throw new RuntimeException("Failed to get hadoop file system", e); } }

Target:
public void init(Map<String, Object> conf) throws StatefulStorageException { LOG.info("Initializing... Config: " + conf.toString()); LOG.info("Class path: " + System.getProperty("java.class.path")); checkpointRootPath = (String) conf.get(ROOT_PATH_KEY); Configuration hadoopConfig = new Configuration(); try { fileSystem = FileSystem.get(hadoopConfig); LOG.info("Hadoop FileSystem URI: " + fileSystem.getUri() + " ; Home Dir: " + fileSystem.getHomeDirectory()); } catch (IOException e) { throw new StatefulStorageException("Failed to get hadoop file system", e); } }
Source:
public boolean removeHeader(Chain header) { long suffixHead = chain + CHAIN_HEADER_SIZE; long prefixTail; Iterator<Element> iterator = header.iterator(); do { if (!compare(iterator.next(), suffixHead)) { return true; } prefixTail = suffixHead; suffixHead = storage.readLong(suffixHead + ELEMENT_HEADER_NEXT_OFFSET); } while (iterator.hasNext()); if (suffixHead == chain) { int slot = owner.getSlotForHashAndEncoding(readKeyHash(chain), chain, ~0); if (!owner.evict(slot, true)) { throw new AssertionError(); } return true; } else { int hash = readKeyHash(chain); int elemSize = storage.readInt(suffixHead + ELEMENT_HEADER_LENGTH_OFFSET); ByteBuffer elemBuffer = storage.readBuffer(suffixHead + ELEMENT_HEADER_SIZE, elemSize); Long newChainAddress = createAttachedChain(readKeyBuffer(chain), hash, elemBuffer); if (newChainAddress == null) { return false; } else { AttachedInternalChain newChain = new AttachedInternalChain(newChainAddress); try { long next = storage.readLong(suffixHead + ELEMENT_HEADER_NEXT_OFFSET); long tail = storage.readLong(chain + CHAIN_HEADER_TAIL_OFFSET); if (next != chain) { newChain.append(next, tail); } if (owner.updateEncoding(hash, chain, newChainAddress, ~0)) { storage.writeLong(prefixTail + ELEMENT_HEADER_NEXT_OFFSET, chain); free(); return true; } else { newChain.free(); throw new AssertionError("Encoding update failure - impossible!"); } } finally { newChain.close(); } } } }

Target:
public boolean removeHeader(Chain header) { long suffixHead = chain + CHAIN_HEADER_SIZE; long prefixTail; Iterator<Element> iterator = header.iterator(); do { if (!compare(iterator.next(), suffixHead)) { return true; } prefixTail = suffixHead; suffixHead = storage.readLong(suffixHead + ELEMENT_HEADER_NEXT_OFFSET); } while (iterator.hasNext()); if (suffixHead == chain) { int slot = owner.getSlotForHashAndEncoding(readKeyHash(chain), chain, ~0); if (!owner.evict(slot, true)) { throw new AssertionError("Unexpected failure to evict slot " + slot); } return true; } else { int hash = readKeyHash(chain); int elemSize = storage.readInt(suffixHead + ELEMENT_HEADER_LENGTH_OFFSET); ByteBuffer elemBuffer = storage.readBuffer(suffixHead + ELEMENT_HEADER_SIZE, elemSize); Long newChainAddress = createAttachedChain(readKeyBuffer(chain), hash, elemBuffer); if (newChainAddress == null) { return false; } else { AttachedInternalChain newChain = new AttachedInternalChain(newChainAddress); try { long next = storage.readLong(suffixHead + ELEMENT_HEADER_NEXT_OFFSET); long tail = storage.readLong(chain + CHAIN_HEADER_TAIL_OFFSET); if (next != chain) { newChain.append(next, tail); } if (owner.updateEncoding(hash, chain, newChainAddress, ~0)) { storage.writeLong(prefixTail + ELEMENT_HEADER_NEXT_OFFSET, chain); free(); return true; } else { newChain.free(); throw new AssertionError("Encoding update failure - impossible!"); } } finally { newChain.close(); } } } }
Source:
public synchronized void stop(final String reason) { new Thread( "Shutdown Thread" ) { @Override public void run() { independentThreadStop( reason, true ); } }.start(); }

Target:
public void stop(final String reason) { new Thread( "Shutdown Thread" ) { @Override public void run() { independentThreadStop( reason, true ); } }.start(); }
Source:
public URI getOutputChannel() throws InfrastructureException { try { final URI apiURI = URI.create(apiEndpoint); return UriBuilder.fromUri(apiURI) .scheme("https".equals(apiURI.getScheme()) ? "wss" : "ws") .replacePath(apiURI.getPath().replace("/api", "")) .path(OUTPUT_WEBSOCKET_ENDPOINT_BASE) .build(); } catch (UriBuilderException | IllegalArgumentException ex) { throw new InternalInfrastructureException("Failed to get the output channel because: " + ex.getLocalizedMessage()); } }

Target:
public URI getOutputChannel() throws InfrastructureException { try { return UriBuilder.fromUri(websocketEndpointBase) .path(OUTPUT_WEBSOCKET_ENDPOINT_BASE) .build(); } catch (UriBuilderException | IllegalArgumentException ex) { throw new InternalInfrastructureException("Failed to get the output channel. " + ex.getMessage()); } }
Source:
public void testEOL() throws Exception { RawText rt = new RawText(Constants.encodeASCII("foo\n")); assertEquals("\n", rt.getEOL()); assertFalse(rt.isMissingNewlineAtEnd()); rt = new RawText(Constants.encodeASCII("foo\r\n")); assertEquals("\r\n", rt.getEOL()); assertFalse(rt.isMissingNewlineAtEnd()); rt = new RawText(Constants.encodeASCII("foo\nbar")); assertEquals("\n", rt.getEOL()); assertTrue(rt.isMissingNewlineAtEnd()); rt = new RawText(Constants.encodeASCII("foo\r\nbar")); assertEquals("\r\n", rt.getEOL()); assertTrue(rt.isMissingNewlineAtEnd()); rt = new RawText(Constants.encodeASCII("foo\nbar\r\n")); assertEquals("\n", rt.getEOL()); assertFalse(rt.isMissingNewlineAtEnd()); rt = new RawText(Constants.encodeASCII("foo\r\nbar\n")); assertEquals("\r\n", rt.getEOL()); assertFalse(rt.isMissingNewlineAtEnd()); rt = new RawText(Constants.encodeASCII("foo")); assertNull(rt.getEOL()); assertTrue(rt.isMissingNewlineAtEnd()); }

Target:
public void testEOL() throws Exception { RawText rt = new RawText(Constants.encodeASCII("foo\n")); assertEquals("\n", rt.getEOL()); assertFalse(rt.isMissingNewlineAtEnd()); rt = new RawText(Constants.encodeASCII("foo\r\n")); assertEquals("\r\n", rt.getEOL()); assertFalse(rt.isMissingNewlineAtEnd()); rt = new RawText(Constants.encodeASCII("foo\nbar")); assertEquals("\n", rt.getEOL()); assertTrue(rt.isMissingNewlineAtEnd()); rt = new RawText(Constants.encodeASCII("foo\r\nbar")); assertEquals("\r\n", rt.getEOL()); assertTrue(rt.isMissingNewlineAtEnd()); rt = new RawText(Constants.encodeASCII("foo\nbar\r\n")); assertEquals("\n", rt.getEOL()); assertFalse(rt.isMissingNewlineAtEnd()); rt = new RawText(Constants.encodeASCII("foo\r\nbar\n")); assertEquals("\r\n", rt.getEOL()); assertFalse(rt.isMissingNewlineAtEnd()); rt = new RawText(Constants.encodeASCII("foo")); assertNull(rt.getEOL()); assertTrue(rt.isMissingNewlineAtEnd()); rt = new RawText(Constants.encodeASCII("")); assertNull(rt.getEOL()); assertTrue(rt.isMissingNewlineAtEnd()); rt = new RawText(Constants.encodeASCII("\n")); assertEquals("\n", rt.getEOL()); assertFalse(rt.isMissingNewlineAtEnd()); rt = new RawText(Constants.encodeASCII("\r\n")); assertEquals("\r\n", rt.getEOL()); assertFalse(rt.isMissingNewlineAtEnd()); }
Source:
private List<GerritQueryResult> executeQueryRest(String query, String option) throws GerritException { List<GerritQueryResult> results = null; results = client.executeQueryRest(new NullProgressMonitor(), query, option); return results; }

Target:
private List<GerritQueryResult> executeQueryRest(String query, String option) throws GerritException { return client.executeQueryRest(new NullProgressMonitor(), query, option); }
Source:
private static String executeCommand(List<String> command, OutputStream os, String message, Map<String, String> env) throws IOException, InterruptedException { ProcessBuilder pb = new ProcessBuilder(command); if (env != null) { for (String variable : env.keySet()) { pb.environment().put(variable, env.get(variable)); } } StringBuilder sb = new StringBuilder(); String result = ""; Process process = pb.start(); try { int errCode = process.waitFor(); sb.append("errCode: " + errCode + " \n"); result = output(process.getInputStream()); sb.append("inputStream: "); sb.append(result); sb.append("\n"); result = output(process.getErrorStream()); sb.append("errorStream: "); sb.append(result); sb.append("\n"); } catch (InterruptedException ie) { ie.printStackTrace(System.err); throw ie; } finally { process.destroy(); } return sb.toString(); }

Target:
private static String executeCommand(List<String> command, OutputStream os, String message, Map<String, String> env) throws IOException, InterruptedException { ProcessBuilder pb = new ProcessBuilder(command); pb.directory(new File ("/store")); if (env != null) { for (String variable : env.keySet()) { pb.environment().put(variable, env.get(variable)); } } StringBuilder sb = new StringBuilder(); sb.append(mydebug()); String result = ""; Process process = pb.start(); try { int errCode = process.waitFor(); sb.append("errCode: " + errCode + " \n"); result = output(process.getInputStream()); sb.append("inputStream: "); sb.append(result); sb.append("\n"); result = output(process.getErrorStream()); sb.append("errorStream: "); sb.append(result); sb.append("\n"); } catch (InterruptedException ie) { ie.printStackTrace(System.err); throw ie; } finally { process.destroy(); } return sb.toString(); }
Source:
public void start() { this.executorService = newSingleThreadExecutor(new AxonThreadFactory("TrackingEventProcessor - " + name)); if (state == State.NOT_STARTED || state == State.SHUT_DOWN) { state = State.STARTED; registerInterceptor((unitOfWork, interceptorChain) -> { unitOfWork.onPrepareCommit(uow -> { EventMessage<?> event = uow.getMessage(); if (event instanceof TrackedEventMessage<?> && lastToken != null && lastToken.equals(((TrackedEventMessage) event).trackingToken())) { tokenStore.storeToken(lastToken, getName(), 0); } }); return interceptorChain.proceed(); }); executorService.submit(() -> { try { this.processingLoop(); } catch (Throwable e) { logger.error("Processing loop ended due to uncaught exception. Processor stopping.", e); } }); } }

Target:
public void start() { if (state == State.NOT_STARTED || state == State.SHUT_DOWN) { if (this.executorService == null || this.executorService.isShutdown()) { this.executorService = newSingleThreadExecutor(new AxonThreadFactory("TrackingEventProcessor - " + name)); } state = State.STARTED; registerInterceptor((unitOfWork, interceptorChain) -> { unitOfWork.onPrepareCommit(uow -> { EventMessage<?> event = uow.getMessage(); if (event instanceof TrackedEventMessage<?> && lastToken != null && lastToken.equals(((TrackedEventMessage) event).trackingToken())) { tokenStore.storeToken(lastToken, getName(), 0); } }); return interceptorChain.proceed(); }); executorService.submit(() -> { try { this.processingLoop(); } catch (Throwable e) { logger.error("Processing loop ended due to uncaught exception. Processor stopping.", e); } }); } }
Source:
public void testDeviceMapping() { final Device device = new Device(); device.setDeviceIdentification("nr1"); device.setDeviceType("typeA"); device.setCommunicationMethod("skype"); device.setCommunicationProvider("internet"); device.setICCId("iccId1"); device.setDSMRVersion("dsmrVersion1"); device.setSupplier("supplier1"); device.setHLS3Active(true); device.setHLS4Active(true); device.setHLS5Active(true); device.setMasterKey("masterKey"); device.setGlobalEncryptionUnicastKey("uniCastKey"); device.setAuthenticationKey("authenticationKey"); device.setDeliveryDate(this.deliveryDate); final SmartMeteringDevice smartMeteringDevice = this.mapperFactory.getMapperFacade().map(device, SmartMeteringDevice.class); assertNotNull(smartMeteringDevice); assertEquals(device.getDeviceIdentification(), smartMeteringDevice.getDeviceIdentification()); assertEquals(device.getDeviceType(), smartMeteringDevice.getDeviceType()); assertEquals(device.getCommunicationMethod(), smartMeteringDevice.getCommunicationMethod()); assertEquals(device.getCommunicationProvider(), smartMeteringDevice.getCommunicationProvider()); assertEquals(device.getICCId(), smartMeteringDevice.getICCId()); assertEquals(device.getDSMRVersion(), smartMeteringDevice.getDSMRVersion()); assertEquals(device.getSupplier(), smartMeteringDevice.getSupplier()); assertEquals(device.isHLS3Active(), smartMeteringDevice.isHLS3Active()); assertEquals(device.isHLS4Active(), smartMeteringDevice.isHLS4Active()); assertEquals(device.isHLS5Active(), smartMeteringDevice.isHLS5Active()); assertEquals(device.getMasterKey(), smartMeteringDevice.getMasterKey()); assertEquals(device.getGlobalEncryptionUnicastKey(), smartMeteringDevice.getGlobalEncryptionUnicastKey()); assertEquals(device.getAuthenticationKey(), smartMeteringDevice.getAuthenticationKey()); final DateTime dateTime = new DateTime(smartMeteringDevice.getDeliveryDate().getTime()); assertEquals(device.getDeliveryDate().getYear(), dateTime.getYear()); assertEquals(device.getDeliveryDate().getMonth(), dateTime.getMonthOfYear()); assertEquals(device.getDeliveryDate().getDay(), dateTime.getDayOfMonth()); }

Target:
public void testDeviceMapping() { final Device device = this.createDevice(); final SmartMeteringDevice smartMeteringDevice = this.installationMapper.map(device, SmartMeteringDevice.class); this.checkDeviceToSmartMeteringDeviceMapping(smartMeteringDevice); }
Source:
catch (Exception e) { throw Throwables.propagate(e); }

Target:
catch (Exception e) { throw new UOE(e, "Exception thrown while trying to find unmap method on MappedByteBuffer, this method must exist in your VM in order for this to work"); }
Source:
private boolean saveDatabase(Path file, boolean selectedOnly, Charset encoding, SavePreferences.DatabaseSaveType saveType) throws SaveException { SavePreferences preferences = prefs.loadForSaveFromPreferences() .withEncoding(encoding) .withSaveType(saveType); try (AtomicFileWriter fileWriter = new AtomicFileWriter(file, preferences.getEncoding(), preferences.makeBackup())) { BibtexDatabaseWriter databaseWriter = new BibtexDatabaseWriter(fileWriter, preferences, entryTypesManager); if (selectedOnly) { databaseWriter.savePartOfDatabase(panel.getBibDatabaseContext(), panel.getSelectedEntries()); panel.getSelectedEntries().forEach(bibEntry -> { bibEntry.setChanged(false); }); } else { databaseWriter.saveDatabase(panel.getBibDatabaseContext()); panel.getBibDatabaseContext().getEntries().forEach(bibEntry -> { bibEntry.setChanged(false); }); } panel.registerUndoableChanges(databaseWriter.getSaveActionsFieldChanges()); if (fileWriter.hasEncodingProblems()) { saveWithDifferentEncoding(file, selectedOnly, preferences.getEncoding(), fileWriter.getEncodingProblems(), saveType); } } catch (UnsupportedCharsetException ex) { throw new SaveException(Localization.lang("Character encoding '%0' is not supported.", encoding.displayName()), ex); } catch (IOException ex) { throw new SaveException("Problems saving:", ex); } return true; }

Target:
private boolean saveDatabase(Path file, boolean selectedOnly, Charset encoding, SavePreferences.DatabaseSaveType saveType) throws SaveException { SavePreferences preferences = prefs.loadForSaveFromPreferences() .withEncoding(encoding) .withSaveType(saveType); try (AtomicFileWriter fileWriter = new AtomicFileWriter(file, preferences.getEncoding(), preferences.makeBackup())) { BibtexDatabaseWriter databaseWriter = new BibtexDatabaseWriter(fileWriter, preferences, entryTypesManager); if (selectedOnly) { databaseWriter.savePartOfDatabase(panel.getBibDatabaseContext(), panel.getSelectedEntries()); } else { databaseWriter.saveDatabase(panel.getBibDatabaseContext()); } panel.registerUndoableChanges(databaseWriter.getSaveActionsFieldChanges()); if (fileWriter.hasEncodingProblems()) { saveWithDifferentEncoding(file, selectedOnly, preferences.getEncoding(), fileWriter.getEncodingProblems(), saveType); } } catch (UnsupportedCharsetException ex) { throw new SaveException(Localization.lang("Character encoding '%0' is not supported.", encoding.displayName()), ex); } catch (IOException ex) { throw new SaveException("Problems saving:", ex); } return true; }
Source:
public void prepareRun(BatchSinkContext context) throws Exception { Job job = context.getHadoopJob(); job.setOutputKeyClass(WritableComparable.class); job.setOutputValueClass(DefaultHCatRecord.class); Configuration configuration = job.getConfiguration(); configuration.set("hive.metastore.uris", config.metaStoreURI); HCatOutputFormat.setOutput(configuration, job.getCredentials(), OutputJobInfo.create(Objects.firstNonNull( config.dbName, DEFAULT_HIVE_DATABASE), config.tableName, getPartitions())); HCatSchema hiveSchema = HCatOutputFormat.getTableSchema(configuration); if (config.schema != null) { hiveSchema = HiveSchemaConverter.toHiveSchema(Schema.parseJson(config.schema), hiveSchema); } HCatOutputFormat.setSchema(configuration, hiveSchema); HiveSchemaStore.storeHiveSchema(context, Objects.firstNonNull(config.dbName, DEFAULT_HIVE_DATABASE), config.tableName, hiveSchema); context.addOutput(config.tableName, new SinkOutputFormatProvider()); }

Target:
public void prepareRun(BatchSinkContext context) throws Exception { Job job = context.getHadoopJob(); job.setOutputKeyClass(WritableComparable.class); job.setOutputValueClass(DefaultHCatRecord.class); Configuration configuration = job.getConfiguration(); configuration.set("hive.metastore.uris", config.metaStoreURI); HCatOutputFormat.setOutput(configuration, job.getCredentials(), OutputJobInfo.create(config.dbName, config.tableName, getPartitions())); HCatSchema hiveSchema = HCatOutputFormat.getTableSchema(configuration); if (config.schema != null) { hiveSchema = HiveSchemaConverter.toHiveSchema(Schema.parseJson(config.schema), hiveSchema); } HCatOutputFormat.setSchema(configuration, hiveSchema); HiveSchemaStore.storeHiveSchema(context, config.dbName, config.tableName, hiveSchema); context.addOutput(config.tableName, new SinkOutputFormatProvider()); }
Source:
public void accumulate(InternalFactHandle handle, A a, B b) { Runnable undo = acc.accumulate(a, b); Runnable previousUndo = this.undoMap.put(handle.getId(), undo); if (previousUndo != null) { throw new IllegalStateException("Undo for fact handle (" + handle.getId() + ") already exists."); } }

Target:
public void accumulate(InternalFactHandle handle, A a, B b) { Runnable undo = acc.accumulate(a, b); Runnable oldUndo = this.undoMap.put(handle.getId(), undo); if (oldUndo != null) { throw new IllegalStateException("Undo for fact handle (" + handle.getId() + ") already exists."); } }
Source:
public String toString() { List<String> sortedList = getSortedList(); StringBuilder result = new StringBuilder(); for (String name : sortedList) { if (result.length() > 0) { result.append(','); } result.append(name); } if (result.length() == 0) { return null; } return result.toString(); }

Target:
public String toString() { return String.join(",", nameSet); }
Source:
public void testServices() { ViewerSorter comparator = ProjectViewerComparator.createProjectTreeSorter(); IService service1 = Mockito.mock(IService.class); when(service1.getName()).thenReturn("s1"); when(service1.toString()).thenReturn("z"); ObservableTreeItem i1 = new ObservableTreeItem(service1); IService service2 = Mockito.mock(IService.class); when(service2.getName()).thenReturn("s2"); when(service2.toString()).thenReturn("a"); ObservableTreeItem i2 = new ObservableTreeItem(service2); assertTrue(comparator.compare(null, i1, i2) < 0); }

Target:
public void testServices() { ViewerComparator comparator = ProjectViewerComparator.createProjectTreeSorter(); ObservableTreeItem i1 = new ObservableTreeItem(mockService("s1", "z")); ObservableTreeItem i2 = new ObservableTreeItem(mockService("s2", "a")); assertTrue(comparator.compare(null, i1, i2) < 0); assertTrue(comparator.compare(null, i2, i1) > 0); assertEquals(0, comparator.compare(null, i1, i1)); }
Source:
public DnsServerAddressStream nameServerAddressStream(String hostname) { long last = lastRefresh.get(); Map<String, DnsServerAddresses> resolverMap = currentMappings; if (System.nanoTime() - last > REFRESH_INTERVAL) { if (lastRefresh.compareAndSet(last, System.nanoTime())) { resolverMap = currentMappings = retrieveCurrentMappings(); } } final String originalHostname = hostname; for (;;) { int i = hostname.indexOf('.', 1); if (i < 0 || i == hostname.length() - 1) { DnsServerAddresses addresses = resolverMap.get(StringUtil.EMPTY_STRING); if (addresses != null) { return addresses.stream(); } return UNIX_PROVIDER.nameServerAddressStream(originalHostname); } DnsServerAddresses addresses = resolverMap.get(hostname); if (addresses != null) { return addresses.stream(); } hostname = hostname.substring(i + 1); } }

Target:
public DnsServerAddressStream nameServerAddressStream(String hostname) { long last = lastRefresh.get(); Map<String, DnsServerAddresses> resolverMap = currentMappings; if (System.nanoTime() - last > REFRESH_INTERVAL) { if (lastRefresh.compareAndSet(last, System.nanoTime())) { resolverMap = currentMappings = retrieveCurrentMappings(); } } final String originalHostname = hostname; for (;;) { int i = hostname.indexOf('.', 1); if (i < 0 || i == hostname.length() - 1) { DnsServerAddresses addresses = resolverMap.get(StringUtil.EMPTY_STRING); if (addresses != null) { return addresses.stream(); } return DnsServerAddressStreamProviders.unixDefault().nameServerAddressStream(originalHostname); } DnsServerAddresses addresses = resolverMap.get(hostname); if (addresses != null) { return addresses.stream(); } hostname = hostname.substring(i + 1); } }
Source:
public void testConstructExternalResourceDriversFromConfig() throws Exception { final Configuration config = new Configuration(); final String resourceName = "test"; final String driverClassName = "org.apache.flink.runtime.externalresource.TestingExternalResourceDriverFactory"; final PluginManager mockPluginManager = Mockito.mock(PluginManager.class); Mockito.when(mockPluginManager.load(ExternalResourceDriverFactory.class)).thenReturn(IteratorUtils.singletonIterator(new TestingExternalResourceDriverFactory())); config.setString(ExternalResourceOptions.EXTERNAL_RESOURCE_LIST, resourceName); config.setString(ExternalResourceConstants.EXTERNAL_RESOURCE_PREFIX + resourceName + ExternalResourceConstants.EXTERNAL_RESOURCE_DRIVER_FACTORY_SUFFIX, driverClassName); final Map<String, ExternalResourceDriver> externalResourceDrivers = ExternalResourceUtils.externalResourceDriversFromConfig(config, mockPluginManager); assertThat(externalResourceDrivers.size(), is(1)); assertTrue(externalResourceDrivers.get(resourceName) instanceof TestingExternalResourceDriver); }

Target:
public void testConstructExternalResourceDriversFromConfig() { final Configuration config = new Configuration(); final String driverFactoryClassName = TestingExternalResourceDriverFactory.class.getName(); final Map<Class<?>, Iterator<?>> plugins = new HashMap<>(); plugins.put(ExternalResourceDriverFactory.class, IteratorUtils.singletonIterator(new TestingExternalResourceDriverFactory())); final PluginManager testingPluginManager = new TestingPluginManager(plugins); config.set(ExternalResourceOptions.EXTERNAL_RESOURCE_LIST, Collections.singletonList(RESOURCE_NAME_1)); config.setString(ExternalResourceOptions.getExternalResourceDriverFactoryConfigOptionForResource(RESOURCE_NAME_1), driverFactoryClassName); final Map<String, ExternalResourceDriver> externalResourceDrivers = ExternalResourceUtils.externalResourceDriversFromConfig(config, testingPluginManager); assertThat(externalResourceDrivers.size(), is(1)); assertThat(externalResourceDrivers.get(RESOURCE_NAME_1), instanceOf(TestingExternalResourceDriver.class)); }
Source:
public void postInit(FMLPostInitializationEvent event) { proxy.cape(); CrossModLoader.postinit(); crossBC = new CrossBuildcraft(); crossIC2 = new CrossIndustrialCraft2(); crossRailcraft = new CrossRailcraft(); crossRF = new CrossRF(); crossClassic = new CrossIndustrialCraft2Classic(); if (crossClassic.doesIC2ClassicExist()) { if (recipes.equalsIgnoreCase("normal-force")) { logger.info("Loading normal recipes with IC2 Classic may prevent certain recipes working") RecipesNew.addRecipes(); } else if (recipes.equalsIgnoreCase("gregtech-force")) { logger.info("Loading Gregtech recipes with IC2 Classic will prevent certain recipes working") GregtechRecipes.addRecipes(); } else { RecipesOld.addOldRecipes(); } } else if (recipes.equalsIgnoreCase("normal")) { RecipesNew.addRecipes(); } else if (recipes.equalsIgnoreCase("old")) { RecipesOld.addOldRecipes(); } else if (recipes.equalsIgnoreCase("gregtech") || recipes.equalsIgnoreCase("gregtech5")) { GregtechRecipes.addRecipes(); logger.info("Hard... I mean, FUN recipes turned on! Have fun!"); } }

Target:
public void postInit(FMLPostInitializationEvent event) { proxy.cape(); CrossModLoader.postinit(); crossBC = new CrossBuildcraft(); crossIC2 = new CrossIndustrialCraft2(); crossRailcraft = new CrossRailcraft(); crossRF = new CrossRF(); crossClassic = new CrossIndustrialCraft2Classic(); if (crossClassic.doesIC2ClassicExist()) { if (recipes.equalsIgnoreCase("normal-force")) { logger.info("Loading normal recipes with IC2 Classic may prevent certain recipes working"); RecipesNew.addRecipes(); } else if (recipes.equalsIgnoreCase("gregtech-force")) { logger.info("Loading Gregtech recipes with IC2 Classic will prevent certain recipes working"); GregtechRecipes.addRecipes(); } else { RecipesOld.addOldRecipes(); } } else if (recipes.equalsIgnoreCase("normal")) { RecipesNew.addRecipes(); } else if (recipes.equalsIgnoreCase("old")) { RecipesOld.addOldRecipes(); } else if (recipes.equalsIgnoreCase("gregtech") || recipes.equalsIgnoreCase("gregtech5")) { GregtechRecipes.addRecipes(); logger.info("Hard... I mean, FUN recipes turned on! Have fun!"); } }
Source:
public Collection<Summary> read() throws IOException { SummarizerFactory factory = new SummarizerFactory(); ConfigurationCopy acuconf = new ConfigurationCopy(DefaultConfiguration.getInstance()); Configuration conf = in.getFileSystem().getConf(); config.forEach((k, v) -> acuconf.set(k, v)); RFileSource[] sources = in.getSources(); try { SummaryCollection all = new SummaryCollection(); for (RFileSource source : sources) { SummaryReader fileSummary = SummaryReader.load(conf, acuconf, source.getInputStream(), source.getLength(), summarySelector, factory, CryptoServiceFactory.newInstance(acuconf)); SummaryCollection sc = fileSummary .getSummaries(Collections.singletonList(new Gatherer.RowRange(startRow, endRow))); all.merge(sc, factory); } return all.getSummaries(); } finally { for (RFileSource source : sources) { source.getInputStream().close(); } } }

Target:
public Collection<Summary> read() throws IOException { SummarizerFactory factory = new SummarizerFactory(); ConfigurationCopy acuconf = new ConfigurationCopy(DefaultConfiguration.getInstance()); config.forEach((k, v) -> acuconf.set(k, v)); RFileSource[] sources = in.getSources(); try { SummaryCollection all = new SummaryCollection(); for (RFileSource source : sources) { SummaryReader fileSummary = SummaryReader.load(in.getFileSystem().getConf(), acuconf, source.getInputStream(), source.getLength(), summarySelector, factory, CryptoServiceFactory.newInstance(acuconf)); SummaryCollection sc = fileSummary .getSummaries(Collections.singletonList(new Gatherer.RowRange(startRow, endRow))); all.merge(sc, factory); } return all.getSummaries(); } finally { for (RFileSource source : sources) { source.getInputStream().close(); } } }
Source:
public void printTasks() { if (!console.isVerbose()) { return; } int i = 0; for (Task task : tasks) { StringBuilder message = new StringBuilder() .append("Task ").append(i++).append(": ").append(task); for (Task blocker : task.tasksThatMustFinishFirst) { message.append("\n depends on completed task: ").append(blocker); } for (Task blocker : task.tasksThatMustFinishSuccessfullyFirst) { message.append("\n depends on successful task: ").append(blocker); } console.verbose(message.toString()); } dotTasks(); }

Target:
public void printTasks() { if (!console.isVerbose()) { return; } int i = 0; for (Task task : tasks) { StringBuilder message = new StringBuilder() .append("Task ").append(i++).append(": ").append(task); for (Task blocker : task.tasksThatMustFinishFirst) { message.append("\n depends on completed task: ").append(blocker); } for (Task blocker : task.tasksThatMustFinishSuccessfullyFirst) { message.append("\n depends on successful task: ").append(blocker); } console.verbose(message.toString()); } printTasksDependencies(); }
Source:
public void addQueues(Queue... queues) { Assert.notNull(queues, "'queues' cannot be null"); Assert.noNullElements(queues, "'queues' cannot contain null elements"); if (isRunning()) { for (Queue queue : queues) { Assert.isTrue(StringUtils.hasText(queue.getName()), "Cannot add broker-named queues dynamically"); } } this.queues.addAll(Arrays.asList(queues)); }

Target:
public void addQueues(Queue... queues) { Assert.notNull(queues, "'queues' cannot be null"); Assert.noNullElements(queues, "'queues' cannot contain null elements"); if (isRunning()) { for (Queue queue : queues) { Assert.hasText(queue.getName(), "Cannot add broker-named queues dynamically"); } } this.queues.addAll(Arrays.asList(queues)); }
Source:
private AggregationNode.Aggregation countWithFilter(Expression condition) { return new AggregationNode.Aggregation( functionManager.lookupFunction("count", ImmutableList.of()), ImmutableList.of(), Optional.of(condition), Optional.empty(), false, Optional.<Symbol>empty()); }

Target:
private AggregationNode.Aggregation countWithFilter(Expression condition) { return new AggregationNode.Aggregation( new CallExpression( "count", functionResolution.countFunction(), BIGINT, ImmutableList.of()), Optional.of(castToRowExpression(condition)), Optional.empty(), false, Optional.empty()); }