auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Owner setupOwner(Principal principal, String ownerKey) { if (ownerKey == null && (principal instanceof UserPrincipal)) { List<String> ownerKeys = ((UserPrincipal) principal).getOwnerKeys(); if (ownerKeys.size() != 1) { throw new BadRequestException(i18n.tr("You must specify an organization for new units.")); } ownerKey = ownerKeys.get(0); } createOwnerIfNeeded(principal); Owner owner = ownerCurator.getByKey(ownerKey); if (owner == null) { throw new BadRequestException(i18n.tr("Organization {0} does not exist.", ownerKey)); } if ((principal instanceof UserPrincipal) && !principal.canAccess(owner, SubResource.CONSUMERS, Access.CREATE)) { log.warn("User does not have access to create consumers in org {}", principal.getPrincipalName(), owner.getKey()); <START> throw new ForbiddenException(i18n.tr("{0} is not authorized to register with " + <END> "organization {1}", principal.getName(), owner.getKey())); } return owner; }</code><technical_language>need check if in right condition send this more explicit message. principal is allow create consumers in org, if user is part of org. replace message entirely, branch principal's owner list includes owner in question (indicating user is allowed org). UserPrincipal methods for fetching owners: getOwners, getOwnerKeys, getOwnerIds. simply iterate values returned getOwners (which iterates permissions build list check for uniqueness), check if contains owner ID owner fetched line 1104</technical_language>

Target:
private Owner setupOwner(Principal principal, String ownerKey) { if (ownerKey == null && (principal instanceof UserPrincipal)) { List<String> ownerKeys = ((UserPrincipal) principal).getOwnerKeys(); if (ownerKeys.size() != 1) { throw new BadRequestException(i18n.tr("You must specify an organization for new units.")); } ownerKey = ownerKeys.get(0); } createOwnerIfNeeded(principal); Owner owner = ownerCurator.getByKey(ownerKey); if (owner == null) { throw new BadRequestException(i18n.tr("Organization {0} does not exist.", ownerKey)); } if ((principal instanceof UserPrincipal) && !principal.canAccess(owner, SubResource.CONSUMERS, Access.CREATE)) { log.warn("User does not have access to create consumers in org {}", principal.getPrincipalName(), owner.getKey()); List<Owner> owners = ((UserPrincipal) principal).getOwners(); boolean isOwnerContained = owners != null && owners.stream() .anyMatch(t -> t != null && t.getOwnerId().equals(owner.getOwnerId())); if (isOwnerContained) { throw new ForbiddenException(i18n.tr("{0} is not authorized to register with " + "organization {1}", principal.getName(), owner.getKey())); } throw new NotFoundException(i18n.tr("owner with key: {0} was not found.", owner.getKey())); } return owner; }
Source:
<code>private void init() { setTitle(ConstantsManager.getInstance().getConstants().editLogicalNetworkTitle()); setHelpTag(HelpTag.edit_logical_network); setHashName("edit_logical_network"); getName().setEntity(getNetwork().getName()); getDescription().setEntity(getNetwork().getDescription()); getComment().setEntity(getNetwork().getComment()); getIsStpEnabled().setEntity(getNetwork().getStp()); getHasVLanTag().setEntity(getNetwork().getVlanId() != null); getVLanTag().setEntity(getNetwork().getVlanId()); initMtu(); initIsVm(); getExternal().setEntity(getNetwork().isExternal()); getExternal().setIsChangeable(false); getExternalProviders().setIsChangeable(false); getPhysicalNetwork().setEntity(isConnectedToPhysicalNetwork()); getPhysicalNetwork().setIsChangeable(false); if (isConnectedToPhysicalNetwork()) { getPhysicalNetworkDatacenter().setEntity(getNetwork().getProvidedBy().isSetPhysicalNetworkId()); } getPhysicalNetworkDatacenterRB().setIsChangeable(false); getPhysicalNetworkCustomRB().setIsChangeable(false); getDatacenterPhysicalNetwork().setIsChangeable(false); if <START> (getNetwork().isExternal() && <END> isConnectedToPhysicalNetwork()) { getNeutronPhysicalNetwork().setEntity(getNetwork().getLabel()); } else { getNetworkLabel().setSelectedItem(getNetwork().getLabel()); } toggleProfilesAvailability(); }</code><technical_language>this check is redundant is checked isConnectedToPhysicalNetwork()</technical_language>

Target:
private void init() { setTitle(ConstantsManager.getInstance().getConstants().editLogicalNetworkTitle()); setHelpTag(HelpTag.edit_logical_network); setHashName("edit_logical_network"); getName().setEntity(getNetwork().getName()); getDescription().setEntity(getNetwork().getDescription()); getComment().setEntity(getNetwork().getComment()); getIsStpEnabled().setEntity(getNetwork().getStp()); getHasVLanTag().setEntity(getNetwork().getVlanId() != null); getVLanTag().setEntity(getNetwork().getVlanId()); initMtu(); initIsVm(); getExternal().setEntity(getNetwork().isExternal()); getExternal().setIsChangeable(false); getExternalProviders().setIsChangeable(false); getPhysicalNetwork().setEntity(isConnectedToPhysicalNetwork()); getPhysicalNetwork().setIsChangeable(false); getPhysicalNetworkDatacenterRB().setIsChangeable(false); getPhysicalNetworkCustomRB().setIsChangeable(false); getDatacenterPhysicalNetwork().setIsChangeable(false); if (isConnectedToPhysicalNetwork()) { if (getNetwork().getProvidedBy().isSetPhysicalNetworkId()) { getPhysicalNetworkDatacenter().setEntity(true); } else { getPhysicalNetworkDatacenter().setEntity(false); getNeutronPhysicalNetwork().setEntity(getNetwork().getLabel()); } } else { getNetworkLabel().setSelectedItem(getNetwork().getLabel()); } toggleProfilesAvailability(); }
Source:
<code>public void disconnect() { <START> if (sock.isConnected()) { <END> sock.disconnect(); } }</code><technical_language>style nit: curly braces single line blocks</technical_language>

