auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void onPlayerInteract(final PlayerInteractEvent event) { boolean updateActivity = true; switch (event.getAction()) { case RIGHT_CLICK_BLOCK: if (!event.isCancelled() && MaterialUtil.isBed(event.getClickedBlock().getType()) && ess.getSettings().getUpdateBedAtDaytime()) { User player = ess.getUser(event.getPlayer()); if (player.isAuthorized("essentials.sethome.bed") && player.getWorld().getEnvironment().equals(World.Environment.NORMAL)) { player.getBase().setBedSpawnLocation(event.getClickedBlock().getLocation()); player.sendMessage(tl("bedSet", player.getLocation().getWorld().getName(), player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ())); } } break; case LEFT_CLICK_AIR: if (event.getPlayer().isFlying()) { final User user = ess.getUser(event.getPlayer()); if (user.isFlyClickJump()) { useFlyClickJump(user); break; } } <START> break; <END> case LEFT_CLICK_BLOCK: if (event.getItem() != null && event.getItem().getType() != Material.AIR) { final User user = ess.getUser(event.getPlayer()); if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem().getType())) { event.setCancelled(true); } } break; case PHYSICAL: updateActivity = false; break; default: break; } if (updateActivity) { ess.getUser(event.getPlayer()).updateActivityOnInteract(true); } }</code><technical_language>This changes behavior. Revert</technical_language>

Target:
public void onPlayerInteract(final PlayerInteractEvent event) { boolean updateActivity = true; switch (event.getAction()) { case RIGHT_CLICK_BLOCK: if (!event.isCancelled() && MaterialUtil.isBed(event.getClickedBlock().getType()) && ess.getSettings().getUpdateBedAtDaytime()) { User player = ess.getUser(event.getPlayer()); if (player.isAuthorized("essentials.sethome.bed") && player.getWorld().getEnvironment().equals(World.Environment.NORMAL)) { player.getBase().setBedSpawnLocation(event.getClickedBlock().getLocation()); player.sendMessage(tl("bedSet", player.getLocation().getWorld().getName(), player.getLocation().getBlockX(), player.getLocation().getBlockY(), player.getLocation().getBlockZ())); } } break; case LEFT_CLICK_AIR: if (event.getPlayer().isFlying()) { final User user = ess.getUser(event.getPlayer()); if (user.isFlyClickJump()) { useFlyClickJump(user); break; } } case LEFT_CLICK_BLOCK: if (event.getItem() != null && event.getItem().getType() != Material.AIR) { final User user = ess.getUser(event.getPlayer()); if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem().getType())) { event.setCancelled(true); } } break; case PHYSICAL: updateActivity = false; break; default: break; } if (updateActivity) { ess.getUser(event.getPlayer()).updateActivityOnInteract(true); } }
Source:
<code>public void shouldAddUserToWarehouse() { <START> account = gd.getAccountService().createAccount(new Account(LOGIN, "nnPvcGXU7f", "FistName", "LastName"), getProperty("domain")); <END> warehouseUser = service.addUserToWarehouse(warehouse, new WarehouseUser(WarehouseUser.ADMIN_ROLE, null, LOGIN)).get(60, TimeUnit.SECONDS); assertThat(warehouseUser, is(notNullValue())); }</code><technical_language>reuse account created in accountserviceAT</technical_language>

Target:
public void shouldAddUserToWarehouse() { warehouseUser = service.addUserToWarehouse(warehouse, new WarehouseUser(WarehouseUser.ADMIN_ROLE, null, LOGIN)).get(60, TimeUnit.SECONDS); assertThat(warehouseUser, is(notNullValue())); }
Source:
<code>@Override public void onPositiveClicked(String instanceTag) { if (instanceTag != null) { <START> if (instanceTag == TAG_PUBLISH_CONFIRMATION_DIALOG) { <END> mPost.setStatus(PostStatus.PUBLISHED.toString()); publishPost(); } else if (instanceTag == TAG_REMOVE_FAILED_UPLOADS_DIALOG) { mEditorFragment.removeAllFailedMediaUploads(); } } }</code><technical_language>This block merge - consider adding else branch throw exception log error message -> follow fail ASAP principle. WDYT</technical_language>

Target:
@Override public void onPositiveClicked(String instanceTag) { if (instanceTag != null) { if (instanceTag == TAG_PUBLISH_CONFIRMATION_DIALOG) { mPost.setStatus(PostStatus.PUBLISHED.toString()); publishPost(); } else if (instanceTag == TAG_REMOVE_FAILED_UPLOADS_DIALOG) { mEditorFragment.removeAllFailedMediaUploads(); } } else { ToastUtils.showToast(EditPostActivity.this, getString(R.string.editor_toast_no_action_taken)); AppLog.e(T.EDITOR, "Dialog instanceTag is null - positive button clicked, but no action taken"); } }
Source:
<code>public CacheManager getCacheManager(URI uri, ClassLoader classLoader, Properties properties) { uri = uri == null ? getDefaultURI() : uri; classLoader = classLoader == null ? getDefaultClassLoader() : classLoader; properties = properties == null ? new Properties() : cloneProperties(properties); if (URI_DEFAULT.equals(uri)) { URI override = DefaultConfigurationResolver.resolveConfigURI(properties); if (override != null) { uri = override; } } Eh107CacheManager cacheManager; ConcurrentMap<URI, Eh107CacheManager> byURI; Configuration config; try { if (URI_DEFAULT.equals(uri)) { config = new DefaultConfiguration(classLoader); } else { config = new XmlConfiguration(uri.toURL(), classLoader); } } catch (Exception e) { throw new javax.cache.CacheException(e); } <START> synchronized (cacheManagers) { <END> byURI = cacheManagers.get(classLoader); if (byURI == null) { byURI = new ConcurrentHashMap<URI, Eh107CacheManager>(); cacheManagers.put(classLoader, byURI); } cacheManager = byURI.get(uri); if (cacheManager == null || cacheManager.isClosed()) { if(cacheManager != null) { byURI.remove(uri, cacheManager); } cacheManager = createCacheManager(config, uri, properties); byURI.put(uri, cacheManager); } } return cacheManager; }</code><technical_language>combined proposed changes allow this logic move method createCacheManager(URI, Configuration, Properties)</technical_language>

