auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void demonstrateTreasureChestIteratorForType(ItemType itemType) { LOGGER.info("------------------------"); LOGGER.info("Item Iterator for ItemType " + itemType + ": "); Iterator itemIterator = TREASURE_CHEST.iterator(itemType); while (itemIterator.hasNext()) { LOGGER.info(itemIterator.next().toString()); } }

Target:
private static void demonstrateTreasureChestIteratorForType(ItemType itemType) { LOGGER.info("------------------------"); LOGGER.info("Item Iterator for ItemType " + itemType + ": "); Iterator<Item> itemIterator = TREASURE_CHEST.iterator(itemType); while (itemIterator.hasNext()) { LOGGER.info(itemIterator.next().toString()); } }
Source:
public List<String> getRecipientsTextDropdown(int qnNumber, int responseNumber) { Select selectElement = new Select(browser.driver.findElement( By.name(Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "-" + qnNumber + "-" + responseNumber))); List<WebElement> optionElements = selectElement.getOptions(); List<String> recipients = new ArrayList<String>(); for (WebElement option : optionElements) { recipients.add(option.getText()); } return recipients; }

Target:
public List<String> getRecipientsTextDropdown(int qnNumber, int responseNumber) { Select selectElement = new Select(browser.driver.findElement( By.name(Const.ParamsNames.FEEDBACK_RESPONSE_RECIPIENT + "-" + qnNumber + "-" + responseNumber))); List<WebElement> optionElements = selectElement.getOptions(); List<String> recipients = new ArrayList<>(); for (WebElement option : optionElements) { recipients.add(option.getText()); } return recipients; }
Source:
public static DevelopersApi api() { HOST = "https://localhost:8443"; ApiClient apiClient = new ApiClient(); apiClient.setBasePath(HOST); apiClient.setVerifyingSsl(false); apiClient.setDebugging(true); return new DevelopersApi(apiClient); }

Target:
public static DevelopersApi api() { ApiClient apiClient = new ApiClient(); apiClient.setBasePath(HOST); apiClient.setVerifyingSsl(false); apiClient.setDebugging(true); return new DevelopersApi(apiClient); }
Source:
private IPageChangingListener onPageChanging(IWizardHandle wizardHandle) { return new IPageChangingListener() { @Override public void handlePageChanging(PageChangingEvent event) { if (event.getCurrentPage() == getPage(wizardHandle)){ if (event.getTargetPage() == null || event.getTargetPage().equals(getPage(wizardHandle).getNextPage())) { String blockedMsg = null; try { if( selectedConnection != null && selectedConnection.canConnect()) { Job connectJob = chooseConnectionComposite.getConnectJob(); WizardUtils.runInWizard( connectJob, new DelegatingProgressMonitor(), getContainer(((WizardPage)handle))); boolean connected = JobUtils.isOk(connectJob.getResult()); if( !connected ) { blockedMsg = connectJob.getResult().getMessage(); } } } catch(Exception e) { blockedMsg = "Error while checking if we can connect to OpenShift Connection: " + e.getMessage(); } if(blockedMsg != null ) { event.doit = false; handle.setMessage(blockedMsg, IMessageProvider.ERROR); } else { handle.setMessage(null, IMessageProvider.NONE); } } if (selectedConnection instanceof Connection) { OpenShiftServerTaskModelAccessor.set((Connection) selectedConnection, getTaskModel()); } } } }; }

Target:
private IPageChangingListener onPageChanging(IWizardHandle wizardHandle) { return new IPageChangingListener() { @Override public void handlePageChanging(PageChangingEvent event) { if (event.getCurrentPage() == getPage(wizardHandle)){ if (event.getTargetPage() == null || event.getTargetPage().equals(getPage(wizardHandle).getNextPage())) { String blockedMsg = null; try { blockedMsg = runConnectionJob(); } catch(Exception e) { blockedMsg = "Error while checking if we can connect to OpenShift Connection: " + e.getMessage(); } event.doit = (blockedMsg == null); handle.setMessage(blockedMsg, (blockedMsg == null ? IMessageProvider.NONE : IMessageProvider.ERROR)); } if (selectedConnection instanceof Connection) { OpenShiftServerTaskModelAccessor.set((Connection) selectedConnection, getTaskModel()); } } } }; }
Source:
public void hashCode_withoutAddress() throws Exception { assertEquals(0, Address.parse("name only").length); }

Target:
public void hashCode_withoutAddress() throws Exception { Address[] addresses = Address.parse("name only"); assertEquals(0, addresses.length); }
Source:
public Map<String, String> provide(Network network, String networkId, Collection<String> subnetIds) { Map<String, String> filter = new HashMap<>(); if (network.getAttributes() != null && network.getAttributes().getMap() != null) { Map<String, Object> attributes = network.getAttributes().getMap(); String sharedProjectId = (String) attributes.get("sharedProjectId"); filter.put("sharedProjectId", sharedProjectId); filter.put("networkId", networkId); buildSubnetIdFilter(subnetIds, filter); } return filter; }

Target:
public Map<String, String> provide(Network network, String networkId, Collection<String> subnetIds) { Map<String, String> filter = new HashMap<>(); if (network.getAttributes() != null && network.getAttributes().getMap() != null) { Map<String, Object> attributes = network.getAttributes().getMap(); String sharedProjectId = (String) attributes.get(SHARED_PROJECT_ID); if (!Strings.isNullOrEmpty(sharedProjectId)) { filter.put(SHARED_PROJECT_ID, sharedProjectId); } } filter.put("networkId", networkId); filter.putAll(buildSubnetIdFilter(subnetIds)); return filter; }
Source:
public Boolean call() throws Exception { return Files.toString(jmxTransAppStdOut, Charset.forName("UTF-8")).contains(value); }

Target:
public Boolean call() throws Exception { return Files.toString(jmxTransAppStdOut, Charsets.UTF_8).contains(value); }
Source:
private void setLbToPendingUpdate(LoadBalancer lb) throws EntityNotFoundException, UnprocessableEntityException, ImmutableEntityException { if (!loadBalancerRepository.testAndSetStatus(lb.getAccountId(), lb.getId(), LoadBalancerStatus.PENDING_UPDATE, false)) { String message = StringHelper.immutableLoadBalancer(lb); LOG.warn(message); throw new ImmutableEntityException(message); } else { loadBalancerStatusHistoryService.save(lb.getAccountId(), lb.getId(), LoadBalancerStatus.PENDING_UPDATE); } }

