auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public AuditLogBuilder causedByCurrentUser() { UserInfo user = UserContext.getCurrentUser(); return causedByUser(user.getUserId(), user.getUserName()).forTenant(user.getTenantId(), user.getTenantName()); }

Target:
public AuditLogBuilder causedByCurrentUser() { UserInfo user = UserContext.getCurrentUser(); return causedByUser(user.getUserId(), user.getUserName()); }
Source:
private void notifyStatus(final Task task, final TaskStatus taskStatus) { giant.lock(); try { Preconditions.checkNotNull(task, "task"); Preconditions.checkNotNull(taskStatus, "status"); Preconditions.checkState(active, "Queue is not active!"); Preconditions.checkArgument( task.getId().equals(taskStatus.getId()), "Mismatching task ids[%s/%s]", task.getId(), taskStatus.getId() ); try { taskRunner.shutdown(task.getId()); } catch (Exception e) { log.warn(e, "TaskRunner failed to cleanup task after completion: %s", task.getId()); } int removed = 0; for (int i = tasks.size() - 1; i >= 0; i--) { if (tasks.get(i).getId().equals(task.getId())) { removed++; taskLockbox.remove(tasks.get(i)); tasks.remove(i); break; } } if (removed == 0) { log.warn("Unknown task completed: %s", task.getId()); } else if (removed > 1) { log.makeAlert("Removed multiple copies of task").addData("count", removed).addData("task", task.getId()).emit(); } taskFutures.remove(task.getId()); if (removed > 0) { try { final Optional<TaskStatus> previousStatus = taskStorage.getStatus(task.getId()); if (!previousStatus.isPresent() || !previousStatus.get().isRunnable()) { log.makeAlert("Ignoring notification for already-complete task").addData("task", task.getId()).emit(); } else { taskStorage.setStatus(taskStatus); taskLockbox.unlock(task); log.info("Task done: %s", task); managementMayBeNecessary.signalAll(); } } catch (Exception e) { log.makeAlert(e, "Failed to persist status for task") .addData("task", task.getId()) .addData("statusCode", taskStatus.getStatusCode()) .emit(); } } } finally { giant.unlock(); } }

Target:
private void notifyStatus(final Task task, final TaskStatus taskStatus) { giant.lock(); try { Preconditions.checkNotNull(task, "task"); Preconditions.checkNotNull(taskStatus, "status"); Preconditions.checkState(active, "Queue is not active!"); Preconditions.checkArgument( task.getId().equals(taskStatus.getId()), "Mismatching task ids[%s/%s]", task.getId(), taskStatus.getId() ); try { taskRunner.shutdown(task.getId()); } catch (Exception e) { log.warn(e, "TaskRunner failed to cleanup task after completion: %s", task.getId()); } int removed = 0; for (int i = tasks.size() - 1; i >= 0; i--) { if (tasks.get(i).getId().equals(task.getId())) { removed++; removeTaskInternal(tasks.get(i)); break; } } if (removed == 0) { log.warn("Unknown task completed: %s", task.getId()); } else if (removed > 1) { log.makeAlert("Removed multiple copies of task").addData("count", removed).addData("task", task.getId()).emit(); } taskFutures.remove(task.getId()); if (removed > 0) { try { final Optional<TaskStatus> previousStatus = taskStorage.getStatus(task.getId()); if (!previousStatus.isPresent() || !previousStatus.get().isRunnable()) { log.makeAlert("Ignoring notification for already-complete task").addData("task", task.getId()).emit(); } else { taskStorage.setStatus(taskStatus); log.info("Task done: %s", task); managementMayBeNecessary.signalAll(); } } catch (Exception e) { log.makeAlert(e, "Failed to persist status for task") .addData("task", task.getId()) .addData("statusCode", taskStatus.getStatusCode()) .emit(); } } } finally { giant.unlock(); } }
Source:
private void submitSearch(@Nullable final String query, boolean delayed) { if (delayed) { mHandler.postDelayed(new Runnable() { @Override public void run() { if (StringUtils.equals(query, getSearchQuery())) { submitSearch(query, false); } } }, 250); } else { clearSearchResults(); if (shouldSearch()) { fetchPlugins(PluginListType.SEARCH, false); } else { mSearchPluginsListStatus.setValue(PluginListStatus.DONE); } } }

Target:
protected void submitSearch(@Nullable final String query, boolean delayed) { if (delayed) { mHandler.postDelayed(new Runnable() { @Override public void run() { if (StringUtils.equals(query, getSearchQuery())) { submitSearch(query, false); } } }, 250); } else { clearSearchResults(); if (shouldSearch()) { fetchPlugins(PluginListType.SEARCH, false); } else { mSearchPluginsListStatus.setValue(PluginListStatus.DONE); } } }
Source:
public void setInetAddress(String addrString) { try { this.address = InetAddress.getByName(addrString); } catch (UnknownHostException e) { } }

Target:
public void setInetAddress(String addrString) { try { this.address = InetAddress.getByName(addrString); } catch (UnknownHostException e) { this.address = null; logger.warn("could not set address from {}", addrString); } }
Source:
boolean setResourceStatus(JID fullJid, ContactStatus status, boolean sarosSupport) { ContactStatus oldStatus = getStatus(); boolean oldSarosSupport = hasSarosSupport(); resources.stream().filter(r -> compareRawJid(r.fullJid, fullJid)).map(resources::remove); resources.add(new Resource(fullJid, status, sarosSupport)); updateBestResource(); if (oldSarosSupport != hasSarosSupport()) return true; return !getStatus().equals(oldStatus); }

Target:
boolean setResourceStatus(JID fullJid, ContactStatus status, boolean sarosSupport) { ContactStatus oldStatus = getStatus(); boolean oldSarosSupport = hasSarosSupport(); resources.removeIf(r -> compareRawJid(r.fullJid, fullJid)); resources.add(new Resource(fullJid, status, sarosSupport)); updateBestResource(); if (oldSarosSupport != hasSarosSupport()) return true; return !getStatus().equals(oldStatus); }
Source:
public void testGetstorage_domain_by_type_for_storagePoolId() { StorageDomain result = dao.getStorageDomainByTypeAndPool(Guid.createGuidFromString("6d849ebf-755f-4552-ad09-9a090cda105d"), StorageDomainType.Master); assertNotNull(result); assertGetResult(result); }

