auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static String calculateChecksum(Path path, String type) throws Exception { byte[] buffer = new byte[4096]; MessageDigest md = MessageDigest.getInstance(type); try (DigestInputStream dis = new DigestInputStream(Files.newInputStream(path), md)) { while (dis.read(buffer) != -1) ; } return convertToHexadecimalString(md); }

Target:
public static String calculateChecksum(Path path, String type) throws IOException, NoSuchAlgorithmException { byte[] buffer = new byte[4096]; MessageDigest md = MessageDigest.getInstance(type); try (DigestInputStream dis = new DigestInputStream(Files.newInputStream(path), md)) { while (dis.read(buffer) != -1) ; } return convertToHexadecimalString(md); }
Source:
public Long getTimestamp(MessageAndOffset messageAndOffset) { return 0l; }

Target:
public long getTimestamp(MessageAndOffset messageAndOffset) { return 0l; }
Source:
public ConnectionNotFoundException(List<Path> paths, PointList waypoints) { super(unconnectedListString(paths), unconnectedInfo(paths, waypoints)); }

Target:
public ConnectionNotFoundException(List<Path> paths, PointList waypoints) { this(unconnectedListString(paths), unconnectedInfo(paths, waypoints)); }
Source:
public Subscriber<? super T> call(Subscriber<? super List<T>> child) { if (after) { final BoundedAfterSubscriber<T> parent = new BoundedAfterSubscriber<T>(child, capacityHint, predicate, prefetch); child.add(parent); child.setProducer(new Producer() { @Override public void request(long n) { parent.requestMore(n); } }); return parent; } final BoundedBeforeSubscriber<T> parent = new BoundedBeforeSubscriber<T>(child, capacityHint, predicate, prefetch); child.add(parent); child.setProducer(new Producer() { @Override public void request(long n) { parent.requestMore(n); } }); return parent; }

Target:
public Subscriber<? super T> call(Subscriber<? super List<T>> child) { final BoundedSubscriber<T> parent = after ? new BoundedAfterSubscriber<T>(child, capacityHint, predicate, prefetch) : new BoundedBeforeSubscriber<T>(child, capacityHint, predicate, prefetch); child.add(parent); child.setProducer(new Producer() { @Override public void request(long n) { parent.requestMore(n); } }); return parent; }
Source:
public CharSequence apply(String relativePath, Options options) throws IOException { if (relativePath == null) { throw new IllegalArgumentException("Relative path of a CSS file cannot be null."); } RequestLookup requestLookup = options.data(HbsRenderable.DATA_KEY_REQUEST_LOOKUP); StringBuilder buffer = new StringBuilder("<link href=\"") .append(requestLookup.getPublicUri()) .append('/') .append(relativePath); for (Object param : options.params) { buffer.append(param); } buffer.append("\" rel=\"stylesheet\" type=\"text/css\" />\n"); String content = buffer.toString(); if (isPlacedholderResolved(content, options)) { return ""; } addToPlaceholder(content, options); ((HashSet<String>) options.data(RESOLVED_PLACEHOLDERS)).add(content); return ""; }

Target:
public CharSequence apply(String relativePath, Options options) throws IOException { if (relativePath == null) { throw new IllegalArgumentException("Relative path of a CSS file cannot be null."); } StringBuilder completeRelativePath = new StringBuilder(relativePath); for (Object param : options.params) { completeRelativePath.append(param); } RequestLookup requestLookup = options.data(HbsRenderable.DATA_KEY_REQUEST_LOOKUP); String resourceIdentifier = getResourceIdentifier(requestLookup, completeRelativePath.toString()); if (isResourceAlreadyResolved(resourceIdentifier, options)) { return ""; } StringBuilder buffer = new StringBuilder("<link href=\"") .append(requestLookup.getPublicUri()) .append('/') .append(completeRelativePath); buffer.append("\" rel=\"stylesheet\" type=\"text/css\" />\n"); addToPlaceholder(buffer.toString(), options); ((Set) options.data(HbsRenderable.DATA_KEY_RESOLVED_RESOURCES)).add(resourceIdentifier); return ""; }
Source:
private List<KeyValue> getNextBatch() { List<KeyValue> nextBatch; try { if (readAheadOperation == null) { nextBatch = readBatch(); } else { nextBatch = readAheadOperation.get(); readAheadOperation = null; } } catch (ExecutionException ee) { if (ee.getCause() instanceof IsolationException) throw new IsolationException(ee); if (ee.getCause() instanceof TableDeletedException) { TableDeletedException cause = (TableDeletedException) ee.getCause(); throw new TableDeletedException(cause.getTableId(), cause); } if (ee.getCause() instanceof TableOfflineException) throw new TableOfflineException(ee); if (ee.getCause() instanceof SampleNotPresentException) throw new SampleNotPresentException(ee.getCause().getMessage(), ee); throw new RuntimeException(ee); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } if (!nextBatch.isEmpty()) { batchCount++; if (batchCount > readaheadThreshold) { initiateReadAhead(); } } return nextBatch; }

Target:
private List<KeyValue> getNextBatch() { List<KeyValue> nextBatch; try { if (readAheadOperation == null) { nextBatch = readBatch(); } else { nextBatch = readAheadOperation.get(); readAheadOperation = null; } } catch (ExecutionException ee) { wrapExecutionException(ee); throw new RuntimeException(ee); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } if (!nextBatch.isEmpty()) { batchCount++; if (batchCount > readaheadThreshold) { initiateReadAhead(); } } return nextBatch; }
Source:
public PlanNode visitSort(SortNode node, RewriteContext<Set<VariableReferenceExpression>> context) { Set<VariableReferenceExpression> expectedInputs = ImmutableSet.copyOf(concat(context.get(), node.getOrderingScheme().getOrderByVariables())); PlanNode source = context.rewrite(node.getSource(), expectedInputs); return new SortNode(node.getId(), source, node.getOrderingScheme(), false); }

