auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onBackPressed() { if (mDrawerLayout != null && mDrawerLayout.isDrawerOpen(GravityCompat.START)) { mDrawerLayout.closeDrawer(Gravity.LEFT); } else { if (doubleBackToExitPressedOnce) { setMenuCreateClient(true); setMenuCreateCentre(true); setMenuCreateGroup(true); super.onBackPressed(); return; } this.doubleBackToExitPressedOnce = true; Toast.makeText(this, R.string.back_again, Toast.LENGTH_SHORT).show(); new android.os.Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce = false; } }, 2000); } }

Target:
public void onBackPressed() { if (mDrawerLayout != null && mDrawerLayout.isDrawerOpen(GravityCompat.START)) { mDrawerLayout.closeDrawer(Gravity.LEFT); } else { if (doubleBackToExitPressedOnce) { setMenuCreateClient(true); setMenuCreateCentre(true); setMenuCreateGroup(true); super.onBackPressed(); return; } this.doubleBackToExitPressedOnce = true; Toast.makeText(this, R.string.back_again, Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override public void run() { doubleBackToExitPressedOnce = false; } }, 2000); } }
Source:
public Collection<SideEffect> getSupportedSideEffects() { return Lists.newArrayList(); }

Target:
public Set<SideEffect> getSupportedSideEffects() { return ImmutableSet.of(); }
Source:
private void enableConnectivityChangeReceiver(boolean enable) { if(getSettings().isAutoSyncQueueEnabled()) { Log.d(TAG, "onOfflineQueueChangedEvent() enable connectivity change receiver: " + enable); Settings.enableConnectivityChangeReceiver(getContext(), enable); } }

Target:
private void enableConnectivityChangeReceiver(boolean enable) { if(getSettings().isAutoSyncQueueEnabled()) { Log.d(TAG, "enableConnectivityChangeReceiver() enable connectivity change receiver: " + enable); Settings.enableConnectivityChangeReceiver(getContext(), enable); } }
Source:
public static boolean isJava7OrAbove() { return isJavaSpecAtLeast(7); }

Target:
public static boolean isJava7OrAbove() { return true; }
Source:
private List<Expression> extractColumnData(final int uiColumnIndex) { final int iiIndex = uiColumnIndex - RelationUIModelMapperHelper.ROW_INDEX_COLUMN_COUNT; final List<Expression> values = relation.getRow().stream().map(row -> row.getExpression().get(iiIndex)).collect(Collectors.toList()); return values; }

Target:
private List<Expression> extractColumnData(final int uiColumnIndex) { final int iiIndex = uiColumnIndex - RelationUIModelMapperHelper.ROW_INDEX_COLUMN_COUNT; return relation.getRow() .stream() .map(row -> row.getExpression().get(iiIndex)) .collect(Collectors.toList()); }
Source:
private void init() throws IOException { final long begin = System.nanoTime(); structurePanel.show(); metadataPanel.showLogical(getSelectedStructure()); metadataPanel.showPhysical(getSelectedMediaUnit()); galleryPanel.show(); paginationPanel.show(); commentPanel.show(); addDocStrucTypeDialog.prepare(); addMediaUnitDialog.prepare(); editPagesDialog.prepare(); if (logger.isTraceEnabled()) { logger.trace("Initializing editor beans took ms", TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - begin)); } }

Target:
private void init() { final long begin = System.nanoTime(); structurePanel.show(); metadataPanel.showLogical(getSelectedStructure()); metadataPanel.showPhysical(getSelectedMediaUnit()); galleryPanel.show(); paginationPanel.show(); addDocStrucTypeDialog.prepare(); addMediaUnitDialog.prepare(); editPagesDialog.prepare(); if (logger.isTraceEnabled()) { logger.trace("Initializing editor beans took ms", TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - begin)); } }
Source:
protected String parseResourceName(String line) { if (line == null) { return null; } for (String template : COMPILER_COMMAND_PATTERN_TEMPLATES) { String pattern = makePattern(template); Matcher fileMatcher = Pattern.compile(pattern).matcher(line); if (fileMatcher.matches()) { int fileGroup = adjustFileGroup(); String sourceFileName = fileMatcher.group(fileGroup); return sourceFileName; } } return null; }

Target:
protected String parseResourceName(String line) { if (line == null) { return null; } if (compilerPatterns == null) { compilerPatterns = new Pattern[COMPILER_COMMAND_PATTERN_TEMPLATES.length]; for (int i = 0; i < COMPILER_COMMAND_PATTERN_TEMPLATES.length; i++) { String patternTemplate = COMPILER_COMMAND_PATTERN_TEMPLATES[i]; String patternString = makePattern(patternTemplate); compilerPatterns[i] = Pattern.compile(patternString); } } for (Pattern pattern : compilerPatterns) { Matcher fileMatcher = pattern.matcher(line); if (fileMatcher.matches()) { int fileGroup = adjustFileGroup(); String sourceFileName = fileMatcher.group(fileGroup); return sourceFileName; } } return null; }
Source:
public final Set<Class<?>> scan(Class<? extends Annotation>... annotationTypes) throws ClassNotFoundException { List<String> packages = getPackages(); if (packages.isEmpty()) { return Collections.emptySet(); } ClassPathScanningCandidateComponentProvider scanner; if (this.excludeAbstractClasses) { scanner = new ClassPathScanningCandidateComponentProvider(false); } else { scanner = new ClassPathScanningCandidateComponentProvider(false) { @Override protected boolean isCandidateComponent(AnnotatedBeanDefinition beanDefinition) { AnnotationMetadata metadata = beanDefinition.getMetadata(); return metadata.isIndependent(); } }; } scanner.setEnvironment(this.context.getEnvironment()); scanner.setResourceLoader(this.context); for (Class<? extends Annotation> annotationType : annotationTypes) { scanner.addIncludeFilter(new AnnotationTypeFilter(annotationType)); } Set<Class<?>> entitySet = new HashSet<>(); for (String basePackage : packages) { if (StringUtils.hasText(basePackage)) { for (BeanDefinition candidate : scanner.findCandidateComponents(basePackage)) { entitySet.add(ClassUtils.forName(candidate.getBeanClassName(), this.context.getClassLoader())); } } } return entitySet; }

