auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void applyFilter() { int matches = 0; String[] needles = searchBox_.getText().toLowerCase().split("\\s+"); for (CommandPaletteEntry entry: entries_) { String hay = entry.getLabel().toLowerCase(); boolean matched = true; <START> for (int i = 0; i < needles.length; i++) <END> { if (!hay.contains(needles[i])) { entry.setVisible(false); matched = false; break; } } if (matched) { entry.setSearchHighlight(needles); entry.setVisible(true); matches++; } } if (needles.length == 0) { matches = entries_.size(); } updateResultsCount_.nudge(); updateSelection(); if (matches == 0 && !noResults_.isVisible()) { scroller_.setVisible(false); noResults_.setVisible(true); } else if (matches > 0 && noResults_.isVisible()) { scroller_.setVisible(true); noResults_.setVisible(false); } }</code><technical_language>IntelliJ nit: for (String needle : needles)</technical_language>

Target:
private void applyFilter() { int matches = 0; String[] needles = searchBox_.getText().toLowerCase().split("\\s+"); for (CommandPaletteEntry entry: entries_) { String hay = entry.getLabel().toLowerCase(); boolean matched = true; for (String needle: needles) { if (!hay.contains(needle)) { entry.setVisible(false); matched = false; break; } } if (matched) { entry.setSearchHighlight(needles); entry.setVisible(true); matches++; } } if (needles.length == 0) { matches = entries_.size(); } updateSelection(); if (matches == 0 && !noResults_.isVisible()) { scroller_.setVisible(false); noResults_.setVisible(true); } else if (matches > 0 && noResults_.isVisible()) { scroller_.setVisible(true); noResults_.setVisible(false); } resultsCount_.reportStatus(matches + " " + "commands found, press up and down to navigate", RStudioGinjector.INSTANCE.getUserPrefs().typingStatusDelayMs().getValue(), Severity.ALERT); }
Source:
<code><START> protected boolean isFileDomainInEditState(StorageDomain storageDomain) { <END> return (storageDomain.getStatus() == StorageDomainStatus.Maintenance || storageDomain.getStorageDomainSharedStatus() == StorageDomainSharedStatus.Unattached); }</code><technical_language>This method (and be) private</technical_language>

Target:
private boolean isFileDomainInEditState(StorageDomain storageDomain) { return (storageDomain.getStatus() == StorageDomainStatus.Maintenance || storageDomain.getStorageDomainSharedStatus() == StorageDomainSharedStatus.Unattached); }
Source:
<code><START> public void testPrefixDoesNotNormalizeDoubleSlashInTar() throws Exception { <END> writeTrashFile("foo", "a file"); git.add().addFilepattern("foo").call(); git.commit().setMessage("boring commit").call(); final byte[] result = CLIGitCommand.rawExecute( "git archive --prefix=x String[] expect = { "x assertArrayEquals(expect, listTarEntries(result)); }</code><technical_language>is purpose of of test method testing format-specific? (I interested if format normalized double slashes another didn't, case.)</technical_language>

Target:
public void testPrefixDoesNotNormalizeDoubleSlashInTar() throws Exception { commitFoo(); final byte[] result = CLIGitCommand.rawExecute( "git archive --prefix=x String[] expect = { "x assertArrayEquals(expect, listTarEntries(result)); }
Source:
<code>private void disableHook() { if (getWindow() != null) { return; } if (getSelectedItems() == null || getSelectedItems().size() == 0) { return; } ConfirmationModel model = new ConfirmationModel(); setConfirmWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().confirmDisableGlusterHooks()); model.setHashName("disable_hooks"); model.setMessage(ConstantsManager.getInstance().getConstants().disableGlusterHooksMessage()); if (getSelectedItems() == null) { return; <START> } <END> java.util.ArrayList<String> list = new java.util.ArrayList<String>(); for (GlusterHookEntity item : Linq.<GlusterHookEntity> Cast(getSelectedItems())) { list.add(item.getName()); } model.setItems(list); UICommand okCommand = new UICommand("OnDisableHook", this); okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); okCommand.setIsDefault(true); model.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("OnCancelConfirmation", this); cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().cancel()); cancelCommand.setIsCancel(true); model.getCommands().add(cancelCommand); }</code><technical_language>checked in line 89</technical_language>

Target:
private void disableHook() { if (getWindow() != null) { return; } if (getSelectedItems() == null || getSelectedItems().size() == 0) { return; } ConfirmationModel model = new ConfirmationModel(); setConfirmWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().confirmDisableGlusterHooks()); model.setHashName("disable_hooks"); model.setMessage(ConstantsManager.getInstance().getConstants().disableGlusterHooksMessage()); if (getSelectedItems() == null) { return; } ArrayList<String> list = new ArrayList<String>(); for (Object item : getSelectedItems()) { GlusterHookEntity hook = (GlusterHookEntity) item; list.add(hook.getName()); } model.setItems(list); UICommand okCommand = new UICommand("OnDisableHook", this); okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); okCommand.setIsDefault(true); model.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("OnCancelConfirmation", this); cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().cancel()); cancelCommand.setIsCancel(true); model.getCommands().add(cancelCommand); }
Source:
<code>public HTNode getLatestLeaf() { List<HTNode> latest = getLatestBranch(); <START> return NonNullUtils.checkNotNull(latest.get(latest.size() - 1)); <END> }</code><technical_language>Iterables.getLast(latest) too, you</technical_language>

Target:
public HTNode getLatestLeaf() { List<HTNode> latest = getLatestBranch(); return NonNullUtils.checkNotNull(Iterables.getLast(latest)); }
Source:
<code>public void testOnBackpressureDropSynchronous() { for (int i = 0; i < 100; i++) { <START> final AtomicInteger dropCount = new AtomicInteger(); <END> int NUM = (int) (RxRingBuffer.SIZE * 1.1); AtomicInteger c = new AtomicInteger(); TestSubscriber<Integer> ts = new TestSubscriber<Integer>(); firehose(c).onBackpressureDrop(new Action1<Integer>() { @Override public void call(Integer i) { dropCount.incrementAndGet(); } }) .map(SLOW_PASS_THRU).take(NUM).subscribe(ts); ts.awaitTerminalEvent(); ts.assertNoErrors(); List<Integer> onNextEvents = ts.getOnNextEvents(); assertEquals(NUM, onNextEvents.size()); Integer lastEvent = onNextEvents.get(NUM - 1); System.out.println("testOnBackpressureDrop => Received: " + onNextEvents.size() + " Dropped: " + dropCount.get() + " Emitted: " + c.get() + " Last value: " + lastEvent); assertTrue(NUM - 1 <= lastEvent.intValue()); assertEquals(0, dropCount.get()); assertEquals(c.get(), onNextEvents.size()); } }</code><technical_language>changes in a separate test method. Leave testOnBackpressureDropSynchronous is introduce testOnBackpressureDropWithActionSynchronous</technical_language>