Target:
public PlanNode visitSort(SortNode node, RewriteContext<Set<VariableReferenceExpression>> context) { Set<VariableReferenceExpression> expectedInputs = ImmutableSet.copyOf(concat(context.get(), node.getOrderingScheme().getOrderByVariables())); PlanNode source = context.rewrite(node.getSource(), expectedInputs); return new SortNode(node.getId(), source, node.getOrderingScheme(), node.isPartial()); }
Source:
public void scanFile(JavaFileScannerContext context) { JavaFilesCache javaFilesCache = new JavaFilesCache(); javaFilesCache.scanFile(context); org.sonar.api.resources.File currentResource = org.sonar.api.resources.File.fromIOFile(context.getFile(), project); if (currentResource == null) { throw new IllegalStateException("resource not found : " + context.getFileKey()); } resourceMapping.addResource(currentResource, context.getFileKey()); for (Map.Entry<String, File> classIOFileEntry : javaFilesCache.getResourcesCache().entrySet()) { resourcesByClass.put(classIOFileEntry.getKey(), currentResource); if (context.getFileKey() != null) { sourceFileByClass.put(classIOFileEntry.getKey(), context.getFileKey()); } } methodStartLines.putAll(javaFilesCache.getMethodStartLines()); if (!javaFilesCache.getSuppressWarningLines().isEmpty()) { String componentKey = project.name() + ":" + currentResource.getKey(); suppressWarningsFilter.addComponent(componentKey, javaFilesCache.getSuppressWarningLines()); } }

Target:
public void scanFile(JavaFileScannerContext context) { Preconditions.checkNotNull(sensorContext); JavaFilesCache javaFilesCache = new JavaFilesCache(); javaFilesCache.scanFile(context); org.sonar.api.resources.File currentResource = org.sonar.api.resources.File.fromIOFile(context.getFile(), project); if (currentResource == null) { throw new IllegalStateException("resource not found : " + context.getFileKey()); } resourceMapping.addResource(currentResource, context.getFileKey()); for (Map.Entry<String, File> classIOFileEntry : javaFilesCache.getResourcesCache().entrySet()) { resourcesByClass.put(classIOFileEntry.getKey(), currentResource); if (context.getFileKey() != null) { sourceFileByClass.put(classIOFileEntry.getKey(), context.getFileKey()); } } methodStartLines.putAll(javaFilesCache.getMethodStartLines()); if (javaFilesCache.hasSuppressWarningLines()) { suppressWarningsFilter.addComponent(sensorContext.getResource(currentResource).getEffectiveKey(), javaFilesCache.getSuppressWarningLines()); } }
Source:
public boolean isDuplicate(@NonNull AvoidRoadInfo item) { for (AvoidRoadInfo existingItem : existingItems) { if (item.latitude == existingItem.latitude && item.longitude == existingItem.longitude && item.name.equals(existingItem.name)) { return true; } } return false; }

Target:
public boolean isDuplicate(@NonNull AvoidRoadInfo item) { return existingItems.contains(item); }
Source:
public HashSet<String> getUniqueUsersWithTokenCache() { Iterable<TokenCacheItem> results = this.getAll(); HashSet<String> users = new HashSet<String>(); if (results != null) { for (final TokenCacheItem tokenCacheItem: results) { if (tokenCacheItem.getUserInfo() != null && !users.contains(tokenCacheItem.getUserInfo().getUserId())) { users.add(tokenCacheItem.getUserInfo().getUserId()); } } } return users; }

Target:
public Set<String> getUniqueUsersWithTokenCache() { Iterator<TokenCacheItem> results = this.getAll(); Set<String> users = new HashSet<String>(); while (results.hasNext()) { final TokenCacheItem tokenCacheItem = results.next(); if (tokenCacheItem.getUserInfo() != null && !users.contains(tokenCacheItem.getUserInfo().getUserId())) { users.add(tokenCacheItem.getUserInfo().getUserId()); } } return users; }
Source:
public void removingPrimaryKeyThrows() { RealmConfiguration originalConfig = configFactory.createConfigurationBuilder() .schema(AllTypes.class) .build(); Realm.getInstance(originalConfig).close(); RealmMigration migration = new RealmMigration() { @Override public void migrate(DynamicRealm realm, long oldVersion, long newVersion) { RealmSchema schema = realm.getSchema(); schema.create("StringOnly") .addField("chars", String.class, FieldAttribute.PRIMARY_KEY); } }; RealmConfiguration realmConfig = configFactory.createConfigurationBuilder() .schemaVersion(1) .schema(StringOnly.class) .migration(migration) .build(); try { realm = Realm.getInstance(realmConfig); fail(); } catch (RealmMigrationNeededException e) { if (!e.getMessage().equals("Primary Key @PrimaryKey was removed.")) { fail(e.toString()); } } finally { if (realm != null) { realm.close(); } } }

Target:
public void removingPrimaryKeyThrows() { RealmConfiguration originalConfig = configFactory.createConfigurationBuilder() .schema(Thread.class) .build(); Realm.getInstance(originalConfig).close(); RealmMigration migration = new RealmMigration() { @Override public void migrate(DynamicRealm realm, long oldVersion, long newVersion) { RealmSchema schema = realm.getSchema(); schema.create("StringOnly") .addField("chars", String.class, FieldAttribute.PRIMARY_KEY); } }; RealmConfiguration realmConfig = configFactory.createConfigurationBuilder() .schemaVersion(1) .schema(Thread.class, StringOnly.class) .migration(migration) .build(); try { realm = Realm.getInstance(realmConfig); fail(); } catch (RealmMigrationNeededException e) { if (!e.getMessage().equals("Primary Key defined for field chars was removed.")) { fail(e.toString()); } } finally { if (realm != null) { realm.close(); } } }
Source:
public void shouldReturnEmptyList() { when(dao.searchSimilarTitle(music.getTitle())).thenReturn(new ArrayList<Music>()); controller.search(music); List<Music> musics = (List<Music>) result.included().get("musics"); Assert.assertTrue(musics.isEmpty()); }

Target:
public void shouldReturnEmptyList() { when(dao.searchSimilarTitle(music.getTitle())).thenReturn(new ArrayList<Music>()); controller.search(music); List<Music> musics = (List<Music>) result.included().get("musics"); assertThat(musics, empty()); }
Source:
public ScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionRegistry functionRegistry) { checkArgument(arity == 1, "Expected arity to be 1"); Type fromKeyType = boundVariables.getTypeVariable("FK"); Type fromValueType = boundVariables.getTypeVariable("FV"); Type toKeyType = boundVariables.getTypeVariable("TK"); Type toValueType = boundVariables.getTypeVariable("TV"); Type toMapType = MAP.createType(typeManager, ImmutableList.of(TypeParameter.of(toKeyType), TypeParameter.of(toValueType))); MethodHandle keyProcessor = getProcessMethodHandle(functionRegistry, fromKeyType, toKeyType, true); MethodHandle valueProcessor = getProcessMethodHandle(functionRegistry, fromValueType, toValueType, false); MethodHandle target = MethodHandles.insertArguments(METHOD_HANDLE, 0, keyProcessor, valueProcessor, toMapType); return new ScalarFunctionImplementation(true, ImmutableList.of(valueTypeArgumentProperty(RETURN_NULL_ON_NULL)), target, true); }