Target:
public void disconnect() { if (sock.isConnected()) sock.disconnect(); }
Source:
<code>private List<SchemaTableConfigBean> expandListOfSchemas() { List<SchemaTableConfigBean> expandedSchemas = new ArrayList<>(); configBean.baseConfigBean.schemaTableConfigs .stream() <START> .map(baseConfig -> Arrays.stream(baseConfig.schema.split(",")) <END> .map(copyBean(baseConfig)) .collect(Collectors.toList())) .forEach(expandedSchemas::addAll); return expandedSchemas; }</code><technical_language>if schemas quoted (the case-sensitive option is selected), "," is a valid character in a schema name, potentially break this logic</technical_language>

Target:
private List<SchemaTableConfigBean> expandListOfSchemas() { List<SchemaTableConfigBean> expandedSchemas = new ArrayList<>(); for (SchemaTableConfigBean baseConfig : configBean.baseConfigBean.schemaTableConfigs) { for(String s: Splitter.on(COMMA_SPLIT_PATTERN).split(baseConfig.schema)){ SchemaTableConfigBean schemaTableConfigBean = copyBean(baseConfig,s.replaceAll("^\"|\"$", "")); expandedSchemas.add(schemaTableConfigBean); } } return expandedSchemas; }
Source:
<code>private void bindToBrokerAccountService(final Context context, final Callback<BrokerAccountServiceConnection> callback, final BrokerEvent brokerEvent) { Logger.v(TAG, "Binding to BrokerAccountService for caller uid: " + android.os.Process.myUid()); final Intent brokerAccountServiceToBind = getIntentForBrokerAccountService(context); final BrokerAccountServiceConnection connection = new BrokerAccountServiceConnection(); <START> BindServiceTimeoutRunnable timeoutRunnable = new BindServiceTimeoutRunnable(context, connection, callback); <END> connection.setBindServiceTimeoutCallback(timeoutRunnable); if (brokerEvent != null) { connection.setTelemetryEvent(brokerEvent); brokerEvent.setBrokerAccountServerStartsBinding(); } final CallbackExecutor<BrokerAccountServiceConnection> callbackExecutor = new CallbackExecutor<>(callback); mPendingConnections.put(connection, callbackExecutor); final boolean serviceBound = context.bindService(brokerAccountServiceToBind, connection, Context.BIND_AUTO_CREATE); Logger.v(TAG, "The status for brokerAccountService bindService call is: " + Boolean.valueOf(serviceBound)); if (brokerEvent != null) { brokerEvent.setBrokerAccountServiceBindingSucceed(serviceBound); } if (!serviceBound) { connection.unBindService(context); callback.onError(new AuthenticationException(ADALError.BROKER_BIND_SERVICE_FAILED)); } else { mUiHandler.postDelayed(timeoutRunnable, BIND_SERVICE_TIMEOUT_THRESHOLD); } }</code><technical_language>declared final</technical_language>

Target:
private void bindToBrokerAccountService(final Context context, final Callback<BrokerAccountServiceConnection> callback, final BrokerEvent brokerEvent) { Logger.v(TAG, "Binding to BrokerAccountService for caller uid: " + android.os.Process.myUid()); final Intent brokerAccountServiceToBind = getIntentForBrokerAccountService(context); final BrokerAccountServiceConnection connection = new BrokerAccountServiceConnection(); final BindServiceTimeoutRunnable timeoutRunnable = new BindServiceTimeoutRunnable(context, connection, callback); connection.setBindServiceTimeoutCallback(timeoutRunnable); if (brokerEvent != null) { connection.setTelemetryEvent(brokerEvent); brokerEvent.setBrokerAccountServerStartsBinding(); } final CallbackExecutor<BrokerAccountServiceConnection> callbackExecutor = new CallbackExecutor<>(callback); mPendingConnections.put(connection, callbackExecutor); final boolean serviceBound = context.bindService(brokerAccountServiceToBind, connection, Context.BIND_AUTO_CREATE); Logger.v(TAG, "The status for brokerAccountService bindService call is: " + Boolean.valueOf(serviceBound)); if (brokerEvent != null) { brokerEvent.setBrokerAccountServiceBindingSucceed(serviceBound); } if (!serviceBound) { connection.unBindService(context); callback.onError(new AuthenticationException(ADALError.BROKER_BIND_SERVICE_FAILED, "'bindService' returned 'false'")); } else { mUiHandler.postDelayed(timeoutRunnable, BIND_SERVICE_TIMEOUT_THRESHOLD); } }
Source:
<code>public boolean canSyncNics(List<? extends NetworkInterface> currentDbNics, List<? extends NetworkInterface> snapshotedNics) { CountMacUsageDifference macUsageDifference = new CountMacUsageDifference(vmNicsToMacAddresses(currentDbNics), vmNicsToMacAddresses(snapshotedNics), macsInSnapshotAreExpectedToBeAlreadyAllocated); <START> List<String> macs = macUsageDifference.getMissingMacs(); <END> if (macs.isEmpty()) { return true; } boolean canReallocateMacs = true; List<String> macsCopy = new ArrayList<>(macs); for (NetworkInterface vmInterface : snapshotedNics) { String originalMacAddress = vmInterface.getMacAddress(); if (macsCopy.contains(originalMacAddress)) { canReallocateMacs &= macPool.canAllocateNewMac(); } } return canReallocateMacs; }</code><technical_language>Please consider changing 'macs' 'macToBeAdded'</technical_language>

Target:
public boolean canSyncNics(List<? extends NetworkInterface> currentDbNics, List<? extends NetworkInterface> snapshotedNics) { CountMacUsageDifference macUsageDifference = new CountMacUsageDifference(vmNicsToMacAddresses(currentDbNics), vmNicsToMacAddresses(snapshotedNics), macsInSnapshotAreExpectedToBeAlreadyAllocated); List<String> macsToBeAdded = macUsageDifference.getMissingMacs(); if (macsToBeAdded.isEmpty()) { return true; } List<String> macsToBeRemoved = macUsageDifference.getExtraMacs(); int numOfMacsToAdd = macsToBeAdded.size() - macsToBeRemoved.size(); return numOfMacsToAdd > 0 ? macPool.canAllocateMacAddresses(numOfMacsToAdd) : true; }
Source:
<code>private List<CoordinatorDuty> makeCompactSegmentsDuty() { <START> List<CoordinatorDuty> duties = new ArrayList<>(); duties.add(compactSegments); return ImmutableList.copyOf(duties); <END> }</code><technical_language>return ImmutableList.of(compactSegments); instead</technical_language>

