auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void applyEdits(ServiceFeatureTable featureTable) { final ListenableFuture<List<FeatureEditResult>> editResult = featureTable.applyEditsAsync(); editResult.addDoneListener(() -> { try { List<FeatureEditResult> edits = editResult.get(); if (edits != null && edits.size() > 0) { if (!edits.get(0).hasCompletedWithErrors()) { runOnUiThread(() -> logToUser(getString(R.string.feature_added))); } else { throw edits.get(0).getError(); } } } catch (InterruptedException | ExecutionException e) { runOnUiThread(() -> logToUser(getString(R.string.error_applying_edits, e.getCause().getMessage()))); } }); }

Target:
private void applyEdits(ServiceFeatureTable featureTable) { final ListenableFuture<List<FeatureEditResult>> editResult = featureTable.applyEditsAsync(); editResult.addDoneListener(() -> { try { List<FeatureEditResult> editResults = editResult.get(); if (editResults != null && !editResults.isEmpty()) { if (!editResults.get(0).hasCompletedWithErrors()) { runOnUiThread(() -> logToUser(false, getString(R.string.feature_added))); } else { throw editResults.get(0).getError(); } } } catch (InterruptedException | ExecutionException e) { runOnUiThread(() -> logToUser(true, getString(R.string.error_applying_edits, e.getCause().getMessage()))); } }); }
Source:
public ImmutableBitmap getBitmapIndex(BitmapIndexSelector selector) { if (filters.size() == 1) { return filters.get(0).getBitmapIndex(selector); } final List<ImmutableBitmap> bitmaps = Lists.newArrayList(); for (final Filter filter : filters) { final ImmutableBitmap bitmapIndex = filter.getBitmapIndex(selector); if (bitmapIndex.isEmpty()) { return Filters.allFalse(selector); } bitmaps.add(bitmapIndex); } return selector.getBitmapFactory().intersection(bitmaps); }

Target:
public ImmutableBitmap getBitmapIndex(BitmapIndexSelector selector) { return getBitmapIndex(selector, filters); }
Source:
public void Facebook_002_noEmailPerms() { WikiBasePageObject base = new WikiBasePageObject(driver); FacebookMainPageObject fbLogin = base.openFacebookMainPage(); FacebookUserPageObject userFB; userFB = fbLogin.login(credentials.emailFB, credentials.passwordFB); userFB.verifyPageLogo(); SignUpPageObject signUp = userFB.openSpecialSignUpPage(wikiURL); FacebookSignupModalComponentObject fbModal = signUp.clickFacebookSignUp(); fbModal.acceptWikiaAppPolicyNoEmail(); String userName = "QA" + signUp.getTimeStamp(); String password = "Pass" + signUp.getTimeStamp(); String email = credentials.emailQaart2; String emailPassword = credentials.emailPasswordQaart2; MailFunctions.deleteAllEmails(email, emailPassword); fbModal.typeUserName(userName); fbModal.typePassword(password); fbModal.typeEmail(email); fbModal.createAccount(); signUp.verifyUserLoggedIn(userName); signUp.verifyEmailNotConfirmed(); try { Thread.sleep(5000); } catch (InterruptedException e) { PageObjectLogging.log("noEmailPerms", e.getMessage(), false); } AlmostTherePageObject almostThere = new AlmostTherePageObject(driver); ConfirmationPageObject confirmation = almostThere.enterActivationLink(email, emailPassword, wikiURL); confirmation.typeInUserName(userName); confirmation.typeInPassword(password); UserProfilePageObject userProfile = confirmation.clickSubmitButton(email, emailPassword); userProfile.verifyUserLoggedIn(userName); userProfile.logOut(driver); SpecialUserLoginPageObject login = base.openSpecialUserLogin(wikiURL); login.login(userName, password); login.logOut(driver); SignUpPageObject signUp2 = userFB.openSpecialSignUpPage(wikiURL); FacebookSignupModalComponentObject fbModal2 = signUp2.clickFacebookSignUp(); signUp2.verifyUserLoggedIn(userName); }

Target:
public void Facebook_002_noEmailPerms() { WikiBasePageObject base = new WikiBasePageObject(driver); FacebookMainPageObject fbLogin = base.openFacebookMainPage(); FacebookUserPageObject userFB = fbLogin.login(credentials.emailFB, credentials.passwordFB); userFB.verifyPageLogo(); SignUpPageObject signUp = userFB.openSpecialSignUpPage(wikiURL); FacebookSignupModalComponentObject fbModal = signUp.clickFacebookSignUp(); String userName = "QA" + signUp.getTimeStamp(); String password = "Pass" + signUp.getTimeStamp(); String email = credentials.emailQaart2; String emailPassword = credentials.emailPasswordQaart2; fbModal.createAccountNoEmail(email, emailPassword, userName, password); signUp.verifyUserLoggedIn(userName); AlmostTherePageObject almostThere = new AlmostTherePageObject(driver); almostThere.confirmAccountAndLogin(email, emailPassword, userName, password, wikiURL); almostThere.logOut(wikiURL); SignUpPageObject signUp2 = userFB.openSpecialSignUpPage(wikiURL); signUp2.clickFacebookSignUp(); signUp2.verifyUserLoggedIn(userName); }
Source:
public void shouldDeleteAllSpecifiedUsersSuccessfully() { List<String> usernames = new ArrayList<String>() {{ add("john"); add("joan"); }}; List<User> users = new ArrayList<User>() {{ add(new User(usernames.get(0))); add(new User(usernames.get(1))); }}; HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); userService.deleteUsers(usernames, result); verify(userDao).deleteUsers(usernames); assertThat(result.isSuccessful(), is(true)); assertThat(result.toString(), containsString("RESOURCE_DELETE_SUCCESSFUL")); assertThat(result.toString(), containsString("[john, joan]")); }

