auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public @ResponseBody boolean addTeamToTournament( HttpSession session, @PathVariable int id, @RequestParam(value = "teamName") String teamName, @RequestParam(value = "acceptFreeAgents") boolean acceptFreeAgents, @RequestParam(value = "teamLeaderId") int teamLeaderId) { Member me = (Member) session.getAttribute("member"); if(me == null) { return false; } TournamentDao tournamentDao = new TournamentDao(); Tournament tournament = tournamentDao.getTournamentById(id, false, true); Team team = new Team(); team.setName(teamName); team.setAcceptFreeAgents(acceptFreeAgents); team.setTournament(tournament); team.setTeamLeader(me); TeamDao teamDao = new TeamDao(); teamDao.saveTeam(team); tournament.addTeam(team); tournamentDao.saveTournament(tournament); MessageDao messageDao = new MessageDao(); for (Member player : team.getPlayers()) messageDao.notify(player, team.getName() + " team was added to " + tournament.getName()); return true; }

Target:
public @ResponseBody boolean addTeamToTournament( HttpSession session, @PathVariable int id, @RequestParam(value = "teamName") String teamName, @RequestParam(value = "acceptFreeAgents") boolean acceptFreeAgents, @RequestParam(value = "teamLeaderId") int teamLeaderId) { Member me = (Member) session.getAttribute("member"); if (me == null) { return false; } TournamentDao tournamentDao = new TournamentDao(); Tournament tournament = tournamentDao.getTournamentById(id, false, true); Team team = new Team(); team.setName(teamName); team.setAcceptFreeAgents(acceptFreeAgents); team.setTournament(tournament); team.setTeamLeader(me); TeamDao teamDao = new TeamDao(); teamDao.saveTeam(team); tournament.addTeam(team); tournamentDao.saveTournament(tournament); return true; }
Source:
private Collection<String> discover(BeanDiscoveryMode beanDiscoveryMode, URL beansXmlUrl, URL indexUrl, Set<AnnotationType> beanDefiningAnnotations) { List<String> discoveredClasses = new ArrayList<String>(); BiConsumer<String, ClassFile> consumer; if (BeanDiscoveryMode.ANNOTATED.equals(beanDiscoveryMode)) { Index index = tryLoadIndex(indexUrl); if (index != null) { consumer = (name, classFile) -> { ClassInfo classInfo = index.getClassByName(DotName.createSimple(name)); if (classInfo != null && hasBeanDefiningAnnotation(classInfo, beanDefiningAnnotations)) { discoveredClasses.add(name); } }; } else { Indexer indexer = new Indexer(); consumer = (name, classFile) -> { try { ClassInfo classInfo = indexer.index(classFile.openStream()); if (classInfo != null && hasBeanDefiningAnnotation(classInfo, beanDefiningAnnotations)) { discoveredClasses.add(name); } } catch (IOException e) { WeldLogger.DEPLOYMENT_LOGGER.cannotIndexClassName(name, beansXmlUrl); } }; } } else { consumer = (name, classFile) -> discoveredClasses.add(name); } UrlScanner scanner = new UrlScanner(beansXmlUrl, consumer); return scanner.scan() ? discoveredClasses : null; }

Target:
private Collection<String> discover(BeanDiscoveryMode beanDiscoveryMode, URL beansXmlUrl, URL indexUrl, Set<AnnotationType> beanDefiningAnnotations) { List<String> discoveredClasses = new ArrayList<String>(); BiConsumer<String, ClassFile> consumer; if (BeanDiscoveryMode.ANNOTATED.equals(beanDiscoveryMode)) { Index index = tryLoadIndex(indexUrl); if (index != null) { consumer = (name, classFile) -> { ClassInfo classInfo = index.getClassByName(DotName.createSimple(name)); if (classInfo != null && hasBeanDefiningAnnotation(classInfo, beanDefiningAnnotations)) { discoveredClasses.add(name); } }; } else { Indexer indexer = new Indexer(); consumer = (name, classFile) -> { try (InputStream in = classFile.openStream()) { ClassInfo classInfo = indexer.index(in); if (classInfo != null && hasBeanDefiningAnnotation(classInfo, beanDefiningAnnotations)) { discoveredClasses.add(name); } } catch (IOException e) { WeldLogger.DEPLOYMENT_LOGGER.cannotIndexClassName(name, beansXmlUrl); } }; } } else { consumer = (name, classFile) -> discoveredClasses.add(name); } UrlScanner scanner = new UrlScanner(beansXmlUrl, consumer); return scanner.scan() ? discoveredClasses : null; }
Source:
public void patientVoided(Patient patient) throws APIException { List<Cohort> cohorts = Context.getCohortService().getCohortsContainingPatient(patient); for (Cohort cohort : cohorts) { List<CohortMembership> membersWithPatient = cohort.getMembers().stream() .filter(m -> m.getPatient().equals(patient)) .collect(Collectors.toList()); membersWithPatient.forEach(m -> m.setVoided(patient.getVoided())); } }

Target:
public void patientVoided(Patient patient) throws APIException { List<Cohort> cohorts = Context.getCohortService().getCohortsContainingPatient(patient); for (Cohort cohort : cohorts) { List<CohortMembership> membersToVoid = cohort.getMembers().stream() .filter(m -> !m.getVoided() && patient.getVoided() && m.getPatient().getPatientId().equals(patient.getPatientId())) .collect(Collectors.toList()); for (CohortMembership member : membersToVoid) { member.setVoided(patient.getVoided()); member.setDateVoided(patient.getDateVoided()); member.setVoidedBy(patient.getVoidedBy()); member.setVoidReason(patient.getVoidReason()); } cohort.removeMember(patient); Context.getCohortService().saveCohort(cohort); } }
Source:
public static void refreshPackages(Bundle[] bundles) { FrameworkWiring wiring = context.getBundle(Constants.SYSTEM_BUNDLE_LOCATION).adapt(FrameworkWiring.class); wiring.refreshBundles(asList(bundles)); }

