auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void setUp() throws Exception { if (loadedBindings == null) { IEclipseContext globalContext = Activator.getDefault().getGlobalContext(); workbenchContext = globalContext.createChild("workbenchContext"); loadedBindings = new ArrayList<Binding>(); contextManager = new ContextManager(); ContextSet.setComparator(new ContextSet.CComp(contextManager)); for (int i = 0; i < CONTEXTS.length; i += 3) { Context context = contextManager.getContext(CONTEXTS[i]); context.define(CONTEXTS[i + 1], null, CONTEXTS[i + 2]); } commandManager = new CommandManager(); Category category = commandManager.getCategory("bogus"); category.define("Bogus", null); for (int i = 0; i < COMMANDS.length; i += 2) { Command cmd = commandManager.getCommand(COMMANDS[i]); cmd.define(COMMANDS[i + 1], null, category); } for (int i = 0; i < BINDINGS.length; i += 3) { KeySequence seq = KeySequence.getInstance(BINDINGS[i + 1]); Command cmd = commandManager.getCommand(BINDINGS[i]); loadedBindings.add(new KeyBinding(seq, new ParameterizedCommand(cmd, null), "org.eclipse.ui.defaultAcceleratorConfiguration", BINDINGS[i + 2], null, null, null, Binding.SYSTEM)); } } <START> System.out.println("Made setup"); <END> }</code><technical_language>Please do add unnecessary syso statements</technical_language>

Target:
protected void setUp() throws Exception { if (loadedBindings == null) { IEclipseContext globalContext = Activator.getDefault().getGlobalContext(); workbenchContext = globalContext.createChild("workbenchContext"); loadedBindings = new ArrayList<Binding>(); contextManager = new ContextManager(); ContextSet.setComparator(new ContextSet.CComp(contextManager)); for (int i = 0; i < CONTEXTS.length; i += 3) { Context context = contextManager.getContext(CONTEXTS[i]); context.define(CONTEXTS[i + 1], null, CONTEXTS[i + 2]); } commandManager = new CommandManager(); Category category = commandManager.getCategory("bogus"); category.define("Bogus", null); for (int i = 0; i < COMMANDS.length; i += 2) { Command cmd = commandManager.getCommand(COMMANDS[i]); cmd.define(COMMANDS[i + 1], null, category); } for (int i = 0; i < BINDINGS.length; i += 3) { KeySequence seq = KeySequence.getInstance(BINDINGS[i + 1]); Command cmd = commandManager.getCommand(BINDINGS[i]); loadedBindings.add(new KeyBinding(seq, new ParameterizedCommand(cmd, null), "org.eclipse.ui.defaultAcceleratorConfiguration", BINDINGS[i + 2], null, null, null, Binding.SYSTEM)); } } }
Source:
<code>public int hashCode() { return Objects.hash( groups.getData(), <START> groups.getMetadata().orElse(null), <END> userRegex.map(Pattern::pattern), userRegex.map(Pattern::flags), sourceRegex.map(Pattern::pattern), sourceRegex.map(Pattern::flags)); }</code><technical_language>Is .orElse(null) necessary</technical_language>

Target:
public int hashCode() { return Objects.hash( group, queryType, userRegex.map(Pattern::pattern), userRegex.map(Pattern::flags), sourceRegex.map(Pattern::pattern), sourceRegex.map(Pattern::flags)); }
Source:
<code>public static ConnectionType get(int id) { <START> return lookupTable.get(id); <END> }</code><technical_language>If returning UNKNOWN if ID is in table, entry</technical_language>

Target:
public static ConnectionType get(int id) { ConnectionType connectionType = lookupTable.get(id); if (connectionType != null) return connectionType; return UNKNOWN; }
Source:
<code>public TestMethodWorker(IInvoker invoker, IMethodInstance[] testMethods, XmlSuite suite, Map<String, String> parameters, ConfigurationGroupMethods groupMethods, ClassMethodMap classMethodMap, ITestContext testContext, List<IClassListener> listeners) { m_invoker = invoker; m_suite = suite; m_parameters = parameters; m_groupMethods = groupMethods; m_classMethodMap = classMethodMap; m_testContext = testContext; m_listeners = listeners; <START> List<IMethodInstance> localMethodInstances = Lists.newArrayList(testMethods); <END> Collections.sort(localMethodInstances, new Comparator<IMethodInstance>() { @Override public int compare(IMethodInstance o1, IMethodInstance o2) { Integer i1 = o1.getMethod().getPriority(); Integer i2 = o2.getMethod().getPriority(); return i1.compareTo(i2); } }); m_methodInstances = localMethodInstances.toArray(new IMethodInstance[localMethodInstances.size()]); }</code><technical_language>order is supposed managed graph add edges. opposite, remove other locations ordering is done: <LINK_0></technical_language>

Target:
public TestMethodWorker(IInvoker invoker, IMethodInstance[] testMethods, XmlSuite suite, Map<String, String> parameters, ConfigurationGroupMethods groupMethods, ClassMethodMap classMethodMap, ITestContext testContext, List<IClassListener> listeners) { m_invoker = invoker; m_methodInstances = testMethods; m_suite = suite; m_parameters = parameters; m_groupMethods = groupMethods; m_classMethodMap = classMethodMap; m_testContext = testContext; m_listeners = listeners; }
Source:
<code>public void setUp() { registerService(volatileStorageService); managedThingProvider = getService(ThingProvider.class, ManagedThingProvider.class); <START> assertNotNull("Could not get ManagedThingProvider", managedThingProvider); <END> bridge = BridgeBuilder.create(BRIDGE_THING_TYPE_UID, "1").withLabel("My Bridge").build(); assertNotNull("Could not get Bridge Configuration", bridge.getConfiguration()); }</code><technical_language>I understand intention of explanatory texts, I personally dislike state of asserted. great if wrong, code harder read. of a big issue here, in mind this code server example - in case I is leading bad style. I suggest add assertions helpful for figuring out wrong ealiest point possible, drop explanatory texts</technical_language>

