auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void deleteRecord(DataIdentifier identifier) throws DataStoreException { if (null == identifier) throw new NullPointerException("identifier"); String key = getKeyName(identifier); long start = System.currentTimeMillis(); ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); boolean result = getAzureContainer().getBlockBlobReference(key).deleteIfExists(); <START> LOG.debug("Blob deleted. existed={} identifier={} duration={}", result, key, (System.currentTimeMillis() - start)); <END> } catch (StorageException e) { LOG.info("Error deleting blob. identifier={}", key, e); throw new DataStoreException(e); } catch (URISyntaxException e) { throw new DataStoreException(e); } finally { if (contextClassLoader != null) { Thread.currentThread().setContextClassLoader(contextClassLoader); } } }</code><technical_language>Suggest log messages here, depending of "result". If blob referenced exist, deleteIfExists() return a of false, log message wording of "Blob deleted. existed=false" logged, I is a confusing message for familiar Azure API. suggest message if result is true, if result is false, log instead "Blob delete requested blob exist (perhaps deleted)" diagnostic info current log message has, that</technical_language>

Target:
public void deleteRecord(DataIdentifier identifier) throws DataStoreException { if (null == identifier) throw new NullPointerException("identifier"); String key = getKeyName(identifier); long start = System.currentTimeMillis(); ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); boolean result = getAzureContainer().getBlockBlobReference(key).deleteIfExists(); LOG.debug("Blob {}. identifier={} duration={}", result ? "deleted" : "delete requested, but it does not exist (perhaps already deleted)", key, (System.currentTimeMillis() - start)); } catch (StorageException e) { LOG.info("Error deleting blob. identifier={}", key, e); throw new DataStoreException(e); } catch (URISyntaxException e) { throw new DataStoreException(e); } finally { if (contextClassLoader != null) { Thread.currentThread().setContextClassLoader(contextClassLoader); } } }
Source:
<code>public static String getSimpleClassName(String qualifiedName) { <START> int i = qualifiedName.lastIndexOf('.'); <END> return i < 0 ? qualifiedName : qualifiedName.substring(i + 1); }</code><technical_language>check check for empty null string org.apache.dubbo.common.utils.Assert.notEmptyString(qualifiedName, "Name null blank");</technical_language>

Target:
public static String getSimpleClassName(String qualifiedName) { if (null == qualifiedName) { return null; } int i = qualifiedName.lastIndexOf('.'); return i < 0 ? qualifiedName : qualifiedName.substring(i + 1); }
Source:
<code>private Map<String, Integer> fetchCapacityUsage(String partitionName, ResourceConfig resourceConfig, ClusterConfig clusterConfig) { Map<String, Map<String, Integer>> capacityMap; try { capacityMap = resourceConfig.getPartitionCapacityMap(); } catch (IOException ex) { throw new IllegalArgumentException( "Invalid partition capacity configuration of resource: " + resourceConfig .getResourceName(), ex); } Map<String, Integer> partitionCapacity = <START> validateAndGetPartitionCapacity(partitionName, resourceConfig, capacityMap, clusterConfig); <END> partitionCapacity.keySet().retainAll(clusterConfig.getInstanceCapacityKeys()); return partitionCapacity; }</code><technical_language>leave capacityMap read logic of validateAndGetPartitionCapacity? Note this diverge behavior of check API real rebalancer API. maybe, check pass rebalancer fails. same</technical_language>

Target:
private Map<String, Integer> fetchCapacityUsage(String partitionName, ResourceConfig resourceConfig, ClusterConfig clusterConfig) { Map<String, Map<String, Integer>> capacityMap; try { capacityMap = resourceConfig.getPartitionCapacityMap(); } catch (IOException ex) { throw new IllegalArgumentException( "Invalid partition capacity configuration of resource: " + resourceConfig .getResourceName(), ex); } Map<String, Integer> partitionCapacity = WagedValidationUtil .validateAndGetPartitionCapacity(partitionName, resourceConfig, capacityMap, clusterConfig); partitionCapacity.keySet().retainAll(clusterConfig.getInstanceCapacityKeys()); return partitionCapacity; }
Source:
<code>public void getBlob() throws Exception { final String sha = "6dcb09b5b57875f334f61aebed695e2e4193db5e"; <START> final Blobs blobs = repo().git().blobs(); <END> MatcherAssert.assertThat(blobs.get(sha), Matchers.notNullValue()); }</code><technical_language>forget create blob before</technical_language>

Target:
public void getBlob() throws Exception { final Blobs blobs = repo().git().blobs(); final Blob created = blobs.create("content", "base64"); MatcherAssert.assertThat( blobs.get(created.sha()), Matchers.notNullValue() ); }
Source:
<code>public void execute() { FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .withInitialDirectory(getInitialDirectory()) .build(); Optional<Path> studyDefinitionFile = dialogService.showFileOpenDialog(fileDialogConfiguration); if (studyDefinitionFile.isEmpty()) { return; } final Crawler crawler; try { <START> crawler = new Crawler(studyDefinitionFile.get(), Globals.getFileUpdateMonitor(), JabRefPreferences.getInstance().getSavePreferences(), Globals.entryTypesManager); <END> } catch (IOException | ParseException | GitAPIException e) { LOGGER.info("Error during reading of study definition file.", e); dialogService.showErrorDialogAndWait(Localization.lang("Error during reading of study definition file.")); return; } BackgroundTask.wrap(() -> { crawler.performCrawl(); return 0; }) .onFailure(e -> { LOGGER.info("Error during persistence of crawling results."); dialogService.showErrorDialogAndWait(Localization.lang("Error during persistence of crawling results."), e); }) .onSuccess(unused -> new OpenDatabaseAction(frame).openFile(Path.of(studyDefinitionFile.get().getParent().toString(), "studyResult.bib"), true)) .executeWith(Globals.TASK_EXECUTOR); }</code><technical_language>get rid of Globals preferable if pass constructor arguments. (if pass them, need call Globals.prefs)</technical_language>