Target:
public static void refreshPackages(Bundle[] bundles) { FrameworkWiring wiring = context.getBundle(Constants.SYSTEM_BUNDLE_LOCATION).adapt(FrameworkWiring.class); final boolean[] flag = new boolean[] { false }; FrameworkListener listener = event -> { if (event.getType() == FrameworkEvent.PACKAGES_REFRESHED) { synchronized (flag) { flag[0] = true; flag.notifyAll(); } } }; context.addFrameworkListener(listener); wiring.refreshBundles(asList(bundles)); synchronized (flag) { while (!flag[0]) { try { flag.wait(); } catch (InterruptedException e) { } } } context.removeFrameworkListener(listener); }
Source:
private String insertSQL(SafeAppendable builder) { sqlClause(builder, "INSERT INTO", tables, "", "", ""); sqlClause(builder, "", columns, "(", ")", ", "); for (int i = 0; i < values.size(); i++) { String keyword = ""; String close = "),"; if(i == 0){ keyword = "VALUES"; } if(i == values.size() - 1){ close = ")"; } sqlClause(builder, keyword, values.get(i), "(", close, ", "); } return builder.toString(); }

Target:
private String insertSQL(SafeAppendable builder) { sqlClause(builder, "INSERT INTO", tables, "", "", ""); sqlClause(builder, "", columns, "(", ")", ", "); for (int i = 0; i < valuesList.size(); i++) { sqlClause(builder, i > 0 ? "," : "VALUES", valuesList.get(i), "(", ")", ", "); } return builder.toString(); }
Source:
public KubernetesCloud getCloud() { Cloud cloud = Jenkins.getInstance().getCloud(getCloudName()); if (cloud instanceof KubernetesCloud) { return (KubernetesCloud) cloud; } else { throw new IllegalStateException(getClass().getName() + " can be launched only by instances of " + KubernetesCloud.class.getName()); } }

Target:
public Cloud getCloud() { return Jenkins.getInstance().getCloud(getCloudName()); }
Source:
public void testGetProtection() throws Exception { GHBranchProtection protection = branch.enableProtection().enable(); GHBranchProtection protectionTest = repo.getBranch(BRANCH).getProtection(); assertTrue(protectionTest instanceof GHBranchProtection); }

Target:
public void testGetProtection() throws Exception { GHBranchProtection protection = branch.enableProtection().enable(); GHBranchProtection protectionTest = repo.getBranch(BRANCH).getProtection(); assertTrue(protectionTest instanceof GHBranchProtection); assertTrue(repo.getBranch(BRANCH).isProtected()); }
Source:
public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof AbstractToolbarItem)) { return false; } AbstractToolbarItem that = (AbstractToolbarItem) o; return uuid.equals(that.uuid); }

Target:
public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof AbstractToolbarItem)) { return false; } final AbstractToolbarItem that = (AbstractToolbarItem) o; return uuid.equals(that.uuid); }
Source:
public <T, C extends PreCommitCondition, E extends Exception> T runTaskWithConditionThrowOnConflict( C condition, ConditionAwareTransactionTask<T, C, E> task) throws E, TransactionFailedRetriableException { checkOpen(); RawTransaction tx = setupRunTaskWithConditionThrowOnConflict(condition); return finishRunTaskWithLockThrowOnConflict(tx, transaction -> task.execute(transaction, condition)); }

Target:
public <T, C extends PreCommitCondition, E extends Exception> T runTaskWithConditionThrowOnConflict( C condition, ConditionAwareTransactionTask<T, C, E> task) throws E, TransactionFailedRetriableException { checkOpen(); try { RawTransaction tx = setupRunTaskWithConditionThrowOnConflict(condition); return finishRunTaskWithLockThrowOnConflict(tx, transaction -> task.execute(transaction, condition)); } finally { condition.cleanup(); } }
Source:
public FeedbackRubricQuestionDetails() { super(FeedbackQuestionType.RUBRIC); this.hasAssignedWeights = false; this.rubricWeights = new ArrayList<>(); this.numOfRubricChoices = 0; this.rubricChoices = new ArrayList<>(); this.numOfRubricSubQuestions = 0; this.rubricSubQuestions = new ArrayList<>(); this.initializeRubricDescriptions(); this.initializeRubricWeights(); }

Target:
public FeedbackRubricQuestionDetails() { super(FeedbackQuestionType.RUBRIC); this.hasAssignedWeights = false; this.rubricWeights = new ArrayList<>(); this.numOfRubricChoices = 0; this.rubricChoices = new ArrayList<>(); this.numOfRubricSubQuestions = 0; this.rubricSubQuestions = new ArrayList<>(); this.initializeRubricDescriptions(); this.rubricWeightsForEachCell = new ArrayList<>(); }
Source:
private void onNext() { if (mClientCertificateCheckBox.isChecked()) { onManualSetup(); return; } String email = mEmailView.getText().toString(); ConnectionSettings connectionSettings = providersXmlDiscovery.discover(email); if (connectionSettings == null) { connectionSettings = srvServiceDiscovery.discover(email); } if (connectionSettings != null) { finishAutoSetup(connectionSettings); } else { onManualSetup(); } }

Target:
private void onNext() { if (mClientCertificateCheckBox.isChecked()) { onManualSetup(); return; } String email = mEmailView.getText().toString(); ConnectionSettings connectionSettings = providersXmlDiscovery.discover(email); if (connectionSettings != null) { finishAutoSetup(connectionSettings); } else { onManualSetup(); } }
Source:
private PartitionMetadata findLeader() throws InterruptedException { for (KafkaBroker broker : replicaBrokers) { SimpleConsumer consumer = null; try { log.info("findLeader, try broker %s:%s", broker.host, broker.port); consumer = new SimpleConsumer(broker.host, broker.port, soTimeout, bufferSize, clientId + "leaderLookup"); TopicMetadataResponse resp = consumer.send(new TopicMetadataRequest(Collections.singletonList(topic))); List<TopicMetadata> metaData = resp.topicsMetadata(); for (TopicMetadata item : metaData) { if (topic.equals(item.topic())) { for (PartitionMetadata part : item.partitionsMetadata()) { if (part.partitionId() == partitionId) { return part; } } } } } catch (Exception e) { ensureNotInterrupted(e); log.warn( e, "error communicating with Broker [%s] to find leader for [%s] - [%s]", broker, topic, partitionId ); } finally { if (consumer != null) { try { consumer.close(); } catch (Exception e) { } } } } return null; }