Target:
public final Set<Class<?>> scan(Class<? extends Annotation>... annotationTypes) throws ClassNotFoundException { List<String> packages = getPackages(); if (packages.isEmpty()) { return Collections.emptySet(); } for (Class<? extends Annotation> annotationType : annotationTypes) { this.componentProvider.addIncludeFilter(new AnnotationTypeFilter(annotationType)); } Set<Class<?>> entitySet = new HashSet<>(); for (String basePackage : packages) { if (StringUtils.hasText(basePackage)) { for (BeanDefinition candidate : this.componentProvider.findCandidateComponents(basePackage)) { entitySet.add(ClassUtils.forName(candidate.getBeanClassName(), this.context.getClassLoader())); } } } return entitySet; }
Source:
public void start() throws Exception { JsonObject config = new JsonObject().put("url", "jdbc:hsqldb:mem:test?shutdown=true") .put("driver_class", "org.hsqldb.jdbcDriver"); JDBCClient jdbc = JDBCClient.createShared(vertx, config); jdbc.rxGetConnection().subscribe( conn -> { conn.rxUpdate("CREATE TABLE test(col VARCHAR(20))"). flatMap(result -> conn.rxUpdate("INSERT INTO test (col) VALUES ('val1')")). flatMap(result -> conn.rxUpdate("INSERT INTO test (col) VALUES ('val2')")). flatMap(result -> conn.rxQueryStream("SELECT * FROM test")).subscribe( rowStream -> { rowStream.toObservable().subscribe( row -> System.out.println("Row : " + row.encode()), Throwable::printStackTrace, conn::close ); }, Throwable::printStackTrace); }, Throwable::printStackTrace ); }

Target:
public void start() throws Exception { JsonObject config = new JsonObject().put("url", "jdbc:hsqldb:mem:test?shutdown=true") .put("driver_class", "org.hsqldb.jdbcDriver"); JDBCClient jdbc = JDBCClient.createShared(vertx, config); jdbc.rxGetConnection(). flatMap(conn -> conn.rxUpdate("CREATE TABLE test(col VARCHAR(20))"). flatMap(result -> conn.rxUpdate("INSERT INTO test (col) VALUES ('val1')")). flatMap(result -> conn.rxUpdate("INSERT INTO test (col) VALUES ('val2')")). flatMap(result -> conn.rxQueryStream("SELECT * FROM test"))). flatMapObservable(SQLRowStream::toObservable). subscribe( row -> System.out.println("Row : " + row.encode()) ); }
Source:
public static void registerDefaultRules(RelOptPlanner planner, boolean enableMaterialziations, boolean enableBindable) { if (CalciteSystemProperty.ENABLE_COLLATION_TRAIT.value()) { registerAbstractRelationalRules(planner); } registerAbstractRules(planner); registerBaseRules(planner); if (enableMaterialziations) { registerMaterializationRules(planner); } if (enableBindable) { for (RelOptRule rule : Bindables.RULES) { planner.addRule(rule); } } planner.addRule(Bindables.BINDABLE_TABLE_SCAN_RULE); planner.addRule(ProjectTableScanRule.INSTANCE); planner.addRule(ProjectTableScanRule.INTERPRETER); if (CalciteSystemProperty.ENABLE_ENUMERABLE.value()) { registerEnumerableRules(planner); planner.addRule(EnumerableInterpreterRule.INSTANCE); } if (enableBindable && CalciteSystemProperty.ENABLE_ENUMERABLE.value()) { planner.addRule( EnumerableBindable.EnumerableToBindableConverterRule.INSTANCE); } if (CalciteSystemProperty.ENABLE_STREAM.value()) { for (RelOptRule rule : StreamRules.RULES) { planner.addRule(rule); } } if (false) { registerReductionRules(planner); } else { planner.addRule(ReduceExpressionsRule.FILTER_INSTANCE); } }

Target:
public static void registerDefaultRules(RelOptPlanner planner, boolean enableMaterialziations, boolean enableBindable) { if (CalciteSystemProperty.ENABLE_COLLATION_TRAIT.value()) { registerAbstractRelationalRules(planner); } registerAbstractRules(planner); registerBaseRules(planner); if (enableMaterialziations) { registerMaterializationRules(planner); } if (enableBindable) { for (RelOptRule rule : Bindables.RULES) { planner.addRule(rule); } } planner.addRule(Bindables.BINDABLE_TABLE_SCAN_RULE); planner.addRule(ProjectTableScanRule.INSTANCE); planner.addRule(ProjectTableScanRule.INTERPRETER); if (CalciteSystemProperty.ENABLE_ENUMERABLE.value()) { registerEnumerableRules(planner); planner.addRule(EnumerableInterpreterRule.INSTANCE); } if (enableBindable && CalciteSystemProperty.ENABLE_ENUMERABLE.value()) { planner.addRule( EnumerableBindable.EnumerableToBindableConverterRule.INSTANCE); } if (CalciteSystemProperty.ENABLE_STREAM.value()) { for (RelOptRule rule : StreamRules.RULES) { planner.addRule(rule); } } planner.addRule(ReduceExpressionsRule.FILTER_INSTANCE); }
Source:
private void loadSubscriptions() { if (disposable != null) { disposable.dispose(); } emptyView.hide(); progressBar.setVisibility(View.VISIBLE); disposable = Observable.fromCallable(DBReader::getNavDrawerData) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(result -> { navDrawerData = result; subscriptionAdapter.notifyDataSetChanged(); emptyView.updateVisibility(); progressBar.setVisibility(View.GONE); }, error -> Log.e(TAG, Log.getStackTraceString(error))); if (UserPreferences.getSubscriptionsFilter().areSubscriptionsFiltered()) { feedsFilteredMsg.setText("{md-info-outline} " + getString(R.string.subscriptions_are_filtered)); Iconify.addIcons(feedsFilteredMsg); feedsFilteredMsg.setVisibility(View.VISIBLE); } else { feedsFilteredMsg.setVisibility(View.GONE); } }

Target:
private void loadSubscriptions() { if (disposable != null) { disposable.dispose(); } emptyView.hide(); progressBar.setVisibility(View.VISIBLE); disposable = Observable.fromCallable(DBReader::getNavDrawerData) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(result -> { navDrawerData = result; subscriptionAdapter.notifyDataSetChanged(); emptyView.updateVisibility(); progressBar.setVisibility(View.GONE); }, error -> Log.e(TAG, Log.getStackTraceString(error))); if (UserPreferences.getSubscriptionsFilter().isEnabled()) { feedsFilteredMsg.setText("{md-info-outline} " + getString(R.string.subscriptions_are_filtered)); Iconify.addIcons(feedsFilteredMsg); feedsFilteredMsg.setVisibility(View.VISIBLE); } else { feedsFilteredMsg.setVisibility(View.GONE); } }
Source:
public void testNarrowingConversionsInListInitialization_389782() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); assertProblemOnFirstToken(helper, "fint({vdouble"); assertProblemOnFirstToken(helper, "ffloat({vlongdouble"); assertProblemOnFirstToken(helper, "ffloat({vdouble"); assertProblemOnFirstToken(helper, "fdouble({vlongdouble"); assertProblemOnFirstToken(helper, "fdouble({vint"); assertProblemOnFirstToken(helper, "fdouble({vue"); assertProblemOnFirstToken(helper, "fshort({vint"); assertProblemOnFirstToken(helper, "fuint({vint"); assertProblemOnFirstToken(helper, "fint({vuint"); assertProblemOnFirstToken(helper, "fulong({vshort"); assertProblemOnFirstToken(helper, "fbool({vint"); assertProblemOnFirstToken(helper, "fchar({vint"); assertNonProblemOnFirstToken(helper, "fint({vshort"); assertNonProblemOnFirstToken(helper, "flong({vint"); assertNonProblemOnFirstToken(helper, "fuint({vushort"); assertNonProblemOnFirstToken(helper, "flong({vshort"); assertNonProblemOnFirstToken(helper, "fulong({vuint"); assertNonProblemOnFirstToken(helper, "fulong({vushort"); assertNonProblemOnFirstToken(helper, "fdouble({vfloat"); assertNonProblemOnFirstToken(helper, "flongdouble({vfloat"); assertNonProblemOnFirstToken(helper, "flongdouble({vdouble"); assertNonProblemOnFirstToken(helper, "fint({vbool"); assertNonProblemOnFirstToken(helper, "fint({vchar"); }