Target:
private List<CoordinatorDuty> makeCompactSegmentsDuty() { return ImmutableList.of(compactSegments); }
Source:
<code>public void testCompletion() throws Exception { Set<Shell> beforeShell = new HashSet<>(Arrays.asList(Display.getDefault().getShells())); editor.selectAndReveal(3, 0); ContentAssistAction action = (ContentAssistAction) editor.getAction(ITextEditorActionConstants.CONTENT_ASSIST); action.update(); action.run(); Set<Shell> afterShell = new HashSet<>(Arrays.asList(Display.getDefault().getShells())); afterShell.removeAll(beforeShell); Assert.assertEquals("No completion", 1, afterShell.size()); Shell completionShell= afterShell.iterator().next(); Table completionProposalList = findCompletionSelectionControl(completionShell); <START> Assert.assertEquals(1, completionProposalList.getItemCount()); <END> TableItem completionProposalItem = completionProposalList.getItem(0); Assert.assertEquals("s are good for a beer.", ((ICompletionProposal)completionProposalItem.getData()).getDisplayString()); completionShell.close(); }</code><technical_language>Prefer import static org.junit.Assert.*; allows assert* prefix</technical_language>

Target:
public void testCompletion() throws Exception { Set<Shell> beforeShell = new HashSet<>(Arrays.asList(Display.getDefault().getShells())); editor.selectAndReveal(3, 0); ContentAssistAction action = (ContentAssistAction) editor.getAction(ITextEditorActionConstants.CONTENT_ASSIST); action.update(); action.run(); Set<Shell> afterShell = new HashSet<>(Arrays.asList(Display.getDefault().getShells())); afterShell.removeAll(beforeShell); assertEquals("No completion", 1, afterShell.size()); Shell completionShell= afterShell.iterator().next(); Table completionProposalList = findCompletionSelectionControl(completionShell); assertEquals(1, completionProposalList.getItemCount()); TableItem completionProposalItem = completionProposalList.getItem(0); assertEquals("s are good for a beer.", ((ICompletionProposal)completionProposalItem.getData()).getDisplayString()); completionShell.close(); }
Source:
<code>public DetailedSampleBuilder(User user) { if (user != null) { securityProfile = new SecurityProfile(user); <START> getSecurityProfile().getProfileId(); <END> } }</code><technical_language>remove line</technical_language>

Target:
public DetailedSampleBuilder(User user) { if (user != null) { securityProfile = new SecurityProfile(user); } }
Source:
<code>private Mono<Address> addressLookup(ServiceMessage request) { return Mono.fromCallable(() -> router.route(serviceRegistry, request) .map(ServiceReference::address) .orElseThrow(() -> noReachableMemberException(request))) .doOnError( t -> { Optional<Object> dataOptional = Optional.ofNullable(request.data()); <START> dataOptional.ifPresent(ReferenceCountUtil::safestRelease); <END> }); }</code><technical_language>mind if I ask inline dataOptional geti rid of curly braces block</technical_language>

Target:
private Mono<Address> addressLookup(ServiceMessage request) { Callable<Address> callable = () -> router .route(serviceRegistry, request) .map(ServiceReference::address) .orElseThrow(() -> noReachableMemberException(request)); return Mono.fromCallable(callable) .doOnError( t -> { Optional<Object> dataOptional = Optional.ofNullable(request.data()); dataOptional.ifPresent(ReferenceCountUtil::safestRelease); }); }
Source:
<code>@Override public SVMLinearBinaryClassificationModel fit(DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, double[]> featureExtractor, IgniteBiFunction<K, V, Double> lbExtractor, int cols) { assert datasetBuilder != null; PartitionDataBuilder<K, V, SVMPartitionContext, LabeledDataset<Double, LabeledVector>> partDataBuilder = new SVMPartitionDataBuilderOnHeap<>( featureExtractor, lbExtractor, cols ); <START> this.dataset = datasetBuilder.build( <END> (upstream, upstreamSize) -> new SVMPartitionContext(), partDataBuilder ); final int weightVectorSizeWithIntercept = cols + 1; Vector weights = initializeWeightsWithZeros(weightVectorSizeWithIntercept); for (int i = 0; i < this.getAmountOfIterations(); i++) { Vector deltaWeights = calculateUpdates(weights); weights = weights.plus(deltaWeights); } return new SVMLinearBinaryClassificationModel(weights.viewPart(1, weights.size() - 1), weights.get(0)); }</code><technical_language>Dataset is AutoCloseable object, fit great close clear resources. Try-with-resources is preferable</technical_language>

Target:
@Override public SVMLinearBinaryClassificationModel fit(DatasetBuilder<K, V> datasetBuilder, IgniteBiFunction<K, V, double[]> featureExtractor, IgniteBiFunction<K, V, Double> lbExtractor, int cols) { assert datasetBuilder != null; PartitionDataBuilder<K, V, SVMPartitionContext, LabeledDataset<Double, LabeledVector>> partDataBuilder = new SVMPartitionDataBuilderOnHeap<>( featureExtractor, lbExtractor, cols ); Vector weights; try(Dataset<SVMPartitionContext, LabeledDataset<Double, LabeledVector>> dataset = datasetBuilder.build( (upstream, upstreamSize) -> new SVMPartitionContext(), partDataBuilder )) { final int weightVectorSizeWithIntercept = cols + 1; weights = initializeWeightsWithZeros(weightVectorSizeWithIntercept); for (int i = 0; i < this.getAmountOfIterations(); i++) { Vector deltaWeights = calculateUpdates(weights, dataset); weights = weights.plus(deltaWeights); } } catch (Exception e) { throw new RuntimeException(e); } return new SVMLinearBinaryClassificationModel(weights.viewPart(1, weights.size() - 1), weights.get(0)); }
Source:
<code>public String apply(final String password) { <START> final String hashed = hashPasswordWithSalt(password); <END> return BCrypt.with(LongPasswordStrategies.none()).hashToString(10, hashed.toCharArray()); }</code><technical_language>a bcrypt salt anywhere? If not, for this PR a fast-follow, clean configuration intended inject a salt: - <LINK_0> - <LINK_2> - <LINK_3> - <LINK_1></technical_language>

Target:
public String apply(final String password) { final String hashed = hashPasswordWithSalt(password); return hashPassword(hashed); }
Source:
<code>private IRadioButton<T> findFirstButtonInFieldTree(IFormField f) { if (f instanceof IRadioButton) { <START> return (IRadioButton<T>) f; END> } else if (f instanceof ICompositeField) { for (IFormField sub : ((ICompositeField) f).getFields()) { IRadioButton<T> b = findFirstButtonInFieldTree(sub); if (b != null) { return b; } } } return null; }</code><technical_language>TypeCastUtility.getGenericsParameterClass(getClass(), IHolder.class); check type parameter</technical_language>