Target:
public void execute() { FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .withInitialDirectory(workingDirectory) .build(); Optional<Path> studyDefinitionFile = dialogService.showFileOpenDialog(fileDialogConfiguration); if (studyDefinitionFile.isEmpty()) { return; } final Crawler crawler; try { crawler = new Crawler(studyDefinitionFile.get(), fileUpdateMonitor, JabRefPreferences.getInstance().getImportFormatPreferences(), JabRefPreferences.getInstance().getSavePreferences(), new BibEntryTypesManager()); } catch (IOException | ParseException | GitAPIException e) { LOGGER.error("Error during reading of study definition file.", e); dialogService.showErrorDialogAndWait(Localization.lang("Error during reading of study definition file."), e); return; } BackgroundTask.wrap(() -> { crawler.performCrawl(); return 0; }) .onFailure(e -> { LOGGER.error("Error during persistence of crawling results."); dialogService.showErrorDialogAndWait(Localization.lang("Error during persistence of crawling results."), e); }) .onSuccess(unused -> new OpenDatabaseAction(frame).openFile(Path.of(studyDefinitionFile.get().getParent().toString(), "studyResult.bib"), true)) .executeWith(taskExecutor); }
Source:
<code><START> public ResponseEntity<?> listStorages(final NativeWebRequest request) throws InternalNakadiException { <END> if (!adminService.isAdmin(AuthorizationService.Operation.READ)) { return status(FORBIDDEN).build(); } final List<Storage> storages = storageService.listStorages(); return status(OK).body(storages); }</code><technical_language>throws other runtime exceptions</technical_language>

Target:
public ResponseEntity<?> listStorages(final NativeWebRequest request) throws InternalNakadiException, PluginException { if (!adminService.isAdmin(AuthorizationService.Operation.READ)) { return status(FORBIDDEN).build(); } final List<Storage> storages = storageService.listStorages(); return status(OK).body(storages); }
Source:
<code>public void consumeItems(CraftingGrid craftingGrid) { ShapedMapping mapping = findIngredientMapping(craftingGrid); if (mapping == null) { return; } for (int i = 0; i < ingredients.length; i++) { Item original = mapping.Items[i]; Item consumed = ingredients[i].consumeOnCrafting(original, craftingGrid); <START> if (consumed != null && consumed.count() == 0) { <END> consumed = null; } mapping.setStack(craftingGrid, i, Optional.ofNullable(consumed)); } }</code><technical_language><LINK_0> assert consumed is null (Objects.requireNonNull) fix it</technical_language>

Target:
public void consumeItems(CraftingGrid craftingGrid) { ShapedMapping mapping = findIngredientMapping(craftingGrid); if (mapping == null) { return; } for (int i = 0; i < ingredients.length; i++) { Item original = mapping.Items[i]; Item consumed = ingredients[i].consumeOnCrafting(original, craftingGrid); Objects.requireNonNull(consumed, "The result of 'ItemIngredient.consumeOnCrafting' can't be null"); if (consumed.count() == 0) { consumed = null; } mapping.setStack(craftingGrid, i, Optional.ofNullable(consumed)); } }
Source:
<code>private NameEnvironmentAnswer findType(String className) { if (className.equals(this.className)) { return new NameEnvironmentAnswer(this, null); } String resourceName = className.replace('.', '/') + ".class"; <START> try <END> { try (InputStream is = UDFunction.udfClassLoader.getResourceAsStream(resourceName)) { if (is != null) { byte[] classBytes = ByteStreams.toByteArray(is); char[] fileName = className.toCharArray(); ClassFileReader classFileReader = new ClassFileReader(classBytes, fileName, true); return new NameEnvironmentAnswer(classFileReader, null); } } } catch (IOException | ClassFormatException exc) { throw new RuntimeException(exc); } return null; }</code><technical_language>Ah - changed part twice. yea, try-catch is absolutely sufficient</technical_language>

Target:
private NameEnvironmentAnswer findType(String className) { if (className.equals(this.className)) { return new NameEnvironmentAnswer(this, null); } String resourceName = className.replace('.', '/') + ".class"; try (InputStream is = UDFunction.udfClassLoader.getResourceAsStream(resourceName)) { if (is != null) { byte[] classBytes = ByteStreams.toByteArray(is); char[] fileName = className.toCharArray(); ClassFileReader classFileReader = new ClassFileReader(classBytes, fileName, true); return new NameEnvironmentAnswer(classFileReader, null); } } catch (IOException | ClassFormatException exc) { throw new RuntimeException(exc); } return null; }
Source:
<code><START> List<String> translate (String rnaSequence) { <END> List proteinList = new ArrayList(); for (int i = 0; i < rnaSequence.length(); i += 3) { String codon = rnaSequence.substring(i, i+3); if (Arrays.asList(METHIONINE).contains(codon)) { proteinList.add("Methionine"); } else if (Arrays.asList(PHENYLALANINE).contains(codon)) { proteinList.add("Phenylalanine"); } else if (Arrays.asList(LEUCINE).contains(codon)) { proteinList.add("Leucine"); } else if (Arrays.asList(SERINE).contains(codon)) { proteinList.add("Serine"); } else if (Arrays.asList(TYROSINE).contains(codon)) { proteinList.add("Tyrosine"); } else if (Arrays.asList(CYSTEINE).contains(codon)) { proteinList.add("Cysteine"); } else if (Arrays.asList(TRYPTOPHAN).contains(codon)) { proteinList.add("Tryptophan"); } else if (Arrays.asList(STOP).contains(codon)) { break; } else { throw new IllegalArgumentException("Invalid input"); } } return proteinList; }</code><technical_language>a space translate :)</technical_language>

Target:
List<String> translate(String rnaSequence) { List<String> proteinList = new ArrayList<String>(); for (int i = 0; i < rnaSequence.length(); i += 3) { String codon = rnaSequence.substring(i, i+3); if (Arrays.asList(METHIONINE).contains(codon)) { proteinList.add("Methionine"); } else if (Arrays.asList(PHENYLALANINE).contains(codon)) { proteinList.add("Phenylalanine"); } else if (Arrays.asList(LEUCINE).contains(codon)) { proteinList.add("Leucine"); } else if (Arrays.asList(SERINE).contains(codon)) { proteinList.add("Serine"); } else if (Arrays.asList(TYROSINE).contains(codon)) { proteinList.add("Tyrosine"); } else if (Arrays.asList(CYSTEINE).contains(codon)) { proteinList.add("Cysteine"); } else if (Arrays.asList(TRYPTOPHAN).contains(codon)) { proteinList.add("Tryptophan"); } else if (Arrays.asList(STOP).contains(codon)) { break; } else { throw new IllegalArgumentException("Invalid input"); } } return proteinList; }
Source:
<code><START> private boolean networksOnNicMatchMtu(List<Network> networksOnNic) { <END> for (int i = 0; i < networksOnNic.size() - 1; i++) { for (int j = i + 1; j < networksOnNic.size(); j++) { final Network network = networksOnNic.get(i); final Network otherNetwork = networksOnNic.get(j); if (network.getMtu() != otherNetwork.getMtu() && !(NetworkUtils.isVlan(otherNetwork) && NetworkUtils.isVlan(otherNetwork))) { return false; } } } return true; }</code><technical_language>I suggest, finding vlan network- if is one. making mtu of other networks equals it. I method clearer way</technical_language>