Target:
private void setLbToPendingUpdate(LoadBalancer lb) throws EntityNotFoundException, UnprocessableEntityException, ImmutableEntityException { lb = loadBalancerRepository.getById(lb.getId()); if (!loadBalancerRepository.testAndSetStatus(lb.getAccountId(), lb.getId(), LoadBalancerStatus.PENDING_UPDATE, false)) { String message = StringHelper.immutableLoadBalancer(lb); LOG.warn(message); throw new ImmutableEntityException(message); } else { loadBalancerStatusHistoryService.save(lb.getAccountId(), lb.getId(), LoadBalancerStatus.PENDING_UPDATE); } }
Source:
private List<Pair<Guid, Boolean>> disconnectOrConnectHostsInUpToDomainStorageServer(ActionType actionType) { List<VDS> hostsInStatusUp = getAllRunningVdssInPool(); List<Callable<Pair<Guid, Boolean>>> callables = new LinkedList<>(); for (final VDS vds : hostsInStatusUp) { callables.add(() -> { Pair<Guid, Boolean> toReturn = new Pair<>(vds.getId(), Boolean.FALSE); try { boolean connectResult = false; switch (actionType) { case CONNECT: connectResult = StorageHelperDirector.getInstance().getItem(getStorageDomain().getStorageType()) .connectStorageToDomainByVdsId(getStorageDomain(), vds.getId()); break; case DISCONNECT: StorageHelperDirector.getInstance().getItem(getStorageDomain().getStorageType()) .disconnectStorageFromDomainByVdsId(getStorageDomain(), vds.getId()); } toReturn.setSecond(connectResult); } catch (RuntimeException e) { log.error("Failed to host '{}' to storage domain (name '{}', id '{}'): {}", actionType.actionDescription, vds.getName(), getStorageDomain().getName(), getStorageDomain().getId(), e.getMessage()); log.debug("Exception", e); } return toReturn; }); } return ThreadPoolUtil.invokeAll(callables); }

Target:
private List<Pair<Guid, Boolean>> disconnectOrConnectHostsInUpToDomainStorageServer(ActionType actionType) { List<VDS> hostsInStatusUp = getAllRunningVdssInPool(); List<Callable<Pair<Guid, Boolean>>> callables = new LinkedList<>(); for (final VDS vds : hostsInStatusUp) { callables.add(() -> { Pair<Guid, Boolean> toReturn = new Pair<>(vds.getId(), Boolean.FALSE); try { boolean connectResult = false; switch (actionType) { case CONNECT: connectResult = StorageHelperDirector.getInstance().getItem(getStorageDomain().getStorageType()) .connectStorageToDomainByVdsId(getStorageDomain(), vds.getId()); break; case DISCONNECT: connectResult = StorageHelperDirector.getInstance().getItem(getStorageDomain().getStorageType()) .disconnectStorageFromDomainByVdsId(getStorageDomain(), vds.getId()); } toReturn.setSecond(connectResult); } catch (RuntimeException e) { log.error("Failed to host '{}' to storage domain (name '{}', id '{}'): {}", actionType.actionDescription, vds.getName(), getStorageDomain().getName(), getStorageDomain().getId(), e.getMessage()); log.debug("Exception", e); } return toReturn; }); } return ThreadPoolUtil.invokeAll(callables); }
Source:
ConditionalStreamListenerHandler(Expression condition, StreamListenerMessageHandler streamListenerMessageHandler) { this.condition = condition; this.streamListenerMessageHandler = streamListenerMessageHandler; }

Target:
ConditionalStreamListenerHandler(Expression condition, StreamListenerMessageHandler streamListenerMessageHandler) { Assert.notNull(streamListenerMessageHandler, "the message handler cannot be null"); Assert.isTrue(condition == null || streamListenerMessageHandler.isVoid(), "cannot specify a condition and a return value at the same time"); this.condition = condition; this.streamListenerMessageHandler = streamListenerMessageHandler; }
Source:
public void init() { infraProperties = getDeploymentProperties(); publisherURL = infraProperties.getProperty(PUBLISHER_URL); storeURL = infraProperties.getProperty(STORE_URL); if (publisherURL == null) { publisherURL = "https://localhost:9443/publisher"; } if (storeURL == null) { storeURL = "https://localhost:9443/store"; } setKeyStoreProperties(); apiPublisher = new APIPublisherRestClient(publisherURL); }

Target:
public void init() { apiPublisher = new APIPublisherRestClient(publisherURL); }
Source:
public String getPrivateLink(Context context, Account account) { String parsedRemoteId = mRemoteId.substring(0, Math.min(mRemoteId.length(), 8)); String fileId = Integer.valueOf(parsedRemoteId).toString(); String privateLink = null; try { String baseUrl = AccountUtils.getBaseUrlForAccount(context, account); if (baseUrl == null) throw new AccountUtils.AccountNotFoundException(account, "Account not found", null); privateLink = baseUrl + AccountUtils.INDEX_PATH + FILES_PATH + "/" + fileId; } catch (AccountUtils.AccountNotFoundException e) { Log_OC.d(TAG, e.toString()); } return privateLink; }

Target:
public String getPrivateLink(Context context, Account account) { String parsedRemoteId = mRemoteId.substring(0, FILE_ID_LENGTH); String fileId = Integer.valueOf(parsedRemoteId).toString(); String privateLink = null; try { String baseUrl = AccountUtils.getBaseUrlForAccount(context, account); if (baseUrl == null) throw new AccountUtils.AccountNotFoundException(account, "Account not found", null); privateLink = baseUrl + PRIVATE_LINK_PATH + fileId; } catch (AccountUtils.AccountNotFoundException e) { Log_OC.d(TAG, e.toString()); } return privateLink; }
Source:
public void rollsBackTransaction() { final TestEntity testEntity = new TestEntity("description"); daoTestRule.inTransaction(() -> persist(testEntity)); testEntity.setDescription("newDescription"); try { daoTestRule.inTransaction(() -> { persist(testEntity); persist(new TestEntity(null)); }); Assert.fail("Expected a constraint violation"); } catch (ConstraintViolationException ignoredException) { final TestEntity sameTestEntity = get(testEntity.getId()); assertThat(sameTestEntity.getDescription()).isEqualTo("description"); } }