Target:
public CacheManager getCacheManager(URI uri, ClassLoader classLoader, Properties properties) { uri = uri == null ? getDefaultURI() : uri; classLoader = classLoader == null ? getDefaultClassLoader() : classLoader; properties = properties == null ? new Properties() : cloneProperties(properties); if (URI_DEFAULT.equals(uri)) { URI override = DefaultConfigurationResolver.resolveConfigURI(properties); if (override != null) { uri = override; } } Configuration config; try { if (URI_DEFAULT.equals(uri)) { config = new DefaultConfiguration(classLoader); } else { config = new XmlConfiguration(uri.toURL(), classLoader); } } catch (Exception e) { throw new javax.cache.CacheException(e); } return getCacheManager(uri, config, properties); }
Source:
<code>public Collection<Account> getAllAccounts() { <START> return Collections.unmodifiableCollection(accounts); <END> }</code><technical_language>missed this in iteration, - _this_ static class variable (the unmodifiable collection)</technical_language>

Target:
public Collection<Account> getAllAccounts() { return accounts; }
Source:
<code>public int getForgottenFileGracePeriodDays() { <START> return config.get(PRIAM_PRE + ".forgotten.file.grace.period", 1); <END> }</code><technical_language>This is opportunity stop bleeding for this naming standard. I suggest bean naming standards archaius uses</technical_language>

Target:
public int getForgottenFileGracePeriodDays() { return config.get(PRIAM_PRE + ".forgottenFileGracePeriodDays", 1); }
Source:
<code>public boolean isRequiredNetworkAffected(NetworkItemModel<?> op1, NetworkItemModel<?> op2) { final LogicalNetworkModel logicalNetworkModel = (LogicalNetworkModel) op1; return <START> logicalNetworkModel.getNetwork().getCluster() != null && <END> logicalNetworkModel.getNetwork() .getCluster() .isRequired(); }</code><technical_language>In case cluster null</technical_language>

Target:
public boolean isRequiredNetworkAffected(NetworkItemModel<?> op1, NetworkItemModel<?> op2) { final LogicalNetworkModel logicalNetworkModel = (LogicalNetworkModel) op1; return logicalNetworkModel.getNetwork().getCluster().isRequired(); }
Source:
<code>public Map<String, Object> calculateOutPutVariables(MappingExecutionContext mappingExecutionContext, Map<String, Object> availableVariables) { Extension extensions = processExtensionService.getExtensionsForId(mappingExecutionContext.getProcessDefinitionId()); if (!extensions.hasMapping(mappingExecutionContext.getActivityId())) { return emptyMap(); } <START> if (extensions.hasMappingTypeOutputs(mappingExecutionContext.getActivityId())) { <END> return (availableVariables != null ? new HashMap<>(availableVariables) : emptyMap()); } if (availableVariables != null && !availableVariables.isEmpty()) { if (expressionResolver.containsExpression(availableVariables)) { throw new ActivitiIllegalArgumentException("Expressions are not allowed as variable values in the output mapping"); } return calculateOutPutVariables(mappingExecutionContext, extensions, availableVariables); } else { return emptyMap(); } }</code><technical_language>In a similar way, rename shouldMapAllOutputs</technical_language>

Target:
public Map<String, Object> calculateOutPutVariables(MappingExecutionContext mappingExecutionContext, Map<String, Object> availableVariables) { Extension extensions = processExtensionService.getExtensionsForId(mappingExecutionContext.getProcessDefinitionId()); if (!extensions.hasMapping(mappingExecutionContext.getActivityId())) { return emptyMap(); } if (extensions.shouldMapAllOutputs(mappingExecutionContext.getActivityId())) { return (availableVariables != null ? new HashMap<>(availableVariables) : emptyMap()); } if (availableVariables != null && !availableVariables.isEmpty()) { if (expressionResolver.containsExpression(availableVariables)) { throw new ActivitiIllegalArgumentException("Expressions are not allowed as variable values in the output mapping"); } return calculateOutPutVariables(mappingExecutionContext, extensions, availableVariables); } else { return emptyMap(); } }
Source:
<code>public List<Project> getProjectsByRegex(String regexPattern) { List<Project> allProjects = new ArrayList<Project>(); Pattern pattern; try { pattern = Pattern.compile(regexPattern, Pattern.CASE_INSENSITIVE); } catch (PatternSyntaxException e) { logger.error("Bad regex pattern " + regexPattern); return allProjects; } List<Project> projects = getProjects(); <START> for (Project project : projects) { <END> if (pattern.matcher(project.getName()).find()) { allProjects.add(project); } } return allProjects; }</code><technical_language>do need introduce projects here? for (Project project : getProjects())</technical_language>

Target:
public List<Project> getProjectsByRegex(String regexPattern) { List<Project> allProjects = new ArrayList<Project>(); Pattern pattern; try { pattern = Pattern.compile(regexPattern, Pattern.CASE_INSENSITIVE); } catch (PatternSyntaxException e) { logger.error("Bad regex pattern " + regexPattern); return allProjects; } for (Project project : getProjects()) { if (pattern.matcher(project.getName()).find()) { allProjects.add(project); } } return allProjects; }
Source:
<code>public ContentInfo createContent(ContentInfo cinfo) { if (cinfo == null) { throw new IllegalArgumentException("cinfo is null"); } <START> if (cinfo.getId() == null || cinfo.getId().matches("\\A\\s*\\z")) { <END> throw new IllegalArgumentException("content is lacking an identifier: " + cinfo); } if (this.contentMap.containsKey(cinfo.getId())) { throw new IllegalStateException("content already exists: " + cinfo.getId()); } ContentData cdata = new ContentData(); cdata.setId(cinfo.getId()); cdata.setType(cinfo.getType()); cdata.setLabel(cinfo.getLabel()); cdata.setName(cinfo.getName()); cdata.setVendor(cinfo.getVendor()); cdata.setContentUrl(cinfo.getContentUrl()); cdata.setRequiredTags(cinfo.getRequiredTags()); cdata.setReleaseVersion(cinfo.getReleaseVersion()); cdata.setGpgUrl(cinfo.getGpgUrl()); cdata.setArches(cinfo.getArches()); cdata.setMetadataExpiration(cinfo.getMetadataExpiration()); cdata.setRequiredProductIds(cinfo.getRequiredProductIds()); cdata.setCreated(new Date()); cdata.setUpdated(new Date()); this.contentMap.put(cdata.getId(), cdata); this.contentProductMap.put(cdata.getId(), new HashSet<>()); return cdata; }</code><technical_language>StringUtils.isBlank</technical_language>