Target:
public void shouldDeleteAllSpecifiedUsersSuccessfully() { List<String> usernames = Arrays.asList("john", "joan"); User john = new User("john"); john.disable(); User joan = new User("joan"); joan.disable(); HttpLocalizedOperationResult result = new HttpLocalizedOperationResult(); when(userDao.findUser("john")).thenReturn(john); when(userDao.findUser("joan")).thenReturn(joan); userService.deleteUsers(usernames, result); verify(userDao).deleteUsers(usernames); assertThat(result.isSuccessful(), is(true)); assertThat(result.toString(), containsString("RESOURCES_DELETE_SUCCESSFUL")); assertThat(result.toString(), containsString("[john, joan]")); }
Source:
public Intent getIntent(GraphData data) throws InvalidStateException { render(data); String title = mRenderer.getChartTitle(); if (mData.getType().equals(Graph.TYPE_BUBBLE)) { return ChartFactory.getBubbleChartIntent(mContext, mDataset, mRenderer, title); } if (mData.getType().equals(Graph.TYPE_TIME)) { return ChartFactory.getTimeChartIntent(mContext, mDataset, mRenderer, title, getTimeFormat()); } if (mData.getType().equals(Graph.TYPE_BAR)) { return ChartFactory.getBarChartIntent(mContext, mDataset, mRenderer, BarChart.Type.DEFAULT, title); } return ChartFactory.getLineChartIntent(mContext, mDataset, mRenderer, title); }

Target:
public Intent getIntent(GraphData data) throws InvalidStateException { render(data); String title = mRenderer.getChartTitle(); if (Graph.TYPE_BUBBLE.equals(mData.getType())) { return ChartFactory.getBubbleChartIntent(mContext, mDataset, mRenderer, title); } if (Graph.TYPE_TIME.equals(mData.getType())) { return ChartFactory.getTimeChartIntent(mContext, mDataset, mRenderer, title, getTimeFormat()); } if (Graph.TYPE_BAR.equals(mData.getType())) { return ChartFactory.getBarChartIntent(mContext, mDataset, mRenderer, BarChart.Type.DEFAULT, title); } return ChartFactory.getLineChartIntent(mContext, mDataset, mRenderer, title); }
Source:
public List<String> processArgs() { final List<String> processArgument = VertxCommandLauncher.getProcessArguments(); return processArgument != null ? processArgument : Starter.PROCESS_ARGS; }

Target:
public List<String> processArgs() { List<String> processArgument = VertxCommandLauncher.getProcessArguments(); return processArgument != null ? processArgument : Starter.PROCESS_ARGS; }
Source:
public void setRegistrationUrl(String registrationUrl) { $("#registerHeader").attr("href", "<LINK_0>" + registrationUrl); $("#registerHeaderHome").attr("href", "<LINK_0>" + registrationUrl); }

Target:
public void setRegistrationUrl(String registrationUrl) { setSelectorRegistrationUrl("#registerHeader", registrationUrl); setSelectorRegistrationUrl("#registerHome", registrationUrl); }
Source:
public Spinner (SpinnerStyle style, SpinnerModel model) { this.style = style; this.model = model; currentBackground = style.background; setSize(getPrefWidth(), getPrefHeight()); this.addListener(new InputListener() { @Override public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { setCurrentBackground(getBackgroundForClick(x, y)); invalidate(); return true; } @Override public void touchUp (InputEvent event, float x, float y, int pointer, int button) { if (getCurrentBackground() == getStyle().backgroundNext) { if (getModel().next()) Spinner.this.fire(new ChangeListener.ChangeEvent()); } else if (getCurrentBackground() == getStyle().backgroundPrev) { if (getModel().previous()) Spinner.this.fire(new ChangeListener.ChangeEvent()); } setCurrentBackground(getStyle().background); invalidate(); } @Override public void touchDragged (InputEvent event, float x, float y, int pointer) { setCurrentBackground(getBackgroundForClick(x, y)); invalidate(); } @Override public void enter (InputEvent event, float x, float y, int pointer, Actor fromActor) { if (getStage() != null) getStage().setScrollFocus(Spinner.this); } @Override public boolean scrolled (InputEvent event, float x, float y, int amount) { if (x >= 0 && x <= getWidth() && y >= 0 && y <= getHeight()) { if (amount > 0) { if (getModel().previous()) Spinner.this.fire(new ChangeListener.ChangeEvent()); } else if (amount < 0) { if (getModel().next()) Spinner.this.fire(new ChangeListener.ChangeEvent()); } invalidate(); } return false; } }); }

Target:
public Spinner (SpinnerStyle style, SpinnerModel model) { this.style = style; this.model = model; currentBackground = style.background; layout = new GlyphLayout(style.font, model.getDisplayValue()); setSize(getPrefWidth(), getPrefHeight()); this.addListener(new InputListener() { @Override public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { updateBackgroundForCoords(x, y); return true; } @Override public void touchUp (InputEvent event, float x, float y, int pointer, int button) { if (getState() == SpinnerState.NEXT) updateValue(true); else if (getState() == SpinnerState.PREVIOUS) updateValue(false); updateBackgroundForCoords(x, y); } @Override public void touchDragged (InputEvent event, float x, float y, int pointer) { updateBackgroundForCoords(x, y); } @Override public void enter (InputEvent event, float x, float y, int pointer, Actor fromActor) { if (getStage() != null) { getStage().setScrollFocus(Spinner.this); getStage().setKeyboardFocus(Spinner.this); } updateBackgroundForCoords(x, y); } @Override public void exit (InputEvent event, float x, float y, int pointer, Actor toActor) { updateBackgroundForCoords(x, y); } @Override public boolean scrolled (InputEvent event, float x, float y, int amount) { if (getState() != SpinnerState.IDLE) updateValue(amount < 0); return false; } @Override public boolean keyDown (InputEvent event, int keycode) { if (getState() != SpinnerState.IDLE) { if (keycode == Input.Keys.UP) updateValue(true); else if (keycode == Input.Keys.DOWN) updateValue(false); } return false; } }); }
Source:
public static void assertMvccWriteConflict(Exception e) { IgniteSQLException sqlEx = X.cause(e, IgniteSQLException.class); assertNotNull("Unexpected exception:" + X.getFullStackTrace(e), sqlEx); assertEquals("Unexpected exception:" + X.getFullStackTrace(e),TRANSACTION_SERIALIZATION_ERROR, sqlEx.statusCode()); }