Target:
public void rollsBackTransaction() { final TestEntity testEntity = new TestEntity("description"); daoTestRule.inTransaction(() -> persist(testEntity)); testEntity.setDescription("newDescription"); try { daoTestRule.inTransaction(() -> { persist(testEntity); persist(new TestEntity(null)); }); failBecauseExceptionWasNotThrown(ConstraintViolationException.class); } catch (ConstraintViolationException ignoredException) { final TestEntity sameTestEntity = get(testEntity.getId()); assertThat(sameTestEntity.getDescription()).isEqualTo("description"); } }
Source:
public boolean hasPathCapability(final Path path, final String capability) throws IOException { switch (validatePathCapabilityArgs(path, capability)) { case CommonPathCapabilities.FS_READ_ONLY_CONNECTOR: return true; default: return false; } }

Target:
public boolean hasPathCapability(final Path path, final String capability) throws IOException { switch (validatePathCapabilityArgs(path, capability)) { case CommonPathCapabilities.FS_READ_ONLY_CONNECTOR: return true; default: return super.hasPathCapability(path, capability); } }
Source:
private void applyViewContext() { ViewContext viewContext = fViewContext.get(fTrace); applyExpandedStateContext(viewContext); if (fColumnComparators != null) { final Tree tree = fTimeGraphViewer.getTree(); final TreeColumn column = tree.getColumn(fCurrentSortColumn); tree.setSortDirection(fSortDirection); tree.setSortColumn(column); } fTimeGraphViewer.getControl().setFocus(); if ((viewContext != null) && (viewContext.getSelection() != null)) { fTimeGraphViewer.setSelection(viewContext.getSelection(), true); } fViewContext.remove(fTrace); }

Target:
private void applyViewContext() { ViewContext viewContext = fViewContext.remove(fTrace); applyExpandedStateContext(viewContext); if (fColumnComparators != null) { final Tree tree = fTimeGraphViewer.getTree(); final TreeColumn column = tree.getColumn(fCurrentSortColumn); tree.setSortDirection(fSortDirection); tree.setSortColumn(column); } fTimeGraphViewer.getControl().setFocus(); if ((viewContext != null) && (viewContext.getSelection() != null)) { fTimeGraphViewer.setSelection(viewContext.getSelection(), true); } }
Source:
SupportLevel getEvidenceVerifySupport(Class<? extends Evidence> evidenceType, String algorithmName) throws RealmUnavailableException; boolean verifyEvidence(Evidence evidence) throws RealmUnavailableException; default boolean checkEvidenceTrusted(Evidence evidence) throws RealmUnavailableException { Assert.checkNotNullParam("evidence", evidence); if (! exists()) { return false; } if (evidence instanceof SecurityIdentityEvidence) { final SecurityIdentity evidenceIdentity = ((SecurityIdentityEvidence) evidence).getSecurityIdentity(); final RealmInfo evidenceRealmInfo = evidenceIdentity.getRealmInfo(); final SecurityRealm evidenceSecurityRealm = evidenceRealmInfo.getSecurityRealm(); return createdBySecurityRealm(evidenceSecurityRealm); } return false; }

Target:
SupportLevel getEvidenceVerifySupport(Class<? extends Evidence> evidenceType, String algorithmName) throws RealmUnavailableException; boolean verifyEvidence(Evidence evidence) throws RealmUnavailableException; boolean exists() throws RealmUnavailableException; default void dispose() { }
Source:
private void validateChain(final List<Certificate> chain, final Certificate cert) { final List<Certificate> certs = new ArrayList<Certificate>(); final Set<TrustAnchor> anchors = new HashSet<TrustAnchor>(); certs.add(cert); certs.addAll(chain); for (final Certificate c : certs) { if (!(c instanceof X509Certificate)) { throw new IllegalArgumentException("Invalid chain format. Expected X509 certificate"); } final X509Certificate xCert = (X509Certificate)c; xCert.getSubjectDN(); xCert.getIssuerDN(); anchors.add(new TrustAnchor(xCert, null)); } final X509CertSelector target = new X509CertSelector(); target.setCertificate((X509Certificate)cert); PKIXBuilderParameters params = null; try { params = new PKIXBuilderParameters(anchors, target); params.setRevocationEnabled(false); params.addCertStore(CertStore.getInstance("Collection", new CollectionCertStoreParameters(certs))); final CertPathBuilder builder = CertPathBuilder.getInstance("PKIX", "BC"); builder.build(params); } catch (final InvalidAlgorithmParameterException e) { throw new IllegalArgumentException("Invalid certificate chain", e); } catch (final CertPathBuilderException e) { throw new IllegalArgumentException("Invalid certificate chain", e); } catch (final NoSuchAlgorithmException e) { throw new IllegalArgumentException("Invalid certificate chain", e); } catch (final NoSuchProviderException e) { throw new CloudRuntimeException("No provider for certificate validation", e); } }

Target:
private void validateChain(final List<Certificate> chain, final Certificate cert) { final List<Certificate> certs = new ArrayList<Certificate>(); final Set<TrustAnchor> anchors = new HashSet<TrustAnchor>(); certs.add(cert); certs.addAll(chain); for (final Certificate c : certs) { if (!(c instanceof X509Certificate)) { throw new IllegalArgumentException("Invalid chain format. Expected X509 certificate"); } final X509Certificate xCert = (X509Certificate)c; anchors.add(new TrustAnchor(xCert, null)); } final X509CertSelector target = new X509CertSelector(); target.setCertificate((X509Certificate)cert); PKIXBuilderParameters params = null; try { params = new PKIXBuilderParameters(anchors, target); params.setRevocationEnabled(false); params.addCertStore(CertStore.getInstance("Collection", new CollectionCertStoreParameters(certs))); final CertPathBuilder builder = CertPathBuilder.getInstance("PKIX", "BC"); builder.build(params); } catch (final InvalidAlgorithmParameterException | CertPathBuilderException | NoSuchAlgorithmException e) { throw new IllegalStateException("Invalid certificate chain", e); } catch (final NoSuchProviderException e) { throw new CloudRuntimeException("No provider for certificate validation", e); } }
Source:
public void testSkipWithXML() throws Exception { File arquillianXML = new File("target/test-classes/arquillian.xml"); InputStream is = new FileInputStream(arquillianXML); BufferedReader br = new BufferedReader(new InputStreamReader(is)); String line; while ((line = br.readLine()) != null) { assertFalse(line.equals(Constants.CONFIGURE_ARQUILLIAN_COMMENT)); } }

