auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public int hashCode() { <START> int result = identifier.hashCode(); <END> result = 31 * result + type.hashCode(); return result; }</code><technical_language>Objects.hash( identifier, type ); instead of method</technical_language>

Target:
public int hashCode() { return Objects.hash( identifier, type ); }
Source:
<code>private static void runClusterBasedJobCoordinator(String[] args) { final String coordinatorSystemEnv = System.getenv(ShellCommandConfig.ENV_COORDINATOR_SYSTEM_CONFIG()); final String submissionEnv = System.getenv(ShellCommandConfig.ENV_SUBMISSION_CONFIG()); if (submissionEnv != null) { Config submissionConfig; try { LOG.info("Parsing submission config {}", submissionEnv); submissionConfig = new MapConfig(SamzaObjectMapper.getObjectMapper().readValue(submissionEnv, Config.class)); <START> LOG.info("Using the submission config: {}.", submissionEnv); <END> } catch (IOException e) { LOG.error("Exception while reading submission config", e); throw new SamzaException(e); } ClusterBasedJobCoordinator jc = new ClusterBasedJobCoordinator(submissionConfig); jc.run(); LOG.info("Finished running ClusterBasedJobCoordinator"); } else { Config coordinatorSystemConfig; try { LOG.info("Parsing coordinator system config {}", coordinatorSystemEnv); coordinatorSystemConfig = new MapConfig(SamzaObjectMapper.getObjectMapper().readValue(coordinatorSystemEnv, Config.class)); LOG.info("Using the coordinator system config: {}.", coordinatorSystemConfig); } catch (IOException e) { LOG.error("Exception while reading coordinator stream config", e); throw new SamzaException(e); } ClusterBasedJobCoordinator jc = new ClusterBasedJobCoordinator(coordinatorSystemConfig); jc.run(); LOG.info("Finished running ClusterBasedJobCoordinator"); } }</code><technical_language>s/submissionEnv/submissiongConfig</technical_language>

Target:
private static void runClusterBasedJobCoordinator(String[] args) { final String coordinatorSystemEnv = System.getenv(ShellCommandConfig.ENV_COORDINATOR_SYSTEM_CONFIG()); final String submissionEnv = System.getenv(ShellCommandConfig.ENV_SUBMISSION_CONFIG()); if (!StringUtils.isBlank(submissionEnv)) { Config submissionConfig; try { LOG.info("Parsing submission config {}", submissionEnv); submissionConfig = new MapConfig(SamzaObjectMapper.getObjectMapper().readValue(submissionEnv, Config.class)); LOG.info("Using the submission config: {}.", submissionConfig); } catch (IOException e) { LOG.error("Exception while reading submission config", e); throw new SamzaException(e); } ClusterBasedJobCoordinator jc = createFromConfigLoader(submissionConfig); jc.run(); LOG.info("Finished running ClusterBasedJobCoordinator"); } else { Config coordinatorSystemConfig; try { LOG.info("Parsing coordinator system config {}", coordinatorSystemEnv); coordinatorSystemConfig = new MapConfig(SamzaObjectMapper.getObjectMapper().readValue(coordinatorSystemEnv, Config.class)); LOG.info("Using the coordinator system config: {}.", coordinatorSystemConfig); } catch (IOException e) { LOG.error("Exception while reading coordinator stream config", e); throw new SamzaException(e); } ClusterBasedJobCoordinator jc = createFromMetadataStore(coordinatorSystemConfig); jc.run(); LOG.info("Finished running ClusterBasedJobCoordinator"); } }
Source:
<code>public void submitWithPasteAndCommentReturnsPasteUrl() throws IOException, ParseException, ExpiredException, IllegalArgumentException, TmcCoreException, URISyntaxException, NoLanguagePluginFoundException { Path testPath = Paths.get( "home", "test", "2014-mooc-no-deadline", "viikko1", "viikko1-Viikko1_001.Nimi"); settings.setCurrentCourse(rootFinder.getCurrentCourse(testPath.toString()).or(new Course())); this.courseSubmitter = new ExerciseSubmitter(rootFinder, langs, urlCommunicator, tmcApi, settings); rootFinder.setReturnValue(testPath.toString()); <START> URI pastePath = URI.create("<LINK_0>"); <END> URI result = courseSubmitter.submitPasteWithComment(testPath, "Commentti"); assertEquals(pastePath, result); }</code><technical_language>Replace URL pointing production server <LINK_1> if actual HTTP request is intended. If a request is intended, replace WireMock</technical_language>

Target:
public void submitWithPasteAndCommentReturnsPasteUrl() throws IOException, ParseException, ExpiredException, IllegalArgumentException, TmcCoreException, URISyntaxException, NoLanguagePluginFoundException { Path testPath = Paths.get( "home", "test", "no-deadline", "halfdoneExercise"); settings.setCurrentCourse(rootFinder.getCurrentCourse(testPath).or(new Course())); this.courseSubmitter = new ExerciseSubmitter(rootFinder, langs, urlCommunicator, tmcApi, settings); rootFinder.setReturnValue(testPath); URI pastePath = URI.create("<LINK_2>"); URI result = courseSubmitter.submitPasteWithComment(testPath, "Commentti"); assertEquals(pastePath, result); }
Source:
<code>public final void testConcurrentAccess() { MockConcurrentSessionProvider.getInstance(); ECPEMFUtils.getESWorkspaceProviderInstance(); for (int i = 0; i < numberOfThreads; i++) { final Runnable runnable = getNewTest(); final Thread t = new Thread(runnable); t.setName("ECPConcurrentTestThread" + i); t.start(); } try { <START> Thread.sleep(20000); <END> } catch (final InterruptedException ex) { ex.printStackTrace(); } }</code><technical_language>assume other threads finish in 20 seconds, add threads a collection do a t.join() of them</technical_language>

Target:
public final void testConcurrentAccess() { MockConcurrentSessionProvider.getInstance(); ECPEMFUtils.getESWorkspaceProviderInstance(); final Collection<Thread> collection = new ArrayList<Thread>(); for (int i = 0; i < numberOfThreads; i++) { final Runnable runnable = getNewTest(); final Thread t = new Thread(runnable); t.setName("ECPConcurrentTestThread" + i); collection.add(t); t.start(); } final Iterator<Thread> iter = collection.iterator(); while (iter.hasNext()) { final Thread thread = iter.next(); try { thread.join(); } catch (final InterruptedException ex) { ex.printStackTrace(); } } }
Source:
<code>public boolean supportsBitmapIndex(BitmapIndexSelector selector) { <START> if(selector.getBitmapIndex(boundDimFilter.getDimension()) == null) { <END> return false; } else { return true; } }</code><technical_language>formatting</technical_language>

