auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void placeFunctionAndOperands(FilterFunction function) { int functionIdx = 0; int[] channels = function.getInputChannels(); for (int channel : channels) { int idx = findChannelIdx(channel); if (idx >= firstNonFilter) { if (idx > firstNonFilter) { StreamReader temp = sortedStreamReaders[idx]; System.arraycopy(sortedStreamReaders, firstNonFilter, sortedStreamReaders, firstNonFilter + 1, idx - firstNonFilter); sortedStreamReaders[firstNonFilter] = temp; } idx = firstNonFilter++; } functionIdx = Math.max(functionIdx, idx); } installFilterFunction(functionIdx, function); }

Target:
private void placeFunctionAndOperands(FilterFunction function) { int functionIdx = 0; int[] channels = function.getInputChannels(); for (int channel : channels) { int idx = findChannelIdx(channel); if (idx > firstNonFilter) { StreamReader temp = sortedStreamReaders[idx]; System.arraycopy(sortedStreamReaders, firstNonFilter, sortedStreamReaders, firstNonFilter + 1, idx - firstNonFilter); sortedStreamReaders[firstNonFilter] = temp; } if (idx >= firstNonFilter) { idx = firstNonFilter++; } functionIdx = Math.max(functionIdx, idx); } installFilterFunction(functionIdx, function); }
Source:
private void forwardTopologyUpdateMessage(OnmsTopologyMessage message) { if (message.getMessagebody() instanceof OnmsTopologyVertex) { OnmsTopologyVertex vertex = (OnmsTopologyVertex) message.getMessagebody(); final OpennmsModelProtos.TopologyVertex mappedTopoMsg = protobufMapper.toVertexTopologyMessage(message.getProtocol().getId(),vertex).build(); forwardTopologyVertexMessage(mappedTopoMsg.getRef().toByteArray(), mappedTopoMsg.toByteArray()); } else if (message.getMessagebody() instanceof OnmsTopologyEdge) { OnmsTopologyEdge edge = (OnmsTopologyEdge) message.getMessagebody(); final OpennmsModelProtos.TopologyEdge mappedTopoMsg = protobufMapper.toEdgeTopologyMessage(message.getProtocol().getId(),edge).build(); forwardTopologyEdgeMessage(mappedTopoMsg.getRef().toByteArray(), mappedTopoMsg.toByteArray()); } else if (message.getMessagebody() instanceof OnmsTopologySegment) { OnmsTopologySegment edge = (OnmsTopologySegment) message.getMessagebody(); final OpennmsModelProtos.TopologySegment mappedTopoMsg = protobufMapper.toSegmentTopologyMessage(message.getProtocol().getId(),edge).build(); forwardTopologySegmentMessage(mappedTopoMsg.getRef().toByteArray(), mappedTopoMsg.toByteArray()); } else { LOG.error("forwardTopologyUpdateMessage: no supported update class {}", message.getMessagebody().getClass().getName()); } }

Target:
private void forwardTopologyUpdateMessage(OnmsTopologyMessage message) { if (message.getMessagebody() instanceof OnmsTopologyVertex) { OnmsTopologyVertex vertex = (OnmsTopologyVertex) message.getMessagebody(); final OpennmsModelProtos.TopologyVertex mappedTopoMsg = protobufMapper.toVertexTopologyMessage(message.getProtocol().getId(),vertex).build(); forwardTopologyVertexMessage(mappedTopoMsg.getRef().toByteArray(), mappedTopoMsg.toByteArray()); } else if (message.getMessagebody() instanceof OnmsTopologyEdge) { OnmsTopologyEdge edge = (OnmsTopologyEdge) message.getMessagebody(); final OpennmsModelProtos.TopologyEdge mappedTopoMsg = protobufMapper.toEdgeTopologyMessage(message.getProtocol().getId(),edge).build(); forwardTopologyEdgeMessage(mappedTopoMsg.getRef().toByteArray(), mappedTopoMsg.toByteArray()); } else { LOG.error("forwardTopologyUpdateMessage: no supported update class {}", message.getMessagebody().getClass().getName()); } }
Source:
protected void onHandleIntent(@Nullable final Intent intent) { if (Build.VERSION.SDK_INT < 7 || hasActiveNetwork()) { if (intent == null) { return; } final Serializable serializable = intent.getSerializableExtra(KEY_CHOICE); if (!(serializable instanceof Choice)) { return; } Choice playerChoice = (Choice) serializable; handleChoice(playerChoice); } else { NetworkStateReceiver networkStateReceiver = new NetworkStateReceiver(); ConnectivityManager connectivityManager = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE); networkStateReceiver.enable(getApplicationContext()); networkStateReceiver.setService(this); connectivityManager.registerDefaultNetworkCallback(networkStateReceiver); } }

Target:
protected void onHandleIntent(@Nullable final Intent intent) { if (Build.VERSION.SDK_INT < 24 || hasActiveNetwork()) { if (intent == null) { return; } final Serializable serializable = intent.getSerializableExtra(KEY_CHOICE); if (!(serializable instanceof Choice)) { return; } Choice playerChoice = (Choice) serializable; handleChoice(playerChoice); } else { NetworkStateReceiver networkStateReceiver = new NetworkStateReceiver(); ConnectivityManager connectivityManager = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE); networkStateReceiver.enable(getApplicationContext()); networkStateReceiver.setService(this); connectivityManager.registerDefaultNetworkCallback(networkStateReceiver); } }
Source:
private static void deeplyPrint(IStatus status, PrintStream strm, boolean stackTrace, int level) { appendLevelString(strm, level); String msg = status.getMessage(); strm.println(msg); Throwable cause = status.getException(); if (cause != null) { strm.print("Caused by: "); if (stackTrace || !(msg.equals(cause.getMessage()) || msg.equals(cause.toString()))) deeplyPrint(cause, strm, stackTrace, level); } if (status.isMultiStatus()) { IStatus[] children = status.getChildren(); for (IStatus children1 : children) { deeplyPrint(children1, strm, stackTrace, level + 1); } } }