Target:
public static void assertMvccWriteConflict(Exception e) { IgniteSQLException sqlEx = X.cause(e, IgniteSQLException.class); if (sqlEx == null || sqlEx.statusCode() != TRANSACTION_SERIALIZATION_ERROR) fail("Unexpected exception: " + X.getFullStackTrace(e)); }
Source:
public void saveAuthorizedClient(OAuth2AuthorizedClient authorizedClient, Authentication principal) { Assert.notNull(authorizedClient, "authorizedClient cannot be null"); Assert.notNull(principal, "principal cannot be null"); OAuth2AuthorizedClientData authorizedClientData = mapData(authorizedClient, principal); Object[] args = { authorizedClientData.clientRegistrationId, authorizedClientData.principalName, authorizedClientData.accessTokenType, authorizedClientData.accessTokenValue, authorizedClientData.accessTokenIssuedAt, authorizedClientData.accessTokenExpiresAt, authorizedClientData.accessTokenScopes, authorizedClientData.refreshTokenValue, authorizedClientData.refreshTokenIssuedAt }; int[] argTypes = { Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.VARCHAR, Types.TIMESTAMP, Types.TIMESTAMP, Types.VARCHAR, Types.VARCHAR, Types.TIMESTAMP }; PreparedStatementSetter pss = new ArgumentTypePreparedStatementSetter(args, argTypes); this.jdbcTemplate.update(SAVE_AUTHORIZED_CLIENT_SQL, pss); }

Target:
public void saveAuthorizedClient(OAuth2AuthorizedClient authorizedClient, Authentication principal) { Assert.notNull(authorizedClient, "authorizedClient cannot be null"); Assert.notNull(principal, "principal cannot be null"); List<SqlParameterValue> parameters = this.authorizedClientParametersMapper.apply( new OAuth2AuthorizedClientHolder(authorizedClient, principal)); PreparedStatementSetter pss = new ArgumentPreparedStatementSetter(parameters.toArray()); this.jdbcOperations.update(SAVE_AUTHORIZED_CLIENT_SQL, pss); }
Source:
public void beforeEach() { initialized = Objects.nonNull(_spark); if (!initialized) { SparkConf conf = new SparkConf(); conf.setMaster("local"); conf.set("spark.driver.host", "localhost"); conf.set("spark.serializer", "org.apache.spark.serializer.KryoSerializer"); _spark = SparkSession.builder().config(conf).getOrCreate(); } }

Target:
public void beforeEach() { initialized = Objects.nonNull(_spark); if (!initialized) { SparkConf conf = new SparkConf(); conf.setAppName(getClass().getSimpleName()); conf.setMaster("local"); conf.set("spark.driver.host", "localhost"); conf.set("spark.serializer", "org.apache.spark.serializer.KryoSerializer"); _spark = SparkSession.builder().config(conf).getOrCreate(); } }
Source:
static void writeAccountMapToFile(Path filepath, Map<String, String> accountMap) throws IOException { try (FileChannel channel = FileChannel.open(filepath, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE)) { ByteBuffer buffer = serializeAccountMap(accountMap); channel.write(buffer); } catch (IOException e) { logger.error("Failed to persist state to file " + filepath, e); throw e; } }

Target:
static void writeAccountMapToFile(Path filepath, Map<String, String> accountMap) throws IOException { try (FileChannel channel = FileChannel.open(filepath, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE)) { ByteBuffer buffer = serializeAccountMap(accountMap); channel.write(buffer); } catch (IOException e) { logger.error("Failed to persist account map to file " + filepath, e); throw e; } }
Source:
private Boolean shouldHandleEvent(BundleEvent event) { if (event.getType() != BundleEvent.STARTED && event.getType() != BundleEvent.STOPPED) { return false; } String symbolicName = event.getBundle().getSymbolicName(); if (symbolicName.equals("org.apache.servicemix.bundles.xmlbeans")) { return false; } if (symbolicName.equals("org.ops4j.pax.wicket.service")) { return false; } return true; }

Target:
private Boolean shouldHandleEvent(BundleEvent event) { if (event.getType() != BundleEvent.STARTED && event.getType() != BundleEvent.STOPPED) { return false; } return true; }
Source:
public void initialize(ConstraintDescriptor<AgeMin> constraintDescriptor, HibernateConstraintValidatorInitializationContext initializationContext) { try { super.referenceClock = Clock.offset( initializationContext.getClockProvider().getClock(), getEffectiveTemporalValidationTolerance( initializationContext.getTemporalValidationTolerance() ) ); super.referenceAge = constraintDescriptor.getAnnotation().value(); super.inclusive = constraintDescriptor.getAnnotation().inclusive(); super.unit = constraintDescriptor.getAnnotation().unit(); } catch (Exception e) { throw LOG.getUnableToGetCurrentTimeFromClockProvider( e ); } }

Target:
public void initialize( ConstraintDescriptor<AgeMin> constraintDescriptor, HibernateConstraintValidatorInitializationContext initializationContext) { super.initialize( constraintDescriptor.getAnnotation().value(), constraintDescriptor.getAnnotation().unit().getChronoUnit(), constraintDescriptor.getAnnotation().inclusive(), initializationContext ); }
Source:
public static Scheduler from(Looper looper, boolean async) { if (looper == null) throw new NullPointerException("looper == null"); boolean useAsync = async && Build.VERSION.SDK_INT >= 16; Handler handler = new Handler(looper); if (useAsync) { Message message = Message.obtain(handler); try { message.setAsynchronous(true); } catch (NoSuchMethodError e) { useAsync = false; } } return new HandlerScheduler(new Handler(looper), useAsync); }

Target:
public static Scheduler from(Looper looper, boolean async) { if (looper == null) throw new NullPointerException("looper == null"); boolean useAsync = async && Build.VERSION.SDK_INT >= 16; Handler handler = new Handler(looper); if (useAsync && Build.VERSION.SDK_INT < 22) { Message message = Message.obtain(handler); try { message.setAsynchronous(true); } catch (NoSuchMethodError e) { useAsync = false; } finally { message.recycle(); } } return new HandlerScheduler(handler, useAsync); }
Source:
public KafkaRecordSupplier( Map<String, Object> consumerProperties, ObjectMapper sortingMapper ) { this.consumerProperties = consumerProperties; this.sortingMapper = sortingMapper; this.consumer = getKafkaConsumer(); this.closed = false; this.records = new LinkedBlockingQueue<>(); }

