auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected Control createContents(Composite parent) { Composite container = new Composite(parent, SWT.NULL); container.setLayout(new GridLayout(1, true)); Label introductionText = new Label(container, SWT.WRAP); introductionText.setText(EMFCompareRCPUIMessages .getString("PostProcessorPreferencePage.PREFERENCE_PAGE_DESCRIPTION")); IItemRegistry<IPostProcessor.Descriptor> postProcessorRegistryDescriptor = EMFCompareRCPPlugin .getDefault().getPostProcessorDescriptorRegistry(); Set<IItemDescriptor<Descriptor>> activesPostProcessor = ItemUtil.getActiveItems( postProcessorRegistryDescriptor, EMFComparePreferences.DISABLED_POST_PROCESSOR); InteractiveUIBuilder<Descriptor> postProcessorUIBuilder = new InteractiveUIBuilder<IPostProcessor.Descriptor>( container, postProcessorRegistryDescriptor); Set<IItemDescriptor<Descriptor>> descriptors = Sets.newHashSet(postProcessorRegistryDescriptor .getItemDescriptors()); postProcessorUIBuilder.setConfigurationNodeKey(EMFComparePreferences.DISABLED_POST_PROCESSOR) .setDefaultCheck(descriptors).setDefaultSelection( postProcessorRegistryDescriptor.getHighestRankingDescriptor()).setHoldingData( dataHolder).setDefaultCheck(activesPostProcessor); interactiveUI = postProcessorUIBuilder.build(); return container; }

Target:
protected Control createContents(Composite parent) { Composite container = new Composite(parent, SWT.NULL); container.setLayout(new GridLayout(1, true)); Label introductionText = new Label(container, SWT.WRAP); introductionText.setText(EMFCompareRCPUIMessages .getString("PostProcessorPreferencePage.PREFERENCE_PAGE_DESCRIPTION")); IItemRegistry<IPostProcessor.Descriptor> postProcessorRegistryDescriptor = EMFCompareRCPPlugin .getDefault().getPostProcessorDescriptorRegistry(); Set<IItemDescriptor<Descriptor>> activesPostProcessor = ItemUtil.getActiveItems( postProcessorRegistryDescriptor, EMFComparePreferences.DISABLED_POST_PROCESSOR); InteractiveUIBuilder<Descriptor> postProcessorUIBuilder = new InteractiveUIBuilder<IPostProcessor.Descriptor>( container, postProcessorRegistryDescriptor); Set<IItemDescriptor<Descriptor>> descriptors = Sets.newLinkedHashSet(postProcessorRegistryDescriptor .getItemDescriptors()); postProcessorUIBuilder.setConfigurationNodeKey(EMFComparePreferences.DISABLED_POST_PROCESSOR) .setDefaultCheck(descriptors).setDefaultSelection( postProcessorRegistryDescriptor.getHighestRankingDescriptor()).setHoldingData( dataHolder).setDefaultCheck(activesPostProcessor); interactiveUI = postProcessorUIBuilder.build(); return container; }
Source:
public void shouldBeAbleToWriteIntoFile() throws Exception { final String message = "Test line"; injectWriterMock(fileLineConsumer, writer); doNothing().when(writer).write(anyString()); doNothing().when(writer).flush(); fileLineConsumer.writeLine(message); verify(writer).write(eq(message)); }

Target:
public void shouldBeAbleToWriteIntoFile() throws Exception { final String message = "Test line"; fileLineConsumer.writeLine(message); verify(writer).write(eq(message)); }
Source:
public FootballEventStream() throws IOException { textStream = new PlainTextByLineStream( new URLInputSreamFactory(this.getClass().getResource("/opennlp/tools/ml/maxent/football.dat")), Charset.defaultCharset() ); }

Target:
public FootballEventStream() throws IOException { textStream = new PlainTextByLineStream( new URLInputStreamFactory(this.getClass().getResource("/opennlp/tools/ml/maxent/football.dat")), StandardCharsets.US_ASCII ); }
Source:
public CreatePostPresenter(@Nonnull PostsDao postsDao) { this.postsDao = postsDao; final Observable<AddPost> filter = OnSubscribeCombineLatestWithoutBackPressure.combineLatest( nameSubject, bodySubject, new Func2<String, String, AddPost>() { @Override public AddPost call(String name, String body) { return new AddPost(name, body); } }) .lift(OperatorSampleWithLastWithObservable.<AddPost>create(sendSubject)) .filter(new Func1<AddPost, Boolean>() { @Override public Boolean call(AddPost addPost) { return !(Strings.isNullOrEmpty(addPost.name()) || Strings.isNullOrEmpty(addPost.body())); } }); filter.subscribe(postsDao.postRequestObserver()); filter.subscribe(showProgress); closeActivitySubject = Observable.merge( postsDao.postSuccesObserver().compose(ResponseOrError.<PostWithBody>onlySuccess()), navigationClickSubject); nameSubject.startWith("") .lift(OperatorSampleWithLastWithObservable.<String>create(sendSubject)) .filter(fieldNullOrEmpty()) .subscribe(nameErrorSubject); bodySubject.startWith("") .lift(OperatorSampleWithLastWithObservable.<String>create(sendSubject)) .filter(fieldNullOrEmpty()) .subscribe(bodyErrorSubject); }