Target:
private IRadioButton<T> findFirstButtonInFieldTree(IFormField f) { if (f instanceof IRadioButton) { return (IRadioButton) f; } else if (f instanceof ICompositeField) { for (IFormField sub : ((ICompositeField) f).getFields()) { IRadioButton<T> b = findFirstButtonInFieldTree(sub); if (b != null) { return b; } } } return null; }
Source:
<code>public APIResult submitExtensionJob(String extensionName, String jobName, String configPath, String doAsUser) { InputStream configStream = getServletInputStream(configPath); try { <START> List<Entity> entities = getEntities(extensionName, jobName, configStream); <END> List<Feed> feeds = new ArrayList<>(); List<Process> processes = new ArrayList<>(); for (Entity entity : entities) { if (EntityType.FEED.equals(entity.getEntityType())) { feeds.add((Feed)entity); } else if (EntityType.PROCESS.equals(entity.getEntityType())) { processes.add((Process)entity); } } return localExtensionManager.submitExtensionJob(extensionName, jobName, configStream, feeds, processes); } catch (FalconException | IOException e) { throw new FalconCLIException("Failed in submitting extension job " + jobName); } }</code><technical_language>If getEntities return a Map<EntityType, List<Entity>>. passed submitExtensionJob. redundant code</technical_language>

Target:
public APIResult submitExtensionJob(String extensionName, String jobName, String configPath, String doAsUser) { InputStream configStream = getServletInputStream(configPath); try { Map<EntityType, List<Entity>> entityMap = getEntityTypeListMap(extensionName, jobName, configStream); return localExtensionManager.submitExtensionJob(extensionName, jobName, configStream, entityMap); } catch (FalconException | IOException e) { throw new FalconCLIException("Failed in submitting extension job " + jobName); } }
Source:
<code>protected boolean downloadAsset(final SwrveAssetsQueueItem assetItem, final String cdnRoot) { boolean success = false; String url = cdnRoot + assetItem.getName(); InputStream inputStream = null; try { URLConnection openConnection = new URL(url).openConnection(); inputStream = new SwrveFilterInputStream(openConnection.getInputStream()); ByteArrayOutputStream stream = new ByteArrayOutputStream(); byte[] buffer = new byte[2048]; int bytesRead; while ((bytesRead = inputStream.read(buffer)) != -1) { stream.write(buffer, 0, bytesRead); } byte[] fileContents = stream.toByteArray(); String sha1File = SwrveHelper.sha1(stream.toByteArray()); if (assetItem.getDigest().equals(sha1File)) { FileOutputStream fileStream = new FileOutputStream(new File(storageDir, assetItem.getName())); fileStream.write(fileContents); fileStream.close(); success = true; } else { <START> SwrveLogger.e(LOG_TAG, "Error downloading asset:" + assetItem + ". Did not match sha:" + sha1File); <END> } } catch (Exception e) { SwrveLogger.e(LOG_TAG, "Error downloading asset:" + assetItem, e); } finally { if (inputStream != null) { try { inputStream.close(); } catch (Exception e) { SwrveLogger.e(LOG_TAG, "Error closing assets stream.", e); } } } return success; }</code><technical_language>digest</technical_language>

Target:
protected boolean downloadAsset(final SwrveAssetsQueueItem assetItem, final String cdnRoot) { boolean success = false; String url = cdnRoot + assetItem.getName(); InputStream inputStream = null; try { URLConnection openConnection = new URL(url).openConnection(); inputStream = new SwrveFilterInputStream(openConnection.getInputStream()); ByteArrayOutputStream stream = new ByteArrayOutputStream(); byte[] buffer = new byte[2048]; int bytesRead; while ((bytesRead = inputStream.read(buffer)) != -1) { stream.write(buffer, 0, bytesRead); } byte[] fileContents = stream.toByteArray(); String sha1File = SwrveHelper.sha1(stream.toByteArray()); if (assetItem.getDigest().equals(sha1File)) { FileOutputStream fileStream = new FileOutputStream(new File(storageDir, assetItem.getName())); fileStream.write(fileContents); fileStream.close(); success = true; } else { SwrveLogger.e(LOG_TAG, "Error downloading assetItem:" + assetItem + ". Did not match digest:" + sha1File); } } catch (Exception e) { SwrveLogger.e(LOG_TAG, "Error downloading asset:" + assetItem, e); } finally { if (inputStream != null) { try { inputStream.close(); } catch (Exception e) { SwrveLogger.e(LOG_TAG, "Error closing assets stream.", e); } } } return success; }
Source:
<code>public void verify() { if (previousCallHistory == null) { if (currentCallHistory.size() == 0) { return; } throw new AssertionFailedError("unexpected"); } if (ordered) { int numMissingCalls = previousCallHistory.size() - currentCallHistory.size(); if (numMissingCalls > 0) { throw new AssertionFailedError("missing method calls (" + numMissingCalls + ", first is: " + previousCallHistory.get(currentCallHistory.size()) + ")"); } for (int i = 0; i < previousCallHistory.size(); i++) { if (!previousCallHistory.get(i).equals( currentCallHistory.get(i))) { throw new AssertionFailedError( "method call did not match (" + i + " of " + currentCallHistory.size() + ")"); } } } else { <START> for (Iterator<MethodCall> it = previousCallHistory.iterator(); it.hasNext();) { <END> MethodCall methodCall = it.next(); if (!currentCallHistory.contains(methodCall)) { throw new AssertionFailedError("missing method call:" + methodCall.method.getName()); } } } reset(); }</code><technical_language>Iterators useful, if want modify Collection iteration Iterator's .remove(); method: it.remove() this is case I propose a new foreach loop: for(MethodCall methodCall : previousCallHistory){ [...] }</technical_language>