Target:
public boolean supportsBitmapIndex(BitmapIndexSelector selector) { return selector.getBitmapIndex(boundDimFilter.getDimension()) != null; }
Source:
<code>@Test public void configRoundTrip() throws Exception { story.addStep(new Statement() { <START> @SuppressWarnings("rawtypes") <END> @Override public void evaluate() throws Throwable { SSHUserPrivateKey c = new DummyPrivateKey("creds", "bob", "secret", "the-key"); CredentialsProvider.lookupStores(story.j.jenkins).iterator().next().addCredentials(Domain.global(), c); BindingStep s = new StepConfigTester(story.j).configRoundTrip(new BindingStep( Collections.<MultiBinding>singletonList(new SSHUserPrivateKeyBinding("keyFile", "passphrase", "user", "creds")))); story.j.assertEqualDataBoundBeans(s.getBindings(), Collections.singletonList(new SSHUserPrivateKeyBinding("keyFile", "passphrase", "user", "creds"))); } }); }</code><technical_language>Collections.<TheType>singletonList</technical_language>

Target:
@Test public void configRoundTrip() throws Exception { story.addStep(new Statement() { @Override public void evaluate() throws Throwable { SSHUserPrivateKey c = new DummyPrivateKey("creds", "bob", "secret", "the-key"); CredentialsProvider.lookupStores(story.j.jenkins).iterator().next().addCredentials(Domain.global(), c); SSHUserPrivateKeyBinding binding = new SSHUserPrivateKeyBinding("keyFile", "creds"); binding.setPassphraseVariable("passphrase"); binding.setUsernameVariable("user"); BindingStep s = new StepConfigTester(story.j).configRoundTrip(new BindingStep( Collections.<MultiBinding>singletonList(binding))); story.j.assertEqualDataBoundBeans(s.getBindings(), Collections.singletonList(binding)); } }); }
Source:
<code>public void timestampServiceShouldRespectDistinctClientsWhenIssuingTimestamps() { TimestampService timestampService1 = getTimestampService(CLIENT_1); TimestampService timestampService2 = getTimestampService(CLIENT_2); long firstServiceFirstTimestamp = timestampService1.getFreshTimestamp(); long secondServiceFirstTimestamp = timestampService2.getFreshTimestamp(); long firstServiceSecondTimestamp = timestampService1 .getFreshTimestamps(100) .getUpperBound(); long secondServiceSecondTimestamp = timestampService2.getFreshTimestamp(); <START> assertThat(firstServiceSecondTimestamp - firstServiceFirstTimestamp).isGreaterThanOrEqualTo(100L); <END> assertThat(secondServiceSecondTimestamp - secondServiceFirstTimestamp).isBetween(0L, 100L); }</code><technical_language>Technically speaking this fail getFreshTimestamps return full 100 timestamps (the API guarantee that). this is do TimestampRange tr = timestampService1.getFreshTimestamps(100); while (tr.size() != 100) { tr = timestampService1.getFreshTimestamps(100); } long firstServiceSecondTimestamp = tr.getUpperBound();</technical_language>

Target:
public void timestampServiceShouldRespectDistinctClientsWhenIssuingTimestamps() { TimestampService timestampService1 = getTimestampService(CLIENT_1); TimestampService timestampService2 = getTimestampService(CLIENT_2); long firstServiceFirstTimestamp = timestampService1.getFreshTimestamp(); long secondServiceFirstTimestamp = timestampService2.getFreshTimestamp(); getFortyTwoFreshTimestamps(timestampService1); long firstServiceSecondTimestamp = timestampService1.getFreshTimestamp(); long secondServiceSecondTimestamp = timestampService2.getFreshTimestamp(); assertThat(firstServiceSecondTimestamp - firstServiceFirstTimestamp).isGreaterThanOrEqualTo(FORTY_TWO); assertThat(secondServiceSecondTimestamp - secondServiceFirstTimestamp).isBetween(0L, (long) FORTY_TWO); }
Source:
<code>public Publisher<Void> close() { return subscriber -> { subscriber.onSubscribe(EmptySubscription.INSTANCE); synchronized (this) { factoryRefresher.close(); activeFactories.clear(); AtomicInteger n = new AtomicInteger(activeSockets.size()); activeSockets.forEach(rs -> { rs.close().subscribe(new Subscriber<Void>() { @Override public void onSubscribe(Subscription s) { s.request(Long.MAX_VALUE); } @Override public void onNext(Void aVoid) @Override public void onError(Throwable t) { if (n.decrementAndGet() == 0) { <START> subscriber.onComplete(); <END> closeSubject.subscribe(EmptySubscriber.INSTANCE); closeSubject.onComplete(); } } @Override public void onComplete() { if (n.decrementAndGet() == 0) { subscriber.onComplete(); closeSubject.subscribe(EmptySubscriber.INSTANCE); closeSubject.onComplete(); } } }); }); } }; }</code><technical_language>propagate onError subscriber here? EDIT: description, I nice log error if exception</technical_language>

Target:
public Publisher<Void> close() { return subscriber -> { subscriber.onSubscribe(EmptySubscription.INSTANCE); synchronized (this) { factoryRefresher.close(); activeFactories.clear(); AtomicInteger n = new AtomicInteger(activeSockets.size()); activeSockets.forEach(rs -> { rs.close().subscribe(new Subscriber<Void>() { @Override public void onSubscribe(Subscription s) { s.request(Long.MAX_VALUE); } @Override public void onNext(Void aVoid) @Override public void onError(Throwable t) { logger.warn("Exception while closing a ReactiveSocket", t); onComplete(); } @Override public void onComplete() { if (n.decrementAndGet() == 0) { subscriber.onComplete(); closeSubject.subscribe(EmptySubscriber.INSTANCE); closeSubject.onComplete(); } } }); }); } }; }
Source:
<code>Connection start() { log.info("Starting PubSub connection"); ProjectSubscriptionName subscriptionName = ProjectSubscriptionName .of(projectId, subscriptionId); FlowControlSettings flowControlSettings = FlowControlSettings.newBuilder() <START> .setMaxOutstandingElementCount(maxOutstandingElementCount) <END> .setMaxOutstandingRequestBytes(maxOutstandingRequestBytes) .build(); ExecutorProvider executorProvider = InstantiatingExecutorProvider.newBuilder().setExecutorThreadCount(threads).build(); log.info("Subscribing to {}", subscriptionName); Subscriber subscriber = Subscriber .newBuilder(subscriptionName, new Receiver(consumer)) .setFlowControlSettings(flowControlSettings) .setExecutorProvider(executorProvider) .setChannelProvider(channelProvider) .setCredentialsProvider(credentialsProvider) .build(); subscriber.startAsync().awaitRunning(); log.info("PubSub connection started"); return this; }</code><technical_language>set variables final, no</technical_language>