Target:
private PartitionMetadata findLeader() throws InterruptedException { for (KafkaBroker broker : replicaBrokers) { SimpleConsumer consumer = null; try { log.info("Finding new leader from Kafka brokers, try broker %s:%s", broker.host, broker.port); consumer = new SimpleConsumer(broker.host, broker.port, SO_TIMEOUT, BUFFER_SIZE, leaderLookupClientId); TopicMetadataResponse resp = consumer.send(new TopicMetadataRequest(Collections.singletonList(topic))); List<TopicMetadata> metaData = resp.topicsMetadata(); for (TopicMetadata item : metaData) { if (topic.equals(item.topic())) { for (PartitionMetadata part : item.partitionsMetadata()) { if (part.partitionId() == partitionId) { return part; } } } } } catch (Exception e) { ensureNotInterrupted(e); log.warn( e, "error communicating with Kafka Broker [%s] to find leader for [%s] - [%s]", broker, topic, partitionId ); } finally { if (consumer != null) { consumer.close(); } } } return null; }
Source:
UpdatesFromMixpanel constructUpdatesFromMixpanel(final Context context, final String token) { if (Build.VERSION.SDK_INT < MPConfig.UI_FEATURES_MIN_API || mConfig.getDisableViewCrawler()) { Log.i(LOGTAG, "Web Configuration, A/B Testing, and Dynamic Tweaks are disabled."); return new NoOpUpdatesFromMixpanel(sSharedTweaks); } else { return new ViewCrawler(mContext, mToken, this, sSharedTweaks); } }

Target:
UpdatesFromMixpanel constructUpdatesFromMixpanel(final Context context, final String token) { if (Build.VERSION.SDK_INT < MPConfig.UI_FEATURES_MIN_API) { Log.i(LOGTAG, "SDK version is lower than " + MPConfig.UI_FEATURES_MIN_API + ". Web Configuration, A/B Testing, and Dynamic Tweaks are disabled."); return new NoOpUpdatesFromMixpanel(sSharedTweaks); } else if (mConfig.getDisableViewCrawler()) { Log.i(LOGTAG, "DisableViewCrawler is set to true. Web Configuration, A/B Testing, and Dynamic Tweaks are disabled."); return new NoOpUpdatesFromMixpanel(sSharedTweaks); } else { return new ViewCrawler(mContext, mToken, this, sSharedTweaks); } }
Source:
public Map<String, QuestionGroupDto> findQuestionGroup( @PathVariable("id") Long id) { final Map<String, QuestionGroupDto> response = new HashMap<String, QuestionGroupDto>(); QuestionGroup s = questionGroupDao.getByKey(id); QuestionGroupDto dto = null; if (s != null) { dto = QuestionGroupDtoMapper.transform(s); } response.put("question_group", dto); return response; }

Target:
public Map<String, QuestionGroupDto> findQuestionGroup( @PathVariable("id") Long id) { final Map<String, QuestionGroupDto> response = new HashMap<String, QuestionGroupDto>(); QuestionGroup qg = questionGroupDao.getByKey(id); QuestionGroupDto dto = null; if (qg != null) { dto = QuestionGroupDtoMapper.transform(qg); } response.put("question_group", dto); return response; }
Source:
public ProducerRecord<byte[], byte[]> serialize(RowData consumedRow, @Nullable Long timestamp) { if (keySerialization == null && !hasMetadata) { final byte[] valueSerialized = valueSerialization.serialize(consumedRow); return new ProducerRecord<>( topic, extractPartition(consumedRow, null, valueSerialized), null, valueSerialized); } final byte[] keySerialized; final RowKind kind = consumedRow.getRowKind(); if (keySerialization == null) { keySerialized = null; } else { final RowData keyRow = createProjectedRow(consumedRow, kind, keyFieldGetters); keySerialized = keySerialization.serialize(keyRow); } final byte[] valueSerialized; if (kind == RowKind.DELETE) { valueSerialized = null; } else { final RowData valueRow = createProjectedRow(consumedRow, kind, valueFieldGetters); valueSerialized = valueSerialization.serialize(valueRow); } return new ProducerRecord<>( topic, extractPartition(consumedRow, keySerialized, valueSerialized), readMetadata(consumedRow, KafkaDynamicSink.WritableMetadata.TIMESTAMP), keySerialized, valueSerialized, readMetadata(consumedRow, KafkaDynamicSink.WritableMetadata.HEADERS)); }

Target:
public ProducerRecord<byte[], byte[]> serialize(RowData consumedRow, @Nullable Long timestamp) { if (keySerialization == null && !hasMetadata) { final byte[] valueSerialized = valueSerialization.serialize(consumedRow); return new ProducerRecord<>( topic, extractPartition(consumedRow, null, valueSerialized), null, valueSerialized); } final byte[] keySerialized; if (keySerialization == null) { keySerialized = null; } else { final RowData keyRow = createProjectedRow(consumedRow, RowKind.INSERT, keyFieldGetters); keySerialized = keySerialization.serialize(keyRow); } final byte[] valueSerialized; final RowKind kind = consumedRow.getRowKind(); final RowData valueRow = createProjectedRow(consumedRow, kind, valueFieldGetters); if (upsertMode) { if (kind == RowKind.DELETE || kind == RowKind.UPDATE_BEFORE) { valueSerialized = null; } else { valueRow.setRowKind(RowKind.INSERT); valueSerialized = valueSerialization.serialize(valueRow); } } else { valueSerialized = valueSerialization.serialize(valueRow); } return new ProducerRecord<>( topic, extractPartition(consumedRow, keySerialized, valueSerialized), readMetadata(consumedRow, KafkaDynamicSink.WritableMetadata.TIMESTAMP), keySerialized, valueSerialized, readMetadata(consumedRow, KafkaDynamicSink.WritableMetadata.HEADERS)); }
Source:
public String getColumnText(Object element, int columnIndex) { if (element instanceof ECAction) { switch (columnIndex) { case 0: if (null != ((ECAction) element).getAlgorithm()) { return ((ECAction) element).getAlgorithm().getName(); } break; case 1: if (null != ((ECAction) element).getOutput()) { return ((ECAction) element).getOutput().getName(); } break; default: break; } } return "[none]"; }

Target:
public String getColumnText(Object element, int columnIndex) { if (element instanceof ECAction) { switch (columnIndex) { case 0: if (null != ((ECAction) element).getAlgorithm()) { return ((ECAction) element).getAlgorithm().getName(); } break; case 1: if (null != ((ECAction) element).getOutput()) { return ((ECAction) element).getOutput().getName(); } break; default: break; } } return ECCContentAndLabelProvider.EMPTY_FIELD; }
Source:
void checkExpectedRouterErrorCode(RouterErrorCode routerErrorCode) throws Exception { try { future.get(AWAIT_TIMEOUT, TimeUnit.SECONDS); Assert.fail("Blob should have failed in operation: " + getOperationName()); } catch (Exception e) { Assert.assertTrue("Expect RouterException", e.getCause() instanceof RouterException); Assert.assertEquals("RouterErrorCode doesn't match.", routerErrorCode, ((RouterException) e.getCause()).getErrorCode()); } }