Target:
public void testOnBackpressureDropSynchronous() { for (int i = 0; i < 100; i++) { int NUM = (int) (RxRingBuffer.SIZE * 1.1); AtomicInteger c = new AtomicInteger(); TestSubscriber<Integer> ts = new TestSubscriber<Integer>(); firehose(c).onBackpressureDrop() .map(SLOW_PASS_THRU).take(NUM).subscribe(ts); ts.awaitTerminalEvent(); ts.assertNoErrors(); List<Integer> onNextEvents = ts.getOnNextEvents(); assertEquals(NUM, onNextEvents.size()); Integer lastEvent = onNextEvents.get(NUM - 1); System.out.println("testOnBackpressureDrop => Received: " + onNextEvents.size() + " Emitted: " + c.get() + " Last value: " + lastEvent); assertTrue(NUM - 1 <= lastEvent.intValue()); } }
Source:
<code>private void writeData() { <START> if (commitExecutor.isShutdown()) { <END> if (!commitExecutor.isTerminated()) { try { if (!commitExecutor .awaitTermination(OGlobalConfiguration.WAL_SHUTDOWN_TIMEOUT.getValueAsInteger(), TimeUnit.MILLISECONDS)) throw new OStorageException("Unable to write data, WAL commit executor appears hung"); } catch (InterruptedException e) { Thread.interrupted(); throw OException.wrapException(new OStorageException("Thread was interrupted during waiting for WAL commit executor"), e); } } new WriteTask().run(); } else { try { commitExecutor.submit(new WriteTask()).get(); } catch (InterruptedException e) { Thread.interrupted(); throw OException.wrapException(new OStorageException("Thread was interrupted during flush"), e); } catch (ExecutionException e) { throw OException.wrapException(new OStorageException("Error during WAL segment '" + getPath() + "' flush"), e); } } }</code><technical_language>Thank for rewriting writeData implementation fix a issue</technical_language>

Target:
private void writeData() { if (commitExecutor.isShutdown()) if (flushNewData) throw new OStorageException("Unable to write data, WAL thread is shutdown"); else return; try { commitExecutor.submit(new WriteTask()).get(); } catch (InterruptedException e) { Thread.interrupted(); throw OException.wrapException(new OStorageException("Thread was interrupted during data write"), e); } catch (ExecutionException e) { throw OException.wrapException(new OStorageException("Error during WAL segment '" + getPath() + "' data write"), e); } }
Source:
<code>public PropertyRegexTester(IPersonAttributesGroupTestDefinition definition) { super(definition); final String propertyName = definition.getTestValue(); String regexExpression = PropertiesManager.getProperty (propertyName, ""); if (StringUtils.isBlank(regexExpression)) { logger.error("Unable to find property name in portal.properties or has empty value." + " PAGS PropertyRegexTester will always return false for attribute {}", propertyName, definition.getAttributeName()); } setPattern(regexExpression); <START> } <END></code><technical_language>PropertyInvertedRegexTester in private method constructor chaining avoid code duplication</technical_language>

Target:
public PropertyRegexTester(IPersonAttributesGroupTestDefinition definition) { super(definition); setPattern(definition.getAttributeName(), definition.getTestValue()); }
Source:
<code>public boolean isSuccessStatusCode() { <START> return 200 <= this.statusCode && this.statusCode <= 299; <END> }</code><technical_language>200 >= instead of <=</technical_language>

Target:
public boolean isSuccessStatusCode() { return this.statusCode >= 200 && this.statusCode <= 299; }
Source:
<code>public void factoryWithDirectUrlWithSpecificBranch() throws Exception { String repositoryName = testRepo.getName(); try { testFactoryWithSpecificBranch.authenticateAndOpen(); } catch (NoSuchElementException ex) { fail("<LINK_0>"); } projectExplorer.waitProjectExplorer(); notificationsPopupPanel.waitProgressPopupPanelClose(); events.clickEventLogBtn(); events.waitExpectedMessage( "Project " + repositoryName + " imported", UPDATING_PROJECT_TIMEOUT_SEC); events.waitExpectedMessage( "Successfully configured and cloned source code of " + repositoryName, UPDATING_PROJECT_TIMEOUT_SEC); events.waitExpectedMessage( <START> "Project: " <END> + repositoryName + " | cloned from: " + repositoryName + " | remote branch: refs/remotes/origin/" + SECOND_BRANCH_NAME + " | local branch: " + SECOND_BRANCH_NAME, UPDATING_PROJECT_TIMEOUT_SEC); projectExplorer.waitAndSelectItem(repositoryName); pullRequestPanel.waitOpenPanel(); projectExplorer.expandPathInProjectExplorer(repositoryName + "/my-lib"); projectExplorer.waitItem(repositoryName + "/my-lib/pom.xml"); String wsId = workspaceServiceClient .getByName(seleniumWebDriver.getWorkspaceNameFromBrowserUrl(), testUser.getName()) .getId(); List<String> visibleItems = projectExplorer.getNamesOfAllOpenItems(); assertTrue( visibleItems.containsAll( ImmutableList.of(repositoryName, "my-lib", "my-webapp", "src", "pom.xml"))); String projectType = testProjectServiceClient.getFirstProject(wsId).getType(); assertTrue(projectType.equals("blank")); }</code><technical_language>This multi row string good. i Strng.format() add variate part string</technical_language>