Target:
public KafkaRecordSupplier( Map<String, Object> consumerProperties, ObjectMapper sortingMapper ) { this.consumerProperties = consumerProperties; this.sortingMapper = sortingMapper; this.consumer = getKafkaConsumer(); }
Source:
public void authenticateWhenAccountExpiredThenException() { this.manager.setPasswordEncoder(this.encoder); UserDetails expiredUser = User.withUsername("user") .password("password") .roles("USER") .accountExpired(true) .build(); when(this.userDetailsService.findByUsername(any())).thenReturn(Mono.just(expiredUser)); UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken( this.user, this.user.getPassword()); this.manager.authenticate(token).block(); }

Target:
public void authenticateWhenAccountExpiredThenException() { this.manager.setPasswordEncoder(this.encoder); UserDetails expiredUser = User.withUsername("user") .password("password") .roles("USER") .accountExpired(true) .build(); when(this.userDetailsService.findByUsername(any())).thenReturn(Mono.just(expiredUser)); UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken( expiredUser, expiredUser.getPassword()); this.manager.authenticate(token).block(); }
Source:
public ValidationResult supportedFirewallTypeForClusterVersion() { return ValidationResult .failWith(EngineMessage.UNSUPPORTED_FIREWALL_TYPE_FOR_CLUSTER_VERSION) .when(cluster.getCompatibilityVersion().equals(Version.v3_6) && (cluster.getFirewallType() != null && cluster.getFirewallType() == FirewallType.FIREWALLD)); }

Target:
public ValidationResult supportedFirewallTypeForClusterVersion() { return ValidationResult .failWith( EngineMessage.UNSUPPORTED_FIREWALL_TYPE_FOR_CLUSTER_VERSION, String.format("$clusterVersion %s", cluster.getCompatibilityVersion()), String.format("$firewallType %s", cluster.getFirewallType()) ) .when(cluster.getCompatibilityVersion().equals(Version.v3_6) && (cluster.getFirewallType() != null && cluster.getFirewallType() == FirewallType.FIREWALLD)); }
Source:
public boolean matches(String pattern, String str, EnvVars envVars) { String expandedPattern = envVars.expand(pattern); return str.matches(expandedPattern); }

Target:
public boolean matches(String pattern, String str, EnvVars envVars) { String expandedPattern = expandWithEnvVarsIfPossible(pattern, envVars); return str.matches(expandedPattern); }
Source:
public Query createQuery(String queryString) { try { return MethodHack.createQuery.invoke(session, queryString); } catch (InvocationTargetException ex) { throw new RuntimeException(ex); } catch (IllegalAccessException ex) { throw new RuntimeException(ex); } }

Target:
public Query createQuery(String queryString) { return session.createQuery(queryString); }
Source:
public Image loadSmallPreview(String mapName) { String url = getMapUrl(mapName, environment.getProperty("vault.mapPreviewUrl.small")); logger.debug("Fetching small preview for map from {}", mapName, url); Image image = new Image(url, true); if (image.isError()) { logger.warn("Error fetching small preview for map from {}", mapName, url); String theme = preferencesService.getPreferences().getTheme(); return new Image(ThemeUtil.themeFile(theme, "images/map_background.png")); } else { return image; } }

Target:
public Image loadSmallPreview(String mapName) { String url = getMapUrl(mapName, environment.getProperty("vault.mapPreviewUrl.small")); logger.debug("Fetching small preview for map from {}", mapName, url); return new Image(url, true); }
Source:
public String toString() { switch (this) { case COMPUTER_FILE: return "Software/Multimedia"; case DATABASE_A_Z: return "Database"; case JOURNAL_PERIODICAL: return "Journal/Periodical"; case MANUSCRIPT_ARCHIVE: return "Archive/Manuscript"; case MUSIC_RECORDING: return "Music recording"; case MUSIC_SCORE: return "Music score"; case OBJECT: return "Object"; case SOUND_RECORDING: return "Sound recording"; default: String lc = super.toString().toLowerCase(); String firstchar = lc.substring(0, 1).toUpperCase(); return lc.replaceFirst(".{1}", firstchar); } }

Target:
public String toString() { switch (this) { case COMPUTER_FILE: return "Software/Multimedia"; case DATABASE_A_Z: return "Database"; case JOURNAL_PERIODICAL: return "Journal/Periodical"; case MANUSCRIPT_ARCHIVE: return "Archive/Manuscript"; case MUSIC_RECORDING: return "Music recording"; case MUSIC_SCORE: return "Music score"; case SOUND_RECORDING: return "Sound recording"; default: String lc = super.toString().toLowerCase(); String firstchar = lc.substring(0, 1).toUpperCase(); return lc.replaceFirst(".{1}", firstchar); } }
Source:
public void testGetAllTicketsForTransport_User() { SessionData login = login("user", userCleartextPassword); given() .filter(sessionFilter) .header(login.getCsrfHeader()) .when() .get("/tickets/transport") .then() .statusCode(HttpStatus.SC_FORBIDDEN); }

Target:
public void testGetAllTicketsForTransport_User() { SessionData login = login(user.getUsername(), userCleartextPassword); given() .filter(sessionFilter) .header(login.getCsrfHeader()) .when() .get("/tickets/transport") .then() .statusCode(HttpStatus.SC_FORBIDDEN); }
Source:
private String parseActualValue(final String value) { if (value != null && value.indexOf("=") > 1) { return value.substring(0, value.indexOf("=")); } else { return value; } }

Target:
private String parseActualValue(final String value) { if (value != null && value.indexOf("=") > 0) { return value.substring(0, value.indexOf("=")); } else { return value; } }
Source:
public boolean hasSpouse(){ if(null == campaign.getPerson(spouse)) setSpouseID(null); return (getSpouseID() != null); }

Target:
public boolean hasSpouse(){ return (getSpouseID() != null); }
Source:
public void setToken(String token) { if (token != null && !token.isEmpty()) { if (validateToken(token)) { this.token = token; } else { throw new IllegalArgumentException("Bad token"); } } else { this.token = null; } }

