auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void cache(Class<? extends Resource> clazz, Map<String, ?> data, CanonicalUri uri) { Assert.notEmpty(data, "Resource data cannot be null or empty."); String href = hrefResolver.resolveHref(data, clazz, baseUrlResolver.getBaseUrl()); if (isDirectlyCacheable(clazz, data)) { Assert.notNull(href, "Resource data must contain an 'href' attribute."); Assert.isTrue(data.size() > 1, "Resource data must be materialized to be cached " + <START> "(need more than just an 'href' attribute)."); END> } Map<String, Object> cacheValue = cacheMapInitializer.initialize(clazz, data, uri.getQuery()); for (Map.Entry<String, ?> entry : data.entrySet()) { String name = entry.getKey(); Object value = entry.getValue(); cacheValue.put(name, value); } if (isDirectlyCacheable(clazz, cacheValue)) { Cache cache = getCache(clazz); String cacheKey = getCacheKey(href); Object previousCacheValue = cache.put(cacheKey, cacheValue); logger.debug("Caching object for key '{}', class: '{}', updated {}", cacheKey, clazz, previousCacheValue != null); } }</code><technical_language>Explain todo</technical_language>

Target:
private void cache(Class<? extends Resource> clazz, Map<String, ?> data, CanonicalUri uri) { Assert.notEmpty(data, "Resource data cannot be null or empty."); String href = hrefResolver.resolveHref(data, clazz); if (isDirectlyCacheable(clazz, data)) { Assert.notNull(href, "Resource data must contain an 'href' attribute."); Assert.isTrue(data.size() > 0, "Resource data must be materialized to be cached " + "(need more at least one attribute)."); } Map<String, Object> cacheValue = cacheMapInitializer.initialize(clazz, data, uri.getQuery()); data.entrySet().forEach(entry -> cacheValue.put(entry.getKey(), entry.getValue()) ); if (isDirectlyCacheable(clazz, cacheValue)) { Cache cache = getCache(clazz); String cacheKey = getCacheKey(href); Object previousCacheValue = cache.put(cacheKey, cacheValue); logger.debug("Caching object for key '{}', class: '{}', updated {}", cacheKey, clazz, previousCacheValue != null); } }
Source:
<code>private StringBuilder getEiscpMessage(String eiscpCmd) { <START> logger.debug("Requested Command is " + eiscpCmd); <END> StringBuilder sb = new StringBuilder(); sb.append("!"); sb.append("1"); sb.append(eiscpCmd); sb.append((char) 0x0D); logger.debug("Serial command is " + sb); return sb; }</code><technical_language>parameterized logging instead of string concatenation, this method generating garbage objects call</technical_language>

Target:
private StringBuilder getEiscpMessage(String eiscpCmd) { logger.debug("Requested Command is '{}' ", eiscpCmd); StringBuilder sb = new StringBuilder(); sb.append("!"); sb.append("1"); sb.append(eiscpCmd); sb.append((char) 0x0D); logger.debug("Serial command is '{}'", sb); return sb; }
Source:
<code>public boolean isEnabled() { final Repository repository = getRepository(); <START> return repository != null && containsHead(repository); <END> }</code><technical_language>prefer remove field itself. Feels a bit unclean a field is valid execute method. a local variable in execute passed argument getTagTarget. do think</technical_language>

Target:
public boolean isEnabled() { final Repository repo = getRepository(); return repo != null && containsHead(repo); }
Source:
<code>private Queue<ImageConfiguration> prepareStart(ServiceHub hub, QueryService queryService, RunService runService, Set<String> imageAliases) throws DockerAccessException, MojoExecutionException { final Queue<ImageConfiguration> imagesWaitingToStart = new ArrayDeque<>(); for (StartOrderResolver.Resolvable resolvable : runService.getImagesConfigsInOrder(queryService, getResolvedImages())) { final ImageConfiguration imageConfig = (ImageConfiguration) resolvable; String imageName = imageConfig.getName(); <START> BuildService.BuildContext buildContext = getBuildContext(); <END> hub.getBuildService().checkImageWithAutoPull(imageName, getConfiguredRegistry(imageConfig, pullRegistry), imageConfig.getBuildConfiguration() == null, buildContext); RunImageConfiguration runConfig = imageConfig.getRunConfiguration(); NetworkConfig config = runConfig.getNetworkingConfig(); if (autoCreateCustomNetworks && config.isCustomNetwork()) { runService.createCustomNetworkIfNotExistant(config.getCustomNetwork()); } imagesWaitingToStart.add(imageConfig); updateAliasesSet(imageAliases, imageConfig.getAlias()); } return imagesWaitingToStart; }</code><technical_language>I see, reason getBuildContext() is in AbstractDockerMojo. However, if move checkImageWithAutoPull() out of BuildService. sound "build-y" is a place for it, StartMojo BuildMojo</technical_language>

Target:
private Queue<ImageConfiguration> prepareStart(ServiceHub hub, QueryService queryService, RunService runService, Set<String> imageAliases) throws DockerAccessException, MojoExecutionException { final Queue<ImageConfiguration> imagesWaitingToStart = new ArrayDeque<>(); for (StartOrderResolver.Resolvable resolvable : runService.getImagesConfigsInOrder(queryService, getResolvedImages())) { final ImageConfiguration imageConfig = (ImageConfiguration) resolvable; String imageName = imageConfig.getName(); RegistryService.RegistryConfig registryConfig = getRegistryConfig(); hub.getRegistryService().checkImageWithAutoPull(imageName, getConfiguredRegistry(imageConfig, pullRegistry), imageConfig.getBuildConfiguration() == null, registryConfig); RunImageConfiguration runConfig = imageConfig.getRunConfiguration(); NetworkConfig config = runConfig.getNetworkingConfig(); if (autoCreateCustomNetworks && config.isCustomNetwork()) { runService.createCustomNetworkIfNotExistant(config.getCustomNetwork()); } imagesWaitingToStart.add(imageConfig); updateAliasesSet(imageAliases, imageConfig.getAlias()); } return imagesWaitingToStart; }
Source:
<code>private static User getFromStoredData(UUID uniqueId) { File dataFile = getPlayerDataFile(uniqueId); if (dataFile == null) { return null; } Optional<org.spongepowered.api.profile.GameProfile> profile = getProfileFromServer(uniqueId); <START> if (profile.isPresent()) { <END> return create((GameProfile) profile.get()); } else { return null; } }</code><technical_language>happened this line</technical_language>