Target:
public void setUp() { registerService(volatileStorageService); managedThingProvider = getService(ThingProvider.class, ManagedThingProvider.class); assertNotNull(managedThingProvider); bridge = BridgeBuilder.create(BRIDGE_THING_TYPE_UID, "1").withLabel("My Bridge").build(); assertNotNull(bridge.getConfiguration()); }
Source:
<code>protected MapSqlParameterSource createFullParametersMapper(CommandEntity entity) { return getCustomMapSqlParameterSource().addValue("user_id", Guid.isNullOrEmpty(entity.getUserId()) ? Guid.Empty : entity.getUserId()) .addValue("command_id", Guid.isNullOrEmpty(entity.getId()) ? Guid.Empty : entity.getId()) .addValue("command_type", entity.getCommandType().getValue()) <START> .addValue("parent_command_id", Guid.isNullOrEmpty(entity.getParentCommandId()) ? Guid.Empty : entity.getParentCommandId()) <END> .addValue("root_command_id", Guid.isNullOrEmpty(entity.getRootCommandId()) ? Guid.Empty : entity.getRootCommandId()) .addValue("job_id", Guid.isNullOrEmpty(entity.getJobId()) ? Guid.Empty : entity.getJobId()) .addValue("step_id", Guid.isNullOrEmpty(entity.getStepId()) ? Guid.Empty : entity.getStepId()) .addValue("command_parameters", serializeParameters(entity.getCommandParameters())) .addValue("command_params_class", entity.getCommandParameters() == null ? null : entity.getCommandParameters().getClass().getName()) .addValue("status", entity.getCommandStatus().toString()) .addValue("executed", entity.isExecuted()) .addValue("callback_enabled", entity.isCallbackEnabled()) .addValue("return_value", serializeReturnValue(entity.getReturnValue())) .addValue("return_value_class", entity.getReturnValue() == null ? null : entity.getReturnValue().getClass().getName()); }</code><technical_language>empty if default is null</technical_language>

Target:
protected MapSqlParameterSource createFullParametersMapper(CommandEntity entity) { return getCustomMapSqlParameterSource().addValue("user_id", Guid.isNullOrEmpty(entity.getUserId()) ? Guid.Empty : entity.getUserId()) .addValue("command_id", Guid.isNullOrEmpty(entity.getId()) ? Guid.Empty : entity.getId()) .addValue("command_type", entity.getCommandType().getValue()) .addValue("parent_command_id", entity.getParentCommandId()) .addValue("root_command_id", Guid.isNullOrEmpty(entity.getRootCommandId()) ? Guid.Empty : entity.getRootCommandId()) .addValue("job_id", Guid.isNullOrEmpty(entity.getJobId()) ? Guid.Empty : entity.getJobId()) .addValue("step_id", Guid.isNullOrEmpty(entity.getStepId()) ? Guid.Empty : entity.getStepId()) .addValue("command_parameters", serializeParameters(entity.getCommandParameters())) .addValue("command_params_class", entity.getCommandParameters() == null ? null : entity.getCommandParameters().getClass().getName()) .addValue("status", entity.getCommandStatus().toString()) .addValue("executed", entity.isExecuted()) .addValue("callback_enabled", entity.isCallbackEnabled()) .addValue("return_value", serializeReturnValue(entity.getReturnValue())) .addValue("return_value_class", entity.getReturnValue() == null ? null : entity.getReturnValue().getClass().getName()); }
Source:
<code><START> public void processCorenodeEvent(String username, PublicKeyHash ownedKeyHash) { <END> try { Set<PublicKeyHash> childrenKeys = WriterData.getDirectOwnedKeys(ownedKeyHash, mutable, dht); currentView.computeIfAbsent(ownedKeyHash, k -> new Stat(username, MaybeMultihash.empty(), 0, childrenKeys)); Stat current = currentView.get(ownedKeyHash); MaybeMultihash updatedRoot = mutable.getPointerKeyHash(ownedKeyHash, dht).get(); processMutablePointerEvent(ownedKeyHash, current.target, updatedRoot); for (PublicKeyHash childKey : childrenKeys) { processCorenodeEvent(username, childKey); } } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>docstring please</technical_language>

Target:
public void processCorenodeEvent(String username, PublicKeyHash ownedKeyHash) { try { Set<PublicKeyHash> childrenKeys = WriterData.getDirectOwnedKeys(ownedKeyHash, mutable, dht); currentView.computeIfAbsent(ownedKeyHash, k -> new Stat(username, MaybeMultihash.empty(), 0, childrenKeys)); Stat current = currentView.get(ownedKeyHash); MaybeMultihash updatedRoot = mutable.getPointerTarget(ownedKeyHash, dht).get(); processMutablePointerEvent(ownedKeyHash, current.target, updatedRoot); for (PublicKeyHash childKey : childrenKeys) { processCorenodeEvent(username, childKey); } } catch (Exception e) { e.printStackTrace(); } }
Source:
<code>protected boolean canDoAction() { parameters = getParameters(); if (!super.canDoAction()) { return false; } if (getGeoRepSession().getStatus().equals(GeoRepSessionStatus.ACTIVE)) { <START> addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GEOREP_SESSION_RESUMED); <END> return false; } return true; }</code><technical_language>ACTION_TYPE_FAILED_GEOREP_SESSION_ALREADY_RESUMED</technical_language>

Target:
protected boolean canDoAction() { parameters = getParameters(); if (!super.canDoAction()) { return false; } if (getGeoRepSession().getStatus().equals(GeoRepSessionStatus.ACTIVE)) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GEOREP_SESSION_ALREADY_RESUMED); return false; } return true; }
Source:
<code>protected void unregisterIdP(IdPClient client) { <START> } <END></code><technical_language>set IdpClient null</technical_language>

Target:
protected void unregisterIdP(IdPClient client) { DataHolder.getInstance().setIdPClient(null); }
Source:
<code>public <T extends OAuth2AuthorizedClient> Mono<T> loadAuthorizedClient(String clientRegistrationId, String principalName) { Assert.hasText(clientRegistrationId, "clientRegistrationId cannot be empty"); Assert.hasText(principalName, "principalName cannot be empty"); <START> return (Mono<T>) databaseClient.sql(LOAD_AUTHORIZED_CLIENT_SQL) <END> .bind("clientRegistrationId", clientRegistrationId).bind("principalName", principalName) .map(this.authorizedClientRowMapper::apply).first() .flatMap(this::getOauth2AuthorizedClient); }</code><technical_language>Member variables prefixed this -> this.databaseClient</technical_language>