Target:
public void testSkipWithXML() throws Exception { File arquillianXML = new File("target/test-classes/arquillian.xml"); InputStream is = new FileInputStream(arquillianXML); BufferedReader br = new BufferedReader(new InputStreamReader(is)); String line; while ((line = br.readLine()) != null) { assertFalse(line.contains(Constants.CONFIGURE_ARQUILLIAN_COMMENT)); } }
Source:
private static boolean ignoreNetworkInterface(final NetworkInterface networkInterface) { try { return networkInterface == null || networkInterface.isLoopback() || networkInterface.isVirtual() || !networkInterface.isUp(); } catch (SocketException e) { return true; } }

Target:
private static boolean ignoreNetworkInterface(final NetworkInterface networkInterface) { try { return null == networkInterface || networkInterface.isLoopback() || networkInterface.isVirtual() || !networkInterface.isUp(); } catch (final SocketException ex) { return true; } }
Source:
private String lookupCacheDirectory(ServletContext servContext) { final String[] typeStrs = { "Java environment variable ", "Servlet context parameter ", "System environment variable " }; final String[] varStrs = { "COMPOSER_CACHE_DIR" }; String cacheDir = null; for (int i = 0; i < varStrs.length && cacheDir == null; i++) { for (int j = 0; j < typeStrs.length && cacheDir == null; j++) { String value = null; String varStr = varStrs[i]; String typeStr = typeStrs[j]; switch (j) { case 0: value = System.getProperty(varStr); break; case 1: value = servContext.getInitParameter(varStr); break; case 2: value = System.getenv(varStr); break; } if (value == null || value.equalsIgnoreCase("")) { LOGGER.finer("Found " + typeStr + varStr + " to be unset"); continue; } if (verifyPath(value, "Found " + typeStr + varStr + " set to " + value)) { cacheDir = value; } } } if(cacheDir == null) { cacheDir = (new GeoServerDataDirectory(catalog.getResourceLoader()).root().getPath()) +File.separator+"composer"; if (verifyPath(cacheDir, "Trying default composer cache directory " + cacheDir)) { LOGGER.info("COMPOSER_CACHE_DIR not set, using default value: " + cacheDir); } } try { File cacheFile = new File(cacheDir); if (!cacheFile.exists()) { cacheFile.mkdirs(); } } catch (Exception e) { LOGGER.log(Level.WARNING, "Could not initilize composer cache directory", e); } return cacheDir; }

Target:
private String lookupCacheDirectory(ServletContext servContext) { String cacheDir = GeoServerExtensions.getProperty("COMPOSER_CACHE_DIR", servContext); if(cacheDir == null) { cacheDir = (GeoServerExtensions.bean(GeoServerDataDirectory.class).root().getPath()) +File.separator+"composer"; } try { File cacheFile = new File(cacheDir); if (!cacheFile.exists()) { cacheFile.mkdirs(); } } catch (Exception e) { LOGGER.log(Level.WARNING, "Could not initilize composer cache directory", e); } return cacheDir; }
Source:
public Collection<? extends Action> createFor(Job j) { List<Action> actions = new LinkedList<Action>(); if (j.getClass().getCanonicalName().startsWith("org.jenkinsci.plugins.workflow")) { Run r = j.getLastSuccessfulBuild(); if (r != null) { List<HtmlPublisherTarget.HTMLBuildAction> reports = r.getActions(HtmlPublisherTarget.HTMLBuildAction.class); for (HtmlPublisherTarget.HTMLBuildAction report : reports) { actions.add(report.getHTMLTarget().getProjectAction(j)); } } } return actions; }

Target:
public Collection<? extends Action> createFor(Job j) { List<Action> actions = new LinkedList<Action>(); if (j.getClass().getCanonicalName().startsWith("org.jenkinsci.plugins.workflow")) { final Run<?,?> r = j.getLastSuccessfulBuild(); if (r != null) { List<HtmlPublisherTarget.HTMLBuildAction> reports = r.getActions(HtmlPublisherTarget.HTMLBuildAction.class); for (HtmlPublisherTarget.HTMLBuildAction report : reports) { actions.add(report.getHTMLTarget().getProjectAction(j)); } List<HtmlPublisherTarget.HTMLPublishedForProjectMarkerAction> projectLevelReports = r.getActions(HtmlPublisherTarget.HTMLPublishedForProjectMarkerAction.class); for (HtmlPublisherTarget.HTMLPublishedForProjectMarkerAction report : projectLevelReports) { actions.add(report.getHTMLTarget().getProjectAction(j)); } } } return actions; }
Source:
public void onAddExperienceLevels(int levels, CallbackInfo ci) { recalculateTotalExperience(); }

Target:
private void onAddExperienceLevels(int levels, CallbackInfo ci) { recalculateTotalExperience(); }
Source:
protected void configure() { bind(ExecutorLoader.class).to(JdbcExecutorLoader.class).in(Scopes.SINGLETON); bind(ProjectLoader.class).to(JdbcProjectLoader.class).in(Scopes.SINGLETON); bind(Props.class).toInstance(this.config.getProps()); bind(Storage.class).to(resolveStorageClassType()).in(Scopes.SINGLETON); bind(DatabaseOperator.class).to(DatabaseOperatorImpl.class).in(Scopes.SINGLETON); bind(TriggerLoader.class).to(JdbcTriggerImpl.class).in(Scopes.SINGLETON); bind(DataSource.class).to(AzkabanDataSource.class); bind(ExecutorManager.class).in(Scopes.SINGLETON); bind(AlerterHolder.class).in(Scopes.SINGLETON); bind(CommonMetrics.class).in(Scopes.SINGLETON); bind(MetricsManager.class).in(Scopes.SINGLETON); bind(MetricRegistry.class).in(Scopes.SINGLETON); }

Target:
protected void configure() { bind(ExecutorLoader.class).to(JdbcExecutorLoader.class).in(Scopes.SINGLETON); bind(ProjectLoader.class).to(JdbcProjectLoader.class).in(Scopes.SINGLETON); bind(Props.class).toInstance(this.config.getProps()); bind(Storage.class).to(resolveStorageClassType()).in(Scopes.SINGLETON); bind(DatabaseOperator.class).to(DatabaseOperatorImpl.class).in(Scopes.SINGLETON); bind(TriggerLoader.class).to(JdbcTriggerImpl.class).in(Scopes.SINGLETON); bind(DataSource.class).to(AzkabanDataSource.class); bind(ExecutorManager.class).in(Scopes.SINGLETON); bind(AlerterHolder.class).in(Scopes.SINGLETON); bind(MetricRegistry.class).in(Scopes.SINGLETON); }
Source:
public UsbDevice getItem(final int position) { if ((position >= 0) && (position < mList.size())) return mList.get(position); else return null; }