Target:
private static void deeplyPrint(IStatus status, PrintStream strm, boolean stackTrace, int level) { appendLevelString(strm, level); String msg = status.getMessage(); strm.println(msg); Throwable cause = status.getException(); if (cause != null) { strm.print("Caused by: "); if (stackTrace || !(msg.equals(cause.getMessage()) || msg.equals(cause.toString()))) deeplyPrint(cause, strm, stackTrace, level); } if (status.isMultiStatus()) { IStatus[] children = status.getChildren(); for (IStatus child : children) { deeplyPrint(child, strm, stackTrace, level + 1); } } }
Source:
public static void copyToFileAndClose(InputStream is, File file, long timeout) throws IOException, TimeoutException { OutputStream os = null; try { file.getParentFile().mkdirs(); os = new BufferedOutputStream(new FileOutputStream(file)); copyWithTimeout(is, os, timeout); } finally { CloseQuietly.close(is); CloseQuietly.close(os); } }

Target:
public static void copyToFileAndClose(InputStream is, File file, long timeout) throws IOException, TimeoutException { file.getParentFile().mkdirs(); try (OutputStream os = new BufferedOutputStream(new FileOutputStream(file))) { copyWithTimeout(is, os, timeout); } finally { Closeables.closeQuietly(is); } }
Source:
public boolean isAction() { List<String> nonActionMethodNames = new ArrayList<>(Arrays.asList("add", "get", "list", "update", "remove")); if (nonActionMethodNames.contains(getName().toString().toLowerCase()) || (base!=null && nonActionMethodNames.contains(base.getName().toString().toLowerCase()))) { return false; } else { return true; } }

Target:
public boolean isAction() { return !(NON_ACTION_METHOD_NAMES.contains(getName()) || (base!=null && NON_ACTION_METHOD_NAMES.contains(base.getName()))); }
Source:
RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { final DepthCommit c = (DepthCommit)pending.next(); if (c == null) return null; if ((c.flags & RevWalk.PARSED) == 0) c.parseHeaders(walk); if (c.depth > depth) { c.flags |= UNINTERESTING; continue; } if (c.depth == depth) c.add(SHALLOW); int newDepth = c.depth + 1; for (final RevCommit p : c.parents) { DepthCommit dp = (DepthCommit)p; boolean add = false; if (dp.depth == -1) { dp.depth = newDepth; add = true; } if ((c.flags & UNINTERESTING) == 0 && ((p.flags & UNINTERESTING) != 0) && (BOUNDARY != null) && !p.has(BOUNDARY)) { if (BOUNDARY != null) p.add(BOUNDARY); add = true; } if (add) pending.add(p); } return c; } }

Target:
RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { final DepthCommit c = (DepthCommit)pending.next(); if (c == null) return null; if ((c.flags & RevWalk.PARSED) == 0) c.parseHeaders(walk); if (c.depth > depth) { c.flags |= UNINTERESTING; continue; } if (c.depth == depth) c.add(SHALLOW); int newDepth = c.depth + 1; for (final RevCommit p : c.parents) { DepthCommit dp = (DepthCommit)p; boolean add = false; if (dp.depth == -1) { dp.depth = newDepth; add = true; } if ((c.flags & UNINTERESTING) == 0 && ((p.flags & UNINTERESTING) != 0) && (BOUNDARY != null) && !p.has(BOUNDARY)) { p.add(BOUNDARY); add = true; } if (add) pending.add(p); } return c; } }
Source:
public URI getWebUri() { if (webUri == null) { try { webUri = new URI("http://localhost:8080"); } catch (URISyntaxException e) { throw new RuntimeException(e); } try { if (undertowSubsystem == null) { undertowSubsystem = readResource(PathAddress.pathAddress("subsystem",UNDERTOW)); } } catch (Exception e) { throw new RuntimeException(e); } if (undertowSubsystem.isDefined()) { List<Property> vhosts = undertowSubsystem.get("server").asPropertyList(); ModelNode socketBinding = new ModelNode(); if (!vhosts.isEmpty()) { socketBinding = vhosts.get(0).getValue().get("http-listener", "default").get("socket-binding"); } if (socketBinding.isDefined()) { webUri = getBinding("http", socketBinding.asString()); } } } return webUri; }

Target:
public URI getWebUri() { if (webUri == null) { try { webUri = new URI("http://localhost:8080"); } catch (URISyntaxException e) { throw new RuntimeException(e); } try { if (undertowSubsystem == null) { ModelNode address = new ModelNode(); address.add("subsystem", UNDERTOW); undertowSubsystem = readResource(address); } } catch (Exception e) { throw new RuntimeException(e); } if (undertowSubsystem.isDefined()) { List<Property> vhosts = undertowSubsystem.get("server").asPropertyList(); ModelNode socketBinding = new ModelNode(); if (!vhosts.isEmpty()) { socketBinding = vhosts.get(0).getValue().get("http-listener", "default").get("socket-binding"); } if (socketBinding.isDefined()) { webUri = getBinding("http", socketBinding.asString()); } } } return webUri; }
Source:
public void sort() { final int numTuples = table.numTuples(); indexes = new ArrayList<>(); indexes.ensureCapacity(numTuples); for (int i = 0; i < numTuples; i++) { indexes.add(i); } TupleComparator comparator = new TupleComparator(); Collections.sort(indexes, comparator); for (int rowIdx = 0; rowIdx < numTuples; rowIdx++) { for (int columnIdx = 0; columnIdx < getSchema().numColumns(); columnIdx++) { int sourceRow = indexes.get(rowIdx); int tupleIdx = table.getTupleIndexInContainingTB(sourceRow); ans.put(columnIdx, table.getColumn(columnIdx, sourceRow), tupleIdx); } } }

Target:
public void sort() { final int numTuples = table.numTuples(); indexes = new ArrayList<>(); indexes.ensureCapacity(numTuples); for (int i = 0; i < numTuples; i++) { indexes.add(i); } TupleComparator comparator = new TupleComparator(); Collections.sort(indexes, comparator); for (int rowIdx = 0; rowIdx < numTuples; rowIdx++) { ans.append(table, indexes.get(rowIdx)); } }
Source:
private void backupWallet(final String backupPassword) { try { final Protos.Wallet walletProto = new WalletProtobufSerializer().walletToProto(wallet); SecurityGuard securityGuard = new SecurityGuard(); if (wallet.isEncrypted()) { String walletPassword = securityGuard.retrievePassword(); backgroundThread = new HandlerThread("backgroundThread", Process.THREAD_PRIORITY_BACKGROUND); backgroundThread.start(); backgroundHandler = new Handler(backgroundThread.getLooper()); final Wallet decryptedWallet = new WalletProtobufSerializer().readWallet(Constants.NETWORK_PARAMETERS, null, walletProto); new DeriveKeyTask(backgroundHandler, application.scryptIterationsTarget()) { @Override protected void onSuccess(KeyParameter encryptionKey, boolean changed) { decryptedWallet.decrypt(encryptionKey); backupWallet(decryptedWallet, backupPassword); } @Override protected void onFailure(KeyCrypterException ex) { super.onFailure(ex); handleError(ex); } }.deriveKey(decryptedWallet, walletPassword); } else { backupWallet(wallet, backupPassword); } } catch (GeneralSecurityException | IOException | UnreadableWalletException x) { handleError(x); } }