Target:
public void testNarrowingConversionsInListInitialization_389782() throws Exception { BindingAssertionHelper helper = getAssertionHelper(); helper.assertProblemOnFirstToken("fint({vdouble"); helper.assertProblemOnFirstToken("ffloat({vlongdouble"); helper.assertProblemOnFirstToken("ffloat({vdouble"); helper.assertProblemOnFirstToken("fdouble({vlongdouble"); helper.assertProblemOnFirstToken("fdouble({vint"); helper.assertProblemOnFirstToken("fdouble({vue"); helper.assertProblemOnFirstToken("fshort({vint"); helper.assertProblemOnFirstToken("fuint({vint"); helper.assertProblemOnFirstToken("fint({vuint"); helper.assertProblemOnFirstToken("fulong({vshort"); helper.assertProblemOnFirstToken("fbool({vint"); helper.assertProblemOnFirstToken("fchar({vint"); helper.assertNonProblemOnFirstToken("fint({vshort"); helper.assertNonProblemOnFirstToken("flong({vint"); helper.assertNonProblemOnFirstToken("fuint({vushort"); helper.assertNonProblemOnFirstToken("flong({vshort"); helper.assertNonProblemOnFirstToken("fulong({vuint"); helper.assertNonProblemOnFirstToken("fulong({vushort"); helper.assertNonProblemOnFirstToken("fdouble({vfloat"); helper.assertNonProblemOnFirstToken("flongdouble({vfloat"); helper.assertNonProblemOnFirstToken("flongdouble({vdouble"); helper.assertNonProblemOnFirstToken("fint({vbool"); helper.assertNonProblemOnFirstToken("fint({vchar"); }
Source:
public void archiveHeadAllFilesTgzTimestamps() throws Exception { try (Git git = new Git(db)) { writeTrashFile("file_1.txt", "content_1_1"); git.add().addFilepattern("file_1.txt").call(); git.commit().setMessage("create file").call(); writeTrashFile("file_1.txt", "content_1_2"); writeTrashFile("file_2.txt", "content_2_2"); git.add().addFilepattern(".").call(); git.commit().setMessage("updated file").call(); File archive = new File(getTemporaryDirectory(), "archive.tgz"); git.archive().setOutputStream(new FileOutputStream(archive)) .setFormat("tgz") .setTree(git.getRepository().resolve("HEAD")).call(); try (InputStream fi = Files.newInputStream(archive.toPath()); InputStream bi = new BufferedInputStream(fi); InputStream gzi = new GzipCompressorInputStream(bi); ArchiveInputStream o = new TarArchiveInputStream(gzi)) { ArchiveEntry e; int n = 0; while ((e = o.getNextEntry()) != null) { n++; assertEquals( "expected lastModified mocked by MockSystemReader " + "truncated to 1 second", (1250379778668L / 1000L) * 1000L, e.getLastModifiedDate().getTime()); } assertEquals(UNEXPECTED_ARCHIVE_SIZE, 2, n); } } }

Target:
public void archiveHeadAllFilesTgzTimestamps() throws Exception { try (Git git = new Git(db)) { createTestContent(git); String fmt = "tgz"; File archive = new File(getTemporaryDirectory(), "archive." + fmt); archive(git, archive, fmt); ObjectId hash1 = ObjectId.fromRaw(IO.readFully(archive)); try (InputStream fi = Files.newInputStream(archive.toPath()); InputStream bi = new BufferedInputStream(fi); InputStream gzi = new GzipCompressorInputStream(bi); ArchiveInputStream o = new TarArchiveInputStream(gzi)) { assertEntries(o); } Thread.sleep(2000); archive(git, archive, fmt); assertEquals(UNEXPECTED_DIFFERENT_HASH, hash1, ObjectId.fromRaw(IO.readFully(archive))); } }
Source:
protected void addListeners() { this.resourceSetListener = new UpdateTableContentListener(getTableManager(), this); getTableEditingDomain().addResourceSetListener(this.resourceSetListener); }

Target:
protected void addListeners() { this.resourceSetListener = new UpdateTableContentListener(getTableManager(), this); if (getTableEditingDomain() != null) { getTableEditingDomain().addResourceSetListener(this.resourceSetListener); } }
Source:
private void createCase(File outputDir, ReportProgressPanel progressPanel) { String caseName = currentCase.getDisplayName() + " (Portable)"; caseFolder = Paths.get(outputDir.toString(), caseName).toFile(); if (caseFolder.exists()) { handleError("Case folder " + caseFolder.toString() + " already exists", Bundle.CreatePortableCaseModule_createCase_caseDirExists(caseFolder.toString()), null, progressPanel); return; } try { skCase = currentCase.createPortableCase(caseName, caseFolder); } catch (TskCoreException ex) { handleError("Error creating case " + caseName + " in folder " + caseFolder.toString(), Bundle.CreatePortableCaseModule_createCase_errorCreatingCase(), ex, progressPanel); return; } copiedFilesFolder = Paths.get(caseFolder.toString(), FILE_FOLDER_NAME).toFile(); copiedFilesFolder.mkdir(); for (FileTypeCategory cat:FILE_TYPE_CATEGORIES) { Paths.get(copiedFilesFolder.toString(), cat.getDisplayName()).toFile().mkdir(); } Paths.get(copiedFilesFolder.toString(), UNKNOWN_FILE_TYPE_FOLDER).toFile().mkdir(); }