Target:
public void factoryWithDirectUrlWithSpecificBranch() throws Exception { String repositoryName = testAuxiliaryRepo.getName(); try { testFactoryWithSpecificBranch.authenticateAndOpen(); } catch (NoSuchElementException ex) { fail("<LINK_0>"); } projectExplorer.waitProjectExplorer(); notificationsPopupPanel.waitProgressPopupPanelClose(); events.clickEventLogBtn(); events.waitExpectedMessage( "Project " + repositoryName + " imported", UPDATING_PROJECT_TIMEOUT_SEC); events.waitExpectedMessage( "Successfully configured and cloned source code of " + repositoryName, UPDATING_PROJECT_TIMEOUT_SEC); events.waitExpectedMessage( String.format( "Project: %s | cloned from: %s | remote branch: refs/remotes/origin/%s | local branch: %s", repositoryName, repositoryName, SECOND_BRANCH_NAME, SECOND_BRANCH_NAME), UPDATING_PROJECT_TIMEOUT_SEC); projectExplorer.waitAndSelectItem(repositoryName); pullRequestPanel.waitOpenPanel(); projectExplorer.expandPathInProjectExplorer(repositoryName + "/my-lib"); projectExplorer.waitItem(repositoryName + "/my-lib/pom.xml"); String wsId = workspaceServiceClient .getByName(seleniumWebDriver.getWorkspaceNameFromBrowserUrl(), testUser.getName()) .getId(); List<String> visibleItems = projectExplorer.getNamesOfAllOpenItems(); assertTrue( visibleItems.containsAll( ImmutableList.of(repositoryName, "my-lib", "my-webapp", "src", "pom.xml"))); String projectType = testProjectServiceClient.getFirstProject(wsId).getType(); assertTrue(projectType.equals("blank")); }
Source:
<code><START> public void setWidth(int width) { <END> this.width= width; }</code><technical_language>this need public? this useful call subclasses, protected. final in a 1st iteration do use-cases need override it</technical_language>

Target:
protected final void setWidth(int width) { this.width= width; }
Source:
<code>public Context(String type, String name) { <START> Preconditions.checkNotNull(type, "type"); <END> Preconditions.checkNotNull(name, "name"); this.type = type; this.name = name; }</code><technical_language>Methods in Preconditions imported statically</technical_language>

Target:
public Context(String type, String name) { checkNotNull(type, "type"); checkNotNull(name, "name"); this.type = type; this.name = name; }
Source:
<code>private void failAfterMinimum(final int next) throws SpuriousIOException { if (count.get() + next > minimumBytes) { <START> throw new SpuriousIOException("Random error"); <END> } }</code><technical_language>nit: This is arbitrary "random" error. nice include byte error induced in message</technical_language>

Target:
private void failAfterMinimum(final int next) throws SpuriousIOException { if (count.get() + next > minimumBytes) { throw new SpuriousIOException("Read failure after byte " + minimumBytes); } }
Source:
<code>public void testReadLz4() throws Exception { byte[] data = toByteArray(getResource("apache-lz4.orc")); OrcReader orcReader = new OrcReader(new InMemoryOrcDataSource(data), ORC, SIZE, SIZE, SIZE); assertEquals(orcReader.getCompressionKind(), LZ4); Map<Integer, Type> includedColumns = ImmutableMap.<Integer, Type>builder() .put(0, BIGINT) .put(1, INTEGER) .put(2, BIGINT) .build(); OrcRecordReader reader = orcReader.createRecordReader( includedColumns, OrcPredicate.TRUE, DateTimeZone.UTC, newSimpleAggregatedMemoryContext()); int rows = 0; while (true) { int batchSize = reader.nextBatch(); if (batchSize <= 0) { break; } rows += batchSize; Block xBlock = reader.readBlock(BIGINT, 0); Block yBlock = reader.readBlock(INTEGER, 1); Block zBlock = reader.readBlock(BIGINT, 2); for (int position = 0; position < batchSize; position++) { BIGINT.getLong(xBlock, position); INTEGER.getLong(yBlock, position); BIGINT.getLong(zBlock, position); } } assertEquals(rows, reader.getFileRowCount()); <START> } <END></code><technical_language>Hard code expected number of rows</technical_language>

Target:
public void testReadLz4() throws Exception { byte[] data = toByteArray(getResource("apache-lz4.orc")); OrcReader orcReader = new OrcReader(new InMemoryOrcDataSource(data), ORC, SIZE, SIZE, SIZE); assertEquals(orcReader.getCompressionKind(), LZ4); assertEquals(orcReader.getFooter().getNumberOfRows(), 10_000); Map<Integer, Type> includedColumns = ImmutableMap.<Integer, Type>builder() .put(0, BIGINT) .put(1, INTEGER) .put(2, BIGINT) .build(); OrcRecordReader reader = orcReader.createRecordReader( includedColumns, OrcPredicate.TRUE, DateTimeZone.UTC, newSimpleAggregatedMemoryContext()); int rows = 0; while (true) { int batchSize = reader.nextBatch(); if (batchSize <= 0) { break; } rows += batchSize; Block xBlock = reader.readBlock(BIGINT, 0); Block yBlock = reader.readBlock(INTEGER, 1); Block zBlock = reader.readBlock(BIGINT, 2); for (int position = 0; position < batchSize; position++) { BIGINT.getLong(xBlock, position); INTEGER.getLong(yBlock, position); BIGINT.getLong(zBlock, position); } } assertEquals(rows, reader.getFileRowCount()); }
Source:
<code>public Map<String, String> getFields() { Map<String, String> map = fFields; if (map == null) { <START> byte[] array = Arrays.copyOfRange(fPayload.array(), 0, fPayload.limit()); <END> Builder<String, String> builder = ImmutableMap.<@NonNull String, @NonNull String> builder() .put("Binary", ConversionHelper.bytesToHex(array, true)); try { String s = new String(array, "UTF-8"); builder.put("Character", s); } catch (UnsupportedEncodingException e) { } fFields = builder.build(); return fFields; } return map; }</code><technical_language>need consider arrayOffset()</technical_language>

Target:
public Map<String, String> getFields() { Map<String, String> map = fFields; if (map == null) { byte[] array = Arrays.copyOfRange(fPayload.array(), fPayload.arrayOffset(), fPayload.arrayOffset() + fPayload.limit()); Builder<String, String> builder = ImmutableMap.<@NonNull String, @NonNull String> builder() .put("Binary", ConversionHelper.bytesToHex(array, true)); try { String s = new String(array, "UTF-8"); builder.put("Character", s); } catch (UnsupportedEncodingException e) { } fFields = builder.build(); return fFields; } return map; }
Source:
<code>public void setSchedulerService(SchedulerService schedulerService) throws InitialisationException { this.schedulerService = schedulerService; <START> initialise(); <END> }</code><technical_language>this belong</technical_language>