Target:
public void verify() { if (previousCallHistory == null) { if (currentCallHistory.size() == 0) { return; } throw new AssertionFailedError("unexpected"); } if (ordered) { int numMissingCalls = previousCallHistory.size() - currentCallHistory.size(); if (numMissingCalls > 0) { throw new AssertionFailedError("missing method calls (" + numMissingCalls + ", first is: " + previousCallHistory.get(currentCallHistory.size()) + ")"); } for (int i = 0; i < previousCallHistory.size(); i++) { if (!previousCallHistory.get(i).equals( currentCallHistory.get(i))) { throw new AssertionFailedError( "method call did not match (" + i + " of " + currentCallHistory.size() + ")"); } } } else { for (MethodCall methodCall : previousCallHistory) { if (!currentCallHistory.contains(methodCall)) { throw new AssertionFailedError("missing method call:" + methodCall.method.getName()); } } } reset(); }
Source:
<code><START> public Subscriptions getAccountSubscriptions(final String accountCode, final String status) { <END> return doGET(Account.ACCOUNT_RESOURCE + "/" + accountCode + Subscriptions.SUBSCRIPTIONS_RESOURCE + "?state=" + status, Subscriptions.class); }</code><technical_language>strong objection if want way, thoughts: - Caller care implementation (what body, optional, etc.), functionality, I instead signatures reflect functionality implementation. - QueryParams intersection of optional fields APIs, union (if a couple of endpoints accept TransactionStatus, I put in there). - name more generic (e.g. OptionalParams)</technical_language>

Target:
public Subscriptions getAccountSubscriptions(final String accountCode, final String status) { final QueryParams params = new QueryParams(); if (status != null) params.put("state", status); return doGET(Account.ACCOUNT_RESOURCE + "/" + accountCode + Subscriptions.SUBSCRIPTIONS_RESOURCE, Subscriptions.class, params); }
Source:
<code>private static void preparePrologue( @Nonnull CandidateInfo candidate, @Nonnull PrologueInfo prologue, @Nonnull TransformationRequest tr) { List<JParameter> params = candidate.target.getParams(); for (int i = 0; i < candidate.callSite.getArgs().size(); i++) { JExpression arg = candidate.callSite.getArgs().get(i); JLocal local = new JLocal( candidate.callSite.getSourceInfo(), <START> ".inline_param_" + params.get(i).getName(), <END> params.get(i).getType(), params.get(i).getModifier() | JModifier.SYNTHETIC, (JMethodBody) candidate.target.getBody()); prologue.parameterMap.put(params.get(i), local); JMethodBody enclosingBody = candidate.callSiteMethodBody; assert enclosingBody != null; tr.append(new AddJLocalInMethodBody(local, enclosingBody)); tr.append( new AppendBefore( candidate.callSiteStmt, new JExpressionStatement( candidate.callSite.getSourceInfo(), new JAsgOperation( candidate.callSite.getSourceInfo(), local.makeRef(candidate.callSite.getSourceInfo()), arg)))); } if (prologue.targetThis != null) { JLocal local = new JLocal( candidate.callSite.getSourceInfo(), ".inline_this", prologue.targetThis.getType(), JModifier.SYNTHETIC, (JMethodBody) candidate.target.getBody()); JMethodBody enclosingBody = candidate.callSiteMethodBody; assert enclosingBody != null; tr.append(new AddJLocalInMethodBody(local, enclosingBody)); tr.append( new AppendBefore( candidate.callSiteStmt, new JExpressionStatement( candidate.callSite.getSourceInfo(), new JAsgOperation( candidate.callSite.getSourceInfo(), local.makeRef(candidate.callSite.getSourceInfo()), prologue.targetThis)))); prologue.targetThisLocal = local; } }</code><technical_language>below, this unique in case multiple inlines</technical_language>

Target:
private static void preparePrologue( @Nonnull CandidateInfo candidate, @Nonnull PrologueInfo prologue, @Nonnull TransformationRequest tr) { SourceInfo src = candidate.callSite.getSourceInfo(); List<JParameter> params = candidate.target.getParams(); for (int i = 0; i < candidate.callSite.getArgs().size(); i++) { JExpression arg = candidate.callSite.getArgs().get(i); JLocal local = new JLocal( src, ".inline_param_" + params.get(i).getName(), params.get(i).getType(), params.get(i).getModifier() | JModifier.SYNTHETIC, (JMethodBody) candidate.target.getBody()); prologue.parameterMap.put(params.get(i), local); JMethodBody enclosingBody = candidate.callSiteMethodBody; assert enclosingBody != null; tr.append(new AddJLocalInMethodBody(local, enclosingBody)); tr.append( new AppendBefore( candidate.callSiteStmt, new JExpressionStatement( src, new JAsgOperation( src, local.makeRef(src), arg)))); } if (prologue.targetThis != null) { JLocal local = new JLocal( src, ".inline_this", prologue.targetThis.getType(), JModifier.SYNTHETIC, (JMethodBody) candidate.target.getBody()); JMethodBody enclosingBody = candidate.callSiteMethodBody; assert enclosingBody != null; tr.append(new AddJLocalInMethodBody(local, enclosingBody)); tr.append( new AppendBefore( candidate.callSiteStmt, new JExpressionStatement( src, new JAsgOperation( src, local.makeRef(src), prologue.targetThis)))); prologue.targetThisLocal = local; } }
Source:
<code>private void createDeviceDataTable(final SuripuAppConfiguration configuration, final AWSCredentialsProvider awsCredentialsProvider) { final AmazonDynamoDBClient client = new AmazonDynamoDBClient(awsCredentialsProvider); final DynamoDBConfiguration config = configuration.getDeviceDataConfiguration(); final String tableName = config.getTableName(); client.setEndpoint(config.getEndpoint()); final DeviceDataDAODynamoDB deviceDataDAODynamoDB = new DeviceDataDAODynamoDB(client, tableName); <START> final DateTime now = DateTime.now(); <END> for (int i = 0; i < 6; i++) { final DateTime currDateTime = now.plusMonths(i); try { client.describeTable(deviceDataDAODynamoDB.getTableName(currDateTime)); System.out.println(String.format("%s already exists.", deviceDataDAODynamoDB.getTableName(currDateTime))); } catch (AmazonServiceException exception) { final CreateTableResult result = deviceDataDAODynamoDB.createTable(currDateTime); System.out.println(result.getTableDescription().getTableStatus()); } } }</code><technical_language>explicitly declare DateTimeZone this is in</technical_language>