Target:
public <T extends OAuth2AuthorizedClient> Mono<T> loadAuthorizedClient(String clientRegistrationId, String principalName) { Assert.hasText(clientRegistrationId, "clientRegistrationId cannot be empty"); Assert.hasText(principalName, "principalName cannot be empty"); return (Mono<T>) this.databaseClient.sql(LOAD_AUTHORIZED_CLIENT_SQL) .bind("clientRegistrationId", clientRegistrationId).bind("principalName", principalName) .map(this.authorizedClientRowMapper::apply).first().flatMap(this::getOauth2AuthorizedClient); }
Source:
<code>public ConceptTree(ConceptTree<T> thatTree) { super(new LabelTree(thatTree.getLabelTree())); try { for (ConceptTreeNode<T> node : getNodes()) { if (isRoot(node)) continue; String label = node.getLabel(); ConceptTreeNode<T> thatNode = thatTree.getNodeFromLabel(label); String description = thatNode.getLabelDescription(); node.setLabelDescription(description); SparseVector<T> vector = SparseVector.<T>deepCopy(thatNode.getConceptVector()); node.setConceptVector(vector); <START> } <END> } catch (Exception e) { e.printStackTrace(); } }</code><technical_language>this constructor need add edges, if present -- is care of in call super()</technical_language>

Target:
public ConceptTree(ConceptTree<T> thatTree) { super(new LabelTree(thatTree.getLabelTree())); for (ConceptTreeNode<T> node : getNodes()) { if (isRoot(node)) continue; String labelID = node.getLabelID(); ConceptTreeNode<T> thatNode = thatTree.getNodeFromLabel(labelID); String description = thatNode.getLabelDescription(); node.setLabelDescription(description); SparseVector<T> vector = SparseVector.deepCopy(thatNode.getConceptVector()); node.setConceptVector(vector); } }
Source:
<code>public final List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { if (harvestingWrapper) { return getDropsDefault(world, pos, state, fortune); } IMicroblockContainerTile brokenTile = getMicroblockTile(world, pos); <START> if (brokenTile == null) <END> { brokenTile = this.brokenTile; } if (brokenTile == null) { return getDropsDefault(world, pos, state, fortune); } List<ItemStack> drops = new ArrayList<ItemStack>(); drops.addAll(getDropsDefault(world, pos, state, fortune)); return drops; }</code><technical_language>shade names this purpose... instance variables Block is a good idea..... Threads kill it..</technical_language>

Target:
public final List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) { if (harvestingWrapper) { return getDropsDefault(world, pos, state, fortune); } IMicroblockContainerTile tile = getMicroblockTile(world, pos); if (tile == null && (tile = brokenTile) == null) { return getDropsDefault(world, pos, state, fortune); } List<ItemStack> drops = new ArrayList<ItemStack>(); drops.addAll(getDropsDefault(world, pos, state, fortune)); drops.addAll(tile.getMicroblockContainer().getPartContainer().getDrops()); return drops; }
Source:
<code>public static Response manageError(CoapOSException e, Request request) throws OSException { ResponseCode responseCode = e.getResponseCode(); Response error = null; boolean includeErrMess = true; <START> if (request != null) { <END> if (request.getType() != null) { if (ResponseCode.isClientError(responseCode)) { error = Response.createResponse(request, responseCode); Type tmp = Type.NON; Type t = request.getType(); if (t.equals(Type.CON)) { tmp = Type.ACK; } error.setType(tmp); if (includeErrMess) { error.setPayload(e.getMessage()); } error.getOptions().setMaxAge(0); return error; } else { LOGGER.error(Error.CANNOT_CREATE_ERROR_MESS + ": " + Error.ERROR_MESS_NULL); } } else { LOGGER.error(Error.CANNOT_CREATE_ERROR_MESS + ": " + Error.TYPE_NULL); } } else { LOGGER.error(Error.CANNOT_CREATE_ERROR_MESS + ": " + Error.REQUEST_NULL); } return null; }</code><technical_language>intended behaviour for "isServerError"</technical_language>

Target:
public static Response manageError(CoapOSException e, Request request) { ResponseCode responseCode = e.getResponseCode(); Response error = null; if (request != null) { if (request.getType() != null) { if (ResponseCode.isClientError(responseCode)) { error = Response.createResponse(request, responseCode); Type tmp = Type.NON; Type t = request.getType(); if (t.equals(Type.CON)) { tmp = Type.ACK; } error.setType(tmp); error.setPayload(e.getMessage()); error.getOptions().setMaxAge(0); return error; } else { LOGGER.error(ErrorDescriptions.CANNOT_CREATE_ERROR_MESS + ": " + ErrorDescriptions.ERROR_MESS_NULL); } } else { LOGGER.error(ErrorDescriptions.CANNOT_CREATE_ERROR_MESS + ": " + ErrorDescriptions.TYPE_NULL); } } else { LOGGER.error(ErrorDescriptions.CANNOT_CREATE_ERROR_MESS + ": " + ErrorDescriptions.REQUEST_NULL); } return null; }
Source:
<code>public int compareTo(@Nullable ITmfStateValue object) { if (object instanceof NullStateValue){ <START> return -1; <END> } return 1; }</code><technical_language>Careful return value: returning -1 means nullstate is smaller other objects. other objects greater nullstate value, do explicitly in other methods if (object instanceof NullStateValue) return 1; Also, for unit tests, do ways, for instance, assertTrue(val1.compareTo(val2) > 0); assertFalse(val2.compareTo(val1) > 0);</technical_language>

Target:
public int compareTo(@Nullable ITmfStateValue object) { if (object == null || object instanceof NullStateValue) { return 0; } return -1; }
Source:
<code>public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { if (convertView == null) { convertView = LayoutInflater.from(getContext()).inflate(R.layout.subject_item_grid, parent, false); } <START> SubjectModel model = getItem(position); <END> SubjectItemGridBinding subjectItemBinding = DataBindingUtil.bind(convertView); subjectItemBinding.tvSubjectName.setText(model.name); @DrawableRes final int imageRes = UiUtil.getDrawable(getContext(), model.imageName); ImageUtils.setRoundedCornerImage(subjectItemBinding.ivSubjectLogo, imageRes); return convertView; }</code><technical_language>final</technical_language>