Target:
private boolean networksOnNicMatchMtu(List<Network> networksOnNic) { final Network nonVlanNetwork = LinqUtils.firstOrNull(networksOnNic, new Predicate<Network>() { @Override public boolean eval(Network network) { return !NetworkUtils.isVlan(network); } }); if (nonVlanNetwork == null) { return true; } final Network mismatchMtuNetwork = LinqUtils.firstOrNull(networksOnNic, new Predicate<Network>() { @Override public boolean eval(Network network) { return network.getMtu() != nonVlanNetwork.getMtu(); } }); return mismatchMtuNetwork == null; }
Source:
<code>public void isEnumCanonicalName() { assertTrue(ScenarioSimulationSharedUtils.isEnumCanonicalName(Enum.class.getCanonicalName())); <START> } <END></code><technical_language>Suggestion: perspective a bit code repetition. please assertTrue(ScenarioSimulationSharedUtils.isEnumCanonicalName("java.lang.Enum")); assertFalse(ScenarioSimulationSharedUtils.isEnumCanonicalName("Enum"));</technical_language>

Target:
public void isEnumCanonicalName() { assertTrue(ScenarioSimulationSharedUtils.isEnumCanonicalName(Enum.class.getCanonicalName())); assertFalse(ScenarioSimulationSharedUtils.isEnumCanonicalName(Enum.class.getSimpleName())); }
Source:
<code>public boolean removeCnxn(NIOServerCnxn cnxn) { if (!cnxns.remove(cnxn)) { return false; } cnxnExpiryQueue.remove(cnxn); long sessionId = cnxn.getSessionId(); if (sessionId != 0) { sessionMap.remove(sessionId); } InetAddress addr = cnxn.getSocketAddress(); if (addr != null) { IpCnxns ipCnxns = ipMap.get(addr); if (ipCnxns != null) { <START> Set<NIOServerCnxn> set = ipCnxns.cnxnSet; <END> set.remove(cnxn); } } unregisterConnection(cnxn); return true; }</code><technical_language>Direct field access... I ipCnxns is internal... awkward yet. :smile:</technical_language>

Target:
public boolean removeCnxn(NIOServerCnxn cnxn) { if (!cnxns.remove(cnxn)) { return false; } cnxnExpiryQueue.remove(cnxn); long sessionId = cnxn.getSessionId(); if (sessionId != 0) { sessionMap.remove(sessionId); } InetAddress addr = cnxn.getSocketAddress(); if (addr != null) { IpCnxns ipCnxns = ipMap.get(addr); if (ipCnxns != null) { Set<NIOServerCnxn> set = ipCnxns.getCnxnSet(); set.remove(cnxn); } } unregisterConnection(cnxn); return true; }
Source:
<code>public void setAccountResolver(AccountResolver accountResolver) { <START> this.accountResolver = accountResolver; <END> }</code><technical_language>Assert.notNull shouldFilter throw</technical_language>

Target:
public void setAccountResolver(AccountResolver accountResolver) { Assert.notNull(accountResolver, "AccountResolver cannot be null."); this.accountResolver = accountResolver; }
Source:
<code>public static Optional<Symbol> rewriteExpression(Map<Symbol, Expression> assignments, Expression expression) { checkArgument(expression instanceof CoalesceExpression, "The rewrite can only handle CoalesceExpression"); List<Expression> expressionOperands = ((CoalesceExpression) expression).getOperands(); checkArgument(expressionOperands.stream().allMatch(SymbolReference.class::isInstance), "Expect operands of CoalesceExpression to be SymbolReference"); Set<Symbol> symboslInExpression = expressionOperands.stream() .filter(SymbolReference.class::isInstance) .map(Symbol::from) .collect(toImmutableSet()); for (Map.Entry<Symbol, Expression> entry : assignments.entrySet()) { if (entry.getValue() instanceof CoalesceExpression) { List<Expression> assignmentOperands = ((CoalesceExpression) entry.getValue()).getOperands(); if (!assignmentOperands.stream().allMatch(SymbolReference.class::isInstance)) { return Optional.empty(); } Set<Symbol> symbolsInAssignment = assignmentOperands.stream() .filter(SymbolReference.class::isInstance) .map(Symbol::from) .collect(toImmutableSet()); <START> if (symbolsInAssignment.equals(symboslInExpression)) { <END> return Optional.of(entry.getKey()); } } } return Optional.empty(); }</code><technical_language>do java if (symbolsInAssignment.size() == assignmentOperands.size() && symbolsInAssignment.equals(symboslInExpression)) { ... } replace condition line 868? -- I wrong semantic equivalence</technical_language>

