auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public String serialize(SenMLPack pack) { JsonArray jsonArray = new JsonArray(); for (int i = 0; i < pack.getRecords().size(); i++) { JsonObject jsonObj = new JsonObject(); if (i == 0 && pack.getBaseName() != null) { jsonObj.add("bn", pack.getBaseName()); } if (i == 0 && pack.getBaseTime() != null) { jsonObj.add("bt", pack.getBaseTime()); } SenMLRecord records = pack.getRecords().get(i); if (records.getName() != null && records.getName().length() > 0) { jsonObj.add("n", records.getName()); } if (records.getTime() != null) { jsonObj.add("t", records.getTime()); } Type type = records.getType(); if (type != null) { switch (records.getType()) { case FLOAT: case INTEGER: jsonObj.add("v", records.getFloatValue().floatValue()); break; case BOOLEAN: jsonObj.add("vb", records.getBooleanValue()); break; case OBJLNK: <START> jsonObj.add("vd", records.getObjectLinkValue()); <END> break; case OPAQUE: jsonObj.add("vd", Hex.encodeHexString(records.getOpaqueValue())); case STRING: jsonObj.add("vs", records.getStringValue()); break; case TIME: jsonObj.add("v", records.getTimeValue()); default: break; } } jsonArray.add(jsonObj); } return jsonArray.toString(); }</code><technical_language>objlink is vlo</technical_language>

Target:
public String serialize(SenMLPack pack) { JsonArray jsonArray = new JsonArray(); for (SenMLRecord record : pack.getRecords()) { JsonObject jsonObj = new JsonObject(); if (record.getBaseName() != null && record.getBaseName().length() > 0) { jsonObj.add("bn", record.getBaseName()); } if (record.getBaseTime() != null) { jsonObj.add("bt", record.getBaseTime()); } if (record.getName() != null && record.getName().length() > 0) { jsonObj.add("n", record.getName()); } if (record.getTime() != null) { jsonObj.add("t", record.getTime()); } Type type = record.getType(); if (type != null) { switch (record.getType()) { case FLOAT: jsonObj.add("v", record.getFloatValue().floatValue()); break; case BOOLEAN: jsonObj.add("vb", record.getBooleanValue()); break; case OBJLNK: jsonObj.add("vlo", record.getObjectLinkValue()); break; case OPAQUE: jsonObj.add("vd", Base64.encodeBase64String(record.getOpaqueValue())); case STRING: jsonObj.add("vs", record.getStringValue()); break; default: break; } } jsonArray.add(jsonObj); } return jsonArray.toString(); }
Source:
<code>public void setup(final ManagementClient managementClient, final String containerId) throws Exception { final ModelNode operation = Util.createAddOperation(ADDRESS_JMS_BRIDGE); operation.get(JMSBridgeDefinition.SOURCE_CONNECTION_FACTORY.getName()).set("java:jboss/jms/XAConnectionFactory"); operation.get(JMSBridgeDefinition.SOURCE_DESTINATION.getName()).set("java:jboss/jms/queue/sourceQueue"); operation.get(JMSBridgeDefinition.TARGET_CONNECTION_FACTORY.getName()).set("jms/XAConnectionFactory"); operation.get(JMSBridgeDefinition.TARGET_DESTINATION.getName()).set("/jms/queue/targetQueue"); operation.get(JMSBridgeDefinition.TARGET_CONTEXT.getName(), "java.naming.factory.initial").set( "org.jboss.naming.remote.client.InitialContextFactory"); <START> operation.get(JMSBridgeDefinition.TARGET_CONTEXT.getName(), "java.naming.provider.url").set("http-remoting://localhost:8080 "); <END> operation.get(JMSBridgeDefinition.QUALITY_OF_SERVICE.getName()).set("ONCE_AND_ONLY_ONCE"); operation.get(JMSBridgeDefinition.FAILURE_RETRY_INTERVAL.getName()).set(60); operation.get(JMSBridgeDefinition.MAX_RETRIES.getName()).set("-1"); operation.get(JMSBridgeDefinition.MAX_BATCH_SIZE.getName()).set("10"); operation.get(JMSBridgeDefinition.MAX_BATCH_TIME.getName()).set("500"); operation.get(JMSBridgeDefinition.ADD_MESSAGE_ID_IN_HEADER.getName()).set("true"); final ModelNode result = managementClient.getControllerClient().execute(operation); Assert.assertTrue(result.toString(), Operations.isSuccessfulOutcome(result)); }</code><technical_language>localhost</technical_language>

Target:
public void setup(final ManagementClient managementClient, final String containerId) throws Exception { final JMSOperations jmsOperations = JMSOperationsProvider.getInstance(managementClient.getControllerClient()); final ModelNode attributes = new ModelNode(); attributes.get(JMSBridgeDefinition.SOURCE_CONNECTION_FACTORY.getName()).set("java:jboss/jms/XAConnectionFactory"); attributes.get(JMSBridgeDefinition.SOURCE_DESTINATION.getName()).set("java:jboss/jms/queue/sourceQueue"); attributes.get(JMSBridgeDefinition.TARGET_CONNECTION_FACTORY.getName()).set("jms/XAConnectionFactory"); attributes.get(JMSBridgeDefinition.TARGET_DESTINATION.getName()).set("/jms/queue/targetQueue"); attributes.get(JMSBridgeDefinition.TARGET_CONTEXT.getName(), "java.naming.factory.initial").set( "org.jboss.naming.remote.client.InitialContextFactory"); attributes.get(JMSBridgeDefinition.TARGET_CONTEXT.getName(), "java.naming.provider.url").set("http-remoting://"+managementClient.getMgmtAddress()+":8080 "); attributes.get(JMSBridgeDefinition.QUALITY_OF_SERVICE.getName()).set("ONCE_AND_ONLY_ONCE"); attributes.get(JMSBridgeDefinition.FAILURE_RETRY_INTERVAL.getName()).set(60); attributes.get(JMSBridgeDefinition.MAX_RETRIES.getName()).set("-1"); attributes.get(JMSBridgeDefinition.MAX_BATCH_SIZE.getName()).set("10"); attributes.get(JMSBridgeDefinition.MAX_BATCH_TIME.getName()).set("500"); attributes.get(JMSBridgeDefinition.ADD_MESSAGE_ID_IN_HEADER.getName()).set("true"); jmsOperations.addJmsBridge(NAME_BRIDGE, attributes); }
Source:
<code>static Scheduler applyRequireNonNull(Function<Callable<Scheduler>, Scheduler> f, Callable<Scheduler> s) { <START> return ObjectHelper.requireNonNull(apply(f, s), "Scheduler Callable result can't be null"); <END> }</code><technical_language>Null check</technical_language>