Target:
private void backupWallet(final String backupPassword) { try { final Protos.Wallet walletProto = new WalletProtobufSerializer().walletToProto(wallet); SecurityGuard securityGuard = new SecurityGuard(); if (wallet.isEncrypted()) { String walletPassword = securityGuard.retrievePassword(); final Wallet decryptedWallet = new WalletProtobufSerializer().readWallet(Constants.NETWORK_PARAMETERS, null, walletProto); new DeriveKeyTask(backgroundHandler, application.scryptIterationsTarget()) { @Override protected void onSuccess(KeyParameter encryptionKey, boolean changed) { decryptedWallet.decrypt(encryptionKey); backupWallet(decryptedWallet, backupPassword); } @Override protected void onFailure(KeyCrypterException ex) { super.onFailure(ex); handleError(ex); } }.deriveKey(decryptedWallet, walletPassword); } else { backupWallet(wallet, backupPassword); } } catch (GeneralSecurityException | IOException | UnreadableWalletException x) { handleError(x); } }
Source:
private void deliverMessages() { try { log.trace("{} Delivering batch of messages to task", this, messageBatch.size()); long start = time.milliseconds(); task.put(new ArrayList<>(messageBatch)); if (workerErrantRecordReporter != null && workerErrantRecordReporter.mustThrowException()) { throw workerErrantRecordReporter.getExceptionToThrow(); } recordBatch(messageBatch.size()); sinkTaskMetricsGroup.recordPut(time.milliseconds() - start); currentOffsets.putAll(origOffsets); messageBatch.clear(); if (pausedForRedelivery) { if (!shouldPause()) resumeAll(); pausedForRedelivery = false; } } catch (RetriableException e) { log.error("{} RetriableException from SinkTask:", this, e); pausedForRedelivery = true; pauseAll(); } catch (Throwable t) { log.error("{} Task threw an uncaught and unrecoverable exception. Task is being killed and will not " + "recover until manually restarted. Error: {}", this, t.getMessage(), t); throw new ConnectException("Exiting WorkerSinkTask due to unrecoverable exception.", t); } }

Target:
private void deliverMessages() { try { log.trace("{} Delivering batch of messages to task", this, messageBatch.size()); long start = time.milliseconds(); task.put(new ArrayList<>(messageBatch)); if (retryWithToleranceOperator.failed() && !retryWithToleranceOperator.withinToleranceLimits()) { throw new ConnectException("Tolerance exceeded in error handler", retryWithToleranceOperator.error()); } recordBatch(messageBatch.size()); sinkTaskMetricsGroup.recordPut(time.milliseconds() - start); currentOffsets.putAll(origOffsets); messageBatch.clear(); if (pausedForRedelivery) { if (!shouldPause()) resumeAll(); pausedForRedelivery = false; } } catch (RetriableException e) { log.error("{} RetriableException from SinkTask:", this, e); pausedForRedelivery = true; pauseAll(); } catch (Throwable t) { log.error("{} Task threw an uncaught and unrecoverable exception. Task is being killed and will not " + "recover until manually restarted. Error: {}", this, t.getMessage(), t); throw new ConnectException("Exiting WorkerSinkTask due to unrecoverable exception.", t); } }
Source:
void insert(BranchInfo info) { if (!match.equals("") || match != null) { if (!info.getShortName().contains(match)) { return; } } if (table.getRowCount() <= pageSize || pageSize == 0) { Comparator<BranchInfo> c = new Comparator<BranchInfo>() { @Override public int compare(BranchInfo a, BranchInfo b) { return a.ref().compareTo(b.ref()); } }; int insertPos = getInsertRow(c, info); if (insertPos >= 0) { table.insertRow(insertPos); applyDataRowStyle(insertPos); populate(insertPos, info); } } else { setupNavigationLink(next, null, ProjectBranchesScreen.this.start + pageSize); } }

Target:
void insert(BranchInfo info) { if (match != null && !match.equals("") && !info.getShortName().contains(match)) { return; } if (table.getRowCount() <= pageSize || pageSize == 0) { Comparator<BranchInfo> c = new Comparator<BranchInfo>() { @Override public int compare(BranchInfo a, BranchInfo b) { return a.ref().compareTo(b.ref()); } }; int insertPos = getInsertRow(c, info); if (insertPos >= 0) { table.insertRow(insertPos); applyDataRowStyle(insertPos); populate(insertPos, info); } } else { setupNavigationLink(next, match, ProjectBranchesScreen.this.start + pageSize); } }
Source:
public CompletableFuture<?> start(IndexManagerStartContext context) { try { lifecycleStrategy = createLifecycleStrategy( context.getConfigurationPropertySource() ); serialOrchestrator.start(); parallelOrchestrator.start(); return lifecycleStrategy.onStart( administrationClient, context ); } catch (RuntimeException e) { new SuppressingCloser( e ) .push( ElasticsearchWorkOrchestratorImplementor::start, parallelOrchestrator ) .push( ElasticsearchWorkOrchestratorImplementor::start, serialOrchestrator ); throw e; } }