Target:
private static Optional<Symbol> rewriteExpression(Map<Symbol, Expression> assignments, Expression expression) { checkArgument(expression instanceof CoalesceExpression, "The rewrite can only handle CoalesceExpression"); Set<Expression> expressionOperands = ImmutableSet.copyOf(((CoalesceExpression) expression).getOperands()); checkArgument(expressionOperands.stream().allMatch(SymbolReference.class::isInstance), "Expect operands of CoalesceExpression to be SymbolReference"); for (Map.Entry<Symbol, Expression> entry : assignments.entrySet()) { if (entry.getValue() instanceof CoalesceExpression) { Set<Expression> assignmentOperands = ImmutableSet.copyOf(((CoalesceExpression) entry.getValue()).getOperands()); if (!assignmentOperands.stream().allMatch(SymbolReference.class::isInstance)) { return Optional.empty(); } if (assignmentOperands.equals(expressionOperands)) { return Optional.of(entry.getKey()); } } } return Optional.empty(); }
Source:
<code>public EntityAsyncTask(AsyncTaskParameters parameters, boolean duringInit) { super(parameters); <START> boolean isNewCommanAdded = false; <END> synchronized (_lockObject) { if (!_multiTasksByEntities.containsKey(getContainerId())) { log.infoFormat("EntityAsyncTask::Adding EntityMultiAsyncTasks object for entity '{0}'", getContainerId()); _multiTasksByEntities.put(getContainerId(), new EntityMultiAsyncTasks(getContainerId())); isNewCommanAdded = true; } } if (duringInit && isNewCommanAdded) { CommandBase<?> command = CommandsFactory.CreateCommand(parameters.getDbAsyncTask().getaction_type(), parameters.getDbAsyncTask().getaction_parameters()); if (!command.acquireLockAsyncTask()) { log.warnFormat("Failed to acquire locks for command {0} with parameters {1}", parameters.getDbAsyncTask().getaction_type(), parameters.getDbAsyncTask().getaction_parameters()); } } EntityMultiAsyncTasks entityInfo = GetEntityMultiAsyncTasks(); entityInfo.AttachTask(this); }</code><technical_language>s/isNewCommanAdded/isNewCommandAdded (you forgot "d" end of "Commnand")</technical_language>

Target:
public EntityAsyncTask(AsyncTaskParameters parameters, boolean duringInit) { super(parameters); boolean isNewCommandAdded = false; synchronized (_lockObject) { if (!_multiTasksByEntities.containsKey(getContainerId())) { log.infoFormat("EntityAsyncTask::Adding EntityMultiAsyncTasks object for entity '{0}'", getContainerId()); _multiTasksByEntities.put(getContainerId(), new EntityMultiAsyncTasks(getContainerId())); isNewCommandAdded = true; } } if (duringInit && isNewCommandAdded) { CommandBase<?> command = CommandsFactory.CreateCommand(parameters.getDbAsyncTask().getaction_type(), parameters.getDbAsyncTask().getaction_parameters()); if (!command.acquireLockAsyncTask()) { log.warnFormat("Failed to acquire locks for command {0} with parameters {1}", parameters.getDbAsyncTask().getaction_type(), parameters.getDbAsyncTask().getaction_parameters()); } } EntityMultiAsyncTasks entityInfo = GetEntityMultiAsyncTasks(); entityInfo.AttachTask(this); }
Source:
<code>public static StorageAuthenticationSettings fromConnectionSettings(final ConnectionSettings settings) { final String accountName = settings.getSettingValue(Constants.ConnectionStringConstants.ACCOUNT_NAME_NAME); final String accountKey = settings.getSettingValue(Constants.ConnectionStringConstants.ACCOUNT_KEY_NAME); final String sasSignature = settings.getSettingValue(Constants.ConnectionStringConstants.SHARED_ACCESS_SIGNATURE_NAME); <START> if (accountName != null && accountKey != null && sasSignature == null) { <END> return new StorageAuthenticationSettings(new Account(accountName, accountKey)); } if (accountKey == null && sasSignature != null) { return new StorageAuthenticationSettings(sasSignature); } return new StorageAuthenticationSettings(); }</code><technical_language>If account name key null, get block. need check sas, right</technical_language>

Target:
public static StorageAuthenticationSettings fromConnectionSettings(final ConnectionSettings settings) { final String accountName = settings.getSettingValue(Constants.ConnectionStringConstants.ACCOUNT_NAME); final String accountKey = settings.getSettingValue(Constants.ConnectionStringConstants.ACCOUNT_KEY_NAME); final String sasSignature = settings.getSettingValue(Constants.ConnectionStringConstants.SHARED_ACCESS_SIGNATURE_NAME); if (accountName != null && accountKey != null && sasSignature == null) { return new StorageAuthenticationSettings(new Account(accountName, accountKey)); } if (accountKey == null && sasSignature != null) { return new StorageAuthenticationSettings(sasSignature); } return new StorageAuthenticationSettings(); }
Source:
<code><START> private JExpression getExitMessage(ExecutableElement element, JMethod method, JVar result, JVar duration) throws ClassNotFoundException { <END> JInvocation format = refClass(String.class).staticInvoke("format"); String returnType = element.getReturnType().toString(); String simpleName = element.getSimpleName().toString(); String methodName = returnType + " " + simpleName; List<JVar> params = method.params(); StringBuilder paramStr = new StringBuilder(); for (int i = 0; i < params.size(); i++) { if (i > 0) { paramStr.append(", "); } JVar var = params.get(i); paramStr.append(var.type().name()); } methodName += "(" + paramStr.toString() + ")"; if (result == null) { format.arg("Exiting [" + methodName + "], duration in ms: %d"); } else { format.arg("Exiting [" + methodName + " returning: %s], duration in ms: %d"); if (method.type().isArray()) { JClass arraysClass = refClass(Arrays.class); format.arg(arraysClass.staticInvoke("toString").arg(JExpr.cast(boxify(method.type()), result))); } else { format.arg(result); } } return format.arg(duration); }</code><technical_language>This getEnterMessage() code duplications. Please extract duplicated parts methods</technical_language>

Target:
private JExpression getExitMessage(ExecutableElement element, JMethod method, JVar result, JVar duration) throws ClassNotFoundException { String methodName = getMethodName(element); List<JVar> params = method.params(); StringBuilder paramStr = new StringBuilder(); for (int i = 0; i < params.size(); i++) { if (i > 0) { paramStr.append(", "); } JVar var = params.get(i); paramStr.append(var.type().name()); } methodName += "(" + paramStr.toString() + ")"; JInvocation format = refClass(String.class).staticInvoke("format"); if (result == null) { format.arg("Exiting [" + methodName + "], duration in ms: %d"); } else { format.arg("Exiting [" + methodName + " returning: %s], duration in ms: %d"); if (method.type().isArray()) { JClass arraysClass = refClass(Arrays.class); format.arg(arraysClass.staticInvoke("toString").arg(JExpr.cast(boxify(method.type()), result))); } else { format.arg(result); } } return format.arg(duration); }
Source:
<code>public static byte[] bigIntegerToBytes(BigInteger b, int numBytes) { <START> checkArgument(b.signum()>1, "We assume only positive numbers"); <END> byte[] src = b.toByteArray(); byte[] dest = new byte[numBytes]; checkArgument((src[0]==0) ? src.length-1<=numBytes : src.length<=numBytes, "The given number does not fit in "+numBytes); int srcPos = (src[0]==0) ? 1 : 0; int destPos = numBytes - src.length; System.arraycopy(src, srcPos, dest, destPos, src.length); return dest; }</code><technical_language>Hu, signum() is > 1. Do > 0? >= 0, 0 a valid for this method (although a private key)</technical_language>