Target:
static Scheduler applyRequireNonNull(Function<Callable<Scheduler>, Scheduler> f, Callable<Scheduler> s) { Scheduler scheduler = apply(f,s); if (scheduler == null) { throw new NullPointerException("Scheduler Callable returned null"); } return scheduler; }
Source:
<code>protected void onOperatingRateChanged(float operatingRate) { codecOperatingRate = operatingRate; <START> if (codec != null && format != null) { <END> updateCodecOperatingRate(format); } }</code><technical_language>I checking codec is sufficient. exist a codec if format is null (I think)</technical_language>

Target:
protected void onOperatingRateChanged(float operatingRate) { codecOperatingRate = operatingRate; if (format != null) { updateCodecOperatingRate(codec, format, operatingRate); } }
Source:
<code>private void verifyNonSpamming(final User user) { <START> final long currentTime = System.currentTimeMillis(); <END> if (messages.stream().filter((message) -> { return message.getUserId() == user.getId() && message.getTimestamp() + TimeUnit.SECONDS.toMillis(MESSAGE_FLOODING_TIMEOUT) > currentTime; }).count() > MESSAGE_FLOODING_MESSAGE_AMOUNT) { throw new IllegalArgumentException("You can not post more than " + MESSAGE_FLOODING_MESSAGE_AMOUNT + " message within " + MESSAGE_FLOODING_TIMEOUT + " seconds"); } }</code><technical_language>I doubting if needed @JWGmeligMeyling needed shoud deleted. I deleted part</technical_language>

Target:
private void verifyNonSpamming(final User user) { if (user.getId().equals(1)) { return; } final long currentTime = System.currentTimeMillis(); if (messages.stream().filter((message) -> { return message.getUserId() == user.getId() && message.getTimestamp() + TimeUnit.SECONDS.toMillis(MESSAGE_FLOODING_TIMEOUT) > currentTime; }).count() > MESSAGE_FLOODING_MESSAGE_AMOUNT) { throw new IllegalArgumentException("You can not post" + MESSAGE_FLOODING_MESSAGE_AMOUNT + "messages within " + MESSAGE_FLOODING_TIMEOUT + " seconds"); } }
Source:
<code>boolean isValid(String stringToVerify) { String isbn; <START> isbn = stringToVerify.replace("-", ""); <END> int total = 0; if (isbn.length() != 10) { return false; } for (int i = 0; i < isbn.length() - 1; i++) { char currentDigit = isbn.charAt(i); if(Character.isDigit(currentDigit)) { int currentCharVal = Character.getNumericValue(currentDigit); total += currentCharVal * (10 - i); } else { return false; } } char finalCharacter = isbn.charAt(isbn.length() - 1); if (Character.isDigit(finalCharacter)) { total += Character.getNumericValue(finalCharacter); } else if (finalCharacter == 'X') { total += 10; } else { return false; } return total % 11 == 0; }</code><technical_language>do this line: String isbn = stringToVerify.replace("-", "");</technical_language>

Target:
boolean isValid(String stringToVerify) { String isbn = stringToVerify.replace("-", ""); int total = 0; if (isbn.length() != 10) { return false; } for (int i = 0; i < isbn.length() - 1; i++) { char currentChar = isbn.charAt(i); if(Character.isDigit(currentChar)) { int currentCharVal = Character.getNumericValue(currentChar); total += currentCharVal * (10 - i); } else { return false; } } char finalChar = isbn.charAt(isbn.length() - 1); if (Character.isDigit(finalChar)) { total += Character.getNumericValue(finalChar); } else if (finalChar == 'X') { total += 10; } else { return false; } return total % 11 == 0; }
Source:
<code>public GridColumn<?> convertColumn(final BaseColumn column, final GuidedDecisionTablePresenter.Access access, final GuidedDecisionTableView gridWidget) { <START> final GridColumn<?> uiColumn = newRuleNameColumn(makeHeaderMetaData(column), Math.max(column.getWidth(), DEFAULT_COLUMN_WIDTH), true, true, access, gridWidget); uiColumn.setMovable(false); uiColumn.setFloatable(true); uiColumn.setVisible(!column.isHideColumn()); uiColumn.setMinimumWidth(150.0); uiColumn.setWidth(Math.max(column.getWidth(), uiColumn.getMinimumWidth())); <END> return uiColumn; }</code><technical_language>this equivalent below? java final GridColumn<?> uiColumn = newRuleNameColumn(makeHeaderMetaData(column), Math.max(column.getWidth(), 150), true, true, access, gridWidget); uiColumn.setMovable(false); uiColumn.setFloatable(true); uiColumn.setVisible(!column.isHideColumn()); uiColumn.setMinimumWidth(150.0); return uiColumn; declare 150 class constant if answer is yes</technical_language>

Target:
public GridColumn<?> convertColumn(final BaseColumn column, final GuidedDecisionTablePresenter.Access access, final GuidedDecisionTableView gridWidget) { final GridColumn<?> uiColumn = newRuleNameColumn(makeHeaderMetaData(column), Math.max(column.getWidth(), MIN_WIDTH), true, true, access, gridWidget); uiColumn.setMovable(false); uiColumn.setFloatable(true); uiColumn.setVisible(!column.isHideColumn()); uiColumn.setMinimumWidth(MIN_WIDTH); return uiColumn; }
Source:
<code>private void checkModuleFile(final String moduleName, String path) throws IOException { ActionManager actionManager = ActionManager.getInstance(); final CreateElixirModuleAction elixirNewFileAction = (CreateElixirModuleAction) actionManager.getAction("Elixir.NewFile"); VirtualFile directoryVirtualFile = myFixture.getTempDirFixture().findOrCreateDir(""); final PsiDirectory directory = myFixture.getPsiManager().findDirectory(directoryVirtualFile); Application application = ApplicationManager.getApplication(); application.runWriteAction(new Runnable() { @Override public void run() { ElixirFile file = elixirNewFileAction.createFile(moduleName, TEMPLATE_NAME, directory); assertNotNull("Expected CreateElixirModuleAction.createFile to create an ElixirFile", file); } }); <START> myFixture.checkResultByFile(path, path, true); <END> }</code><technical_language>[x] named variable is reader bare true is doing. work fact Java keyword argument. Please leave variable</technical_language>