Target:
public CreatePostPresenter(@Nonnull PostsDao postsDao) { this.postsDao = postsDao; OnSubscribeCombineLatestWithoutBackPressure.combineLatest( nameSubject, bodySubject, new Func2<String, String, AddPost>() { @Override public AddPost call(String name, String body) { return new AddPost(name, body); } }) .lift(OperatorSampleWithLastWithObservable.<AddPost>create(sendSubject)) .filter(new Func1<AddPost, Boolean>() { @Override public Boolean call(AddPost addPost) { final boolean nameIsPresent = !Strings.isNullOrEmpty(addPost.name()); final boolean bodyIsPresent = !Strings.isNullOrEmpty(addPost.body()); return (nameIsPresent && bodyIsPresent); } }) .doOnNext(new Action1<AddPost>() { @Override public void call(AddPost addPost) { showProgress.onNext(true); } }) .subscribe(postsDao.postRequestObserver()); Observable.merge( postsDao.postSuccesObservable().compose(ResponseOrError.<PostWithBody>onlySuccess()), navigationClickSubject) .doOnNext(new Action1<Object>() { @Override public void call(Object o) { showProgress.onNext(false); } }) .subscribe(closeActivitySubject); postsDao.postSuccesObservable() .compose(ResponseOrError.<PostWithBody>onlyError()) .doOnNext(new Action1<Throwable>() { @Override public void call(Throwable throwable) { showProgress.onNext(false); } }).subscribe(postErrorSubject); nameSubject.startWith("") .lift(OperatorSampleWithLastWithObservable.<String>create(sendSubject)) .filter(fieldNullOrEmpty()) .subscribe(nameErrorSubject); bodySubject.startWith("") .lift(OperatorSampleWithLastWithObservable.<String>create(sendSubject)) .filter(fieldNullOrEmpty()) .subscribe(bodyErrorSubject); }
Source:
public void testSSLFactory() { try { SSLFactory sslFactory = TestUtils.createSSLFactory(); SSLContext sslContext = sslFactory.createSSLContext(); SSLSocketFactory socketFactory = sslContext.getSocketFactory(); SSLServerSocketFactory serverSocketFactory = sslContext.getServerSocketFactory(); SSLEngine engine = sslFactory.createSSLEngine(sslContext, "localhost", 9095, true); System.out.println(socketFactory.toString()); System.out.println(serverSocketFactory.toString()); System.out.println(engine.toString()); } catch (Exception e) { fail("Unexpected error in SSLFactory testing"); e.printStackTrace(); } }

Target:
public void testSSLFactory() throws Exception { SSLFactory sslFactory = TestUtils.createSSLFactory(); SSLContext sslContext = sslFactory.createSSLContext(); SSLSocketFactory socketFactory = sslContext.getSocketFactory(); SSLServerSocketFactory serverSocketFactory = sslContext.getServerSocketFactory(); SSLEngine engine = sslFactory.createSSLEngine(sslContext, "localhost", 9095, true); Assert.assertEquals(sslContext.getProtocol(), "TLS"); String[] enabledCipherSuites = engine.getEnabledCipherSuites(); Assert.assertEquals(enabledCipherSuites.length, 1); Assert.assertEquals(enabledCipherSuites[0], "TLS_RSA_WITH_AES_128_CBC_SHA256"); String[] enabledProtocols = engine.getEnabledProtocols(); Assert.assertEquals(enabledProtocols.length, 1); Assert.assertEquals(enabledProtocols[0], "TLSv1.2"); Assert.assertEquals(engine.getNeedClientAuth(), false); Assert.assertEquals(engine.getUseClientMode(), true); Assert.assertEquals(engine.getWantClientAuth(), false); System.out.println(socketFactory.toString()); System.out.println(serverSocketFactory.toString()); System.out.println(engine.toString()); }
Source:
public List<LogicalDeviceDto> getLogicalDevices() { return Collections.unmodifiableList(logicalDevices!=null?logicalDevices:new ArrayList<>()); }

Target:
public List<LogicalDeviceDto> getLogicalDevices() { return Collections.unmodifiableList(this.logicalDevices!=null?this.logicalDevices:new ArrayList<>()); }
Source:
private void importDatabase(String filePath) { ZipFile zipFile = null; try { zipFile = new ZipFile(filePath); } catch (IOException ioe) { Toast.makeText(getContext(), R.string.no_valid_zip_file, Toast.LENGTH_SHORT) .show(); return; } finally { try { zipFile.close(); } catch (Exception e){} } try { if (!databasesDir.exists() && !databasesDir.mkdir()) { throw new Exception("Could not create databases dir"); } if(!(ZipHelper.extractFileFromZip(filePath, newpipe_db.getPath(), "newpipe.db") && ZipHelper.extractFileFromZip(filePath, newpipe_db_journal.getPath(), "newpipe.db-journal"))) { Toast.makeText(getContext(), R.string.could_not_import_all_files, Toast.LENGTH_LONG) .show(); } if(ZipHelper.extractFileFromZip(filePath, newpipe_settings.getPath(), "newpipe.settings")) { AlertDialog.Builder alert = new AlertDialog.Builder(getContext()); alert.setTitle(R.string.import_settings); alert.setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); System.exit(0); } }); alert.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); loadSharedPreferences(newpipe_settings); System.exit(0); } }); alert.show(); } else { System.exit(0); } } catch (Exception e) { onError(e); } }

Target:
private void importDatabase(String filePath) { ZipFile zipFile = null; try { zipFile = new ZipFile(filePath); } catch (IOException ioe) { Toast.makeText(getContext(), R.string.no_valid_zip_file, Toast.LENGTH_SHORT) .show(); return; } finally { try { zipFile.close(); } catch (Exception e){} } try { if (!databasesDir.exists() && !databasesDir.mkdir()) { throw new Exception("Could not create databases dir"); } if(!(ZipHelper.extractFileFromZip(filePath, newpipe_db.getPath(), "newpipe.db") && ZipHelper.extractFileFromZip(filePath, newpipe_db_journal.getPath(), "newpipe.db-journal"))) { Toast.makeText(getContext(), R.string.could_not_import_all_files, Toast.LENGTH_LONG) .show(); } if(ZipHelper.extractFileFromZip(filePath, newpipe_settings.getPath(), "newpipe.settings")) { AlertDialog.Builder alert = new AlertDialog.Builder(getContext()); alert.setTitle(R.string.import_settings); alert.setNegativeButton(android.R.string.no, (dialog, which) -> { dialog.dismiss(); System.exit(0); }); alert.setPositiveButton(android.R.string.yes, (dialog, which) -> { dialog.dismiss(); loadSharedPreferences(newpipe_settings); System.exit(0); }); alert.show(); } else { System.exit(0); } } catch (Exception e) { onError(e); } }
Source:
public int getSourceOpt(int target) { try { return sources[target]; } catch (ArrayIndexOutOfBoundsException e) { throw new Mappings.NoElementException("invalid target " + target); } }

Target:
public int getSourceOpt(int target) { return sources[target]; }
Source:
private FeedbackSessionAttributes extractFeedbackSessionData() { InstructorFeedbackAddAction feedbackData = new InstructorFeedbackAddAction(); return feedbackData.extractFeedbackSessionData(); }