Target:
public void testGetstorage_domain_by_type_for_storagePoolId() { StorageDomain result = dao.getStorageDomainByTypeAndPool(new Guid("6d849ebf-755f-4552-ad09-9a090cda105d"), StorageDomainType.Master); assertNotNull(result); assertGetResult(result); }
Source:
public int getMaximumSize() { return 1; }

Target:
public int getMaximumSize() { return 8; }
Source:
public void testProhibitRenameOverExistingNode() throws Exception { final String NOTE = "Rename node to name of another node should fail."; Node nodeA = j.createSlave("nodeA", null, null); Node nodeB = j.createSlave("nodeB", null, null); WebClient wc = j.createWebClient(); HtmlForm form = wc.getPage(nodeB, "configure").getFormByName("config"); form.getInputByName("_.name").setValueAttribute("nodeA"); try { j.submit(form); fail(NOTE); } catch (FailingHttpStatusCodeException e) { assertThat(NOTE, e.getStatusCode(), equalTo(400)); } }

Target:
public void testProhibitRenameOverExistingNode() throws Exception { final String NOTE = "Rename node to name of another node should fail."; Node nodeA = j.createSlave("nodeA", null, null); Node nodeB = j.createSlave("nodeB", null, null); WebClient wc = j.createWebClient(); HtmlForm form = wc.getPage(nodeB, "configure").getFormByName("config"); form.getInputByName("_.name").setValueAttribute("nodeA"); try { j.submit(form); fail(NOTE); } catch (FailingHttpStatusCodeException e) { assertThat(NOTE, e.getStatusCode(), equalTo(400)); assertThat(NOTE, e.getResponse().getContentAsString(), containsString("Slave called ‘nodeA’ already exists")); } }
Source:
protected void checkFileConfiguration() throws RuntimeConfigurationError { VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(VfsUtilCore.pathToUrl(getFilePath())); if (file == null) { String relativePath = FileUtil.join(getWorkingDirectory(), getFilePath()); file = VirtualFileManager.getInstance().findFileByUrl(VfsUtilCore.pathToUrl(relativePath)); if (file == null) throw new RuntimeConfigurationError("Main file is not specified"); } PsiFile psiFile = PsiManager.getInstance(getProject()).findFile(file); if (psiFile == null || !(psiFile instanceof GoFile)) { throw new RuntimeConfigurationError("Main file is invalid"); } if (!GoRunUtil.isMainGoFile(psiFile)) { throw new RuntimeConfigurationError("Main file has non-main package or doesn't contain main function"); } }

Target:
protected void checkFileConfiguration() throws RuntimeConfigurationError { VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(VfsUtilCore.pathToUrl(getFilePath())); if (file == null) { String path = FileUtil.join(getWorkingDirectory(), getFilePath()); file = VirtualFileManager.getInstance().findFileByUrl(VfsUtilCore.pathToUrl(path)); if (file == null) throw new RuntimeConfigurationError("Main file is not specified"); } PsiFile psiFile = PsiManager.getInstance(getProject()).findFile(file); if (psiFile == null || !(psiFile instanceof GoFile)) { throw new RuntimeConfigurationError("Main file is invalid"); } if (!GoRunUtil.isMainGoFile(psiFile)) { throw new RuntimeConfigurationError("Main file has non-main package or doesn't contain main function"); } }
Source:
protected Serializable doCreate(final Session session) { UUID sessionId = UUID.randomUUID(); assignSessionId(session, sessionId.toString()); jdbcSessionSqlDao.create(new SessionModelDao(session)); return sessionId; }

Target:
protected Serializable doCreate(final Session session) { final UUID sessionId = UUIDs.randomUUID(); assignSessionId(session, sessionId.toString()); jdbcSessionSqlDao.create(new SessionModelDao(session)); return sessionId; }
Source:
protected void setTreeChecked(Object treeElement, boolean state) { if (treeElement.equals(currentTreeSelection)) { listViewer.setAllChecked(state); } if (state) { List listItemsChecked = new ArrayList(); java.util.Collections.addAll(listItemsChecked, listContentProvider.getElements(treeElement)); checkedStateStore.put(treeElement, listItemsChecked); } else { checkedStateStore.remove(treeElement); } setWhiteChecked(treeElement, state); treeViewer.setChecked(treeElement, state); treeViewer.setGrayed(treeElement, false); for (Object child : treeContentProvider.getChildren(treeElement)) { setTreeChecked(child, state); } }

Target:
protected void setTreeChecked(Object treeElement, boolean state) { if (treeElement.equals(currentTreeSelection)) { listViewer.setAllChecked(state); } if (state) { List listItemsChecked = new ArrayList(Arrays.asList(listContentProvider.getElements(treeElement))); checkedStateStore.put(treeElement, listItemsChecked); } else { checkedStateStore.remove(treeElement); } setWhiteChecked(treeElement, state); treeViewer.setChecked(treeElement, state); treeViewer.setGrayed(treeElement, false); for (Object child : treeContentProvider.getChildren(treeElement)) { setTreeChecked(child, state); } }
Source:
public void testMarkerWithSpaces() throws IOException, SignatureException, XmlProcessingException { final String bucketName = "marker_with_spaces"; final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); try { helpers.ensureBucketExists(bucketName); final List<Ds3Object> objects = Lists.newArrayList( new Ds3Object("obj1_no_spaces.txt", 1024), new Ds3Object("obj2_no_spaces.txt", 1024), new Ds3Object("obj3 has spaces.txt", 1024), new Ds3Object("obj4 also has spaces.txt", 1024)); final Ds3ClientHelpers.Job putJob = helpers.startWriteJob(bucketName, objects); putJob.transfer(new Ds3ClientHelpers.ObjectChannelBuilder() { @Override public SeekableByteChannel buildChannel(String key) throws IOException { final byte[] randomData = IOUtils.toByteArray(new RandomDataInputStream(120, 1024)); final ByteBuffer randomBuffer = ByteBuffer.wrap(randomData); final ByteArraySeekableByteChannel channel = new ByteArraySeekableByteChannel(1024); channel.write(randomBuffer); return channel; } }); final Iterable<Contents> objs = helpers.listObjects(bucketName, null, "obj3 has spaces.txt"); boolean foundObj4 = false; for( Contents obj : objs ) { LOG.info("marker with spaces name: " + obj.getKey()); if (obj.getKey().equals("obj4 also has spaces.txt")) foundObj4 = true; LOG.info("marker with spaces size: " + obj.getSize()); } assertTrue(Iterables.size(objs) == 1); assertTrue(foundObj4); } finally { Util.deleteAllContents(client, bucketName); } }