Target:
public static byte[] bigIntegerToBytes(BigInteger b, int numBytes) { checkArgument(b.signum() >= 0, "b must be positive or zero"); checkArgument(numBytes > 0, "numBytes must be positive"); byte[] src = b.toByteArray(); byte[] dest = new byte[numBytes]; boolean isFirstByteOnlyForSign = src[0] == 0; int length = isFirstByteOnlyForSign ? src.length - 1 : src.length; checkArgument(length <= numBytes, "The given number does not fit in " + numBytes); int srcPos = isFirstByteOnlyForSign ? 1 : 0; int destPos = numBytes - length; System.arraycopy(src, srcPos, dest, destPos, length); return dest; }
Source:
<code><START> public DnsClient createDnsClient() { <END> InetSocketAddress address = DefaultDnsServerAddressStreamProvider.defaultAddresses() .stream() .next(); return new DnsClientImpl(this, address.getPort(), address.getAddress().getHostAddress(), DnsClientOptions.DEFAULT_QUERY_TIMEOUT); }</code><technical_language>yes, add a method DnsResolverProvider provides server address (the one) stream nameServerAddresses a field of DnsResolverProvider a method returns it, building client, a List</technical_language>

Target:
public DnsClient createDnsClient() { DnsResolverProvider provider = new DnsResolverProvider(this, addressResolverOptions); InetSocketAddress address = provider.nameServerAddresses().get(0); return new DnsClientImpl(this, address.getPort(), address.getAddress().getHostAddress(), DnsClientOptions.DEFAULT_QUERY_TIMEOUT); }
Source:
<code>private int checkAllPillData(final long lastTimestampMillis) { <START> long timestampDiff = lastTimestampMillis - this.lastRecordDTMillis; <END> if (timestampDiff > 0 && timestampDiff < this.dateMinuteBucketMillis) { return 0; } if (timestampDiff > 0) { this.lastRecordDTMillis = lastTimestampMillis; } int added = 0; for (final String pillID : this.pillAccountID.keySet()) { if (!this.toProccessedIDs.contains(pillID)) { final SensorSample lastSample = this.pillData.get(pillID).last(); if (this.lastRecordDTMillis - lastSample.dateTime.getMillis() > this.tooOldThreshold) { this.toProccessedIDs.add(pillID); } } } return added; }</code><technical_language>final</technical_language>

Target:
private int checkAllPillData(final long lastTimestampMillis) { final long timestampDiff = lastTimestampMillis - this.lastRecordDTMillis; if (timestampDiff > 0 && timestampDiff < this.dateMinuteBucketMillis) { return 0; } if (timestampDiff > 0) { this.lastRecordDTMillis = lastTimestampMillis; } int added = 0; for (final String pillID : this.pillAccountID.keySet()) { if (!this.toProccessedIDs.contains(pillID)) { final PillSample lastSample = this.pillData.get(pillID).last(); if (this.lastRecordDTMillis - lastSample.dateTime.getMillis() > this.tooOldThreshold) { this.toProccessedIDs.add(pillID); } } } return added; }
Source:
<code>public void onPartitionsAssigned(Collection<TopicPartition> partitions) { _consumerMetrics.updateRebalanceRate(1); LOG.info("Partition ownership assigned for {}.", partitions); <START> _flushlessProducer.clear(); <END> }</code><technical_language>this work, If does, do sense clear out offsets for partitions reassigned, This checkpoint state for partitions get reassigned</technical_language>

Target:
public void onPartitionsAssigned(Collection<TopicPartition> partitions) { _consumerMetrics.updateRebalanceRate(1); LOG.info("Partition ownership assigned for {}.", partitions); }
Source:
<code>public void testConvertToDataModelTypeEmptyIds() { mongoVariant.put(uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantConverter.IDS_FIELD, new HashSet<String>()); <START> uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantConverter converter = new uk.ac.ebi.eva.commons.models.converters.data.DBObjectToVariantConverter(); <END> Variant converted = converter.convert(mongoVariant); assertNotNull(converted.getIds()); assertTrue(converted.getIds().isEmpty()); variant.setIds(new HashSet<String>()); assertEquals(variant, converted); }</code><technical_language>Full qualification is needed</technical_language>

Target:
public void testConvertToDataModelTypeEmptyIds() { mongoVariant.put(DBObjectToVariantConverter.IDS_FIELD, new HashSet<String>()); DBObjectToVariantConverter converter = new DBObjectToVariantConverter(); Variant converted = converter.convert(mongoVariant); assertNotNull(converted.getIds()); assertTrue(converted.getIds().isEmpty()); variant.setIds(new HashSet<String>()); assertEquals(variant, converted); }
Source:
<code>public static void setTrace(TraceState state) { <START> STATE.get().clear(); <END> STATE.get().push(state); }</code><technical_language>want STATE.remove() clear if deques grow significantly default size, allow shrinking</technical_language>

Target:
public static void setTrace(TraceState state) { STATE.remove(); STATE.get().push(state); }
Source:
<code>public Protocol getProtocol(Class iface) { Protocol protocol = new Protocol(iface.getSimpleName(), iface.getPackage() == null ? "" : iface.getPackage().getName()); Map<String, Schema> names = new LinkedHashMap<>(); Map<String, Message> messages = protocol.getMessages(); Map<TypeVariable<?>, Type> genericTypeVariableMap = ReflectionUtil.resolveTypeVariables(iface); <START> for (Method method : iface.getMethods()) <END> if ((method.getModifiers() & Modifier.STATIC) == 0) { String name = method.getName(); if (messages.containsKey(name)) throw new AvroTypeException("Two methods with same name: " + name); messages.put(name, getMessage(method, protocol, names, genericTypeVariableMap)); } List<Schema> types = new ArrayList<>(names.values()); Collections.reverse(types); protocol.setTypes(types); return protocol; }</code><technical_language>part of PR, add brackets here, awkward</technical_language>