Target:
public ContentInfo createContent(ContentInfo cinfo) { if (cinfo == null) { throw new IllegalArgumentException("cinfo is null"); } if (StringUtils.isBlank(cinfo.getId())) { throw new IllegalArgumentException("content is lacking an identifier: " + cinfo); } if (this.contentMap.containsKey(cinfo.getId())) { throw new IllegalStateException("content already exists: " + cinfo.getId()); } ContentData cdata = new ContentData(); cdata.setId(cinfo.getId()); cdata.setType(cinfo.getType()); cdata.setLabel(cinfo.getLabel()); cdata.setName(cinfo.getName()); cdata.setVendor(cinfo.getVendor()); cdata.setContentUrl(cinfo.getContentUrl()); cdata.setRequiredTags(cinfo.getRequiredTags()); cdata.setReleaseVersion(cinfo.getReleaseVersion()); cdata.setGpgUrl(cinfo.getGpgUrl()); cdata.setArches(cinfo.getArches()); cdata.setMetadataExpiration(cinfo.getMetadataExpiration()); cdata.setRequiredProductIds(cinfo.getRequiredProductIds()); cdata.setCreated(new Date()); cdata.setUpdated(new Date()); this.contentMap.put(cdata.getId(), cdata); this.contentProductMap.put(cdata.getId(), new HashSet<>()); return cdata; }
Source:
<code>public void setUp() { <START> deviceHandler = new EventHandlerTest(); <END> passingHandler = new FilterHandler(); filtingHandler = new FilterHandler(); filtingHandler.setFilterInvalid(true); filtingHandler.setFilterZero(true); filtingHandler.setFilterDuplicate(true); filtingHandler.setFilterFuture(true); filtingHandler.setFilterApproximate(true); filtingHandler.setFilterStatic(true); filtingHandler.setFilterDistance(10); filtingHandler.setFilterLimit(10); }</code><technical_language>EventHandlerTest here? do filtering</technical_language>

Target:
public void setUp() { passingHandler = new FilterHandler(); filtingHandler = new FilterHandler(); filtingHandler.setFilterInvalid(true); filtingHandler.setFilterZero(true); filtingHandler.setFilterDuplicate(true); filtingHandler.setFilterFuture(true); filtingHandler.setFilterApproximate(true); filtingHandler.setFilterStatic(true); filtingHandler.setFilterDistance(10); filtingHandler.setFilterLimit(10); }
Source:
<code>private Collection<ValidationRule> getFailingRulesFromDiagramExtension(EObject objectToValidate, DiagramDescription diagDescExtension, Collection<Viewpoint> viewpoints) { Collection<ValidationRule> failingRules = viewpoints.stream().flatMap(vp -> vp.getOwnedRepresentationExtensions().stream()).filter(DiagramExtensionDescription.class::isInstance) .filter(ext -> ComponentizationHelper.match(diagDescExtension, ext)).map(ext -> ((DiagramExtensionDescription) ext).getValidationSet()).filter(Objects::nonNull) .flatMap(vs -> <START> getFaillingRulesFromCollection(objectToValidate, <END> vs.getAllRules().iterator()).stream()).collect(Collectors.toList()); return failingRules; }</code><technical_language>getFailingRulesFromCollection</technical_language>

Target:
private Collection<ValidationRule> getFailingRulesFromDiagramExtension(EObject objectToValidate, DiagramDescription diagDescExtension, Collection<Viewpoint> viewpoints) { Collection<ValidationRule> failingRules = viewpoints.stream().flatMap(vp -> vp.getOwnedRepresentationExtensions().stream()).filter(DiagramExtensionDescription.class::isInstance) .filter(ext -> ComponentizationHelper.match(diagDescExtension, ext)).map(ext -> ((DiagramExtensionDescription) ext).getValidationSet()).filter(Objects::nonNull) .flatMap(vs -> getFailingRulesFromCollection(objectToValidate, vs.getAllRules().iterator()).stream()).collect(Collectors.toList()); return failingRules; }
Source:
<code>private Assignment getOrcreateWrapperByValueCheckStrategy(Assignment assignment, boolean isUpdate) { if ( valueSetCheckStrategy == null ) { return createNullCheckWrapper( assignment, isUpdate ); } switch ( valueSetCheckStrategy ) { case IS_NULL_INLINE: return createNullCheckWrapper( assignment, isUpdate ); case CUSTOM: String hasMethod = this.getSourceHasMethod(); if ( hasMethod == null ) { <START> throw new IllegalArgumentException( sourceReference.getParameter().getName() <END> + " does not have 'hasX()' method." ); } return isUpdate ? new UpdateHasCheckWrapper( assignment, method.getThrownTypes(), hasMethod ) : new HasCheckWrapper( assignment, method.getThrownTypes(), hasMethod ); case IS_NULL: default: return assignment; } }</code><technical_language>throw exception AP environment. Instead create actual compilation errors gracefully handled processing infrastructure. errors linked line number of flawed mapping method. find examples in this class, e.g. so: ctx.getMessager().printMessage( method.getExecutable(), Message.SOME_KEY, targetPropertyName ); Instead of "hasX()", actual name of presence check method nice read: > custom source presence checking strategy, method 'boolean hasMyProperty()' found</technical_language>

Target:
private Assignment getOrcreateWrapperByValueCheckStrategy(Assignment assignment, boolean isUpdate) { if ( valueSetCheckStrategy == null ) { return createNullCheckWrapper( assignment, isUpdate ); } switch ( valueSetCheckStrategy ) { case IS_NULL: if (getSourceType().isPrimitive() ) { return assignment; } return createNullCheckWrapper( assignment, isUpdate ); case IS_NULL_INLINE: if (isUpdate || ( (assignment.getType().isTypeRelated() || assignment.getType().isDirect() ) && !getSourceType().isPrimitive() ) ) { return createNullCheckWrapper( assignment, isUpdate ); } return assignment; case CUSTOM: String presenceChecker = getPresenceChecker(); if ( presenceChecker == null ) { ctx.getMessager().printMessage( method.getExecutable(), Message.PROPERTYMAPPING_NO_PRESENCE_CHECKER_FOR_SOURCE_TYPE, getSourceElement() ); } return isUpdate ? new UpdatePresenceCheckWrapper( assignment, presenceChecker ) : new PresenceCheckWrapper( assignment, presenceChecker ); default: return assignment; } }
Source:
<code>private boolean isObjectColumnPresent(TableDefinition tableDefinition) { <START> for (Attribute attribute: tableDefinition.getAttributeList()) { if (attribute.getType() == Attribute.Type.OBJECT) { return true; } } return false; <END> }</code><technical_language>replace with: return tableDefinition.getAttributeList() .stream().anyMatch(attribute -> attribute.getType() == Attribute.Type.OBJECT);</technical_language>