Target:
private void createCase(File outputDir, ReportProgressPanel progressPanel) { String caseName = currentCase.getDisplayName() + " (Portable)"; caseFolder = Paths.get(outputDir.toString(), caseName).toFile(); if (caseFolder.exists()) { handleError("Case folder " + caseFolder.toString() + " already exists", Bundle.CreatePortableCaseModule_createCase_caseDirExists(caseFolder.toString()), null, progressPanel); return; } try { skCase = currentCase.createPortableCase(caseName, caseFolder); } catch (TskCoreException ex) { handleError("Error creating case " + caseName + " in folder " + caseFolder.toString(), Bundle.CreatePortableCaseModule_createCase_errorCreatingCase(), ex, progressPanel); return; } copiedFilesFolder = Paths.get(caseFolder.toString(), FILE_FOLDER_NAME).toFile(); if (! copiedFilesFolder.mkdir()) { handleError("Error creating folder " + copiedFilesFolder.toString(), Bundle.CreatePortableCaseModule_createCase_errorCreatingFolder(copiedFilesFolder.toString()), null, progressPanel); return; } for (FileTypeCategory cat:FILE_TYPE_CATEGORIES) { File subFolder = Paths.get(copiedFilesFolder.toString(), cat.getDisplayName()).toFile(); if (! subFolder.mkdir()) { handleError("Error creating folder " + subFolder.toString(), Bundle.CreatePortableCaseModule_createCase_errorCreatingFolder(subFolder.toString()), null, progressPanel); return; } } File unknownTypeFolder = Paths.get(copiedFilesFolder.toString(), UNKNOWN_FILE_TYPE_FOLDER).toFile(); if (! unknownTypeFolder.mkdir()) { handleError("Error creating folder " + unknownTypeFolder.toString(), Bundle.CreatePortableCaseModule_createCase_errorCreatingFolder(unknownTypeFolder.toString()), null, progressPanel); return; } }
Source:
public String toString() { return "CloudReplica[" + getDataNodeId().getHostname() + ":" + getDataNodeId().getPort() + ":" + getReplicaPath() + "]"; }

Target:
public String toString() { return "CloudReplica[" + dataNodeId.getHostname() + ":" + dataNodeId.getPort() + ":" + getReplicaPath() + "]"; }
Source:
public ThreadedHistoryTreeBackend(@NonNull String ssid, File newStateFile, int providerVersion, long startTime, int queueSize, int blockSize, int maxChildren) throws IOException { super(ssid, newStateFile, providerVersion, startTime, blockSize, maxChildren); intervalQueue = new BufferedBlockingQueue<>(queueSize / 100, 100); shtThread = new Thread(this, "History Tree Thread"); shtThread.start(); }

Target:
public ThreadedHistoryTreeBackend(@NonNull String ssid, File newStateFile, int providerVersion, long startTime, int queueSize, int blockSize, int maxChildren) throws IOException { super(ssid, newStateFile, providerVersion, startTime, blockSize, maxChildren); intervalQueue = new BufferedBlockingQueue<>(queueSize / CHUNK_SIZE, CHUNK_SIZE); shtThread = new Thread(this, "History Tree Thread"); shtThread.start(); }
Source:
private void validateThenCreateAccount() { clearErrors(); ValidateResult result = validateInput(getText(usernameInput), getText(passwordInput), getText(passwordRepeatInput), getText(emailInput)); switch (result) { case INVALID_USERNAME: usernameInput.requestFocus(); usernameInput.setError(getString(R.string.create_account_username_error)); return; case INVALID_PASSWORD: passwordInput.requestFocus(); passwordInput.setError(getString(R.string.create_account_password_error)); return; case PASSWORD_MISMATCH: passwordRepeatInput.requestFocus(); passwordRepeatInput.setError(getString(R.string.create_account_passwords_mismatch_error)); return; case INVALID_EMAIL: emailInput.requestFocus(); emailInput.setError(getString(R.string.create_account_email_error)); return; case NO_EMAIL: new AlertDialog.Builder(this) .setCancelable(false) .setTitle(R.string.email_recommendation_dialog_title) .setMessage(StringUtil.fromHtml(getResources().getString(R.string.email_recommendation_dialog_message))) .setPositiveButton(R.string.email_recommendation_dialog_create_without_email_action, (dialogInterface, i) -> { dialogInterface.dismiss(); createAccount(); }) .setNegativeButton(R.string.email_recommendation_dialog_create_with_email_action, (dialogInterface, i) -> { dialogInterface.dismiss(); emailInput.requestFocus(); }) .show(); break; case SUCCESS: createAccount(); default: break; } }

Target:
private void validateThenCreateAccount() { clearErrors(); ValidateResult result = validateInput(getText(usernameInput), getText(passwordInput), getText(passwordRepeatInput), getText(emailInput)); switch (result) { case INVALID_USERNAME: usernameInput.requestFocus(); usernameInput.setError(getString(R.string.create_account_username_error)); return; case INVALID_PASSWORD: passwordInput.requestFocus(); passwordInput.setError(getString(R.string.create_account_password_error)); return; case PASSWORD_MISMATCH: passwordRepeatInput.requestFocus(); passwordRepeatInput.setError(getString(R.string.create_account_passwords_mismatch_error)); return; case INVALID_EMAIL: emailInput.requestFocus(); emailInput.setError(getString(R.string.create_account_email_error)); return; case NO_EMAIL: new AlertDialog.Builder(this) .setCancelable(false) .setTitle(R.string.email_recommendation_dialog_title) .setMessage(StringUtil.fromHtml(getResources().getString(R.string.email_recommendation_dialog_message))) .setPositiveButton(R.string.email_recommendation_dialog_create_without_email_action, (dialogInterface, i) -> { createAccount(); }) .setNegativeButton(R.string.email_recommendation_dialog_create_with_email_action, (dialogInterface, i) -> { emailInput.requestFocus(); }) .show(); break; case SUCCESS: createAccount(); default: break; } }
Source:
public void helpEmailScreen(String email) { launchHelpshift(null, email, HelpshiftHelper.chooseHelpshiftLoginTag(getLoginMode() == LoginMode.JETPACK_STATS, true)); }

Target:
public void helpEmailScreen(String email) { launchHelpshift(null, email, true); }
Source:
private MongoCredential createCredential(Map<String, String> properties) { MongoCredential credential = null; String authenticationType = properties.get(DBConstants.MongoDB.AUTHENTICATION_TYPE); String username = properties.get(DBConstants.MongoDB.USERNAME); String password = properties.get(DBConstants.MongoDB.PASSWORD); String database = properties.get(DBConstants.MongoDB.DATABASE); switch (authenticationType) { case "PLAIN": credential = MongoCredential.createPlainCredential(username, database, password.toCharArray()); break; case "SCRAM-SHA-1": credential = MongoCredential.createScramSha1Credential(username, database, password.toCharArray()); break; case "MONGODB-CR": credential = MongoCredential.createMongoCRCredential(username, database, password.toCharArray()); break; case "GSSAPI": credential = MongoCredential.createGSSAPICredential(username); break; case "MONGODB-X509": credential = MongoCredential.createMongoX509Credential(username); break; } return credential; }