Target:
void checkExpectedRouterErrorCode(RouterErrorCode routerErrorCode) { try { future.get(AWAIT_TIMEOUT, TimeUnit.SECONDS); Assert.fail("Blob should have failed in operation: " + getOperationName()); } catch (Exception e) { Assert.assertTrue("Expect RouterException", e.getCause() instanceof RouterException); Assert.assertEquals("RouterErrorCode doesn't match.", routerErrorCode, ((RouterException) e.getCause()).getErrorCode()); } }
Source:
private ConditionEvaluationResult evaluate(EnabledIf annotation, ScriptEngine scriptEngine, String script) { Object result; try { result = scriptEngine.eval(script); } catch (ScriptException e) { logger.warn(e, () -> "Evaluation of @EnabledIf script failed, disabling execution"); logger.info(() -> "Script: `" + script + "`"); logger.info(() -> "Bindings: " + scriptEngine.getBindings(ScriptContext.ENGINE_SCOPE).entrySet()); return disabled(e.toString()); } if (result instanceof ConditionEvaluationResult) { return (ConditionEvaluationResult) result; } String resultAsString = String.valueOf(result); String reason = createReason(annotation, script, resultAsString); return Boolean.parseBoolean(resultAsString) ? enabled(reason) : disabled(reason); }

Target:
private ConditionEvaluationResult evaluate(EnabledIf annotation, ScriptEngine scriptEngine, String script) { Object result; try { result = scriptEngine.eval(script); } catch (ScriptException e) { String caption = "Evaluation of @EnabledIf script failed."; String bindings = scriptEngine.getBindings(ScriptContext.ENGINE_SCOPE).entrySet().toString(); String message = String.format("%s script=`%s`, bindings=%s", caption, script, bindings); throw new JUnitException(message, e); } if (result instanceof ConditionEvaluationResult) { return (ConditionEvaluationResult) result; } String resultAsString = String.valueOf(result); String reason = createReason(annotation, script, resultAsString); return Boolean.parseBoolean(resultAsString) ? enabled(reason) : disabled(reason); }
Source:
private void showMissingMediaView(String mediaUri, String errorMessage, boolean allowDownload, @Nullable Runnable completion) { missingMediaBackground.setVisibility(VISIBLE); missingMediaText.setText(errorMessage); missingMediaText.setVisibility(VISIBLE); downloadIcon.setVisibility(allowDownload ? View.VISIBLE : INVISIBLE); downloadIcon.setOnClickListener(v -> { progressBar.setVisibility(VISIBLE); downloadIcon.setVisibility(INVISIBLE); downloadIcon.setEnabled(false); missingMediaText.setText(StringUtils.getStringRobust(getContext(), R.string.media_download_in_progress)); MissingMediaDownloadHelper.requestMediaDownload(mediaUri, result -> { if (result instanceof MissingMediaDownloadResult.Success) { AndroidUtil.showToast(getContext(), R.string.media_download_completed); if (completion != null) { completion.run(); } } else if (!(result instanceof MissingMediaDownloadResult.InProgress)) { progressBar.setVisibility(GONE); downloadIcon.setVisibility(VISIBLE); downloadIcon.setEnabled(true); missingMediaText.setText(StringUtils.getStringRobust(getContext(), R.string.media_download_failed)); } }); }); }

Target:
private void showMissingMediaView(String mediaUri, String errorMessage, boolean allowDownload, @Nullable Runnable completion) { missingMediaBackground.setVisibility(VISIBLE); missingMediaStatus.setText(errorMessage); missingMediaStatus.setVisibility(VISIBLE); downloadIcon.setVisibility(allowDownload ? View.VISIBLE : INVISIBLE); downloadIcon.setOnClickListener(v -> { progressBar.setVisibility(VISIBLE); downloadIcon.setVisibility(INVISIBLE); downloadIcon.setEnabled(false); missingMediaStatus.setText(StringUtils.getStringRobust(getContext(), R.string.media_download_in_progress)); MissingMediaDownloadHelper.requestMediaDownload(mediaUri, Dispatchers.getDefault(), result -> { if (result instanceof MissingMediaDownloadResult.Success) { AndroidUtil.showToast(getContext(), R.string.media_download_completed); hideMissingMediaView(); if (completion != null) { completion.run(); } } else if (!(result instanceof MissingMediaDownloadResult.InProgress)) { progressBar.setVisibility(GONE); downloadIcon.setVisibility(VISIBLE); downloadIcon.setEnabled(true); missingMediaStatus.setText(StringUtils.getStringRobust(getContext(), R.string.media_download_failed)); } }); }); }
Source:
private void populateTeamsContainer() { if (!replay.getValidity().equals(Validity.VALID)) { showRatingChangeButton.setDisable(true); showRatingChangeButton.setText(i18n.get("game.notValid")); } else if (replay.getTeamPlayerStats() .values() .stream() .flatMap(Collection::stream) .anyMatch(playerStats -> playerStats.getAfterMean() == null || playerStats.getAfterDeviation() == null)) { showRatingChangeButton.setDisable(true); showRatingChangeButton.setText(i18n.get("game.notRatedYet")); } Map<Integer, PlayerStats> statsByPlayerId = teams.values().stream() .flatMap(Collection::stream) .collect(Collectors.toMap(PlayerStats::getPlayerId, Function.identity())); Platform.runLater(() -> teams.forEach((team, value) -> { List<Integer> playerIds = value.stream() .map(PlayerStats::getPlayerId) .collect(Collectors.toList()); TeamCardController controller = uiService.loadFxml("theme/team_card.fxml"); teamCardControllers.add(controller); playerService.getPlayersByIds(playerIds) .thenAccept(players -> controller.setPlayersInTeam(team, players, player -> { PlayerStats playerStats = statsByPlayerId.get(player.getId()); return new Rating(playerStats.getBeforeMean(), playerStats.getBeforeDeviation()); })); teamsContainer.getChildren().add(controller.getRoot()); })); }