Target:
void setSchedulerService(SchedulerService schedulerService) { this.schedulerService = schedulerService; }
Source:
<code>public void shouldScheduleEmailCheckJob() throws SchedulerException { <START> ebodacScheduler.unscheduleEmailCheckJob(); <END> verify(motechSchedulerService).safeUnscheduleAllJobs(EbodacConstants.EMAIL_CHECK_EVENT); Integer interval = 500; ebodacScheduler.scheduleEmailCheckJob(interval); MotechEvent event = new MotechEvent(EbodacConstants.EMAIL_CHECK_EVENT); Period period = Period.minutes(interval); DateTime startDate = DateTime.now().plusMinutes(1); RepeatingPeriodSchedulableJob job = new RepeatingPeriodSchedulableJob(event, startDate.toDate(), null, period, true); verify(motechSchedulerService).safeScheduleRepeatingPeriodJob(job); }</code><technical_language>move new test</technical_language>

Target:
public void shouldScheduleEmailCheckJob() { Integer interval = 500; DateTimeUtils.setCurrentMillisFixed(10L); DateTime startDate = DateTime.now().plusMinutes(1); ebodacScheduler.scheduleEmailCheckJob(interval); MotechEvent event = new MotechEvent(EbodacConstants.EMAIL_CHECK_EVENT); Period period = Period.minutes(interval); RepeatingPeriodSchedulableJob job = new RepeatingPeriodSchedulableJob(event, startDate.toDate(), null, period, true); verify(motechSchedulerService).safeScheduleRepeatingPeriodJob(job); }
Source:
<code>public void testXSetWMProtocols() { X11.Atom[] protocols = new X11.Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false) }; <START> int status = X11.INSTANCE.XSetWMProtocols(display, root, protocols, 1); <END> assertEquals("Bad status for XSetWMProtocols", 1, status); }</code><technical_language>Please replace hardcoded count of "1" protocols.length, this enforces correct values, if input is changed</technical_language>

Target:
public void testXSetWMProtocols() { X11.Atom[] atoms = new X11.Atom[]{ X11.INSTANCE.XInternAtom(display, "WM_DELETE_WINDOW", false), X11.INSTANCE.XInternAtom(display, "WM_TAKE_FOCUS", false) }; int status = X11.INSTANCE.XSetWMProtocols(display, root, atoms, atoms.length); Assert.assertNotEquals("Bad status for XSetWMProtocols", 0, status); }
Source:
<code>public static void placeVolumeInVolumeAccessGroups(SolidFireConnection sfConnection, long sfVolumeId, List<HostVO> hosts, String clusterUuId) { if (!SolidFireUtil.hostsSupport_iScsi(hosts)) { String errMsg = "Not all hosts in the compute cluster support iSCSI."; LOGGER.warn(errMsg); throw new CloudRuntimeException(errMsg); } List<SolidFireUtil.SolidFireVag> sfVags = SolidFireUtil.getAllVags(sfConnection); Map<SolidFireUtil.SolidFireVag, List<String>> sfVagToIqnsMap = buildVagToIQNMap(hosts, sfVags); if (sfVagToIqnsMap.size() > MAX_NUM_VAGS_PER_VOLUME) { throw new CloudRuntimeException("A SolidFire volume can be in at most four volume access groups simultaneously."); } if (sfVagToIqnsMap.containsKey(null)) { sfVagToIqnsMap = updateNullKeyInsfVagToIqnsMap(sfVagToIqnsMap, sfVags, sfConnection, clusterUuId, sfVolumeId); } <START> addVoulumestoVagIfNotPresent(sfVagToIqnsMap.keySet(), sfVolumeId, sfConnection); <END> }</code><technical_language>"Voulumes" "Volumes"</technical_language>

Target:
public static void placeVolumeInVolumeAccessGroups(SolidFireConnection sfConnection, long sfVolumeId, List<HostVO> hosts, String clusterUuId) { if (!SolidFireUtil.hostsSupport_iScsi(hosts)) { String errMsg = "Not all hosts in the compute cluster support iSCSI."; LOGGER.warn(errMsg); throw new CloudRuntimeException(errMsg); } List<SolidFireUtil.SolidFireVag> sfVags = SolidFireUtil.getAllVags(sfConnection); Map<SolidFireUtil.SolidFireVag, List<String>> sfVagToIqnsMap = buildVagToIQNMap(hosts, sfVags); if (sfVagToIqnsMap.size() > MAX_NUM_VAGS_PER_VOLUME) { throw new CloudRuntimeException("A SolidFire volume can be in at most four volume access groups simultaneously."); } if (sfVagToIqnsMap.containsKey(null)) { sfVagToIqnsMap = updateNullKeyInSfVagToIqnsMap(sfVagToIqnsMap, sfVags, sfConnection, clusterUuId, sfVolumeId); } addVolumestoVagIfNotPresent(sfVagToIqnsMap.keySet(), sfVolumeId, sfConnection); }
Source:
<code><START> public static List<TargetGroup> newTargetGroups( <END> final Collection<Unit> units, final Collection<Unit> enemyUnits) { final Set<UnitType> unitTypes = units.stream().map(unit -> unit.getType()).collect(Collectors.toSet()); final Set<UnitType> enemyUnitTypes = enemyUnits.stream().map(unit -> unit.getType()).collect(Collectors.toSet()); final List<TargetGroup> firingGroups = new ArrayList<TargetGroup>(); for (final UnitType unitType : unitTypes) { final Set<UnitType> targets = findTargets(unitType, unitTypes, enemyUnitTypes); boolean isAdded = false; for (final TargetGroup firingGroup : firingGroups) { if (firingGroup.getTargetUnitTypes().equals(targets)) { firingGroup.getFiringUnitTypes().add(unitType); isAdded = true; break; } } if (!isAdded) { firingGroups.add(new TargetGroup(unitType, targets)); } } return sortFiringGroups(firingGroups); }</code><technical_language>Method newTargetGroups a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring</technical_language>