Target:
private static User getFromStoredData(UUID uniqueId) { File dataFile = getPlayerDataFile(uniqueId); if (dataFile == null) { return null; } Optional<org.spongepowered.api.profile.GameProfile> profile = getProfileFromServer(uniqueId); if (profile.isPresent()) { User user = create((GameProfile) profile.get()); try { ((SpongeUser) user).readFromNbt(CompressedStreamTools.readCompressed(new FileInputStream(dataFile))); } catch (IOException e) { SpongeHooks.logWarning("Corrupt user file {}. {}", dataFile, e); } return user; } else { return null; } }
Source:
<code>public void updateResidentIdP(IdentityProvider identityProvider) throws IdentityProviderManagementException { try { String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); IdentityProviderManager.getInstance().updateResidentIdP(identityProvider, tenantDomain); } catch (IdentityProviderManagementException idpException) { <START> log.error("Error while updating ResidentIdP", idpException); <END> throw idpException; } }</code><technical_language>log tenantDomain if</technical_language>

Target:
public void updateResidentIdP(IdentityProvider identityProvider) throws IdentityProviderManagementException { String tenantDomain = ""; try { tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); IdentityProviderManager.getInstance().updateResidentIdP(identityProvider, tenantDomain); } catch (IdentityProviderManagementException idpException) { log.error("Error while updating ResidentIdP in tenantDomain : " + tenantDomain, idpException); throw idpException; } }
Source:
<code><START> @Override public String extractUrl() { <END> String url = ""; if (getIntent().getExtras() != null) { url = getIntent().getStringExtra(URL_KEY); } return url; }</code><technical_language>is small duplication. If add extra parameter key replace methods</technical_language>

Target:
@Override public String extractUrl() { return extractExtra(URL_KEY); }
Source:
<code><START> private void cleanupBackupFiles() throws IOException { <END> if (dataDirPath == null) { return; } File backupDir = dataDirPath.toFile(); FileFilter tempFileFilter = (File pathname) -> pathname.getName().startsWith("storeId"); File[] files = backupDir.listFiles(tempFileFilter); if (files != null) { for (File file : files) { File deleteFile = new File(MOUNT_PATH + file.getName() + File.separator + "compactionPolicyInfo.json"); logger.trace("Delete temp file {}", deleteFile.getName()); deleteFile(deleteFile.toPath()); } } }</code><technical_language>Minor: please move private utility methods bottom</technical_language>

Target:
private void cleanupBackupFiles() { if (dataDirPath == null) { return; } File backupDir = dataDirPath.toFile(); FileFilter tempFileFilter = (File pathname) -> pathname.getName().startsWith("storeId"); File[] files = backupDir.listFiles(tempFileFilter); if (files != null) { for (File file : files) { File deleteFile = new File(MOUNT_PATH + file.getName() + File.separator + "compactionPolicyInfo.json"); logger.trace("Delete temp file {}", deleteFile.getName()); deleteFile(deleteFile.toPath()); } } }
Source:
<code>public static void main(String[] args) { final RestServer restServer; int exitCode = 0; try { final InvocationOptions options = new InvocationOptions(args); final Properties properties = Utils.loadProps(options.serverPropsFilePath); final VerifiableProperties verifiableProperties = new VerifiableProperties(properties); final ClusterMap clusterMap = new ClusterMapManager(options.hardwareLayoutFilePath, options.partitionLayoutFilePath, new ClusterMapConfig(verifiableProperties)); <START> final SSLFactory sslFactory = new SSLFactory(new SSLConfig(verifiableProperties)); <END> logger.info("Bootstrapping RestServer"); restServer = new RestServer(verifiableProperties, clusterMap, new LoggingNotificationSystem(), sslFactory); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { logger.info("Received shutdown signal. Shutting down RestServer"); restServer.shutdown(); } }); restServer.start(); restServer.awaitShutdown(); } catch (Exception e) { logger.error("Exception during bootstrap of RestServer", e); exitCode = 1; } logger.info("Exiting RestServerMain"); System.exit(exitCode); }</code><technical_language>reminder check for ssl requirement this</technical_language>

Target:
public static void main(String[] args) { final RestServer restServer; int exitCode = 0; try { final InvocationOptions options = new InvocationOptions(args); final Properties properties = Utils.loadProps(options.serverPropsFilePath); final VerifiableProperties verifiableProperties = new VerifiableProperties(properties); final ClusterMap clusterMap = new ClusterMapManager(options.hardwareLayoutFilePath, options.partitionLayoutFilePath, new ClusterMapConfig(verifiableProperties)); final SSLFactory sslFactory = getSSLFactoryIfRequired(verifiableProperties); logger.info("Bootstrapping RestServer"); restServer = new RestServer(verifiableProperties, clusterMap, new LoggingNotificationSystem(), sslFactory); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { logger.info("Received shutdown signal. Shutting down RestServer"); restServer.shutdown(); } }); restServer.start(); restServer.awaitShutdown(); } catch (Exception e) { logger.error("Exception during bootstrap of RestServer", e); exitCode = 1; } logger.info("Exiting RestServerMain"); System.exit(exitCode); }
Source:
<code>private HashSet<String> getCurrentlyUsedRepo() { <START> HashSet<String> currentlyUsedRepos = new HashSet<String>(); <END> String defaultRepo = ui.logic.getDefaultRepo(); currentlyUsedRepos.add(defaultRepo); for(int i = 0; i < panels.getNumberOfPanels(); i++) { AbstractPanel currPanel = panels.getPanel(i); if (currPanel instanceof FilterPanel) { FilterPanel currFilterPanel = (FilterPanel) currPanel; FilterExpression panelExpression = currFilterPanel.getCurrentFilterExpression(); List<Qualifier> panelMetaQualifiers = panelExpression.find(Qualifier::isMetaQualifier); panelMetaQualifiers.forEach(metaQualifier -> { if (metaQualifier.getName().equals(Qualifier.REPO) && metaQualifier.getContent().isPresent()) { currentlyUsedRepos.add(metaQualifier.getContent().get()); } }); } } return currentlyUsedRepos; }</code><technical_language>I need traverse panels filters figure out repos open. This Logic</technical_language>