Target:
public void testMarkerWithSpaces() throws IOException, SignatureException, XmlProcessingException { final String bucketName = "marker_with_spaces"; final Ds3ClientHelpers helpers = Ds3ClientHelpers.wrap(client); try { helpers.ensureBucketExists(bucketName); final List<Ds3Object> objects = Lists.newArrayList( new Ds3Object("obj1_no_spaces.txt", 1024), new Ds3Object("obj2_no_spaces.txt", 1024), new Ds3Object("obj3 has spaces.txt", 1024), new Ds3Object("obj4 also has spaces.txt", 1024)); final Ds3ClientHelpers.Job putJob = helpers.startWriteJob(bucketName, objects); final Iterable<Contents> objs = helpers.listObjects(bucketName, null, "obj3 has spaces.txt"); boolean foundObj4 = false; for (final Contents obj : objs) { LOG.info("marker with spaces name: " + obj.getKey()); if (obj.getKey().equals("obj4 also has spaces.txt")) foundObj4 = true; LOG.info("marker with spaces size: " + obj.getSize()); } assertTrue(Iterables.size(objs) == 1); assertTrue(foundObj4); final CancelJobResponse cancelJobResponse = client.cancelJob(new CancelJobRequest(putJob.getJobId())); assertEquals(204, cancelJobResponse.getStatusCode()); } finally { Util.deleteAllContents(client, bucketName); } }
Source:
private HashSet determineModelOutputIdsWithoutViews(Set<Integer> rowIds, Set<Integer> viewIds) { HashSet<Integer> result = new HashSet(); for (Integer id : viewIds) { if (rowIds.contains(id)) { log.info("View already exists for model_output_id: " + id); } else { result.add(id); log.info("Will create two views for each model_output_id: " + id); } } log.info("Found: " + result.size()+ " model_output_ids that will require views to be created."); return result; }

Target:
private HashSet determineModelOutputIdsWithoutViews(Set<Integer> rowIds, Set<Integer> viewIds) { HashSet<Integer> result = new HashSet(); for (Integer id : rowIds) { if (viewIds.contains(id)) { log.info("View already exists for model_output_id: " + id); } else { result.add(id); log.info("Will create two views for each model_output_id: " + id); } } log.info("Found: " + result.size()+ " model_output_ids that will require views to be created."); return result; }
Source:
private void setup(String propName, List<T> defaultValue, Splitter splitter) { this.defaultValues = (defaultValue == null ? null : Collections.unmodifiableList(new ArrayList<T>(defaultValue))); this.splitter = splitter; delegate = DynamicPropertyFactory.getInstance().getStringProperty(propName, null); load(); Runnable callback = new Runnable() { @Override public void run() { propertyChangedInternal(); } }; delegate.addCallback(callback); callbackList.add(callback); }

Target:
private void setup(String propName, List<T> defaultValue, Splitter splitter) { this.defaultValues = (defaultValue == null ? null : Collections.unmodifiableList(new ArrayList<T>(defaultValue))); this.splitter = splitter; delegate = DynamicPropertyFactory.getInstance().getStringProperty(propName, null); load(); Runnable callback = new Runnable() { @Override public void run() { propertyChangedInternal(); } }; delegate.addCallback(callback); }
Source:
public static FlowParameters getFlowParameters(List<String> providerIds) { List<IdpConfig> idpConfigs = new ArrayList<>(); for (String providerId : providerIds) { switch (providerId) { case GoogleAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.GoogleBuilder().build()); break; case FacebookAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.FacebookBuilder().build()); break; case TwitterAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.TwitterBuilder().build()); break; case EmailAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.EmailBuilder().build()); break; case PhoneAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.PhoneBuilder().build()); break; default: throw new IllegalArgumentException("Unknown provider: " + providerId); } } return new FlowParameters( FIREBASE_APP_NAME, idpConfigs, AuthUI.getDefaultTheme(), AuthUI.NO_LOGO, null, null, true, true); }

Target:
public static FlowParameters getFlowParameters(List<String> providerIds) { List<IdpConfig> idpConfigs = new ArrayList<>(); for (String providerId : providerIds) { switch (providerId) { case GoogleAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.GoogleBuilder().build()); break; case FacebookAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.FacebookBuilder().build()); break; case TwitterAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.TwitterBuilder().build()); break; case EmailAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.EmailBuilder().build()); break; case PhoneAuthProvider.PROVIDER_ID: idpConfigs.add(new IdpConfig.PhoneBuilder().build()); break; default: throw new IllegalArgumentException("Unknown provider: " + providerId); } } return new FlowParameters( FirebaseApp.DEFAULT_APP_NAME, idpConfigs, AuthUI.getDefaultTheme(), AuthUI.NO_LOGO, null, null, true, true); }
Source:
public static void addConfiguredSecurityProviders(Map<String, ?> configs) { String securityProviderClassesStr = (String) configs.get(SecurityConfig.SECURITY_PROVIDERS_CONFIG); if (securityProviderClassesStr == null || securityProviderClassesStr.equals("")) { return; } try { String[] securityProviderClasses = securityProviderClassesStr.replaceAll("\\s+", "").split(","); for (int index = 0; index < securityProviderClasses.length; index++) { SecurityProviderCreator securityProviderCreator = (SecurityProviderCreator) Class.forName(securityProviderClasses[index]).newInstance(); securityProviderCreator.configure(configs); Security.insertProviderAt(securityProviderCreator.getProvider(), index + 1); } } catch (ClassCastException e) { LOGGER.error("Generator provided through " + SecurityConfig.SECURITY_PROVIDERS_CONFIG + " are expected to be sub-classes of SecurityProviderCreator"); } catch (ClassNotFoundException cnfe) { LOGGER.error("Unrecognized security provider class", cnfe); } catch (IllegalAccessException | InstantiationException e) { LOGGER.error("Unexpected implementation of security provider class", e); } }