Target:
public Protocol getProtocol(Class iface) { Protocol protocol = new Protocol(iface.getSimpleName(), iface.getPackage() == null ? "" : iface.getPackage().getName()); Map<String, Schema> names = new LinkedHashMap<>(); Map<String, Message> messages = protocol.getMessages(); Map<TypeVariable<?>, Type> genericTypeVariableMap = ReflectionUtil.resolveTypeVariables(iface); for (Method method : iface.getMethods()) { if ((method.getModifiers() & Modifier.STATIC) == 0) { String name = method.getName(); if (messages.containsKey(name)) throw new AvroTypeException("Two methods with same name: " + name); messages.put(name, getMessage(method, protocol, names, genericTypeVariableMap)); } } List<Schema> types = new ArrayList<>(names.values()); Collections.reverse(types); protocol.setTypes(types); return protocol; }
Source:
<code>public void unretireProvider_shouldUnretireAProvider() throws Exception { <START> Provider provider = service.getProvider(2); <END> service.unretireProvider(provider); assertFalse(provider.isRetired()); assertNull(provider.getRetireReason()); }</code><technical_language>Do mind explaining a bit this changed necessitated a switch 1 2 for provider id</technical_language>

Target:
public void unretireProvider_shouldUnretireAProvider() { Provider provider = service.getProvider(2); service.unretireProvider(provider); assertFalse(provider.getRetired()); assertNull(provider.getRetireReason()); }
Source:
<code>private void loadUefiProperties() throws FileNotFoundException { if (_uefiProperties != null && _uefiProperties.getProperty("guest.loader.legacy") != null) return; final File file = PropertiesUtil.findConfigFile("uefi.properties"); if (file == null) { throw new FileNotFoundException("Unable to find uefi.properties."); } <START> s_logger.info("uefi.properties found at " + file.getAbsolutePath()); <END> try { PropertiesUtil.loadFromFile(_uefiProperties, file); s_logger.info("guest.nvram.template.legacy = " + _uefiProperties.getProperty("guest.nvram.template.legacy")); s_logger.info("guest.loader.legacy = " + _uefiProperties.getProperty("guest.loader.legacy")); } catch (final FileNotFoundException ex) { throw new CloudRuntimeException("Cannot find the file: " + file.getAbsolutePath(), ex); } catch (final IOException ex) { throw new CloudRuntimeException("IOException in reading " + file.getAbsolutePath(), ex); } }</code><technical_language>Please add braces this if condition</technical_language>

Target:
private void loadUefiProperties() throws FileNotFoundException { if (_uefiProperties != null && _uefiProperties.getProperty("guest.loader.legacy") != null) { return; } final File file = PropertiesUtil.findConfigFile("uefi.properties"); if (file == null) { throw new FileNotFoundException("Unable to find file uefi.properties."); } s_logger.info("uefi.properties file found at " + file.getAbsolutePath()); try { PropertiesUtil.loadFromFile(_uefiProperties, file); s_logger.info("guest.nvram.template.legacy = " + _uefiProperties.getProperty("guest.nvram.template.legacy")); s_logger.info("guest.loader.legacy = " + _uefiProperties.getProperty("guest.loader.legacy")); s_logger.info("guest.nvram.template.secure = " + _uefiProperties.getProperty("guest.nvram.template.secure")); s_logger.info("guest.loader.secure =" + _uefiProperties.getProperty("guest.loader.secure")); s_logger.info("guest.nvram.path = " + _uefiProperties.getProperty("guest.nvram.path")); } catch (final FileNotFoundException ex) { throw new CloudRuntimeException("Cannot find the file: " + file.getAbsolutePath(), ex); } catch (final IOException ex) { throw new CloudRuntimeException("IOException in reading " + file.getAbsolutePath(), ex); } }
Source:
<code>public void updateUsage(List<Quota> quotaList) { List<Quota> needToCache = new ArrayList<Quota>(); lock.readLock().lock(); <START> try { <END> for (Quota quotaExternal : quotaList) { Quota quota = null; for (Map<Guid, Quota> quotaMap : storagePoolQuotaMap.values()) { quota = quotaMap.get(quotaExternal.getId()); if (quota != null) { break; } } if (quota == null) { needToCache.add(quotaExternal); } else { copyUsageData(quota, quotaExternal); } } } finally { lock.readLock().unlock(); } if (!needToCache.isEmpty()) { lock.writeLock().lock(); try { for (Quota quotaExternal : needToCache) { Quota quota = null; for (Map<Guid, Quota> quotaMap : storagePoolQuotaMap.values()) { quota = quotaMap.get(quotaExternal.getId()); if (quota != null) { break; } } if (quota == null) { quota = getQuotaDAO().getById(quotaExternal.getId()); if (quota != null) { if (!storagePoolQuotaMap.containsKey(quota.getStoragePoolId())) { storagePoolQuotaMap.put(quota.getStoragePoolId(), new HashMap<Guid, Quota>()); } storagePoolQuotaMap.get(quota.getStoragePoolId()).put(quota.getId(), quota); } } copyUsageData(quota, quotaExternal); } } finally { lock.writeLock().unlock(); } } }</code><technical_language>please check for quotaList for null</technical_language>

Target:
public void updateUsage(List<Quota> quotaList) { List<Quota> needToCache = new ArrayList<Quota>(); if (quotaList == null) { return; } lock.readLock().lock(); try { for (Quota quotaExternal : quotaList) { Map<Guid, Quota> quotaMap = storagePoolQuotaMap.get(quotaExternal.getStoragePoolId()); Quota quota = null; if (quotaMap != null) { quota = quotaMap.get(quotaExternal.getId()); } if (quota == null) { needToCache.add(quotaExternal); } else { copyUsageData(quota, quotaExternal); } } } finally { lock.readLock().unlock(); } if (!needToCache.isEmpty()) { lock.writeLock().lock(); try { for (Quota quotaExternal : needToCache) { if (!storagePoolQuotaMap.containsKey(quotaExternal.getStoragePoolId())) { storagePoolQuotaMap.put(quotaExternal.getStoragePoolId(), new HashMap<Guid, Quota>()); } Quota quota = fetchQuotaFromCache(quotaExternal.getId(), quotaExternal.getStoragePoolId()); if (quota != null) { copyUsageData(quota, quotaExternal); } } } finally { lock.writeLock().unlock(); } } }
Source:
<code>public void namespaceAwareUpsert(SQLiteDatabase db, T obj, String tableName, String primaryKeySelection, String[] primaryKeySelectionArgs) { Cursor existingEntries = namespaceAwareSelect(db, tableName, primaryKeySelection, primaryKeySelectionArgs); if (existingEntries.getCount() == 0) { WikipediaApp.getInstance().getPersister(obj.getClass()).persist(obj); } else { ContentValues cv = toContentValues(obj); if (cv.containsKey("timestamp")) { updateDbEntryTimestamp(db, tableName, primaryKeySelection, primaryKeySelectionArgs, getTimestampString(cv)); } } <START> WikipediaApp.getInstance().getContentResolver().notifyChange(getBaseContentURI(), null); <END> }</code><technical_language>a method called notifyAdapters() (I this does). Is get ContentProvider call this method drill app notify it? (Sorry again, fuzzy this area of code.)</technical_language>