Target:
public UsbDevice getItem(final int position) { return mList.get(position); }
Source:
public NodeValue exec(NodeValue nv) { System.out.println(nv); Node n = nv.asNode(); if ( ! n.isNodeTriple() ) throw new ExprEvalException(getClass().getSimpleName()+": Not a triple term: "+nv); Triple t = Node_Triple.triple(n); Node x = function(t); return NodeValue.makeNode(x); }

Target:
public NodeValue exec(NodeValue nv) { Node n = nv.asNode(); if ( ! n.isNodeTriple() ) throw new ExprEvalException(getClass().getSimpleName()+": Not a triple term: "+nv); Triple t = Node_Triple.triple(n); Node x = function(t); return NodeValue.makeNode(x); }
Source:
public boolean hasErrors() { return !errors.isEmpty(); }

Target:
public boolean hasErrors() { return !errors.isEmpty() || configuration.hasErrors(); }
Source:
protected void addTablePartConfig(String tablePartKey, TablePart tablePart, Config jobConfig, Map<String, String> tableConfig) { Map<String, String> tablePartConfig = tablePart.toConfig(jobConfig, new MapConfig(tableConfig)); for (String configKey : tablePartConfig.keySet()) { addTableConfig(String.format("%s.%s", tablePartKey, configKey), tablePartConfig.get(configKey), tableConfig); } }

Target:
protected void addTablePartConfig(String tablePartKey, TablePart tablePart, Config jobConfig, Map<String, String> tableConfig) { tablePart.toConfig(jobConfig, new MapConfig(tableConfig)) .forEach((k, v) -> addTableConfig(String.format("%s.%s", tablePartKey, k), v, tableConfig)); }
Source:
public void setTimeBounds(long beginTime, long endTime) { fBeginTime = beginTime; fEndTime = endTime; fTime0Bound = fBeginTime != SWT.DEFAULT ? fBeginTime : fEndTime; fTime1Bound = fEndTime != SWT.DEFAULT ? fEndTime : fBeginTime; if (fTime0Bound > fTime1Bound) { fBeginTime = endTime; fEndTime = beginTime; fTime0Bound = fBeginTime; fTime1Bound = fEndTime; } adjustHorizontalScrollBar(); }

Target:
public void setTimeBounds(long beginTime, long endTime) { fBeginTime = beginTime; fEndTime = endTime; fTime0Bound = (fBeginTime != SWT.DEFAULT ? fBeginTime : fEndTime); fTime1Bound = (fEndTime != SWT.DEFAULT ? fEndTime : fBeginTime); if (fTime0Bound > fTime1Bound) { fBeginTime = endTime; fEndTime = beginTime; fTime0Bound = fBeginTime; fTime1Bound = fEndTime; } adjustHorizontalScrollBar(); }
Source:
protected Void doInBackground(Void... params) { List<Map<String, Object>> blogs; String[] extraFields = {"isHidden", "homeURL", "last_picked_timestamp"}; if (mIsInSearchMode) { blogs = WordPress.wpDB.getBlogsBy(null, extraFields); } else { blogs = getBlogsForCurrentView(extraFields); } SiteList sites = new SiteList(blogs); final long primaryBlogId = AccountHelper.getDefaultAccount().getPrimaryBlogId(); Collections.sort(sites, new Comparator<SiteRecord>() { public int compare(SiteRecord site1, SiteRecord site2) { if (primaryBlogId > 0 && !mIsInSearchMode) { if (site1.blogId == primaryBlogId) { return -1; } else if (site2.blogId == primaryBlogId) { return 1; } } return site1.getBlogNameOrHomeURL().compareToIgnoreCase(site2.getBlogNameOrHomeURL()); } }); if (!mIsInSearchMode && sites.size() >= RECENTLY_PICKED_THRESHOLD) { ArrayList<Integer> pickedIds = AppPrefs.getRecentlyPickedSiteIds(); for (int i = pickedIds.size() - 1; i > -1; i--) { int thisId = pickedIds.get(i); int indexOfSite = sites.indexOfSiteId(thisId); if (indexOfSite > -1) { SiteRecord site = sites.remove(indexOfSite); site.isRecentPick = true; sites.add(0, site); } } } if (mSites == null || !mSites.isSameList(sites)) { mAllSites = (SiteList) sites.clone(); mSites = filteredSitesByTextIfInSearchMode(sites); } return null; }

Target:
protected Void doInBackground(Void... params) { List<Map<String, Object>> blogs; String[] extraFields = {"isHidden", "homeURL"}; if (mIsInSearchMode) { blogs = WordPress.wpDB.getBlogsBy(null, extraFields); } else { blogs = getBlogsForCurrentView(extraFields); } SiteList sites = new SiteList(blogs); final long primaryBlogId = AccountHelper.getDefaultAccount().getPrimaryBlogId(); Collections.sort(sites, new Comparator<SiteRecord>() { public int compare(SiteRecord site1, SiteRecord site2) { if (primaryBlogId > 0 && !mIsInSearchMode) { if (site1.blogId == primaryBlogId) { return -1; } else if (site2.blogId == primaryBlogId) { return 1; } } return site1.getBlogNameOrHomeURL().compareToIgnoreCase(site2.getBlogNameOrHomeURL()); } }); if (!mIsInSearchMode && sites.size() >= RECENTLY_PICKED_THRESHOLD) { ArrayList<Integer> pickedIds = AppPrefs.getRecentlyPickedSiteIds(); for (int i = pickedIds.size() - 1; i > -1; i--) { int thisId = pickedIds.get(i); int indexOfSite = sites.indexOfSiteId(thisId); if (indexOfSite > -1) { SiteRecord site = sites.remove(indexOfSite); site.isRecentPick = true; sites.add(0, site); } } } if (mSites == null || !mSites.isSameList(sites)) { mAllSites = (SiteList) sites.clone(); mSites = filteredSitesByTextIfInSearchMode(sites); } return null; }
Source:
public synchronized void forceNodeShutdown() { LOGGER.entering(); CloseableHttpClient client = HttpClientBuilder.create().build(); StringBuilder url = new StringBuilder(); url.append("http://"); url.append(machine); url.append(":").append(this.getRemoteHost().getPort()); url.append("/extra/"); url.append(NodeForceRestartServlet.class.getSimpleName()); HttpPost post = new HttpPost(url.toString()); int responseStatusCode = HttpStatus.SC_NOT_FOUND; try { HttpResponse response = client.execute(post); responseStatusCode = response.getStatusLine().getStatusCode(); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } finally { if (responseStatusCode == HttpStatus.SC_OK) { proxyLogger.info("Node " + machine + " shutdown successfully."); } else { proxyLogger.info("Node " + machine + " did not shutdown. Return code was " + responseStatusCode); } try { client.close(); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } } stopNodeRecycleThread(); if (responseStatusCode == HttpStatus.SC_OK) { getRegistry().removeIfPresent(this); } LOGGER.exiting(); }