Target:
protected FeedbackSessionAttributes extractFeedbackSessionData() { return super.extractFeedbackSessionData(); }
Source:
public void setUp() { final Handle h = this.dbRule.getSharedHandle(); h.execute("CREATE TABLE uniq (id INTEGER PRIMARY KEY)"); }

Target:
public void setUp() { this.dbRule.getSharedHandle().execute("CREATE TABLE uniq (id INTEGER PRIMARY KEY)"); }
Source:
public Page<PoolTaskRest> findByUser(@Parameter(value = "uuid") UUID userID, Pageable pageable) { List<PoolTask> tasks = null; try { Context context = obtainContext(); EPerson ep = epersonService.find(context, userID); tasks = poolTaskService.findByEperson(context, ep); } catch (SQLException | AuthorizeException | IOException e) { throw new RuntimeException(e.getMessage(), e); } Page<PoolTaskRest> page = utils.getPage(tasks, pageable).map(converter); return page; }

Target:
public Page<PoolTaskRest> findByUser(@Parameter(value = "uuid") UUID userID, Pageable pageable) { List<PoolTask> tasks = null; try { Context context = obtainContext(); EPerson currentUser = context.getCurrentUser(); if (currentUser == null) { throw new RESTAuthorizationException( "This endpoint is available only to logged-in user" + " to search for their own pool tasks or the admins"); } if (authorizeService.isAdmin(context) || userID.equals(currentUser.getID())) { EPerson ep = epersonService.find(context, userID); tasks = poolTaskService.findByEperson(context, ep); } else { throw new RESTAuthorizationException("Only administrators can search for pool tasks of other users"); } } catch (AuthorizeException e) { throw new RESTAuthorizationException(e); } catch (SQLException | IOException e) { throw new RuntimeException(e.getMessage(), e); } Page<PoolTaskRest> page = utils.getPage(tasks, pageable).map(converter); return page; }
Source:
private synchronized void onReceipt(TransactionReceipt receipt, Block block, PendingTransactionState state) { ByteArrayWrapper txHashW = new ByteArrayWrapper(receipt.getTransaction().getHash()); if (contractAddressFilter.matchBloom(receipt.getBloomFilter())) { int txCount = 0; List<EventData> matchedTxs = new ArrayList<>(); for (LogInfo logInfo : receipt.getLogInfoList()) { if (contractAddressFilter.matchBloom(logInfo.getBloom()) && contractAddressFilter.matchesExactly(logInfo)) { EventData matchedTx = onLogMatch(logInfo, block, receipt, txCount, state); if (matchedTx != null) { txCount++; matchedTxs.add(matchedTx); } } } if (!matchedTxs.isEmpty()) { onEventData(receipt, block, state, matchedTxs); } } else if (state == PendingTransactionState.DROPPED && pendings.containsKey(txHashW)) { PendingEvent event = pendings.get(txHashW); onEventData(receipt, block, state, event.eventData); } }

Target:
private synchronized void onReceipt(TransactionReceipt receipt, Block block, PendingTransactionState state) { if (!initialized) throw new RuntimeException("Event listener should be initialized"); byte[] txHash = receipt.getTransaction().getHash(); if (logFilter.matchBloom(receipt.getBloomFilter())) { int txCount = 0; List<EventData> matchedTxs = new ArrayList<>(); for (LogInfo logInfo : receipt.getLogInfoList()) { if (logFilter.matchBloom(logInfo.getBloom()) && logFilter.matchesExactly(logInfo)) { EventData matchedTx = onLogMatch(logInfo, block, receipt, txCount, state); if (matchedTx != null) { txCount++; matchedTxs.add(matchedTx); } } } if (!matchedTxs.isEmpty()) { onEventData(receipt, block, state, matchedTxs); } } else if (state == PendingTransactionState.DROPPED && pendings.containsKey(txHash)) { PendingEvent event = pendings.get(txHash); onEventData(receipt, block, state, event.eventData); } }
Source:
private void processEmails(List<EmailMessage> emails, AbstractFile abstractFile) { List<AbstractFile> derivedFiles = new ArrayList<>(); EmailMessageThreader threader = new EmailMessageThreader(); threader.threadMessages(emails, String.format("%d", abstractFile.getId())); for (EmailMessage email : emails) { BlackboardArtifact msgArtifact = addEmailArtifact(email, abstractFile); if ((msgArtifact != null) && (email.hasAttachment())) { derivedFiles.addAll(handleAttachments(email.getAttachments(), abstractFile, msgArtifact )); } } if (derivedFiles.isEmpty() == false) { for (AbstractFile derived : derivedFiles) { services.fireModuleContentEvent(new ModuleContentEvent(derived)); } } context.addFilesToJob(derivedFiles); services.fireModuleDataEvent(new ModuleDataEvent(EmailParserModuleFactory.getModuleName(), BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG)); }

Target:
private void processEmails(List<EmailMessage> emails, AbstractFile abstractFile) { List<AbstractFile> derivedFiles = new ArrayList<>(); try{ EmailMessageThreader.threadMessages(emails, String.format("%d", abstractFile.getId())); } catch(Exception ex) { logger.log(Level.WARNING, String.format("Exception thrown parsing emails from %s", abstractFile.getName()), ex); } for (EmailMessage email : emails) { BlackboardArtifact msgArtifact = addEmailArtifact(email, abstractFile); if ((msgArtifact != null) && (email.hasAttachment())) { derivedFiles.addAll(handleAttachments(email.getAttachments(), abstractFile, msgArtifact )); } } if (derivedFiles.isEmpty() == false) { for (AbstractFile derived : derivedFiles) { services.fireModuleContentEvent(new ModuleContentEvent(derived)); } } context.addFilesToJob(derivedFiles); services.fireModuleDataEvent(new ModuleDataEvent(EmailParserModuleFactory.getModuleName(), BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG)); }
Source:
private static String exceptionName(TypeTree typeTree) { switch (typeTree.kind()) { case IDENTIFIER: return ((IdentifierTree) typeTree).name(); case MEMBER_SELECT: return ExpressionsHelper.concatenate((MemberSelectExpressionTree) typeTree); default: return null; } }