Target:
private HashSet<String> getCurrentlyUsedRepo() { HashSet<String> currentlyUsedRepos = new HashSet<>(); String defaultRepo = ui.logic.getDefaultRepo(); currentlyUsedRepos.add(defaultRepo); currentlyUsedRepos.addAll(panels.getRepositoriesReferencedOnAllPanels()); return currentlyUsedRepos; }
Source:
<code>private ArgumentMatcher<Collection<GlusterVolumeOptionEntity>> areAddedOptions() { return new ArgumentMatcher<Collection<GlusterVolumeOptionEntity>>() { @Override public boolean matches(Object argument) { <START> if (!(argument instanceof Collection<?>)) { <END> return false; } @SuppressWarnings("unchecked") ArrayList<GlusterVolumeOptionEntity> optionsToAdd = (ArrayList<GlusterVolumeOptionEntity>) argument; existingReplVol.setOption(optionsToAdd.get(0)); return (optionsToAdd.size() == 1 && (optionsToAdd.get(0).getKey().equals(OPTION_AUTH_REJECT))); } }; }</code><technical_language>I method check instancof ArrayList. Is ok check instanceof Collection</technical_language>

Target:
private ArgumentMatcher<Collection<GlusterVolumeOptionEntity>> areAddedOptions() { return new ArgumentMatcher<Collection<GlusterVolumeOptionEntity>>() { @Override public boolean matches(Object argument) { if (!(argument instanceof ArrayList)) { return false; } @SuppressWarnings("unchecked") ArrayList<GlusterVolumeOptionEntity> optionsToAdd = (ArrayList<GlusterVolumeOptionEntity>) argument; existingReplVol.setOption(optionsToAdd.get(0)); return (optionsToAdd.size() == 1 && (optionsToAdd.get(0).getKey().equals(OPTION_AUTH_REJECT))); } }; }
Source:
<code>public static PCollection<Variant> joinGvcfVariantsTransform( PCollection<SearchVariantsRequest> input, GenomicsFactory.OfflineAuth auth, String fields) { for (String field : REQUIRED_FIELDS) { <START> Preconditions.checkState(fields.contains(field), "Required field missing: " + field <END> + "Add this field to the list of Variants fields returned in the partial response."); } return joinGvcfVariants(input, auth, fields); }</code><technical_language>Preconditions.checkState a format string format error message: Preconditions.checkState(fields.contains(field), "Required field missing: %s Add this field list of Variants fields returned in partial response.", field);</technical_language>

Target:
public static PCollection<Variant> joinGvcfVariantsTransform( PCollection<SearchVariantsRequest> input, GenomicsFactory.OfflineAuth auth, String fields) { for (String field : REQUIRED_FIELDS) { Preconditions .checkState( fields.contains(field), "Required field missing: %s Add this field to the list of Variants fields returned in the partial response.", field); } return joinGvcfVariants(input, auth, fields); }
Source:
<code><START> public void releaseBlockingChannel(BlockingChannel blockingChannel) { <END> rwlock.readLock().lock(); try { if (blockingChannelActiveConnections.remove(blockingChannel)) { blockingChannelAvailableConnections.add(blockingChannel); logger.trace( "Adding connection to {}:{} back to pool. Current available connections Current active connections {}", blockingChannel.getRemoteHost(), blockingChannel.getRemotePort(), blockingChannelAvailableConnections.size(), blockingChannelActiveConnections.size()); } else { logger.error("Tried to add invalid connection. Channel does not belong in the active queue. Host port {}" + " channel host channel port {}", host, port, blockingChannel.getRemoteHost(), blockingChannel.getRemotePort()); } } finally { rwlock.readLock().unlock(); } }</code><technical_language>this a diff this is is in linkedin/ambry:master</technical_language>

Target:
public void releaseBlockingChannel(BlockingChannel blockingChannel) { rwlock.readLock().lock(); try { if (blockingChannelActiveConnections.remove(blockingChannel)) { blockingChannelAvailableConnections.add(blockingChannel); logger.trace( "Adding connection to {}:{} back to pool. Current available connections Current active connections {}", blockingChannel.getRemoteHost(), blockingChannel.getRemotePort(), blockingChannelAvailableConnections.size(), blockingChannelActiveConnections.size()); } else { logger.error("Tried to add invalid connection. Channel does not belong in the active queue. Host port {}" + " channel host channel port {}", host, port.getPort(), blockingChannel.getRemoteHost(), blockingChannel.getRemotePort()); } } finally { rwlock.readLock().unlock(); } }
Source:
<code>public boolean unblock() { if (blocker != null) { <START> if (client.send(blocker.buffer, blocker.dataOffset, blocker.length - (blocker.dataOffset - blocker.offset))) { <END> blocker = null; } else { return false; } } return true; }</code><technical_language>Is refactoring necessary? replacing line send client.send. I length sent</technical_language>

Target:
public boolean unblock() { if (blocker == null) { return true; } if (client.send(blocker.buffer, blocker.dataOffset, blocker.length - (blocker.dataOffset - blocker.offset))) { blocker = null; return true; } return false; }
Source:
<code>public void init() { URL url = URL.valueOf("dubbo://" + NetUtils.getLocalAddress().getHostName() + ":2233"); testUrl = URL.valueOf("<LINK_0>"); abstractRegistry = new AbstractRegistry(url) { @Override public boolean isAvailable() { return false; } }; listener = urls -> notifySuccess = true; notifySuccess = false; <START> LoggerFactory.setLevel(Level.INFO); <END> Level level = LoggerFactory.getLevel(); }</code><technical_language>do this, instead, modify resources/log4j.xml</technical_language>