Target:
private MongoCredential createCredential(Map<String, String> properties) { MongoCredential credential = null; String authenticationType = properties.get(DBConstants.MongoDB.AUTHENTICATION_TYPE); String username = properties.get(DBConstants.MongoDB.USERNAME); String password = properties.get(DBConstants.MongoDB.PASSWORD); String database = properties.get(DBConstants.MongoDB.DATABASE); switch (authenticationType) { case DBConstants.MongoDB.MongoAuthenticationTypes.PLAIN: credential = MongoCredential.createPlainCredential(username, database, password.toCharArray()); break; case DBConstants.MongoDB.MongoAuthenticationTypes.SCRAM_SHA_1: credential = MongoCredential.createScramSha1Credential(username, database, password.toCharArray()); break; case DBConstants.MongoDB.MongoAuthenticationTypes.MONGODB_CR: credential = MongoCredential.createMongoCRCredential(username, database, password.toCharArray()); break; case DBConstants.MongoDB.MongoAuthenticationTypes.GSSAPI: credential = MongoCredential.createGSSAPICredential(username); break; case DBConstants.MongoDB.MongoAuthenticationTypes.MONGODB_X509: credential = MongoCredential.createMongoX509Credential(username); break; } return credential; }
Source:
public void handleRequest(HttpServerExchange exchange) throws Exception { try { handler.handleRequest(exchange); } catch (Throwable throwable) { for (ExceptionHandlerHolder<?> holder : exceptionHandlers) { if (holder.getClazz().isInstance(throwable)) { holder.getHandler().handleRequest(exchange); break; } } } }

Target:
public void handleRequest(HttpServerExchange exchange) throws Exception { try { handler.handleRequest(exchange); } catch (Throwable throwable) { for (ExceptionHandlerHolder<?> holder : exceptionHandlers) { if (holder.getClazz().isInstance(throwable)) { exchange.putAttachment(THROWABLE, throwable); holder.getHandler().handleRequest(exchange); return; } } throw throwable; } }
Source:
public static Media from(MwQueryPage page) { ImageInfo imageInfo = page.imageInfo(); if (imageInfo == null) { return null; } ExtMetadata metadata = imageInfo.getMetadata(); if (metadata == null) { Media media = new Media(null, imageInfo.getOriginalUrl(), page.title(), "", 0, null, null, null, null); if (!StringUtils.isBlank(imageInfo.getThumbUrl())) { media.setThumbUrl(imageInfo.getThumbUrl()); } return media; } Media media = new Media(null, imageInfo.getOriginalUrl(), page.title(), "", 0, safeParseDate(metadata.dateTime()), safeParseDate(metadata.dateTime()), getArtist(metadata), imageInfo.getUser() ); if (!StringUtils.isBlank(imageInfo.getThumbUrl())) { media.setThumbUrl(imageInfo.getThumbUrl()); } String language = Locale.getDefault().getLanguage(); if (StringUtils.isBlank(language)) { language = "default"; } media.setDescriptions(Collections.singletonMap(language, metadata.imageDescription())); media.setCategories(MediaDataExtractorUtil.extractCategoriesFromList(metadata.getCategories())); String latitude = metadata.getGpsLatitude(); String longitude = metadata.getGpsLongitude(); if (!StringUtils.isBlank(latitude) && !StringUtils.isBlank(longitude)) { LatLng latLng = new LatLng(Double.parseDouble(latitude), Double.parseDouble(longitude), 0); media.setCoordinates(latLng); } media.setLicenseInformation(metadata.licenseShortName(), metadata.licenseUrl()); return media; }

Target:
public static Media from(MwQueryPage page) { ImageInfo imageInfo = page.imageInfo(); if (imageInfo == null) { return null; } ExtMetadata metadata = imageInfo.getMetadata(); if (metadata == null) { Media media = new Media(null, imageInfo.getOriginalUrl(), page.title(), "", 0, null, null, null, imageInfo.getUser()); if (!StringUtils.isBlank(imageInfo.getThumbUrl())) { media.setThumbUrl(imageInfo.getThumbUrl()); } return media; } Media media = new Media(null, imageInfo.getOriginalUrl(), page.title(), "", 0, safeParseDate(metadata.dateTime()), safeParseDate(metadata.dateTime()), getArtist(metadata), imageInfo.getUser() ); if (!StringUtils.isBlank(imageInfo.getThumbUrl())) { media.setThumbUrl(imageInfo.getThumbUrl()); } String language = Locale.getDefault().getLanguage(); if (StringUtils.isBlank(language)) { language = "default"; } media.setDescriptions(Collections.singletonMap(language, metadata.imageDescription())); media.setCategories(MediaDataExtractorUtil.extractCategoriesFromList(metadata.getCategories())); String latitude = metadata.getGpsLatitude(); String longitude = metadata.getGpsLongitude(); if (!StringUtils.isBlank(latitude) && !StringUtils.isBlank(longitude)) { LatLng latLng = new LatLng(Double.parseDouble(latitude), Double.parseDouble(longitude), 0); media.setCoordinates(latLng); } media.setLicenseInformation(metadata.licenseShortName(), metadata.licenseUrl()); return media; }
Source:
public Unifier<T> getUnifier() { if (outputPort != null) { return outputPort.getUnifier(); } return null; }

Target:
public Unifier<T> getUnifier() { return outputPort == null ? null : outputPort.getUnifier(); }
Source:
private void executeTruncationChecks( int truncateTable1, int truncateTable2, int truncateTable3, int truncateTable4) { if (truncateTable1 != 0) { voltQueueSQL(validatebase1); } if (truncateTable2 != 0) { voltQueueSQL(validatebase2); } if (truncateTable3 != 0) { voltQueueSQL(validatebase3); } if (truncateTable4 != 0) { voltQueueSQL(validatebase4); } voltExecuteSQL(); }