Target:
private static String exceptionName(TypeTree typeTree) { switch (typeTree.kind()) { case IDENTIFIER: return ((IdentifierTree) typeTree).name(); case MEMBER_SELECT: return ExpressionsHelper.concatenate((MemberSelectExpressionTree) typeTree); default: throw new IllegalStateException("Exceptions can not be specified other than with an identifier or a fully qualified name."); } }
Source:
public Observable<CategoryItem> searchAll(String term, List<String> imageTitleList) { if (TextUtils.isEmpty(term)) { Observable<CategoryItem> categoryItemObservable = gpsCategories() .concatWith(titleCategories(imageTitleList)); if (hasDirectCategories()) { categoryItemObservable.concatWith(directCategories().concatWith(recentCategories())); } return categoryItemObservable; } if (cacheContainsKey(term)) { return Observable.fromIterable(getCachedCategories(term)) .map(name -> new CategoryItem(name, false)); } return categoryClient .searchCategories(term, SEARCH_CATS_LIMIT) .map(name -> new CategoryItem(name, false)); }

Target:
public Observable<CategoryItem> searchAll(String term, List<String> imageTitleList) { if (TextUtils.isEmpty(term)) { Observable<CategoryItem> categoryItemObservable = gpsCategories() .concatWith(titleCategories(imageTitleList)); if (hasDirectCategories()) { categoryItemObservable.concatWith(directCategories().concatWith(recentCategories())); } return categoryItemObservable; } if (cacheContainsKey(term)) { return Observable.fromIterable(getCachedCategories(term)) .map(name -> new CategoryItem(name, false)); } return categoryClient .searchCategoriesForPrefix(term, SEARCH_CATS_LIMIT) .map(name -> new CategoryItem(name, false)); }
Source:
public Set<String> getRequiredParameterNames() { Set<String> result = new HashSet<>(groupId.getRequiredParameterNames()); result.addAll(artifactId.getRequiredParameterNames()); return result; }

Target:
public Set<String> getRequiredParameterNames() { Set<String> result = new HashSet<>(); if (groupId != null) result.addAll(groupId.getRequiredParameterNames()); if (artifactId != null) result.addAll(artifactId.getRequiredParameterNames()); return result; }
Source:
private boolean removeUDAFInSchema(String functionName) { for (int idx = 0; idx < m_schema.children.size(); idx++) { VoltXMLElement func = m_schema.children.get(idx); if ("ud_function".equals(func.name)) { String fnm = func.attributes.get("name"); if (fnm != null && functionName.equals(fnm)) { m_schema.children.remove(idx); m_tracker.addDroppedFunction(functionName); m_logger.debug(String.format("Removed XML for" + " function named %s", functionName)); return true; } } } return false; }

Target:
private boolean removeUDAFInSchema(String functionName) { for (int idx = 0; idx < m_schema.children.size(); idx++) { VoltXMLElement func = m_schema.children.get(idx); if ("ud_function".equals(func.name)) { String fnm = func.attributes.get("name"); if (fnm != null && functionName.equals(fnm)) { m_schema.children.remove(idx); m_tracker.addDroppedFunction(functionName); if (m_logger.isDebugEnabled()) { m_logger.debug(String.format("Removed XML for" + " function named %s", functionName)); } return true; } } } return false; }
Source:
protected ViewModel onValidSubmit(HttpServletRequest request, HttpServletResponse response, Form form) { Application application = (Application) request.getAttribute(Application.class.getName()); String email = form.getFieldValue("email"); Map<String, Object> model = new HashMap<String, Object>(); try { request.setAttribute("form", form); AccountStore accountStore = accountStoreResolver.getAccountStore(request, response); if (accountStore != null) { application.sendPasswordResetEmail(email, accountStore); } else { application.sendPasswordResetEmail(email); } } catch (ResourceException e) { if (isJsonPreferred(request, response)) { model.put("status", 200); model.put("message", "OK"); return new DefaultViewModel("stormpathJsonView", model); } if (e.getCode() != 404) { throw e; } } if (isJsonPreferred(request, response)) { model.put("status", 200); model.put("message", "OK"); return new DefaultViewModel("stormpathJsonView", model); } return new DefaultViewModel(nextUri).setRedirect(true); }

Target:
protected ViewModel onValidSubmit(HttpServletRequest request, HttpServletResponse response, Form form) { Application application = (Application) request.getAttribute(Application.class.getName()); String email = form.getFieldValue("email"); try { request.setAttribute("form", form); AccountStore accountStore = accountStoreResolver.getAccountStore(request, response); if (accountStore != null) { application.sendPasswordResetEmail(email, accountStore); } else { application.sendPasswordResetEmail(email); } } catch (ResourceException e) { if (isJsonPreferred(request, response)) { return new DefaultViewModel("stormpathJsonView"); } } if (isJsonPreferred(request, response)) { return new DefaultViewModel("stormpathJsonView"); } return new DefaultViewModel(nextUri).setRedirect(true); }
Source:
void run() throws Exception; } @AfterEach void tearDown(TestUtils setup, TestReference reference) throws Exception { runAsUser(setup, U2_USERNAME, USERS_PWD, () -> { setup.gotoPage("Main", "WebHome"); NotificationsTrayPage tray = new NotificationsTrayPage(); tray.clearAllNotifications(); }); runAsSuperAdmin(setup, () -> setup.deletePage(reference)); }