Target:
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { if (convertView == null) { convertView = LayoutInflater.from(getContext()).inflate(R.layout.subject_item_grid, parent, false); } final SubjectModel model = getItem(position); final SubjectItemGridBinding subjectItemBinding = DataBindingUtil.bind(convertView); subjectItemBinding.tvSubjectName.setText(model.name); @DrawableRes final int imageRes = UiUtil.getDrawable(getContext(), model.imageName); ImageUtils.setRoundedCornerImage(subjectItemBinding.ivSubjectLogo, imageRes); convertView.setContentDescription( convertView.getResources().getString(R.string.browse_by_subject) + " " + model.name); return convertView; }
Source:
<code>private void deleteGitRepository(final Repository repository) throws RepositoryNotFoundException { File parentFile = repository.getDirectory().getParentFile(); if (!recursiveDelete(repository.getDirectory())) { <START> throw new RepositoryNotFoundException("Error trying to delete " <END> + repository.getDirectory().getAbsolutePath()); } recursiveDeleteParent(parentFile, gitDir); }</code><technical_language>this IOException, repository exists deleted</technical_language>

Target:
private void deleteGitRepository(final Repository repository) throws IOException { File parentFile = repository.getDirectory().getParentFile(); if (!recursiveDelete(repository.getDirectory())) { throw new IOException("Error trying to delete " + repository.getDirectory().getAbsolutePath()); } recursiveDeleteParent(parentFile, gitDir); }
Source:
<code>public Option[] individualModules() { return options( gradleBundle("org.ehcache.modules:api"), gradleBundle("org.ehcache.modules:core"), gradleBundle("org.ehcache.modules:impl"), <START> gradleBundle("org.ehcache.modules:xml"), jaxbConfiguration(), <END> gradleBundle("org.ehcache:clustered-dist"), jaxbConfiguration(), gradleBundle("org.terracotta.management:management-model"), gradleBundle("org.terracotta.management:sequence-generator"), wrappedGradleBundle("org.terracotta:statistics"), wrappedGradleBundle("org.ehcache:sizeof"), wrappedGradleBundle("org.terracotta:offheap-store"), baseConfiguration("ClusteredOsgiTest", "individualModules") ); }</code><technical_language>I clustered-dist need jaxbConfiguration() depend JAXB (plus is redundant)</technical_language>

Target:
public Option[] individualModules() { return options( gradleBundle("org.ehcache.modules:api"), gradleBundle("org.ehcache.modules:core"), gradleBundle("org.ehcache.modules:impl"), gradleBundle("org.ehcache.modules:xml"), jaxbConfiguration(), gradleBundle("org.ehcache:clustered-dist"), gradleBundle("org.terracotta.management:management-model"), gradleBundle("org.terracotta.management:sequence-generator"), wrappedGradleBundle("org.terracotta:statistics"), wrappedGradleBundle("org.ehcache:sizeof"), wrappedGradleBundle("org.terracotta:offheap-store"), baseConfiguration("ClusteredOsgiTest", "individualModules") ); }
Source:
<code>public void blowfishUnableToDecrypt() throws Exception { String aWonderfulString = "aWonderfulString"; final Encryption encryptionAES = new Encryption(KeySources.machineUID(16), CipherSources.getDefault()); String encryptedAESString = encryptionAES.encrypt(aWonderfulString); final Encryption encryptionBlowfish = new Encryption(KeySources.machineUID(16), CipherSources.blowfish()); final String decryptedString = encryptionBlowfish.decrypt(encryptedAESString); <START> assertNotEquals(decryptedString, aWonderfulString); <END> }</code><technical_language>need this assertion, test is throwing expected exception</technical_language>

Target:
public void blowfishUnableToDecrypt() throws Exception { String aWonderfulString = "aWonderfulString"; final Encryption encryptionAES = new Encryption(KeySources.machineUID(16), CipherSources.getDefault()); String encryptedAESString = encryptionAES.encrypt(aWonderfulString); final Encryption encryptionBlowfish = new Encryption(KeySources.machineUID(16), CipherSources.blowfish()); encryptionBlowfish.decrypt(encryptedAESString); }
Source:
<code>public void setup() { super.setup(); vaultResourceGroup = System.getProperty("test.azurecompute-arm.vault.resource.group"); vaultName = System.getProperty("test.azurecompute-arm.vault.name"); vaultCertificateUrl = System.getProperty("test.azurecompute-arm.vault.certificate.url"); <START> tenantId = System.getProperty("test.azurecompute-arm.tenantId"); <END> }</code><technical_language>Change to: tenantId = injector.getInstance(Key.get(String.class, Tenant.class));</technical_language>

Target:
public void setup() { super.setup(); vaultResourceGroup = System.getProperty("test.azurecompute-arm.vault.resource.group"); vaultName = System.getProperty("test.azurecompute-arm.vault.name"); vaultCertificateUrl = System.getProperty("test.azurecompute-arm.vault.certificate.url"); }
Source:
<code><START> public ValidationResult vmNotHavingPassthroughVnics() { <END> for (VM vm : vms) { List<VmNetworkInterface> vnics = DbFacade.getInstance().getVmNetworkInterfaceDao().getAllForVm(vm.getId()); List<VmNetworkInterface> passthroughVnics = LinqUtils.filter(vnics, new org.ovirt.engine.core.utils.linq.Predicate<VmNetworkInterface>() { public boolean eval(VmNetworkInterface vnic) { return vnic.isPassthrough(); } }); Collection<String> replacements = ReplacementUtils.replaceWithNameable("interfaces", passthroughVnics); replacements.add(String.format("$vmName %s", vm.getName())); return ValidationResult.failWith(VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_OF_PASSTHROUGH_VNICS_IS_NOT_SUPPORTED, replacements.toArray(new String[] {})) .unless(passthroughVnics.isEmpty()); } return ValidationResult.VALID; }</code><technical_language>name positive plural is can-do-action. Please change vmsHavingPassthroughVnic()</technical_language>

Target:
public ValidationResult vmNotHavingPassthroughVnics() { for (VM vm : vms) { List<VmNetworkInterface> vnics = getDbFacade().getVmNetworkInterfaceDao().getAllForVm(vm.getId()); List<VmNetworkInterface> passthroughVnics = LinqUtils.filter(vnics, new org.ovirt.engine.core.utils.linq.Predicate<VmNetworkInterface>() { public boolean eval(VmNetworkInterface vnic) { return vnic.isPassthrough(); } }); Collection<String> replacements = ReplacementUtils.replaceWithNameable("interfaces", passthroughVnics); replacements.add(String.format("$vmName %s", vm.getName())); if (!passthroughVnics.isEmpty()) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_OF_PASSTHROUGH_VNICS_IS_NOT_SUPPORTED, replacements); } } return ValidationResult.VALID; }
Source:
<code>public void testRootIdNoData() throws JsonProcessingException { String graphQLRequest = "mutation { " + <START> "author(op:DELETE, ids: [\"1\"]) { " + <END> "id " + "name " + "} " + "}"; String expectedResponse = "{" + "\"author\":[{" + "\"id\":\"1\"," + "\"name\":\"Mark Twain\"" + "}]" + "}"; assertQueryEquals(graphQLRequest, expectedResponse); }</code><technical_language>Do a fetch delete ensure deleted</technical_language>