Target:
public static List<TargetGroup> newTargetGroups( final Collection<Unit> units, final Collection<Unit> enemyUnits) { final Set<UnitType> unitTypes = units.stream().map(unit -> unit.getType()).collect(Collectors.toSet()); final Set<UnitType> enemyUnitTypes = enemyUnits.stream().map(unit -> unit.getType()).collect(Collectors.toSet()); final List<TargetGroup> targetGroups = new ArrayList<TargetGroup>(); for (final UnitType unitType : unitTypes) { final Set<UnitType> targets = findTargets(unitType, unitTypes, enemyUnitTypes); if (targets.isEmpty()) { continue; } final Optional<TargetGroup> targetGroup = findTargetsInTargetGroups(targets, targetGroups); if (targetGroup.isPresent()) { targetGroup.get().getFiringUnitTypes().add(unitType); } else { targetGroups.add(new TargetGroup(unitType, targets)); } } return sortTargetGroups(targetGroups); }
Source:
<code>public Map<String, AnalysisProvider<TokenFilterFactory>> getTokenFilters() { <START> Map<String, AnalysisProvider<TokenFilterFactory>> map = new HashMap<>(); <END> map.put("serbian_stemmer", SerbianStemmerTokenFilterFactory::new); return Collections.unmodifiableMap(map); }</code><technical_language>return Collections.singletonMap( "serbian_stemmer", SerbianStemmerTokenFilterFactory::new );</technical_language>

Target:
public Map<String, AnalysisProvider<TokenFilterFactory>> getTokenFilters() { return Collections.singletonMap("serbian_stemmer", SerbianStemmerTokenFilterFactory::new); }
Source:
<code>public QuotaBalanceResponse createQuotaLastBalanceResponse(List<QuotaBalanceVO> quotaBalance, Date startDate) { <START> if (quotaBalance == null || quotaBalance.size() == 0) { <END> throw new InvalidParameterValueException("There are no balance entries on or before the requested date."); } if (startDate == null) { startDate = new Date(); } QuotaBalanceResponse resp = new QuotaBalanceResponse(); BigDecimal lastCredits = new BigDecimal(0); for (QuotaBalanceVO entry : quotaBalance) { if (s_logger.isDebugEnabled()) { s_logger.info("createQuotaLastBalanceResponse Date=" + entry.getUpdatedOn() + " balance=" + entry.getCreditBalance() + " credit=" + entry.getCreditsId()); } lastCredits = lastCredits.add(entry.getCreditBalance()); } resp.setStartQuota(lastCredits); resp.setStartDate(_quotaService.computeAdjustedTime(startDate)); resp.setCurrency(QuotaConfig.QuotaCurrencySymbol.value()); resp.setObjectName("balance"); return resp; }</code><technical_language>List#isEmpty() is preferred, idiomatic check a list is empty</technical_language>

Target:
public QuotaBalanceResponse createQuotaLastBalanceResponse(List<QuotaBalanceVO> quotaBalance, Date startDate) { if (quotaBalance == null) { throw new InvalidParameterValueException("There are no balance entries on or before the requested date."); } if (startDate == null) { startDate = new Date(); } QuotaBalanceResponse resp = new QuotaBalanceResponse(); BigDecimal lastCredits = new BigDecimal(0); for (QuotaBalanceVO entry : quotaBalance) { if (s_logger.isDebugEnabled()) { s_logger.debug("createQuotaLastBalanceResponse Date=" + entry.getUpdatedOn() + " balance=" + entry.getCreditBalance() + " credit=" + entry.getCreditsId()); } lastCredits = lastCredits.add(entry.getCreditBalance()); } resp.setStartQuota(lastCredits); resp.setStartDate(_quotaService.computeAdjustedTime(startDate)); resp.setCurrency(QuotaConfig.QuotaCurrencySymbol.value()); resp.setObjectName("balance"); return resp; }
Source:
<code>private String getLocal(final Server server, final User user, final long radius) { final Location loc = user.getLocation(); final World world = loc.getWorld(); final StringBuilder output = new StringBuilder(); final long radiusSquared = radius * radius; boolean showHidden = user.canInteractVanished(); Queue<User> nearbyPlayers = new PriorityQueue<>((o1, o2) -> (int) (o1.getLocation().distanceSquared(loc) - o2.getLocation().distanceSquared(loc))); for (User player : ess.getOnlineUsers()) { if (!player.equals(user) && (!player.isHidden(user.getBase()) || showHidden || user.getBase().canSee(player.getBase()))) { final Location playerLoc = player.getLocation(); if (playerLoc.getWorld() != world) { continue; } final long delta = (long) playerLoc.distanceSquared(loc); if (delta < radiusSquared) { nearbyPlayers.offer(player); } } } while (!nearbyPlayers.isEmpty()) { if (output.length() > 0) { output.append(", "); } User nearbyPlayer = nearbyPlayers.poll(); <START> output.append(nearbyPlayer.getDisplayName()).append("§f(§4").append((long) Math.sqrt(nearbyPlayer.getLocation().distanceSquared(loc))).append("m§f)"); <END> } return output.length() > 1 ? output.toString() : tl("none"); }</code><technical_language>nearbyPlayer.getLocation().distance(loc)</technical_language>

Target:
private String getLocal(final Server server, final User user, final long radius) { final Location loc = user.getLocation(); final World world = loc.getWorld(); final StringBuilder output = new StringBuilder(); final long radiusSquared = radius * radius; boolean showHidden = user.canInteractVanished(); Queue<User> nearbyPlayers = new PriorityQueue<>((o1, o2) -> (int) (o1.getLocation().distanceSquared(loc) - o2.getLocation().distanceSquared(loc))); for (User player : ess.getOnlineUsers()) { if (!player.equals(user) && (!player.isHidden(user.getBase()) || showHidden || user.getBase().canSee(player.getBase()))) { final Location playerLoc = player.getLocation(); if (playerLoc.getWorld() != world) { continue; } final long delta = (long) playerLoc.distanceSquared(loc); if (delta < radiusSquared) { nearbyPlayers.offer(player); } } } while (!nearbyPlayers.isEmpty()) { if (output.length() > 0) { output.append(", "); } User nearbyPlayer = nearbyPlayers.poll(); output.append(nearbyPlayer.getDisplayName()).append("§f(§4").append((long) nearbyPlayer.getLocation().distance(loc)).append("m§f)"); } return output.length() > 1 ? output.toString() : tl("none"); }
Source:
<code>public void itDoesntWritePassword() throws Exception { JsonNode node = getResponseAsJson(RequestType.GET, "/user/user1"); <START> assertNull("", node.get("properties").get("password")); <END> }</code><technical_language>need for empty message assertNull(node.get("properties").get("password"));</technical_language>