Target:
private boolean isObjectColumnPresent(TableDefinition tableDefinition) { return tableDefinition.getAttributeList() .stream().anyMatch(attribute -> attribute.getType() == Attribute.Type.OBJECT); }
Source:
<code>public ListenableFuture<BufferSummary> getTaskSummary(TaskId taskId, OutputBufferId bufferId, long startingSequenceId, long maxBytes) { requireNonNull(taskId, "taskId is null"); requireNonNull(bufferId, "bufferId is null"); checkArgument(startingSequenceId >= 0, "startingSequenceId is negative"); <START> requireNonNull(maxBytes, "maxSize is null"); <END> return tasks.getUnchecked(taskId).getTaskSummary(bufferId, startingSequenceId, maxBytes); }</code><technical_language>typo maxSize</technical_language>

Target:
public ListenableFuture<BufferSummary> getTaskSummary(TaskId taskId, OutputBufferId bufferId, long startingSequenceId, long maxBytes) { requireNonNull(taskId, "taskId is null"); requireNonNull(bufferId, "bufferId is null"); checkArgument(startingSequenceId >= 0, "startingSequenceId is negative"); checkArgument(maxBytes > 0, "maxBytes should be at least 1"); return tasks.getUnchecked(taskId).getTaskSummary(bufferId, startingSequenceId, maxBytes); }
Source:
<code>public void assertTenantOrParentTenant(TenantAware tenantAware) { if (tenantAware == null) { return; } <START> <END> if (!Objects.equals(tenantAware.getTenantAsString(), getCurrentTenant().map(Tenant::getIdAsString).orElse(null)) && !Objects.equals(tenantAware.getTenantAsString(), getCurrentTenant().map(Tenant::getParent) .map(SQLEntityRef::getId) .map(Value::of) .map(Value::getString) .orElse(null))) { throw Exceptions.createHandled().withNLSKey("BizController.invalidTenant").handle(); } }</code><technical_language>/ getTenantAsString return uniqueName instead? in TenantUserManager</technical_language>

Target:
public void assertTenantOrParentTenant(TenantAware tenantAware) { if (tenantAware == null) { return; } if (!Objects.equals(tenantAware.getTenantAsString(), getCurrentTenant().map(Tenant::getIdAsString).orElse(null)) && !Objects.equals(tenantAware.getTenantAsString(), getCurrentTenant().map(Tenant::getParent) .filter(SQLEntityRef::isFilled) .map(SQLEntityRef::getId) .map(String::valueOf) .orElse(null))) { throw Exceptions.createHandled().withNLSKey("BizController.invalidTenant").handle(); } }
Source:
<code>public static Value haversin( AnyValue in ) { if ( in == NO_VALUE ) { return NO_VALUE; } else if ( in instanceof NumberValue ) { return doubleValue( (1.0 - Math.cos( ((NumberValue) in).doubleValue() )) / 2 ); } else { <START> throw new CypherTypeException( "asin requires numbers", null ); <END> } }</code><technical_language>..although disappointed in error message mess types</technical_language>

Target:
public static Value haversin( AnyValue in ) { if ( in == NO_VALUE ) { return NO_VALUE; } else if ( in instanceof NumberValue ) { return doubleValue( (1.0 - Math.cos( ((NumberValue) in).doubleValue() )) / 2 ); } else { throw needsNumbers( "haversin()" ); } }
Source:
<code>public V3Server(DELEGATE delegate) { if (delegate == null) { throw new NullPointerException("The delegate of a V3 server can't be null"); <START> } <END> this.delegate = delegate; }</code><technical_language>I if more elegant Objects.requireNonNull(delegate) do trick</technical_language>

Target:
public V3Server(DELEGATE delegate) { Objects.requireNonNull(delegate, "The delegate of a V3 server can't be null"); this.delegate = delegate; }
Source:
<code>public void shouldCreateMapWithAllValues() { final var yesterday = ZonedDateTime.now().minusDays(1); final var tomorrow = ZonedDateTime.now().plusDays(1); var params = aDirectDebitSearchMandatesParams() .withBankStatementReference("a bank statement reference") .withDisplaySize(10) .withEmail("test@test.test") .withFromDate(yesterday) .withToDate(tomorrow) .withName("test") .withPage(1) .withReference("a reference") .withState("pending") .build(); var paramsAsMap = params.paramsAsMap(); assertThat(paramsAsMap, IsMapContaining.hasEntry("bank_statement_reference", "a bank statement reference")); assertThat(paramsAsMap, IsMapContaining.hasEntry("display_size", String.valueOf(10))); assertThat(paramsAsMap, IsMapContaining.hasEntry("email", "test@test.test")); assertThat(paramsAsMap, IsMapContaining.hasEntry("from_date", yesterday.toString())); assertThat(paramsAsMap, IsMapContaining.hasEntry("to_date", tomorrow.toString())); assertThat(paramsAsMap, IsMapContaining.hasEntry("name", "test")); assertThat(paramsAsMap, IsMapContaining.hasEntry("page", String.valueOf(1))); assertThat(paramsAsMap, IsMapContaining.hasEntry("reference", "a reference")); assertThat(paramsAsMap, IsMapContaining.hasEntry("state", "pending")); <START> assertThat(paramsAsMap, IsMapContaining.hasEntry("reference", "a reference")); <END> }</code><technical_language>static import IsMapContaining.hasEntry</technical_language>