Target:
Connection start() { log.info("Starting PubSub connection"); ProjectSubscriptionName subscriptionName = ProjectSubscriptionName .of(projectId, subscriptionId); FlowControlSettings flowControlSettings = FlowControlSettings.newBuilder() .setMaxOutstandingElementCount(maxOutstandingElementCount) .setMaxOutstandingRequestBytes(maxOutstandingRequestBytes) .build(); ExecutorProvider executorProvider = InstantiatingExecutorProvider.newBuilder().setExecutorThreadCount(threads).build(); log.info("Subscribing to {}", subscriptionName); subscriber = Subscriber .newBuilder(subscriptionName, new Receiver(consumer)) .setFlowControlSettings(flowControlSettings) .setExecutorProvider(executorProvider) .setChannelProvider(channelProvider) .setCredentialsProvider(credentialsProvider) .build(); subscriber.startAsync().awaitRunning(); log.info("PubSub connection started"); return this; }
Source:
<code>public Map<String, Integer> flushCaches(final List<String> indexNames) { Logger.warn(this.getClass(), "Flushing Elasticsearch index caches:" + indexNames); if(indexNames==null || indexNames.isEmpty()) { return ImmutableMap.of("failedShards",0, "successfulShards", 0); } <START> ClearIndicesCacheRequest request = new ClearIndicesCacheRequest( <END> indexNames.toArray(new String[0])); ClearIndicesCacheResponse clearCacheResponse = Sneaky.sneak(()->( RestHighLevelClientProvider.getInstance().getClient().indices() .clearCache(request, RequestOptions.DEFAULT))); Map<String, Integer> map= ImmutableMap.of("failedShards", clearCacheResponse.getFailedShards(), "successfulShards", clearCacheResponse.getSuccessfulShards()); Logger.warn(this.getClass(), "Flushed Elasticsearch index caches:" + map); return map; }</code><technical_language>![Codacy](<LINK_0> Issue found: [Local variable 'request' declared final](<LINK_1></technical_language>

Target:
public Map<String, Integer> flushCaches(final List<String> indexNames) { Logger.warn(this.getClass(), "Flushing Elasticsearch index caches:" + indexNames); if(indexNames==null || indexNames.isEmpty()) { return ImmutableMap.of("failedShards",0, "successfulShards", 0); } ClearIndicesCacheRequest request = new ClearIndicesCacheRequest( indexNames.stream().map(indexName -> getNameWithClusterIDPrefix(indexName)).collect( Collectors.toList()).toArray(new String[0])); ClearIndicesCacheResponse clearCacheResponse = Sneaky.sneak(()->( RestHighLevelClientProvider.getInstance().getClient().indices() .clearCache(request, RequestOptions.DEFAULT))); Map<String, Integer> map= ImmutableMap.of("failedShards", clearCacheResponse.getFailedShards(), "successfulShards", clearCacheResponse.getSuccessfulShards()); Logger.warn(this.getClass(), "Flushed Elasticsearch index caches:" + map); return map; }
Source:
<code>public Future<?> scheduleLotsOutsideLoop(final ThreadState threadState) { for (int i = 1; i <= threadState.num; i++) { <START> threadState.eventLoop.schedule(NO_OP, i, TimeUnit.HOURS); <END> } return null; }</code><technical_language>save threadState.eventLoop in a field tight loop</technical_language>

Target:
public Future<?> scheduleLotsOutsideLoop(final ThreadState threadState) { final AbstractScheduledEventExecutor eventLoop = threadState.eventLoop; for (int i = 1; i <= threadState.num; i++) { eventLoop.schedule(NO_OP, i, TimeUnit.HOURS); } return null; }
Source:
<code>public Object doWork() { final String sampleName = ReadCountCollectionUtils.getSampleNameForCLIsFromReadCountsFile(new File(coverageFile)); final ReadCountCollection counts; try { counts = ReadCountCollectionUtils.parse(new File(coverageFile)); } catch (final IOException ex) { throw new UserException.BadInput("could not read input file"); } <START> final List<Double> coverage = Arrays.stream(counts.counts().getColumn(0)).mapToObj(x->x).collect(Collectors.toList()); <END> final List<SimpleInterval> intervals = counts.targets().stream().map(Target::getInterval).collect(Collectors.toList()); final CopyRatioSegmenter segmenter = new CopyRatioSegmenter(initialNumStates, intervals, coverage); final List<ModeledSegment> segmentsWithLogSpaceMeans = segmenter.findSegments(); final List<ModeledSegment> segments = segmentsWithLogSpaceMeans.stream().map(segment -> new ModeledSegment(segment.getSimpleInterval(), segment.getTargetCount(), segment.getSegmentMeanInCRSpace())).collect(Collectors.toList());; SegmentUtils.writeModeledSegmentFile(outputSegmentsFile, segments, sampleName, true); return "SUCCESS"; }</code><technical_language>Doubles.asList(counts.counts().getColumn(0))</technical_language>

Target:
public Object doWork() { final String sampleName = ReadCountCollectionUtils.getSampleNameForCLIsFromReadCountsFile(new File(coverageFile)); final ReadCountCollection counts; try { counts = ReadCountCollectionUtils.parse(new File(coverageFile)); } catch (final IOException ex) { throw new UserException.BadInput("could not read input file"); } final List<Double> coverage = Doubles.asList(counts.counts().getColumn(0)); final List<SimpleInterval> intervals = counts.targets().stream().map(Target::getInterval).collect(Collectors.toList()); final CopyRatioSegmenter segmenter = new CopyRatioSegmenter(initialNumStates, intervals, coverage); final List<ModeledSegment> segmentsWithLog2Means = segmenter.findSegments(); final List<ModeledSegment> segments = segmentsWithLog2Means.stream().map(segment -> new ModeledSegment(segment.getSimpleInterval(), segment.getTargetCount(), segment.getSegmentMeanInCRSpace())).collect(Collectors.toList());; SegmentUtils.writeModeledSegmentFile(outputSegmentsFile, segments, sampleName, true); return "SUCCESS"; }
Source:
<code>private List<MetricFamilySamples> getSessionMetrics() { return Arrays.<MetricFamilySamples>asList( createCounter( <START> "hibernate_session_open_total", <END> "Global number of sessions opened", statistics.getSessionOpenCount() ), createCounter( "hibernate_session_close_total", "Global number of sessions closed", statistics.getSessionCloseCount() ), createCounter( "hibernate_flush_total", "Get the global number of flush executed by sessions", statistics.getFlushCount() ), createCounter( "hibernate_connect_total", "Get the global number of connections asked by the sessions", statistics.getConnectCount() ), createCounter( "hibernate_optimistic_failure_total", "The number of StaleObjectStateExceptions that occurred", statistics.getOptimisticFailureCount() ) ); }</code><technical_language>opened "open" implies current number of open sessions Similarly for other counters</technical_language>

Target:
private List<MetricFamilySamples> getSessionMetrics() { return Arrays.<MetricFamilySamples>asList( createCounter( "hibernate_session_opened_total", "Global number of sessions opened (getSessionOpenCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getSessionOpenCount(); } } ), createCounter( "hibernate_session_closed_total", "Global number of sessions closed (getSessionCloseCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getSessionCloseCount(); } } ), createCounter( "hibernate_flushed_total", "The global number of flushes executed by sessions (getFlushCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getFlushCount(); } } ), createCounter( "hibernate_connect_total", "The global number of connections requested by the sessions (getConnectCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getConnectCount(); } } ), createCounter( "hibernate_optimistic_failure_total", "The number of StaleObjectStateExceptions that occurred (getOptimisticFailureCount)", new ValueProvider() { @Override public double getValue(Statistics statistics) { return statistics.getOptimisticFailureCount(); } } ) ); }
Source:
<code>public Predicate<String> getFilter() { return Stream.of( Glob.toGlobPredicate(this.include), Glob.toGlobPredicate(this.exclude).negate(), <START> commonClasses().negate() <END> ).reduce(x -> true, Predicate::and); }</code><technical_language>Instead of Streaming return Glob.toGlobPredicate(this.include) .and(Glob.toGlobPredicate(this.exclude).negate()) .and(commonClasses().negate())</technical_language>