Target:
public synchronized void forceNodeShutdown() { LOGGER.entering(); CloseableHttpClient client = HttpClientBuilder.create().build(); String url = String.format("http://%s:%d/extra/%s", machine, this.getRemoteHost().getPort(), NodeForceRestartServlet.class.getSimpleName()); HttpPost post = new HttpPost(url); int responseStatusCode = HttpStatus.SC_NOT_FOUND; try { HttpResponse response = client.execute(post); responseStatusCode = response.getStatusLine().getStatusCode(); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } finally { if (responseStatusCode == HttpStatus.SC_OK) { proxyLogger.info("Node " + machine + " shutdown successfully."); } else { proxyLogger.info("Node " + machine + " did not shutdown. Return code was " + responseStatusCode); } try { client.close(); } catch (IOException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } } stopNodeRecycleThread(); if (responseStatusCode == HttpStatus.SC_OK) { getRegistry().removeIfPresent(this); } LOGGER.exiting(); }
Source:
private void maybeCreateTopic(String topic) { if (!isTopicCreationEnabled || topicCache.contains(topic)) { return; } log.info("The task will send records to topic '{}' for the first time. Checking " + "whether topic exists", topic); Map<String, TopicDescription> existing = admin.describeTopics(topic); if (!existing.isEmpty()) { log.info("Topic '{}' already exists.", topic); topicCache.add(topic); return; } log.info("Creating topic '{}'", topic); NewTopicCreationGroup topicGroup = topicGroups.values().stream() .filter(group -> group.matches(topic)) .findFirst() .orElse(defaultTopicGroup); log.debug("Topic '{}' matched topic creation group: {}", topic, topicGroup); NewTopic newTopic = topicGroup.newTopic(topic); if (admin.createTopic(newTopic)) { topicCache.add(topic); log.info("Created topic '{}'", newTopic); } else { log.warn("Request to create new topic '{}' failed", topic); throw new ConnectException("Task failed to create new topic " + topic + ". Ensure " + "that the task is authorized to create topics or that the topic exists and " + "restart the task"); } }

Target:
private void maybeCreateTopic(String topic) { if (!topicCreation.isTopicCreationRequired(topic)) { return; } log.info("The task will send records to topic '{}' for the first time. Checking " + "whether topic exists", topic); Map<String, TopicDescription> existing = admin.describeTopics(topic); if (!existing.isEmpty()) { log.info("Topic '{}' already exists.", topic); topicCreation.addTopic(topic); return; } log.info("Creating topic '{}'", topic); TopicCreationGroup topicGroup = topicCreation.findFirstGroup(topic); log.debug("Topic '{}' matched topic creation group: {}", topic, topicGroup); NewTopic newTopic = topicGroup.newTopic(topic); if (admin.createTopic(newTopic)) { topicCreation.addTopic(topic); log.info("Created topic '{}' using creation group {}", newTopic, topicGroup); } else { log.warn("Request to create new topic '{}' failed", topic); throw new ConnectException("Task failed to create new topic " + topic + ". Ensure " + "that the task is authorized to create topics or that the topic exists and " + "restart the task"); } }
Source:
private Node tryToFoldArrayConcat(Node n) { checkArgument(n.isCall(), n); if (!isASTNormalized() || !useTypes) { return n; } if (isSafeToRemoveArrayLiteralFromFrontOfConcat(n)) { return removeArrayLiteralFromFrontOfConcat(n); } if (isSafeToFoldConcatChaining(n)) { return foldConcatChaining(n); } return n; }

Target:
private Node tryToFoldArrayConcat(Node n) { checkArgument(n.isCall(), n); if (!isASTNormalized() || !useTypes) { return n; } ConcatFunctionCall concatFunctionCall = createConcatFunctionCallForNode(n); if (concatFunctionCall == null) { return n; } concatFunctionCall = tryToRemoveArrayLiteralFromFrontOfConcat(concatFunctionCall); checkNotNull(concatFunctionCall); return tryToFoldConcatChaining(concatFunctionCall); }
Source:
public Optional<UsernamePasswordCredentials> extract(WebContext context) { final Optional<String> username = context.getRequestParameter(this.usernameParameter); final Optional<String> password = context.getRequestParameter(this.passwordParameter); if (username.isPresent() && password.isPresent()) { return Optional.of( new UsernamePasswordCredentials(username.get(), password.get()) ); } return Optional.empty(); }

Target:
public Optional<UsernamePasswordCredentials> extract(WebContext context) { final Optional<String> username = context.getRequestParameter(this.usernameParameter); final Optional<String> password = context.getRequestParameter(this.passwordParameter); return username.map( un -> password.isPresent() ? new UsernamePasswordCredentials(un, password.get()) : null ); }
Source:
public static GerritTableView getActiveView() { IViewPart viewPart = null; if (rtv != null) { return rtv; } else { IWorkbench workbench = GerritUi.getDefault().getWorkbench(); IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); IWorkbenchPage page = null; if (window != null ) { page = workbench.getActiveWorkbenchWindow() .getActivePage(); } if (page != null) { viewPart = page.findView(VIEW_ID); if (viewPart == null) { try { viewPart = page.showView(VIEW_ID, null, org.eclipse.ui.IWorkbenchPage.VIEW_CREATE); } catch (PartInitException e) { StatusHandler.log(new Status(IStatus.WARNING, GerritCorePlugin.PLUGIN_ID, NLS.bind( "PartInitException: ''{0}'' ", e))); } GerritUi.Ftracer.traceWarning("getActiveView() SHOULD (JUST) CREATED A NEW Table:" + viewPart ); } } return (GerritTableView) viewPart; } }