Target:
public void itDoesntWritePassword() throws Exception { JsonNode node = getResponseAsJson(RequestType.GET, "/user/user1"); assertNull(node.get("properties").get("password")); }
Source:
<code>public Void visit(File f) { try { ContentUtils.writeToFile(f, dest, progress, worker, source); } catch (IOException ex) { <START> logger.log(Level.WARNING, <END> "Trouble extracting file to " + dest.getAbsolutePath(), ex); } return null; }</code><technical_language>is a bit of subtlety here. experience error reading a file a data source, want write a warning, data source, typically image, corrupt in some way, atypical do about, WARNING. However, reading writing secondary storage. If write fails, is a SEVERE error. I solutions: 1. ReadContentInputStream throw a new class of exception derived IOException, a compatible of distinguishing exceptions, TskCoreExceptions wrapped in IOException more stream-like, I understandable unfortunate design decision. 2. Leave SEVERE errors, cloaking a problem writing files secondary storage. aside, note this points out a weakness of of a Visitor here, ideally propagating error client decide handle it; is a problem for another day, partially reflects more of ad hoc error handling policy of this originally written, exceptions in visit methods considered. I prefer #1 improvement while in this code require a small, potentially negligible effort, useful in other places in this story (like in CallLogAnalyzer below), can, for example, give user a meaningful error message if a read operation fails. #2 is effort. this is a matter of public API, I @bcarrier choice, care, in case I do #1</technical_language>

Target:
public Void visit(File f) { try { ContentUtils.writeToFile(f, dest, progress, worker, source); } catch (ReadContentInputStreamException ex) { logger.log(Level.WARNING, "Trouble extracting file to " + dest.getAbsolutePath(), ex); } catch (IOException ex) { logger.log(Level.SEVERE, "Trouble extracting file to " + dest.getAbsolutePath(), ex); } return null; }
Source:
<code>public void getSourceFile(OutputStream output, IResourceRegistry registry, String urlToSource, boolean offline) { <START> String templateName = offline ? "offlineSourceFileTemplate.html" : "sourceFileTemplate.html"; <END> ResourceToken template = new ClassBasedResourceToken(templateName, getClass()); Writer writer = null; try { writer = new OutputStreamWriter(output); Client client = Client.create(); WebResource service = client.resource(urlToSource); PageFactory.realizePage(registry, template, writer, "fileContents", service.get(String.class)); } finally { Lib.close(writer); } }</code><technical_language>tokens hard coded strings. Why</technical_language>

Target:
public void getSourceFile(OutputStream output, IResourceRegistry registry, String urlToSource, boolean offline) { ResourceToken template = offline ? SOURCE_OFFLINE : SOURCE; Writer writer = null; try { writer = new OutputStreamWriter(output); Client client = Client.create(); WebResource service = client.resource(urlToSource); PageFactory.realizePage(registry, template, writer, "fileContents", service.get(String.class)); } finally { Lib.close(writer); } }
Source:
<code>public int onStartCommand(Intent intent, int flags, int startId) { <START> googleApiClient = new GoogleApiClient.Builder(this) <END> .addApi(Nearby.MESSAGES_API) .addConnectionCallbacks(connectionCallbacks) .addOnConnectionFailedListener(onConnectionFailedListener) .build(); googleApiClient.connect(); return Service.START_NOT_STICKY; }</code><technical_language>this in onCreate</technical_language>

Target:
public int onStartCommand(Intent intent, int flags, int startId) { googleApiClient.connect(); return Service.START_NOT_STICKY; }
Source:
<code>@Override public void attach(Linker linker) { for (Element enclosedElement : enclosingClass.getEnclosedElements()) { if (enclosedElement.getKind().isField()) { Inject injectAnnotation = enclosedElement.getAnnotation(Inject.class); if (injectAnnotation != null) { String key = GeneratorKeys.get(enclosedElement.asType()); <START> System.out.println("enclosedElementKey = " + key); <END> linker.requestBinding(key, enclosingClass.toString()); } } } }</code><technical_language>Remove</technical_language>

Target:
@Override public void attach(Linker linker) { for (Element enclosedElement : enclosingClass.getEnclosedElements()) { if (enclosedElement.getKind().isField() && CodeGen.isStatic(enclosedElement)) { Inject injectAnnotation = enclosedElement.getAnnotation(Inject.class); if (injectAnnotation != null) { String key = GeneratorKeys.get(enclosedElement.asType()); linker.requestBinding(key, enclosingClass.toString()); } } } }
Source:
<code><START> private boolean cannotAdd(T element) { return type != obj() && ((element == null) || (type.type() != asPrimitive(element.getClass()))); } <END></code><technical_language>need check types. T need check if want insert null a primitive array. java private boolean addNullToPrimitiveArray(T element) { return !arrayType.isPrimitive() && element == null; } I need additional check if element is Object want insert primitive array. If element is null unboxed, right? If is unboxed to: java private boolean addNullOrObjectToPrimitiveArray(T element) { return arrayType.isPrimitive() && (element == null || !arrayType.isPrimitive()); }</technical_language>

Target:
private boolean cannotAdd(T element) { return (type != obj()) && (type.type() != primitiveType(element)); }
Source:
<code>protected void recvCommands() throws IOException { PushCertificateParser certParser = getPushCertificateParser(); FirstLine firstLine = null; try { for (;;) { <START> String line; try { rawLine = <END> pckIn.readString(); } catch (EOFException eof) { if (commands.isEmpty()) return; throw eof; } if (rawLine == PacketLineIn.END) { break; } if (line.length() >= 48 && line.startsWith("shallow ")) { clientShallowCommits.add(ObjectId.fromString(line.substring(8, 48))); continue; } if (firstLine == null) { firstLine = new FirstLine(line); enabledCapabilities = firstLine.getCapabilities(); line = firstLine.getLine(); if (line.equals(GitProtocolConstants.OPTION_PUSH_CERT)) { certParser.receiveHeader(pckIn, !isBiDirectionalPipe()); continue; } } if (line.equals(PushCertificateParser.BEGIN_SIGNATURE)) { certParser.receiveSignature(pckIn); continue; } ReceiveCommand cmd = parseCommand(line); if (cmd.getRefName().equals(Constants.HEAD)) { cmd.setResult(Result.REJECTED_CURRENT_BRANCH); } else { cmd.setRef(refs.get(cmd.getRefName())); } commands.add(cmd); if (certParser.enabled()) { certParser.addCommand(cmd); } } } catch (PackProtocolException e) { sendError(e.getMessage()); throw e; } }</code><technical_language>bad rebase? I rawLine is in scope here</technical_language>