Target:
public CompletableFuture<?> start(IndexManagerStartContext context) { try { lifecycleStrategy = createLifecycleStrategy( context.getConfigurationPropertySource() ); serialOrchestrator.start(); parallelOrchestrator.start(); return lifecycleStrategy.onStart( administrationClient, context ); } catch (RuntimeException e) { new SuppressingCloser( e ) .push( ElasticsearchWorkOrchestratorImplementor::stop, parallelOrchestrator ) .push( ElasticsearchWorkOrchestratorImplementor::stop, serialOrchestrator ); throw e; } }
Source:
public void testResource() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(ImportControlCheck.class); checkConfig.addAttribute("file", "/com/puppycrawl/tools/checkstyle/checks/imports/import-control_one.xml"); final String[] expected = {"5:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; verify(checkConfig, getPath("InputImportControl.java"), expected); }

Target:
public void testResource() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(ImportControlCheck.class); checkConfig.addAttribute("file", getResourcePath("import-control_one.xml")); final String[] expected = {"5:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; verify(checkConfig, getPath("InputImportControl.java"), expected); }
Source:
public GsonJsonArray(com.google.gson.JsonArray jsonArray) { this.jsonArray = jsonArray; }

Target:
public GsonJsonArray(com.google.gson.JsonArray jsonArray) { this.jsonArray = Objects.requireNonNull(jsonArray, "'jsonArray' cannot be null."); }
Source:
int read() throws IOException; } public static @Nullable String readNextEventString(IReaderWrapper parser) throws IOException { StringBuffer sb = new StringBuffer(); int scope = -1; int arrScope = 0; boolean inQuotes = false; int elem = parser.read(); while (elem != -1 && elem < 128) { if (elem == '"') { inQuotes = !inQuotes; } else { if (inQuotes) { } else if (elem == '[') { arrScope++; } else if (elem == ']') { if (arrScope > 0) { arrScope--; } else { return null; } } else if (elem == '{') { scope++; } else if (elem == '}') { if (scope > 0) { scope--; } else if (scope == 0) { sb.append((char) elem); return sb.toString(); } } } if (scope >= 0) { sb.append((char) elem); } elem = parser.read(); } return null; }

Target:
int read() throws IOException; } public static @Nullable String readNextEventString(IReaderWrapper parser) throws IOException { StringBuffer sb = new StringBuffer(); int scope = -1; int arrScope = 0; boolean inQuotes = false; int elem = parser.read(); while (elem != -1) { if (elem == '"') { inQuotes = !inQuotes; } else { if (inQuotes) { } else if (elem == '[') { arrScope++; } else if (elem == ']') { if (arrScope > 0) { arrScope--; } else { return null; } } else if (elem == '{') { scope++; } else if (elem == '}') { if (scope > 0) { scope--; } else if (scope == 0) { sb.append((char) elem); return sb.toString(); } } } if (scope >= 0) { sb.append((char) elem); } elem = parser.read(); } return null; }
Source:
public void readFields(DataInput in) throws IOException { String className = WritableUtils.readString(in); Class clazz; if (className.isEmpty()) { clazz = Message.class; } else { try { clazz = Class.forName(className); } catch (ClassNotFoundException ex) { throw new IllegalArgumentException("Byte stream does not have a " + "valid class identifier", ex); } } this.setConverter(clazz); super.readFields(in); }

Target:
public void readFields(DataInput in) throws IOException { super.readFields(in); String className = WritableUtils.readString(in); if (!className.isEmpty()) { Class clazz; try { clazz = Class.forName(className); } catch (ClassNotFoundException ex) { throw new IllegalArgumentException("Byte stream does not have a " + "valid class identifier", ex); } this.setConverter(clazz); } }
Source:
public GeoEntry queryById(String id) throws GeoEntryQueryException { if (StringUtils.isBlank(id)) { throw new IllegalArgumentException(); } Filter textFilter = filterBuilder.attribute(Core.ID).is().text(id); Filter queryFilter = filterBuilder.allOf(tagFilter, textFilter); QueryResponse queryResponse; try { queryResponse = catalogFramework.query(new QueryRequestImpl(new QueryImpl(queryFilter))); } catch (UnsupportedQueryException | SourceUnavailableException | FederationException e) { throw new GeoEntryQueryException(ERROR_MESSAGE, e); } if (!queryResponse.getResults().isEmpty()) { Result result = queryResponse.getResults().get(0); return transformMetacardToGeoEntry(result.getMetacard()); } return null; }

Target:
public GeoEntry queryById(String id) throws GeoEntryQueryException { if (StringUtils.isBlank(id)) { throw new IllegalArgumentException("id cannot be blank or null"); } Filter idFilter = filterBuilder.attribute(Core.ID).is().text(id); Filter queryFilter = filterBuilder.allOf(tagFilter, idFilter); QueryResponse queryResponse; try { queryResponse = catalogFramework.query(new QueryRequestImpl(new QueryImpl(queryFilter))); } catch (UnsupportedQueryException | SourceUnavailableException | FederationException e) { throw new GeoEntryQueryException(ERROR_MESSAGE, e); } if (!queryResponse.getResults().isEmpty()) { Result result = queryResponse.getResults().get(0); return transformMetacardToGeoEntry(result.getMetacard()); } return null; }
Source:
static List<Image> provideWindowIcons() { if (SystemUtils.IS_OS_MAC) { return new ArrayList<>(); } ArrayList<Image> icons = new ArrayList<>(); icons.add(new Image(FxApplicationModule.class.getResourceAsStream("/window_icon_32.png"))); icons.add(new Image(FxApplicationModule.class.getResourceAsStream("/window_icon_512.png"))); return icons; }

Target:
static List<Image> provideWindowIcons() { if (SystemUtils.IS_OS_MAC) { return Collections.emptyList(); } try { return List.of(createImageFromResource("/window_icon_32.png"), createImageFromResource("/window_icon_512.png")); } catch (IOException e) { return Collections.emptyList(); } }
Source:
public static void input(@AggregationState AreaUnderRocCurveState state, @SqlType(StandardTypes.BOOLEAN) boolean label, @SqlType(StandardTypes.DOUBLE) double score) { MultiKeyValuePairs pairs = state.get(); if (pairs == null) { pairs = new MultiKeyValuePairs(BOOLEAN, DOUBLE); state.set(pairs); } BlockBuilder labelBlockBuilder = BOOLEAN.createBlockBuilder(new BlockBuilderStatus(), 1); BOOLEAN.writeBoolean(labelBlockBuilder, label); BlockBuilder scoreBlockBuilder = DOUBLE.createBlockBuilder(new BlockBuilderStatus(), 1); DOUBLE.writeDouble(scoreBlockBuilder, score); long startSize = pairs.estimatedInMemorySize(); pairs.add(labelBlockBuilder.build(), scoreBlockBuilder.build(), 0, 0); state.addMemoryUsage(pairs.estimatedInMemorySize() - startSize); }