Target:
public ScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionRegistry functionRegistry) { checkArgument(arity == 1, "Expected arity to be 1"); Type fromKeyType = boundVariables.getTypeVariable("FK"); Type fromValueType = boundVariables.getTypeVariable("FV"); Type toKeyType = boundVariables.getTypeVariable("TK"); Type toValueType = boundVariables.getTypeVariable("TV"); Type toMapType = typeManager.getParameterizedType( "map", ImmutableList.of( TypeSignatureParameter.of(toKeyType.getTypeSignature()), TypeSignatureParameter.of(toValueType.getTypeSignature()))); MethodHandle keyProcessor = buildProcessor(functionRegistry, fromKeyType, toKeyType, true); MethodHandle valueProcessor = buildProcessor(functionRegistry, fromValueType, toValueType, false); MethodHandle target = MethodHandles.insertArguments(METHOD_HANDLE, 0, keyProcessor, valueProcessor, toMapType); return new ScalarFunctionImplementation(true, ImmutableList.of(valueTypeArgumentProperty(RETURN_NULL_ON_NULL)), target, true); }
Source:
public JavaContentAssistInvocationContext(ITextViewer viewer, int offset, IEditorPart editor) { super(viewer, offset); Assert.isNotNull(editor); fEditor= editor; if (viewer != null) { ISelectionProvider selectionProvider = viewer.getSelectionProvider(); if (!equippedSelectionProviders.contains(selectionProvider)) { boolean toEquip = false; synchronized (equippedSelectionProviders) { toEquip = !equippedSelectionProviders.contains(selectionProvider); if (toEquip) { equippedSelectionProviders.add(selectionProvider); } } if (toEquip) { Display.getDefault().asyncExec(() -> { ISelection selection = selectionProvider.getSelection(); if (selection instanceof ITextSelection) { lastKnownTextSelections.put(selectionProvider, (ITextSelection)selection); } }); ISelectionChangedListener selectionChangedListener = event -> { ISelection selection = event.getSelection(); if (selection instanceof ITextSelection) { lastKnownTextSelections.put(event.getSelectionProvider(), (ITextSelection)selection); } }; DisposeListener listener= new DisposeListener() { @Override public void widgetDisposed(DisposeEvent event) { selectionProvider.removeSelectionChangedListener(selectionChangedListener); event.widget.removeDisposeListener(this); equippedSelectionProviders.remove(selectionProvider); lastKnownTextSelections.remove(selectionProvider); } }; viewer.getTextWidget().addDisposeListener(listener); } } } }

Target:
public JavaContentAssistInvocationContext(ITextViewer viewer, int offset, IEditorPart editor) { super(viewer, offset); Assert.isNotNull(editor); fEditor= editor; }
Source:
private void createOAuth2Client() { Client client = Clients.builder() .setOrgUrl("https://{yourOktaDomain}") .setAuthorizationMode(AuthorizationMode.PRIVATE_KEY) .setClientId("yourClientID") .setScopes(new HashSet<>(Arrays.asList("okta.users.read", "okta.apps.read"))) .setPrivateKey("/path/to/yourPrivateKey.pem") .build(); }

Target:
private void createOAuth2Client() { Client client = Clients.builder() .setOrgUrl("https://{yourOktaDomain}") .setAuthorizationMode(AuthorizationMode.PRIVATE_KEY) .setClientId("{clientId}") .setScopes(new HashSet<>(Arrays.asList("okta.users.read", "okta.apps.read"))) .setPrivateKey("/path/to/yourPrivateKey.pem") .build(); }
Source:
public void applySearchString(String searchString) { if (modelProvider.getModel() instanceof SearchableListModel) { @SuppressWarnings("unchecked") SearchableListModel<?, ? extends EntityModel<?>> listModel = modelProvider.getModel(); if (StringHelper.isNotNullOrEmpty(searchString) && searchString.startsWith(listModel.getDefaultSearchString())) { placeManager.setFragmentParameters(getFragmentParams(searchString), false); listModel.setSearchString(searchString); listModel.getSearchCommand().execute(); } } }

Target:
public void applySearchString(String searchString) { if (modelProvider.getModel() instanceof SearchableListModel) { @SuppressWarnings("unchecked") SearchableListModel<?, ? extends EntityModel<?>> listModel = modelProvider.getModel(); if (StringHelper.isNotNullOrEmpty(searchString) && searchString.startsWith(listModel.getDefaultSearchString())) { placeManager.setFragmentParameters(getFragmentParameters(searchString), false); listModel.setSearchString(searchString); listModel.getSearchCommand().execute(); } } }
Source:
public static String getExecutableAsString(String name, Class<?>... parameterTypes) { StringBuilder sb = new StringBuilder( name ); sb.append( "(" ); boolean isFirst = true; for ( Class<?> parameterType : parameterTypes ) { if ( !isFirst ) { sb.append( ", " ); } else { isFirst = false; } sb.append( parameterType.getSimpleName() ); } sb.append( ")" ); return sb.toString(); }