Target:
public void testRootIdNoData() throws JsonProcessingException { String graphQLRequest = "mutation { " + "author(op:DELETE, ids: [\"1\"]) { " + "id " + "name " + "} " + "}"; String expectedResponse = "{" + "\"author\":[{" + "\"id\":\"1\"," + "\"name\":\"Mark Twain\"" + "}]" + "}"; assertQueryEquals(graphQLRequest, expectedResponse); String graphQLFetchRequest = "mutation { " + "author(ids: [\"1\"]) { " + "id " + "name " + "} " + "}"; String expectedFetchResponse = "{" + "\"author\":[]" + "}"; assertQueryEquals(graphQLFetchRequest, expectedFetchResponse); }
Source:
<code>public void simple() { assertEquals(True.instance(), True.instance()); <START> assertEquals(False.instance(), False.instance()); <END> assertNotEquals(True.instance(), False.instance()); assertNotEquals(False.instance(), True.instance()); Leaf<String> leaf = new Leaf<>("foo"); assertEquals(leaf, leaf); assertNotEquals(True.instance(), leaf); assertNotEquals(False.instance(), leaf); }</code><technical_language>add assertSame() versions validate singleton creation</technical_language>

Target:
public void simple() { assertEquals(True.instance(), True.instance()); assertEquals(True.instance().hashCode(), True.instance().hashCode()); assertEquals(False.instance(), False.instance()); assertEquals(False.instance().hashCode(), False.instance().hashCode()); assertNotEquals(True.instance(), False.instance()); assertNotEquals(False.instance(), True.instance()); Leaf<String> leaf = new Leaf<>("foo"); assertEquals(leaf, leaf); assertNotEquals(True.instance(), leaf); assertNotEquals(False.instance(), leaf); }
Source:
<code>private static <A extends Annotation> boolean valuesEqual(Class<A> annotationType, Object a, Object b) { for (Method m : annotationType.getDeclaredMethods()) { Function<Object, Object> invoker = Unchecked.function(m::invoke); Object valueA = invoker.apply(a); Object valueB = invoker.apply(b); if (valueA != null && valueA.getClass().isArray() && valueA.getClass().equals(valueB.getClass()) <START> && Boolean.FALSE.equals(Unchecked.supplier(() -> <END> MethodHandles.publicLookup() .findStatic(Arrays.class, "equals", MethodType.methodType(boolean.class, valueA.getClass(), valueB.getClass())) .invoke(a, b)).get())) { return false; } if (!Objects.equals(valueA, valueB)) { return false; } } return true; }</code><technical_language>missing null check valueB</technical_language>

Target:
private static <A extends Annotation> boolean valuesEqual(Class<A> annotationType, Object a, Object b) { for (Method m : annotationType.getDeclaredMethods()) { Function<Object, Object> invoker = Unchecked.function(m::invoke); Object valueA = invoker.apply(a); Object valueB = invoker.apply(b); if (valueA != null && valueB != null && valueA.getClass().isArray() && valueA.getClass().equals(valueB.getClass()) && Boolean.FALSE.equals(Unchecked.supplier(() -> MethodHandles.publicLookup() .findStatic(Arrays.class, "equals", MethodType.methodType(boolean.class, valueA.getClass(), valueB.getClass())) .invoke(a, b)).get())) { return false; } if (!Objects.equals(valueA, valueB)) { return false; } } return true; }
Source:
<code>public ClassDefItem call() { long now = System.nanoTime(); <START> ClassDefItem clazz = translateClass(name, bytes, classFile); <END> translateTime += System.nanoTime() - now; methodDefs += classFile.getMethods().size(); fieldDefs += classFile.getFields().size(); return clazz; }</code><technical_language>Trivial nit: 1 space equals</technical_language>

Target:
public ClassDefItem call() { ClassDefItem clazz = translateClass(name, bytes, classFile); return clazz; }
Source:
<code>private void fetchDictionaries(File collectionDir, String collectionName, final EntityManager rootEm, Results entity, Gson gson, Integer batchId) { JsonGenerator jgDictionaries = null; try { jgDictionaries = getJsonGenerator(new File(collectionDir + "/" + collectionName + "_" + "dictionaries_" + batchId)); for (Entity et : entity.getEntities()) { Set<String> dictionaries; try { dictionaries = rootEm.getDictionaries(et); jgDictionaries.writeStartArray(); if (dictionaries != null && !dictionaries.isEmpty()) { for (String dictionary : dictionaries) { Map<Object, Object> dict = rootEm.getDictionaryAsMap(et, dictionary); if (dict != null && dict.isEmpty()) { continue; } jgDictionaries.writeStartObject(); <START> jgDictionaries.writeObjectField("Related Entity", et.getUuid()); <END> jgDictionaries.writeObjectField(dictionary, dict); jgDictionaries.writeEndObject(); } jgDictionaries.writeEndArray(); } } catch (Exception e) { logger.error("Exception while trying to fetch dictionaries.", e); } } } catch (Exception e) { logger.error("Exception while trying to fetch dictionaries.", e); } finally { if (jgDictionaries != null) { try { jgDictionaries.close(); } catch (IOException e) { logger.error("Exception while trying to close dictionaries writer.", e); } } } }</code><technical_language>Change tag Related Entity Entity is other entity present, is a specific reason call Related Entity</technical_language>