Target:
public static void addConfiguredSecurityProviders(Map<String, ?> configs) { String securityProviderClassesStr = (String) configs.get(SecurityConfig.SECURITY_PROVIDERS_CONFIG); if (securityProviderClassesStr == null || securityProviderClassesStr.equals("")) { return; } try { String[] securityProviderClasses = securityProviderClassesStr.replaceAll("\\s+", "").split(","); for (int index = 0; index < securityProviderClasses.length; index++) { SecurityProviderCreator securityProviderCreator = (SecurityProviderCreator) Class.forName(securityProviderClasses[index]).newInstance(); securityProviderCreator.configure(configs); Security.insertProviderAt(securityProviderCreator.getProvider(), index + 1); } } catch (ClassCastException e) { LOGGER.error("Creators provided through " + SecurityConfig.SECURITY_PROVIDERS_CONFIG + " are expected to be sub-classes of SecurityProviderCreator"); } catch (ClassNotFoundException cnfe) { LOGGER.error("Unrecognized security provider creator class", cnfe); } catch (IllegalAccessException | InstantiationException e) { LOGGER.error("Unexpected implementation of security provider creator class", e); } }
Source:
protected void verifyAppStarted(String appFile) throws MojoExecutionException { if (shouldValidateAppStart()) { String appName; if (getAppsDirectory().equals("apps")) { ServerConfigDocument scd = null; File serverXML = new File(serverDirectory, "server.xml"); if (serverXML != null && serverXML.exists()) { try { scd = ServerConfigDocument.getInstance(CommonLogger.getInstance(), serverXML, configDirectory, bootstrapPropertiesFile, bootstrapProperties, serverEnvFile, false); } catch (Exception e) { log.warn(e.getLocalizedMessage()); log.debug(e); } } appName = scd.findNameForLocation(appFile); } else { appName = appFile.substring(0, appFile.lastIndexOf('.')); } ServerTask serverTask = initializeJava(); if (serverTask.waitForStringInLog(START_APP_MESSAGE_REGEXP + appName, timeout * 1000, new File(new File(outputDirectory, serverName), "logs/messages.log")) == null) { throw new MojoExecutionException(MessageFormat.format(messages.getString("error.deploy.fail"), appName)); } } }

Target:
protected void verifyAppStarted(String appFile) throws MojoExecutionException { if (shouldValidateAppStart()) { String appName = appFile.substring(0, appFile.lastIndexOf('.')); if (getAppsDirectory().equals("apps")) { ServerConfigDocument scd = null; File serverXML = new File(serverDirectory, "server.xml"); try { scd = ServerConfigDocument.getInstance(CommonLogger.getInstance(), serverXML, configDirectory, bootstrapPropertiesFile, bootstrapProperties, serverEnvFile, false); appName = scd.findNameForLocation(appFile); } catch (Exception e) { log.warn(e.getLocalizedMessage()); log.debug(e); } } ServerTask serverTask = initializeJava(); if (serverTask.waitForStringInLog(START_APP_MESSAGE_REGEXP + appName, timeout * 1000, new File(new File(outputDirectory, serverName), "logs/messages.log")) == null) { throw new MojoExecutionException(MessageFormat.format(messages.getString("error.deploy.fail"), appName)); } } }
Source:
public final CompletionStage<Void> wrapEntryForReading(InvocationContext ctx, Object key, int segment, boolean isOwner) { if (!isOwner && !isL1Enabled) { return CompletableFutures.completedNull(); } CompletionStage<Void> returnedStage = CompletableFutures.completedNull(); CacheEntry cacheEntry = getFromContext(ctx, key); if (cacheEntry == null) { InternalCacheEntry readEntry = getFromContainer(key, segment); CompletionStage<Boolean> expiredStage = null; if (readEntry == null) { if (isOwner) { cacheEntry = NullCacheEntry.getInstance(); } } else if (isOwner || readEntry.isL1Entry()) { cacheEntry = readEntry; expiredStage = handlePossibleExpiredEntry(readEntry, false); } if (cacheEntry != null) { if (expiredStage != null) { if (!CompletionStages.isCompletedSuccessfully(expiredStage)) { CacheEntry finalEntry = cacheEntry; returnedStage = expiredStage.thenApply(expired -> { if (expired == Boolean.FALSE) { addReadEntryToContext(ctx, finalEntry, key); } else if (isOwner) { addReadEntryToContext(ctx, NullCacheEntry.getInstance(), key); } return null; }); } else { Boolean expired = CompletionStages.join(expiredStage); if (expired == Boolean.FALSE) { addReadEntryToContext(ctx, cacheEntry, key); } else if (isOwner) { addReadEntryToContext(ctx, NullCacheEntry.getInstance(), key); } } } else { addReadEntryToContext(ctx, cacheEntry, key); } } } return returnedStage; }

Target:
public final CompletionStage<Void> wrapEntryForReading(InvocationContext ctx, Object key, int segment, boolean isOwner) { if (!isOwner && !isL1Enabled) { return CompletableFutures.completedNull(); } CompletionStage<Void> returnedStage = CompletableFutures.completedNull(); CacheEntry cacheEntry = getFromContext(ctx, key); if (cacheEntry == null) { InternalCacheEntry readEntry = getFromContainer(key, segment); if (readEntry == null) { if (isOwner) { addReadEntryToContext(ctx, NullCacheEntry.getInstance(), key); } } else if (isOwner || readEntry.isL1Entry()) { CompletionStage<Boolean> expiredStage = handlePossibleExpiredEntry(readEntry, false); if (expiredStage != null) { if (CompletionStages.isCompletedSuccessfully(expiredStage)) { Boolean expired = CompletionStages.join(expiredStage); handleExpiredEntryContextAddition(expired, ctx, readEntry, key, isOwner); } else { returnedStage = expiredStage.thenApply(expired -> { handleExpiredEntryContextAddition(expired, ctx, readEntry, key, isOwner); return null; }); } } else { addReadEntryToContext(ctx, readEntry, key); } } } return returnedStage; }
Source:
private BuildConfig configAtSha(String name, String sha, GitInfo gitInfo) throws IOException { LOG.info("Trying to fetch current config at sha: {}", sha); GitHub gitHub = gitHubFor(gitInfo); GHRepository repository = gitHub.getRepository(gitInfo.getFullRepositoryName()); GHContent configContent = repository.getFileContent(".blazar.yaml", gitInfo.getBranch()); LOG.info("Found config at hubspot.build/%s ".format(name)); return objectMapper.readValue(yamlFactory.createParser(configContent.getContent()), BuildConfig.class); }