Target:
public static String getExecutableAsString(String name, Class<?>... parameterTypes) { return Stream.of( parameterTypes ) .map( t -> t.getSimpleName() ) .collect( Collectors.joining( ", ", name + "(", ")" ) ); }
Source:
public EEFViewDescription convert() { EEFViewDescription view = EefFactory.eINSTANCE.createEEFViewDescription(); view.setImageExpression("aql:self.image()"); Set<EPackage> ePackages = new LinkedHashSet<>(); for (PageDescription pageDescription : pageDescriptions) { EObject eContainer = pageDescription.eContainer(); if (eContainer instanceof ViewExtensionDescription) { ViewExtensionDescription viewExtensionDescription = (ViewExtensionDescription) eContainer; ePackages.addAll(viewExtensionDescription.getMetamodels()); } } view.getEPackages().addAll(ePackages); view.setLabelExpression("feature:name"); for (PageDescription pageDescription : pageDescriptions) { createPage(pageDescription, view); } Set<Entry<EEFPropertyValidationRuleDescription, PropertyValidationRule>> entries = this.eefPropertyValidationRule2propertyValidationRule.entrySet(); for (Entry<EEFPropertyValidationRuleDescription, PropertyValidationRule> entry : entries) { List<WidgetDescription> widgets = entry.getValue().getTargets(); for (WidgetDescription widgetDescription : widgets) { EEFWidgetDescription eefWidgetDescription = this.widget2eefWidget.get(widgetDescription); if (eefWidgetDescription != null) { EEFPropertyValidationRuleDescription eefPropertyValidationRule = entry.getKey(); eefPropertyValidationRule.getTargets().add(eefWidgetDescription); } } } this.widget2eefWidget.clear(); this.eefPropertyValidationRule2propertyValidationRule.clear(); return view; }

Target:
public EEFViewDescription convert() { EEFViewDescription view = EefFactory.eINSTANCE.createEEFViewDescription(); view.setImageExpression("service:image"); Set<EPackage> ePackages = new LinkedHashSet<>(); for (PageDescription pageDescription : pageDescriptions) { EObject eContainer = pageDescription.eContainer(); if (eContainer instanceof ViewExtensionDescription) { ViewExtensionDescription viewExtensionDescription = (ViewExtensionDescription) eContainer; ePackages.addAll(viewExtensionDescription.getMetamodels()); } } view.getEPackages().addAll(ePackages); view.setLabelExpression("feature:name"); for (PageDescription pageDescription : pageDescriptions) { createPage(pageDescription, view); } Set<Entry<EEFPropertyValidationRuleDescription, PropertyValidationRule>> entries = this.eefPropertyValidationRule2propertyValidationRule.entrySet(); for (Entry<EEFPropertyValidationRuleDescription, PropertyValidationRule> entry : entries) { List<WidgetDescription> widgets = entry.getValue().getTargets(); for (WidgetDescription widgetDescription : widgets) { EEFWidgetDescription eefWidgetDescription = this.widget2eefWidget.get(widgetDescription); if (eefWidgetDescription != null) { EEFPropertyValidationRuleDescription eefPropertyValidationRule = entry.getKey(); eefPropertyValidationRule.getTargets().add(eefWidgetDescription); } } } this.widget2eefWidget.clear(); this.eefPropertyValidationRule2propertyValidationRule.clear(); return view; }
Source:
private void startCropActivity(Uri uri) { final Context context = getActivity(); if (context == null) { return; } UCrop.Options options = new UCrop.Options(); options.setShowCropGrid(false); options.setStatusBarColor(ContextCompat.getColor(context, R.color.status_bar_tint)); options.setToolbarColor(ContextCompat.getColor(context, R.color.color_primary)); options.setAllowedGestures(UCropActivity.SCALE, UCropActivity.NONE, UCropActivity.NONE); options.setHideBottomControls(true); UCrop.of(uri, Uri.fromFile(new File(context.getCacheDir(), "cropped_for_gravatar.jpg"))) .withAspectRatio(1, 1) .withOptions(options) .start(getActivity(), this); }

Target:
private void startCropActivity(Uri uri) { final Context context = getActivity(); if (context == null) { return; } UCrop.Options options = new UCrop.Options(); options.setShowCropGrid(false); options.setStatusBarColor(ContextCompat.getColor(context, R.color.status_bar_tint)); options.setToolbarColor(ContextCompat.getColor(context, R.color.color_primary)); options.setAllowedGestures(UCropActivity.SCALE, UCropActivity.NONE, UCropActivity.NONE); options.setHideBottomControls(true); UCrop.of(uri, Uri.fromFile(new File(context.getCacheDir(), "cropped_for_site_icon.jpg"))) .withAspectRatio(1, 1) .withOptions(options) .start(getActivity(), this); }
Source:
public void addColumnFamily(TableName tableName, ColumnFamilyDescriptor columnFamilyDesc) throws IOException { ModifyColumnFamiliesRequest request = ModifyColumnFamiliesRequest.of(tableName.getNameAsString()); request.addFamily(columnFamilyDesc.getNameAsString(), buildGarbageCollectionRule(TableAdapter2x.toHColumnDescriptor(columnFamilyDesc))); modifyColumns(request); }

Target:
public void addColumnFamily(TableName tableName, ColumnFamilyDescriptor columnFamilyDesc) throws IOException { modifyColumns(tableName, columnFamilyDesc.getNameAsString(), "add", ModifyTableBuilder.newBuilder(tableName).add(TableAdapter2x.toHColumnDescriptor(columnFamilyDesc))); }
Source:
public ApexStream<T> union(ApexStream<T>... others) { return null; }

Target:
public <STREAM extends ApexStream<T>> STREAM union(ApexStream<T>... others) { throw new UnsupportedOperationException(); }
Source:
public static void normalizeCourseStructure(CourseStructureV1Model courseStructureV1Model, BlockModel block, CourseComponent parent){ if ( block.isContainer() ){ CourseComponent child = new CourseComponent(block, parent); for (BlockModel m : courseStructureV1Model.getDescendants(block)) { normalizeCourseStructure(courseStructureV1Model, m, child); } } else { if ( BlockType.VIDEO == block.type && block.data != null && (block.data instanceof VideoData) ){ VideoBlockModel child = new VideoBlockModel(block, parent); } else { HtmlBlockModel child = new HtmlBlockModel(block, parent); } } }

Target:
public static void normalizeCourseStructure(CourseStructureV1Model courseStructureV1Model, BlockModel block, CourseComponent parent){ if ( block.isContainer() ){ CourseComponent child = new CourseComponent(block, parent); for (BlockModel m : courseStructureV1Model.getDescendants(block)) { normalizeCourseStructure(courseStructureV1Model, m, child); } } else { if ( BlockType.VIDEO == block.type && block.data != null && (block.data instanceof VideoData) ){ new VideoBlockModel(block, parent); } else { new HtmlBlockModel(block, parent); } } }
Source:
private IndexValue getPutRecordForDeletedKey(StoreKey key, IndexValue deleteIndexValue) throws StoreException { BlobReadOptions originalPut = index.getBlobReadInfo(key, EnumSet.of(StoreGetOptions.Store_Include_Deleted)); Offset originalPutOffset = new Offset(originalPut.getLogSegmentName(), originalPut.getOffset()); return new IndexValue(originalPut.getSize(), originalPutOffset, originalPut.getExpiresAtMs(), Utils.Infinite_Time, deleteIndexValue.getServiceId(), deleteIndexValue.getContainerId()); }