Target:
private void checkModuleFile(final String moduleName, String path) throws IOException { ActionManager actionManager = ActionManager.getInstance(); final CreateElixirModuleAction elixirNewFileAction = (CreateElixirModuleAction) actionManager.getAction("Elixir.NewFile"); VirtualFile directoryVirtualFile = myFixture.getTempDirFixture().findOrCreateDir(""); final PsiDirectory directory = myFixture.getPsiManager().findDirectory(directoryVirtualFile); Application application = ApplicationManager.getApplication(); application.runWriteAction(new Runnable() { @Override public void run() { ElixirFile file = elixirNewFileAction.createFile(moduleName, TEMPLATE_NAME, directory); assertNotNull("Expected CreateElixirModuleAction.createFile to create an ElixirFile", file); } }); boolean ignoreTrailingWhitespaces = true; myFixture.checkResultByFile(path, path, ignoreTrailingWhitespaces); }
Source:
<code>private CompletionStage<Map<Address, Response>> invalidateAcrossCluster(boolean synchronous, Object[] keys, InvocationContext ctx) throws Throwable { incrementInvalidations(); final InvalidateCommand invalidateCommand = commandsFactory.buildInvalidateCommand(EnumUtil.EMPTY_BIT_SET, keys); invalidateCommand.setTopologyId(rpcManager.getTopologyId()); if (log.isDebugEnabled()) log.debug("Cache [" + rpcManager.getAddress() + "] replicating " + invalidateCommand); TopologyAffectedCommand command = invalidateCommand; if (ctx.isInTxScope()) { TxInvocationContext txCtx = (TxInvocationContext) ctx; command = commandsFactory.buildPrepareCommand(txCtx.getGlobalTransaction(), Collections.singletonList(invalidateCommand), true); command.setTopologyId(invalidateCommand.getTopologyId()); } <START> if (synchronous) { <END> return rpcManager.invokeCommandOnAll(command, new MapResponseCollector(true), rpcManager.getSyncRpcOptions()); } else { rpcManager.sendToAll(command, DeliverOrder.NONE); return CompletableFutures.completedEmptyMap(); } }</code><technical_language>lot of places decide if command is synchronous this. this is based command flags + cache configuration, do this distinction in single place in RpcManager... allocate non-constant lambdas for some sync cases</technical_language>

Target:
private CompletionStage<Void> invalidateAcrossCluster(boolean synchronous, Object[] keys, InvocationContext ctx) throws Throwable { incrementInvalidations(); final InvalidateCommand invalidateCommand = commandsFactory.buildInvalidateCommand(EnumUtil.EMPTY_BIT_SET, keys); invalidateCommand.setTopologyId(rpcManager.getTopologyId()); if (log.isDebugEnabled()) log.debug("Cache [" + rpcManager.getAddress() + "] replicating " + invalidateCommand); TopologyAffectedCommand command = invalidateCommand; if (ctx.isInTxScope()) { TxInvocationContext txCtx = (TxInvocationContext) ctx; command = commandsFactory.buildPrepareCommand(txCtx.getGlobalTransaction(), Collections.singletonList(invalidateCommand), true); command.setTopologyId(invalidateCommand.getTopologyId()); } if (synchronous) { return rpcManager.invokeCommandOnAll(command, new VoidResponseCollector(true), rpcManager.getSyncRpcOptions()); } else { rpcManager.sendToAll(command, DeliverOrder.NONE); return CompletableFutures.completedNull(); } }
Source:
<code>public void process(Exchange exchange) throws Exception { if (exchange.getIn().getBody() == null) { log.info("Received exchange with empty body, skipping"); return; } TelegramConfiguration config = endpoint.getConfiguration(); OutgoingMessage message = exchange.getIn().getBody(OutgoingMessage.class); if (message.getChatId() == null) { log.debug("Chat id is null on outgoing message, trying resolution"); String chatId = resolveChatId(config, message, exchange); log.debug("Resolved chat id is " + chatId); message.setChatId(chatId); } TelegramService service = TelegramServiceProvider.get().getService(); <START> log.info("Sending text message to Telegram service"); <END> log.debug("Message being sent is: " + message); log.debug("Headers of message being sent are: " + exchange.getIn().getHeaders()); service.sendMessage(config.getAuthorizationToken(), message); }</code><technical_language>Reduce info level logging noise</technical_language>

Target:
public void process(Exchange exchange) throws Exception { if (exchange.getIn().getBody() == null) { log.debug("Received exchange with empty body, skipping"); return; } TelegramConfiguration config = endpoint.getConfiguration(); OutgoingMessage message = exchange.getIn().getBody(OutgoingMessage.class); if (message.getChatId() == null) { log.debug("Chat id is null on outgoing message, trying resolution"); String chatId = resolveChatId(config, message, exchange); log.debug("Resolved chat id is {}", chatId); message.setChatId(chatId); } TelegramService service = TelegramServiceProvider.get().getService(); log.debug("Message being sent is: {}", message); log.debug("Headers of message being sent are: {}", exchange.getIn().getHeaders()); service.sendMessage(config.getAuthorizationToken(), message); }
Source:
<code>public List<SubmitRecord> canSubmit() { List<Term> results; try { results = evaluateImpl("locate_submit_rule", "can_submit", "locate_submit_filter", "filter_submit_results"); } catch (RuleEvalException e) { return ruleError(e.getMessage(), e); } if (results.isEmpty()) { return <START> ruleError("Submit rule '" + getSubmitRule() + "' for change " + cd.getId() + " of " + getProjectName() + " has no solution."); <END> } return resultsToSubmitRecord(getSubmitRule(), results); }</code><technical_language>String.format</technical_language>

Target:
public List<SubmitRecord> canSubmit() { List<Term> results; try { results = evaluateImpl("locate_submit_rule", "can_submit", "locate_submit_filter", "filter_submit_results"); } catch (RuleEvalException e) { return ruleError(e.getMessage(), e); } if (results.isEmpty()) { return ruleError(String.format("Submit rule '%s' for change %s of %s has " + "no solution.", getSubmitRule(), cd.getId(), getProjectName())); } return resultsToSubmitRecord(getSubmitRule(), results); }
Source:
<code>public void discoverGeoRepData() { List<VDSGroup> clusters = getClusterDao().getAll(); for (VDSGroup cluster : clusters) { <START> discoverGeoRepDataInCluster(cluster, null); <END> } }</code><technical_language>Please consider a method overloading for case is volume name</technical_language>