Target:
public void init() { URL url = URL.valueOf("dubbo://" + NetUtils.getLocalAddress().getHostName() + ":2233"); testUrl = URL.valueOf("<LINK_0>"); mockUrl = new URL("dubbo", "127.0.0.0", 2200); parametersConsumer.put("application", "demo-consumer"); parametersConsumer.put("category", "consumer"); parametersConsumer.put("check", "false"); parametersConsumer.put("dubbo", "2.0.2"); parametersConsumer.put("interface", "org.apache.dubbo.demo.DemoService"); parametersConsumer.put("methods", "sayHello"); parametersConsumer.put("pid", "1676"); parametersConsumer.put("qos.port", "333333"); parametersConsumer.put("side", "consumer"); parametersConsumer.put("timestamp", String.valueOf(System.currentTimeMillis())); abstractRegistry = new AbstractRegistry(url) { @Override public boolean isAvailable() { return false; } }; listener = urls -> notifySuccess = true; notifySuccess = false; }
Source:
<code>public void run() { try { while (wrapper.isAlive) { if (wrapper.waitForReplay) { Thread.sleep(100); <START> } <END> if (!this.offsetToCommit.isEmpty()) { if (logger.isDebugEnabled()) { logger.debug("Commit offsets {}", Joiner.on(';').withKeyValueSeparator("=").join(this.offsetToCommit)); } consumer.commitAsync(offsetToCommit, wrapper.ownerOperator); offsetToCommit.clear(); } try { ConsumerRecords<byte[], byte[]> records = consumer.poll(wrapper.ownerOperator.getConsumerTimeout()); for (ConsumerRecord<byte[], byte[]> record : records) { wrapper.putMessage(Pair.of(cluster, record)); } } catch (NoOffsetForPartitionException e) { AbstractKafkaInputOperator.InitialOffset io = AbstractKafkaInputOperator.InitialOffset.valueOf(wrapper.ownerOperator.getInitialOffset()); if (io == AbstractKafkaInputOperator.InitialOffset.APPLICATION_OR_EARLIEST || io == AbstractKafkaInputOperator.InitialOffset.EARLIEST) { consumer.seekToBeginning(e.partitions().toArray(new TopicPartition[0])); } else { consumer.seekToEnd(e.partitions().toArray(new TopicPartition[0])); } } catch (InterruptedException e) { throw new IllegalStateException("Consumer thread is interrupted unexpectedly", e); } } } catch (WakeupException we) { logger.info("The consumer is being stopped"); } catch (InterruptedException e) { DTThrowable.rethrow(e); } finally { consumer.close(); } }</code><technical_language>thread sleep, I need continue loop. Otherwise, consume messages consumer. Code snippet for if condition follows: if (wrapper.waitForReplay) { Thread.sleep(100); continue; }</technical_language>

Target:
public void run() { try { while (wrapper.isAlive) { if (wrapper.waitForReplay) { Thread.sleep(100); continue; } if (!this.offsetToCommit.isEmpty()) { if (logger.isDebugEnabled()) { logger.debug("Commit offsets {}", Joiner.on(';').withKeyValueSeparator("=").join(this.offsetToCommit)); } consumer.commitAsync(offsetToCommit, wrapper.ownerOperator); offsetToCommit.clear(); } try { ConsumerRecords<byte[], byte[]> records = consumer.poll(wrapper.ownerOperator.getConsumerTimeout()); for (ConsumerRecord<byte[], byte[]> record : records) { wrapper.putMessage(Pair.of(cluster, record)); } } catch (NoOffsetForPartitionException e) { AbstractKafkaInputOperator.InitialOffset io = AbstractKafkaInputOperator.InitialOffset.valueOf(wrapper.ownerOperator.getInitialOffset()); if (io == AbstractKafkaInputOperator.InitialOffset.APPLICATION_OR_EARLIEST || io == AbstractKafkaInputOperator.InitialOffset.EARLIEST) { consumer.seekToBeginning(e.partitions().toArray(new TopicPartition[0])); } else { consumer.seekToEnd(e.partitions().toArray(new TopicPartition[0])); } } catch (InterruptedException e) { throw new IllegalStateException("Consumer thread is interrupted unexpectedly", e); } } } catch (WakeupException we) { logger.info("The consumer is being stopped"); } catch (InterruptedException e) { DTThrowable.rethrow(e); } finally { consumer.close(); } }
Source:
<code>protected Set<String> getNextNames(final String group, final Template template, int count) { Set<String> names = newLinkedHashSet(); if (!template.getOptions().getNodeNames().isEmpty()) { if (template.getOptions().getNodeNames().size() == count) { return ImmutableSet.copyOf(template.getOptions().getNodeNames()); } else if (template.getOptions().getNodeNames().size() > count) { <START> return ImmutableSet.copyOf(Iterables.limit(template.getOptions().getNodeNames(), count)); <END> } else { names.addAll(template.getOptions().getNodeNames()); } } Iterable<? extends ComputeMetadata> currentNodes = listNodesStrategy.listNodes(); int maxTries = 100; int currentTries = 0; while (names.size() < count && currentTries++ < maxTries) { final String name = namingConvention.createWithoutPrefix().uniqueNameForGroup(group); if (!any(currentNodes, new Predicate<ComputeMetadata>() { @Override public boolean apply(ComputeMetadata input) { return name.equals(input.getName()); } })) { names.add(name); } } return names; }</code><technical_language>branches clear, Set<String> nodeNames = template.getOptions().getNodeNames(); if (nodeNames.size() >= count) { return ImmutableSet.copyOf(Iterables.limit(nodeNames, count)); } else { names.addAll(nodeNames); } clear enough, a bit shorter</technical_language>