Target:
private BuildConfig configAtSha(String name, String sha, GitInfo gitInfo) throws IOException { LOG.info("Trying to fetch current config at sha: in repo: {}", sha, gitInfo.getFullRepositoryName()); GitHub gitHub = gitHubFor(gitInfo); GHRepository repository = gitHub.getRepository(gitInfo.getFullRepositoryName()); String configPath = ".blazar.yaml"; try { GHContent configContent = repository.getFileContent(configPath, sha); LOG.info("Found config at {}", configPath); return objectMapper.readValue(yamlFactory.createParser(configContent.getContent()), BuildConfig.class); } catch (FileNotFoundException e) { LOG.info("No blazar config file found for project using default values", name); return BuildConfig.makeDefaultBuildConfig(); } }
Source:
protected String[] stringTagsAt(int pos) { pos -= leftWindow(); if ((pos < 0) || (pos >= size)) { return naTagArr; } if (originalTags != null) { final String orig = originalTags.get(pos); if (orig != null) { return new String[] { orig }; } } String[] arr1; String word = sent.get(pos - leftWindow()); int count = maxentTagger.dict.sum(word); if (count == 0 || count < minWordsLockTags) { arr1 = maxentTagger.tags.getOpenTagsArray(); } else { arr1 = maxentTagger.dict.getTags(word); } return maxentTagger.tags.deterministicallyExpandTags(arr1); }

Target:
protected String[] stringTagsAt(int pos) { pos -= leftWindow(); if ((pos < 0) || (pos >= size)) { return naTagArr; } if (originalTags != null) { final String orig = originalTags.get(pos); if (orig != null) { return new String[] { orig }; } } String[] arr1; String word = sent.get(pos); int count = maxentTagger.dict.sum(word); if (count == 0 || count < minWordsLockTags) { arr1 = maxentTagger.tags.getOpenTagsArray(); } else { arr1 = maxentTagger.dict.getTags(word); } return maxentTagger.tags.deterministicallyExpandTags(arr1); }
Source:
public void init() throws APIManagerIntegrationTestException { infraProperties = getDeploymentProperties(); String publisherURL = infraProperties.getProperty(PUBLISHER_URL); String storeURL = infraProperties.getProperty(STORE_URL); String warFileName = "jaxrs_basic"; String warFileLocation = System.getProperty("user.dir") + File.separator+ "src/test/resources" + File.separator + warFileName + ".war"; String serviceEndpoint = "https://localhost:9443/services/"; if (publisherURL == null) { publisherURL = "https://localhost:9443/publisher"; } if (storeURL == null) { storeURL = "https://localhost:9443/store"; } setKeyStoreProperties(); apiPublisher = new APIPublisherRestClient(publisherURL); apiPublisher.login(admin, admin); apiStore = new APIStoreRestClient(storeURL); apiStore.login(admin, admin); try { WebAppDeployUtils.deployWebApp(serviceEndpoint, admin, admin, warFileLocation, warFileName); log.info("WebApp deployed successfully"); } catch (RemoteException | MalformedURLException e) { e.printStackTrace(); } }

Target:
public void init() throws APIManagerIntegrationTestException { String warFileName = "jaxrs_basic"; String warFileLocation = System.getProperty("user.dir") + File.separator+ "src/test/resources" + File.separator + warFileName + ".war"; String serviceEndpoint = "https://localhost:9443/services/"; createUsers(); apiPublisher = new APIPublisherRestClient(publisherURL); apiPublisher.login(apiProvider, "wso2123$"); apiStore = new APIStoreRestClient(storeURL); apiStore.login("APIConsumer", "wso2123$"); try { WebAppDeployUtils.deployWebApp(serviceEndpoint, admin, admin, warFileLocation, warFileName); log.info("WebApp deployed successfully"); } catch (RemoteException | MalformedURLException e) { e.printStackTrace(); } }
Source:
private String publish(KeenProject project, String eventCollection, Map<String, Object> event) throws IOException, URISyntaxException { eventCollection = new URI(null, null, eventCollection,null).getRawPath(); String urlString = String.format(Locale.US, "%s/%s/projects/%s/events/%s", getBaseUrl(), KeenConstants.API_VERSION, project.getProjectId(), eventCollection); URL url = new URL(urlString); return publishObject(project, url, event); }

Target:
private String publish(KeenProject project, String eventCollection, Map<String, Object> event) throws IOException { URL url = createURL(project, eventCollection); if (url == null) { throw new IllegalStateException("URL address is empty"); } return publishObject(project, url, event); }
Source:
public void shouldAlertIfOkObtained() throws Exception { nano.addHandler(new ForbiddenResponse(PROTECTED_PATH)); nano.addHandler(new OkResponse("/." + PROTECTED_PATH)); HttpMessage msg = this.getHttpMessage(PROTECTED_PATH); rule.init(msg, this.parent); rule.scan(); assertThat(alertsRaised, hasSize(1)); Alert alert = alertsRaised.get(0); assertEquals("Bypassing 403", alert.getName()); assertEquals(Alert.RISK_MEDIUM, alert.getRisk()); assertEquals(Alert.CONFIDENCE_MEDIUM, alert.getConfidence()); }

Target:
public void shouldAlertIfOkObtained() throws Exception { nano.addHandler(new ForbiddenResponse(PROTECTED_PATH)); nano.addHandler(new OkResponse("/." + PROTECTED_PATH)); HttpMessage msg = this.getHttpMessage(PROTECTED_PATH); rule.init(msg, this.parent); rule.scan(); assertThat(alertsRaised, hasSize(1)); Alert alert = alertsRaised.get(0); assertEquals("/%2e" + PROTECTED_PATH, alert.getAttack()); assertAlert(alert); }
Source:
protected Dialect getDialect(RolapSchema schema) { Dialect dialect = null; try { if (schema != null && schema.getDialect() != null) { dialect = schema.getDialect(); } else { dialect = createDialect(); } } catch (Exception ignored) { } return dialect; }