Target:
private void populateTeamsContainer() { if (!replay.getValidity().equals(Validity.VALID)) { showRatingChangeButton.setDisable(true); showRatingChangeButton.setText(i18n.get("game.notValid")); } else if (!replayService.replayChangedRating(replay)) { showRatingChangeButton.setDisable(true); showRatingChangeButton.setText(i18n.get("game.notRatedYet")); } Map<Integer, PlayerStats> statsByPlayerId = teams.values().stream() .flatMap(Collection::stream) .collect(Collectors.toMap(PlayerStats::getPlayerId, Function.identity())); Platform.runLater(() -> teams.forEach((team, value) -> { List<Integer> playerIds = value.stream() .map(PlayerStats::getPlayerId) .collect(Collectors.toList()); TeamCardController controller = uiService.loadFxml("theme/team_card.fxml"); teamCardControllers.add(controller); playerService.getPlayersByIds(playerIds) .thenAccept(players -> controller.setPlayersInTeam(team, players, player -> { PlayerStats playerStats = statsByPlayerId.get(player.getId()); return new Rating(playerStats.getBeforeMean(), playerStats.getBeforeDeviation()); })); teamsContainer.getChildren().add(controller.getRoot()); })); }
Source:
public void setUp() throws Exception { IEclipseContext globalContext = Activator.getDefault() .getGlobalContext(); workbenchContext = globalContext.createChild("workbenchContext"); ContextInjectionFactory.make(CommandServiceAddon.class, workbenchContext); ContextInjectionFactory.make(ContextServiceAddon.class, workbenchContext); ContextInjectionFactory.make(BindingServiceAddon.class, workbenchContext); defineCommands(workbenchContext); defineContexts(workbenchContext); defineBindingTables(workbenchContext); }

Target:
public void setUp() { IEclipseContext globalContext = Activator.getDefault() .getGlobalContext(); workbenchContext = globalContext.createChild("workbenchContext"); ContextInjectionFactory.make(CommandServiceAddon.class, workbenchContext); ContextInjectionFactory.make(ContextServiceAddon.class, workbenchContext); ContextInjectionFactory.make(BindingServiceAddon.class, workbenchContext); defineCommands(workbenchContext); defineContexts(workbenchContext); defineBindingTables(workbenchContext); }
Source:
private static String serialize(Object obj) throws IOException { ObjectMapper mapper = new ObjectMapper() .enableDefaultTyping(ObjectMapper.DefaultTyping.OBJECT_AND_NON_CONCRETE); mapper.getSerializationConfig().addMixInAnnotations(ExtMap.class, JsonExtMapMixIn.class); mapper.getSerializationConfig().addMixInAnnotations(IVdcQueryable.class, JsonIVdcQueryableMixIn.class); return mapper.writeValueAsString(obj); }

Target:
private static String serialize(Object obj) throws IOException { ObjectMapper mapper = new ObjectMapper() .enableDefaultTyping(ObjectMapper.DefaultTyping.OBJECT_AND_NON_CONCRETE); mapper.getSerializationConfig().addMixInAnnotations(ExtMap.class, JsonExtMapMixIn.class); return mapper.writeValueAsString(obj); }
Source:
private static byte[] loadExternalResource(String location) throws IOException, CheckstyleException { final ByteArrayOutputStream content = new ByteArrayOutputStream(); final URI uri = CommonUtil.getUriByFilename(location); try (InputStream is = uri.toURL().openStream()) { do { final int size = is.read(BUFFER); if (size == -1) { break; } content.write(BUFFER, 0, size); } while (true); } return content.toByteArray(); }

Target:
private static byte[] loadExternalResource(String location) throws IOException, CheckstyleException { final URI uri = CommonUtil.getUriByFilename(location); try (InputStream is = uri.toURL().openStream()) { return toByteArray(is); } }
Source:
public VariableStatsEstimate visitCall(CallExpression call, Void context) { if (resolution.isNegateFunction(call.getFunctionHandle())) { return computeNegationStatistics(call, context); } FunctionMetadata functionMetadata = metadata.getFunctionManager().getFunctionMetadata(call.getFunctionHandle()); if (functionMetadata.getOperatorType().map(OperatorType::isArithmeticOperator).orElse(false)) { return computeArithmeticBinaryStatistics(call, context); } RowExpression value = new RowExpressionOptimizer(metadata).optimize(call, OPTIMIZED, session.toConnectorSession()); if (value == null) { return nullStatsEstimate(); } if (value instanceof ConstantExpression) { return value.accept(this, context); } if (resolution.isCastFunction(call.getFunctionHandle())) { return computeCastStatistics(call, context); } return VariableStatsEstimate.unknown(); }

Target:
public VariableStatsEstimate visitCall(CallExpression call, Void context) { if (resolution.isNegateFunction(call.getFunctionHandle())) { return computeNegationStatistics(call, context); } FunctionMetadata functionMetadata = metadata.getFunctionManager().getFunctionMetadata(call.getFunctionHandle()); if (functionMetadata.getOperatorType().map(OperatorType::isArithmeticOperator).orElse(false)) { return computeArithmeticBinaryStatistics(call, context); } RowExpression value = new RowExpressionOptimizer(metadata).optimize(call, OPTIMIZED, session.toConnectorSession()); if (isNull(value)) { return nullStatsEstimate(); } if (value instanceof ConstantExpression) { return value.accept(this, context); } if (resolution.isCastFunction(call.getFunctionHandle())) { return computeCastStatistics(call, context); } return VariableStatsEstimate.unknown(); }
Source:
public static SingleServerAppliance create(String id, String name, List<AvailableDataCenters> availableDataCenters, String osInstallationBase, Types.OSFamliyType osFamily, String os, String osVersion, int osArchitecture, Types.OSImageType osImageType, int minHddSize, Types.ApplianceType type, String state, String version, List<String> categories, String eulaUrl) { return new AutoValue_SingleServerAppliance(id, name, availableDataCenters == null ? ImmutableList.<AvailableDataCenters>of() : availableDataCenters, osInstallationBase, osFamily, os, osVersion, osArchitecture, osImageType, minHddSize, type, state, version, categories == null ? ImmutableList.<String>of() : categories, eulaUrl); }