Target:
protected Set<String> getNextNames(final String group, final Template template, int count) { Set<String> names = newLinkedHashSet(); Set<String> nodeNames = template.getOptions().getNodeNames(); if (nodeNames.size() >= count) { return ImmutableSet.copyOf(Iterables.limit(nodeNames, count)); } else { names.addAll(nodeNames); } Iterable<? extends ComputeMetadata> currentNodes = listNodesStrategy.listNodes(); int maxTries = 100; int currentTries = 0; while (names.size() < count && currentTries++ < maxTries) { final String name = namingConvention.createWithoutPrefix().uniqueNameForGroup(group); if (!any(currentNodes, new Predicate<ComputeMetadata>() { @Override public boolean apply(ComputeMetadata input) { return name.equals(input.getName()); } })) { names.add(name); } } return names; }
Source:
<code>public int compareTo(final ITmfTimestamp ts, final boolean withinPrecision) { if (ts == null) { return 1; } if (this == ts || (fValue == ts.getValue() && fScale == ts.getScale())) { return 0; } if ((fValue == BIG_BANG.getValue() && fScale == BIG_BANG.getScale()) || (ts.getValue() == BIG_CRUNCH.getValue() && ts.getScale() == BIG_CRUNCH.getScale())) { return -1; } if ((fValue == BIG_CRUNCH.getValue() && fScale == BIG_CRUNCH.getScale()) || (ts.getValue() == BIG_BANG.getValue() && ts.getScale() == BIG_BANG.getScale())) { return 1; } try { final ITmfTimestamp nts = ts.normalize(0, fScale); final long delta = fValue - nts.getValue(); int imprecision = fPrecision + nts.getPrecision(); <START> if (!(imprecision == 0 && delta != 0)) { <END> if ((delta == 0) || (withinPrecision && (Math.abs(delta) <= imprecision))) { return 0; } } return (delta > 0) ? 1 : -1; } catch (final ArithmeticException e) { final long value = ts.getValue(); if (fValue == 0 && value == 0) { return 0; } if (fValue < 0 && value >= 0) { return -1; } if (fValue >= 0 && value < 0) { return 1; } final int scale = ts.getScale(); return (fScale > scale) ? (fValue >= 0) ? 1 : -1 : (fValue >= 0) ? -1 : 1; } }</code><technical_language>withinPrecision is false always, if this slower</technical_language>

Target:
public int compareTo(final ITmfTimestamp ts, final boolean withinPrecision) { if (ts == null) { return 1; } if (this == ts || (fValue == ts.getValue() && fScale == ts.getScale())) { return 0; } if ((fValue == BIG_BANG.getValue() && fScale == BIG_BANG.getScale()) || (ts.getValue() == BIG_CRUNCH.getValue() && ts.getScale() == BIG_CRUNCH.getScale())) { return -1; } if ((fValue == BIG_CRUNCH.getValue() && fScale == BIG_CRUNCH.getScale()) || (ts.getValue() == BIG_BANG.getValue() && ts.getScale() == BIG_BANG.getScale())) { return 1; } try { final ITmfTimestamp nts = ts.normalize(0, fScale); final long delta = fValue - nts.getValue(); if (delta == 0) { return 0; } if (withinPrecision) { int imprecision = fPrecision + nts.getPrecision(); if (imprecision == 0 || (Math.abs(delta) <= imprecision)) { return 0; } } return (delta > 0) ? 1 : -1; } catch (final ArithmeticException e) { final long value = ts.getValue(); if (fValue == 0 && value == 0) { return 0; } if (fValue < 0 && value >= 0) { return -1; } if (fValue >= 0 && value < 0) { return 1; } final int scale = ts.getScale(); return (fScale > scale) ? (fValue >= 0) ? 1 : -1 : (fValue >= 0) ? -1 : 1; } }
Source:
<code>public Map<ProjectVersionRef, String> translateVersions(List<ProjectVersionRef> projects) { final Map<ProjectVersionRef, String> result = new HashMap<>(); logger.debug("Translating versions: " + projects); final Queue<Task> queue = new ArrayDeque<>(); queue.add(new Task(projects, chunkSplitCount, endpointUrl)); while (!queue.isEmpty()) { Task task = queue.remove(); task.executeTranslate(); if (task.isSuccess()) { result.putAll(task.getResult()); } else { if (task.canSplit()) { logger.debug("Failed to translate versions, splitting and retrying. " + <START> "Chunk size is " + task.getChunkSize()); <END> queue.addAll(task.split()); } else { if (task.getStatus() > 0) throw new RestException("Cannot split and retry anymore. Last status was " + task.getStatus()); else throw new RestException("Cannot split and retry anymore. Cause: " + task.getException(), task.getException()); } } } return result; }</code><technical_language>Is this output previous chunk size split into</technical_language>

Target:
public Map<ProjectVersionRef, String> translateVersions( List<ProjectVersionRef> projects ) { final Map<ProjectVersionRef, String> result = new HashMap<>(); logger.debug( "Translating versions: " + projects ); final Queue<Task> queue = new ArrayDeque<>(); queue.add( new Task( projects, chunkSplitCount, endpointUrl ) ); while ( !queue.isEmpty() ) { Task task = queue.remove(); task.executeTranslate(); if ( task.isSuccess() ) { result.putAll( task.getResult() ); } else { if ( task.canSplit() ) { List<Task> tasks = task.split(); logger.debug( "Failed to translate versions, splitting and retrying. " + "Chunk was: " + task + ", new chunks are: " + tasks ); queue.addAll( tasks ); } else { if ( task.getStatus() > 0 ) throw new RestException( "Cannot split and retry anymore. Last status was " + task.getStatus() ); else throw new RestException( "Cannot split and retry anymore. Cause: " + task.getException(), task.getException() ); } } } return result; }
Source:
<code>public void test() { final String contig = "chr1"; final int spacing = 100000; final double contamination = 0.05; final double alleleFrequency = 0.2; final int depth = 100; final List<PileupSummary> ps = new ArrayList<>(); for (int n = 0; n < 1000; n++) { int position = n * spacing; ps.add(n % 10 == 0 ? new PileupSummary(contig, position, (int) (depth*contamination), (int) (depth * (1 - contamination)), 0, alleleFrequency) : new PileupSummary(contig, position, depth / 2, depth/2, 1, alleleFrequency)); } for (int n = 1000; n < 1100; n++) { int position = n * spacing; ps.add(n % 10 == 0 ? new PileupSummary(contig, position, (int) (depth*contamination), (int) (depth * (1 - contamination)), 0, alleleFrequency) : new PileupSummary(contig, position, (int) 0.2 * depth, (int) (0.8 * depth), 1, alleleFrequency)); } final File psTable = createTempFile("pileups", ".table"); PileupSummary.writePileupSummaries(ps, psTable); final File contaminationTable = createTempFile("contamination", ".table"); final String[] args = { "-I", psTable.getAbsolutePath(), "-O", contaminationTable.getAbsolutePath(), }; runCommandLine(args); final double calculatedContamination = ContaminationRecord.readContaminationTable(contaminationTable).get(0).getContamination(); <START> Assert.assertEquals(calculatedContamination, 0.05 / (1 - alleleFrequency), 0.01); <END> }</code><technical_language>contamination instead of 0.05</technical_language>