Target:
private IndexValue getPutRecordForDeletedKey(StoreKey key, IndexValue deleteIndexValue) throws StoreException { BlobReadOptions originalPut = index.getBlobReadInfo(key, EnumSet.allOf(StoreGetOptions.class)); Offset originalPutOffset = new Offset(originalPut.getLogSegmentName(), originalPut.getOffset()); return new IndexValue(originalPut.getSize(), originalPutOffset, originalPut.getExpiresAtMs(), deleteIndexValue.getOperationTimeInMs(), deleteIndexValue.getServiceId(), deleteIndexValue.getContainerId()); }
Source:
synchronized Client getJerseyClient() { if ( jerseyClient == null ) { int poolSize = 100; final String poolSizeStr = properties.getProperty( CENTRAL_CONNECTION_POOL_SIZE ); if ( poolSizeStr != null ) { poolSize = Integer.parseInt( poolSizeStr ); } MultiThreadedHttpConnectionManager cm = new MultiThreadedHttpConnectionManager(); HttpConnectionManagerParams cmParams = cm.getParams(); cmParams.setMaxTotalConnections( poolSize ); HttpClient httpClient = new HttpClient( cm ); int timeout = 20000; final String timeoutStr = properties.getProperty( CENTRAL_CONNECTION_TIMEOUT ); if ( timeoutStr != null ) { timeout = Integer.parseInt( timeoutStr ); } int readTimeout = 20000; final String readTimeoutStr = properties.getProperty( CENTRAL_READ_TIMEOUT ); if ( readTimeoutStr != null ) { readTimeout = Integer.parseInt( readTimeoutStr ); } ClientConfig clientConfig = new DefaultClientConfig(); clientConfig.getFeatures().put( JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE ); clientConfig.getProperties().put( ClientConfig.PROPERTY_CONNECT_TIMEOUT, timeout ); clientConfig.getProperties().put( ClientConfig.PROPERTY_READ_TIMEOUT, readTimeout ); ApacheHttpClientHandler handler = new ApacheHttpClientHandler( httpClient, clientConfig ); jerseyClient = new ApacheHttpClient( handler ); } return jerseyClient; }

Target:
private Client getJerseyClient() { if ( jerseyClient == null ) { synchronized ( this ) { int poolSize = 100; final String poolSizeStr = properties.getProperty( CENTRAL_CONNECTION_POOL_SIZE ); if ( poolSizeStr != null ) { poolSize = Integer.parseInt( poolSizeStr ); } MultiThreadedHttpConnectionManager cm = new MultiThreadedHttpConnectionManager(); HttpConnectionManagerParams cmParams = cm.getParams(); cmParams.setMaxTotalConnections( poolSize ); HttpClient httpClient = new HttpClient( cm ); int timeout = 20000; final String timeoutStr = properties.getProperty( CENTRAL_CONNECTION_TIMEOUT ); if ( timeoutStr != null ) { timeout = Integer.parseInt( timeoutStr ); } int readTimeout = 20000; final String readTimeoutStr = properties.getProperty( CENTRAL_READ_TIMEOUT ); if ( readTimeoutStr != null ) { readTimeout = Integer.parseInt( readTimeoutStr ); } ClientConfig clientConfig = new DefaultClientConfig(); clientConfig.getFeatures().put( JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE ); clientConfig.getProperties().put( ClientConfig.PROPERTY_CONNECT_TIMEOUT, timeout ); clientConfig.getProperties().put( ClientConfig.PROPERTY_READ_TIMEOUT, readTimeout ); ApacheHttpClientHandler handler = new ApacheHttpClientHandler( httpClient, clientConfig ); jerseyClient = new ApacheHttpClient( handler ); } } return jerseyClient; }
Source:
TryCatchFinallyControlFlow(CommandContext ctx) { tryList = new ArrayList<>(); ctx.set(Scope.CONTEXT, CTX_KEY, this); }

Target:
TryCatchFinallyControlFlow(CommandContext ctx) { ctx.set(Scope.CONTEXT, CTX_KEY, this); }
Source:
private static File[] init() { final String currentVersion = Version.getVersionString(); Set<File> libraryFiles = new HashSet<>(); libraryFiles.addAll( dependency( "org.hibernate:hibernate-search-orm:" + currentVersion, false ) ); libraryFiles.addAll( dependency( "org.hibernate:hibernate-search-engine:" + currentVersion, false ) ); libraryFiles.addAll( dependency( "org.hibernate:hibernate-search-backend-jms:" + currentVersion, false ) ); libraryFiles.addAll( dependency( "org.hibernate:hibernate-search-serialization-avro:" + currentVersion, true ) ); libraryFiles.addAll( dependency( "org.apache.lucene:lucene-core:" + VersionTestHelper.getDependencyVersionLucene(), false ) ); libraryFiles.addAll( dependency( "org.apache.lucene:lucene-analyzers-common:" + VersionTestHelper.getDependencyVersionLucene(), false ) ); libraryFiles.addAll( dependency( "org.hibernate.common:hibernate-commons-annotations:" + VersionTestHelper.getDependencyVersionHibernateCommonsAnnotations(), false ) ); return libraryFiles.toArray( new File[libraryFiles.size()] ); }