Target:
public void shouldCreateMapWithAllValues() { final var yesterday = ZonedDateTime.now().minusDays(1); final var tomorrow = ZonedDateTime.now().plusDays(1); var params = aDirectDebitSearchMandatesParams() .withBankStatementReference("a bank statement reference") .withDisplaySize(10) .withEmail("test@test.test") .withFromDate(yesterday) .withToDate(tomorrow) .withName("test") .withPage(1) .withReference("a reference") .withState("pending") .build(); var paramsAsMap = params.paramsAsMap(); assertThat(paramsAsMap, hasEntry("bank_statement_reference", "a bank statement reference")); assertThat(paramsAsMap, hasEntry("display_size", String.valueOf(10))); assertThat(paramsAsMap, hasEntry("email", "test@test.test")); assertThat(paramsAsMap, hasEntry("from_date", yesterday.toString())); assertThat(paramsAsMap, hasEntry("to_date", tomorrow.toString())); assertThat(paramsAsMap, hasEntry("name", "test")); assertThat(paramsAsMap, hasEntry("page", String.valueOf(1))); assertThat(paramsAsMap, hasEntry("reference", "a reference")); assertThat(paramsAsMap, hasEntry("state", "pending")); assertThat(paramsAsMap, hasEntry("reference", "a reference")); }
Source:
<code>private void forceHttpServiceLoading ( BundleContext context ) throws Exception { try { if ( System.getProperty(WebKeys.OSGI_ENABLED)!=null ) { <START> if (null == OSGIProxyServlet.bundleContext) { <END> initProxyServlet(context); } else { try { OSGIProxyServlet.bundleContext.getBundle(); } catch (IllegalStateException e) { initProxyServlet(context); } } } } catch ( Exception e ) { Logger.error( this, "Error loading HttpService.", e ); throw e; } }</code><technical_language>I this sync in order thread-safe</technical_language>

Target:
private void forceHttpServiceLoading ( BundleContext context ) throws Exception { try { if ( System.getProperty(WebKeys.OSGI_ENABLED)!=null ) { if (null == OSGIProxyServlet.bundleContext) { synchronized (this) { if (null == OSGIProxyServlet.bundleContext) { initProxyServlet(context); } } } else { try { OSGIProxyServlet.bundleContext.getBundle(); } catch (IllegalStateException e) { initProxyServlet(context); } } } } catch ( Exception e ) { Logger.error( this, "Error loading HttpService.", e ); throw e; } }
Source:
<code>private boolean checkIsValid() { if (isRequired()) { setValidationState(ValidationState.INVALID_BY_REQUIRED_WITHOUT_VALUE); } else { setValidationState(ValidationState.VALID); } <START> return !isRequired(); <END> }</code><technical_language>This is a bit strange, I prefer like: if (isRequired()) { setValidationState(ValidationState.INVALID_BY_REQUIRED_WITHOUT_VALUE); return false; } else { setValidationState(ValidationState.VALID); return true; } do think</technical_language>

Target:
private boolean checkIsValid() { if (isRequired()) { setValidationState(ValidationState.INVALID_BY_REQUIRED_WITHOUT_VALUE); return false; } else { setValidationState(ValidationState.VALID); return true; } }
Source:
<code>public static void assertOperatorIsUnblocked(Operator operator, Duration timeout) { try { operator.isBlocked().get(timeout.toMillis(), TimeUnit.MILLISECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException("interrupted", e); } catch (ExecutionException e) { <START> throw new RuntimeException(e.getCause()); <END> } catch (TimeoutException ignored) { fail("Operator is expected to be unblocked within " + timeout.toString()); } }</code><technical_language>extract private method boolean waitForOperator(Operator operator, Duration timeout): try { operator.isBlocked().get(timeout.toMillis(), TimeUnit.MILLISECONDS); return true; } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException("interrupted", e); } catch (ExecutionException e) { throw new RuntimeException(e.getCause()); } catch (TimeoutException expected) { return false; } build assertions this method</technical_language>

Target:
public static void assertOperatorIsUnblocked(Operator operator, Duration timeout) { if (!waitForOperatorToUnblock(operator, timeout)) { fail("Operator is expected to be unblocked within " + timeout.toString()); } }
Source:
<code>public final Object invoke(Object object, Object[] arguments) { try { AccessPermissionChecker.checkAccessPermission(cachedMethod); } catch (AccessControlException ex) { <START> throw new InvokerInvocationException(new IllegalArgumentException("Illegal access to method" + cachedMethod.getName())); <END> } try { return cachedMethod.invoke(object, arguments); } catch (IllegalArgumentException e) { throw new InvokerInvocationException(e); } catch (IllegalAccessException e) { throw new InvokerInvocationException(e); } catch (InvocationTargetException e) { Throwable cause = e.getCause(); throw (cause instanceof RuntimeException && !(cause instanceof MissingMethodException)) ? (RuntimeException) cause : new InvokerInvocationException(e); } }</code><technical_language>Throwing IllegalArgumentException confusing arguments passed invoked method causing problem. throw new InvokerInvocationException(ex) throw new InvokerInvocationException( new AccessControlException("Illegal access method" + cachedMethod.getName(), ex) )</technical_language>

Target:
public final Object invoke(Object object, Object[] arguments) { try { AccessPermissionChecker.checkAccessPermission(cachedMethod); } catch (CacheAccessControlException ex) { throw new InvokerInvocationException(ex); } try { return cachedMethod.invoke(object, arguments); } catch (IllegalArgumentException e) { throw new InvokerInvocationException(e); } catch (IllegalAccessException e) { throw new InvokerInvocationException(e); } catch (InvocationTargetException e) { Throwable cause = e.getCause(); throw (cause instanceof RuntimeException && !(cause instanceof MissingMethodException)) ? (RuntimeException) cause : new InvokerInvocationException(e); } }
Source:
<code>void close() { webSocketConnection.getWebSocketListener().onOpen(webSocket); requiresCloseAction(); webSocketConnection.close(); verify(webSocket) <START> .sendClose(WebSocket.NORMAL_CLOSURE, WebSocketConnection.CLIENT_DISCONNECT_MESSAGE); <END> assertThat(webSocketConnection.getPingSender().isRunning(), is(false)); }</code><technical_language>matter disconnect message is, it? do need assert a specific message</technical_language>