Target:
public static SingleServerAppliance create(String id, String name, List<AvailableDataCenters> availableDataCenters, String osInstallationBase, Types.OSFamliyType osFamily, String os, String osVersion, int osArchitecture, Types.OSImageType osImageType, int minHddSize, Types.ApplianceType type, String state, String version, List<String> categories, String eulaUrl) { return builder() .id(id) .name(name) .availableDataCenters(availableDataCenters == null ? ImmutableList.<AvailableDataCenters>of() : ImmutableList.copyOf(availableDataCenters)) .osInstallationBase(osInstallationBase) .osFamily(osFamily) .os(os) .osVersion(osVersion) .osArchitecture(osArchitecture) .osImageType(osImageType) .minHddSize(minHddSize) .type(type) .state(state) .version(version) .categories(categories == null ? ImmutableList.<String>of() : ImmutableList.copyOf(categories)) .eulaUrl(eulaUrl) .build(); }
Source:
public void testResourceLoadingAtOpenSession() throws Exception { SessionManager.INSTANCE.addSessionsListener(new SessionManagerListener.Stub() { @Override public void notify(Session updated, int notification) { super.notify(updated, notification); if (notification == SessionListener.OPENING) { ResourceSet resourceSet = session.getTransactionalEditingDomain().getResourceSet(); EList<Resource> resources = resourceSet.getResources(); assertEquals("ResourceSet should contain only 2 resources at SessionListener.OPENING notification. Resources in resourceSet :", 2, resources.size()); } } @Override public void notifyAddSession(Session newSession) { ResourceSet resourceSet = session.getTransactionalEditingDomain().getResourceSet(); EList<Resource> resources = resourceSet.getResources(); assertEquals("ResourceSet should contain only resources at notifyAddSession. Resources in resourceSet :", 2, resources.size()); } }); copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, PATH, AIRD_MODEL_FILENAME, SEMANTIC_MODEL_FILENAME); URI sessionResourceURI = URI.createPlatformResourceURI("/" + TEMPORARY_PROJECT_NAME + "/" + AIRD_MODEL_FILENAME, true); session = SessionFactory.INSTANCE.createSession(sessionResourceURI, new NullProgressMonitor()); session.open(new NullProgressMonitor()); }

Target:
public void testResourceLoadingAtOpenSession() throws Exception { SessionManager.INSTANCE.addSessionsListener(new SessionManagerListener.Stub() { @Override public void notify(Session updated, int notification) { super.notify(updated, notification); if (notification == SessionListener.OPENING) { ResourceSet resourceSet = session.getTransactionalEditingDomain().getResourceSet(); EList<Resource> resources = resourceSet.getResources(); assertEquals("Wrong number of ResourceSet resources at SessionListener.OPENING notification", 2, resources.size()); } } @Override public void notifyAddSession(Session newSession) { ResourceSet resourceSet = session.getTransactionalEditingDomain().getResourceSet(); EList<Resource> resources = resourceSet.getResources(); assertEquals("Wrong number of ResourceSet resources at notifyAddSession", 1, resources.size()); } }); copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, PATH, AIRD_MODEL_FILENAME, SEMANTIC_MODEL_FILENAME); URI sessionResourceURI = URI.createPlatformResourceURI("/" + TEMPORARY_PROJECT_NAME + "/" + AIRD_MODEL_FILENAME, true); session = SessionFactory.INSTANCE.createSession(sessionResourceURI, new NullProgressMonitor()); session.open(new NullProgressMonitor()); }
Source:
public Type[] getActualTypeArguments() { return actualTypeArguments.clone(); }

Target:
public Type[] getActualTypeArguments() { return actualTypeArguments; }
Source:
public PerUnitGcBiasMetricsCollector(final String sample, final String library, final String readGroup) { this.sample = sample; this.library = library; this.readGroup = readGroup; final String prefix; if (this.readGroup != null) { prefix = this.readGroup; gcData.put(prefix, new GcObject()); } else if (this.library != null) { prefix = this.library; gcData.put(prefix, new GcObject()); } else if (this.sample != null) { prefix = this.sample; gcData.put(prefix, new GcObject()); } else { prefix = "All_Reads"; gcData.put(prefix, new GcObject()); } }

Target:
public PerUnitGcBiasMetricsCollector(final String sample, final String library, final String readGroup) { this.sample = sample; this.library = library; this.readGroup = readGroup; final String prefix; if (this.readGroup != null) { prefix = this.readGroup; gcData.put(prefix, new GcObject()); } else if (this.library != null) { prefix = this.library; gcData.put(prefix, new GcObject()); } else if (this.sample != null) { prefix = this.sample; gcData.put(prefix, new GcObject()); } else { prefix = allReads; gcData.put(prefix, new GcObject()); } }
Source:
public Response testMail() throws MessagingException { NotificationMail.sendMailSync(getUserId(), new Event("unknown", 0), null); return Response.noContent().build(); }

Target:
public Response testMail() throws MessagingException { NotificationMail.sendMailSync(getUserId(), new Event("test", 0), null); return Response.noContent().build(); }
Source:
public void usesImplictAndExplicitFieldAliasAndIncludeExclude() { ProjectionOperation operation = Aggregation.project("foo").and("foobar").as("bar").andInclude("inc1", "inc2") .andExclude("_id"); DBObject dbObject = operation.toDBObject(Aggregation.DEFAULT_CONTEXT); DBObject projectClause = DBObjectUtils.getAsDBObject(dbObject, PROJECT); assertThat(projectClause.get("foo"), is((Object) "$foo")); assertThat(projectClause.get("bar"), is((Object) "$foobar")); assertThat((Integer) projectClause.get("inc1"), is(1)); assertThat((Integer) projectClause.get("inc2"), is(1)); assertThat((Integer) projectClause.get("_id"), is(0)); }

Target:
public void usesImplictAndExplicitFieldAliasAndIncludeExclude() { ProjectionOperation operation = Aggregation.project("foo").and("foobar").as("bar").andInclude("inc1", "inc2") .andExclude("_id"); DBObject dbObject = operation.toDBObject(Aggregation.DEFAULT_CONTEXT); DBObject projectClause = DBObjectUtils.getAsDBObject(dbObject, PROJECT); assertThat((Integer) projectClause.get("foo"), is(1)); assertThat(projectClause.get("bar"), is((Object) "$foobar")); assertThat((Integer) projectClause.get("inc1"), is(1)); assertThat((Integer) projectClause.get("inc2"), is(1)); assertThat((Integer) projectClause.get("_id"), is(0)); }
Source:
private WebResponse makeRequest(List<NameValuePair> postData) throws Exception { WebRequest request = new WebRequest(client.createCrumbedUrl(ENDPOINT), POST); if (postData != null) request.setRequestParameters(postData); request.setCharset(Charset.forName("UTF-8")); return client.loadWebResponse(request); }