Target:
public void setToken(String token) { if (token != null && !token.isEmpty()) { if (!token.matches("^[a-zA-Z0-9]{16,}$")) { throw new IllegalArgumentException("Illegal token"); } this.token = token; } }
Source:
public boolean extractQuestionDetails(Map<String, String[]> requestParameters, FeedbackQuestionType questionType) { super.extractQuestionDetails(requestParameters, questionType); String minRecipientsToBeRanked = HttpRequestHelper.getValueFromParamMap( requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RANKMINRECIPIENTSTOBERANKED); String maxRecipientsToBeRanked = HttpRequestHelper.getValueFromParamMap( requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RANKMAXRECIPIENTSTOBERANKED); String isMinRecipientsToBeRankedEnabled = HttpRequestHelper.getValueFromParamMap( requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RANKISMINRECIPIENTSTOBERANKEDENABLED); String isMaxRecipientsToBeRankedEnabled = HttpRequestHelper.getValueFromParamMap( requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RANKISMAXRECIPIENTSTOBERANKEDENABLED); this.minOptionsToBeRankedEnabled = "on".equals(isMinRecipientsToBeRankedEnabled); this.maxOptionsToBeRankedEnabled = "on".equals(isMaxRecipientsToBeRankedEnabled); if (minRecipientsToBeRanked != null && !"".equals(minRecipientsToBeRanked)) { this.minOptionsToBeRanked = Integer.parseInt(minRecipientsToBeRanked); } if (maxRecipientsToBeRanked != null && !"".equals(maxRecipientsToBeRanked)) { this.maxOptionsToBeRanked = Integer.parseInt(maxRecipientsToBeRanked); } return true; }

Target:
public boolean extractQuestionDetails(Map<String, String[]> requestParameters, FeedbackQuestionType questionType) { super.extractQuestionDetails(requestParameters, questionType); String minRecipientsToBeRanked = Strings.nullToEmpty(HttpRequestHelper.getValueFromParamMap( requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RANK_MIN_RECIPIENTS_TO_BE_RANKED)); String maxRecipientsToBeRanked = Strings.nullToEmpty(HttpRequestHelper.getValueFromParamMap( requestParameters, Const.ParamsNames.FEEDBACK_QUESTION_RANK_MAX_RECIPIENTS_TO_BE_RANKED)); minOptionsToBeRanked = MoreObjects.firstNonNull(Ints.tryParse(minRecipientsToBeRanked), NO_VALUE); maxOptionsToBeRanked = MoreObjects.firstNonNull(Ints.tryParse(maxRecipientsToBeRanked), NO_VALUE); return true; }
Source:
private static List<String> extend(final Response res, final Iterable<? extends CharSequence> headers) throws IOException { Response resp = res; for (final CharSequence hdr: headers) { resp = new RsWithHeader(resp, hdr); } final List<String> ret = new ArrayList<String>(1); for (final String hdr: resp.head()) { ret.add(hdr); } return ret; }

Target:
private static Iterable<String> extend(final Response res, final Iterable<? extends CharSequence> headers) throws IOException { Response resp = res; for (final CharSequence hdr: headers) { resp = new RsWithHeader(resp, hdr); } return resp.head(); }
Source:
public Operator createOperator(DriverContext driverContext) { checkState(!closed, "LookupOuterOperatorFactory is closed"); if (createdDriverGroups.contains(driverContext.getDriverLifeCycle())) { throw new IllegalStateException("Only one outer operator can be created per DriverGroup"); } ListenableFuture<OuterPositionIterator> outerPositionsFuture = this.outerPositionsFuture.apply(driverContext.getDriverLifeCycle()); ReferenceCount referenceCount = this.referenceCount.apply(driverContext.getDriverLifeCycle()); OperatorContext operatorContext = driverContext.addOperatorContext(operatorId, planNodeId, LookupOuterOperator.class.getSimpleName()); referenceCount.retain(); return new LookupOuterOperator(operatorContext, outerPositionsFuture, probeOutputTypes, buildOutputTypes, referenceCount::release); }

Target:
public Operator createOperator(DriverContext driverContext) { checkState(!closed, "LookupOuterOperatorFactory is closed"); if (createdLifespans.contains(driverContext.getLifespan())) { throw new IllegalStateException("Only one outer operator can be created per Lifespan"); } createdLifespans.add(driverContext.getLifespan()); ListenableFuture<OuterPositionIterator> outerPositionsFuture = this.outerPositionsFuture.apply(driverContext.getLifespan()); ReferenceCount referenceCount = this.referenceCount.apply(driverContext.getLifespan()); OperatorContext operatorContext = driverContext.addOperatorContext(operatorId, planNodeId, LookupOuterOperator.class.getSimpleName()); referenceCount.retain(); return new LookupOuterOperator(operatorContext, outerPositionsFuture, probeOutputTypes, buildOutputTypes, referenceCount::release); }
Source:
public void setAlwaysEdible(IItemDefinition item) { if (item instanceof ItemFood) ((ItemFood)getInternal(item)).setAlwaysEdible(); }

Target:
public void setAlwaysEdible(IItemDefinition item) { Item food = getInternal(item); if (food instanceof ItemFood) ((ItemFood)food).setAlwaysEdible(); }
Source:
public String toString() { return "VDS[" + (mVdsStatic == null ? "null" : mVdsStatic.gethost_name()) + "]"; }

Target:
public String toString() { return "Host[" + (mVdsStatic == null ? "null" : mVdsStatic.getvds_name()) + "]"; }
Source:
public boolean click(Vector2 clickPosition) { if(clickPosition.x > rectangle.x && clickPosition.x < rectangle.x + rectangle.width && clickPosition.y > rectangle.y && clickPosition.y < rectangle.y + rectangle.height) { float relativePos = clickPosition.x - rectangle.x; setValue((relativePos/rectangle.width)); return true; } return false; }

Target:
public boolean click(Vector2 clickPosition) { if (clickPosition.x > rectangle.x && clickPosition.x < rectangle.x + rectangle.width && clickPosition.y > rectangle.y && clickPosition.y < rectangle.y + rectangle.height) { float relativePos = clickPosition.x - rectangle.x; setValue(relativePos / rectangle.width); return true; } return false; }
Source:
public void onDestroy() { super.onDestroy(); if (getService() != null) { getService().unregisterOnServiceStateChangeListener(this); } mLabelView.removeTextChangedListener(mTextWatcher); mIdView.removeTextChangedListener(mTextWatcher); mPathView.removeTextChangedListener(mTextWatcher); }