Target:
public void test() { final String contig = "chr1"; final int spacing = 100000; final double contamination = 0.07; final double alleleFrequency = 0.2; final double refContamination = contamination * (1 - alleleFrequency); final int depth = 100; final List<PileupSummary> ps = new ArrayList<>(); for (int n = 0; n < 1000; n++) { int position = n * spacing; ps.add(n % 10 == 0 ? new PileupSummary(contig, position, (int) (depth*refContamination), (int) (depth * (1 - refContamination)), 0, alleleFrequency) : new PileupSummary(contig, position, depth / 2, depth/2, 1, alleleFrequency)); } for (int n = 1000; n < 1100; n++) { int position = n * spacing; ps.add(n % 10 == 0 ? new PileupSummary(contig, position, (int) (depth*refContamination), (int) (depth * (1 - refContamination)), 0, alleleFrequency) : new PileupSummary(contig, position, (int) 0.2 * depth, (int) (0.8 * depth), 1, alleleFrequency)); } final File psTable = createTempFile("pileups", ".table"); PileupSummary.writePileupSummaries(ps, psTable); final File contaminationTable = createTempFile("contamination", ".table"); final String[] args = { "-I", psTable.getAbsolutePath(), "-O", contaminationTable.getAbsolutePath(), }; runCommandLine(args); final double calculatedContamination = ContaminationRecord.readContaminationTable(contaminationTable).get(0).getContamination(); Assert.assertEquals(calculatedContamination, contamination, 0.01); }
Source:
<code><START> public AsyncRequestResponseHandler getHandler() { <END> int index = currIndex.getAndIncrement(); logger.trace("Monotonically increasing value was used to pick request handler at index {}", index, index % requestResponseHandlers.size()); return requestResponseHandlers.get(index % requestResponseHandlers.size()); }</code><technical_language>If caller is concern a ResponseHandler a RequestHandler, this class getRequestHandler() getResponseHandler() methods. internally give out AsyncRequestResponseHandler objects implement RequestHandler ResponseHandler interfaces</technical_language>

Target:
public AsyncRequestResponseHandler getHandler() { int index = currIndex.getAndIncrement(); logger.trace("Monotonically increasing value was used to pick request handler at index {}", index, index % asyncRequestResponseHandlers.size()); return asyncRequestResponseHandlers.get(index % asyncRequestResponseHandlers.size()); }
Source:
<code>Snapshot.Root chooseDeletedSnapshot() { final List<INodeDirectory> dirs = getSnapshottableDirs(); <START> Collections.shuffle(dirs); <END> for(INodeDirectory dir : dirs) { final Snapshot.Root root = chooseDeletedSnapshot(dir); if (root != null) { return root; } } return null; }</code><technical_language>Lets move this a funcation chooseSnapshottableDir, this policy controleed later</technical_language>

Target:
Snapshot.Root chooseDeletedSnapshot() { for(INodeDirectory dir : getSnapshottableDirsForGc()) { final Snapshot.Root root = chooseDeletedSnapshot(dir); if (root != null) { return root; } } return null; }
Source:
<code>public FileSystemViewKeyInputFormat(FileSystemDataset<E> dataset, Configuration conf) { this.dataset = dataset; LOG.debug("Dataset: {}", dataset); Format format = dataset.getDescriptor().getFormat(); boolean isSpecific = SpecificRecord.class.isAssignableFrom(dataset.getType()); String readerSchema = conf.get("kite.readerSchema"); <START> if (isSpecific && readerSchema == null) { <END> readerSchema = SpecificData.get().getSchema(dataset.getType()).toString(); } if (Formats.AVRO.equals(format)) { setModel.invoke(conf, DataModelUtil.getDataModelForType(dataset.getType()).getClass()); if (readerSchema != null) { conf.set(AVRO_SCHEMA_INPUT_KEY, readerSchema); } } else if (Formats.PARQUET.equals(format)) { if (readerSchema != null) { AvroReadSupport.setAvroReadSchema(conf, new Schema.Parser().parse(readerSchema)); } } }</code><technical_language>I this require schema is null if isSpecific is true. able project columns a class (specific, reflect, thrift, etc.) setting a schema, both. return partial objects: I get object field stored in dataset. This is especially important Avro unsafe APIs construct reflected objects guarantees</technical_language>

Target:
public FileSystemViewKeyInputFormat(FileSystemDataset<E> dataset, Configuration conf) { this.dataset = dataset; LOG.debug("Dataset: {}", dataset); Format format = dataset.getDescriptor().getFormat(); boolean isSpecific = SpecificRecord.class.isAssignableFrom(dataset.getType()); String readerSchema = conf.get(KITE_READER_SCHEMA); Preconditions.checkState(!isSpecific || readerSchema == null, "Illegal configuration: must not be set if dataset uses a specific type {}", KITE_READER_SCHEMA, dataset.getType()); if (isSpecific) { readerSchema = SpecificData.get().getSchema(dataset.getType()).toString(); } if (Formats.AVRO.equals(format)) { setModel.invoke(conf, DataModelUtil.getDataModelForType(dataset.getType()).getClass()); if (readerSchema != null) { conf.set(AVRO_SCHEMA_INPUT_KEY, readerSchema); } } else if (Formats.PARQUET.equals(format)) { if (readerSchema != null) { AvroReadSupport.setAvroReadSchema(conf, new Schema.Parser().parse(readerSchema)); } } }
Source:
<code>public static GlobalMetricRegistriesAdapter getInstance() { <START> if (INSTANCE == null) { <END> INSTANCE = new GlobalMetricRegistriesAdapter(); } return INSTANCE; }</code><technical_language>nit: do need double checking here? if (INSTANCE == null) { synchronized(this) { if(INSTANCE == null) { ... } } }</technical_language>

Target:
public static GlobalMetricRegistriesAdapter getInstance() { return INSTANCE; }
Source:
<code>public void call_shouldNotMarkTransactionSuccessful_ifOptionSet_Fails() throws Exception { when(optionSetCall.execute()).thenReturn(errorResponse); <START> <END> Response response = metadataCall.call(); assertThat(response).isEqualTo(errorResponse); assertThat(response.code()).isEqualTo(HttpURLConnection.HTTP_CLIENT_TIMEOUT); verify(databaseAdapter, times(6)).beginNewTransaction(); verify(transaction, times(6)).end(); verify(transaction, atMost(5)).setSuccessful(); }</code><technical_language>Create a constant (int transactionsSuccess = 6) is a magic number</technical_language>