Target:
protected void recvCommands() throws IOException { PushCertificateParser certParser = getPushCertificateParser(); FirstLine firstLine = null; try { for (;;) { String line; try { line = pckIn.readString(); } catch (EOFException eof) { if (commands.isEmpty()) return; throw eof; } if (line == PacketLineIn.END) { break; } if (line.length() >= 48 && line.startsWith("shallow ")) { clientShallowCommits.add(ObjectId.fromString(line.substring(8, 48))); continue; } if (firstLine == null) { firstLine = new FirstLine(line); enabledCapabilities = firstLine.getCapabilities(); line = firstLine.getLine(); if (line.equals(GitProtocolConstants.OPTION_PUSH_CERT)) { certParser.receiveHeader(pckIn, !isBiDirectionalPipe()); continue; } } if (line.equals(PushCertificateParser.BEGIN_SIGNATURE)) { certParser.receiveSignature(pckIn); continue; } ReceiveCommand cmd; try { cmd = parseCommand(line); } catch (PackProtocolException e) { sendError(e.getMessage()); throw e; } if (cmd.getRefName().equals(Constants.HEAD)) { cmd.setResult(Result.REJECTED_CURRENT_BRANCH); } else { cmd.setRef(refs.get(cmd.getRefName())); } commands.add(cmd); if (certParser.enabled()) { certParser.addCommand(cmd); } } } catch (PackProtocolException e) { sendError(e.getMessage()); throw e; } }
Source:
<code>protected void tearDown() throws Exception { Job.getJobManager().cancel(BuildTestProject.class); <START> IProject testProject = getTestProject(); if (testProject.exists()) { testProject.delete(true, null); } <END> setWorkspaceAutoBuild(wasAutoBuildOn); logListener.clear(); Platform.removeLogListener(logListener); super.tearDown(); }</code><technical_language>Please enclose try/finally put autobuild restore code finally block</technical_language>

Target:
protected void tearDown() throws Exception { Job.getJobManager().cancel(BuildTestProject.class); Platform.removeLogListener(logListener); logListener.clear(); try { IProject testProject = getTestProject(); if (testProject.exists()) { testProject.delete(true, null); } } finally { setWorkspaceAutoBuild(wasAutoBuildOn); } super.tearDown(); }
Source:
<code>public void removeServoEventListener(NameProvider service) { isEventsEnabled = false; <START> removeListener("publishServoEvent", service.getName(), "onServoEvent"); <END> }</code><technical_language>refactored call detach. isEventsEnabled away</technical_language>

Target:
public void removeServoEventListener(NameProvider service) { isEventsEnabled = false; unsubscribe(getName(), "publishServoEvent"); }
Source:
<code>public static void configurePushURI(RemoteConfig remoteConfig, URIish pushURI) <START> throws URISyntaxException { <END> List<URIish> pushURIs = new ArrayList<URIish>( remoteConfig.getPushURIs()); for (URIish urIish : pushURIs) { remoteConfig.removePushURI(urIish); } remoteConfig.addPushURI(pushURI); }</code><technical_language>exception is thrown in code, is needed here</technical_language>

Target:
public static void configurePushURI(RemoteConfig remoteConfig, URIish pushURI) { List<URIish> pushURIs = new ArrayList<URIish>( remoteConfig.getPushURIs()); for (URIish urIish : pushURIs) { remoteConfig.removePushURI(urIish); } remoteConfig.addPushURI(pushURI); }
Source:
<code>public static String[] listBaudRates() { <START> return new String[] {"115200", "57600", "38400", "31250", "28800", "19200", "14400", "9600", "4800", "2400", "1200", "300"}; <END> }</code><technical_language>I this is improvement,t NON-NLS avoid warnings previous line add warnings instead of remove warnings</technical_language>

Target:
public static String[] listBaudRates() { String outgoing[] = { "115200", "57600", "38400", "31250", "28800", "19200", "14400", "9600", "4800", "2400", "1200", "300" }; return outgoing; }
Source:
<code>public void boardNew(boolean showDialog) { boolean userCancel = false; if (showDialog) { RandomMapDialog rmd = new RandomMapDialog(frame, this, null, mapSettings); userCancel = rmd.activateDialog(bv.getTilesetManager().getThemes()); } <START> if (!userCancel) { board = BoardUtilities.generateRandom(mapSettings); game.setBoard(board); curfile = null; butSourceFile.setEnabled(false); frame.setTitle(Messages.getString("BoardEditor.title")); menuBar.setBoard(true); bvc.doLayout(); resetUndo(); choTheme.setSelectedItem(mapSettings.getTheme()); <END> } }</code><technical_language>I this is tab space spacing, good fix</technical_language>

Target:
public void boardNew(boolean showDialog) { boolean userCancel = false; if (showDialog) { RandomMapDialog rmd = new RandomMapDialog(frame, this, null, mapSettings); userCancel = rmd.activateDialog(bv.getTilesetManager().getThemes()); } if (!userCancel) { board = BoardUtilities.generateRandom(mapSettings); game.setBoard(board); curfile = null; choTheme.setSelectedItem(mapSettings.getTheme()); setupUiFreshBoard(); } }
Source:
<code>private static Requirement createAvroTable(String schemaPath, String tableName, String topicName, ImmutableMap<String, Object> record) { try { Schema schema = new Schema.Parser().parse(new File(schemaPath)); byte[] avroData = convertRecordToAvro(schema, record); return immutableTable(new KafkaTableDefinition( tableName, topicName, new ListKafkaDataSource(ImmutableList.of( new KafkaMessage( contentsBuilder() .appendBytes(avroData) .build()))), 1, 1)); } catch (IOException e) { <START> throw new RuntimeException(e); <END> } }</code><technical_language>UncheckedIOException</technical_language>

Target:
private static Requirement createAvroTable(String schemaPath, String tableName, String topicName, ImmutableMap<String, Object> record) { try { Schema schema = new Schema.Parser().parse(new File(schemaPath)); byte[] avroData = convertRecordToAvro(schema, record); return immutableTable(new KafkaTableDefinition( tableName, topicName, new ListKafkaDataSource(ImmutableList.of( new KafkaMessage( contentsBuilder() .appendBytes(avroData) .build()))), 1, 1)); } catch (IOException e) { throw new UncheckedIOException(e); } }
Source:
<code>static Severity getSeverity(String severityName) { switch (severityName) { case "BLOCKER": case "CRITICAL": case "MAJOR": return Severity.ERROR; case "MINOR": return Severity.WARNING; case "INFO": <START> return Severity.INFO; <END> } log.warn("Unknown severity: " + severityName); return Severity.WARNING; }</code><technical_language>I levels, is correct MINOR WARNING? Please check if MINOR is INFO</technical_language>