Target:
void run() throws Exception; } @Test @Order(1) void documentBody(TestUtils setup, TestReference reference) throws Exception { String pageName = "Mention Test Page"; runAsSuperAdmin(setup, () -> { setup.createUser(U1_USERNAME, USERS_PWD, null); setup.createUser(U2_USERNAME, USERS_PWD, null); }); runAsUser(setup, U1_USERNAME, USERS_PWD, () -> { setup.deletePage(reference); setup.createPage(reference, "{{mention reference=\"xwiki:XWiki.U2\" style=\"LOGIN\" anchor=\"test-mention-1\" /}}", pageName); }); runAsUser(setup, U2_USERNAME, USERS_PWD, () -> { setup.gotoPage("Main", "WebHome"); waitOnNotificationCount("xwiki:XWiki.U2", "xwiki", 1); reload(setup); NotificationsTrayPage tray = new NotificationsTrayPage(); tray.showNotificationTray(); assertEquals(1, tray.getNotificationsCount()); assertEquals(1, tray.getUnreadNotificationsCount()); assertEquals("mentions.mention", tray.getNotificationType(0)); String notificationContent = tray.getNotificationContent(0); String expected = "You have received one mention."; assertTrue(notificationContent.contains(expected), String.format("Notification content should contain [%s] but is [%s].", expected, notificationContent)); final WebElement rootElement = tray.getNotificationsButton(); MentionNotificationPage mentionNotificationPage = new MentionNotificationPage(rootElement); mentionNotificationPage.openGroup(0); assertEquals("mentioned you on page Mention Test Page", mentionNotificationPage.getText(0, 0)); assertEquals("U1", mentionNotificationPage.getEmitter(0, 0)); assertTrue(mentionNotificationPage.hasSummary(0, 0)); assertEquals("@U2", mentionNotificationPage.getSummary(0, 0)); tray.clearAllNotifications(); }); }
Source:
private Broker findNewLeader(Broker oldLeader) throws InterruptedException { long retryCnt = 0; while (true) { PartitionMetadata metadata = findLeader(); if (metadata != null) { replicaBrokers.clear(); for (Broker replica : metadata.replicas()) { replicaBrokers.add(new KafkaBroker(replica.host(), replica.port())); } log.debug("Got new Kafka leader metadata : [%s], previous leader : [%s]", metadata, oldLeader); Broker newLeader = metadata.leader(); if (newLeader != null) { if (oldLeader == null || isValidNewLeader(newLeader) || retryCnt != 0) { return newLeader; } } } Thread.sleep(RETRY_INTERVAL); retryCnt++; if (retryCnt >= 3 && (retryCnt - 3) % 5 == 0) { log.warn("cannot find leader for [%s] - [%s] after [%s] retries", topic, partitionId, retryCnt); replicaBrokers.clear(); replicaBrokers.addAll(allBrokers); } } }

Target:
private Broker findNewLeader(Broker oldLeader) throws InterruptedException { long retryCnt = 0; while (true) { PartitionMetadata metadata = findLeader(); if (metadata != null) { replicaBrokers.clear(); for (Broker replica : metadata.replicas()) { replicaBrokers.add( HostAndPort.fromParts(replica.host(), replica.port()) ); } log.debug("Got new Kafka leader metadata : [%s], previous leader : [%s]", metadata, oldLeader); Broker newLeader = metadata.leader(); if (newLeader != null) { if (oldLeader == null || isValidNewLeader(newLeader) || retryCnt != 0) { return newLeader; } } } Thread.sleep(RETRY_INTERVAL); retryCnt++; if (retryCnt >= 3 && (retryCnt - 3) % 5 == 0) { log.warn("cannot find leader for [%s] - [%s] after [%s] retries", topic, partitionId, retryCnt); replicaBrokers.clear(); replicaBrokers.addAll(allBrokers); } } }
Source:
public void run(SparkExecutionPluginContext context, JavaRDD<StructuredRecord> input) throws Exception { if (input == null) { return; } JavaSparkContext javaSparkContext = context.getSparkContext(); SQLContext sqlContext = new SQLContext(javaSparkContext); Set<String> inputCols = new LinkedHashSet<>(); inputCols.add(config.inputCol); List<StructField> structField = SparkUtils.getStructFieldList(input.first().getSchema().getFields(), inputCols); schema = new StructType(structField.toArray(new StructField[structField.size()])); JavaRDD<Row> rowRDD = SparkUtils.convertJavaRddStructuredRecordToJavaRddRows(input, schema); DataFrame documentDF = sqlContext.createDataFrame(rowRDD, schema); Word2Vec word2Vec = new Word2Vec() .setInputCol(config.inputCol + "-transformed") .setVectorSize(config.vectorSize) .setMinCount(config.minCount) .setNumPartitions(config.numPartitions) .setMaxIter(config.numIterations) .setWindowSize(config.windowSize); Word2VecModel model = word2Vec.fit(documentDF); FileSet outputFS = context.getDataset(config.fileSetName); model.save(outputFS.getBaseLocation().append(config.path).toURI().getPath()); }

Target:
public void run(SparkExecutionPluginContext context, JavaRDD<StructuredRecord> input) throws Exception { if (input.isEmpty()) { return; } final String fieldName = config.inputCol; JavaRDD<Iterable<String>> textRDD = input.map(new Function<StructuredRecord, Iterable<String>>() { @Override public Iterable<String> call(StructuredRecord input) throws Exception { splitter = (splitter == null) ? Splitter.on(Pattern.compile(config.pattern)) : splitter; return SparkUtils.getInputFieldValue(input, fieldName, splitter); } }); Word2Vec word2Vec = new Word2Vec() .setVectorSize(config.vectorSize) .setMinCount(config.minCount) .setNumPartitions(config.numPartitions) .setNumIterations(config.numIterations) .setWindowSize(config.windowSize); Word2VecModel model = word2Vec.fit(textRDD); FileSet outputFS = context.getDataset(config.fileSetName); model.save(context.getSparkContext().sc(), outputFS.getBaseLocation().append(config.path).toURI().getPath()); }
Source:
public Page<Event> getEvents(Set<String> tenantIds, EventsCriteria criteria, Pager pager) throws Exception { if (isEmpty(tenantIds)) { throw new IllegalArgumentException("TenantIds must be not null"); } List<Event> events = new ArrayList<>(); if (tenantIds.size() == 1) { events.addAll(getEvents(tenantIds.iterator().next(), criteria)); } else { TreeSet<String> orderedTenantsIds = new TreeSet<>(tenantIds); List<Future> futures = new ArrayList<>(); orderedTenantsIds.stream().forEach(tenantId -> { futures.add(executor.submit(() -> { try { List<Event> tenantEvents = getEvents(tenantId, criteria); synchronized (events) { events.addAll(tenantEvents); } } catch (Exception e) { msgLog.errorDatabaseException(e.getMessage()); } })); }); futures.stream().forEach(f -> { try { f.get(); } catch (Exception e) { msgLog.errorDatabaseException(e.getMessage()); } }); } if (events.isEmpty()) { return new Page<>(events, pager, 0); } else { return prepareEventsPage(events, pager); } }