Target:
public Predicate<String> getFilter() { return Glob.toGlobPredicate(this.include) .and(Glob.toGlobPredicate(this.exclude).negate()) .and(commonClasses().negate()); }
Source:
<code>public void deleteStorage(final String id) throws DbWriteOperationsBlockedException, NoSuchStorageException, StorageIsUsedException { if (featureToggleService.isFeatureEnabled(FeatureToggleService.Feature.DISABLE_DB_WRITE_OPERATIONS)) { throw new DbWriteOperationsBlockedException("Cannot delete storage: write operations on DB " + "are blocked by feature flag."); } try { storageDbRepository.deleteStorage(id); } catch (final RepositoryProblemException e) { LOG.error("DB error occurred when deleting storage", e); throw new InternalNakadiException(e.getMessage()); } catch (final TransactionException e) { LOG.error("Error with transaction handling when deleting storage", e); throw new InternalNakadiException("Transaction error occurred when deleting storage"); } <START> return; <END> }</code><technical_language>gift:</technical_language>

Target:
public void deleteStorage(final String id) throws DbWriteOperationsBlockedException, NoSuchStorageException, StorageIsUsedException, InternalNakadiException { if (featureToggleService.isFeatureEnabled(FeatureToggleService.Feature.DISABLE_DB_WRITE_OPERATIONS)) { throw new DbWriteOperationsBlockedException("Cannot delete storage: write operations on DB " + "are blocked by feature flag."); } try { storageDbRepository.deleteStorage(id); } catch (final RepositoryProblemException e) { LOG.error("DB error occurred when deleting storage", e); throw new InternalNakadiException(e.getMessage()); } catch (final TransactionException e) { LOG.error("Error with transaction handling when deleting storage", e); throw new InternalNakadiException("Transaction error occurred when deleting storage"); } }
Source:
<code>public void updateList(List<Encounter> visitEncounters) { List<Encounter> displayableEnounters = new ArrayList<>(); for (Encounter encounter : visitEncounters) { String[] displayableEncounterTypes = ApplicationConstants.EncounterTypes.ENCOUNTER_TYPES_DISPLAYS; String encounterTypeDisplay = encounter.getEncounterType().getDisplay(); <START> if (Arrays.asList(displayableEncounterTypes).contains(encounterTypeDisplay)) { <END> displayableEnounters.add(encounter); } } mExpandableListAdapter = new VisitExpandableListAdapter(this.getActivity(), displayableEnounters); mExpandableListView.setAdapter(mExpandableListAdapter); mExpandableListView.setGroupIndicator(null); }</code><technical_language>Create collection for loop do once. more efficient HashSet intend call contains (O(1) instead of O(n)). a small set difference, a good habit do right shows understand difference</technical_language>