Target:
protected Dialect getDialect(RolapSchema schema) { Dialect dialect = null; if (schema != null && schema.getDialect() != null) { dialect = schema.getDialect(); } else { dialect = createDialect(); } return dialect; }
Source:
public NewCourseOutlineAdapter(final Context context, Fragment fragment, final EnrolledCoursesResponse courseData, final IEdxEnvironment environment, DownloadListener listener, boolean isVideoMode, boolean isOnCourseOutline) { this.context = context; this.parentFragment = fragment; this.environment = environment; this.config = environment.getConfig(); this.dbStore = environment.getDatabase(); this.storage = environment.getStorage(); this.courseData = courseData; this.downloadListener = listener; this.isVideoMode = isVideoMode; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); adapterData = new ArrayList(); if (isOnCourseOutline) { if (!isVideoMode) { adapterData.add(new SectionRow(SectionRow.COURSE_CARD, null)); if (courseData.isCertificateEarned() && environment.getConfig().areCertificateLinksEnabled()) { adapterData.add(new SectionRow(SectionRow.COURSE_CERTIFICATE, null, new View.OnClickListener() { @Override public void onClick(View v) { environment.getRouter().showCertificate(context, courseData); } })); } } else { adapterData.add(new SectionRow(SectionRow.BULK_DOWNLOAD, null)); } } getItem(getNonCourseWareItemPlace(SectionRow.BULK_DOWNLOAD)); }

Target:
public NewCourseOutlineAdapter(final Context context, Fragment fragment, final EnrolledCoursesResponse courseData, final IEdxEnvironment environment, DownloadListener listener, boolean isVideoMode, boolean isOnCourseOutline) { this.context = context; this.parentFragment = fragment; this.environment = environment; this.config = environment.getConfig(); this.dbStore = environment.getDatabase(); this.storage = environment.getStorage(); this.courseData = courseData; this.downloadListener = listener; this.isVideoMode = isVideoMode; inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); adapterData = new ArrayList(); if (isOnCourseOutline) { if (isVideoMode) { adapterData.add(new SectionRow(SectionRow.BULK_DOWNLOAD, null)); } else { adapterData.add(new SectionRow(SectionRow.COURSE_CARD, null)); if (courseData.isCertificateEarned() && environment.getConfig().areCertificateLinksEnabled()) { adapterData.add(new SectionRow(SectionRow.COURSE_CERTIFICATE, null, new View.OnClickListener() { @Override public void onClick(View v) { environment.getRouter().showCertificate(context, courseData); } })); } } } }
Source:
public void set(long index, Block value) { Block currentValue = array.get(index); if (currentValue != null) { long headerSize = currentValue.getRetainedSizeInBytesBreakdown(decrementVisitor); sizeOfBlocks -= headerSize; } if (value != null) { long headerSize = value.getRetainedSizeInBytesBreakdown(incrementVisitor); sizeOfBlocks += headerSize; } array.set(index, value); }

Target:
public void set(long index, Block value) { Block currentValue = array.get(index); if (currentValue != null) { currentValue.retainedBytesForEachPart((object, size) -> { if (currentValue == object) { sizeOfBlocks -= size; return; } if (trackedObjects.decrementReference(object) == 0) { sizeOfBlocks -= size; } }); } if (value != null) { value.retainedBytesForEachPart((object, size) -> { if (value == object) { sizeOfBlocks += size; return; } if (trackedObjects.incrementReference(object) == 1) { sizeOfBlocks += size; } }); } array.set(index, value); }
Source:
public void setupTopologyConfigId(long topologyConfigId) { CorfuStoreMetadata.Timestamp timestamp = corfuStore.getTimestamp(); long persistedTopologyConfigId = query(timestamp, LogReplicationMetadataKey.KeyType.TOPOLOGY_CONFIG_ID); if (topologyConfigId <= persistedTopologyConfigId) { log.warn("Skip setupTopologyConfigId. the current topologyConfigId " + topologyConfigId + " is not larger than the persistedTopologyConfigID " + persistedTopologyConfigId); } TxBuilder txBuilder = corfuStore.tx(namespace); for (LogReplicationMetadataKey.KeyType type : LogReplicationMetadataKey.KeyType.values()) { long val = Address.NON_ADDRESS; if (type == LogReplicationMetadataKey.KeyType.TOPOLOGY_CONFIG_ID) { val = topologyConfigId; } if (type != LogReplicationMetadataKey.KeyType.UNRECOGNIZED) { appendUpdate(txBuilder, type, val); } } txBuilder.commit(timestamp); log.info("Update topologyConfigId, new metadata {}", this); }

Target:
public void setupTopologyConfigId(long topologyConfigId) { CorfuStoreMetadata.Timestamp timestamp = corfuStore.getTimestamp(); long persistedTopologyConfigId = query(timestamp, LogReplicationMetadataType.TOPOLOGY_CONFIG_ID); if (topologyConfigId <= persistedTopologyConfigId) { log.warn("Skip setupTopologyConfigId. the current topologyConfigId is not larger than the persistedTopologyConfigID {}", topologyConfigId, persistedTopologyConfigId); return; } TxBuilder txBuilder = corfuStore.tx(NAMESPACE); for (LogReplicationMetadataType type : LogReplicationMetadataType.values()) { long val = Address.NON_ADDRESS; if (type == LogReplicationMetadataType.TOPOLOGY_CONFIG_ID) { val = topologyConfigId; } appendUpdate(txBuilder, type, val); } txBuilder.commit(timestamp); log.info("Update topologyConfigId, new metadata {}", this); }
Source:
public String enableStatistics(String proxyName) throws ProxyAdminException { final Lock lock = getLock(); try { lock.lock(); ProxyService proxy = getSynapseConfiguration().getProxyService(proxyName); if (proxy != null) { if (proxy.getAspectConfiguration() == null) { AspectConfiguration config = new AspectConfiguration(proxyName); config.enableStatistics(); proxy.configure(config); } else { proxy.getAspectConfiguration().enableStatistics(); } CAppArtifactDataService cAppArtifactDataService = ConfigHolder.getInstance(). getcAppArtifactDataService(); if (!cAppArtifactDataService.isArtifactDeployedFromCApp(getTenantId(), ServiceBusConstants.PROXY_SERVICE_TYPE + File.separator + proxyName)) { persistProxyService(proxy); } } else { log.error("Couldn't find the proxy service with name " + proxyName + " to enable statistics"); return FAILED; } if(log.isDebugEnabled()) { log.debug("Enabled statistics on proxy service : " + proxyName); } return SUCCESSFUL; } catch (Exception e) { handleException(log, "Unable to enable statistics for proxy service " + proxyName, e); } finally { lock.unlock(); } return FAILED; }