Target:
public void namespaceAwareUpsert(SQLiteDatabase db, T obj, String tableName, String primaryKeySelection, String[] primaryKeySelectionArgs) { Cursor existingEntries = namespaceAwareSelect(db, tableName, primaryKeySelection, primaryKeySelectionArgs); if (existingEntries.getCount() == 0) { WikipediaApp.getInstance().getPersister(obj.getClass()).persist(obj); } else { ContentValues cv = toContentValues(obj); if (cv.containsKey("timestamp")) { updateDbEntryTimestamp(db, tableName, primaryKeySelection, primaryKeySelectionArgs, getTimestampString(cv)); } } notifyAdapters(); }
Source:
<code>protected synchronized void modified(Map<String, Object> config) { <START> logger.info("Modifying the configuration of the firmware update service."); <END> if (!isValid(config)) { return; } cancelFirmwareUpdateStatusInfoJob(); firmwareStatusInfoJobPeriod = config.containsKey(PERIOD_CONFIG_KEY) ? (Integer) config.get(PERIOD_CONFIG_KEY) : firmwareStatusInfoJobPeriod; firmwareStatusInfoJobDelay = config.containsKey(DELAY_CONFIG_KEY) ? (Integer) config.get(DELAY_CONFIG_KEY) : firmwareStatusInfoJobDelay; firmwareStatusInfoJobTimeUnit = config.containsKey(TIME_UNIT_CONFIG_KEY) ? TimeUnit.valueOf((String) config.get(TIME_UNIT_CONFIG_KEY)) : firmwareStatusInfoJobTimeUnit; if (!firmwareUpdateHandlers.isEmpty()) { createFirmwareUpdateStatusInfoJob(); } }</code><technical_language>debug level enough</technical_language>

Target:
protected synchronized void modified(Map<String, Object> config) { logger.debug("Modifying the configuration of the firmware update service."); if (!isValid(config)) { return; } cancelFirmwareUpdateStatusInfoJob(); firmwareStatusInfoJobPeriod = config.containsKey(PERIOD_CONFIG_KEY) ? (Integer) config.get(PERIOD_CONFIG_KEY) : firmwareStatusInfoJobPeriod; firmwareStatusInfoJobDelay = config.containsKey(DELAY_CONFIG_KEY) ? (Integer) config.get(DELAY_CONFIG_KEY) : firmwareStatusInfoJobDelay; firmwareStatusInfoJobTimeUnit = config.containsKey(TIME_UNIT_CONFIG_KEY) ? TimeUnit.valueOf((String) config.get(TIME_UNIT_CONFIG_KEY)) : firmwareStatusInfoJobTimeUnit; if (!firmwareUpdateHandlers.isEmpty()) { createFirmwareUpdateStatusInfoJob(); } }
Source:
<code><START> public void setFinal(boolean ffinal) { <END> this._final = ffinal; }</code><technical_language>Boolean _final</technical_language>

Target:
public void setFinal(boolean ffinal) { this.ffinal = ffinal; }
Source:
<code>public void transform(StructuredRecord input, Emitter<StructuredRecord> emitter) { try { InputSource source = new InputSource(new StringReader((String) input.get(config.inputField))); source.setEncoding(config.encoding); DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder = builderFactory.newDocumentBuilder(); Document document = documentBuilder.parse(source); XPathFactory xpathFactory = XPathFactory.newInstance(); XPath xpath = xpathFactory.newXPath(); StructuredRecord.Builder builder = StructuredRecord.builder(outSchema); for (Schema.Field field : outSchema.getFields()) { String fieldName = field.getName(); NodeList nodeList = (NodeList) xpath.compile(xPathMapping.get(fieldName)).evaluate(document, XPathConstants.NODESET); if (nodeList.getLength() > 1) { throw new IllegalArgumentException("Cannot specify an XPath that is an array"); } Node node = nodeList.item(0); Schema.Type type = field.getSchema().getNonNullable().getType(); String value = getValue(node, type, fieldName); if (value == null) { builder.set(fieldName, null); } else { builder.set(fieldName, TypeConvertor.get(value, type)); } } emitter.emit(builder.build()); } catch (Exception e) { switch (config.processOnError) { case EXIT_ON_ERROR: <START> throw new IllegalStateException("Terminating process on error: " + e.getMessage()); <END> case WRITE_ERROR_DATASET: emitter.emitError(new InvalidEntry<>(31, e.getStackTrace()[0].toString() + " : " + e.getMessage(), input)); break; default: break; } } }</code><technical_language>pass e parameter, entire stack trace is lost</technical_language>