Target:
public static void input(@AggregationState AreaUnderRocCurveState state, @SqlType(StandardTypes.BOOLEAN) boolean label, @SqlType(StandardTypes.DOUBLE) double score) { GroupedAreaUnderRocCurve auc = state.get(); BlockBuilder labelBlockBuilder = BOOLEAN.createBlockBuilder(new BlockBuilderStatus(), 1); BOOLEAN.writeBoolean(labelBlockBuilder, label); BlockBuilder scoreBlockBuilder = DOUBLE.createBlockBuilder(new BlockBuilderStatus(), 1); DOUBLE.writeDouble(scoreBlockBuilder, score); long startSize = auc.estimatedInMemorySize(); auc.add(labelBlockBuilder.build(), scoreBlockBuilder.build(), 0, 0); state.addMemoryUsage(auc.estimatedInMemorySize() - startSize); }
Source:
private boolean valueTypeMatchesParameterType(Object value, MBeanParameterInfo paramInfo) { Class<? extends Object> valueClass = value.getClass(); if (valueClass.getName().equals(paramInfo.getType())) { return true; } else { String primitiveTypeName = primitiveWrapperToPrimitiveTypeName.get(valueClass); return primitiveTypeName != null && primitiveTypeName.equals(paramInfo.getType()); } }

Target:
private boolean valueTypeMatchesParameterType(Object value, MBeanParameterInfo paramInfo) { Class<? extends Object> valueClass = value.getClass(); if (valueClass.getName().equals(paramInfo.getType())) { return true; } else { Class<?> primitiveType = ClassUtils.resolvePrimitiveType(valueClass); return primitiveType != null && primitiveType.getName().equals(paramInfo.getType()); } }
Source:
private TargetBundle[] readBundleInfosFromConfigIni(URI configArea) { File configIni = new File(configArea); configIni = new File(configIni, CONFIG_INI); if (!configIni.isFile()) { return null; } Properties configProps = new Properties(); try (FileInputStream fis = new FileInputStream(configIni)) { configProps.load(fis); } catch (IOException e) { PDECore.log(e); return null; } String osgiBundles = configProps.getProperty("osgi.bundles"); if (osgiBundles == null || osgiBundles.isEmpty()) { return null; } return Arrays.stream(osgiBundles.split(",")) .map(entry -> entry.split("@")[0]) .map(location -> location.startsWith("reference:") ? location.substring("reference:".length()) : location) .map(URI::create) .map(File::new) .map(file -> { try { return new TargetBundle(file); } catch (CoreException e) { return null; } }).filter(Objects::nonNull) .toArray(TargetBundle[]::new); }

Target:
private TargetBundle[] readBundleInfosFromConfigIni(URI configArea) { File configIni = new File(configArea); configIni = new File(configIni, CONFIG_INI); if (!configIni.isFile()) { return null; } Properties configProps = new Properties(); try (FileInputStream fis = new FileInputStream(configIni)) { configProps.load(fis); } catch (IOException e) { PDECore.log(e); return null; } String osgiBundles = configProps.getProperty("osgi.bundles"); if (osgiBundles == null || osgiBundles.isEmpty()) { return null; } String osgiFramework = configProps.getProperty("osgi.framework"); if (osgiFramework != null && !osgiFramework.isEmpty()) { osgiBundles = osgiFramework + ',' + osgiBundles; } return Arrays.stream(osgiBundles.split(",")) .map(entry -> entry.split("@")[0]) .map(location -> location.startsWith("reference:") ? location.substring("reference:".length()) : location) .map(URI::create) .map(File::new) .map(file -> { try { return new TargetBundle(file); } catch (CoreException e) { return new InvalidTargetBundle(new BundleInfo(file.toURI()), e.getStatus()); } }).filter(Objects::nonNull) .toArray(TargetBundle[]::new); }
Source:
public static Path zipDirectory(Path source, Path target, CopyOption... options) throws IOException { if (!source.toFile().isDirectory()) { throw new IllegalArgumentException("Source argument must be a directory to zip"); } URI uri = URI.create("jar:file:" + target.toString()); try (FileSystem zipfs = FileSystems.newFileSystem(uri, Collections.singletonMap("create", "true"))) { Files.walkFileTree(source, new SimpleFileVisitor<java.nio.file.Path>() { @Override public FileVisitResult preVisitDirectory(java.nio.file.Path dir, BasicFileAttributes attrs) throws IOException { if (source.equals(dir)) { return FileVisitResult.CONTINUE; } return visitFile(dir, attrs); } @Override public FileVisitResult visitFile(java.nio.file.Path file, BasicFileAttributes attrs) throws IOException { java.nio.file.Path relativePath = source.relativize(file); java.nio.file.Path pathInZipFile = zipfs.getPath(relativePath.toString()); Files.copy(file, pathInZipFile, options); return FileVisitResult.CONTINUE; } }); } return target; }

Target:
public static Path zipDirectory(Path source, Path target, CopyOption... options) throws IOException { if (!Files.isDirectory(source)) { throw new IllegalArgumentException("Source argument must be a directory to zip"); } URI uri = URI.create("jar:file:" + target.toString()); try (FileSystem zipfs = FileSystems.newFileSystem(uri, Collections.singletonMap("create", "true"))) { Files.walkFileTree(source, new SimpleFileVisitor<java.nio.file.Path>() { @Override public FileVisitResult preVisitDirectory(java.nio.file.Path dir, BasicFileAttributes attrs) throws IOException { if (source.equals(dir)) { return FileVisitResult.CONTINUE; } return visitFile(dir, attrs); } @Override public FileVisitResult visitFile(java.nio.file.Path file, BasicFileAttributes attrs) throws IOException { java.nio.file.Path relativePath = source.relativize(file); java.nio.file.Path pathInZipFile = zipfs.getPath(relativePath.toString()); Files.copy(file, pathInZipFile, options); return FileVisitResult.CONTINUE; } }); } return target; }
Source:
public static StreamsAddressResponse getStreamsAddressResponse(long tail, List<UuidToStreamAddressSpacePairMsg> map) { return new StreamsAddressResponse(tail, map.stream() .collect(Collectors.<UuidToStreamAddressSpacePairMsg, UUID, StreamAddressSpace>toMap( e -> getUUID(e.getStreamUuid()), e -> getStreamAddressSpace(e.getAddressSpace())) )); }

Target:
public static StreamsAddressResponse getStreamsAddressResponse(long tail, List<UuidToStreamAddressSpacePairMsg> map) { return new StreamsAddressResponse(tail, map.stream() .collect(Collectors.<UuidToStreamAddressSpacePairMsg, UUID, StreamAddressSpace>toMap( entry -> getUUID(entry.getStreamUuid()), entry -> getStreamAddressSpace(entry.getAddressSpace())) )); }
Source:
public void testDeleteCardNoFilter() throws Throwable { int cardIndex = 0; this.expectedCards = new ArrayList<BaseballCard>(this.allCards); this.expectedCards.remove(cardIndex); this.solo.clickOnCheckBox(cardIndex + 1); Assert.assertTrue(this.solo.waitForView(R.id.delete_menu)); View deleteMenu = this.activity.findViewById(R.id.delete_menu); Assert.assertNotNull(deleteMenu); TouchUtils.clickView(this, deleteMenu); BBCTTestUtil.waitForToast(this.solo, BBCTTestUtil.DELETE_MESSAGE); ListView lv = (ListView) this.solo.getCurrentActivity().findViewById(android.R.id.list); BBCTTestUtil.assertListViewContainsItems(this.expectedCards, lv); }