Target:
private void createDeviceDataTable(final SuripuAppConfiguration configuration, final AWSCredentialsProvider awsCredentialsProvider) { final AmazonDynamoDBClient client = new AmazonDynamoDBClient(awsCredentialsProvider); final DynamoDBConfiguration config = configuration.getDeviceDataConfiguration(); final String tablePrefix = config.getTableName(); client.setEndpoint(config.getEndpoint()); final DeviceDataDAODynamoDB deviceDataDAODynamoDB = new DeviceDataDAODynamoDB(client, tablePrefix); final DateTime now = DateTime.now(DateTimeZone.UTC); for (int i = 0; i < 6; i++) { final DateTime currDateTime = now.plusMonths(i); try { client.describeTable(deviceDataDAODynamoDB.getTableName(currDateTime)); System.out.println(String.format("%s already exists.", deviceDataDAODynamoDB.getTableName(currDateTime))); } catch (AmazonServiceException exception) { final String tableName = deviceDataDAODynamoDB.getTableName(currDateTime); final CreateTableResult result = deviceDataDAODynamoDB.createTable(tableName); System.out.println(result.getTableDescription().getTableStatus()); } } }
Source:
<code>public Optional<DecorrelationResult> visitFilter(FilterNode node, Void context) { Expression predicate = node.getPredicate(); if (!SymbolsExtractor.extractUnique(predicate).containsAll(correlation)) { <START> return Optional.empty(); <END> } Map<Boolean, List<Expression>> predicates = ExpressionUtils.extractConjuncts(predicate).stream() .collect(Collectors.partitioningBy(isUsingPredicate(correlation))); List<Expression> correlatedPredicates = ImmutableList.copyOf(predicates.get(true)); List<Expression> uncorrelatedPredicates = ImmutableList.copyOf(predicates.get(false)); FilterNode newFilterNode = new FilterNode( idAllocator.getNextId(), node.getSource(), ExpressionUtils.combineConjuncts(uncorrelatedPredicates)); return Optional.of(new DecorrelationResult( newFilterNode, Sets.difference(SymbolsExtractor.extractUnique(correlatedPredicates), ImmutableSet.copyOf(correlation)), correlatedPredicates)); }</code><technical_language>return Optional.empty();</technical_language>

Target:
public Optional<DecorrelationResult> visitFilter(FilterNode node, Void context) { Optional<DecorrelationResult> childDecorrelationResultOptional = Optional.of(new DecorrelationResult( node.getSource(), ImmutableSet.of(), ImmutableList.of(), ImmutableMultimap.of(), false)); if (containsCorrelation(node.getSource(), correlation)) { childDecorrelationResultOptional = lookup.resolve(node.getSource()).accept(this, null); } if (!childDecorrelationResultOptional.isPresent()) { return Optional.empty(); } Expression predicate = node.getPredicate(); Map<Boolean, List<Expression>> predicates = ExpressionUtils.extractConjuncts(predicate).stream() .collect(Collectors.partitioningBy(PlanNodeDecorrelator.DecorrelatingVisitor.this::isCorrelated)); List<Expression> correlatedPredicates = ImmutableList.copyOf(predicates.get(true)); List<Expression> uncorrelatedPredicates = ImmutableList.copyOf(predicates.get(false)); DecorrelationResult childDecorrelationResult = childDecorrelationResultOptional.get(); FilterNode newFilterNode = new FilterNode( idAllocator.getNextId(), childDecorrelationResult.node, ExpressionUtils.combineConjuncts(uncorrelatedPredicates)); Set<Symbol> symbolsToPropagate = Sets.difference(SymbolsExtractor.extractUnique(correlatedPredicates), ImmutableSet.copyOf(correlation)); return Optional.of(new DecorrelationResult( newFilterNode, Sets.union(childDecorrelationResult.symbolsToPropagate, symbolsToPropagate), ImmutableList.<Expression>builder() .addAll(childDecorrelationResult.correlatedPredicates) .addAll(correlatedPredicates) .build(), ImmutableMultimap.<Symbol, Symbol>builder() .putAll(childDecorrelationResult.correlatedSymbolsMapping) .putAll(extractCorrelatedSymbolsMapping(correlatedPredicates)) .build(), childDecorrelationResult.atMostSingleRow)); }
Source:
<code>public boolean next(List<Cell> results) throws IOException { Cell lastCell = null; int rowCount = 0; region.startRegionOperation(); try { synchronized (innerScanner) { do { List<Cell> row = new ArrayList<>(); hasMore = innerScanner.nextRaw(row); if (!row.isEmpty()) { lastCell = row.get(0); Put put = null; Delete del = null; for (Cell cell : row) { if (KeyValue.Type.codeToType(cell.getTypeByte()) == KeyValue.Type.Put) { if (put == null) { put = new Put(CellUtil.cloneRow(cell)); mutations.add(put); } put.add(cell); } else { <START> if (del == null) { <END> del = new Delete(CellUtil.cloneRow(cell)); mutations.add(del); } del.addDeleteMarker(cell); } } rowCount++; } } while (hasMore && rowCount < pageSizeInRows); verifyIndex(); } } catch (IOException e) { LOGGER.error(String.format("IOException during rebuilding: %s", Throwables.getStackTraceAsString(e))); throw e; } finally { region.closeRegionOperation(); mutations.clear(); indexKeyToDataPutMap.clear(); dataKeyToDataPutMap.clear(); } byte[] rowCountBytes = PLong.INSTANCE.toBytes(Long.valueOf(rowCount)); final Cell aggKeyValue; if (lastCell == null) { aggKeyValue = KeyValueUtil.newKeyValue(UNGROUPED_AGG_ROW_KEY, SINGLE_COLUMN_FAMILY, SINGLE_COLUMN, AGG_TIMESTAMP, rowCountBytes,0, rowCountBytes.length); } else { aggKeyValue = KeyValueUtil.newKeyValue(CellUtil.cloneRow(lastCell), SINGLE_COLUMN_FAMILY, SINGLE_COLUMN, AGG_TIMESTAMP, rowCountBytes, 0, rowCountBytes.length); } results.add(aggKeyValue); return hasMore; }</code><technical_language>scan for this scanner is a raw scan, get delete cell. trow exception if type of cell is put</technical_language>