Target:
public void discoverGeoRepData() { List<VDSGroup> clusters = getClusterDao().getAll(); for (VDSGroup cluster : clusters) { discoverGeoRepDataInCluster(cluster); } }
Source:
<code>private static String buildMetricPrefix(InetSocketAddress address) { <START> return address.getHostString().replace('.', '_') + ':' + address.getPort(); <END> }</code><technical_language>I address.getHostString() return null, in theory (although a pathological case). Do want defensively prevent NPEs here</technical_language>

Target:
private static String buildMetricPrefix(InetSocketAddress address) { String hostString = address.getHostString(); if (hostString == null) { throw new IllegalArgumentException( "Could not extract a host string from provided address " + address); } return hostString.replace('.', '_') + ':' + address.getPort(); }
Source:
<code>public boolean takeSnapshot(boolean syncSnap) { if (isTakingSnapshot.compareAndSet(false, true)) { this.worker.execute(new Runnable() { @Override public void run() { try { zks.takeSnapshot(syncSnap); if (purgeAfterSnapshot) { zks.purge(); } } catch (Exception e) { LOG.warn("Unexpected exception", e); } finally { isTakingSnapshot.compareAndSet(true, false); } } }); return true; } else { <START> LOG.warn("Too busy to snap, skipping"); <END> return false; } }</code><technical_language>Is this log message accurate? means previous snapshot is running</technical_language>

Target:
public boolean takeSnapshot(boolean syncSnap) { if (isTakingSnapshot.compareAndSet(false, true)) { this.worker.execute(new Runnable() { @Override public void run() { try { zks.takeSnapshot(syncSnap); if (purgeAfterSnapshot) { zks.purge(); } } catch (Exception e) { LOG.warn("Unexpected exception", e); } finally { isTakingSnapshot.compareAndSet(true, false); } } }); return true; } else { LOG.warn("Previous snapshot is still in-flight, too busy to snap, skipping"); return false; } }
Source:
<code>private void run() { HashMap<String, String> commandLineArgs = new HashMap<>(getParameters().getNamed()); String sourceJarPath = commandLineArgs.get("source"); String targetJarPath = commandLineArgs.get("target"); String executeJarOption = commandLineArgs.get("execute-jar"); if (sourceJarPath == null || targetJarPath == null) { log("Please specify source and target files."); quit(); } else { log("source: " + sourceJarPath); log("target: " + targetJarPath); } File sourceJarFile = new File(sourceJarPath); File targetJarFile = new File(targetJarPath); if (!sourceJarFile.exists()) { log("Such source file does not exist, aborting."); quit(); } if (!prepareTargetJarFile(targetJarFile)) { showCriticalErrorOnUpdating(); return; } log("Moving source to target"); if (!moveFile(sourceJarFile.toPath(), targetJarFile.toPath())) { log("Failed to move update."); restoreBackup(targetJarFile); quit(); } if (executeJarOption != null && executeJarOption.equalsIgnoreCase("y")) { if (executeJar(targetJarPath, "")) { removeBackup(targetJarFile); } else { restoreBackup(targetJarFile); <START> executeJar(targetJarPath, ""); <END> } } else { removeBackup(targetJarFile); } quit(); }</code><technical_language>Is ignore return of this? instead of error-handling everywhere, exception handle higher up? I this work for everything, if stages return/quit/abort failure, exception stop execution work better</technical_language>

Target:
private void run() throws IllegalArgumentException, IOException { HashMap<String, String> commandLineArgs = new HashMap<>(getParameters().getNamed()); String sourceJarPath = commandLineArgs.get("source"); String targetJarPath = commandLineArgs.get("target"); String executeJarOption = commandLineArgs.get("execute-jar"); if (sourceJarPath == null || targetJarPath == null) { throw new IllegalArgumentException("Please specify source and target files."); } else { log("source: " + sourceJarPath); log("target: " + targetJarPath); } File sourceJarFile = new File(sourceJarPath); File targetJarFile = new File(targetJarPath); if (!sourceJarFile.exists()) { throw new IOException(String.format("Source file %s does not exist. Aborting...", sourceJarFile.toString())); } if (targetJarFile.exists() && targetJarFile.isFile()) { makeJarBackup(targetJarFile); } else { JarUpdaterFileHandler.createParentDirectoriesOfFile(targetJarFile); } log("Moving source to target"); try { JarUpdaterFileHandler.moveFileWithReplaceExisting(sourceJarFile.toPath(), targetJarFile.toPath()); } catch (IOException e) { restoreBackupOfFile(targetJarFile); throw e; } if (executeJarOption != null && executeJarOption.equalsIgnoreCase("y") && !executeJar(targetJarPath)) { restoreBackupOfFile(targetJarFile); executeJar(targetJarPath); } else { removeBackupOfFileIfExists(targetJarFile); } quit(); }
Source:
<code>protected void runInternal() { log.info("XdContainer internal run starting, setting up XD container launcher"); log.info("Using xd.home=" + getEnvironment("xd.home")); <START> ContainerOptions options = new ContainerOptions(); <END> String[] args = new String[] { "--xdHomeDir", getEnvironment("xd.home") }; CmdLineParser parser = new CmdLineParser(options); try { parser.parseArgument(args); } catch (CmdLineException e) { log.error("Error parsing options", e); } log.info("Going to launch Spring XD specific XDContainer"); ContainerLauncher launcher = context.getBean(ContainerLauncher.class); XDContainer container = launcher.launch(options); log.info("XdContainer launched id=" + container.getId() + " jvm=" + container.getJvmName()); }</code><technical_language>this leverage ContainerMain in some way</technical_language>