Target:
public void testDeleteCardNoFilter() throws Throwable { int cardIndex = 0; this.expectedCards = new ArrayList<BaseballCard>(this.allCards); this.expectedCards.remove(cardIndex); this.solo.clickOnCheckBox(cardIndex + 1); Assert.assertTrue(this.solo.waitForView(R.id.delete_menu)); deleteCards(); ListView lv = (ListView) this.solo.getCurrentActivity().findViewById(android.R.id.list); BBCTTestUtil.assertListViewContainsItems(this.expectedCards, lv); }
Source:
private void init(IConfiguration configuration, XmlSuite suite, String outputDir, ITestRunnerFactory runnerFactory, boolean useDefaultListeners, List<IMethodInterceptor> methodInterceptors, List<IInvokedMethodListener> invokedMethodListener, List<ITestListener> testListeners) { m_configuration = configuration; m_suite = suite; m_useDefaultListeners = useDefaultListeners; m_tmpRunnerFactory= runnerFactory; m_methodInterceptors = methodInterceptors; setOutputDir(outputDir); m_objectFactory = m_configuration.getObjectFactory(); if(m_objectFactory == null) { m_objectFactory = suite.getObjectFactory(); } m_invokedMethodListeners = invokedMethodListener; if (m_invokedMethodListeners == null) { m_invokedMethodListeners = Lists.newArrayList(); } m_invokedMethodListeners.add(this); m_skipFailedInvocationCounts = suite.skipFailedInvocationCounts(); if (null != testListeners) { m_testListeners.addAll(testListeners); } m_runnerFactory = buildRunnerFactory(); List<XmlTest> xmlTests = m_suite.getTests(); Collections.sort(xmlTests, new Comparator<XmlTest>() { @Override public int compare(XmlTest arg0, XmlTest arg1) { return arg0.getIndex() - arg1.getIndex(); } }); for (XmlTest test : xmlTests) { TestRunner tr = m_runnerFactory.newTestRunner(this, test, m_invokedMethodListeners); if (!m_methodInterceptors.isEmpty()) { for (IMethodInterceptor methodInterceptor : methodInterceptors) { tr.addMethodInterceptor(methodInterceptor); } } tr.addListener(m_textReporter); m_testRunners.add(tr); m_allTestMethods.addAll(Arrays.asList(tr.getAllTestMethods())); } }

Target:
private void init(IConfiguration configuration, XmlSuite suite, String outputDir, ITestRunnerFactory runnerFactory, boolean useDefaultListeners, List<IMethodInterceptor> methodInterceptors, List<IInvokedMethodListener> invokedMethodListener, List<ITestListener> testListeners) { m_configuration = configuration; m_suite = suite; m_useDefaultListeners = useDefaultListeners; m_tmpRunnerFactory= runnerFactory; m_methodInterceptors = methodInterceptors != null ? methodInterceptors : new ArrayList<IMethodInterceptor>(); setOutputDir(outputDir); m_objectFactory = m_configuration.getObjectFactory(); if(m_objectFactory == null) { m_objectFactory = suite.getObjectFactory(); } m_invokedMethodListeners = invokedMethodListener; if (m_invokedMethodListeners == null) { m_invokedMethodListeners = Lists.newArrayList(); } m_invokedMethodListeners.add(this); m_skipFailedInvocationCounts = suite.skipFailedInvocationCounts(); if (null != testListeners) { m_testListeners.addAll(testListeners); } m_runnerFactory = buildRunnerFactory(); List<XmlTest> xmlTests = m_suite.getTests(); Collections.sort(xmlTests, new Comparator<XmlTest>() { @Override public int compare(XmlTest arg0, XmlTest arg1) { return arg0.getIndex() - arg1.getIndex(); } }); for (XmlTest test : xmlTests) { TestRunner tr = m_runnerFactory.newTestRunner(this, test, m_invokedMethodListeners); for (IMethodInterceptor methodInterceptor : methodInterceptors) { tr.addMethodInterceptor(methodInterceptor); } tr.addListener(m_textReporter); m_testRunners.add(tr); m_allTestMethods.addAll(Arrays.asList(tr.getAllTestMethods())); } }
Source:
public LogicalPlan pruneOutputsExcept(Collection<Symbol> outputsToKeep) { HashSet<Symbol> toKeep = new HashSet<>(outputsToKeep); toKeep.removeAll(windowFunctions); List<Symbol> newStandalone = List.copyOf(toKeep); for (WindowFunction windowFunction : windowFunctions) { toKeep.addAll(windowFunction.arguments()); Symbol filter = windowFunction.filter(); if (filter != null) { toKeep.add(filter); } toKeep.addAll(windowFunction.windowDefinition().partitions()); OrderBy orderBy = windowFunction.windowDefinition().orderBy(); if (orderBy != null) { toKeep.addAll(orderBy.orderBySymbols()); } Symbol startOffsetValue = windowFunction.windowDefinition().windowFrameDefinition().start().value(); if (startOffsetValue != null) { toKeep.add(startOffsetValue); } Symbol endOffsetValue = windowFunction.windowDefinition().windowFrameDefinition().end().value(); if (endOffsetValue != null) { toKeep.add(endOffsetValue); } } LogicalPlan newSource = source.pruneOutputsExcept(toKeep); if (newSource == source) { return this; } return new WindowAgg( newSource, windowDefinition, windowFunctions, newStandalone ); }

Target:
public LogicalPlan pruneOutputsExcept(Collection<Symbol> outputsToKeep) { HashSet<Symbol> toKeep = new HashSet<>(); ArrayList<Symbol> newStandalone = new ArrayList<>(); ArrayList<WindowFunction> newWindowFunctions = new ArrayList<>(); for (Symbol outputToKeep : outputsToKeep) { SymbolVisitors.intersection(outputToKeep, windowFunctions, newWindowFunctions::add); SymbolVisitors.intersection(outputToKeep, standalone, newStandalone::add); } for (WindowFunction newWindowFunction : newWindowFunctions) { SymbolVisitors.intersection(newWindowFunction, source.outputs(), toKeep::add); } toKeep.addAll(newStandalone); LogicalPlan newSource = source.pruneOutputsExcept(toKeep); if (newSource == source) { return this; } return new WindowAgg(newSource, windowDefinition, List.copyOf(newWindowFunctions), List.copyOf(newStandalone)); }
Source:
public List<VariableReferenceExpression> getOrderBy() { return orderBy; }