Target:
public static GerritTableView getActiveView() { IViewPart viewPart = null; if (rtv != null) { return rtv; } else { IWorkbench workbench = GerritUi.getDefault().getWorkbench(); IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); IWorkbenchPage page = null; if (window != null ) { page = workbench.getActiveWorkbenchWindow() .getActivePage(); } if (page != null) { viewPart = page.findView(VIEW_ID); if (viewPart == null) { try { viewPart = page.showView(VIEW_ID, null, org.eclipse.ui.IWorkbenchPage.VIEW_CREATE); } catch (PartInitException e) { StatusHandler.log(new Status(IStatus.WARNING, GerritCorePlugin.PLUGIN_ID, e.getMessage(), e)); } GerritUi.Ftracer.traceWarning("getActiveView() SHOULD (JUST) CREATED A NEW Table:" + viewPart ); } } return (GerritTableView) viewPart; } }
Source:
private Boolean rearrangeColumns(TableView<?> table) { Double tableWidth = getContentWidth(table); List<? extends TableColumnBase<?, ?>> visibleLeafColumns = table.getVisibleLeafColumns(); Double remainingAvailableWidth = tableWidth - getSumMinWidthOfColumns(table); for (TableColumnBase<?, ?> col : visibleLeafColumns) { double share = expansionShare.get(col); double newSize = col.getMinWidth() + share * remainingAvailableWidth; newSize -= 2; newSize = Math.min(newSize, col.getMaxWidth()); col.setPrefWidth(newSize); } return true; }

Target:
private Boolean rearrangeColumns(TableView<?> table) { Double initialContentWidth = getContentWidth(table); LOGGER.debug("initialContentWidth {}", initialContentWidth); for (TableColumnBase<?, ?> col : resizableColumns) { col.setPrefWidth(col.getMinWidth()); } LOGGER.debug("Width after setting min width: {}", getContentWidth(table)); rearrangeColumns(table, resizableColumns); LOGGER.debug("Width after rearranging columns: {}", getContentWidth(table)); return (initialContentWidth - getContentWidth(table)) != 0d; }
Source:
public void startCanTestThread() { if (this.m_pollThread != null) { this.m_pollThread.interrupt(); try { this.m_pollThread.join(100); } catch (InterruptedException e) { } this.m_pollThread = null; } this.m_pollThread = new Thread(new Runnable() { @Override public void run() { if (CanSocketTest.this.m_canConnection != null && !IS_MAC) { while (!CanSocketTest.this.thread_done) { CanSocketTest.this.thread_done = doCanTest(); } } } }); this.m_pollThread.start(); }

Target:
public void startCanTestThread() { terminatePollThread(); this.pollThread = new Thread(new Runnable() { @Override public void run() { if (CanSocketTest.this.canConnection != null && !IS_MAC) { boolean threadDone = false; while (!threadDone) { threadDone = doCanTest(); } } } }); this.pollThread.start(); }
Source:
protected void initPingIntervalMilli() { Integer pingIntervalMilliParam = getInitParameter("pingIntervalMilli", Integer.class); setPingIntervalMilli((pingIntervalMilliParam == null) ? DEFAULT_PING_INTERVAL_MILLI : pingIntervalMilliParam); if (isDebug()) { LOGGER.debug("pingIntervalMilli: {}", getPingIntervalMilli()); } }

Target:
protected void initPingIntervalMilli() { setPingIntervalMilli(Optional.ofNullable(getInitParameter("pingIntervalMilli", Integer.class)).orElse(DEFAULT_PING_INTERVAL_MILLI)); if (isDebug()) { LOGGER.debug("pingIntervalMilli: {}", getPingIntervalMilli()); } }
Source:
public boolean setLayerState(boolean showWidget) { prevWidgetState = showWidget; if (isWidgetVisible() == showWidget) return false; updateQuickActionButton(showWidget); if (settings.DO_NOT_USE_ANIMATIONS.get()) { quickActionsWidget.setVisibility(!showWidget ? View.GONE : View.VISIBLE); } else { animateWidget(showWidget); } mapActivity.updateStatusBarColor(); if (!showWidget) { quitMovingMarker(); quickActionRegistry.setUpdatesListener(null); quickActionsWidget.setSelectionListener(null); } else { enterMovingMode(mapActivity.getMapView().getCurrentRotatedTileBox()); quickActionsWidget.setActions(quickActionRegistry.getFilteredQuickActions()); quickActionRegistry.setUpdatesListener(MapQuickActionLayer.this); quickActionsWidget.setSelectionListener(MapQuickActionLayer.this); } return true; }

Target:
public boolean setLayerState(boolean showWidget) { currentWidgetState = showWidget; if (isWidgetVisible() == showWidget) return false; updateQuickActionButton(showWidget); if (settings.DO_NOT_USE_ANIMATIONS.get()) { quickActionsWidget.setVisibility(!showWidget ? View.GONE : View.VISIBLE); } else { animateWidget(showWidget); } mapActivity.updateStatusBarColor(); if (!showWidget) { quitMovingMarker(); quickActionRegistry.setUpdatesListener(null); quickActionsWidget.setSelectionListener(null); } else { enterMovingMode(mapActivity.getMapView().getCurrentRotatedTileBox()); quickActionsWidget.setActions(quickActionRegistry.getFilteredQuickActions()); quickActionRegistry.setUpdatesListener(MapQuickActionLayer.this); quickActionsWidget.setSelectionListener(MapQuickActionLayer.this); } return true; }
Source:
public View keys(Object... keys) { this.allDocsKeys = String.format("{%s:%s}", gson.toJson("keys"), getKeyAsJsonElement(keys)); return this; }

Target:
public View keys(Object... keys) { JsonObject keysObject = new JsonObject(); keysObject.add("keys", getKeyAsJsonElement(keys)); this.allDocsKeys = gson.toJson(keysObject); return this; }
Source:
public JsonObject findDocument(Integer id) throws DataException { SearchRestClient restClient = initiateRestClient(); String response = restClient.getDocument(id); if (!response.equals("")) { JsonReader jsonReader = Json.createReader(new StringReader(response)); return jsonReader.readObject(); } else { return Json.createObjectBuilder().build(); } }