Target:
protected void runInternal() { log.info("XdContainer internal run starting, setting up XD container launcher"); log.info("Using XD_HOME=" + getEnvironment("XD_HOME")); log.info("XdContainer context=" + context); log.info("XdContainer parent context=" + context.getParent()); ContainerOptions options = new ContainerOptions(); String[] args = new String[] { "--xdHomeDir", getEnvironment("XD_HOME") }; CmdLineParser parser = new CmdLineParser(options); try { parser.parseArgument(args); } catch (CmdLineException e) { log.error("Error parsing options", e); } log.info("Going to launch Spring XD specific XDContainer"); ContainerLauncher launcher = context.getBean(ContainerLauncher.class); XDContainer container = launcher.launch(options); log.info("XdContainer launched id=" + container.getId() + " jvm=" + container.getJvmName()); }
Source:
<code>public static void testOnblurAutoConvertValueNoncompoundAttribute(WebDriver driver, By context, String simpleName, String value, String expected) { <START> WebElement attribuetContainer = findAttributeContainerWebElement(driver, context, simpleName, false); <END> changeValueAttribute(attribuetContainer, simpleName, value); attribuetContainer.click(); assertFalse(FormsUtils.formHasErrors(driver, context)); String actual = FormsUtils.getValueNoncompoundAttribute(driver, context, simpleName); assertEquals(actual, expected); }</code><technical_language>typo in attribuetContainer</technical_language>

Target:
public static void testOnblurAutoConvertValueNoncompoundAttribute(WebDriver driver, By context, String simpleName, String value, String expected) { WebElement attributeContainer = findAttributeContainerWebElement(driver, context, simpleName, false); changeValueAttributeTextNumberEmailUrl(attributeContainer, simpleName, value); attributeContainer.click(); assertFalse(FormsUtils.formHasErrors(driver, context)); String actual = FormsUtils.getValueNoncompoundAttribute(driver, context, simpleName); assertEquals(actual, expected); }
Source:
<code>public void Find_Available_Default_Actions_Invalid_License() throws Exception { final HttpServletRequest request = mock(HttpServletRequest.class); <START> final ContentType defaultContentType = APILocator.getContentTypeAPI(userAdmin).find("webPageContent"); <END> final Response response = nonLicenseWorkflowResource.findAvailableDefaultActionsByContentType(request, defaultContentType.id()); assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); ResponseEntityView ev = ResponseEntityView.class.cast(response.getEntity()); List<WorkflowDefaultActionView> actions = List.class.cast(ev.getEntity()); for(WorkflowDefaultActionView av:actions){ assertTrue(av.getScheme().isSystem()); } }</code><technical_language>rename var webPageContentType contentGenericType</technical_language>