Target:
public void onDestroy() { super.onDestroy(); SyncthingService syncthingService = getService(); if (syncthingService != null) { syncthingService.unregisterOnServiceStateChangeListener(this::onServiceStateChange); } mLabelView.removeTextChangedListener(mTextWatcher); mIdView.removeTextChangedListener(mTextWatcher); mPathView.removeTextChangedListener(mTextWatcher); }
Source:
private int getPluginsLoadTimeout(final Config cfg) { long cfgValue = ConfigUtil.getTimeUnit(cfg, "plugins", null, "jsLoadTimeout", DEFAULT_JS_LOAD_TIMEOUT, TimeUnit.MILLISECONDS); if (cfgValue < 0) { return 0; } return (int) cfgValue; }

Target:
private static int getPluginsLoadTimeout(final Config cfg) { long cfgValue = ConfigUtil.getTimeUnit(cfg, "plugins", null, "jsLoadTimeout", DEFAULT_JS_LOAD_TIMEOUT, TimeUnit.MILLISECONDS); if (cfgValue < 0) { return 0; } return (int) cfgValue; }
Source:
private static ChangeType detectChangeType(Project project, @NotNull VirtualFile file) { ProjectRootManager rootManager = ProjectRootManager.getInstance(project); if (rootManager.getFileIndex().getContentRootForFile(file) != null) { boolean isBuildFile = PantsUtil.isBUILDFileName(file.getName()); boolean isUnderPantsRepo = PantsUtil.isFileUnderPantsRepo(file); boolean isNotInPantsD = !file.getPath().contains("/.pants.d/"); if (isUnderPantsRepo && isBuildFile && isNotInPantsD) { return ChangeType.BUILD; } return ChangeType.OTHER; } return ChangeType.UNRELATED; }

Target:
private static ChangeType detectChangeType(Project project, @NotNull VirtualFile file) { ProjectRootManager rootManager = ProjectRootManager.getInstance(project); if (rootManager.getFileIndex().getContentRootForFile(file) != null) { boolean isBuildFile = PantsUtil.isBUILDFileName(file.getName()); boolean isUnderPantsRepo = PantsUtil.isFileUnderPantsRepo(file); Path filePath = Paths.get(file.getPath()); boolean shouldBeIgnored = PantsOptions.getPantsOptions(project) .flatMap(options -> options.get(PantsConstants.PANTS_OPTION_PANTS_WORKDIR)) .map(workdir -> filePath.startsWith(Paths.get(workdir).toAbsolutePath())) .orElse(filePath.toUri().toString().contains("/.pants.d/")); if (isUnderPantsRepo && isBuildFile && !shouldBeIgnored) { return ChangeType.BUILD; } return ChangeType.OTHER; } return ChangeType.UNRELATED; }
Source:
public void setTabHeader(BaseComponent header, BaseComponent footer) { header = ChatComponentTransformer.getInstance().transform( getServerSentScoreboard(), this, header )[0]; footer = ChatComponentTransformer.getInstance().transform( getServerSentScoreboard(), this, footer )[0]; unsafe().sendPacket( new PlayerListHeaderFooter( ComponentSerializer.toString( header ), ComponentSerializer.toString( footer ) ) ); }

Target:
public void setTabHeader(BaseComponent header, BaseComponent footer) { header = ChatComponentTransformer.getInstance().transform( this, header )[0]; footer = ChatComponentTransformer.getInstance().transform( this, footer )[0]; unsafe().sendPacket( new PlayerListHeaderFooter( ComponentSerializer.toString( header ), ComponentSerializer.toString( footer ) ) ); }
Source:
public byte[] getEntry() { if (data == null) { throw new IllegalStateException("entry content can be accessed only once"); } byte[] entry = new byte[data.readableBytes()]; data.readBytes(entry); data.release(); data = null; return entry; }

Target:
public byte[] getEntry() { Preconditions.checkNotNull(data, "entry content can be accessed only once"); byte[] entry = new byte[data.readableBytes()]; data.readBytes(entry); data.release(); data = null; return entry; }
Source:
public void consume(ParsableByteArray data) { if (writingSample) { totalBytesWritten += data.bytesLeft(); output.sampleData(data, data.bytesLeft()); } }

Target:
public void consume(ParsableByteArray data) { if (writingSample) { int bytesAvailable = data.bytesLeft(); TrackOutput output; int dataPosition = data.getPosition(); for (int i = 0; i < outputTracks.size(); i++) { data.setPosition(dataPosition); output = outputTracks.get(i); output.sampleData(data, bytesAvailable); } sampleBytesWritten += bytesAvailable; } }
Source:
protected boolean checkStoragePool() { if (!super.checkStoragePool()) return false; if (getStoragePool().getstatus() == StoragePoolStatus.Uninitialized) { return true; } if (getStoragePool().getstatus() != StoragePoolStatus.Up) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_ACTIVE); return false; } return true; }

Target:
protected boolean checkStoragePool() { if (!super.checkStoragePool()) return false; StoragePoolStatus status = getStoragePool().getstatus(); if (status == StoragePoolStatus.Uninitialized) { return true; } if (status != StoragePoolStatus.Up) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_ACTIVE); return false; } return true; }
Source:
Builder memoryPolicy(@NonNull MemoryPolicy policy, @NonNull MemoryPolicy... additional) { if (policy == null) { throw new IllegalArgumentException("Memory policy cannot be null."); } this.memoryPolicy |= policy.index; if (additional == null) { throw new IllegalArgumentException("Memory policy cannot be null."); } if (additional.length > 0) { for (MemoryPolicy memoryPolicy : additional) { if (memoryPolicy == null) { throw new IllegalArgumentException("Memory policy cannot be null."); } this.memoryPolicy |= memoryPolicy.index; } } return this; }

Target:
Builder memoryPolicy(@NonNull MemoryPolicy policy, @NonNull MemoryPolicy... additional) { if (policy == null) { throw new NullPointerException("policy == null"); } if (additional == null) { throw new NullPointerException("additional == null"); } this.memoryPolicy |= policy.index; for (MemoryPolicy memoryPolicy : additional) { if (memoryPolicy == null) { throw new NullPointerException("memoryPolicy == null"); } this.memoryPolicy |= memoryPolicy.index; } return this; }
Source:
protected void determineDebuggerPath(IDMContext dmc, String hostPath, final DataRequestMonitor<String> rm) { final IBreakpoints breakpoints = getServicesTracker().getService(IBreakpoints.class); if (!(breakpoints instanceof MIBreakpoints)) { rm.done(hostPath); return; } ISourceLookup sourceLookup = getServicesTracker().getService(ISourceLookup.class); ISourceLookupDMContext srcDmc = DMContexts.getAncestorOfType(dmc, ISourceLookupDMContext.class); if (sourceLookup == null || srcDmc == null) { rm.done(((MIBreakpoints)breakpoints).adjustDebuggerPath(hostPath)); return; } sourceLookup.getDebuggerPath(srcDmc, hostPath, new DataRequestMonitor<String>(getExecutor(), rm) { @Override protected void handleSuccess() { rm.done(((MIBreakpoints)breakpoints).adjustDebuggerPath(getData())); } }); }