Target:
public String enableStatistics(String proxyName) throws ProxyAdminException { final Lock lock = getLock(); try { lock.lock(); ProxyService proxy = getSynapseConfiguration().getProxyService(proxyName); if (proxy != null) { if (proxy.getAspectConfiguration() == null) { AspectConfiguration config = new AspectConfiguration(proxyName); config.enableStatistics(); proxy.configure(config); } else { proxy.getAspectConfiguration().enableStatistics(); } CAppArtifactDataService cAppArtifactDataService = ConfigHolder.getInstance(). getcAppArtifactDataService(); if (!cAppArtifactDataService.isArtifactDeployedFromCApp(getTenantId(),getArtifactName(artifactType, proxyName))) { persistProxyService(proxy); } } else { log.error("Couldn't find the proxy service with name " + proxyName + " to enable statistics"); return FAILED; } if(log.isDebugEnabled()) { log.debug("Enabled statistics on proxy service : " + proxyName); } return SUCCESSFUL; } catch (Exception e) { handleException(log, "Unable to enable statistics for proxy service " + proxyName, e); } finally { lock.unlock(); } return FAILED; }
Source:
@Test public void testJsonInsert() { String query = "select json_insert(\"product_name\", '$', 10) from \"product\""; final String expected = "SELECT JSON_INSERT(\"product_name\", '$', 10)\n" + "FROM \"foodmart\".\"product\""; sql(query).ok(expected); }

Target:
@Test public void testJsonInsert() { String query0 = "select json_insert(\"product_name\", '$', 10) from \"product\""; String query1 = "select json_insert(cast(null as varchar), '$', 10, '$', null, '$'," + " '\n\t\n') from \"product\""; final String expected0 = "SELECT JSON_INSERT(\"product_name\", '$', 10)\n" + "FROM \"foodmart\".\"product\""; final String expected1 = "SELECT JSON_INSERT(NULL, '$', 10, '$', NULL, '$', " + "u&'\\000a\\0009\\000a')\nFROM \"foodmart\".\"product\""; sql(query0).ok(expected0); sql(query1).ok(expected1); }
Source:
public static String printLine() { String result = "\n"; for (int i = 0; i < LINE_LENGTH; i++) { result += "-"; } return result + "\n"; }

Target:
public static String printLine() { StringBuilder result = new StringBuilder().append("\n"); for (int i = 0; i < LINE_LENGTH; i++) { result.append("-"); } result.append("\n"); return result.toString(); }
Source:
public void waitForPanelsToCollapse() { List<WebElement> panelBodies = browser.driver.findElements(By.cssSelector("div[id^='panelBodyCollapse-']")); waitForElementsVisibility(panelBodies); ThreadHelper.waitFor(1000); }

Target:
public void waitForPanelsToCollapse() { By panelCollapseSelector = By.cssSelector("div[id^='panelBodyCollapse-']"); waitForElementToDisappear(panelCollapseSelector); }
Source:
public synchronized void notifyTaskFailure(long jobId, long taskId, Throwable t) { Pair<Long, Long> id = new Pair<>(jobId, taskId); TaskInfo taskInfo = mUnfinishedTasks.get(id); taskInfo.setStatus(Status.FAILED); String errorMessage; if (ServerConfiguration.getBoolean(PropertyKey.DEBUG)) { errorMessage = Throwables.getStackTraceAsString(t); } else { errorMessage = t.getMessage(); } taskInfo.setErrorType(ErrorUtils.getErrorType(t)); if (errorMessage != null) { taskInfo.setErrorMessage(errorMessage); } finishTask(id); LOG.info("Task for job failed: {}", taskId, jobId, errorMessage); SAMPLING_LOGGER.info(Throwables.getStackTraceAsString(t)); }

Target:
public synchronized void notifyTaskFailure(long jobId, long taskId, Throwable t) { Pair<Long, Long> id = new Pair<>(jobId, taskId); TaskInfo taskInfo = mUnfinishedTasks.get(id); taskInfo.setStatus(Status.FAILED); String errorMessage; if (ServerConfiguration.getBoolean(PropertyKey.DEBUG)) { errorMessage = Throwables.getStackTraceAsString(t); } else { errorMessage = t.getMessage(); } taskInfo.setErrorType(ErrorUtils.getErrorType(t)); if (errorMessage != null) { taskInfo.setErrorMessage(errorMessage); } finishTask(id); LOG.info("Task for job failed: {}", taskId, jobId, errorMessage); SAMPLING_LOGGER.info("Stack trace for taskId: jobId: : {}", taskId, jobId, Throwables.getStackTraceAsString(t)); }
Source:
protected void mergeOneCommit(final CodeReviewCommit n) throws MergeException { final ThreeWayMerger m; if (destProject.isUseContentMerge()) { m = MergeStrategy.RESOLVE.newMerger(db, true); } else { m = MergeStrategy.SIMPLE_TWO_WAY_IN_CORE.newMerger(db); } try { if (m.merge(new AnyObjectId[] {mergeTip, n})) { writeMergeCommit(m, n); } else { failed(n, CommitMergeStatus.PATH_CONFLICT); } } catch (IOException e) { if (e.getMessage().startsWith("Multiple merge bases for")) { try { failed(n, CommitMergeStatus.CRISS_CROSS_MERGE); } catch (IOException e2) { throw new MergeException("Cannot merge " + n.name(), e); } } else { throw new MergeException("Cannot merge " + n.name(), e); } } }