Target:
private WebResponse makeRequest(List<NameValuePair> postData) throws Exception { WebRequest request = new WebRequest(client.createCrumbedUrl(ENDPOINT), POST); if (postData != null) request.setRequestParameters(postData); request.setCharset(StandardCharsets.UTF_8); return client.loadWebResponse(request); }
Source:
IFocusSelectable[] getFocusSelectableSegments() { if (selectableSegments != null || paragraphs == null) return selectableSegments; Vector<ParagraphSegment> result = new Vector<>(); for (Paragraph p : paragraphs) { ParagraphSegment[] segments = p.getSegments(); for (ParagraphSegment segment : segments) { if (segment instanceof IFocusSelectable) result.add(segment); } } selectableSegments = result .toArray(new IFocusSelectable[result.size()]); return selectableSegments; }

Target:
IFocusSelectable[] getFocusSelectableSegments() { if (selectableSegments != null || paragraphs == null) return selectableSegments; Vector<ParagraphSegment> result = new Vector<>(); for (Paragraph paragraph : paragraphs) { ParagraphSegment[] segments = paragraph.getSegments(); for (ParagraphSegment segment : segments) { if (segment instanceof IFocusSelectable) result.add(segment); } } selectableSegments = result .toArray(new IFocusSelectable[result.size()]); return selectableSegments; }
Source:
public void display_tags_with_edit() { executeBuild("shared/xoo-sample", "sample-with-tags", "Sample with tags"); wsClient.wsConnector().call( new PostRequest("api/project_tags/set") .setParam("project", "sample-with-tags") .setParam("tags", "foo,bar,baz") ); executeBuild("shared/xoo-sample", "sample", "Sample"); ProjectDashboardPage page = nav.logIn().asAdmin().openProjectDashboard("sample"); SelenideElement tags = page.getTags(); tags.$(".tags-list > span").should(hasText("No tags")); tags.$("button").shouldBe(visible).click(); tags.$("div.multi-select").shouldBe(visible); tags.$$("ul.menu a").get(2).click(); tags.$(".tags-list > span").should(hasText("foo")); tags.$("input").sendKeys("test"); tags.$$("ul.menu a").get(1).should(hasText("+ test")).click(); tags.$(".tags-list > span").should(hasText("foo, test")); tags.$$("ul.menu a").get(1).should(hasText("test")); tags.$("input").sendKeys(Keys.ENTER); tags.$(".tags-list > span").should(hasText("foo")); }

Target:
public void display_tags_with_edit() { executeBuild("shared/xoo-sample", "sample-with-tags", "Sample with tags"); wsClient.wsConnector().call( new PostRequest("api/project_tags/set") .setParam("project", "sample-with-tags") .setParam("tags", "foo,bar,baz") ); executeBuild("shared/xoo-sample", "sample", "Sample"); ProjectDashboardPage page = nav.logIn().asAdmin().openProjectDashboard("sample"); page .shouldHaveTags("No tags") .shouldBeEditable() .openTagEditor() .getTagAtIdx(2).click(); page .shouldHaveTags("foo") .sendKeysToTagsInput("test") .getTagAtIdx(0).should(hasText("+ test")).click(); page .shouldHaveTags("foo", "test") .getTagAtIdx(1).should(hasText("test")); page .sendKeysToTagsInput(Keys.ENTER) .shouldHaveTags("test"); }
Source:
private void createDynamicMappingControl(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage, EEFDynamicMappingFor dynamicMappingFor) { String domainClassExpression = dynamicMappingFor.getDomainClassExpression(); EEFDynamicMappingSwitch dynamicMappingSwitch = dynamicMappingFor.getSwitch(); String switchExpression = dynamicMappingSwitch.getSwitchExpression(); if (domainClassExpression != null && domainClassExpression.trim().length() > 0 && switchExpression != null && switchExpression.trim().length() > 0) { IEvaluationResult domainClassExpressionResult = this.interpreter.evaluateExpression(this.variableManager.getVariables(), domainClassExpression); if (domainClassExpressionResult.success()) { for (EObject eObject : domainClassExpressionResult.asEObjects()) { String iterator = dynamicMappingFor.getIterator(); Map<String, Object> switchExpressionVariables = new HashMap<String, Object>(); switchExpressionVariables.put("self", this.variableManager.getVariables().get("self")); switchExpressionVariables.put(iterator, eObject); IEvaluationResult switchExpressionResult = this.interpreter.evaluateExpression(switchExpressionVariables, switchExpression); EEFWidgetDescription eefWidgetDescription = this.getWidgetDescription(switchExpressionResult, dynamicMappingSwitch.getCases()); if (eefWidgetDescription != null) { IVariableManager childVariableManager = this.variableManager.createChild(); childVariableManager.put(iterator, eObject); this.createWidgetControl(parent, tabbedPropertySheetPage, eefWidgetDescription, childVariableManager); } } } } }

Target:
private void createDynamicMappingControl(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage, EEFDynamicMappingFor dynamicMappingFor) { String domainClassExpression = dynamicMappingFor.getDomainClassExpression(); EEFDynamicMappingSwitch dynamicMappingSwitch = dynamicMappingFor.getSwitch(); String switchExpression = dynamicMappingSwitch.getSwitchExpression(); if (!Util.isBlank(domainClassExpression) && !Util.isBlank(switchExpression)) { IEvaluationResult domainClassExpressionResult = this.interpreter.evaluateExpression(this.variableManager.getVariables(), domainClassExpression); if (domainClassExpressionResult.success()) { for (EObject eObject : domainClassExpressionResult.asEObjects()) { String iterator = dynamicMappingFor.getIterator(); Map<String, Object> switchExpressionVariables = new HashMap<String, Object>(); switchExpressionVariables.put(EEFExpressionUtils.SELF, this.variableManager.getVariables().get(EEFExpressionUtils.SELF)); switchExpressionVariables.put(iterator, eObject); IEvaluationResult switchExpressionResult = this.interpreter.evaluateExpression(switchExpressionVariables, switchExpression); EEFWidgetDescription eefWidgetDescription = this.getWidgetDescription(switchExpressionResult, dynamicMappingSwitch.getCases()); if (eefWidgetDescription != null) { IVariableManager childVariableManager = this.variableManager.createChild(); childVariableManager.put(iterator, eObject); this.createWidgetControl(parent, tabbedPropertySheetPage, eefWidgetDescription, childVariableManager); } } } } }
Source:
public void testCreateFailNotFound() { PluginDescriptor pluginDescriptor = mock(DefaultPluginDescriptor.class); when(pluginDescriptor.getPluginClass()).thenReturn("org.pf4j.plugin.NotFoundTestPlugin"); PluginWrapper pluginWrapper = mock(PluginWrapper.class); when(pluginWrapper.getDescriptor()).thenReturn(pluginDescriptor); when(pluginWrapper.getPluginClassLoader()).thenReturn(getClass().getClassLoader()); DefaultPluginFactory instance = new DefaultPluginFactory(); Plugin result = instance.create(pluginWrapper); assertNull(result); }