Target:
public void Find_Available_Default_Actions_Invalid_License() throws Exception { final HttpServletRequest request = mock(HttpServletRequest.class); final ContentType webPageContentType = APILocator.getContentTypeAPI(userAdmin).find("webPageContent"); final Response response = nonLicenseWorkflowResource.findAvailableDefaultActionsByContentType(request, webPageContentType.id()); assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); ResponseEntityView ev = ResponseEntityView.class.cast(response.getEntity()); List<WorkflowDefaultActionView> actions = List.class.cast(ev.getEntity()); for(WorkflowDefaultActionView av:actions){ assertTrue(av.getScheme().isSystem()); } }
Source:
<code>public boolean isExistChecksum(Repository repository, String path) { return getDigestAlgorithmSet() .stream() .map(algorithm -> { String checksumPath = path.concat(".") .concat(algorithm.toLowerCase() .replaceAll("-", "")); RepositoryPath checksum = null; try { checksum = resolve(repository, checksumPath); } <START> catch (IOException e) <END> { e.printStackTrace(); } return checksum; }) .allMatch(checksum -> Files.exists(checksum)); }</code><technical_language>![CRITICAL](<LINK_0> log rethrow this exception. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public boolean isExistChecksum(Repository repository, String path) { return getDigestAlgorithmSet() .stream() .map(algorithm -> { String checksumPath = path.concat(".") .concat(algorithm.toLowerCase() .replaceAll( "-", "")); RepositoryPath checksum = null; try { checksum = resolve(repository, checksumPath); } catch (IOException e) { logger.error(e.getMessage()); } return checksum; }) .allMatch(checksum -> Files.exists(checksum)); }
Source:
<code>private Set<String> extractTags(Set<String> input) throws BadRequestException { if (input == null) { return ImmutableSet.of(); } else { for (String <START> hashtag: input) <END> { if (hashtag.contains(",")) { throw new BadRequestException("Hashtags may not contain commas"); } } return input; } }</code><technical_language>Nit: space ':'</technical_language>

Target:
private Set<String> extractTags(Set<String> input) throws BadRequestException { if (input == null) { return ImmutableSet.of(); } else { HashSet<String> result = new HashSet<>(); for (String hashtag : input) { if (hashtag.contains(",")) { throw new BadRequestException("Hashtags may not contain commas"); } if (!hashtag.trim().isEmpty()) { result.add(hashtag.trim()); } } return result; } }
Source:
<code>public final Long createLO(Connection connection) throws SQLException { if (shouldUseReflection) { Object largeObjectManager = getLargeObjectManager(connection); try { Method method = largeObjectManager.getClass().getMethod("createLO", Connection.class); <START> return (Long) method.invoke(largeObjectManager, connection); <END> } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { throw new SQLException("Couldn't access org.postgresql.largeobject.LargeObjectManager", ex); } } else { return ((PGConnection) unwrap(connection)).getLargeObjectAPI().createLO(); } }</code><technical_language>connection is a parameter of this method</technical_language>

Target:
public final Long createLO(Connection connection) throws SQLException { if (shouldUseReflection) { Object largeObjectManager = getLargeObjectManager(connection); try { Method method = largeObjectManager.getClass().getMethod("createLO"); return (Long) method.invoke(largeObjectManager); } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { throw new SQLException("Couldn't access org.postgresql.largeobject.LargeObjectManager", ex); } } else { return ((PGConnection) unwrap(connection)).getLargeObjectAPI().createLO(); } }
Source:
<code>private static Fork fork(final String host, final Take take) { return new Fork() { @Override public Opt<Response> route(final Request req) throws Exception { final String hst = new RqHeaders.Smart( new RqHeaders.Base(req) ).single("host"); final Opt<Response> rsp; <START> if (new UncheckedText( <END> new Lowered(host) ).asString().equals( new UncheckedText( new Lowered(hst) ).asString() ) ) { rsp = new Opt.Single<>(take.act(req)); } else { rsp = new Opt.Empty<>(); } return rsp; } }; }</code><technical_language>@fanifieiev please, fix indentation here</technical_language>

Target:
private static Fork fork(final String host, final Take take) { return new Fork() { @Override public Opt<Response> route(final Request req) throws Exception { final String hst = new RqHeaders.Smart( new RqHeaders.Base(req) ).single("host"); final Opt<Response> rsp; final Text lowhost = new UncheckedText(new Lowered(host)); final Text lowhst = new UncheckedText(new Lowered(hst)); if (lowhost.asString().equals(lowhst.asString())) { rsp = new Opt.Single<>(take.act(req)); } else { rsp = new Opt.Empty<>(); } return rsp; } }; }
Source:
<code>private void setPagesRecycler(OnThisDayCard card) { if (card.pages() != null) { RecyclerAdapter recyclerAdapter = new RecyclerAdapter(card.pages(), card.wiki(), true, (Activity) <START> this.getContext()); <END> recyclerAdapter.setCallback(new ItemCallback()); pagesRecycler.setAdapter(recyclerAdapter); } else { pagesRecycler.setVisibility(GONE); } }</code><technical_language>getContext() instead of this.getContext()</technical_language>

Target:
private void setPagesRecycler(OnThisDayCard card) { if (card.pages() != null) { RecyclerAdapter recyclerAdapter = new RecyclerAdapter(card.pages(), card.wiki(), true, (Activity) getContext()); recyclerAdapter.setCallback(new ItemCallback()); pagesRecycler.setAdapter(recyclerAdapter); } else { pagesRecycler.setVisibility(GONE); } }
Source:
<code>public void passivateAll() throws PersistenceException { if (enabled && !skipOnStop) { long start = timeService.time(); log.passivatingAllEntries(); int count = 0; for (InternalCacheEntry e : container) { if (count != Integer.MAX_VALUE) { <START> count++; <END> } if (trace) log.tracef("Passivating %s", e.getKey()); persistenceManager.writeToAllNonTxStores(marshalledEntryFactory.newMarshalledEntry(e.getKey(), e.getValue(), internalMetadata(e)), BOTH); } log.passivatedEntries(count, Util.prettyPrintTime(timeService.timeDuration(start, TimeUnit.MILLISECONDS))); } }</code><technical_language>a long instead</technical_language>

Target:
public void passivateAll() throws PersistenceException { if (enabled && !skipOnStop) { long start = timeService.time(); log.passivatingAllEntries(); long count = 0; for (InternalCacheEntry e : container) { count++; if (trace) log.tracef("Passivating %s", e.getKey()); persistenceManager.writeToAllNonTxStores(marshalledEntryFactory.newMarshalledEntry(e.getKey(), e.getValue(), internalMetadata(e)), BOTH); } log.passivatedEntries(count, Util.prettyPrintTime(timeService.timeDuration(start, TimeUnit.MILLISECONDS))); } }
Source:
<code>public void startElement(String uri, String localName, String qName, Attributes attributes) { currentQName = qName; if (qName.indexOf("Pixels") != -1) { inPixels = true; } <START> if (qName.indexOf("BinData") != -1 && inPixels == true) { <END> binData.add( new BinData(locator.getLineNumber(), locator.getColumnNumber())); String compress = attributes.getValue("Compression"); compression.add(compress == null ? "" : compress); xmlBuffer.append("<"); xmlBuffer.append(qName); for (int i=0; i<attributes.getLength(); i++) { String key = XMLTools.escapeXML(attributes.getQName(i)); String value = XMLTools.escapeXML(attributes.getValue(i)); if (key.equals("Length")) value = "0"; xmlBuffer.append(" "); xmlBuffer.append(key); xmlBuffer.append("=\""); xmlBuffer.append(value); xmlBuffer.append("\""); } xmlBuffer.append(">"); } else { xmlBuffer.append("<"); xmlBuffer.append(qName); for (int i=0; i<attributes.getLength(); i++) { String key = XMLTools.escapeXML(attributes.getQName(i)); String value = XMLTools.escapeXML(attributes.getValue(i)); if (key.equals("BigEndian")) { String endian = value.toLowerCase(); if (!endian.equals("true") && !endian.equals("false")) { if (endian.startsWith("t")) endian = "true"; else if (endian.startsWith("f")) endian = "false"; } value = endian; } xmlBuffer.append(" "); xmlBuffer.append(key); xmlBuffer.append("=\""); xmlBuffer.append(value); xmlBuffer.append("\""); } xmlBuffer.append(">"); } }</code><technical_language>inPixels instead of inPixels == true</technical_language>

Target:
public void startElement(String uri, String localName, String qName, Attributes attributes) { currentQName = qName; if (qName.indexOf("Pixels") != -1) { inPixels = true; } if (inPixels && qName.indexOf("BinData") != -1) { binData.add( new BinData(locator.getLineNumber(), locator.getColumnNumber())); String compress = attributes.getValue("Compression"); compression.add(compress == null ? "" : compress); xmlBuffer.append("<"); xmlBuffer.append(qName); for (int i=0; i<attributes.getLength(); i++) { String key = XMLTools.escapeXML(attributes.getQName(i)); String value = XMLTools.escapeXML(attributes.getValue(i)); if (key.equals("Length")) value = "0"; xmlBuffer.append(" "); xmlBuffer.append(key); xmlBuffer.append("=\""); xmlBuffer.append(value); xmlBuffer.append("\""); } xmlBuffer.append(">"); } else { xmlBuffer.append("<"); xmlBuffer.append(qName); for (int i=0; i<attributes.getLength(); i++) { String key = XMLTools.escapeXML(attributes.getQName(i)); String value = XMLTools.escapeXML(attributes.getValue(i)); if (key.equals("BigEndian")) { String endian = value.toLowerCase(); if (!endian.equals("true") && !endian.equals("false")) { if (endian.startsWith("t")) endian = "true"; else if (endian.startsWith("f")) endian = "false"; } value = endian; } xmlBuffer.append(" "); xmlBuffer.append(key); xmlBuffer.append("=\""); xmlBuffer.append(value); xmlBuffer.append("\""); } xmlBuffer.append(">"); } }
Source:
<code><START> public void setUp() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, <END> InvocationTargetException, InstantiationException, IOException { inputFiles = new ArrayList<>(); inputFiles.add(new File(TEST_INPUT_DIR + "AngleBracketWhitespaceTest.swift")); inputFiles.add(new File(TEST_INPUT_DIR + "BraceWhitespaceTest.swift")); inputFiles.add(new File(TEST_INPUT_DIR + "SemicolonTest.swift")); inputFiles.add(new File(TEST_INPUT_DIR + "UpperCamelCaseTest.swift")); expectedMessages = new ArrayList<>(); outContent = new ByteArrayOutputStream(); System.setOut(new PrintStream(outContent, false, Charset.defaultCharset().name())); }</code><technical_language>appears of exceptions replaced java throws UnsupportedEncodingException is extra space opening brace</technical_language>

Target:
public void setUp() throws UnsupportedEncodingException { inputFiles = new ArrayList<>(); inputFiles.add(new File(TEST_INPUT_DIR + "AngleBracketWhitespaceTest.swift")); inputFiles.add(new File(TEST_INPUT_DIR + "BraceWhitespaceTest.swift")); inputFiles.add(new File(TEST_INPUT_DIR + "SemicolonTest.swift")); inputFiles.add(new File(TEST_INPUT_DIR + "UpperCamelCaseTest.swift")); expectedMessages = new ArrayList<>(); outContent = new ByteArrayOutputStream(); System.setOut(new PrintStream(outContent, false, Charset.defaultCharset().name())); }
Source:
<code>public void testGetReplicaException() throws Exception { CompletableFuture<Void> taskFuture = new CompletableFuture<>(); taskFuture.completeExceptionally(new CacheException("Problem encountered retrieving state")); initTransferTaskMock(taskFuture); CompletableFuture<List<Map<Address, InternalCacheEntry<Object, Object>>>> cf = stateReceiver.getAllReplicasForSegment(0, localizedCacheTopology); try { cf.get(); fail("Expected an ExecutionExceptions caused by a CacheException"); } catch (ExecutionException e) { <START> assertTrue("Expected an ExecutionExceptions caused by a CacheException.", e.getCause() instanceof CacheException); <END> } }</code><technical_language>Exceptions.expectExecutionException();</technical_language>

Target:
public void testGetReplicaException() throws Exception { CompletableFuture<Void> taskFuture = new CompletableFuture<>(); taskFuture.completeExceptionally(new CacheException("Problem encountered retrieving state")); initTransferTaskMock(taskFuture); CompletableFuture<List<Map<Address, CacheEntry<Object, Object>>>> cf = stateReceiver.getAllReplicasForSegment(0, localizedCacheTopology); Exceptions.expectExecutionException(CacheException.class, cf); }
Source:
<code>public CandlepinQuery<Consumer> getHypervisorsBulk(Iterable<String> hypervisorIds, String ownerKey) { if (hypervisorIds == null || !hypervisorIds.iterator().hasNext()) { return this.cpQueryFactory.<Consumer>buildQuery(); } DetachedCriteria criteria = DetachedCriteria.forClass(Consumer.class) .createAlias("owner", "o") .createAlias("hypervisorId", "hvsr") .add(Restrictions.eq("o.key", ownerKey)) .add(this.getHypervisorIdRestriction(hypervisorIds)) .addOrder(Order.asc("hvsr.hypervisorId")); CandlepinQuery<Consumer> query = this.cpQueryFactory.<Consumer>buildQuery(this.currentSession(), criteria); query.setLockMode(LockModeType.PESSIMISTIC_WRITE); <START> return query; <END> }</code><technical_language>simplify this a bit chainable nature of mutators in CandlepinQuery: return this.cpQueryFactory.<Consumer>buildQuery(this.currentSession(), criteria) .setLockMode(LockModeType.PESSIMISTIC_WRITE);</technical_language>

Target:
public CandlepinQuery<Consumer> getHypervisorsBulk(Iterable<String> hypervisorIds, String ownerKey) { if (hypervisorIds == null || !hypervisorIds.iterator().hasNext()) { return this.cpQueryFactory.<Consumer>buildQuery(); } DetachedCriteria criteria = DetachedCriteria.forClass(Consumer.class) .createAlias("owner", "o") .createAlias("hypervisorId", "hvsr") .add(Restrictions.eq("o.key", ownerKey)) .add(this.getHypervisorIdRestriction(hypervisorIds)) .addOrder(Order.asc("hvsr.hypervisorId")); return this.cpQueryFactory.<Consumer>buildQuery(this.currentSession(), criteria) .setLockMode(LockModeType.PESSIMISTIC_WRITE); }
Source:
<code><START> public synchronized static void setUp() { <END> try { System.setProperty(DIIRT_HOME_ENV_VAR, FileLocator.resolve(PVManagerSettings.class.getResource(DIIRT_DIR)).getPath()); } catch (IOException | RuntimeException err) { IsisLog.getLogger(PVManagerSettings.class).error(err.getMessage(), err); } }</code><technical_language>Checkstyle issue: 'static' modifier out of order JLS suggestions</technical_language>

Target:
public static synchronized void setUp() { try { System.setProperty(DIIRT_HOME_ENV_VAR, FileLocator.resolve(PVManagerSettings.class.getResource(DIIRT_DIR)).getPath()); } catch (IOException | RuntimeException err) { IsisLog.getLogger(PVManagerSettings.class).error(err.getMessage(), err); } }
Source:
<code>public void refreshSchema(String keyspace, String table) throws InterruptedException { logger.debug("[Control connection] Refreshing schema for {}{}", keyspace == null ? "" : keyspace, table == null ? "" : '.' + table); try { Connection c = connectionRef.get(); if (c == null) return; refreshSchema(c, keyspace, table, cluster); if (table == null) { cluster.submitNodeListRefresh(); <START> cluster.nodeListRefreshRequestDebouncer.deliverEvents().get(); <END> } } catch (ConnectionException e) { logger.debug("[Control connection] Connection error while refreshing schema ({})", e.getMessage()); signalError(); } catch (ExecutionException e) { if (!isShutdown) logger.error("[Control connection] Unexpected error while refreshing schema", e); signalError(); } catch (BusyConnectionException e) { logger.debug("[Control connection] Connection is busy, reconnecting"); signalError(); } }</code><technical_language>This get weird a SchemaRefreshRequestDeliveryCallback is executing in Cluster.executor, this submit another task Cluster.executor. This weirder if schemaRefresh triggered schemaRefreshRequestDebouncer.deliverEvents in Cluster.maybeRefreshSchemaAndSignal. This leaves a situation have: a. A response submitting SchemaRefreshDeiveryCallback in Cluster.executor maybeRefreshSchemaAndSingal b. SchemaRefreshDeliveryCallback submitting Runnable Cluster.executor: c. Runnable calling controlConnection.refreshSchema submits a nodeListRefresh d. NodeListRefreshDeliveryCallback submitting a Runnable refreshNodeListAndTokenMap in Cluster.Executor. If Cluster.executor 2 threads (dual core system configured way), starve executor in a c waiting completion of is submitted time</technical_language>

Target:
public void refreshSchema(String keyspace, String table) throws InterruptedException { if(keyspace == null && table == null) { logger.debug("[Control connection] Refreshing schema"); } else { logger.debug("[Control connection] Refreshing schema for {}{}", keyspace == null ? "" : keyspace, table == null ? "" : '.' + table); } try { Connection c = connectionRef.get(); if (c == null) return; refreshSchema(c, keyspace, table, cluster); if (table == null) { cluster.submitNodeListRefresh(); } } catch (ConnectionException e) { logger.debug("[Control connection] Connection error while refreshing schema ({})", e.getMessage()); signalError(); } catch (ExecutionException e) { if (!isShutdown) logger.error("[Control connection] Unexpected error while refreshing schema", e); signalError(); } catch (BusyConnectionException e) { logger.debug("[Control connection] Connection is busy, reconnecting"); signalError(); } }
Source:
<code>public void testCcTestCoverageOutputGenerator() throws Exception { scratch.file( "sh/test/BUILD", "sh_test(name = 'foo_test',", <START> " srcs = ['foo_test.sh'])"); <END> reporter.removeHandler(failFastHandler); ConfiguredTarget ct = getConfiguredTarget(" assertThat(getRuleContext(ct).getPrerequisite(":lcov_merger", Mode.HOST)).isNull(); }</code><technical_language>Nit: reformat (either single line attribute a separate line). below. :))</technical_language>

Target:
public void testCcTestCoverageOutputGenerator() throws Exception { scratch.file( "sh/test/BUILD", "sh_test(name = 'foo_test', srcs = ['foo_test.sh'])"); reporter.removeHandler(failFastHandler); ConfiguredTarget ct = getConfiguredTarget(" assertThat(getRuleContext(ct).getPrerequisite(":lcov_merger", Mode.HOST)).isNull(); }
Source:
<code>public static EntityManagerCacheGlobal entityManagerCache(PersistenceUnitMetadata pu) { if (pu.getProperties().containsKey(Configuration.JPA_ENTITYMANAGER_CACHE) && Boolean.parseBoolean(pu.getProperties().getProperty(Configuration.JPA_ENTITYMANAGER_CACHE))) { int cache_max_size = 0; if (pu.getProperties().containsKey(Configuration.JPA_ENTITYMANAGER_CACHE_SIZE)) { cache_max_size = Integer.parseInt(pu.getProperties().getProperty(Configuration.JPA_ENTITYMANAGER_CACHE_SIZE)); } <START> return new EntityManagerCacheGlobal(cache_max_size); <END> } return null; }</code><technical_language>If cache_max_size is 0 null returned cached</technical_language>

Target:
public static EntityManagerCache entityManagerCache(PersistenceUnitMetadata pu) { if (pu.getProperties().containsKey(JPA_ENTITYMANAGER_CACHE) && Boolean.parseBoolean(pu.getProperties().getProperty(JPA_ENTITYMANAGER_CACHE))) { int cache_max_size = 0; if (pu.getProperties().containsKey(JPA_ENTITYMANAGER_CACHE_SIZE)) { cache_max_size = Integer.parseInt(pu.getProperties().getProperty(JPA_ENTITYMANAGER_CACHE_SIZE)); } if (cache_max_size > 0) { return new BoundedEntityManagerCacheImpl(cache_max_size); } return new UnBoundedEntityManagerCacheImpl(); } return null; }
Source:
<code>protected WorkflowItemRest createAndReturn(Context context) { XmlWorkflowItem source; try { source = submissionService.createWorkflowItem(context, getRequestService().getCurrentRequest()); } catch (SQLException | AuthorizeException | WorkflowException e) { <START> throw new RuntimeException(e.getMessage(), e); <END> } if (source.getItem().isArchived()) { return null; } return converter.convert(source); }</code><technical_language>Again, more useful error message please</technical_language>

Target:
protected WorkflowItemRest createAndReturn(Context context) { XmlWorkflowItem source; try { source = submissionService.createWorkflowItem(context, getRequestService().getCurrentRequest()); } catch (AuthorizeException e) { throw new RESTAuthorizationException(e); } catch (WorkflowException e) { throw new UnprocessableEntityException( "Invalid workflow action: " + e.getMessage(), e); } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } if (source.getItem().isArchived()) { return null; } return converter.convert(source); }
Source:
<code>public String toString() { <START> return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) <END> .append("myId", myId) .append(myValueSet != null ? ("myValueSet - id=" + myValueSet.getId()) : ("myValueSet=(null)")) .append("myValueSetUrl", this.getValueSetUrl()) .append("myValueSetName", this.getValueSetName()) .append("mySystem", mySystem) .append("myCode", myCode) .append("myDisplay", myDisplay) .toString(); }</code><technical_language>Update style</technical_language>

Target:
public String toString() { return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) .append("myId", myId) .append(myValueSet != null ? ("myValueSet - id=" + myValueSet.getId()) : ("myValueSet=(null)")) .append("myValueSetUrl", this.getValueSetUrl()) .append("myValueSetName", this.getValueSetName()) .append("mySystem", mySystem) .append("myCode", myCode) .append("myDisplay", myDisplay) .toString(); }
Source:
<code>public Collection<T> values() { LinkedList<T> collection = new LinkedList<T>(); validate(); Set<String> keySet = litems.keySet(); for (String key: keySet) { LinkedList<T> list = litems.get(key); <START> for (T item: list) { <END> collection.add(item); } } return collection; }</code><technical_language>addAll method, no</technical_language>

Target:
public Collection<T> values() { LinkedList<T> collection = new LinkedList<T>(); validate(); Set<String> keySet = linkedListItems.keySet(); for (String key: keySet) { LinkedList<T> list = linkedListItems.get(key); for (T item: list) { collection.add(item); } } return collection; }