Target:
protected void determineDebuggerPath(IDMContext dmc, String hostPath, final DataRequestMonitor<String> rm) { final IBreakpoints breakpoints = getServicesTracker().getService(IBreakpoints.class); if (!(breakpoints instanceof IMIBreakpointPathAdjuster)) { rm.done(hostPath); return; } ISourceLookup sourceLookup = getServicesTracker().getService(ISourceLookup.class); ISourceLookupDMContext srcDmc = DMContexts.getAncestorOfType(dmc, ISourceLookupDMContext.class); if (sourceLookup == null || srcDmc == null) { rm.done(((IMIBreakpointPathAdjuster)breakpoints).adjustDebuggerPath(hostPath)); return; } sourceLookup.getDebuggerPath(srcDmc, hostPath, new DataRequestMonitor<String>(getExecutor(), rm) { @Override protected void handleSuccess() { rm.done(((IMIBreakpointPathAdjuster)breakpoints).adjustDebuggerPath(getData())); } }); }
Source:
private AsyncCompletionWaitor removeBreakpoint(final IBreakpointDMContext breakpoint) throws InterruptedException { final AsyncCompletionWaitor waitor = new AsyncCompletionWaitor(); final RequestMonitor rm = new RequestMonitor(fBreakpointService.getExecutor(), null) { @Override protected void handleCompleted() { waitor.waitFinished(getStatus()); } }; fBreakpointService.getExecutor().submit(new Runnable() { @Override public void run() { fBreakpointService.removeBreakpoint(breakpoint, rm); } }); waitor.waitUntilDone(TestsPlugin.massageTimeout(2000)); return waitor; }

Target:
private void removeBreakpoint(final IBreakpointDMContext breakpoint) throws InterruptedException, ExecutionException { Query<Void> query = new Query<Void>() { @Override protected void execute(DataRequestMonitor<Void> rm) { fBreakpointService.removeBreakpoint(breakpoint, rm); } }; fBreakpointService.getExecutor().submit(query); query.get(); }
Source:
private void updateRowBuffer(boolean isInsert) throws SQLException { for (Map.Entry<String, Object> entry : updateValues.entrySet()) { int columnIndex = findColumn(entry.getKey()) - 1; Object valueObject = entry.getValue(); setRowBufferColumn(columnIndex, valueObject); } if (isInsert) { final ResultSet generatedKeys = insertStatement.getGeneratedKeys(); generatedKeys.next(); int numKeys = primaryKeys.size(); for (int i = 0; i < numKeys; i++) { final PrimaryKey key = primaryKeys.get(i); int columnIndex = key.index - 1; Object valueObject = generatedKeys.getObject(key.name); setRowBufferColumn(columnIndex, valueObject); } } }

Target:
private void updateRowBuffer(boolean isInsert) throws SQLException { for (Map.Entry<String, Object> entry : updateValues.entrySet()) { int columnIndex = findColumn(entry.getKey()) - 1; Object valueObject = entry.getValue(); setRowBufferColumn(columnIndex, valueObject); } if (isInsert) { final ResultSet generatedKeys = insertStatement.getGeneratedKeys(); try { generatedKeys.next(); int numKeys = primaryKeys.size(); for (int i = 0; i < numKeys; i++) { final PrimaryKey key = primaryKeys.get(i); int columnIndex = key.index - 1; Object valueObject = generatedKeys.getObject(key.name); setRowBufferColumn(columnIndex, valueObject); } } finally { generatedKeys.close(); } } }
Source:
private boolean validateGroupNameChange(VDSGroup oldGroup) { VDSGroup vdsGroup = getVdsGroup(); if (StringHelper.EqOp(oldGroup.getname(), vdsGroup.getname())) { return true; } VdsGroupDAO vdsGroupDAO = DbFacade.getInstance().getVdsGroupDAO(); VDSGroup groupWithName = vdsGroupDAO.getByName(vdsGroup.getname()); if (groupWithName == null) { return true; } if (groupWithName.getId().equals(vdsGroup.getId())) { return true; } addCanDoActionMessage(VdcBllMessages.VDS_GROUP_CANNOT_DO_ACTION_NAME_IN_USE); return false; }

Target:
private boolean validateGroupNameChange(VDSGroup oldGroup) { VDSGroup vdsGroup = getVdsGroup(); if (StringHelper.EqOp(oldGroup.getname(), vdsGroup.getname())) { return true; } VDSGroup groupWithName = getVdsGroupDAO().getByName(vdsGroup.getname()); if (groupWithName == null) { return true; } if (groupWithName.getId().equals(vdsGroup.getId())) { return true; } addCanDoActionMessage(VdcBllMessages.VDS_GROUP_CANNOT_DO_ACTION_NAME_IN_USE); return false; }
Source:
public RelWriter explainTerms(RelWriter pw) { super.explainTerms(pw); pw.item("split", m_splitCount); if (m_limit != null) { pw.item("limit", m_limit); } if (m_offset != null) { pw.item("offset", m_offset); } return pw; }

Target:
public RelWriter explainTerms(RelWriter pw) { super.explainTerms(pw); pw.item("split", m_splitCount); pw.itemIf("limit", m_limit, m_limit != null); pw.itemIf("offset", m_offset, m_offset != null); return pw; }
Source:
public static <K, A> PriorityQueue<K, A> priorityQueue(Equal<K> e, FingerTree<K, P2<K, A>> ft) { return new PriorityQueue<K, A>(e, ft); }

Target:
public static <K, A> PriorityQueue<K, A> priorityQueue(Equal<K> e, FingerTree<K, P2<K, A>> ft) { return new PriorityQueue<>(e, ft); }
Source:
public boolean canExecute() { if (selection != null && selection.size() > 1) { for (EObject tool : selection) { if (!(tool instanceof AbstractToolDescription)) { return false; } } } return true; }