Target:
public boolean next(List<Cell> results) throws IOException { Cell lastCell = null; int rowCount = 0; region.startRegionOperation(); try { synchronized (innerScanner) { do { List<Cell> row = new ArrayList<>(); hasMore = innerScanner.nextRaw(row); if (!row.isEmpty()) { lastCell = row.get(0); Put put = null; for (Cell cell : row) { if (KeyValue.Type.codeToType(cell.getTypeByte()) == KeyValue.Type.Put) { if (put == null) { put = new Put(CellUtil.cloneRow(cell)); } put.add(cell); } else { throw new DoNotRetryIOException("Scan without raw found a deleted cell"); } } rowCount++; indexKeyToDataPutMap .put(getIndexRowKey(indexMaintainer, put), put); } } while (hasMore && rowCount < pageSizeInRows); verifyIndex(); } } catch (IOException e) { LOGGER.error(String.format("IOException during rebuilding: %s", Throwables.getStackTraceAsString(e))); throw e; } finally { region.closeRegionOperation(); indexKeyToDataPutMap.clear(); } byte[] rowCountBytes = PLong.INSTANCE.toBytes(Long.valueOf(rowCount)); final Cell aggKeyValue; if (lastCell == null) { aggKeyValue = KeyValueUtil.newKeyValue(UNGROUPED_AGG_ROW_KEY, SINGLE_COLUMN_FAMILY, SINGLE_COLUMN, AGG_TIMESTAMP, rowCountBytes,0, rowCountBytes.length); } else { aggKeyValue = KeyValueUtil.newKeyValue(CellUtil.cloneRow(lastCell), SINGLE_COLUMN_FAMILY, SINGLE_COLUMN, AGG_TIMESTAMP, rowCountBytes, 0, rowCountBytes.length); } results.add(aggKeyValue); return hasMore; }
Source:
<code>private static Pair<Long, Long> readMemInfo() { long memFree = 0L; long activeFile = 0L; long inactiveFile = 0L; long sReclaimable = 0L; long memTotal = 0L; long memAvailable; List<String> procMemInfo = FileUtil.readFile(ProcPath.MEMINFO); for (String checkLine : procMemInfo) { String[] memorySplit = ParseUtil.whitespaces.split(checkLine); if (memorySplit.length > 1) { switch (memorySplit[0]) { case "MemTotal:": <START> memTotal = ParseUtil.parseDecimalMemorySizeToBinary(checkLine.substring(memorySplit[0].length()).trim()); <END> break; case "MemAvailable:": memAvailable = ParseUtil.parseDecimalMemorySizeToBinary(checkLine.substring(memorySplit[0].length()).trim()); return new Pair<>(memAvailable, memTotal); case "MemFree:": memFree = ParseUtil.parseDecimalMemorySizeToBinary(checkLine.substring(memorySplit[0].length()).trim()); break; case "Active(file):": activeFile = ParseUtil.parseDecimalMemorySizeToBinary(checkLine.substring(memorySplit[0].length()).trim()); break; case "Inactive(file):": inactiveFile = ParseUtil.parseDecimalMemorySizeToBinary(checkLine.substring(memorySplit[0].length()).trim()); break; case "SReclaimable:": sReclaimable = ParseUtil.parseDecimalMemorySizeToBinary(checkLine.substring(memorySplit[0].length()).trim()); break; default: break; } } } return new Pair<>(memFree + activeFile + inactiveFile + sReclaimable, memTotal); }</code><technical_language>~Good start, this work. full memorySplit string includes header text ("MemTotal" in this case), while ParseUtil method is expecting part split.~ original string "MemTotal: 1882064 kB". Currently split line 103 turns this array { "MemTotal:", "1882064", "kB" } want send string "1882064 kB" ParseUtil. If add a limit parameter of 2 split Line 103 (ParseUtil.whitespaces.split(checkline, 2)) split string parts... split[0] "MemTotal:" split[1] "1882064 kB" want send</technical_language>

Target:
private static Pair<Long, Long> readMemInfo() { long memFree = 0L; long activeFile = 0L; long inactiveFile = 0L; long sReclaimable = 0L; long memTotal = 0L; long memAvailable; List<String> procMemInfo = FileUtil.readFile(ProcPath.MEMINFO); for (String checkLine : procMemInfo) { String[] memorySplit = ParseUtil.whitespaces.split(checkLine, 2); if (memorySplit.length > 1) { switch (memorySplit[0]) { case "MemTotal:": memTotal = ParseUtil.parseDecimalMemorySizeToBinary(memorySplit[1]); break; case "MemAvailable:": memAvailable = ParseUtil.parseDecimalMemorySizeToBinary(memorySplit[1]); return new Pair<>(memAvailable, memTotal); case "MemFree:": memFree = ParseUtil.parseDecimalMemorySizeToBinary(memorySplit[1]); break; case "Active(file):": activeFile = ParseUtil.parseDecimalMemorySizeToBinary(memorySplit[1]); break; case "Inactive(file):": inactiveFile = ParseUtil.parseDecimalMemorySizeToBinary(memorySplit[1]); break; case "SReclaimable:": sReclaimable = ParseUtil.parseDecimalMemorySizeToBinary(memorySplit[1]); break; default: break; } } } return new Pair<>(memFree + activeFile + inactiveFile + sReclaimable, memTotal); }
Source:
<code><START> public int compare(T o1, T o2) { <END> Pair<Integer,Integer> result = this.getReult(o1,o2); return result.getFirst() == result.getSecond() ? 0 : result.getFirst() > result.getSecond() ? 1 : -1; }</code><technical_language>I missing something, ExecutableFlow comparator (ranker) ? This enable more signals chose Executor A Executor B in context of Executable flow C ? more extensible avoiding interfaces changes on</technical_language>

Target:
public int compare(T o1, T o2) { Pair<Integer,Integer> result = this.getComparisonScore(o1,o2); return result.getFirst() == result.getSecond() ? 0 : result.getFirst() > result.getSecond() ? 1 : -1; }
Source:
<code>private EnumSchema.Builder buildEnumSchema() { EnumSchema.Builder builder = EnumSchema.builder(); Set<Object> possibleValues = new HashSet<>(); ls.schemaJson().require("enum").requireArray().forEach((i, item) -> possibleValues.add(item.unwrap())); builder.possibleValues(possibleValues); if (config.useDefaults) <START> ls.schemaJson().maybe("default").map(JsonValue::deepToOrgJson).ifPresent(builder::defaultValue); <END> return builder; }</code><technical_language>notes in #buildBooleanSchema()</technical_language>