Target:
public void testCreateFailNotFound() { PluginDescriptor pluginDescriptor = mock(PluginDescriptor.class); when(pluginDescriptor.getPluginClass()).thenReturn("org.pf4j.plugin.NotFoundTestPlugin"); PluginWrapper pluginWrapper = mock(PluginWrapper.class); when(pluginWrapper.getDescriptor()).thenReturn(pluginDescriptor); when(pluginWrapper.getPluginClassLoader()).thenReturn(getClass().getClassLoader()); DefaultPluginFactory instance = new DefaultPluginFactory(); Plugin result = instance.create(pluginWrapper); assertNull(result); }
Source:
private void initUserAnswers() { OrderedHashtable<String, QueryPrompt> queryPrompts = queryDatum.getUserQueryPrompts(); for (Enumeration en = queryPrompts.keys(); en.hasMoreElements(); ) { String promptId = (String)en.nextElement(); QueryPrompt prompt = queryPrompts.get(promptId); String defaultValue = ""; if(prompt.getDefaultValueExpr() != null) { defaultValue = FunctionUtils.toString(prompt.getDefaultValueExpr().eval(evaluationContext)); } userAnswers.put(prompt.getKey(), defaultValue); } }

Target:
private void initUserAnswers() throws XPathException { OrderedHashtable<String, QueryPrompt> queryPrompts = queryDatum.getUserQueryPrompts(); for (Enumeration en = queryPrompts.keys(); en.hasMoreElements(); ) { String promptId = (String)en.nextElement(); QueryPrompt prompt = queryPrompts.get(promptId); String defaultValue = ""; if(prompt.getDefaultValueExpr() != null) { defaultValue = FunctionUtils.toString(prompt.getDefaultValueExpr().eval(evaluationContext)); } userAnswers.put(prompt.getKey(), defaultValue); } }
Source:
public void onActivityCreated(final Activity activity, Bundle bundle) { Observable .just(activity) .filter(sameInstance) .subscribe(sendCreateEvent); }

Target:
public void onActivityCreated(final Activity activity, Bundle bundle) { sendEvent(activity, LifecycleEvent.CREATE); }
Source:
public OutputSettings charset(Charset charset) { if( document != null ) { Element meta = document.select("meta[charset]").first(); if( meta != null ) { meta.attr("charset", charset.displayName()); } } this.charset = charset; charsetEncoder = charset.newEncoder(); return this; }

Target:
public OutputSettings charset(Charset charset) { this.charset = charset; charsetEncoder = charset.newEncoder(); return this; }
Source:
public static String makeRandomPassword(final int length, String... passwordValidCharsPool) { Preconditions.checkState(length >= passwordValidCharsPool.length); int l = 0; char[] id = new char[length]; for(int i = 0; i < passwordValidCharsPool.length; i++){ id[l++] = pickRandomCharFrom(passwordValidCharsPool[i]); } String remainingValidChars = passwordValidCharsPool[passwordValidCharsPool.length - 1]; while(l < length) { id[l++] = pickRandomCharFrom(remainingValidChars); } return new String(id); }

Target:
public static String makeRandomPassword(final int length, String... passwordValidCharsPool) { Preconditions.checkState(length >= passwordValidCharsPool.length); int l = 0; Character[] password = new Character[length]; for(int i = 0; i < passwordValidCharsPool.length; i++){ password[l++] = pickRandomCharFrom(passwordValidCharsPool[i]); } String remainingValidChars = mergeCharacterSets(passwordValidCharsPool); while(l < length) { password[l++] = pickRandomCharFrom(remainingValidChars); } List<Character> list = Arrays.asList(password); Collections.shuffle(list); return Joiner.on("").join(list); }
Source:
private Object createSecurityManager(SparkConf conf) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { Object securityManager = null; try { Constructor<?> smConstructor = getClass().getClassLoader() .loadClass("org.apache.spark.SecurityManager") .getConstructor(new Class[]{ SparkConf.class }); } catch (NoSuchMethodException e) { Constructor<?> smConstructor = getClass().getClassLoader() .loadClass("org.apache.spark.SecurityManager") .getConstructor(new Class[]{ SparkConf.class, scala.Option.class }); securityManager = smConstructor.newInstance(conf, null); } return securityManager; }

Target:
private Object createSecurityManager(SparkConf conf) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { Object securityManager = null; try { Constructor<?> smConstructor = getClass().getClassLoader() .loadClass("org.apache.spark.SecurityManager") .getConstructor(new Class[]{ SparkConf.class, scala.Option.class }); securityManager = smConstructor.newInstance(conf, null); } catch (NoSuchMethodException e) { Constructor<?> smConstructor = getClass().getClassLoader() .loadClass("org.apache.spark.SecurityManager") .getConstructor(new Class[]{ SparkConf.class }); securityManager = smConstructor.newInstance(conf); } return securityManager; }
Source:
public void theGetOrganizationResponseContains(final Map<String, String> expectedResult) { final FindOrganisationResponse response = (FindOrganisationResponse) ScenarioContext.current() .get(PlatformCommonKeys.RESPONSE); final Organisation organisation = response.getOrganisation(); final Organisation expected = this.createOrganisation(expectedResult); if (this.organisationMatches(expected, organisation)) { return; } Assert.fail("Expected organization \"" + expected.getOrganisationIdentification() + "\" was not found as the organization in the response"); }

Target:
public void theGetOrganizationResponseContains(final Map<String, String> expectedResult) { final FindOrganisationResponse response = (FindOrganisationResponse) ScenarioContext.current() .get(PlatformCommonKeys.RESPONSE); final Organisation organisation = response.getOrganisation(); final Organisation expected = this.createOrganisation(expectedResult); Assert.assertTrue( "Expected organization \"" + expected.getOrganisationIdentification() + "\" was not found as the organization in the response", this.organisationMatches(expected, organisation)); }