Target:
private void executeTruncationChecks( int truncateTable1, int truncateTable2, int truncateTable3, int truncateTable4) { voltQueueSQL(validateview1); voltQueueSQL(validateview2); voltQueueSQL(validateview3); voltQueueSQL(validateview4); if (truncateTable1 != 0) { voltQueueSQL(validatebase1); } if (truncateTable2 != 0) { voltQueueSQL(validatebase2); } if (truncateTable3 != 0) { voltQueueSQL(validatebase3); } if (truncateTable4 != 0) { voltQueueSQL(validatebase4); } VoltTable[] empties = voltExecuteSQL(); int jj = 1; for (VoltTable cleared : empties) { if (cleared.asScalarLong() != 0) { System.out.println( "DEBUG Truncate failed to delete all rows of table/view " + jj + " of " + empties.length + ", leaving: " + cleared.asScalarLong()); } ++jj; } }
Source:
public final List<A> sort(final Ord<A> o) { if (isEmpty()) return nil(); else if (tail().isEmpty()) return this; else { final class Merge { List<A> merge(List<A> xs, List<A> ys, final Ord<A> o) { final Buffer<A> buf = empty(); while (true) { if (xs.isEmpty()) { buf.append(ys); break; } if (ys.isEmpty()) { buf.append(xs); break; } final A x = xs.head(); final A y = ys.head(); if (o.isLessThan(x, y) || o.eq(x, y)) { buf.snoc(x); xs = xs.tail(); } else { buf.snoc(y); ys = ys.tail(); } } return buf.toList(); } } final P2<List<A>, List<A>> s = splitAt(length() / 2); return new Merge().merge(s._1().sort(o), s._2().sort(o), o); } }

Target:
public final List<A> sort(final Ord<A> o) { if (isEmpty()) return nil(); else if (tail().isEmpty()) return this; else { final class Merge { List<A> merge(List<A> xs, List<A> ys, final Ord<A> o) { final Buffer<A> buf = empty(); while (true) { if (xs.isEmpty()) { buf.append(ys); break; } if (ys.isEmpty()) { buf.append(xs); break; } final A x = xs.head(); final A y = ys.head(); if (o.isLessThanOrEqualTo(x, y)) { buf.snoc(x); xs = xs.tail(); } else { buf.snoc(y); ys = ys.tail(); } } return buf.toList(); } } final P2<List<A>, List<A>> s = splitAt(length() / 2); return new Merge().merge(s._1().sort(o), s._2().sort(o), o); } }
Source:
public void persist(final Runnable commitRunnable) { final List<Pair<FireHydrant, Interval>> indexesToPersist = Lists.newArrayList(); for (Sink sink : sinks.values()) { if (sink.swappable()) { indexesToPersist.add(Pair.of(sink.swap(), sink.getInterval())); } } log.info("Submitting persist runnable for dataSource[%s]", schema.getDataSource()); if (persistExecutor.getQueue().size() >= config.getMaxPendingPersists()) { log.warn( "Persists pending[%,d] >= maxPendingPersists[%,d]. Ingestion may be throttled.", persistExecutor.getQueue().size(), config.getMaxPendingPersists() ); } persistExecutor.execute( new ThreadRenamingRunnable(String.format("%s-incremental-persist", schema.getDataSource())) { @Override public void doRun() { for (Pair<FireHydrant, Interval> pair : indexesToPersist) { metrics.incrementRowOutputCount(persistHydrant(pair.lhs, schema, pair.rhs)); } commitRunnable.run(); } } ); }

Target:
public void persist(final Runnable commitRunnable) { final List<Pair<FireHydrant, Interval>> indexesToPersist = Lists.newArrayList(); for (Sink sink : sinks.values()) { if (sink.swappable()) { indexesToPersist.add(Pair.of(sink.swap(), sink.getInterval())); } } log.info("Submitting persist runnable for dataSource[%s]", schema.getDataSource()); final Stopwatch runExecStopwatch = Stopwatch.createStarted(); final Stopwatch persistStopwatch = Stopwatch.createStarted(); persistExecutor.execute( new ThreadRenamingRunnable(String.format("%s-incremental-persist", schema.getDataSource())) { @Override public void doRun() { try { for (Pair<FireHydrant, Interval> pair : indexesToPersist) { metrics.incrementRowOutputCount(persistHydrant(pair.lhs, schema, pair.rhs)); } commitRunnable.run(); } finally { metrics.incrementNumPersists(); metrics.incrementPersistTimeMillis(persistStopwatch.elapsed(TimeUnit.MILLISECONDS)); persistStopwatch.stop(); } } } ); final long startDelay = runExecStopwatch.elapsed(TimeUnit.MILLISECONDS); metrics.incrementPersistBackPressureMillis(startDelay); if (startDelay > WARN_DELAY) { log.warn("Ingestion was throttled for [%,d] millis because persists were pending.", startDelay); } runExecStopwatch.stop(); }
Source:
public void testObjLitRedefinedInLocalScope() { test("var a = {}; a.b = {c: 0}; function d() { a.b = {c: 1}; } e(a.b.c);", "var a$b = {c: 0}; function d() { a$b = {c: 1}; } e(a$b.c);"); test("var a = {}; a.b = {c: 0}; " + "function d() { a.b = {c: 1}; } e(a.b.c);", "var a = {}; a.b = {c: 0}; function d() { a.b = {c: 1}; } e(a.b.c);"); test("var a = {}; a.b = {c: 0}; " + "function d() { a.b = { c: 1}; } e(a.b.c);", "var a$b = {c: 0}; function d() { a$b = {c: 1}; } e(a$b.c);"); }

Target:
public void testObjLitRedefinedInLocalScope() { test("var a = {}; a.b = {c: 0}; function d() { a.b = {c: 1}; } e(a.b.c);", "var a$b = {c: 0}; function d() { a$b = {c: 1}; } e(a$b.c);"); testSame("var a = {}; a.b = {c: 0}; " + "function d() { a.b = {c: 1}; } e(a.b.c);"); test("var a = {}; a.b = {c: 0}; " + "function d() { a.b = { c: 1}; } e(a.b.c);", "var a$b = {c: 0}; function d() { a$b = {c: 1}; } e(a$b.c);"); }
Source:
private void logHostFailToRespond(VDSNetworkException ex, long timeoutToFence) { log.info( "Server failed to respond, vds_id='{}', vds_name='{}', vm_count={}, " + "spm_status='{}', non-responsive_timeout (seconds)={}, error: {}", cachedVds.getId(), cachedVds.getName(), cachedVds.getVmCount(), cachedVds.getSpmStatus(), TimeUnit.MILLISECONDS.toSeconds(timeoutToFence), ex.getMessage()); AuditLogableBase logable; logable = new AuditLogableBase(cachedVds.getId()); logable.updateCallStackFromThrowable(ex); if (ex.getCause() instanceof java.net.UnknownHostException) auditLogDirector.log(logable, AuditLogType.VDS_UNKNOWN_HOST); else auditLogDirector.log(logable, AuditLogType.VDS_FAILURE); }