Target:
private EnumSchema.Builder buildEnumSchema() { EnumSchema.Builder builder = EnumSchema.builder(); Set<Object> possibleValues = new HashSet<>(); ls.schemaJson().require("enum").requireArray().forEach((i, item) -> possibleValues.add(item.unwrap())); builder.possibleValues(possibleValues); return builder; }
Source:
<code>private static final SerializationFilterAdapter serializationFilterAdapter = isJava6To8() ? createOnJava6To8Adapter() : new OnJavaAfter8(); <START> private static boolean isJava6To8() { <END> List<String> olderVersions = Arrays.asList("1.6", "1.7", "1.8"); return olderVersions.contains(System.getProperty("java.specification.version")); }</code><technical_language>Missing license header</technical_language>

Target:
private static final SerializationFilterAdapter serializationFilterAdapter = isJava6To8() ? createOnJava6To8Adapter() : createOnJavaAfter8Adapter(); private static boolean isJava6To8() { List<String> olderVersions = Arrays.asList("1.6", "1.7", "1.8"); return olderVersions.contains(System.getProperty("java.specification.version")); }
Source:
<code>public IndexReader newReader() { Map<CoordinateReferenceSystem,IndexReader> indexReaders = new HashMap<>(); for ( Map.Entry<CoordinateReferenceSystem,SpatialKnownIndex> index : indexMap.entrySet() ) { try { <START> indexReaders.put( index.getKey(), index.getValue().getOnlineAccessor(descriptor, samplingConfig).newReader() ); <END> } catch ( IOException e ) { e.printStackTrace(); } } return new SpatialFusionIndexReader( indexReaders, descriptor ); }</code><technical_language>plans for this fellow</technical_language>

Target:
public IndexReader newReader() { Map<CoordinateReferenceSystem,IndexReader> indexReaders = new HashMap<>(); for ( Map.Entry<CoordinateReferenceSystem,SpatialKnownIndex> index : indexMap.entrySet() ) { indexReaders.put( index.getKey(), index.getValue().newReader( samplingConfig, descriptor ) ); } return new SpatialFusionIndexReader( indexReaders, descriptor ); }
Source:
<code><START> public boolean hasUnsyncedNotes() { <END> Simplenote application = (Simplenote) getActivity().getApplication(); Bucket<Note> notesBucket = application.getNotesBucket(); Bucket.ObjectCursor<Note> notesCursor = notesBucket.allObjects(); while (notesCursor.moveToNext()) { Note note = notesCursor.getObject(); if (note.getVersion() == 0) { return true; } } return false; }</code><technical_language>private. passed asyncTask a subclass of this class</technical_language>

Target:
private boolean hasUnsyncedNotes() { Simplenote application = (Simplenote) getActivity().getApplication(); Bucket<Note> notesBucket = application.getNotesBucket(); Bucket.ObjectCursor<Note> notesCursor = notesBucket.allObjects(); while (notesCursor.moveToNext()) { Note note = notesCursor.getObject(); if (note.isNew() || note.isModified()) { return true; } } return false; }
Source:
<code>public String[] decorateListing( final Transfer transfer, final String[] listing, final EventMetadata metadata ) throws IOException { String[] result = listing; for ( TransferDecorator decorator : decorators ) { String[] decorated = decorator.decorateListing( transfer, listing, metadata ); <START> if(!Arrays.equals( listing, decorated )){ <END> result = decorated; } } return result; }</code><technical_language>if statement necessary. if decorated is equals listing, assignment is valid. btw, for loop, immutable listing. I result instead of listing? i.e., String[] decorated = decorator.decorateListing( transfer, result, metadata ); in case result changed</technical_language>

Target:
public String[] decorateListing( final Transfer transfer, final String[] listing, final EventMetadata metadata ) throws IOException { String[] result = listing; for ( TransferDecorator decorator : decorators ) { result = decorator.decorateListing( transfer, result, metadata ); } return result; }
Source:
<code>private void doRenderRobot(float factor, TextureManager texManager) { box.render(factor); GL11.glPushMatrix(); texManager.bindTexture(overlay); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); GL11.glDepthMask(true); <START> OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680 % 65536, 61680 / 65536); <END> box.render(factor); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glPopMatrix(); }</code><technical_language>GL11.glDisable(GL11.GL_LIGHTING)? asking</technical_language>

Target:
private void doRenderRobot(float factor, TextureManager texManager) { box.render(factor); GL11.glPushMatrix(); texManager.bindTexture(overlay); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glDisable(GL11.GL_LIGHTING); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); GL11.glDepthMask(true); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680 % 65536, 61680 / 65536); box.render(factor); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); }
Source:
<code>public InfinispanRemoteQueryBuilder getQuery() { InfinispanRemoteQueryBuilder builder = new InfinispanRemoteQueryBuilder(); int counter = 1; builder.append( "(" ); for ( Predicate<InfinispanRemoteQueryBuilder> child : children ) { <START> builder.append( child.getQuery() ); <END> builder.append( ")" ); if ( counter++ < children.size() ) { builder.append( " and (" ); } } return builder; }</code><technical_language>removed duplicated code in InfinispanRemoteDisjunctionPredicate</technical_language>

Target:
public InfinispanRemoteQueryBuilder getQuery() { return new InfinispanRemoteQueryBuilder( "and", false, children ); }
Source:
<code>public void testRemoveValueNoStoreEntryNoCacheWriter() throws Exception { final MockStore realStore = new MockStore(Collections.<String, String>emptyMap()); this.store = spy(realStore); final Ehcache<String, String> ehcache = this.getEhcache(null); assertFalse(ehcache.remove("key", "value")); verify(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); verifyZeroInteractions(this.spiedResilienceStrategy); assertThat(realStore.getMap().containsKey("key"), is(false)); <START> validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.RemoveOutcome.FAILURE)); END> }</code><technical_language>match return of false asserted a lines this</technical_language>

Target:
public void testRemoveValueNoStoreEntryNoCacheWriter() throws Exception { final FakeStore fakeStore = new FakeStore(Collections.<String, String>emptyMap()); this.store = spy(fakeStore); final Ehcache<String, String> ehcache = this.getEhcache(null); assertFalse(ehcache.remove("key", "value")); verify(this.store).computeIfPresent(eq("key"), getAnyBiFunction()); verifyZeroInteractions(this.spiedResilienceStrategy); assertThat(fakeStore.getEntryMap().containsKey("key"), is(false)); validateStats(ehcache, EnumSet.of(CacheOperationOutcomes.RemoveOutcome.FAILURE)); }