Target:
public void updateList(List<Encounter> visitEncounters) { final String[] displayableEncounterTypes = ApplicationConstants.EncounterTypes.ENCOUNTER_TYPES_DISPLAYS; final HashSet<String> displayableEncounterTypesArray = new HashSet<>(Arrays.asList(displayableEncounterTypes)); List<Encounter> displayableEncounters = new ArrayList<>(); for (Encounter encounter : visitEncounters) { String encounterTypeDisplay = encounter.getEncounterType().getDisplay(); if (displayableEncounterTypesArray.contains(encounterTypeDisplay)) { displayableEncounters.add(encounter); } } mExpandableListAdapter = new VisitExpandableListAdapter(this.getActivity(), displayableEncounters); mExpandableListView.setAdapter(mExpandableListAdapter); mExpandableListView.setGroupIndicator(null); }
Source:
<code><START> public <M1 extends Model<IS, IA>> StackedDatasetTrainer<IS, IA, O, AM, L> addTrainer( <END> DatasetTrainer<M1, L> trainer) { submodelsTrainers.add(new DatasetTrainer<Model<IS, IA>, L>() { @Override public <K, V> Model<IS, IA> fit(DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> featureExtractor, IgniteBiFunction<K, V, L> lbExtractor) { return trainer.fit(datasetBuilder, featureExtractor, lbExtractor); } @Override protected boolean checkState(Model<IS, IA> mdl) { return true; } @Override protected <K, V> Model<IS, IA> updateModel(Model<IS, IA> mdl, DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> featureExtractor, IgniteBiFunction<K, V, L> lbExtractor) { return null; } @Override public <K, V> Model<IS, IA> update(Model<IS, IA> mdl, DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> featureExtractor, IgniteBiFunction<K, V, L> lbExtractor) { DatasetTrainer<Model<IS, IA>, L> trainer1 = (DatasetTrainer<Model<IS, IA>, L>)trainer; return trainer1.update(mdl, datasetBuilder, featureExtractor, lbExtractor); } }); return this; }</code><technical_language>is wrapper additional logic is reason of it</technical_language>

Target:
public <M1 extends Model<IS, IA>> StackedDatasetTrainer<IS, IA, O, AM, L> addTrainer( DatasetTrainer<M1, L> trainer) { submodelsTrainers.add(new DatasetTrainer<Model<IS, IA>, L>() { @Override public <K, V> Model<IS, IA> fit(DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> featureExtractor, IgniteBiFunction<K, V, L> lbExtractor) { return trainer.fit(datasetBuilder, featureExtractor, lbExtractor); } @Override public <K, V> Model<IS, IA> update(Model<IS, IA> mdl, DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> featureExtractor, IgniteBiFunction<K, V, L> lbExtractor) { DatasetTrainer<Model<IS, IA>, L> trainer1 = (DatasetTrainer<Model<IS, IA>, L>)trainer; return trainer1.update(mdl, datasetBuilder, featureExtractor, lbExtractor); } @Override protected boolean checkState(Model<IS, IA> mdl) { return true; } @Override protected <K, V> Model<IS, IA> updateModel(Model<IS, IA> mdl, DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, Vector> featureExtractor, IgniteBiFunction<K, V, L> lbExtractor) { return null; } }); return this; }
Source:
<code>private void updateIdentifierDetails(OzoneTokenIdentifier identifier) { int sequenceNum; long now = Time.now(); sequenceNum = incrementDelegationTokenSeqNum(); identifier.setIssueDate(now); identifier.setMasterKeyId(getCurrentKey().getKeyId()); identifier.setSequenceNumber(sequenceNum); <START> identifier.setMaxDate(Time.now() + getTokenMaxLifetime()); <END> identifier.setOmCertSerialId(getOmCertificateSerialId()); }</code><technical_language>initialized variable here</technical_language>

Target:
private void updateIdentifierDetails(OzoneTokenIdentifier identifier) { int sequenceNum; long now = Time.now(); sequenceNum = incrementDelegationTokenSeqNum(); identifier.setIssueDate(now); identifier.setMasterKeyId(getCurrentKey().getKeyId()); identifier.setSequenceNumber(sequenceNum); identifier.setMaxDate(now + getTokenMaxLifetime()); identifier.setOmCertSerialId(getOmCertificateSerialId()); }
Source:
<code>private void applyEntrypoint(Entrypoint entrypoint, List<HasMetadata> list) { ContainerSearch search = new ContainerSearch( entrypoint.getDeployment(), entrypoint.getPod(), entrypoint.getContainer(), entrypoint.getPodSelector(), entrypoint.getDeploymentSelector()); List<Container> cs = search.search(list); <START> List<String> command = entrypoint.getCommand(); <END> List<String> args = entrypoint.getArgs(); for (Container c : cs) { c.setCommand(command); c.setArgs(args); } }</code><technical_language>entrypoint.getCommand() retuns empty list if user define it. override command/arg if is in Devfile</technical_language>

Target:
private void applyEntrypoint(Entrypoint entrypoint, List<HasMetadata> list) { ContainerSearch search = new ContainerSearch( entrypoint.getParentName(), entrypoint.getParentSelector(), entrypoint.getContainerName()); List<Container> cs = search.search(list); List<String> command = entrypoint.getCommand(); List<String> args = entrypoint.getArgs(); for (Container c : cs) { c.setCommand(command); c.setArgs(args); } }
Source:
<code>public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { fab_layout.setOrientation(LinearLayout.HORIZONTAL); rvContributionsList.setLayoutManager(gridLayoutManager); } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) { fab_layout.setOrientation(LinearLayout.VERTICAL); <START> rvContributionsList.setLayoutManager(linearLayoutManager); <END> } }</code><technical_language>of is unclear is switching view managers this maintain current scroll position. want pop top orientation changed. Likewise, I maintain scroll positions, get some strange effects scrolling places in orientation rotating device change forth</technical_language>

Target:
public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) { fab_layout.setOrientation(LinearLayout.HORIZONTAL); rvContributionsList.setLayoutManager(new GridLayoutManager(getContext(),SPAN_COUNT)); } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) { fab_layout.setOrientation(LinearLayout.VERTICAL); rvContributionsList.setLayoutManager(new LinearLayoutManager(getContext())); } }
Source:
<code>private void startGetBlobAuthorizationFailTest(final OperationChain opChain) { <START> Callback<GetBlobResult> callback = new TestCallback<GetBlobResult>(opChain, false) { <END> @Override public void onCompletion(GetBlobResult result, Exception exception) { continueChain(opChain); } }; BlobId originalId, fraudId; try { originalId = new BlobId(opChain.blobId, clusterMap); fraudId = BlobId.craft(originalId, originalId.getVersion(), (short) (originalId.getAccountId() + 1), (short) (originalId.getContainerId() + 1)); } catch (IOException e) { FutureResult<Void> future = new FutureResult<>(); future.done(null, e); callback.onCompletion(null, e); TestFuture<Void> testFuture = new TestFuture<Void>(future, genLabel("getBlob", true), opChain) { @Override void check() throws Exception { throw e; } }; opChain.testFutures.add(testFuture); return; } Future<GetBlobResult> future = router.getBlob(fraudId.getID(), new GetBlobOptionsBuilder().operationType(GetBlobOptions.OperationType.All) .getOption(GetOption.Include_All) .build(), callback); TestFuture<GetBlobResult> testFuture = new TestFuture<GetBlobResult>(future, genLabel("getBlob", true), opChain) { @Override void check() throws Exception { checkExpectedRouterErrorCode(RouterErrorCode.BlobAuthorizationFailure); } }; opChain.testFutures.add(testFuture); }</code><technical_language>expecting error occur here? If so, set expectError true, chain continue</technical_language>