Target:
private void logHostFailToRespond(VDSNetworkException ex, long timeoutToFence) { log.info( "Server failed to respond, vds_id='{}', vds_name='{}', vm_count={}, " + "spm_status='{}', non-responsive_timeout (seconds)={}, error: {}", cachedVds.getId(), cachedVds.getName(), cachedVds.getVmCount(), cachedVds.getSpmStatus(), TimeUnit.MILLISECONDS.toSeconds(timeoutToFence), ex.getMessage()); AuditLogableBase logable; logable = new AuditLogableBase(cachedVds.getId()); logable.updateCallStackFromThrowable(ex); if (ex.getCause() instanceof java.net.UnknownHostException){ auditLogDirector.log(logable, AuditLogType.VDS_UNKNOWN_HOST); } else { auditLogDirector.log(logable, AuditLogType.VDS_FAILURE); } }
Source:
public List<Double> resolveValues(List<SchedulePeriod> periods) { int size = periods.size(); double[] result = new double[size]; if (steps.size() == 0) { Arrays.fill(result, initialValue); } else { ValueAdjustment[] expandedSteps = new ValueAdjustment[size]; for (ValueStep step : steps) { int index = step.findIndex(periods); if (index == 0) { throw new IllegalArgumentException("ValueStep is not allowed at the start of the schedule"); } if (expandedSteps[index] != null && expandedSteps[index].equals(step.getValue()) == false) { throw new IllegalArgumentException("Two ValueStep instances resolve to the same schedule period"); } expandedSteps[index] = step.getValue(); } double value = initialValue; for (int i = 0; i < size; i++) { if (expandedSteps[i] != null) { value = expandedSteps[i].adjust(value); } result[i] = value; } } return Doubles.asList(result); }

Target:
public List<Double> resolveValues(List<SchedulePeriod> periods) { int size = periods.size(); double[] result = new double[size]; if (steps.size() == 0) { Arrays.fill(result, initialValue); } else { ValueAdjustment[] expandedSteps = new ValueAdjustment[size]; for (ValueStep step : steps) { int index = step.findIndex(periods); if (index == 0) { throw new IllegalArgumentException("ValueStep is not allowed at the start of the schedule"); } if (expandedSteps[index] != null && !expandedSteps[index].equals(step.getValue())) { throw new IllegalArgumentException("Two ValueStep instances resolve to the same schedule period"); } expandedSteps[index] = step.getValue(); } double value = initialValue; for (int i = 0; i < size; i++) { if (expandedSteps[i] != null) { value = expandedSteps[i].adjust(value); } result[i] = value; } } return Doubles.asList(result); }
Source:
private Bitmap doFileInBackground() { Bitmap thumbnail = null; final String imageKey = String.valueOf(mFile.hashCode()); thumbnail = getBitmapFromDiskCache(imageKey); if (thumbnail == null) { int px = getThumbnailDimension(); Bitmap bitmap = BitmapUtils.decodeSampledBitmapFromFile( ((File)mFile).getAbsolutePath(), px, px); if (bitmap != null) { thumbnail = addThumbnailToCache(imageKey, bitmap, ((File)mFile).getPath(), px); } } return thumbnail; }

Target:
private Bitmap doFileInBackground() { Bitmap thumbnail = null; File file = (File)mFile; final String imageKey = String.valueOf(file.hashCode()); thumbnail = getBitmapFromDiskCache(imageKey); if (thumbnail == null) { int px = getThumbnailDimension(); Bitmap bitmap = BitmapUtils.decodeSampledBitmapFromFile( file.getAbsolutePath(), px, px); if (bitmap != null) { thumbnail = addThumbnailToCache(imageKey, bitmap, file.getPath(), px); } } return thumbnail; }
Source:
protected boolean shouldUpdatedItemRemainInList(FeedItem item) { SharedPreferences prefs = getActivity().getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE); FeedItemFilter feedItemFilter = new FeedItemFilter(prefs.getString(PREF_FILTER, "")); if (feedItemFilter.isShowDownloaded()) { return false; } return true; }

Target:
protected boolean shouldUpdatedItemRemainInList(FeedItem item) { SharedPreferences prefs = getActivity().getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE); FeedItemFilter feedItemFilter = new FeedItemFilter(prefs.getString(PREF_FILTER, "")); if (feedItemFilter.isShowDownloaded() && (!item.hasMedia() || !item.getMedia().isDownloaded())) { return false; } return true; }
Source:
public String getScroller() { return scroller == null ? DEFAULT_SCROLLER : scroller; }

Target:
public String getScroller() { return scroller; }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((actionType == null) ? 0 : actionType.hashCode()); result = prime * result + ((correlationId == null) ? 0 : correlationId.hashCode()); result = prime * result + ((endTime == null) ? 0 : endTime.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + (isVisible ? 1231 : 1237); result = prime * result + ((jobSubjectEntities == null) ? 0 : jobSubjectEntities.hashCode()); result = prime * result + ((lastUpdateTime == null) ? 0 : lastUpdateTime.hashCode()); result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode()); result = prime * result + ((startTime == null) ? 0 : startTime.hashCode()); result = prime * result + ((status == null) ? 0 : status.hashCode()); result = prime * result + ((steps == null) ? 0 : steps.hashCode()); result = prime * result + (isExternal ? 1231 : 1237); return result; }

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((actionType == null) ? 0 : actionType.hashCode()); result = prime * result + ((correlationId == null) ? 0 : correlationId.hashCode()); result = prime * result + ((endTime == null) ? 0 : endTime.hashCode()); result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + (isVisible ? 1231 : 1237); result = prime * result + ((jobSubjectEntities == null) ? 0 : jobSubjectEntities.hashCode()); result = prime * result + ((lastUpdateTime == null) ? 0 : lastUpdateTime.hashCode()); result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode()); result = prime * result + ((startTime == null) ? 0 : startTime.hashCode()); result = prime * result + ((status == null) ? 0 : status.hashCode()); result = prime * result + ((steps == null) ? 0 : steps.hashCode()); result = prime * result + (external ? 1231 : 1237); return result; }
Source:
public void queueEvent(NotificationContext context, ClusterEventType eventType, HelixConstants.ChangeType changeType) { ClusterEvent event = new ClusterEvent(_clusterName, eventType); event.addAttribute(AttributeName.helixmanager.name(), context.getManager()); event.addAttribute(AttributeName.changeContext.name(), context); event.addAttribute(AttributeName.ChangeType.name(), changeType); queueEvent(event); _monitor.increaseCallbackCounters(_eventQueue.size()); }

Target:
public void queueEvent(NotificationContext context, ClusterEventType eventType, HelixConstants.ChangeType changeType) { ClusterEvent event = new ClusterEvent(_clusterName, eventType); event.addAttribute(AttributeName.helixmanager.name(), context.getManager()); event.addAttribute(AttributeName.changeContext.name(), context); queueEvent(event); _monitor.increaseCallbackCounters(_eventQueue.size()); }
Source:
public void shouldAlwaysGenerateTheSameValueForTheSameSeed() { FloatRangeRandomizer bloatRangeRandomizer = aNewFloatRangeRandomizer(min, max, SEED); Float f = bloatRangeRandomizer.getRandomValue(); then(f).isEqualTo(7F); }