Target:
public void transform(StructuredRecord input, Emitter<StructuredRecord> emitter) { try { InputSource source = new InputSource(new StringReader((String) input.get(config.inputField))); source.setEncoding(config.encoding); DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder documentBuilder = builderFactory.newDocumentBuilder(); Document document = documentBuilder.parse(source); XPathFactory xpathFactory = XPathFactory.newInstance(); XPath xpath = xpathFactory.newXPath(); StructuredRecord.Builder builder = StructuredRecord.builder(outSchema); for (Schema.Field field : outSchema.getFields()) { String fieldName = field.getName(); NodeList nodeList = (NodeList) xpath.compile(xPathMapping.get(fieldName)).evaluate(document, XPathConstants.NODESET); if (nodeList.getLength() > 1) { throw new IllegalArgumentException("Cannot specify an XPath that is an array"); } Node node = nodeList.item(0); Schema.Type type = field.getSchema().getNonNullable().getType(); String value = getValue(node, type, fieldName); if (value == null) { builder.set(fieldName, null); } else { builder.set(fieldName, TypeConvertor.get(value, type)); } } emitter.emit(builder.build()); } catch (Exception e) { switch (config.processOnError) { case EXIT_ON_ERROR: throw new IllegalStateException("Terminating process on error: " + e.getMessage(), e); case WRITE_ERROR_DATASET: emitter.emitError(new InvalidEntry<>(31, e.getStackTrace()[0].toString() + " : " + e.getMessage(), input)); break; default: break; } } }
Source:
<code>private JerseyRequest<ReportInputControlsListWrapper> buildRequest(){ JerseyRequest<ReportInputControlsListWrapper> request = JerseyRequest.buildRequest(sessionStorage, ReportInputControlsListWrapper.class, <START> new String[]{"/reports", containerUri, "/inputControls"}, <END> new DefaultErrorHandler()); if (excludeState) { request.addParam("exclude", "state"); } return request; }</code><technical_language>I containerUri null if user set explicitly. Please throw some exception indicating container set</technical_language>

Target:
private JerseyRequest<ReportInputControlsListWrapper> buildRequest(){ if (containerUri == null) { throw new MandatoryParameterNotFoundException("Uri of container should be specified"); } JerseyRequest<ReportInputControlsListWrapper> request = JerseyRequest.buildRequest(sessionStorage, ReportInputControlsListWrapper.class, new String[]{"/reports", containerUri, "/inputControls"}, new DefaultErrorHandler()); if (excludeState) { request.addParam("exclude", "state"); } return request; }
Source:
<code>protected String[] getElementMetadata(int recordId, String[] metaFields, QueryContext context) { if (context == null || this.parent.getStorageCacheName() == null) { return parent.storage.getMetaDataForRecord(recordId, metaFields); } <START> RecordSetResultCache recordSetCache = context.getQueryCacheOrNull(RecordSetResultCache.class); <END> String recordSetKey = parent.getStorageCacheName(); String recordObjectKey = parent.getStorageCacheName() + "_partial"; RecordObjectCache<String[]> recordObjectCache = StorageInstanceTreeElement.getRecordObjectCacheIfRelevant( context); if (recordObjectCache != null) { if (recordObjectCache.isLoaded(recordObjectKey, recordId)) { return recordObjectCache.getLoadedRecordObject(recordObjectKey, recordId); } if (StorageInstanceTreeElement.canLoadRecordFromGroup(recordSetCache, recordSetKey, recordId)) { Pair<String, LinkedHashSet<Integer>> tranche = recordSetCache.getRecordSetForRecordId(recordSetKey, recordId); EvaluationTrace loadTrace = new EvaluationTrace(String.format("Model [%s]: Limited Scope Partial Bulk Load [%s}", recordObjectKey,tranche.first)); LinkedHashSet<Integer> body = tranche.second; parent.getStorage().bulkReadMetadata(body, metaFields, recordObjectCache.getLoadedCaseMap(recordObjectKey)); loadTrace.setOutcome("Loaded: " + body.size()); context.reportTrace(loadTrace); return recordObjectCache.getLoadedRecordObject(recordObjectKey, recordId); } } return parent.storage.getMetaDataForRecord(recordId, metaFields); }</code><technical_language>happening end of this method. explain a bit, move this code a well-named helper method</technical_language>

Target:
protected String[] getElementMetadata(int recordId, String[] metaFields, QueryContext context) { if (context == null || this.parent.getStorageCacheName() == null) { return readSingleRecordMetadataFromStorage(recordId, metaFields); } RecordObjectCache<String[]> recordObjectCache = StorageInstanceTreeElement.getRecordObjectCacheIfRelevant( context); String recordObjectKey = parent.getStorageCacheName() + "_partial"; if (recordObjectCache == null) { return readSingleRecordMetadataFromStorage(recordId, metaFields); } if (recordObjectCache.isLoaded(recordObjectKey, recordId)) { return recordObjectCache.getLoadedRecordObject(recordObjectKey, recordId); } RecordSetResultCache recordSetCache = context.getQueryCacheOrNull(RecordSetResultCache.class); String recordSetKey = parent.getStorageCacheName(); if (!StorageInstanceTreeElement.canLoadRecordFromGroup(recordSetCache, recordSetKey, recordId)) { return readSingleRecordMetadataFromStorage(recordId, metaFields); } return populateMetaDataCacheAndReadForRecord(recordSetCache, recordSetKey, recordObjectCache, recordObjectKey, metaFields, context); }
Source:
<code>public LamiTableContentProvider() { fCurrentEntries = <START> checkNotNull(Collections.emptyList()); <END> }</code><technical_language>remove checkNotNull, external @NonNull annotation Collections.emptyList()</technical_language>

Target:
public LamiTableContentProvider() { fCurrentEntries = Collections.emptyList(); }
Source:
<code>public void testAppFromOnlyConfigPackage() throws Exception { ApexCli.LaunchCommandLineInfo commandLineInfo = ApexCli .getLaunchCommandLineInfo(new String[]{"-conf", configFile.getAbsolutePath(), appFile.getAbsolutePath(), "-useConfigApps", "exclusive"}); ApexCli apexCli = new ApexCli(); apexCli.init(); Assert.assertEquals("configApps", "exclusive", commandLineInfo.useConfigApps); apexCli.getLaunchAppPackageArgs(ap, cp, commandLineInfo, new ConsoleReader()); <START> Assert.assertEquals(ap.getApplications().size(), 1); <END> }</code><technical_language>add verification of element of application list? check name matches a json app</technical_language>

Target:
public void testAppFromOnlyConfigPackage() throws Exception { ApexCli.LaunchCommandLineInfo commandLineInfo = ApexCli .getLaunchCommandLineInfo(new String[]{"-conf", configFile.getAbsolutePath(), appFile.getAbsolutePath(), "-useConfigApps", "exclusive"}); ApexCli apexCli = new ApexCli(); apexCli.init(); Assert.assertEquals("configApps", "exclusive", commandLineInfo.useConfigApps); apexCli.getLaunchAppPackageArgs(ap, cp, commandLineInfo, new ConsoleReader()); Assert.assertEquals(ap.getApplications().size(), 1); Assert.assertEquals(ap.getApplications().get(0).displayName, "testApp"); Assert.assertEquals(ap.getApplications().get(0).type, "json"); }