Target:
private void startGetBlobAuthorizationFailTest(final OperationChain opChain) { Callback<GetBlobResult> callback = new TestCallback<>(opChain, true); BlobId originalId, fraudId; try { originalId = new BlobId(opChain.blobId, clusterMap); fraudId = BlobId.craft(originalId, originalId.getVersion(), (short) (originalId.getAccountId() + 1), (short) (originalId.getContainerId() + 1)); } catch (IOException e) { FutureResult<Void> future = new FutureResult<>(); future.done(null, e); callback.onCompletion(null, e); TestFuture<Void> testFuture = new TestFuture<Void>(future, genLabel("getBlobAuthorizationFail", true), opChain) { @Override void check() throws Exception { throw e; } }; opChain.testFutures.add(testFuture); return; } Future<GetBlobResult> future = router.getBlob(fraudId.getID(), new GetBlobOptionsBuilder().operationType(GetBlobOptions.OperationType.All) .getOption(GetOption.Include_All) .build(), callback); TestFuture<GetBlobResult> testFuture = new TestFuture<GetBlobResult>(future, genLabel("getBlobAuthorizationFail", true), opChain) { @Override void check() throws Exception { checkExpectedRouterErrorCode(RouterErrorCode.BlobAuthorizationFailure); } }; opChain.testFutures.add(testFuture); }
Source:
<code>public void executeCommand(UICommand command) { super.executeCommand(command); if (command.equals(getRemoveSessionCommand())) { } else if(command.equals(getStartSessionCommand())) { startGeoRepSession(); } else if(command.equals(getStopSessionCommand())) { stopGeoRepSession(); } else if(command.equals(getPauseSessionCommand())) { pauseGeoRepSession(); } else if(command.equals(getResumeSessionCommand())) { resumeGeoRepSession(); } else if(command.equals(getSessionOptionsCommand())) { } else if(command.equals(getViewSessionDetailsCommand())) { } else if (command.equals(getRefreshSessionsCommand())) { refreshSessions(); } else if (command.getName().equalsIgnoreCase("onStartGeoRepSession")) { onGeoRepSessionAction(VdcActionType.StartGlusterVolumeGeoRep, constants.startVerb()); } else if (command.getName().equalsIgnoreCase("onStopGeoRepSession")) { onGeoRepSessionAction(VdcActionType.StopGeoRepSession, constants.stopVerb()); } else if (command.getName().equalsIgnoreCase("onPauseGeoRepSession")) { onGeoRepSessionAction(VdcActionType.PauseGlusterVolumeGeoRepSession, constants.pauseVerb()); } else if (command.getName().equalsIgnoreCase("onResumeGeoRepSession")) { <START> onGeoRepSessionAction(VdcActionType.ResumeGeoRepSession, constants.resumeVerb()); <END> } else if (command.getName().equalsIgnoreCase("closeWindow")) { closeWindow(); } }</code><technical_language>relevant this patch. need convention for VdcActionType of geo rep actions. "StartGlusterVolumeGeoRep" "StopGeoRepSession" good read. call - StartGlusterVolumeGeoRep - StopGlusterVolumeGeoRep - StartGeoRepSession - StopGeoRepSession</technical_language>

Target:
public void executeCommand(UICommand command) { super.executeCommand(command); if (command.equals(getRemoveSessionCommand())) { } else if(command.equals(getStartSessionCommand())) { startGeoRepSession(); } else if(command.equals(getStopSessionCommand())) { stopGeoRepSession(); } else if(command.equals(getPauseSessionCommand())) { pauseGeoRepSession(); } else if(command.equals(getResumeSessionCommand())) { resumeGeoRepSession(); } else if(command.equals(getSessionOptionsCommand())) { } else if(command.equals(getViewSessionDetailsCommand())) { } else if (command.equals(getRefreshSessionsCommand())) { refreshSessions(); } else if (command.getName().equalsIgnoreCase("onStartGeoRepSession")) { onGeoRepSessionAction(VdcActionType.StartGlusterVolumeGeoRep); } else if (command.getName().equalsIgnoreCase("onStopGeoRepSession")) { onGeoRepSessionAction(VdcActionType.StopGeoRepSession); } else if (command.getName().equalsIgnoreCase("onPauseGeoRepSession")) { onGeoRepSessionAction(VdcActionType.PauseGlusterVolumeGeoRepSession); } else if (command.getName().equalsIgnoreCase("onResumeGeoRepSession")) { onGeoRepSessionAction(VdcActionType.ResumeGeoRepSession); } else if (command.getName().equalsIgnoreCase("closeWindow")) { closeWindow(); } }
Source:
<code>public Map<String, String> readExecutionEnvironmentContainerIdMapping() { Map<String, String> executionEnvironmentContainerIdMapping = new HashMap<>(); metadataStore.all().forEach((processorId, valueBytes) -> { if (valueBytes != null) { String executionEnvContainerId = valueSerde.fromBytes(valueBytes); executionEnvironmentContainerIdMapping.put(processorId, executionEnvContainerId); } }); if (LOG.isDebugEnabled()) { for (Map.Entry<String, String> entry : executionEnvironmentContainerIdMapping.entrySet()) { <START> LOG.debug("Execution evironment container id for container {}: {}", entry.getKey(), entry.getValue()); <END> } } return executionEnvironmentContainerIdMapping; }</code><technical_language>above. consistent log message replace container processor executionEnvContainerId instead</technical_language>