Target:
private void fetchDictionaries(File collectionDir, String collectionName, final EntityManager rootEm, Results entity, Gson gson, Integer batchId) { JsonGenerator jgDictionaries = null; try { jgDictionaries = getJsonGenerator(new File(collectionDir + "/" + collectionName + "_" + "dictionaries_" + batchId)); for (Entity et : entity.getEntities()) { Set<String> dictionaries; try { dictionaries = rootEm.getDictionaries(et); jgDictionaries.writeStartArray(); if (dictionaries != null && !dictionaries.isEmpty()) { for (String dictionary : dictionaries) { Map<Object, Object> dict = rootEm.getDictionaryAsMap(et, dictionary); if (dict != null && dict.isEmpty()) { continue; } jgDictionaries.writeStartObject(); jgDictionaries.writeObjectField("Entity", et.getUuid()); jgDictionaries.writeObjectField(dictionary, dict); jgDictionaries.writeEndObject(); } jgDictionaries.writeEndArray(); } } catch (Exception e) { logger.error("Exception while trying to fetch dictionaries.", e); } } } catch (Exception e) { logger.error("Exception while trying to fetch dictionaries.", e); } finally { if (jgDictionaries != null) { try { jgDictionaries.close(); } catch (IOException e) { logger.error("Exception while trying to close dictionaries writer.", e); } } } }
Source:
<code>public Map<String, Boolean> getLsFileMap(String paramString) throws Exception { <START> HashMap<Object, Object> hashMap = new HashMap<>(); <END> Vector<ChannelSftp.LsEntry> vector = channelSFTP.ls(paramString); for (byte b = 0; b < vector.size(); b++) { ChannelSftp.LsEntry lsEntry = vector.get(b); String str = lsEntry.getFilename(); if (!".".equals(str)) { if (!"..".equals(str)) { String str1 = paramString + "/" + str; boolean bool = isDirectory(str1); this.logger.info("fileName : " + str); hashMap.put(str, Boolean.valueOf(bool)); } } } return (Map) hashMap; }</code><technical_language>declare this <Object, Boolean> beginning casting end of method? suggestion HashMap<Object, Boolean> hashMap = new HashMap<>();</technical_language>

Target:
public Map<String, Boolean> getLsFileMap(String paramString) throws Exception { Map<String, Boolean> hashMap = new HashMap<>(); Vector<ChannelSftp.LsEntry> vector = channelSFTP.ls(paramString); for(ChannelSftp.LsEntry lsEntry : vector) { String str = lsEntry.getFilename(); if (!".".equals(str)) { if (!"..".equals(str)) { String str1 = paramString + "/" + str; boolean bool = isDirectory(str1); this.logger.info("fileName : " + str); hashMap.put(str, Boolean.valueOf(bool)); } } } return hashMap; }
Source:
<code>public String awaitConfigToExecute() throws TerminateException { if (!registered) { throw new IllegalStateException("must be registered"); } try { statusExchangeThread.setPendingRequestEntity(); String configName; do { configName = statusExchangeThread.nextConfigToExecute.poll(1, TimeUnit.MINUTES); if (!standBy) { throw new TerminateException("Master execution can't be proceeded"); } } while (configName == null); statusExchangeThread.setRunningRequestEntity(configName); synchronized (statusExchangeThread.statusLock) { <START> statusExchangeThread.statusLock.wait(); <END> } return configName; } catch (InterruptedException e) { statusExchangeThread.interrupt(); throw new TerminateException("Master execution can't be proceeded"); } }</code><technical_language>need check 'standBy' periodically hang</technical_language>

Target:
public String awaitConfigToExecute() throws TerminateException { if (!registered) { throw new IllegalStateException("must be registered"); } try { statusExchangeThread.setPendingRequestEntity(); String configName; do { configName = statusExchangeThread.nextConfigToExecute.poll(1, TimeUnit.MINUTES); if (!standBy) { throw new TerminateException("Master execution can't be proceeded"); } } while (configName == null); statusExchangeThread.setRunningRequestEntity(configName); statusExchangeThread.statusSent = false; synchronized (statusExchangeThread.statusLock) { while (!statusExchangeThread.statusSent) { statusExchangeThread.statusLock.wait(statusReportIntervalSeconds * 1000); if (!standBy) throw new TerminateException("Master execution can't be proceeded"); } } return configName; } catch (InterruptedException e) { statusExchangeThread.interrupt(); throw new TerminateException("Master execution can't be proceeded"); } }
Source:
<code>public static void AdminChatMsg(CommandSender sender, String message) { for (Player onlineadmins : Bukkit.getOnlinePlayers()) { if (ICM_Rank.isRankOrHigher(onlineadmins, ICM_Rank.Rank.SUPER)) { <START> onlineadmins.sendMessage("§f[§bADMIN§f] §c" + sender.getName() + ICM_Rank.getRank(sender).actag + "§f: §b " + message); <END> } } }</code><technical_language>change this get senders nickname? I grown prefer username</technical_language>

Target:
public static void AdminChatMsg(CommandSender sender, String message) { for (Player onlineadmins : Bukkit.getOnlinePlayers()) { if (ICM_Rank.isRankOrHigher(onlineadmins, ICM_Rank.Rank.SUPER)) { onlineadmins.sendMessage("§f[§bADMIN§f] §c" + ICM_SqlHandler.getNick(sender) + ICM_Rank.getRank(sender).actag + "§f: §b " + message); } } }
Source:
<code>public void onPlayerQuit(final PlayerQuitEvent event) { final User user = ess.getUser(event.getPlayer()); if (ess.getSettings().allowSilentJoinQuit() && user.isAuthorized("essentials.silentquit")) { event.setQuitMessage(null); } else if (ess.getSettings().isCustomQuitMessage() && event.getQuitMessage() != null) { final Player player = event.getPlayer(); String quitMessage = ess.getSettings().getCustomQuitMessage(); <START> quitMessage.replace("{PLAYER}", player.getDisplayName()) <END> .replace("{USERNAME}", player.getName()); quitMessage = FormatUtil.placeholderAPIFormat(user, quitMessage); event.setQuitMessage(quitMessage); } user.startTransaction(); if (ess.getSettings().removeGodOnDisconnect() && user.isGodModeEnabled()) { user.setGodModeEnabled(false); } if (user.isVanished()) { user.setVanished(false); } user.setLogoutLocation(); if (user.isRecipeSee()) { user.getBase().getOpenInventory().getTopInventory().clear(); } for (HumanEntity viewer : user.getBase().getInventory().getViewers()) { if (viewer instanceof Player) { User uviewer = ess.getUser((Player) viewer); if (uviewer.isInvSee()) { uviewer.getBase().closeInventory(); } } } user.updateActivityOnInteract(false); if (!user.isHidden()) { user.setLastLogout(System.currentTimeMillis()); } user.stopTransaction(); user.dispose(); }</code><technical_language>String is immutable, code is correct</technical_language>