Target:
public void call_shouldNotMarkTransactionSuccessful_ifOptionSet_Fails() throws Exception { final int expectedTransactions = 6; when(optionSetCall.execute()).thenReturn(errorResponse); Response response = metadataCall.call(); assertThat(response).isEqualTo(errorResponse); assertThat(response.code()).isEqualTo(HttpURLConnection.HTTP_CLIENT_TIMEOUT); verify(databaseAdapter, times(expectedTransactions)).beginNewTransaction(); verify(transaction, times(expectedTransactions)).end(); verify(transaction, atMost(expectedTransactions - 1)).setSuccessful(); }
Source:
<code>private <T extends Serializable> void sendMessageToLocalRegionSync(final T body) throws IOException { if ( sqs == null ) { logger.error( "SQS client is null, perhaps it failed to initialize successfully" ); return; } final String stringBody = toString( body ); if (logger.isDebugEnabled()) { logger.debug(" sendMessageToLocalRegion " + stringBody); } String url = getReadQueue().getUrl(); if ( logger.isTraceEnabled() ) { logger.trace( "Publishing Message...{} to url: {}", stringBody, url ); } SendMessageRequest messageRequest = new SendMessageRequest(url, stringBody); try { SendMessageResult result = sqs.sendMessage(messageRequest); if (logger.isTraceEnabled()) { logger.trace("Successfully published... messageID=[{}], arn=[{}]", result.getMessageId(), url); } } catch (Exception e) { <START> logger.error("Failed to send this message {}. To this address {}. Error was ", messageRequest.getMessageBody(), url, e); <END> sendMessageToLocalRegionAsync(body); } }</code><technical_language>common format</technical_language>

Target:
private <T extends Serializable> void sendMessageToLocalRegionSync(final T body) throws IOException { if ( sqs == null ) { logger.error( "SQS client is null, perhaps it failed to initialize successfully" ); return; } final String stringBody = toString( body ); if (logger.isDebugEnabled()) { logger.debug(" sendMessageToLocalRegion " + stringBody); } String url = getReadQueue().getUrl(); if ( logger.isTraceEnabled() ) { logger.trace( "Publishing Message...{} to url: {}", stringBody, url ); } SendMessageRequest messageRequest = new SendMessageRequest(url, stringBody); try { SendMessageResult result = sqs.sendMessage(messageRequest); if (logger.isTraceEnabled()) { logger.trace("Successfully published... messageID=[{}], arn=[{}]", result.getMessageId(), url); } } catch (Exception e) { logger.error(FAILED_TO_SEND_MESSAGE, messageRequest.getMessageBody(), url, e); sendMessageToLocalRegionAsync(body); } }
Source:
<code>private static FunctionTree functionTree(CallExpressionTree tree, ProgramState currentState) { if (tree.callee().is(Kind.IDENTIFIER_REFERENCE)) { Symbol symbol = ((IdentifierTree) tree.callee()).symbol(); if (symbol != null) { <START> SymbolicValue symbolicValue = currentState.getSymbolicValue(symbol); <END> if (symbolicValue instanceof FunctionSymbolicValue) { return ((FunctionSymbolicValue) symbolicValue).getFunctionTree(); } } } return null; }</code><technical_language>@vilchik-elena expression stack</technical_language>

Target:
private static FunctionTree functionTree(CallExpressionTree tree, ProgramState currentState) { SymbolicValue calleeSV = currentState.peekStack(tree.arguments().parameters().size()); if (calleeSV instanceof FunctionSymbolicValue) { return ((FunctionSymbolicValue) calleeSV).getFunctionTree(); } return null; }
Source:
<code>public void testPendingMutationsOnDDL() throws Exception { Connection conn = null; PhoenixConnection spy = null; try { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); props.setProperty(QueryServices.PENDING_MUTATIONS_DDL_THROW_ATTRIB, "true"); <START> conn = DriverManager.getConnection(getUrl(), props); <END> MutationState mutationState = mock(MutationState.class); when(mutationState.getNumRows()).thenReturn(1); spy = spy((PhoenixConnection) conn); doReturn(mutationState).when(spy).getMutationState(); spy.createStatement().execute("create table MUTATION_TEST1" + "( id1 UNSIGNED_INT not null primary key," + "appId1 VARCHAR)"); } finally { if (spy != null) { spy.close(); } } }</code><technical_language>Surround connection try-with-resources for auto-closing</technical_language>

Target:
public void testPendingMutationsOnDDL() throws Exception { Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); props.setProperty(QueryServices.PENDING_MUTATIONS_DDL_THROW_ATTRIB, "true"); try (Connection conn = DriverManager.getConnection(getUrl(), props); PhoenixConnection pConnSpy = spy((PhoenixConnection) conn)) { MutationState mutationState = mock(MutationState.class); when(mutationState.getNumRows()).thenReturn(1); doReturn(mutationState).when(pConnSpy).getMutationState(); exceptionRule.expect(SQLException.class); exceptionRule.expectMessage( SQLExceptionCode.CANNOT_PERFORM_DDL_WITH_PENDING_MUTATIONS.getMessage()); pConnSpy.createStatement().execute("create table MUTATION_TEST1" + "( id1 UNSIGNED_INT not null primary key," + "appId1 VARCHAR)"); } }
Source:
<code>public boolean isInDiskCacheSync(final ImageRequest imageRequest) { final CacheKey cacheKey = mCacheKeyFactory.getEncodedCacheKey(imageRequest, null); final ImageRequest.CacheChoice cacheChoice = imageRequest.getCacheChoice(); <START> if (cacheChoice == ImageRequest.CacheChoice.SMALL) { <END> return mSmallImageBufferedDiskCache.diskCheckSync(cacheKey); } else { return mMainBufferedDiskCache.diskCheckSync(cacheKey); } }</code><technical_language>style: this a switch. If happen add CacheChoice, compiler warn if forget this location</technical_language>