Target:
public JsonObject findDocument(Integer id) throws DataException { SearchRestClient restClient = initiateRestClient(); String response = restClient.getDocument(id); if (!response.equals("")) { try (JsonReader jsonReader = Json.createReader(new StringReader(response))) { return jsonReader.readObject(); } } else { return Json.createObjectBuilder().build(); } }
Source:
private void updateParagraph(NotebookSocket conn, Message fromMessage) throws IOException { String paragraphId = (String) fromMessage.get("id"); if (paragraphId == null) { return; } String noteId = getOpenNoteId(conn); if (noteId == null) { noteId = (String) fromMessage.get("noteId"); } NotebookService notebookService = new NotebookService(notebook()); String title = (String) fromMessage.get("title"); String text = (String) fromMessage.get("paragraph"); Map<String, Object> params = (Map<String, Object>) fromMessage.get("params"); Map<String, Object> config = (Map<String, Object>) fromMessage.get("config"); notebookService.updateParagraph(noteId, paragraphId, title, text, params, config, getServiceContext(fromMessage), new WebSocketServiceCallback<Paragraph>(conn) { @Override public void onSuccess(Paragraph p, ServiceContext context) throws IOException { if (p.getNote().isPersonalizedMode()) { Map<String, Paragraph> userParagraphMap = p.getNote().getParagraph(paragraphId).getUserParagraphMap(); broadcastParagraphs(userParagraphMap, p); } else { broadcastParagraph(p.getNote(), p); } } }); }

Target:
private void updateParagraph(NotebookSocket conn, Message fromMessage) throws IOException { String paragraphId = (String) fromMessage.get("id"); if (paragraphId == null) { return; } String noteId = getOpenNoteId(conn); if (noteId == null) { noteId = (String) fromMessage.get("noteId"); } String title = (String) fromMessage.get("title"); String text = (String) fromMessage.get("paragraph"); Map<String, Object> params = (Map<String, Object>) fromMessage.get("params"); Map<String, Object> config = (Map<String, Object>) fromMessage.get("config"); getNotebookService().updateParagraph(noteId, paragraphId, title, text, params, config, getServiceContext(fromMessage), new WebSocketServiceCallback<Paragraph>(conn) { @Override public void onSuccess(Paragraph p, ServiceContext context) throws IOException { if (p.getNote().isPersonalizedMode()) { Map<String, Paragraph> userParagraphMap = p.getNote().getParagraph(paragraphId).getUserParagraphMap(); broadcastParagraphs(userParagraphMap, p); } else { broadcastParagraph(p.getNote(), p); } } }); }
Source:
protected void onCommand(final Command c) throws IOException, UnableToExecuteException { String callout = c.getProperty("callout.message"); if (callout != null) { Callout callout1 = new Callout(this.getClass().getCanonicalName(), "info", callout, 0, 0, 0, 0); drawer.createCallout(callout1); } else if (c.getProperty("command") != null && c.getProperty("command").equals("GRAPH-DATA")) { EnvObjectLogic obj = (EnvObjectLogic) getApi().things().findByAddress("harvester", c.getProperty("event.object.address")); if (obj.getBehavior("data") != null) { if (!obj.getBehavior("data").getValueAsString().isEmpty()) { GraphPanel gw = graphs.get(obj.getPojo().getUUID()); if (gw != null) { gw.reDraw(); } else { gw = new GraphPanel(this, obj); graphs.put(obj.getPojo().getUUID(), gw); } } } } else { EventQueue.invokeLater(new Runnable() { @Override public void run() { new Thread(new Runnable() { @Override public void run() { if (c.getProperty("options") != null) { Object[] options = c.getProperty("options").split(";"); int n = JOptionPane.showOptionDialog(window, c.getProperty("question"), "Please reply within " + (int) (c.getReplyTimeout() / 1000) + " seconds", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[2]); c.setProperty("result", options[n].toString()); } reply(c); } }).start(); } }); } }

Target:
protected void onCommand(final Command c) throws IOException, UnableToExecuteException { String callout = c.getProperty("callout.message"); if (callout != null) { Callout callout1 = new Callout(this.getClass().getCanonicalName(), "info", callout, 0, 0, 0, 0); drawer.createCallout(callout1); } else if (c.getProperty("command") != null && c.getProperty("command").equals("GRAPH-DATA")) { EnvObjectLogic obj = (EnvObjectLogic) getApi().things().findByAddress("harvester", c.getProperty("event.object.address")); if (obj != null && obj.getBehavior("data") != null) { if (!obj.getBehavior("data").getValueAsString().isEmpty()) { GraphPanel gw = graphs.get(obj.getPojo().getUUID()); if (gw != null) { gw.reDraw(); } else { gw = new GraphPanel(this, obj); graphs.put(obj.getPojo().getUUID(), gw); } } } } else { EventQueue.invokeLater(new Runnable() { @Override public void run() { new Thread(new Runnable() { @Override public void run() { if (c.getProperty("options") != null) { Object[] options = c.getProperty("options").split(";"); int n = JOptionPane.showOptionDialog(window, c.getProperty("question"), "Please reply within " + (int) (c.getReplyTimeout() / 1000) + " seconds", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[2]); c.setProperty("result", options[n].toString()); } reply(c); } }).start(); } }); } }
Source:
private static boolean vectorsMatch(VectorValueExpression e1, VectorValueExpression e2) { return e1.getArgs().stream().map(FilterMatcher::asCVE).collect(Collectors.toSet()) .equals(e2.getArgs().stream().map(FilterMatcher::asCVE).collect(Collectors.toSet())); }

Target:
private static boolean vectorsMatch(VectorValueExpression e1, VectorValueExpression e2) { final Set<ConstantValueExpression> c1 = new HashSet<>(), c2 = new HashSet<>(); final Set<Integer> tveIndices1 = new HashSet<>(), tveIndices2 = new HashSet<>(); e1.getArgs().forEach(e -> { if (e instanceof ConstantValueExpression || e instanceof ParameterValueExpression) { c1.add(asCVE(e)); } else { assert (e instanceof TupleValueExpression); tveIndices1.add(((TupleValueExpression) e).getColumnIndex()); } }); e2.getArgs().forEach(e -> { if (e instanceof ConstantValueExpression || e instanceof ParameterValueExpression) { c2.add(asCVE(e)); } else { assert (e instanceof TupleValueExpression); tveIndices2.add(((TupleValueExpression) e).getColumnIndex()); } }); return c1.equals(c2) && tveIndices1.equals(tveIndices2); }
Source:
public S indexNullAs(F indexNullAs) { indexNullAsValue = Optional.of( indexNullAs ); return thisAsS(); }

Target:
public S indexNullAs(F indexNullAs) { indexNullAsValue = indexNullAs; return thisAsS(); }