Target:
public Map<String, String> readExecutionEnvironmentContainerIdMapping() { Map<String, String> executionEnvironmentContainerIdMapping = new HashMap<>(); metadataStore.all().forEach((processorId, valueBytes) -> { if (valueBytes != null) { String executionEnvContainerId = valueSerde.fromBytes(valueBytes); executionEnvironmentContainerIdMapping.put(processorId, executionEnvContainerId); } }); if (LOG.isDebugEnabled()) { for (Map.Entry<String, String> entry : executionEnvironmentContainerIdMapping.entrySet()) { LOG.debug("Processor has executionEnvContainerId as {}", entry.getKey(), entry.getValue()); } } return executionEnvironmentContainerIdMapping; }
Source:
<code>protected ResponseEntity<String> getAnnotationById(String identifier, String profileStr, String language) throws HttpException { try { AnnotationId annoId = new BaseAnnotationId(getConfiguration().getAnnotationBaseUrl(), identifier); Annotation annotation = getAnnotationService().getAnnotationById(annoId, null); SearchProfiles searchProfile = SearchProfiles.getByStr(profileStr); getAnnotationService().dereferenceSemanticTags(annotation, searchProfile, language); JsonLd annotationLd = new AnnotationLdSerializer(annotation); String jsonLd = annotationLd.toString(4); String eTag; <START> if (annotation.getLastUpdate() != null) <END> eTag = generateETag(annotation.getLastUpdate()); else eTag = generateETag(annotation.getGenerated()); MultiValueMap<String, String> headers = new LinkedMultiValueMap<String, String>(5); headers.add(HttpHeaders.VARY, HttpHeaders.ACCEPT); headers.add(HttpHeaders.ETAG, eTag); headers.add(HttpHeaders.LINK, HttpHeaders.VALUE_LDP_RESOURCE); headers.add(HttpHeaders.ALLOW, AnnotationHttpHeaders.ALLOW_GPuDOH); ResponseEntity<String> response = new ResponseEntity<String>(jsonLd, headers, HttpStatus.OK); return response; } catch (RuntimeException e) { throw new InternalServerException(e); } catch (HttpException e) { throw e; } catch (Exception e) { throw new InternalServerException(e); } }</code><technical_language>please remove of lastUpdated, this replaced generated</technical_language>

Target:
protected ResponseEntity<String> getAnnotationById(String identifier, String profileStr, String language) throws HttpException { try { AnnotationId annoId = new BaseAnnotationId(getConfiguration().getAnnotationBaseUrl(), identifier); Annotation annotation = getAnnotationService().getAnnotationById(annoId, null); SearchProfiles searchProfile = SearchProfiles.getByStr(profileStr); getAnnotationService().dereferenceSemanticTags(annotation, searchProfile, language); JsonLd annotationLd = new AnnotationLdSerializer(annotation); String jsonLd = annotationLd.toString(4); String apiVersion = getConfiguration().getAnnotationApiVersion(); String eTag = generateETag(annotation.getGenerated(), WebAnnotationFields.FORMAT_JSONLD, apiVersion); MultiValueMap<String, String> headers = new LinkedMultiValueMap<String, String>(5); headers.add(HttpHeaders.VARY, HttpHeaders.ACCEPT); headers.add(HttpHeaders.ETAG, eTag); headers.add(HttpHeaders.LINK, HttpHeaders.VALUE_LDP_RESOURCE); headers.add(HttpHeaders.ALLOW, AnnotationHttpHeaders.ALLOW_GPuDOH); ResponseEntity<String> response = new ResponseEntity<String>(jsonLd, headers, HttpStatus.OK); return response; } catch (RuntimeException e) { throw new InternalServerException(e); } catch (HttpException e) { throw e; } catch (Exception e) { throw new InternalServerException(e); } }
Source:
<code>public void paste() { List<BibEntry> entriesToAdd = Globals.clipboardManager.extractData(); if (!entriesToAdd.isEmpty()) { <START> database.getDatabase().insertEntries(entriesToAdd); <END> undoManager.addEdit(new UndoableInsertEntries(database.getDatabase(), entriesToAdd, true)); for (BibEntry entryToAdd : entriesToAdd) { UpdateField.setAutomaticFields(entryToAdd, Globals.prefs.getUpdateFieldPreferences()); } BibEntry firstNewEntry = entriesToAdd.get(0); if (Globals.prefs.getBoolean(JabRefPreferences.AUTO_OPEN_FORM)) { panel.showAndEdit(firstNewEntry); } clearAndSelect(firstNewEntry); this.requestFocus(); } }</code><technical_language>Reading other code, I insertEntries of basePanel is called. want focus entries, we</technical_language>