Target:
private static File[] init() { final String currentVersion = VersionTestHelper.getDependencyVersionHibernateSearch(); Set<File> libraryFiles = new HashSet<>(); libraryFiles.addAll( dependency( "org.hibernate:hibernate-search-orm:" + currentVersion, false ) ); libraryFiles.addAll( dependency( "org.hibernate:hibernate-search-engine:" + currentVersion, false ) ); libraryFiles.addAll( dependency( "org.hibernate:hibernate-search-backend-jms:" + currentVersion, false ) ); libraryFiles.addAll( dependency( "org.hibernate:hibernate-search-serialization-avro:" + currentVersion, true ) ); libraryFiles.addAll( dependency( "org.apache.lucene:lucene-core:" + VersionTestHelper.getDependencyVersionLucene(), false ) ); libraryFiles.addAll( dependency( "org.apache.lucene:lucene-analyzers-common:" + VersionTestHelper.getDependencyVersionLucene(), false ) ); libraryFiles.addAll( dependency( "org.hibernate.common:hibernate-commons-annotations:" + VersionTestHelper.getDependencyVersionHibernateCommonsAnnotations(), false ) ); return libraryFiles.toArray( new File[libraryFiles.size()] ); }
Source:
public ServiceInstance createServiceInstance(CreateServiceInstanceRequest request) throws ServiceInstanceExistsException, ServiceBrokerException { String serviceId = request.getServiceInstanceId(); log.debug("createServiceInstance - {}", serviceId); AutosleepServiceInstance serviceInstance = serviceRepository.findOne(serviceId); if (serviceInstance != null) { throw new ServiceInstanceExistsException(serviceInstance); } else { request.setParameters(processParameters(null, request.getParameters())); serviceInstance = new AutosleepServiceInstance(request); String baseDashUrl = deployment == null ? "localhost:8080" : deployment.getFirstUri(); serviceInstance.withDashboardUrl(baseDashUrl + Config.Path.dashboardPrefix + serviceId); serviceRepository.save(serviceInstance); watcher.watchServiceBindings(serviceId, Config.delayBeforeFirstServiceCheck); } return serviceInstance; }

Target:
public ServiceInstance createServiceInstance(CreateServiceInstanceRequest request) throws ServiceInstanceExistsException, ServiceBrokerException { String serviceId = request.getServiceInstanceId(); log.debug("createServiceInstance - {}", serviceId); AutosleepServiceInstance serviceInstance = serviceRepository.findOne(serviceId); if (serviceInstance != null) { throw new ServiceInstanceExistsException(serviceInstance); } else { request.setParameters(processParameters(null, request.getParameters())); serviceInstance = new AutosleepServiceInstance(request); if (deployment != null) { serviceInstance.withDashboardUrl(deployment.getFirstUri()+ Config.Path.dashboardPrefix + serviceId); } serviceRepository.save(serviceInstance); watcher.watchServiceBindings(serviceId, Config.delayBeforeFirstServiceCheck); } return serviceInstance; }
Source:
public GroupByQueryResource prepareResource(GroupByQuery query, boolean willMergeRunners) { if (!willMergeRunners) { final int requiredMergeBufferNum = countRequiredMergeBufferNum(query, 1) + (query.getSubtotalsSpec() != null ? 1 : 0); if (requiredMergeBufferNum > mergeBufferPool.maxSize()) { throw new ResourceLimitExceededException( "Query needs " + requiredMergeBufferNum + " merge buffers, but only " + mergeBufferPool.maxSize() + " merge buffers are configured" ); } else if (requiredMergeBufferNum == 0) { return new GroupByQueryResource(); } else { final ResourceHolder<List<ByteBuffer>> mergeBufferHolders; if (QueryContexts.hasTimeout(query)) { mergeBufferHolders = mergeBufferPool.takeBatch(requiredMergeBufferNum, QueryContexts.getTimeout(query)); } else { mergeBufferHolders = mergeBufferPool.takeBatch(requiredMergeBufferNum); } if (mergeBufferHolders == null) { throw new InsufficientResourcesException("Cannot acquire enough merge buffers"); } else { return new GroupByQueryResource(mergeBufferHolders); } } } else { return new GroupByQueryResource(); } }

Target:
public GroupByQueryResource prepareResource(GroupByQuery query, boolean willMergeRunners) { if (!willMergeRunners) { final int requiredMergeBufferNum = countRequiredMergeBufferNum(query, 1) + (query.getSubtotalsSpec() != null ? 1 : 0); if (requiredMergeBufferNum > mergeBufferPool.maxSize()) { throw new ResourceLimitExceededException( "Query needs " + requiredMergeBufferNum + " merge buffers, but only " + mergeBufferPool.maxSize() + " merge buffers were configured" ); } else if (requiredMergeBufferNum == 0) { return new GroupByQueryResource(); } else { final List<ReferenceCountingResourceHolder<ByteBuffer>> mergeBufferHolders; if (QueryContexts.hasTimeout(query)) { mergeBufferHolders = mergeBufferPool.takeBatch(requiredMergeBufferNum, QueryContexts.getTimeout(query)); } else { mergeBufferHolders = mergeBufferPool.takeBatch(requiredMergeBufferNum); } if (mergeBufferHolders.isEmpty()) { throw new InsufficientResourcesException("Cannot acquire enough merge buffers"); } else { return new GroupByQueryResource(mergeBufferHolders); } } } else { return new GroupByQueryResource(); } }
Source:
public void equal_shouldReturnTrueIfPatientIdIsEqualAndStarDateAndEndDateAreBothNull() { int patientId = 12; CohortMembership cohortMembershipOne = new CohortMembership(patientId); CohortMembership cohortMembershipTwo = new CohortMembership(patientId); Date startDate = null; Date endDate = null; cohortMembershipOne.setEndDate(endDate); cohortMembershipOne.setStartDate(startDate); cohortMembershipTwo.setStartDate(startDate); cohortMembershipTwo.setEndDate(endDate); assertTrue(cohortMembershipOne.equals(cohortMembershipTwo)); }

Target:
public void equal_shouldReturnTrueIfPatientIdIsEqualAndStarDateAndEndDateAreBothNull() { final int PATIENT_ID = 12; CohortMembership cohortMembershipOne = new CohortMembership(PATIENT_ID); CohortMembership cohortMembershipTwo = new CohortMembership(PATIENT_ID); Date startDate = null; Date endDate = null; cohortMembershipOne.setEndDate(endDate); cohortMembershipOne.setStartDate(startDate); cohortMembershipTwo.setStartDate(startDate); cohortMembershipTwo.setEndDate(endDate); assertTrue(cohortMembershipOne.equals(cohortMembershipTwo)); }
Source:
public void serialize(Appender appender, JsonGenerator json, SerializerProvider serializerProvider) throws IOException { json.writeStartObject(); json.writeStringField("name", appender.getName()); Layout<? extends Serializable> layout = appender.getLayout(); json.writeEndObject(); }