Target:
public List<Ordering> getOrderBy() { return orderBy; }
Source:
public void updateFildsAfterOsChanged() { model.startProgress(null); deactivate(new ActivatedListener() { @Override public void activated() { model.stopProgress(); } }); VmBase vmBase = getSource(); maybeSetSingleQxlPci(vmBase); updateWatchdog(vmBase, false); updateBalloon(vmBase, false); maybeSetSelectedItem(model.getUsbPolicy(), vmBase.getUsbPolicy()); activate(); }

Target:
public void updateFildsAfterOsChanged() { deactivateAndStartProgress(); VmBase vmBase = getSource(); maybeSetSingleQxlPci(vmBase); updateWatchdog(vmBase, false); updateBalloon(vmBase, false); maybeSetSelectedItem(model.getUsbPolicy(), vmBase.getUsbPolicy()); activate(); }
Source:
public void testWriteSamWithEmptyArray(Object emptyArray, Class<?> arrayClass, String fileExtension) throws IOException { Assert.assertEquals(emptyArray.getClass(), arrayClass); Assert.assertEquals(Array.getLength(emptyArray), 0); final String arrayTag = "XA"; final SAMRecordSetBuilder samRecords = new SAMRecordSetBuilder(); samRecords.addFrag("Read",0,100, false); final SAMRecord record = samRecords.getRecords().iterator().next(); record.setAttribute(arrayTag, emptyArray); checkArrayIsEmpty(arrayTag, record, arrayClass); final Path tmp = Files.createTempFile("tmp", fileExtension); IOUtil.deleteOnExit(tmp); final SAMFileWriterFactory writerFactory = new SAMFileWriterFactory() .setCreateMd5File(false) .setCreateIndex(false); final Path reference = IOUtil.getPath("src/test/resources/htsjdk/samtools/one-contig.fasta"); try(final SAMFileWriter samFileWriter = writerFactory.makeWriter(samRecords.getHeader(), false, tmp, reference)) { samFileWriter.addAlignment(record); } try(final SamReader reader = SamReaderFactory.makeDefault() .referenceSequence(reference) .open(tmp)) { final SAMRecordIterator iterator = reader.iterator(); Assert.assertTrue(iterator.hasNext()); final SAMRecord recordFromDisk = iterator.next(); checkArrayIsEmpty(arrayTag, recordFromDisk, arrayClass); } }

Target:
public void testWriteSamWithEmptyArray(Object emptyArray, Class<?> arrayClass, String fileExtension) throws IOException { Assert.assertEquals(emptyArray.getClass(), arrayClass); Assert.assertEquals(Array.getLength(emptyArray), 0); final SAMRecordSetBuilder samRecords = new SAMRecordSetBuilder(); samRecords.addFrag("Read", 0, 100, false); final SAMRecord record = samRecords.getRecords().iterator().next(); record.setAttribute(ARRAY_TAG, emptyArray); checkArrayIsEmpty(ARRAY_TAG, record, arrayClass); final Path tmp = Files.createTempFile("tmp", fileExtension); IOUtil.deleteOnExit(tmp); final SAMFileWriterFactory writerFactory = new SAMFileWriterFactory() .setCreateMd5File(false) .setCreateIndex(false); final Path reference = IOUtil.getPath("src/test/resources/htsjdk/samtools/one-contig.fasta"); try (final SAMFileWriter samFileWriter = writerFactory.makeWriter(samRecords.getHeader(), false, tmp, reference)) { samFileWriter.addAlignment(record); } try (final SamReader reader = SamReaderFactory.makeDefault() .referenceSequence(reference) .open(tmp)) { final SAMRecordIterator iterator = reader.iterator(); Assert.assertTrue(iterator.hasNext()); final SAMRecord recordFromDisk = iterator.next(); checkArrayIsEmpty(ARRAY_TAG, recordFromDisk, arrayClass); } }
Source:
public static boolean isSpecialDevice(String device, VmDeviceGeneralType type) { switch(type) { case SOUND: return true; case CONSOLE: return VmDeviceType.CONSOLE.getName().equals(device); case SMARTCARD: return VmDeviceType.SMARTCARD.getName().equals(device); case REDIR: return VmDeviceType.SPICEVMC.getName().equals(device); case BALLOON: return VmDeviceType.MEMBALLOON.getName().equals(device); case WATCHDOG: return VmDeviceType.WATCHDOG.getName().equals(device); case RNG: return VmDeviceType.VIRTIO.getName().equals(device); case CONTROLLER: if (VmDeviceType.VIRTIOSERIAL.getName().equals(device)) { return true; } if (VmDeviceType.VIRTIOSCSI.getName().equals(device)) { return true; } return false; default: return VmDeviceType.USB.getName().equals(device); } }

Target:
public static boolean isSpecialDevice(String device, VmDeviceGeneralType type) { switch(type) { case SOUND: return true; case CONSOLE: return VmDeviceType.CONSOLE.getName().equals(device); case SMARTCARD: return VmDeviceType.SMARTCARD.getName().equals(device); case REDIR: return VmDeviceType.SPICEVMC.getName().equals(device); case BALLOON: return VmDeviceType.MEMBALLOON.getName().equals(device); case WATCHDOG: return VmDeviceType.WATCHDOG.getName().equals(device); case RNG: return VmDeviceType.VIRTIO.getName().equals(device); case CONTROLLER: return VmDeviceType.VIRTIOSERIAL.getName().equals(device) || VmDeviceType.VIRTIOSCSI.getName().equals(device); default: return VmDeviceType.USB.getName().equals(device); } }
Source:
public void WindowedWordCountTest() { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); WindowedWordCount app = new WindowedWordCount(); try { lma.prepareDAG(app, conf); } catch (Exception e) { e.printStackTrace(); } LocalMode.Controller lc = lma.getController(); lc.run(10000); }