Target:
void close() { webSocketConnection.getInternalListener().onOpen(webSocket); when(webSocket.sendClose(anyInt(), any())) .thenReturn(CompletableFuture.completedFuture(null)); webSocketConnection.close(); verify(webSocket).sendClose(eq(WebSocket.NORMAL_CLOSURE), any()); assertThat(webSocketConnection.getPingSender().isRunning(), is(false)); }
Source:
<code>protected void executeCommand() { <START> if (maxServerFound() && StringUtils.isEmpty(getCluster().getCpuName())) { <END> updateClusterCpuName(getMaxServerCpu().getCpuName(), getMaxServerCpu().getArchitecture()); } if (maxServerFound() && !architecturesMatch() ) { addCustomValue("VdsArchitecture", getMaxServerCpu().getArchitecture().name()); addCustomValue("ClusterArchitecture", getCluster().getArchitecture().name()); SetNonOperationalVdsParameters params = new SetNonOperationalVdsParameters(getVdsId(), NonOperationalReason.ARCHITECTURE_INCOMPATIBLE_WITH_CLUSTER); runInternalAction(ActionType.SetNonOperationalVds, params, ExecutionHandler.createInternalJobContext(getContext())); } else { List<String> missingFlags = getCpuFlagsManagerHandler().missingServerCpuFlags( getCluster().getCpuName(), getVds().getCpuFlags(), getCluster().getCompatibilityVersion()); if (!cpuFlagsMatch(missingFlags)) { if (missingFlags != null) { addCustomValue("CpuFlags", StringUtils.join(missingFlags, ", ")); if (missingFlags.contains("nx")) { auditLogDirector.log(this, AuditLogType.CPU_FLAGS_NX_IS_MISSING); } } SetNonOperationalVdsParameters params = new SetNonOperationalVdsParameters(getVdsId(), NonOperationalReason.CPU_TYPE_INCOMPATIBLE_WITH_CLUSTER); runInternalAction(ActionType.SetNonOperationalVds, params, ExecutionHandler.createInternalJobContext(getContext())); } else { setCommandShouldBeLogged(false); } } setSucceeded(true); }</code><technical_language>Previously, cluster CPU name updated if cluster CPU architecture is ArchitectureType.undefined</technical_language>

Target:
protected void executeCommand() { updateClusterCpuName(getMaxServerCpu().getCpuName(), getMaxServerCpu().getArchitecture()); if (maxServerFound() && !architecturesMatch() ) { addCustomValue("VdsArchitecture", getMaxServerCpu().getArchitecture().name()); addCustomValue("ClusterArchitecture", getCluster().getArchitecture().name()); SetNonOperationalVdsParameters params = new SetNonOperationalVdsParameters(getVdsId(), NonOperationalReason.ARCHITECTURE_INCOMPATIBLE_WITH_CLUSTER); runInternalAction(ActionType.SetNonOperationalVds, params, ExecutionHandler.createInternalJobContext(getContext())); } else { List<String> missingFlags = getCpuFlagsManagerHandler().missingServerCpuFlags( getCluster().getCpuName(), getVds().getCpuFlags(), getCluster().getCompatibilityVersion()); if (vdsContainsFlags() && !cpuFlagsMatch(missingFlags)) { if (missingFlags != null) { addCustomValue("CpuFlags", StringUtils.join(missingFlags, ", ")); if (missingFlags.contains("nx")) { auditLogDirector.log(this, AuditLogType.CPU_FLAGS_NX_IS_MISSING); } } SetNonOperationalVdsParameters params = new SetNonOperationalVdsParameters(getVdsId(), NonOperationalReason.CPU_TYPE_INCOMPATIBLE_WITH_CLUSTER); runInternalAction(ActionType.SetNonOperationalVds, params, ExecutionHandler.createInternalJobContext(getContext())); } else { setCommandShouldBeLogged(false); } } setSucceeded(true); }
Source:
<code>protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { resp.setContentType(MediaType.APPLICATION_JSON); resp.setCharacterEncoding(StandardCharsets.UTF_8.name()); List<AssetFilter> filters = new ArrayList<>(); filters.add(new AssetFilter("state", Arrays.asList(new Condition[] { new Condition(Operation.EQUALS, "published") }))); int assetCount = serviceLayer.countAllAssets(filters, null); JsonObjectBuilder frontPageJsonBuilder = getJsonObjectBuilder(); frontPageJsonBuilder.add("serverName", "LARS"); frontPageJsonBuilder.add("assetCount", assetCount); JsonObject frontPageJsonObject = frontPageJsonBuilder.build(); PrintWriter out = resp.getWriter(); <START> out.print(frontPageJsonObject); <END> }</code><technical_language>more sense a JsonWriter relying PrintWriter JsonObject.toString() result</technical_language>