Target:
public void shouldAlwaysGenerateTheSameValueForTheSameSeed() { FloatRangeRandomizer floatRangeRandomizer = aNewFloatRangeRandomizer(min, max, SEED); Float f = floatRangeRandomizer.getRandomValue(); then(f).isEqualTo(7F); }
Source:
public void unselectsSelection() throws Exception { bot.radio("SWT.MULTI").click(); bot.checkBox("Listen").select(); bot.button("Clear").click(); tree = bot.treeInGroup("Tree"); tree.select(new int[] { 1 }); SWTBotText text = bot.textInGroup("Listeners"); bot.button("Clear").click(); tree.unselect(); assertEquals(0, tree.selectionCount()); assertEventMatches(text, "Selection [13]: SelectionEvent{Tree time=-550222256 data=null item=TreeItem {Node 2} detail=0 x=0 y=0 width=0 height=0 stateMask=0xc0000 text=null doit=true}"); assertEventMatches(text, "MouseDown [3]: MouseEvent{Tree time=-550222259 data=null button=1 stateMask=0x40000 x=0 y=0 count=1}"); assertEventMatches(text, "MouseUp [4]: MouseEvent{Tree time=-550222255 data=null button=1 stateMask=0xc0000 x=0 y=0 count=1}"); }

Target:
public void unselectsSelection() throws Exception { bot.radio("SWT.MULTI").click(); bot.checkBox("Listen").select(); bot.button("Clear").click(); tree = bot.treeInGroup("Tree"); tree.select(new int[] { 1 }); SWTBotText text = bot.textInGroup("Listeners"); bot.button("Clear").click(); tree.unselect(); assertEquals(0, tree.selectionCount()); assertEventMatches(text, "MouseDown [3]: MouseEvent{Tree time=-550222259 data=null button=1 stateMask=0x40000 x=0 y=0 count=1}"); assertEventMatches(text, "Selection [13]: SelectionEvent{Tree time=-550222256 data=null item=TreeItem {Node 2} detail=0 x=0 y=0 width=0 height=0 stateMask=0xc0000 text=null doit=true}"); assertEventMatches(text, "MouseUp [4]: MouseEvent{Tree time=-550222255 data=null button=1 stateMask=0xc0000 x=0 y=0 count=1}"); tree.select(new int[] { 1, 2 }); assertEquals(2, tree.selectionCount()); tree.select(new int[] {}); assertEquals(0, tree.selectionCount()); tree.select(new String[] { "Node 2", "Node 4" }); assertEquals(2, tree.selectionCount()); tree.select(new int[] {}); assertEquals(0, tree.selectionCount()); }
Source:
public SymbolReference<ResolvedMethodDeclaration> solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly) { List<ResolvedMethodDeclaration> candidates = new ArrayList<>(); Predicate<CtMethod> staticOnlyCheck = m -> !staticOnly || (staticOnly && Modifier.isStatic(m.getModifiers())); for (CtMethod method : ctClass.getDeclaredMethods()) { boolean isSynthetic = method.getMethodInfo().getAttribute(SyntheticAttribute.tag) != null; boolean isNotBridge = (method.getMethodInfo().getAccessFlags() & AccessFlag.BRIDGE) == 0; if (method.getName().equals(name) && !isSynthetic && isNotBridge && staticOnlyCheck.test(method)) { candidates.add(new JavassistMethodDeclaration(method, typeSolver)); } } SymbolReference<ResolvedMethodDeclaration> superClassMethodRef = MethodResolutionLogic.solveMethodInFQN (getSuperclassFQN(), name, argumentsTypes, staticOnly, typeSolver); if (superClassMethodRef.isSolved()) { candidates.add(superClassMethodRef.getCorrespondingDeclaration()); } for (String interfaceFQN : getInterfaceFQNs()) { SymbolReference<ResolvedMethodDeclaration> interfaceMethodRef = MethodResolutionLogic.solveMethodInFQN (interfaceFQN, name, argumentsTypes, staticOnly, typeSolver); if (interfaceMethodRef.isSolved()) { candidates.add(interfaceMethodRef.getCorrespondingDeclaration()); } } return MethodResolutionLogic.findMostApplicable(candidates, name, argumentsTypes, typeSolver); }

Target:
public SymbolReference<ResolvedMethodDeclaration> solveMethod(String name, List<ResolvedType> argumentsTypes, boolean staticOnly) { List<ResolvedMethodDeclaration> candidates = new ArrayList<>(); Predicate<CtMethod> staticOnlyCheck = m -> !staticOnly || (staticOnly && Modifier.isStatic(m.getModifiers())); for (CtMethod method : ctClass.getDeclaredMethods()) { boolean isSynthetic = method.getMethodInfo().getAttribute(SyntheticAttribute.tag) != null; boolean isNotBridge = (method.getMethodInfo().getAccessFlags() & AccessFlag.BRIDGE) == 0; if (method.getName().equals(name) && !isSynthetic && isNotBridge && staticOnlyCheck.test(method)) { candidates.add(new JavassistMethodDeclaration(method, typeSolver)); } } SymbolReference<ResolvedMethodDeclaration> superClassMethodRef = MethodResolutionLogic .solveMethodInType(getSuperClass().getTypeDeclaration(), name, argumentsTypes, staticOnly, typeSolver); if (superClassMethodRef.isSolved()) { candidates.add(superClassMethodRef.getCorrespondingDeclaration()); } for (ResolvedReferenceType interfaceRef : getInterfaces()) { SymbolReference<ResolvedMethodDeclaration> interfaceMethodRef = MethodResolutionLogic.solveMethodInType(interfaceRef.getTypeDeclaration(), name, argumentsTypes, staticOnly, typeSolver); if (interfaceMethodRef.isSolved()) { candidates.add(interfaceMethodRef.getCorrespondingDeclaration()); } } return MethodResolutionLogic.findMostApplicable(candidates, name, argumentsTypes, typeSolver); }
Source:
private void startNewConnection() { final ApnsConnection<T> connection = new ApnsConnection<T>(this.environment, this.sslContext, this.eventLoopGroup, this.configuration.getConnectionConfiguration(), this, String.format("%s-connection-%d", this.name, this.connectionCounter++)); connection.connect(); synchronized (this.activeConnections) { this.activeConnections.add(connection); } }

Target:
private void startNewConnection() { final ApnsConnection<T> connection = new ApnsConnection<T>(this.environment, this.sslContext, this.eventLoopGroup, this.configuration.getConnectionConfiguration(), this, String.format("%s-connection-%d", this.name, this.connectionCounter.getAndIncrement())); connection.connect(); synchronized (this.activeConnections) { this.activeConnections.add(connection); } }