Target:
public Page<Event> getEvents(Set<String> tenantIds, EventsCriteria criteria, Pager pager) throws Exception { if (isEmpty(tenantIds)) { throw new IllegalArgumentException("TenantIds must be not null"); } List<Event> events = new ArrayList<>(); if (tenantIds.size() == 1) { events.addAll(getEvents(tenantIds.iterator().next(), criteria)); } else { TreeSet<String> orderedTenantIds = new TreeSet<>(tenantIds); List<Future> futures = new ArrayList<>(); orderedTenantIds.stream().forEach(tenantId -> { futures.add(executor.submit(() -> { try { List<Event> tenantEvents = getEvents(tenantId, criteria); synchronized (events) { events.addAll(tenantEvents); } } catch (Exception e) { msgLog.errorDatabaseException(e.getMessage()); } })); }); futures.stream().forEach(f -> { try { f.get(); } catch (Exception e) { msgLog.errorDatabaseException(e.getMessage()); } }); } if (events.isEmpty()) { return new Page<>(events, pager, 0); } else { return prepareEventsPage(events, pager); } }
Source:
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { PluginResult.Status status = PluginResult.Status.OK; String result = ""; try { if (action.equals("clearCache")) { this.clearCache(); } else if (action.equals("show")) { cordova.getActivity().runOnUiThread(new Runnable() { public void run() { webView.getPluginManager().postMessage("spinner", "stop"); } }); } else if (action.equals("loadUrl")) { this.loadUrl(args.getString(0), args.optJSONObject(1)); } else if (action.equals("cancelLoadUrl")) { } else if (action.equals("clearHistory")) { this.clearHistory(); } else if (action.equals("backHistory")) { this.backHistory(); } else if (action.equals("overrideButton")) { this.overrideButton(args.getString(0), args.getBoolean(1)); } else if (action.equals("overrideBackbutton")) { this.overrideBackbutton(args.getBoolean(0)); } else if (action.equals("exitApp")) { this.exitApp(); } else if (action.equals("messageChannel")) { messageChannel = callbackContext; if(pendingResume != null) { sendEventMessage(pendingResume); pendingResume = null; } return true; } callbackContext.sendPluginResult(new PluginResult(status, result)); return true; } catch (JSONException e) { callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION)); return false; } }

Target:
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { PluginResult.Status status = PluginResult.Status.OK; String result = ""; try { if (action.equals("clearCache")) { this.clearCache(); } else if (action.equals("show")) { cordova.getActivity().runOnUiThread(new Runnable() { public void run() { webView.getPluginManager().postMessage("spinner", "stop"); } }); } else if (action.equals("loadUrl")) { this.loadUrl(args.getString(0), args.optJSONObject(1)); } else if (action.equals("cancelLoadUrl")) { } else if (action.equals("clearHistory")) { this.clearHistory(); } else if (action.equals("backHistory")) { this.backHistory(); } else if (action.equals("overrideButton")) { this.overrideButton(args.getString(0), args.getBoolean(1)); } else if (action.equals("overrideBackbutton")) { this.overrideBackbutton(args.getBoolean(0)); } else if (action.equals("exitApp")) { this.exitApp(); } else if (action.equals("messageChannel")) { synchronized(messageChannelLock) { messageChannel = callbackContext; if (pendingResume != null) { sendEventMessage(pendingResume); pendingResume = null; } } return true; } callbackContext.sendPluginResult(new PluginResult(status, result)); return true; } catch (JSONException e) { callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION)); return false; } }
Source:
public DummyExchangeAndWalletAndSource(String fiatCurrency, String cryptoCurrency, String walletAddress) throws IllegalArgumentException { if (fiatCurrency == null || cryptoCurrency == null) { throw new NullPointerException("Fiat and crypto currency has to be specified."); } if (cryptoCurrency.equals(Currencies.BTC) || cryptoCurrency.equals(Currencies.ETH) || cryptoCurrency.equals(Currencies.DASH) || cryptoCurrency.equals(Currencies.XMR) || cryptoCurrency.equals(Currencies.LTC)) { if (walletAddress != null) { throw new IllegalArgumentException("Build in wallet is used for BTC, LTC, ETH, DASH, XMR crypto currencies."); } } else { if (walletAddress == null || "".equals(walletAddress)) { throw new IllegalArgumentException("Wallet address has to be specified."); } this.walletAddress = walletAddress; } this.cryptoCurrency = cryptoCurrency; this.fiatCurrency = fiatCurrency; }

Target:
public DummyExchangeAndWalletAndSource(String fiatCurrency, String cryptoCurrency, String walletAddress) throws IllegalArgumentException { if (fiatCurrency == null || cryptoCurrency == null) { throw new NullPointerException("Fiat and crypto currency has to be specified."); } if (cryptoCurrency.equals(Currencies.BTC) || cryptoCurrency.equals(Currencies.ETH) || cryptoCurrency.equals(Currencies.DASH) || cryptoCurrency.equals(Currencies.XMR) || cryptoCurrency.equals(Currencies.LTC)) { if (walletAddress != null) { throw new IllegalArgumentException("Built-in wallet is used for BTC, LTC, ETH, DASH, XMR crypto currencies."); } } else { if (walletAddress == null || "".equals(walletAddress)) { throw new IllegalArgumentException("Wallet address has to be specified."); } this.walletAddress = walletAddress; } this.cryptoCurrency = cryptoCurrency; this.fiatCurrency = fiatCurrency; }
Source:
private void checkIfDeleteIsAllowed(EntitySelection entitySelection, XClassBreakingQuestion question) { DocumentReference documentReference = (DocumentReference) entitySelection.getEntityReference(); String query = "select distinct doc.fullName from XWikiDocument doc, BaseObject obj where " + "doc.fullName=obj.name and obj.className=:className"; String serializedReference = serializer.serialize(documentReference); String className = serializedReference.substring(serializedReference.indexOf(":") + 1); try { List<String> results = this.queryManager.createQuery(query, Query.HQL) .bindValue("className", className) .setWiki(documentReference.getWikiReference().getName()).setLimit(10) .<String>execute(); if (results.isEmpty()) { question.markAsFreePage(entitySelection); } else { for (String documentObjectName : results) { question.markImpactedObject(entitySelection, serializedReference, documentObjectName); } } } catch (QueryException e) { e.printStackTrace(); } }