Target:
public void paste() { List<BibEntry> entriesToAdd = Globals.clipboardManager.extractData(); panel.insertEntries(entriesToAdd); if (!entriesToAdd.isEmpty()) { this.requestFocus(); } }
Source:
<code>public Map<String, Ref> getRefs(String prefix) throws IOException { final RefList<Ref> packed = getPackedRefs(); final RefList<LooseRef> oldLoose = looseRefs.get(); LooseScanner scan = new LooseScanner(oldLoose); scan.scan(prefix); RefList<LooseRef> loose; if (scan.newLoose != null) { loose = scan.newLoose.toRefList(); if (looseRefs.compareAndSet(oldLoose, loose)) modCnt.incrementAndGet(); } else loose = oldLoose; fireRefsChanged(); RefList.Builder<Ref> symbolic = scan.symbolic; for (int idx = 0; idx < symbolic.size();) { Ref ref = symbolic.get(idx); ref = resolve(ref, 0, prefix, loose, packed); if (ref != null && ref.getObjectId() != null) { symbolic.set(idx, ref); idx++; } else { symbolic.remove(idx); <START> final int toRemove = loose.find(ref.getName()); <END> if (0 <= toRemove) loose = loose.remove(toRemove); } } return new RefMap(prefix, packed, upcast(loose), symbolic.toRefList()); }</code><technical_language>I this implies ref null this point. correct, I if drop "ref != null" test code reading risking NPE here. (I'm pretty symbolic.get() return null, resolve() return null, ref != null test is wrong.)</technical_language>

Target:
public Map<String, Ref> getRefs(String prefix) throws IOException { final RefList<Ref> packed = getPackedRefs(); final RefList<LooseRef> oldLoose = looseRefs.get(); LooseScanner scan = new LooseScanner(oldLoose); scan.scan(prefix); RefList<LooseRef> loose; if (scan.newLoose != null) { loose = scan.newLoose.toRefList(); if (looseRefs.compareAndSet(oldLoose, loose)) modCnt.incrementAndGet(); } else loose = oldLoose; fireRefsChanged(); RefList.Builder<Ref> symbolic = scan.symbolic; for (int idx = 0; idx < symbolic.size();) { final Ref symbolicRef = symbolic.get(idx); final Ref resolvedRef = resolve(symbolicRef, 0, prefix, loose, packed); if (resolvedRef != null && resolvedRef.getObjectId() != null) { symbolic.set(idx, resolvedRef); idx++; } else { symbolic.remove(idx); final int toRemove = loose.find(symbolicRef.getName()); if (0 <= toRemove) loose = loose.remove(toRemove); } } return new RefMap(prefix, packed, upcast(loose), symbolic.toRefList()); }
Source:
<code>private static Method[] populateSetters(Class<?> cls, String propertyName) { String setterName = ""; if (propertyName != null && propertyName.length() > 0){ setterName = new StringBuilder("set").append(propertyName.substring(0, 1).toUpperCase(Locale.ENGLISH)) .append(propertyName.substring(1)).toString(); } List<Method> resultList = null; for (Method method : cls.getMethods()) { if (method.getName().equals(setterName)) { Class<?>[] clazzes = method.getParameterTypes(); if (clazzes.length != 1) continue; if (resultList == null) resultList = new ArrayList<Method>(); resultList.add(method); } } Method[] result = EMPTY_METHOD_ARRAY; if (resultList != null && !resultList.isEmpty()) result = resultList.toArray(new Method[resultList.size()]); Map<String, Method[]> classMap = SETTERS_METHODS_CACHE.computeIfAbsent(cls, k -> new ConcurrentHashMap<>()); <START> classMap.put(propertyName, result); <END> return result; }</code><technical_language>line</technical_language>

Target:
private static Method[] populateSetters(Class<?> cls, String propertyName) { String setterName = ""; if (propertyName != null && propertyName.length() > 0){ setterName = new StringBuilder("set").append(propertyName.substring(0, 1).toUpperCase(Locale.ENGLISH)) .append(propertyName.substring(1)).toString(); } List<Method> resultList = null; for (Method method : cls.getMethods()) { if (method.getName().equals(setterName)) { Class<?>[] clazzes = method.getParameterTypes(); if (clazzes.length != 1) continue; if (resultList == null) resultList = new ArrayList<Method>(); resultList.add(method); } } Method[] result = EMPTY_METHOD_ARRAY; if (resultList != null && !resultList.isEmpty()) result = resultList.toArray(new Method[resultList.size()]); SETTERS_METHODS_CACHE.computeIfAbsent(cls, k -> new ConcurrentHashMap<>()).put(propertyName, result); return result; }
Source:
<code>private Callable<Void> createDiscoveryJob( MemberId member, DiscoveryServiceFactory disoveryServiceFactory, Set<MemberId> expectedTargetSet ) throws ExecutionException, InterruptedException { Neo4jJobScheduler jobScheduler = new Neo4jJobScheduler(); jobScheduler.init(); ResolutionResolver resolutionResolver = new NoOpResolutionResolver(); <START> CoreTopologyService topologyService = disoveryServiceFactory <END> .coreTopologyService( config(), null, member, jobScheduler, logProvider, userLogProvider, resolutionResolver ); return sharedClientStarter( topologyService, expectedTargetSet ); }</code><technical_language>some reformatting place standard me. Please refrain reformatting entire files find a aligned code style</technical_language>

Target:
private Callable<Void> createDiscoveryJob( MemberId member, DiscoveryServiceFactory disoveryServiceFactory, Set<MemberId> expectedTargetSet ) throws ExecutionException, InterruptedException { Neo4jJobScheduler jobScheduler = new Neo4jJobScheduler(); jobScheduler.init(); HostnameResolver hostnameResolver = new NoOpHostnameResolver(); CoreTopologyService topologyService = disoveryServiceFactory .coreTopologyService( config(), null, member, jobScheduler, logProvider, userLogProvider, hostnameResolver ); return sharedClientStarter( topologyService, expectedTargetSet ); }
Source:
<code>private static Map<String, Object> response(Object id, Object value) { Map<String, Object> response = new HashMap<>(); <START> response.put("jsonrpc", VERSION); <END> response.put("id", id); if (value instanceof Error) { response.put("error", value); } else { response.put("result", value); } return response; }</code><technical_language>![CRITICAL](<LINK_0> 'Severity: CRITICAL') Define a constant instead of duplicating this literal "jsonrpc" 4 times. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
private static Map<String, Object> response(Object id, Object value) { Map<String, Object> response = new HashMap<>(); response.put(JSONRPC, VERSION); response.put("id", id); if (value instanceof Error) { response.put("error", value); } else { response.put("result", value); } return response; }
Source:
<code>public void setUp() throws Exception { MockitoAnnotations.initMocks(this); <START> this.controller = (ClinicalStatusController)this.mocker.getComponentUnderTest(); <END> this.logger = this.mocker.getMockedLogger(); this.documentAccessBridge = this.mocker.getInstance(DocumentAccessBridge.class); DocumentReference patientDocument = new DocumentReference("wiki", "patient", "00000001"); doReturn(patientDocument).when(this.patient).getDocument(); doReturn(this.doc).when(this.documentAccessBridge).getDocument(patientDocument); doReturn(this.data).when(this.doc).getXObject(Patient.CLASS_REFERENCE); }</code><technical_language>do need cast it? work interface, get fresh mocker.getComponentUnderTest()</technical_language>

Target:
public void setUp() throws Exception { MockitoAnnotations.initMocks(this); this.documentAccessBridge = this.mocker.getInstance(DocumentAccessBridge.class); DocumentReference patientDocument = new DocumentReference("wiki", "patient", "00000001"); doReturn(patientDocument).when(this.patient).getDocument(); doReturn(this.doc).when(this.documentAccessBridge).getDocument(patientDocument); doReturn(this.data).when(this.doc).getXObject(Patient.CLASS_REFERENCE); }
Source:
<code>public void init(Scene scene) { SimpleDoubleProperty p = Settings.getInstance().getDoubleProperty("SCREEN_HEIGHT"); p.addListener((o, old, newVal) -> { scrollPane.setPrefHeight(newVal.intValue() - 240); <START> }); <END> table.prefHeightProperty().bind(scrollPane.heightProperty().subtract(10)); scrollPane.setPrefHeight(p.intValue() - 240); }</code><technical_language>Consider a single line for this lambda expression (brackets unnecesarry). <layout</technical_language>

Target:
public void init(Scene scene) { scrollPane.prefHeightProperty().bind(Settings.getInstance().getDoubleProperty("SCREEN_HEIGHT").subtract(240)); table.prefHeightProperty().bind(scrollPane.heightProperty().subtract(10)); }