Target:
public void onPlayerQuit(final PlayerQuitEvent event) { final User user = ess.getUser(event.getPlayer()); if (ess.getSettings().allowSilentJoinQuit() && user.isAuthorized("essentials.silentquit")) { event.setQuitMessage(null); } else if (ess.getSettings().isCustomQuitMessage() && event.getQuitMessage() != null) { final Player player = event.getPlayer(); String quitMessage = ess.getSettings().getCustomQuitMessage() .replace("{PLAYER}", player.getDisplayName()) .replace("{USERNAME}", player.getName()); quitMessage = FormatUtil.placeholderAPIFormat(user, quitMessage); event.setQuitMessage(quitMessage); } user.startTransaction(); if (ess.getSettings().removeGodOnDisconnect() && user.isGodModeEnabled()) { user.setGodModeEnabled(false); } if (user.isVanished()) { user.setVanished(false); } user.setLogoutLocation(); if (user.isRecipeSee()) { user.getBase().getOpenInventory().getTopInventory().clear(); } for (HumanEntity viewer : user.getBase().getInventory().getViewers()) { if (viewer instanceof Player) { User uviewer = ess.getUser((Player) viewer); if (uviewer.isInvSee()) { uviewer.getBase().closeInventory(); } } } user.updateActivityOnInteract(false); if (!user.isHidden()) { user.setLastLogout(System.currentTimeMillis()); } user.stopTransaction(); user.dispose(); }
Source:
<code>public Object visitDataWriteCommand(InvocationContext ctx, DataWriteCommand command, boolean assumeOriginKeptEntryInL1) throws Throwable { Object returnValue = invokeNextInterceptor(ctx, command); Object key; if (shouldUpdateOnWriteCommand(command) && command.isSuccessful() && cdl.localNodeIsPrimaryOwner((key = command.getKey()))) { <START> getLog().tracef("Sending additional invalidation for requestors if necessary."); <END> l1Manager.flushCache(Collections.singleton(key), ctx.getOrigin(), assumeOriginKeptEntryInL1); } return returnValue; }</code><technical_language>I guard tracef invocation in if (... isTraceLogEnabled())</technical_language>

Target:
public Object visitDataWriteCommand(InvocationContext ctx, DataWriteCommand command, boolean assumeOriginKeptEntryInL1) throws Throwable { Object returnValue = invokeNextInterceptor(ctx, command); Object key; if (shouldUpdateOnWriteCommand(command) && command.isSuccessful() && cdl.localNodeIsPrimaryOwner((key = command.getKey()))) { if (trace) { log.trace("Sending additional invalidation for requestors if necessary."); } l1Manager.flushCache(Collections.singleton(key), ctx.getOrigin(), assumeOriginKeptEntryInL1); } return returnValue; }
Source:
<code>public void write(Object datum) throws IOException { if (!opened) { throw new IOException("Writer is not opened"); } result.totalCount++; if (datum == null) { return; } IndexedRecord record = (IndexedRecord) datum; Schema schema = record.getSchema(); Schema.Field idField = schema.getField(idFieldName); if (idField == null) { throw new IOException("Schema does not contain ID field: " + idFieldName); } int idPos = idField.pos(); <START> Object id = record.get(idPos); <END> if (id == null) { throw new IOException("ID field is null: " + idField.name()); } connection.upsert(id.toString(), datum.toString()); }</code><technical_language>idPos variable is needed</technical_language>

Target:
public void write(Object datum) throws IOException { if (!opened) { throw new IOException("Writer is not opened"); } result.totalCount++; if (datum == null) { return; } IndexedRecord record = (IndexedRecord) datum; Schema schema = record.getSchema(); Schema.Field idField = schema.getField(idFieldName); if (idField == null) { throw new IOException("Schema does not contain ID field: " + idFieldName); } int idPos = idField.pos(); Object id = record.get(idPos); if (id == null) { handleException("Record is not processed. ID is null.", new IllegalArgumentException("ID field should not be null")); return; } try { connection.upsert(id.toString(), datum.toString()); result.successCount++; } catch (Exception e) { handleException("Record is not processed. Failed to upsert value - " + datum.toString(), e); } }
Source:
<code>protected IContributionItem[] getContributionItems() { final List<IContributionItem> list = new ArrayList<IContributionItem>(); <START> CommandContributionItemParameter params = new CommandContributionItemParameter(ReviewsUiPlugin.getDefault() <END> .getWorkbench() .getActiveWorkbenchWindow() .getActivePage() .getActivePart() .getSite(), UIUtils.NEXT_COMMENT_ANNOTATION_COMMAND, UIUtils.NEXT_COMMENT_ANNOTATION_COMMAND, null, ImageDescriptor.createFromURL(ReviewsUiPlugin.getDefault() .getBundle() .getEntry(UIUtils.NEXT_COMMENT_ANNOTATION_ICON_FILE)), null, null, UIUtils.NEXT_COMMENT_ANNOTATION_COMMAND_NAME, UIUtils.NEXT_COMMENT_ANNOTATION_COMMAND_MNEMONIC, UIUtils.NEXT_COMMENT_ANNOTATION_COMMAND_TOOLTIP, CommandContributionItem.STYLE_PUSH, null, true); list.add(new CommandContributionItem(params)); params = new CommandContributionItemParameter(ReviewsUiPlugin.getDefault() .getWorkbench() .getActiveWorkbenchWindow() .getActivePage() .getActivePart() .getSite(), UIUtils.PREVIOUS_COMMENT_ANNOTATION_COMMAND, UIUtils.PREVIOUS_COMMENT_ANNOTATION_COMMAND, null, ImageDescriptor.createFromURL(ReviewsUiPlugin.getDefault() .getBundle() .getEntry(UIUtils.PREVIOUS_COMMENT_ANNOTATION_ICON_FILE)), null, null, UIUtils.PREVIOUS_COMMENT_ANNOTATION_COMMAND_NAME, UIUtils.PREVIOUS_COMMENT_ANNOTATION_COMMAND_MNEMONIC, UIUtils.PREVIOUS_COMMENT_ANNOTATION_COMMAND_TOOLTIP, CommandContributionItem.STYLE_PUSH, null, true); list.add(new CommandContributionItem(params)); UIUtils.setCurrentElement(0); return list.toArray(new IContributionItem[list.size()]); }</code><technical_language>plugin activator? PlatformUI provides workbench</technical_language>