Target:
public boolean canExecute() { boolean canExecute = false; if (selection != null) { canExecute = Iterables.all(selection, Predicates.instanceOf(AbstractToolDescription.class)); } return canExecute; }
Source:
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String username = request.getParameter("wb-username"); String password = request.getParameter("wb-password"); String remember = request.getParameter("remember-credentials"); ConnectionManager manager = ConnectionManager.getInstance(); if (username != null && password != null) { manager.login(username, password, "on".equals(remember)); } else if ("true".equals(request.getParameter("logout"))) { manager.logout(); } response.setCharacterEncoding("UTF-8"); response.setHeader("Content-Type", "application/json"); StringWriter sb = new StringWriter(2048); JSONWriter writer = new JSONWriter(sb); try { writer.object(); writer.key("logged_in"); writer.value(manager.isLoggedIn()); writer.key("username"); writer.value(manager.getUsername()); writer.endObject(); } catch (JSONException e) { e.printStackTrace(); } respond(response, sb.toString()); }

Target:
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String username = request.getParameter("wb-username"); String password = request.getParameter("wb-password"); String remember = request.getParameter("remember-credentials"); ConnectionManager manager = ConnectionManager.getInstance(); if (username != null && password != null) { manager.login(username, password, "on".equals(remember)); } else if ("true".equals(request.getParameter("logout"))) { manager.logout(); } response.setCharacterEncoding("UTF-8"); response.setHeader("Content-Type", "application/json"); StringWriter sb = new StringWriter(2048); JSONWriter writer = new JSONWriter(sb); try { writer.object(); writer.key("logged_in"); writer.value(manager.isLoggedIn()); writer.key("username"); writer.value(manager.getUsername()); writer.endObject(); } catch (JSONException e) { logger.error(e.getMessage()); } respond(response, sb.toString()); }
Source:
public WorkflowResponse execute(WorkflowDTO workflowDTO) throws WorkflowException { if (log.isDebugEnabled()) { log.debug("Executing Application registration Workflow.."); } ApplicationRegistrationWorkflowDTO appRegDTO = (ApplicationRegistrationWorkflowDTO) workflowDTO; Application application = appRegDTO.getApplication(); String callBackURL = appRegDTO.getCallbackUrl(); String applicationCallbackUrl = application.getCallbackUrl(); String applicationDescription = application.getDescription(); String message="Approve request to create "+appRegDTO.getKeyType()+" keys for [ "+application.getName()+ " ] from application creator - "+appRegDTO.getUserName()+" with throttling tier - "+application.getTier() ; workflowDTO.setWorkflowDescription(message); workflowDTO.setMetadata("applicationName", application.getName()); workflowDTO.setMetadata("applicationTier", application.getTier()); workflowDTO.setMetadata("applicationCallbackUrl", applicationCallbackUrl != null ? applicationCallbackUrl : "?"); workflowDTO.setMetadata("applicationDescription", applicationDescription != null ? applicationDescription : "?"); workflowDTO.setMetadata("TenantDomain", appRegDTO.getTenantDomain()); workflowDTO.setMetadata("UserName", appRegDTO.getUserName()); workflowDTO.setMetadata("workflowExternalRef", appRegDTO.getExternalWorkflowReference()); workflowDTO.setMetadata("callBackURL", callBackURL != null ? callBackURL : "?"); workflowDTO.setMetadata("KeyType", appRegDTO.getKeyType()); workflowDTO.setProperties("Workflow Process","Registration Creation"); super.execute(workflowDTO); return new GeneralWorkflowResponse(); }

Target:
public WorkflowResponse execute(WorkflowDTO workflowDTO) throws WorkflowException { if (log.isDebugEnabled()) { log.debug("Executing Application registration Workflow.."); } ApplicationRegistrationWorkflowDTO appRegDTO = (ApplicationRegistrationWorkflowDTO) workflowDTO; Application application = appRegDTO.getApplication(); String callBackURL = appRegDTO.getCallbackUrl(); String applicationCallbackUrl = application.getCallbackUrl(); String applicationDescription = application.getDescription(); String message = "Approve request to create " + appRegDTO.getKeyType() + " keys for [ " + application.getName() + " ] from application creator - " + appRegDTO.getUserName() + " with throttling tier - " + application.getTier(); workflowDTO.setWorkflowDescription(message); super.execute(workflowDTO); return new GeneralWorkflowResponse(); }
Source:
public void removeRelatedAlarm(OnmsAlarm alarm) { Optional<AlarmAssociation> alarmAssociation = m_associatedAlarms.stream().filter(associatedAlarm -> associatedAlarm.getRelatedAlarm().getId().equals(alarm.getId())).findFirst(); if (alarmAssociation.isPresent()) { m_associatedAlarms.remove(alarmAssociation.get()); } }

Target:
public void removeRelatedAlarm(OnmsAlarm alarm) { m_associatedAlarms.removeIf(associatedAlarm -> associatedAlarm.getRelatedAlarm().getId().equals(alarm.getId())); }
Source:
void convertWithoutResultEventData() { AttemptAuditEventResult source = makeAttemptAuditEventResult(null); AuditProto.AttemptAuditEventResult target = underTest.convert(source); assertGeneric(target); assertThat(target.getEventTypeCase()).isEqualTo(AuditProto.AttemptAuditEventResult.EventTypeCase.EVENTTYPE_NOT_SET); }

Target:
void convertWithoutResultEventData() { AttemptAuditEventResult source = makeAttemptAuditEventResult(null); AuditProto.AttemptAuditEventResult target = underTest.convert(source); assertEquals(target, result); verify(mockBuilder, times(1)).build(); verify(builderProvider, times(1)).getNewAttemptAuditEventResultBuilder(); verify(mockAttemptAuditEventResultBuilderUpdater, never()).update(any(), any()); }
Source:
public boolean waitInvisibility(By elementLocator, int timeout) { return webDriverWaitFactory.get(timeout).until(invisibilityOfElementLocated(elementLocator)); }

Target:
public void waitInvisibility(By elementLocator, int timeout) { webDriverWaitFactory.get(timeout).until(invisibilityOfElementLocated(elementLocator)); }