Target:
private void checkIfDeleteIsAllowed(EntitySelection entitySelection, XClassBreakingQuestion question) { int queryLimit = 25; DocumentReference classReference = (DocumentReference) entitySelection.getEntityReference(); String query = "select distinct obj.name from BaseObject obj where obj.className=:className " + "order by obj.name asc"; String className = localSerializer.serialize(classReference); try { List<String> results = this.queryManager.createQuery(query, Query.HQL) .setLimit(queryLimit) .bindValue("className", className) .setWiki(classReference.getWikiReference().getName()) .<String>execute(); if (results.isEmpty()) { question.markAsFreePage(entitySelection); } else { if (results.size() == queryLimit) { question.setObjectsPotentiallyHidden(true); } for (String documentObjectName : results) { EntityReference documentObjectReference = this.resolver.resolve(documentObjectName, EntityType.DOCUMENT, classReference); question.markImpactedObject(entitySelection, documentObjectReference); } } } catch (QueryException e) { logger.error("Error while executing query to retrieve objects linked to an XClass.", e); } }
Source:
public FeedbackQuestionAttributes createFeedbackQuestionNoIntegrityCheck( FeedbackQuestionAttributes fqa, int questionNumber) throws InvalidParametersException, EntityDoesNotExistException { fqa.questionNumber = questionNumber; fqa.removeIrrelevantVisibilityOptions(); return fqDb.createFeedbackQuestionWithoutIntegrityCheck(fqa); }

Target:
public FeedbackQuestionAttributes createFeedbackQuestionNoIntegrityCheck( FeedbackQuestionAttributes fqa, int questionNumber) throws InvalidParametersException { fqa.questionNumber = questionNumber; fqa.removeIrrelevantVisibilityOptions(); return fqDb.createFeedbackQuestionWithoutIntegrityCheck(fqa); }
Source:
private static List<Allele> makeAlleles(Collection<Allele> alleles) { final List<Allele> alleleList = new ArrayList<>(alleles.size()); boolean sawRef = false; for ( final Allele a : alleles ) { for ( int i = 0; i < alleleList.size(); i++ ) { if ( a.equals(alleleList.get(i), true) ) { throw new IllegalArgumentException("Duplicate allele added to VariantContext: " + a); } } if ( a.isReference() ) { if ( sawRef ) throw new IllegalArgumentException("Alleles for a VariantContext must contain at most one reference allele: " + alleles); alleleList.add(0, a); sawRef = true; } else alleleList.add(a); } if ( alleleList.isEmpty() ) throw new IllegalArgumentException("Cannot create a VariantContext with an empty allele list"); if ( alleleList.get(0).isNonReference() ) throw new IllegalArgumentException("Alleles for a VariantContext must contain at least one reference allele: " + alleles); return alleleList; }

Target:
private static List<Allele> makeAlleles(Collection<Allele> alleles) { final List<Allele> alleleList = new ArrayList<>(alleles.size()); boolean sawRef = false; for ( final Allele a : alleles ) { for (int i = 0, alleleListSize = alleleList.size(); i < alleleListSize; i++) { if (a.equals(alleleList.get(i), true)) { throw new IllegalArgumentException("Duplicate allele added to VariantContext: " + a); } } if ( a.isReference() ) { if ( sawRef ) throw new IllegalArgumentException("Alleles for a VariantContext must contain at most one reference allele: " + alleles); alleleList.add(0, a); sawRef = true; } else alleleList.add(a); } if ( alleleList.isEmpty() ) throw new IllegalArgumentException("Cannot create a VariantContext with an empty allele list"); if ( alleleList.get(0).isNonReference() ) throw new IllegalArgumentException("Alleles for a VariantContext must contain at least one reference allele: " + alleles); return alleleList; }
Source:
public JdbcConnectivityParamsState( String name, String driverClass, String url, String user, String password, boolean pooling, Optional<String> jar, Optional<String> prepareStatement, Optional<String> kerberosPrincipal, Optional<String> kerberosKeytab) { this.name = name; this.driverClass = driverClass; this.url = url; this.user = user; this.password = password; this.pooling = pooling; this.jar = jar; this.prepareStatement = prepareStatement; this.kerberosPrincipal = kerberosPrincipal; this.kerberosKeytab = kerberosKeytab; }

Target:
private JdbcConnectivityParamsState( String name, String driverClass, String url, String user, String password, boolean pooling, Optional<String> jar, Optional<String> prepareStatement, Optional<String> kerberosPrincipal, Optional<String> kerberosKeytab) { this.name = requireNonNull(name, "name is null"); this.driverClass = requireNonNull(driverClass, "driverClass is null"); this.url = requireNonNull(url, "url is null"); this.user = requireNonNull(user, "user is null"); this.password = requireNonNull(password, "password is null"); this.pooling = pooling; this.jar = requireNonNull(jar, "jar is null"); this.prepareStatement = requireNonNull(prepareStatement, "prepareStatement is null"); this.kerberosPrincipal = requireNonNull(kerberosPrincipal, "kerberosPrincipal is null"); this.kerberosKeytab = requireNonNull(kerberosKeytab, "kerberosKeytab is null"); }
Source:
public void setUp() { h = dbRule.getSharedHandle(); h.registerRowMapper(ImmutablesMapperFactory.mapImmutable(Train.class, ImmutableTrain.class, ImmutableTrain::builder)); h.execute("create table train (name varchar, carriages int, observation_car boolean)"); dao = h.attach(Dao.class); }

Target:
public void setUp() { h = dbRule.getSharedHandle(); h.execute("create table train (name varchar, carriages int, observation_car boolean)"); dao = h.attach(Dao.class); }
Source:
private void assertPaginatedClients(int start, int end, List<ClientRepresentation> actual) { List<String> expected = new LinkedList<>(); for (int i = start; i <= end; i++) { expected.add("ccx-" + (i < 10 ? "0" + i : i)); } List<String> a = actual.stream().map(rep -> rep.getClientId()).collect(Collectors.toList()); assertThat(a, Matchers.hasSize(expected.size())); assertThat(a, Matchers.containsInAnyOrder(expected.toArray())); }

Target:
private void assertPaginatedClients(int start, int end, List<ClientRepresentation> actual) { List<String> expected = new LinkedList<>(); for (int i = start; i <= end; i++) { expected.add("ccx-" + (i < 10 ? "0" + i : i)); } List<String> a = actual.stream().map(rep -> rep.getClientId()).collect(Collectors.toList()); assertThat(a, is(expected)); }
Source:
public void setup(){ MockitoAnnotations.initMocks(this); executorService = Executors.newCachedThreadPool(); }