Target:
public boolean isInDiskCacheSync(final ImageRequest imageRequest) { final CacheKey cacheKey = mCacheKeyFactory.getEncodedCacheKey(imageRequest, null); final ImageRequest.CacheChoice cacheChoice = imageRequest.getCacheChoice(); switch (cacheChoice) { case DEFAULT: return mMainBufferedDiskCache.diskCheckSync(cacheKey); case SMALL: return mSmallImageBufferedDiskCache.diskCheckSync(cacheKey); default: return false; } }
Source:
<code>public static String getVideoPressVideoPosterFromURL(String videoUrl) { <START> return videoUrl.substring(0, videoUrl.lastIndexOf(".")) + "_std.original.jpg"; <END> }</code><technical_language>In addition null check mentioned above, this ensure videoUrl empty string (otherwise a StringIndexOutOfBoundsException exception here). A simple TextUtils.isEmpty() check suffice</technical_language>

Target:
public static String getVideoPressVideoPosterFromURL(String videoUrl) { String posterUrl = ""; if (videoUrl != null) { int filetypeLocation = videoUrl.lastIndexOf("."); if (filetypeLocation > 0) { posterUrl = videoUrl.substring(0, filetypeLocation) + "_std.original.jpg"; } } return posterUrl; }
Source:
<code><START> protected Map<String, Pair<String, String>> getExclusiveLocks() { <END> Map<String, Pair<String, String>> locks = new HashMap<String, Pair<String, String>>(); domains = getStorageDomainsByConnId(getParameters().getStorageServerConnection().getid()); if (!domains.isEmpty() && domains.size() == 1) { setStorageDomain(domains.get(0)); locks.put(getStorageDomain().getId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } locks.put(getParameters().getStorageServerConnection().getconnection(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE_CONNECTION, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); return locks; }</code><technical_language>lock objects refer in CDA: - domains - lun disks - vms plugged disks this leave issue of adding a new lun disk target, I file a BZ for handle later</technical_language>

Target:
protected Map<String, Pair<String, String>> getExclusiveLocks() { Map<String, Pair<String, String>> locks = new HashMap<String, Pair<String, String>>(); domains = getStorageDomainsByConnId(getConnection().getid()); if (!domains.isEmpty()) { for (StorageDomain domain : domains) { locks.put(domain.getId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } } if (getConnection().getstorage_type().isFileDomain()) { locks.put(getConnection().getconnection(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE_CONNECTION, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } else { locks.put(getConnection().getconnection() + ";" + getConnection().getiqn() + ";" + getConnection().getport() + ";" + getConnection().getuser_name(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE_CONNECTION, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } locks.put(getConnection().getid(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.STORAGE_CONNECTION, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); return locks; }
Source:
<code>protected void validateClone(Map<String, Long> values) throws IOException { try (Table clonedTable = getConnection().getTable(clonedTableName); ResultScanner scanner = clonedTable.getScanner(new Scan())){ for(Result result : scanner) { String row = Bytes.toString(result.getRow()); Long expected = values.get(row); Long found = Bytes.toLong(result.getValue(COLUMN_FAMILY, QUALIFIER)); Assert.assertEquals("row " + row + " not equal", expected, found); values.remove(row); } } <START> Assert.assertTrue("Extra keys found.", values.isEmpty()); <END> }</code><technical_language>I remaining values missing extra</technical_language>

Target:
protected void validateClone(Map<String, Long> values) throws IOException { try (Table clonedTable = getConnection().getTable(clonedTableName); ResultScanner scanner = clonedTable.getScanner(new Scan())){ for(Result result : scanner) { String row = Bytes.toString(result.getRow()); Long expected = values.get(row); Long found = Bytes.toLong(result.getValue(COLUMN_FAMILY, QUALIFIER)); Assert.assertEquals("row " + row + " not equal", expected, found); values.remove(row); } } Assert.assertTrue("There were missing keys.", values.isEmpty()); }
Source:
<code>public boolean pushdownFilterAndProjection(PageSourceOptions options) { ImmutableList.Builder<FilterFunction> remainingFilterFunctions = ImmutableList.builder(); for (FilterFunction filterFunction : options.getFilterFunctions()) { Set<ColumnMappingKind> inputKinds = getInputKinds(filterFunction); if (!inputKinds.contains(PREFILLED)) { remainingFilterFunctions.add(filterFunction); continue; } if (inputKinds.size() > 1) { throw new UnsupportedOperationException("Filters on a mix of partition and non-partition columns are not supported"); <START> } <END> if (!evaluateFilterFunction(filterFunction)) { filterOnPrefilledValuesFailed = true; close(); break; } } if (filterOnPrefilledValuesFailed) { return true; } this.outputChannels = Arrays.copyOf(options.getOutputChannels(), options.getOutputChannels().length); int[] internalChannels = options.getInternalChannels(); int[] outputChannels = options.getOutputChannels(); for (int i = 0; i < internalChannels.length; i++) { ColumnMapping columnMapping = columnMappings.get(i); if (columnMapping.getKind() != REGULAR && columnMapping.getKind() != INTERIM) { internalChannels[i] = -1; if (i < outputChannels.length) { outputChannels[i] = -1; } } } filterAndProjectPushedDown = delegate.pushdownFilterAndProjection( new PageSourceOptions( internalChannels, outputChannels, options.getReusePages(), remainingFilterFunctions.build().toArray(new FilterFunction[0]), options.getReorderFilters(), options.getTargetBytes(), options.getAriaFlags())); return filterAndProjectPushedDown; }</code><technical_language>I clear if this factored out methods: 1) pushdownFilterAndProjectionToPartitionColumns (or similar name) 2) A method extract out PageSourceOptions delegate call method 1, get result method 2, send delegate</technical_language>

Target:
public boolean pushdownFilterAndProjection(PageSourceOptions options) { List<FilterFunction> remainingFilterFunctions = pushdownFilterOnPrefilledColumns(options); if (filterOnPrefilledValuesFailed) { return true; } this.outputChannels = Arrays.copyOf(options.getOutputChannels(), options.getOutputChannels().length); filterAndProjectPushedDown = delegate.pushdownFilterAndProjection(createPageSourceOptionsForDelegate(options, remainingFilterFunctions)); return filterAndProjectPushedDown; }