Target:
public void WindowedWordCountTest() throws Exception { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); lma.prepareDAG(new WindowedWordCount(), conf); LocalMode.Controller lc = lma.getController(); ((StramLocalCluster)lc).setExitCondition(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return WindowedWordCount.TextInput.isDone(); } }); lc.run(60000); Assert.assertEquals(127, countSum(WindowedWordCount.Collector.getResult())); Assert.assertEquals(28, countSumWord(WindowedWordCount.Collector.getResult(), "word2")); Assert.assertEquals(7, countSumWord(WindowedWordCount.Collector.getResult(), "error")); Assert.assertEquals(21, countSumWord(WindowedWordCount.Collector.getResult(), "word9")); Assert.assertEquals(1, countSumWord(WindowedWordCount.Collector.getResult(), "bye")); }
Source:
public void findAll() throws Exception { getClient().perform(get("/api/config/submissionuploads")) .andExpect(status().isForbidden()); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(get("/api/config/submissionuploads")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$.page.size", is(20))) .andExpect(jsonPath("$.page.totalElements", greaterThanOrEqualTo(1))) .andExpect(jsonPath("$.page.totalPages", greaterThanOrEqualTo(1))) .andExpect(jsonPath("$.page.number", is(0))) .andExpect(jsonPath("$._links.self.href", Matchers.startsWith(REST_SERVER_URL + "config/submissionuploads"))) .andExpect(jsonPath("$._embedded.submissionuploads", hasSize(greaterThanOrEqualTo(1)))) ; }

Target:
public void findAll() throws Exception { getClient().perform(get("/api/config/submissionuploads")) .andExpect(status().isUnauthorized()); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(get("/api/config/submissionuploads")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$.page.size", is(20))) .andExpect(jsonPath("$.page.totalElements", greaterThanOrEqualTo(1))) .andExpect(jsonPath("$.page.totalPages", greaterThanOrEqualTo(1))) .andExpect(jsonPath("$.page.number", is(0))) .andExpect(jsonPath("$._links.self.href", Matchers.startsWith(REST_SERVER_URL + "config/submissionuploads"))) .andExpect(jsonPath("$._embedded.submissionuploads", hasSize(greaterThanOrEqualTo(1)))) ; }
Source:
private Converter newMessageConverter(final Message.Builder parentBuilder, final Descriptors.FieldDescriptor fieldDescriptor, Type parquetType) { boolean isRepeated = fieldDescriptor.isRepeated(); ParentValueContainer parent; if (isRepeated) { parent = new ParentValueContainer() { @Override public void add(Object value) { parentBuilder.addRepeatedField(fieldDescriptor, value); } }; } else { parent = new ParentValueContainer() { @Override public void add(Object value) { parentBuilder.setField(fieldDescriptor, value); } }; } OriginalType originalType = parquetType.getOriginalType() == null ? OriginalType.UTF8 : parquetType.getOriginalType(); switch (originalType) { case LIST: return new ListConverter(parentBuilder, fieldDescriptor, parquetType); case MAP: return new MapConverter(parentBuilder, fieldDescriptor, parquetType); default: return newScalarConverter(parent, parentBuilder, fieldDescriptor, parquetType); } }

Target:
private Converter newMessageConverter(final Message.Builder parentBuilder, final Descriptors.FieldDescriptor fieldDescriptor, Type parquetType) { boolean isRepeated = fieldDescriptor.isRepeated(); ParentValueContainer parent; if (isRepeated) { parent = new ParentValueContainer() { @Override public void add(Object value) { parentBuilder.addRepeatedField(fieldDescriptor, value); } }; } else { parent = new ParentValueContainer() { @Override public void add(Object value) { parentBuilder.setField(fieldDescriptor, value); } }; } if (OriginalType.LIST == parquetType.getOriginalType()) { return new ListConverter(parentBuilder, fieldDescriptor, parquetType); } if (OriginalType.MAP == parquetType.getOriginalType()) { return new MapConverter(parentBuilder, fieldDescriptor, parquetType); } return newScalarConverter(parent, parentBuilder, fieldDescriptor, parquetType); }
Source:
public final void put(final int destColumn, final Column<?> sourceColumn, final int sourceRow) { Type t = sourceColumn.getType(); switch (t) { case BOOLEAN_TYPE: memSize++; break; case DATETIME_TYPE: break; case DOUBLE_TYPE: case LONG_TYPE: memSize += 8; break; case FLOAT_TYPE: case INT_TYPE: memSize += 4; break; case STRING_TYPE: memSize += sourceColumn.getString(sourceRow).length(); break; } TupleUtils.copyValue(sourceColumn, sourceRow, this, destColumn); }

Target:
public final void put(final int destColumn, final Column<?> sourceColumn, final int sourceRow) { TupleUtils.copyValue(sourceColumn, sourceRow, this, destColumn); }
Source:
public boolean updateConsoleLog(File dest, InputStream in) throws IOException { File parentFile = dest.getParentFile(); parentFile.mkdirs(); LOGGER.trace("Updating console log [" + dest.getAbsolutePath() + "]"); try (OutputStream out = new BufferedOutputStream(new FileOutputStream(dest, dest.exists()))) { IOUtils.copy(in, out); } catch (IOException e) { LOGGER.error("Failed to update console log at : [" + dest.getAbsolutePath() + "]", e); return false; } LOGGER.trace("Console log [" + dest.getAbsolutePath() + "] saved."); return true; }

Target:
public boolean updateConsoleLog(File dest, InputStream in) throws IOException { File parentFile = dest.getParentFile(); parentFile.mkdirs(); LOGGER.trace("Updating console log [{}]", dest.getAbsolutePath()); try (OutputStream out = new BufferedOutputStream(new FileOutputStream(dest, dest.exists()))) { IOUtils.copy(in, out); } catch (IOException e) { LOGGER.error("Failed to update console log at : [{}]", dest.getAbsolutePath(), e); return false; } LOGGER.trace("Console log saved.", dest.getAbsolutePath()); return true; }
Source:
public Collection<String> getHeaders(final String header) { final String prefix = String.format( "%s", new Lowered(header) ); try { return new Filtered<>( hdr -> { final Lowered low = new Lowered(hdr); return low.asString().startsWith(prefix); }, this.response.get().head() ); } catch (final IOException ex) { throw new IllegalStateException(ex); } }

Target:
public Collection<String> getHeaders(final String header) { final String prefix = String.format( "%s", new Lowered(header) ); try { return new Filtered<>( hdr -> new Lowered(hdr).asString().startsWith(prefix), this.response.get().head() ); } catch (final IOException ex) { throw new IllegalStateException(ex); } }