Target:
public void serialize(Appender appender, JsonGenerator json, SerializerProvider serializerProvider) throws IOException { json.writeStartObject(); json.writeStringField("name", appender.getName()); json.writeEndObject(); }
Source:
public final static InputRow parseInputRow(Writable value, InputRowParser parser) { if(value instanceof Text) { ByteBuffer bb = ByteBuffer.wrap(value.toString().getBytes()); return parser.parse(bb); } else if(value instanceof MapWritable){ return parser.parse(convertMapStringAndObject((MapWritable)value)); } else { throw new RuntimeException("Incompatible input. expected MapWritable or Text"); } }

Target:
public final static InputRow parseInputRow(Writable value, InputRowParser parser) { if(parser instanceof StringInputRowParser && value instanceof Text) { return ((StringInputRowParser)parser).parse(value.toString()); } else { return parser.parse(value); } }
Source:
private int handleStart(@NonNull ITmfEvent event, ITmfStateSystemBuilder ss, long timestamp, String processName) { ITmfStateValue functionBeginName = functionEntry(event); if (functionBeginName != null) { int processQuark = ss.getQuarkAbsoluteAndAdd(PROCESSES, processName); String threadName = getThreadName(event); long threadId = getThreadId(event); if (threadName == null) { threadName = Long.toString(threadId); } int threadQuark = ss.getQuarkRelativeAndAdd(processQuark, threadName); int callStackQuark = ss.getQuarkRelativeAndAdd(threadQuark, InstrumentedCallStackAnalysis.CALL_STACK); ITmfStateValue value = functionBeginName; ss.pushAttribute(timestamp, value, callStackQuark); return ss.queryOngoingState(callStackQuark).unboxInt() + callStackQuark; } return -1; }

Target:
private void handleStart(@NonNull ITmfEvent event, ITmfStateSystemBuilder ss, long timestamp, String processName) { ITmfStateValue functionBeginName = functionEntry(event); if (functionBeginName != null) { int processQuark = ss.getQuarkAbsoluteAndAdd(PROCESSES, processName); String threadName = getThreadName(event); long threadId = getThreadId(event); if (threadName == null) { threadName = Long.toString(threadId); } int threadQuark = ss.getQuarkRelativeAndAdd(processQuark, threadName); int callStackQuark = ss.getQuarkRelativeAndAdd(threadQuark, InstrumentedCallStackAnalysis.CALL_STACK); ITmfStateValue value = functionBeginName; ss.pushAttribute(timestamp, value, callStackQuark); } }
Source:
public static void deleteSnapshot(File snpDir, String folderName) { if (!snpDir.exists()) return; assert snpDir.isDirectory() : snpDir; try { List<Path> dirs = new ArrayList<>(); Files.walkFileTree(snpDir.toPath(), new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { if (Files.isDirectory(dir) && Files.exists(dir) && folderName.equals(dir.getFileName().toString())) { dirs.add(dir); } return super.preVisitDirectory(dir, attrs); } @Override public FileVisitResult visitFileFailed(Path file, IOException exc) { return FileVisitResult.CONTINUE; } }); dirs.forEach(U::delete); File db = new File(snpDir, DB_DEFAULT_FOLDER); if (!db.exists() || db.list().length == 0) U.delete(snpDir); } catch (IOException e) { U.error(null, "Snapshot deletion failed with an error", e); } }

Target:
public static void deleteSnapshot(File snpDir, String folderName) { if (!snpDir.exists()) return; assert snpDir.isDirectory() : snpDir; try { List<Path> dirs = new ArrayList<>(); Files.walkFileTree(snpDir.toPath(), new SimpleFileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { if (Files.isDirectory(dir) && Files.exists(dir) && folderName.equals(dir.getFileName().toString())) { dirs.add(dir); } return super.preVisitDirectory(dir, attrs); } @Override public FileVisitResult visitFileFailed(Path file, IOException exc) { return FileVisitResult.CONTINUE; } }); dirs.forEach(U::delete); File db = new File(snpDir, DB_DEFAULT_FOLDER); if (!db.exists() || db.list().length == 0) U.delete(snpDir); } catch (IOException e) { throw new IgniteException(e); } }
Source:
private static boolean isVmRunningOnHost(Guid hostId) { return !DbFacade.getInstance().getVmDao().getAllRunningForVds(hostId).isEmpty(); }

Target:
private static boolean isVmRunningOnHost(Guid hostId) { return !DbFacade.getInstance().getVmDynamicDao().getAllRunningForVds(hostId).isEmpty(); }
Source:
public void shouldFindChargeWithCaptureUrlAndNoNextUrl_whenChargeInAwaitingCaptureRequest() throws Exception{ Long chargeId = 101L; Long accountId = 10L; GatewayAccountEntity gatewayAccount = new GatewayAccountEntity("sandbox", new HashMap<>(), TEST); gatewayAccount.setId(1L); ChargeEntity newCharge = aValidChargeEntity() .withId(chargeId) .withGatewayAccountEntity(gatewayAccount) .withStatus(AWAITING_CAPTURE_REQUEST) .build(); Optional<ChargeEntity> chargeEntity = Optional.of(newCharge); String externalId = newCharge.getExternalId(); when(mockedChargeDao.findByExternalIdAndGatewayAccount(externalId, accountId)).thenReturn(chargeEntity); Optional<ChargeResponse> chargeResponseForAccount = service.findChargeForAccount(externalId, accountId, mockedUriInfo); verify(mockedTokenDao, never()).persist(any()); ChargeResponseBuilder expectedChargeResponse = chargeResponseBuilderOf(chargeEntity.get()); expectedChargeResponse.withLink("self", GET, new URI(SERVICE_HOST + "/v1/api/accounts/1/charges/" + externalId)); expectedChargeResponse.withLink("refunds", GET, new URI(SERVICE_HOST + "/v1/api/accounts/1/charges/" + externalId + "/refunds")); expectedChargeResponse.withLink("capture", POST, new URI(SERVICE_HOST + "/v1/api/accounts/1/charges/" + externalId + "/capture")); assertThat(chargeResponseForAccount.get(), is(expectedChargeResponse.build())); }