Target:
public IContributionItem[] getContributionItems() { final List<IContributionItem> list = new ArrayList<IContributionItem>(); IWorkbenchSite site = PlatformUI.getWorkbench() .getActiveWorkbenchWindow() .getActivePage() .getActivePart() .getSite(); if (site != null) { CommandContributionItemParameter params = new CommandContributionItemParameter(site, UIUtils.NEXT_COMMENT_ANNOTATION_COMMAND, UIUtils.NEXT_COMMENT_ANNOTATION_COMMAND, null, ImageDescriptor.createFromURL(ReviewsUiPlugin.getDefault() .getBundle() .getEntry(UIUtils.NEXT_COMMENT_ANNOTATION_ICON_FILE)), null, null, UIUtils.NEXT_COMMENT_ANNOTATION_COMMAND_NAME, UIUtils.NEXT_COMMENT_ANNOTATION_COMMAND_MNEMONIC, UIUtils.NEXT_COMMENT_ANNOTATION_COMMAND_TOOLTIP, CommandContributionItem.STYLE_PUSH, null, true); list.add(new CommandContributionItem(params)); params = new CommandContributionItemParameter(site, UIUtils.PREVIOUS_COMMENT_ANNOTATION_COMMAND, UIUtils.PREVIOUS_COMMENT_ANNOTATION_COMMAND, null, ImageDescriptor.createFromURL(ReviewsUiPlugin.getDefault() .getBundle() .getEntry(UIUtils.PREVIOUS_COMMENT_ANNOTATION_ICON_FILE)), null, null, UIUtils.PREVIOUS_COMMENT_ANNOTATION_COMMAND_NAME, UIUtils.PREVIOUS_COMMENT_ANNOTATION_COMMAND_MNEMONIC, UIUtils.PREVIOUS_COMMENT_ANNOTATION_COMMAND_TOOLTIP, CommandContributionItem.STYLE_PUSH, null, true); list.add(new CommandContributionItem(params)); UIUtils.setCurrentElement(0); return list.toArray(new IContributionItem[list.size()]); } else { return null; } }
Source:
<code><START> public FileSystem getFileSystem(final URI uri) { <END> return getDefaultFileSystem(); }</code><technical_language>I in this case is ignore sonarCloud. reponsible for sonarCloud rules, in this case ignore</technical_language>

Target:
public FileSystem getFileSystem(final URI uri) throws IllegalArgumentException, FileSystemNotFoundException, SecurityException { return getDefaultFileSystem(); }
Source:
<code>public TableName[] listTableNames() throws IOException { ListTablesRequest.Builder builder = ListTablesRequest.newBuilder(); <START> clusterMetadataSetter.setMetadata(builder); <END> ListTablesResponse response; try { response = bigtableAdminClient.listTables(builder.build()); } catch (Throwable throwable) { throw new IOException("Failed to listTables", throwable); } List<Table> tablesList = response.getTablesList(); TableName[] result = new TableName[tablesList.size()]; for (int i=0;i<tablesList.size(); i++) { String name = clusterMetadataSetter.toHBaseTableName(tablesList.get(i).getName()); result[i] = TableName.valueOf(name); } return result; }</code><technical_language>this to? method setting meta data, yet, pass in a empty list-table-request builder</technical_language>

Target:
public TableName[] listTableNames() throws IOException { return asTableNames(requestTableList().getTablesList()); }
Source:
<code>abstract void process(ReviewDb db, Account.Id account, Map<Id, Change> outResultChanges) throws OrmException ; <START> <END> } private List<Change.Id> changesCreatedBy(final ReviewDb db, final String userName) { UserNameProcessor processor = new UserNameProcessor(db, userName) { @Override void process(ReviewDb db, Account.Id account, Map<Id, Change> resultChanges) throws OrmException { for (Change change : db.changes().byOwnerOpen(account)) { resultChanges.put(change.getId(), change); } for (Change change : db.changes().byOwnerClosed(account)) { resultChanges.put(change.getId(), change); } } }; return new ArrayList<Change.Id>(processor.call()); }</code><technical_language>Unnecessary blank line</technical_language>

Target:
abstract void process(ReviewDb db, Account.Id account, Map<Id, Change> outResultChanges) throws OrmException ; } private Set<Change.Id> changesCreatedBy(final ReviewDb db, final String userName) throws OrmException { UserNameProcessor processor = new UserNameProcessor(db, userName) { @Override void process(ReviewDb db, Account.Id account, Map<Id, Change> resultChanges) throws OrmException { for (Change change : db.changes().byOwnerOpen(account)) { resultChanges.put(change.getId(), change); } for (Change change : db.changes().byOwnerClosed(account)) { resultChanges.put(change.getId(), change); } } }; return processor.call(); }
Source:
<code>public boolean removeAll(Collection<?> c) { <START> return innerList.removeAll(c); <END> }</code><technical_language>Actually, I do in other nodes well, right? Hmmm, means childNodes list accumulate kinds of crap start modifying AST..</technical_language>

Target:
public boolean removeAll(Collection<?> c) { boolean removeAll = innerList.removeAll(c); for (Object o : c) { if (o != null && o instanceof Node) ((Node) o).setParentNode(null); } return removeAll; }
Source:
<code>public static Arguments buildArgs() { String memory = bytesToString( OsBeanUtil.getTotalPhysicalMemory() ); return new Arguments() .withArgument( new OptionalNamedArg( ARG_MEMORY, memory, memory, "Recommend memory settings with respect to the given amount of memory, " + "instead of the total memory of the system running the command." ) ) .withArgument( new OptionalBooleanArg( ARG_DB, false, "Specific database to calculate page cache memory requirement for. " + "The generic calculation is still a good generic recommendation for this machine, " + "but there will be an additional calculation for minimal required page cache memory " + <START> "for mapping all store and index files that are managed by the page cache." ) ); <END> }</code><technical_language>I standard of instructing a command work a database, is withDatabase argument. I do well, instead of assuming configured default database is want build a configuration for in invocation of command. Unfortunately, withDatabase allow override description. I added, description is good</technical_language>

Target:
public static Arguments buildArgs() { String memory = bytesToString( OsBeanUtil.getTotalPhysicalMemory() ); return new Arguments() .withArgument( new OptionalNamedArg( ARG_MEMORY, memory, memory, "Recommend memory settings with respect to the given amount of memory, " + "instead of the total memory of the system running the command." ) ) .withDatabase( "Name of specific database to calculate page cache memory requirement for. " + "The generic calculation is still a good generic recommendation for this machine, " + "but there will be an additional calculation for minimal required page cache memory " + "for mapping all store and index files that are managed by the page cache." ); }