Target:
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { resp.setContentType(MediaType.APPLICATION_JSON); resp.setCharacterEncoding(StandardCharsets.UTF_8.name()); PrintWriter printWriter = resp.getWriter(); List<AssetFilter> filters = new ArrayList<>(); filters.add(new AssetFilter("state", Arrays.asList(new Condition[] { new Condition(Operation.EQUALS, "published") }))); int assetCount = serviceLayer.countAllAssets(filters, null); JsonGenerator frontPageJsonGenerator = new JsonFactory().createGenerator(printWriter); frontPageJsonGenerator.setPrettyPrinter(new DefaultPrettyPrinter()); frontPageJsonGenerator.writeStartObject(); frontPageJsonGenerator.writeStringField("serverName", "LARS"); frontPageJsonGenerator.writeNumberField("assetCount", assetCount); frontPageJsonGenerator.writeEndObject(); frontPageJsonGenerator.flush(); frontPageJsonGenerator.close(); }
Source:
<code>public StartIdentifiedAtlasDbTransactionResponse startIdentifiedAtlasDbTransaction() { LockImmutableTimestampResponse immutableTimestamp = lockImmutableTimestamp(); try { return StartIdentifiedAtlasDbTransactionResponse.of( immutableTimestamp, TimestampAndPartition.of(getFreshTimestamp(), 0)); <START> } catch (Throwable throwable) { <END> unlock(ImmutableSet.of(immutableTimestamp.getLock())); throw Throwables.throwUncheckedException(throwable); } }</code><technical_language>suggestion } catch (RuntimeException | Error e) {</technical_language>

Target:
public StartIdentifiedAtlasDbTransactionResponse startIdentifiedAtlasDbTransaction() { LockImmutableTimestampResponse immutableTimestamp = lockImmutableTimestamp(); try { return StartIdentifiedAtlasDbTransactionResponse.of( immutableTimestamp, TimestampAndPartition.of(getFreshTimestamp(), 0)); } catch (RuntimeException | Error throwable) { try { unlock(ImmutableSet.of(immutableTimestamp.getLock())); } catch (Throwable unlockThrowable) { throwable.addSuppressed(unlockThrowable); } throw throwable; } }
Source:
<code>public EventResult onDamage(DamageEvent event, EntityRef entity) { if (event.getDamage() <= 0) { return EventResult.CONTINUE; } if (entity.getComponent(Health.class).isPresent()) { Health health = entity.getComponent(Health.class).get(); int newHealthAmount = health.currentHealth - event.getDamage(); if (newHealthAmount < 0) { newHealthAmount = 0; } health.currentHealth = newHealthAmount; entity.setComponent(health); <START> if (health.currentHealth <= 0) { <END> entitySystemManager.sendEvent(new DestroyEvent(), entity); } } return EventResult.CONTINUE; }</code><technical_language>This block simplified, no? effectively checking for negative health now</technical_language>

Target:
public EventResult onDamage(DamageEvent event, EntityRef entity) { if (event.getDamage() <= 0) { return EventResult.CONTINUE; } if (entity.getComponent(Health.class).isPresent()) { Health health = entity.getComponent(Health.class).get(); health.currentHealth -= event.getDamage(); if (health.currentHealth <= 0) { health.currentHealth = 0; entity.setComponent(health); entitySystemManager.sendEvent(new ZeroHealthEvent(), entity); } else { entity.setComponent(health); } } return EventResult.CONTINUE; }
Source:
<code>public void testClearBlockCacheFromAsyncAdmin() throws Exception { AsyncConnection conn = ConnectionFactory.createAsyncConnection(HTU.getConfiguration()).get(); <START> AsyncAdmin admin = conn.getAdmin(); <END> BlockCache blockCache1 = rs1.getBlockCache().get(); BlockCache blockCache2 = rs2.getBlockCache().get(); long initialBlockCount1 = blockCache1.getBlockCount(); long initialBlockCount2 = blockCache2.getBlockCount(); scanAllRegionsForRS(rs1); assertEquals(blockCache1.getBlockCount() - initialBlockCount1, HTU.getNumHFilesForRS(rs1, TABLE_NAME, FAMILY)); scanAllRegionsForRS(rs2); assertEquals(blockCache2.getBlockCount() - initialBlockCount2, HTU.getNumHFilesForRS(rs2, TABLE_NAME, FAMILY)); CacheEvictionStats stats = admin.clearBlockCache(TABLE_NAME).get(); assertEquals(stats.getEvictedBlocks(), HTU.getNumHFilesForRS(rs1, TABLE_NAME, FAMILY) + HTU .getNumHFilesForRS(rs2, TABLE_NAME, FAMILY)); assertEquals(initialBlockCount1, blockCache1.getBlockCount()); assertEquals(initialBlockCount2, blockCache2.getBlockCount()); conn.close(); }</code><technical_language>this a try-with-resources too</technical_language>

Target:
public void testClearBlockCacheFromAsyncAdmin() throws Exception { try (AsyncConnection conn = ConnectionFactory.createAsyncConnection(HTU.getConfiguration()) .get()) { AsyncAdmin admin = conn.getAdmin(); BlockCache blockCache1 = rs1.getBlockCache().get(); BlockCache blockCache2 = rs2.getBlockCache().get(); long initialBlockCount1 = blockCache1.getBlockCount(); long initialBlockCount2 = blockCache2.getBlockCount(); scanAllRegionsForRS(rs1); assertEquals(blockCache1.getBlockCount() - initialBlockCount1, HTU.getNumHFilesForRS(rs1, TABLE_NAME, FAMILY)); scanAllRegionsForRS(rs2); assertEquals(blockCache2.getBlockCount() - initialBlockCount2, HTU.getNumHFilesForRS(rs2, TABLE_NAME, FAMILY)); CacheEvictionStats stats = admin.clearBlockCache(TABLE_NAME).get(); assertEquals(stats.getEvictedBlocks(), HTU.getNumHFilesForRS(rs1, TABLE_NAME, FAMILY) + HTU .getNumHFilesForRS(rs2, TABLE_NAME, FAMILY)); assertEquals(initialBlockCount1, blockCache1.getBlockCount()); assertEquals(initialBlockCount2, blockCache2.getBlockCount()); } }
Source:
<code>public BigtableSession(BigtableOptions options) throws IOException { <START> this (options, null); <END> }</code><technical_language>I personally prefer call overloaded constructor. example: public BigtableSession(BigtableOptions options) throws IOException { this(options, null, null, null); }</technical_language>

Target:
public BigtableSession(BigtableOptions options) throws IOException { this (options, null, null, null); }
Source:
<code>private static AllergyIntolerance.AllergyIntoleranceCriticality buildCriticality(Allergy allergy) { if (allergy.getSeverity() != null) { if (allergy.getSeverity().equals(AllergySeverity.MILD)) { return AllergyIntolerance.AllergyIntoleranceCriticality.LOW; } else if (allergy.getSeverity().equals(AllergySeverity.MODERATE)) { return AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS; } else if (allergy.getSeverity().equals(AllergySeverity.SEVERE)) { return AllergyIntolerance.AllergyIntoleranceCriticality.HIGH; } else { return AllergyIntolerance.AllergyIntoleranceCriticality.NULL; } } <START> return null; <END> }</code><technical_language>i switch case convention, please stick alse</technical_language>

Target:
private static AllergyIntolerance.AllergyIntoleranceCriticality buildCriticality(Allergy allergy) { if (allergy.getSeverity() != null) { switch (allergy.getSeverity()) { case MILD: return AllergyIntolerance.AllergyIntoleranceCriticality.LOW; case MODERATE: return AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS; case SEVERE: return AllergyIntolerance.AllergyIntoleranceCriticality.HIGH; default: return AllergyIntolerance.AllergyIntoleranceCriticality.NULL; } } return null; }
Source:
<code>public int hashCode() { <START> final int prime = 31; int result = 1; result = prime * result + ((scope == null) ? 0 : scope.hashCode()); result = prime * result + ((doneAt == null) ? 0 : doneAt.hashCode()); return result; } <END></code><technical_language>use: return Objects.hashCode(scope, doneAt);</technical_language>

Target:
public int hashCode() { return Objects.hash(scope, doneAt); }
Source:
<code>public Long getUuid() { <START> return new Long(456); <END> }</code><technical_language>456L</technical_language>

Target:
public Long getUuid() { return Long.valueOf(456); }
Source:
<code>public List<Tuple> getTuples() { <START> ArrayList<Tuple> tuples = new ArrayList<Tuple>(); <END> if ( rows.size() > 0 ) { for ( Row row : rows ) { tuples.add( new Tuple( new CouchDBTupleSnapshot( row.getValue().getProperties() ) ) ); } } return tuples; }</code><technical_language>I List<Tuple></technical_language>

Target:
public List<Tuple> getTuples() { List<Tuple> tuples = new ArrayList<Tuple>( rows.size() ); if ( rows.size() > 0 ) { for ( Row row : rows ) { tuples.add( new Tuple( new CouchDBTupleSnapshot( row.getValue().getProperties() ) ) ); } } return tuples; }
Source:
<code>String generateNewAnonID() { String uuid = UUID.randomUUID().toString(); <START> String[] uuidSplitted = uuid.split("-"); <END> StringBuilder builder = new StringBuilder(); for (String currentPart : uuidSplitted) { builder.append(currentPart); } uuid = builder.toString(); AppLog.d(AppLog.T.STATS, "New anonID generated in " + this.getClass().getSimpleName() + ": " + uuid); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(mContext); final SharedPreferences.Editor editor = preferences.edit(); editor.putString(getAnonIdPrefKey(), uuid); editor.commit(); mAnonID = uuid; return uuid; }</code><technical_language>simpler String uuid = UUID.randomUUID().toString().replace("-", "")</technical_language>

Target:
String generateNewAnonID() { String uuid = UUID.randomUUID().toString().replace("-", ""); AppLog.d(AppLog.T.STATS, "New anonID generated in " + this.getClass().getSimpleName() + ": " + uuid); SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(mContext); final SharedPreferences.Editor editor = preferences.edit(); editor.putString(getAnonIdPrefKey(), uuid); editor.commit(); mAnonID = uuid; return uuid; }
Source:
<code>public JoypadHandler(int index) { controller = Controllers.getController(index); buttonCount = controller.getButtonCount(); axisCount = controller.getAxisCount(); itemCount = controller.getButtonCount() + controller.getAxisCount() + 2; <START> for (int i=0;i<controller.getButtonCount();i++) { <END> addButton(new Button(controller.getButtonName(i), controller, i)); } for (int i=buttonCount;i<buttonCount+controller.getAxisCount();i++) { addAxis(new Axis(controller.getAxisName(i-buttonCount), controller, i)); } int i = itemCount - 2; addAxis(new Axis("POV X", controller, i)); i = itemCount - 1; addAxis(new Axis("POV Y", controller, i)); }</code><technical_language>set a variable called buttonCount...might it</technical_language>

Target:
public JoypadHandler(int index) { controller = Controllers.getController(index); buttonCount = controller.getButtonCount(); buttons = new Button[buttonCount]; axisCount = controller.getAxisCount(); axes = new Axis[axisCount + 2]; itemCount = controller.getButtonCount() + controller.getAxisCount() + 2; for (int i=0;i<buttonCount;i++) { buttons[i] = new Button(controller.getButtonName(i), controller, i); } for (int i=0;i<axisCount;i++) { axes[i] = new Axis(controller.getAxisName(i), controller, i + buttonCount); } axes[axisCount] = new Axis("POV X", controller, axisCount + buttonCount); axes[axisCount+1] = new Axis("POV Y", controller, axisCount + 1 + buttonCount); }
Source:
<code>private void loadPage(String data) { mWebViewOnUiThread.loadDataWithBaseURLAndWaitForCompletion( BASE_URI, data, "text/html", <START> "UTF-8", null); <END> }</code><technical_language>encoding null</technical_language>

Target:
private void loadPage(String data) { mWebViewOnUiThread.loadDataWithBaseURLAndWaitForCompletion( BASE_URI, data, "text/html", null, null); }
Source:
<code>public void testClusterCacheTest() { waitForClusterToForm(); ConfigurationBuilder builder = new ConfigurationBuilder(); builder.clustering().cacheMode(CacheMode.DIST_SYNC); Configuration configuration = builder.build(); Cache<Object, Object> cache = manager(0).administration().createCache("a", configuration); waitForClusterToForm("a"); assertEquals(cacheManagers.size(), cache.getAdvancedCache().getRpcManager().getMembers().size()); checkConsistencyAcrossCluster("a", configuration); addClusterEnabledCacheManager(); checkConsistencyAcrossCluster("a", configuration); <START> try { <END> manager(0).administration().createCache("b", "nonExistingTemplate"); fail("Should not succed in creating a cache with a non-existing template"); } catch (CacheConfigurationException e) { } try { manager(0).administration().createCache("a", configuration); fail("Should not have allowed creation of existing cache"); } catch (CacheConfigurationException e) { } manager(0).administration().getOrCreateCache("a", configuration); manager(1).administration().removeCache("a"); checkCacheExistenceAcrossCluster("a", false); addClusterEnabledCacheManager(); checkCacheExistenceAcrossCluster("a", false); }</code><technical_language>suggestion: Exceptions.expectException(CacheConfigurationException.class, "Should succeed in creating a cache a non-existing template", () -> manager(0).administration().createCache("b", "nonExistingTemplate")); also, is a typo in fail() message (succeed)</technical_language>

Target:
public void testClusterCacheTest() { waitForClusterToForm(); ConfigurationBuilder builder = new ConfigurationBuilder(); builder.clustering().cacheMode(CacheMode.DIST_SYNC); Configuration configuration = builder.build(); Cache<Object, Object> cache = manager(0).administration().createCache("a", configuration); waitForClusterToForm("a"); assertEquals(cacheManagers.size(), cache.getAdvancedCache().getRpcManager().getMembers().size()); checkConsistencyAcrossCluster("a", configuration); addClusterEnabledCacheManager(); checkConsistencyAcrossCluster("a", configuration); Exceptions.expectException(CacheConfigurationException.class, "ISPN000374: No such template 'b' when declaring 'nonExistingTemplate'", () -> manager(0).administration().createCache("b", "nonExistingTemplate")); Exceptions.expectException(CacheConfigurationException.class, "ISPN000507: Cache a already exists", () -> manager(0).administration().createCache("a", configuration)); manager(0).administration().getOrCreateCache("a", configuration); manager(1).administration().removeCache("a"); checkCacheExistenceAcrossCluster("a", false); addClusterEnabledCacheManager(); checkCacheExistenceAcrossCluster("a", false); }
Source:
<code><START> protected <K> LocalStreamManager<K> waitUntilSendingResponse(final Cache<?, ?> cache, final CheckPoint checkPoint) { <END> return Mocks.blockingMock(checkPoint, LocalStreamManager.class, cache, (stub, m) -> stub.when(m).startIterator(any(), any(), any(), any(), any(), anyBoolean(), any(), anyLong())); }</code><technical_language>void</technical_language>

Target:
protected <K> void waitUntilSendingResponse(final Cache<?, ?> cache, final CheckPoint checkPoint) { Mocks.blockingMock(checkPoint, LocalStreamManager.class, cache, (stub, m) -> stub.when(m).startIterator(any(), any(), any(), any(), any(), anyBoolean(), any(), anyLong())); }