Target:
public void shouldFindChargeWithCaptureUrlAndNoNextUrl_whenChargeInAwaitingCaptureRequest() throws Exception{ Long chargeId = 101L; ChargeEntity newCharge = aValidChargeEntity() .withId(chargeId) .withGatewayAccountEntity(gatewayAccount) .withStatus(AWAITING_CAPTURE_REQUEST) .build(); Optional<ChargeEntity> chargeEntity = Optional.of(newCharge); String externalId = newCharge.getExternalId(); when(mockedChargeDao.findByExternalIdAndGatewayAccount(externalId, GATEWAY_ACCOUNT_ID)).thenReturn(chargeEntity); Optional<ChargeResponse> chargeResponseForAccount = service.findChargeForAccount(externalId, GATEWAY_ACCOUNT_ID, mockedUriInfo); verify(mockedTokenDao, never()).persist(any()); ChargeResponseBuilder expectedChargeResponse = chargeResponseBuilderOf(chargeEntity.get()); expectedChargeResponse.withLink("self", GET, new URI(SERVICE_HOST + "/v1/api/accounts/10/charges/" + externalId)); expectedChargeResponse.withLink("refunds", GET, new URI(SERVICE_HOST + "/v1/api/accounts/10/charges/" + externalId + "/refunds")); expectedChargeResponse.withLink("capture", POST, new URI(SERVICE_HOST + "/v1/api/accounts/10/charges/" + externalId + "/capture")); assertThat(chargeResponseForAccount.get(), is(expectedChargeResponse.build())); }
Source:
public void start(Stage gameStage) { gameStage.setTitle("Scrumbledore"); gameStage.setHeight(Constants.RESOLUTIONY); gameStage.setWidth(Constants.RESOLUTIONX); gameStage.setResizable(false); BorderPane contentHandler = new BorderPane(); Scene mainScene = new Scene(contentHandler); gameStage.setScene(mainScene); HBox topItems = new HBox(); Label scoreLabel = new Label(Constants.SCORELABEL); Label highScoreLabel = new Label(Constants.HISCORELABEL); Label powerUpLabel = new Label(Constants.POWERUPLABEL); Label levelLabel = new Label(Constants.LEVELLABEL); topItems.getChildren().addAll(scoreLabel, powerUpLabel, levelLabel, highScoreLabel); contentHandler.setTop(topItems); Canvas gameDisplay = new Canvas(Constants.RESOLUTIONX, Constants.CANVASRESOLUTIONY); GraphicsContext gamePainter = gameDisplay.getGraphicsContext2D(); contentHandler.setCenter(gameDisplay); for (int i = 0; i < 620; i = i + Constants.BLOCKSIZE) { for (int j = 0; j < 620; j = j + Constants.BLOCKSIZE) { gamePainter.fillText("CELL", j, i); } } HBox bottomItems = new HBox(); Button startStopButton = new Button(Constants.STARTBTNLABEL); Button settingsButton = new Button(Constants.SETTINGSBTNLABEL); Button exitButton = new Button(Constants.EXITBTNLABEL); bottomItems.getChildren().addAll(startStopButton, settingsButton, exitButton); contentHandler.setBottom(bottomItems); gameStage.show(); }

Target:
public void start(Stage gameStage) { gameStage.setTitle("Scrumbledore"); gameStage.setHeight(Constants.RESOLUTIONY); gameStage.setWidth(Constants.RESOLUTIONX); gameStage.setResizable(false); BorderPane contentHandler = new BorderPane(); Scene mainScene = new Scene(contentHandler); gameStage.setScene(mainScene); HBox topItems = new HBox(); Label scoreLabel = new Label(Constants.SCORELABEL); Label highScoreLabel = new Label(Constants.HISCORELABEL); Label powerUpLabel = new Label(Constants.POWERUPLABEL); Label levelLabel = new Label(Constants.LEVELLABEL); topItems.getChildren().addAll(scoreLabel, powerUpLabel, levelLabel, highScoreLabel); contentHandler.setTop(topItems); Canvas gameDisplay = new Canvas(Constants.RESOLUTIONX, Constants.CANVASRESOLUTIONY); GraphicsContext gamePainter = gameDisplay.getGraphicsContext2D(); contentHandler.setCenter(gameDisplay); for (int i = 0; i < Constants.RESOLUTIONX; i = i + Constants.BLOCKSIZE) { for (int j = 0; j < Constants.RESOLUTIONX; j = j + Constants.BLOCKSIZE) { gamePainter.fillText("CELL", j, i); } } HBox bottomItems = new HBox(); Button startStopButton = new Button(Constants.STARTBTNLABEL); Button settingsButton = new Button(Constants.SETTINGSBTNLABEL); Button exitButton = new Button(Constants.EXITBTNLABEL); bottomItems.getChildren().addAll(startStopButton, settingsButton, exitButton); contentHandler.setBottom(bottomItems); gameStage.show(); }
Source:
public TransactionalObject getTransactionalObject(String serviceName, String name) { checkActive(serviceName, name); if (requiresBackupLogs(serviceName)) { transaction.ensureBackupLogsExist(); } TransactionalObjectKey key = new TransactionalObjectKey(serviceName, name); TransactionalObject obj = txnObjectMap.get(key); if (obj != null) { return obj; } TransactionalService transactionalService = getTransactionalService(serviceName); nodeEngine.getProxyService().initializeDistributedObject(serviceName, name, source); obj = transactionalService.createTransactionalObject(name, transaction); txnObjectMap.put(key, obj); return obj; }

Target:
public TransactionalObject getTransactionalObject(String serviceName, String name) { checkActive(serviceName, name); if (requiresBackupLogs(serviceName)) { transaction.ensureBackupLogsExist(); } TransactionalObjectKey key = new TransactionalObjectKey(serviceName, name); TransactionalObject obj = txnObjectMap.get(key); if (obj != null) { return obj; } TransactionalService transactionalService = getTransactionalService(serviceName); nodeEngine.getProxyService().initializeDistributedObject(serviceName, name, transaction.getOwnerUuid()); obj = transactionalService.createTransactionalObject(name, transaction); txnObjectMap.put(key, obj); return obj; }
Source:
public boolean test() { problemsView.open(); List<Problem> problems = problemsView.getProblems(problemType, matchers); return problems.size() == expectedProblemsCount; }

Target:
public boolean test() { problemsView.activate(); problems = problemsView.getProblems(problemType, problemMatchers); return problems.size() == expectedProblemsCount; }