Target:
static Severity getSeverity(String severityName) { switch (severityName) { case "BLOCKER": case "CRITICAL": case "MAJOR": return Severity.ERROR; case "MINOR": return Severity.WARNING; case "INFO": return Severity.INFO; default: log.warn("Unknown severity: " + severityName); } return Severity.WARNING; }
Source:
<code>public void testDivisibleByMiniBatchSize() { final Random generator = new Random(); final int numTotalInstances = MINI_BATCH_SIZE * 5; for (int i = 0; i < numTotalInstances; i++) { final int value = generator.nextInt(); values.put(i, value); } trainingDataProvider.prepareDataForEpoch(); assertTrue(numTotalInstances % MINI_BATCH_SIZE == 0); final int numTotalMiniBatches = (int) Math.ceil((double) numTotalInstances / MINI_BATCH_SIZE); final int numInstances = numTotalInstances / MINI_BATCH_SIZE; <START> int numMiniBatchCount = 0; <END> Map<Integer, Integer> trainingData = trainingDataProvider.getNextTrainingData(); while (!trainingData.isEmpty()) { numMiniBatchCount++; for (final Integer key : trainingData.keySet()) { assertEquals("The training data for a key should be same", values.get(key), trainingData.get(key)); } assertEquals("TrainingDataProvider did not give the expected number of instances", numInstances, trainingData.size()); trainingData = trainingDataProvider.getNextTrainingData(); } assertEquals("The total number of mini-batch is different from expectation", numTotalMiniBatches, numMiniBatchCount); }</code><technical_language>miniBatchIdx miniBatchCount</technical_language>

Target:
public void testDivisibleByMiniBatchSize() { final int numTotalInstances = MINI_BATCH_SIZE * 5; createMockTrainingData(numTotalInstances); trainingDataProvider.prepareDataForEpoch(); testGetNextTrainingData(numTotalInstances); assertTrue("Data should be exhausted", trainingDataProvider.getNextTrainingData().isEmpty()); trainingDataProvider.prepareDataForEpoch(); testGetNextTrainingData(numTotalInstances); assertTrue("Data should be exhausted", trainingDataProvider.getNextTrainingData().isEmpty()); }
Source:
<code>public void assertXmlApiWithXPathNavigationMatchesExpected() { <START> try { <END> FreeStyleProject project = createJobWithWorkspaceFile("checkstyleregextest.xml"); enableWarningsWithCheckstyle(project); String buildNumber = String.valueOf(project.getNextBuildNumber()); scheduleBuild(project); XmlPage page = j.createWebClient() .goToXml(project.getUrl() + buildNumber + "/checkstyleResult/api/xml?xpath=/*/overallResult"); Document test = page.getXmlDocument(); assertThat(test.getDocumentElement().getTagName()).isEqualTo("overallResult"); } catch (IOException | SAXException e) { e.printStackTrace(); } }</code><technical_language>s.o</technical_language>

Target:
public void assertXmlApiWithXPathNavigationMatchesExpected() { FreeStyleProject project = createJobWithWorkspaceFile("checkstyleregextest.xml"); enableWarningsWithCheckstyle(project); String buildNumber = String.valueOf(buildProjectAndReturnBuildNo(project)); XmlPage page = getXmlPage(project, buildNumber, "/checkstyleResult/api/xml?xpath=/*/overallResult"); Document test = page.getXmlDocument(); assertThat(test.getDocumentElement().getTagName()).isEqualTo("overallResult"); assertThat(test.getDocumentElement().getFirstChild().getNodeValue()).isEqualTo("SUCCESS"); }
Source:
<code>private BarcodeInventoryErrorDetail getErrorDetail(String netid, String assetTag, String condition, String buildingCode, String roomNumber) { BarcodeInventoryErrorDetail barcodeInventoryErrorDetail = new BarcodeInventoryErrorDetail(); <START> barcodeInventoryErrorDetail.setUploadRowNumber(1L); <END> barcodeInventoryErrorDetail.setCampusCode("IT"); barcodeInventoryErrorDetail.setAssetTagNumber(assetTag); barcodeInventoryErrorDetail.setUploadScanIndicator(true); barcodeInventoryErrorDetail.setUploadScanTimestamp(getDateTimeService().getCurrentTimestamp()); barcodeInventoryErrorDetail.setBuildingCode(buildingCode); barcodeInventoryErrorDetail.setBuildingRoomNumber(roomNumber); barcodeInventoryErrorDetail.setAssetConditionCode(condition); barcodeInventoryErrorDetail.setErrorCorrectionStatusCode(CamsConstants.BarCodeInventoryError.STATUS_CODE_ERROR); barcodeInventoryErrorDetail.setCorrectorUniversalIdentifier(netid); return barcodeInventoryErrorDetail; }</code><technical_language>Please existing constants define new for hard coded values</technical_language>

Target:
private BarcodeInventoryErrorDetail getErrorDetail(String netid, String assetTag, String condition, String buildingCode, String roomNumber) { BarcodeInventoryErrorDetail barcodeInventoryErrorDetail = new BarcodeInventoryErrorDetail(); barcodeInventoryErrorDetail.setUploadRowNumber(CuCamsConstants.CapAssetApi.UPLOAD_ROW_NUMBER); barcodeInventoryErrorDetail.setCampusCode(CuCamsConstants.CapAssetApi.CAMPUS_CODE_VALUE); barcodeInventoryErrorDetail.setAssetTagNumber(assetTag); barcodeInventoryErrorDetail.setUploadScanIndicator(true); barcodeInventoryErrorDetail.setUploadScanTimestamp(getDateTimeService().getCurrentTimestamp()); barcodeInventoryErrorDetail.setBuildingCode(buildingCode); barcodeInventoryErrorDetail.setBuildingRoomNumber(roomNumber); barcodeInventoryErrorDetail.setAssetConditionCode(condition); barcodeInventoryErrorDetail.setErrorCorrectionStatusCode(CamsConstants.BarCodeInventoryError.STATUS_CODE_ERROR); barcodeInventoryErrorDetail.setCorrectorUniversalIdentifier(netid); barcodeInventoryErrorDetail.setErrorDescription("Asset Tag Not Found"); return barcodeInventoryErrorDetail; }