Target:
protected final void mergeOneCommit(final CodeReviewCommit n) throws MergeException { final ThreeWayMerger m; if (destProject.isUseContentMerge()) { m = MergeStrategy.RESOLVE.newMerger(db, true); } else { m = MergeStrategy.SIMPLE_TWO_WAY_IN_CORE.newMerger(db); } try { if (m.merge(new AnyObjectId[] {mergeTip, n})) { writeMergeCommit(m, n); } else { failed(n, CommitMergeStatus.PATH_CONFLICT); } } catch (IOException e) { if (e.getMessage().startsWith("Multiple merge bases for")) { try { failed(n, CommitMergeStatus.CRISS_CROSS_MERGE); } catch (IOException e2) { throw new MergeException("Cannot merge " + n.name(), e); } } else { throw new MergeException("Cannot merge " + n.name(), e); } } }
Source:
public static DistributedQueryRunner createElasticsearchQueryRunner(EmbeddedElasticsearchNode embeddedElasticsearch, Iterable<TpchTable<?>> tables) throws Exception { DistributedQueryRunner queryRunner = null; try { queryRunner = new DistributedQueryRunner(createSession(), 2); queryRunner.installPlugin(new TpchPlugin()); queryRunner.createCatalog("tpch", "tpch"); embeddedElasticsearch.start(); Map<SchemaTableName, ElasticsearchTableDescription> tableDescriptions = createTableDescriptions(queryRunner.getCoordinator().getMetadata(), tables); installElasticsearchPlugin(queryRunner, tables, tableDescriptions); TestingPrestoClient prestoClient = queryRunner.getClient(); LOG.info("Loading data..."); long startTime = System.nanoTime(); for (TpchTable<?> table : tables) { loadTpchTopic(embeddedElasticsearch, prestoClient, table); } LOG.info("Loading complete in %s", nanosSince(startTime).toString(SECONDS)); return queryRunner; } catch (Exception e) { closeAllSuppress(e, queryRunner, embeddedElasticsearch); throw e; } }

Target:
public static DistributedQueryRunner createElasticsearchQueryRunner(EmbeddedElasticsearchNode embeddedElasticsearch, Iterable<TpchTable<?>> tables) throws Exception { DistributedQueryRunner queryRunner = null; try { queryRunner = DistributedQueryRunner.builder(createSession()) .setNodeCount(NODE_COUNT) .build(); queryRunner.installPlugin(new TpchPlugin()); queryRunner.createCatalog("tpch", "tpch"); embeddedElasticsearch.start(); ElasticsearchTableDescriptionProvider tableDescriptions = createTableDescriptions(queryRunner.getCoordinator().getMetadata(), tables); ElasticsearchConnectorTestFactory testFactory = new ElasticsearchConnectorTestFactory(tableDescriptions); installElasticsearchPlugin(queryRunner, tables, testFactory); TestingPrestoClient prestoClient = queryRunner.getClient(); LOG.info("Loading data..."); long startTime = System.nanoTime(); for (TpchTable<?> table : tables) { loadTpchTopic(embeddedElasticsearch, prestoClient, table); } LOG.info("Loading complete in %s", nanosSince(startTime).toString(SECONDS)); return queryRunner; } catch (Exception e) { closeAllSuppress(e, queryRunner, embeddedElasticsearch); throw e; } }
Source:
public List<String> getRuleChainVisits() { if (xPathRuleQueryNeedsInitialization()) { initXPathRuleQuery(); for (final String nodeName : xpathRuleQuery.getRuleChainVisits()) { super.addRuleChainVisit(nodeName); } } return super.getRuleChainVisits(); }

Target:
public List<String> getRuleChainVisits() { if (xPathRuleQueryNeedsInitialization()) { initXPathRuleQuery(); for (String nodeName : xpathRuleQuery.getRuleChainVisits()) { super.addRuleChainVisit(nodeName); } } return super.getRuleChainVisits(); }
Source:
public String refreshToken() throws Exception { token = flow.getToken(); return token; }

Target:
public String refreshToken() throws OAuthSystemException, OAuthProblemException { if (flow == null) { throw new OAuthSystemException("Oauth flow is null"); } token = flow.getToken(); return token; }
Source:
public DesignDocument get(String id) { final URI uri = buildUri(dbUri).path(id).build(); return client.get(uri, DesignDocument.class); }

Target:
public DesignDocument get(String id) { assertNotEmpty(id, "id"); id = CouchDbUtil.ensureDesignPrefix(id); return db.find(DesignDocument.class, id); }
Source:
public List<Node> getChildren() { return ImmutableList.copyOf(properties); }

Target:
public List<Property> getChildren() { return properties; }
Source:
public static WorkProcessor<Page> mergeSortedPages( List<WorkProcessor<Page>> pageProducers, PageWithPositionComparator comparator, List<Integer> outputChannels, List<Type> outputTypes, BiPredicate<PageBuilder, PageWithPosition> pageBreakPredicate, boolean updateMemoryAfterEveryPosition, AggregatedMemoryContext aggregatedMemoryContext, DriverYieldSignal yieldSignal) { return buildPage(mergeSorted( pageProducers.stream() .map(pageProducer -> pageWithPositions(pageProducer, aggregatedMemoryContext.newLocalMemoryContext())) .collect(toImmutableList()), (firstPageWithPosition, secondPageWithPosition) -> comparator.compareTo( firstPageWithPosition.getPage(), firstPageWithPosition.getPosition(), secondPageWithPosition.getPage(), secondPageWithPosition.getPosition())), outputChannels, outputTypes, pageBreakPredicate, updateMemoryAfterEveryPosition, aggregatedMemoryContext.newLocalMemoryContext(), yieldSignal); }

Target:
public static WorkProcessor<Page> mergeSortedPages( List<WorkProcessor<Page>> pageProducers, PageWithPositionComparator comparator, List<Integer> outputChannels, List<Type> outputTypes, BiPredicate<PageBuilder, PageWithPosition> pageBreakPredicate, boolean updateMemoryAfterEveryPosition, AggregatedMemoryContext aggregatedMemoryContext, DriverYieldSignal yieldSignal) { List<WorkProcessor<PageWithPosition>> pageWithPositionProducers = pageProducers.stream() .map(pageProducer -> pageWithPositions(pageProducer, aggregatedMemoryContext.newLocalMemoryContext())) .collect(toImmutableList()); Comparator<PageWithPosition> pageWithPositionComparator = (firstPageWithPosition, secondPageWithPosition) -> comparator.compareTo( firstPageWithPosition.getPage(), firstPageWithPosition.getPosition(), secondPageWithPosition.getPage(), secondPageWithPosition.getPosition()); return buildPage( mergeSorted(pageWithPositionProducers, pageWithPositionComparator), outputChannels, outputTypes, pageBreakPredicate, updateMemoryAfterEveryPosition, aggregatedMemoryContext.newLocalMemoryContext(), yieldSignal); }