Target:
public void setup(){ MockitoAnnotations.initMocks(this); }
Source:
private int getUpdatedCaretPosition(StringBuilder currentCalculatedMessage, int currentCaretPosition, CommitMessageWithCaretPosition messageWithPosition, ICommitMessageProvider2 provider) { int pos = currentCaretPosition; if (!isCaretPositionSet) { pos += currentCalculatedMessage.length(); if (currentCalculatedMessage.length() > 0) { pos += MESSAGE_SEPARATOR.length(); } pos += messageWithPosition.getDesiredCaretPosition(); isCaretPositionSet = true; } else { Activator .logWarning( MessageFormat.format( UIText.CommitDialog_MultipleCommitMessageProvider2Implementations, provider.getClass().getName()), null); } return pos; }

Target:
private int getUpdatedCaretPosition(StringBuilder currentCalculatedMessage, int currentCaretPosition, CommitMessageWithCaretPosition messageWithPosition, ICommitMessageProvider2 provider) { int pos = currentCaretPosition; if (currentCaretPosition == CommitMessageWithCaretPosition.NO_POSITION) { if (messageWithPosition .getDesiredCaretPosition() == CommitMessageWithCaretPosition.NO_POSITION) { return pos; } if (messageWithPosition .getDesiredCaretPosition() > messageWithPosition .getMessage().length() || messageWithPosition .getDesiredCaretPosition() < CommitMessageWithCaretPosition.NO_POSITION) { Activator.logWarning( MessageFormat.format( UIText.CommitDialog_CaretPositionOutOfBounds, provider.getClass().getName(), messageWithPosition.getDesiredCaretPosition()), null); return CommitMessageWithCaretPosition.NO_POSITION; } else { pos = currentCalculatedMessage.length(); if (currentCalculatedMessage.length() > 0) { pos += MESSAGE_SEPARATOR.length(); } pos += messageWithPosition.getDesiredCaretPosition(); } } else { Activator .logWarning( MessageFormat.format( UIText.CommitDialog_MultipleCommitMessageProvider2Implementations, provider.getClass().getName()), null); } return pos; }
Source:
private CoordinateConverter() { double lineHeigth = FigureUtilities.getFontMetrics(null).getHeight(); transformationScale = lineHeigth / 100.0; }

Target:
private CoordinateConverter() { double lineHeight = FigureUtilities.getFontMetrics(null).getHeight(); transformationScale = lineHeight / 100.0; }
Source:
private List<Future<UpdateCenter.UpdateCenterJob>> install(@Nonnull Collection<String> plugins, boolean dynamicLoad, @CheckForNull UUID correlationId) { List<Future<UpdateCenter.UpdateCenterJob>> installJobs = new ArrayList<>(); for (String n : plugins) { int index = n.indexOf('.'); UpdateSite.Plugin p = null; if (index == -1) { p = getPlugin(n, UpdateCenter.ID_DEFAULT); } else { while (index != -1) { if (index + 1 >= n.length()) { break; } String pluginName = n.substring(0, index); String siteName = n.substring(index + 1); UpdateSite.Plugin plugin = getPlugin(pluginName, siteName); if (plugin != null) { if (p != null) { throw new Failure("Ambiguous plugin: " + n); } p = plugin; } index = n.indexOf('.', index + 1); } } if (p == null) { throw new Failure("No such plugin: " + n); } for(PluginWrapper.Dependency previouslyBundledDependency : ClassicPluginStrategy.getPreviouslyBundledDependencies(p.requiredCore)) { if(getPlugin(previouslyBundledDependency.shortName) == null) { UpdateSite.Plugin previouslyBundledPlugin = getPlugin(previouslyBundledDependency.shortName, UpdateCenter.ID_DEFAULT); Future<UpdateCenter.UpdateCenterJob> jobFuture = previouslyBundledPlugin.deploy(dynamicLoad, correlationId); installJobs.add(jobFuture); } } Future<UpdateCenter.UpdateCenterJob> jobFuture = p.deploy(dynamicLoad, correlationId); installJobs.add(jobFuture); } if (Jenkins.getActiveInstance().getInstallState() == InstallState.NEW) { trackInitialPluginInstall(installJobs); } return installJobs; }

Target:
private List<Future<UpdateCenter.UpdateCenterJob>> install(@Nonnull Collection<String> plugins, boolean dynamicLoad, @CheckForNull UUID correlationId) { List<Future<UpdateCenter.UpdateCenterJob>> installJobs = new ArrayList<>(); for (String n : plugins) { int index = n.indexOf('.'); UpdateSite.Plugin p = null; if (index == -1) { p = getPlugin(n, UpdateCenter.ID_DEFAULT); } else { while (index != -1) { if (index + 1 >= n.length()) { break; } String pluginName = n.substring(0, index); String siteName = n.substring(index + 1); UpdateSite.Plugin plugin = getPlugin(pluginName, siteName); if (plugin != null) { if (p != null) { throw new Failure("Ambiguous plugin: " + n); } p = plugin; } index = n.indexOf('.', index + 1); } } if (p == null) { throw new Failure("No such plugin: " + n); } Future<UpdateCenter.UpdateCenterJob> jobFuture = p.deploy(dynamicLoad, correlationId); installJobs.add(jobFuture); } if (Jenkins.getActiveInstance().getInstallState() == InstallState.NEW) { trackInitialPluginInstall(installJobs); } return installJobs; }
Source:
public PlanNode visitFilter(FilterNode node, RewriteContext<Expression> context) { PlanNode rewrittenPlan = context.rewrite(node.getSource(), combineConjuncts(node.getPredicate(), context.get())); if (!(rewrittenPlan instanceof FilterNode) || !expressionEquivalence.areExpressionsEquivalent(session, ((FilterNode) rewrittenPlan).getPredicate(), node.getPredicate(), types)) { return rewrittenPlan; } return node; }

Target:
public PlanNode visitFilter(FilterNode node, RewriteContext<Expression> context) { PlanNode rewrittenPlan = context.rewrite(node.getSource(), combineConjuncts(node.getPredicate(), context.get())); if (!(rewrittenPlan instanceof FilterNode)) { return rewrittenPlan; } FilterNode rewrittenFilterNode = (FilterNode) rewrittenPlan; if (!areExpressionsEquivalent(rewrittenFilterNode.getPredicate(), node.getPredicate()) || node.getSource() != rewrittenFilterNode.getSource()) { return rewrittenPlan; } return node; }