auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void handleGetAllAttributeValuesResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final String resultData) { LOGGER.debug("handleGetAllAttributeValuesResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_UNEXPECTED_EXCEPTION, exception); result = ResponseMessageResultType.NOT_OK; } <START> this.webServiceResponseMessageSender.send( <END> ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withDataObject(resultData) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }</code><technical_language>Extract building of ResponseMessage variable (in eclipse, select text, right-click > refactor > extract local variable / select code + shift+alt+L). This code a bit more readable, especially passing in other besides ResponseMessage</technical_language>

Target:
public void handleGetAllAttributeValuesResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final String resultData) { LOGGER.debug("handleGetAllAttributeValuesResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); ResponseMessageResultType result = deviceResult; if (exception != null) { LOGGER.error(DEVICE_RESPONSE_NOT_OK_UNEXPECTED_EXCEPTION, exception); result = ResponseMessageResultType.NOT_OK; } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(deviceMessageMetadata.getDeviceIdentification()).withResult(result) .withOsgpException(exception).withDataObject(resultData) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send( responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
<code>private void confirmUnplug() { ConfirmationModel model = new ConfirmationModel(); model.setTitle(ConstantsManager.getInstance().getConstants().deactivateVmDisksTitle()); model.setMessage(ConstantsManager.getInstance().getConstants().areYouSureYouWantDeactivateVMDisksMsg()); model.setHashName("deactivate_vm_disk"); setWindow(model); <START> model.getLatch().setEntity(false); <END> ArrayList<String> items = new ArrayList<String>(); for (Object selected : getSelectedItems()) { items.add(((Disk) selected).getDiskAlias()); } model.setItems(items); UICommand unPlug = new UICommand("OnConfirmUnplug", this); unPlug.setTitle(ConstantsManager.getInstance().getConstants().ok()); unPlug.setIsDefault(true); model.getCommands().add(unPlug); UICommand cancel = new UICommand("Cancel", this); cancel.setTitle(ConstantsManager.getInstance().getConstants().cancel()); cancel.setIsCancel(true); model.getCommands().add(cancel); }</code><technical_language>This is needed, please remove</technical_language>

Target:
private void confirmUnplug() { ConfirmationModel model = new ConfirmationModel(); model.setTitle(ConstantsManager.getInstance().getConstants().deactivateVmDisksTitle()); model.setMessage(ConstantsManager.getInstance().getConstants().areYouSureYouWantDeactivateVMDisksMsg()); model.setHashName("deactivate_vm_disk"); setWindow(model); ArrayList<String> items = new ArrayList<String>(); for (Object selected : getSelectedItems()) { items.add(((Disk) selected).getDiskAlias()); } model.setItems(items); UICommand unPlug = new UICommand("OnConfirmUnplug", this); unPlug.setTitle(ConstantsManager.getInstance().getConstants().ok()); unPlug.setIsDefault(true); model.getCommands().add(unPlug); UICommand cancel = new UICommand("Cancel", this); cancel.setTitle(ConstantsManager.getInstance().getConstants().cancel()); cancel.setIsCancel(true); model.getCommands().add(cancel); }
Source:
<code>public Collection<? extends Action> createFor(@Nonnull Job job) { try { if (nonNull(JobInfoHelpers.triggerFrom(job, GitHubBranchTrigger.class))) { return Collections.singleton(forProject(job)); } <START> } catch (Exception ex) { <END> LOGGER.warn("Bad configured project - {}", job.getFullName(), ex.getMessage()); return Collections.emptyList(); } return Collections.emptyList(); }</code><technical_language>![CRITICAL](<LINK_0> log rethrow this exception. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public Collection<? extends Action> createFor(@Nonnull Job job) { try { if (nonNull(ghBranchTriggerFromJob(job))) { return Collections.singleton(forProject(job)); } } catch (Exception ex) { LOGGER.warn("Bad configured project - {}", job.getFullName(), ex.getMessage()); return Collections.emptyList(); } return Collections.emptyList(); }
Source:
<code>public Response pdf(@ApiParam(value = "Osoitetiedot", required = true) final AddressLabelBatch input, @Context HttpServletRequest request) { String documentId; try { byte[] pdf = labelBuilder.printPDF(input); DocumentId docId = downloadCache.addDocument(new Download("application/pdf;charset=utf-8", "addresslabels.pdf", pdf)); <START> documentId = docId.getDocumentId(); <END> } catch (Exception e) { e.printStackTrace(); LOG.error("AddressLabel PDF failed: {}", e.getMessage()); return createFailureResponse(request); } return createResponse(request, documentId + ".pdf"); }</code><technical_language>inline</technical_language>

Target:
public Response pdf(@ApiParam(value = "Osoitetiedot", required = true) final AddressLabelBatch input, @Context HttpServletRequest request) { try { byte[] pdf = labelBuilder.printPDF(input); DocumentId docId = downloadCache.addDocument(new Download("application/pdf;charset=utf-8", "addresslabels.pdf", pdf)); return createResponse(request, docId.getDocumentId() + ".pdf"); } catch (Exception e) { LOG.error("AddressLabel PDF failed: {}", e); return createFailureResponse(request); } }
Source:
<code>public SSLSession getSslSession() { SocketFactory socketFactory = connectionInternal.connection.getConfiguration().getSocketFactory(); String host = connectionInternal.connection.getConfiguration().getHost().ace; SSLSocket sslSocket = null; UInt16 port = connectionInternal.connection.getConfiguration().getPort(); try { sslSocket = (SSLSocket) socketFactory.createSocket(host, port.intValue()); } catch (IOException e) { Logger.getAnonymousLogger().log(Level.WARNING, "Couldn't obtain SSLSocket", e); return null; } SSLSession session = sslSocket.getSession(); <START> return session; <END> }</code><technical_language>purpose of this method is get currently active SSLSession transport, create a new one. needs a counterpart method in WebsocketInterface / AbstractWebsocket</technical_language>

Target:
public SSLSession getSslSession() { return websocket.getSSLSession(); }
Source:
<code>private void createDynamicMenu(Menu menu, final Repository[] repositories) { if (!isMultipleSelection(repositories)) { Repository repository = repositories[0]; createNewBranchMenuItem(menu, repository); if (hasBranches(repository)) { createSeparator(menu); } } int itemCount = createMostActiveBranchesMenuItems(menu, repositories); if (!isMultipleSelection(repositories)) { <START> createSeparator(menu); createSwitchToCommitItem(menu, repositories[0]); } if (!isMultipleSelection(repositories) && itemCount > 0) { createSeparator(menu); createOtherMenuItem(menu, repositories[0]); <END> } if (itemCount == 0 && isMultipleSelection(repositories)) { createDisabledMenu(menu, UIText.SwitchToMenu_NoCommonBranchesFound); } }</code><technical_language>"Commit" "Other" items in a single group, a separator in between. Right menu New branch... ---------- master ---------- Commit... ---------- Other... in worst case. separators</technical_language>

Target:
private void createDynamicMenu(Menu menu, final Repository[] repositories) { if (!isMultipleSelection(repositories)) { Repository repository = repositories[0]; createNewBranchMenuItem(menu, repository); if (hasBranches(repository)) { createSeparator(menu); } } int itemCount = createMostActiveBranchesMenuItems(menu, repositories); if (!isMultipleSelection(repositories)) { createSeparator(menu); createSwitchToCommitItem(menu, repositories[0]); if (itemCount > 0) { createOtherMenuItem(menu, repositories[0]); } } if (itemCount == 0 && isMultipleSelection(repositories)) { createDisabledMenu(menu, UIText.SwitchToMenu_NoCommonBranchesFound); } }
Source:
<code>public void testSync() throws InjectionException, NetworkException, InterruptedException, ExecutionException { final int numWorkers = 3; final List<String> workerIds = prepare(numWorkers); final SynchronizationManager synchronizationManager = driverComponents.getFirst(); final CountDownLatch firstLatch = callGlobalBarriers(workerIds.subList(0, 2)); <START> assertFalse("Cannot enter next state before all workers call global barrier", <END> firstLatch.await(SYNC_WAIT_TIME_MS, TimeUnit.MILLISECONDS)); callGlobalBarrier(workerIds.get(2)); assertTrue("All workers should be released after sync", firstLatch.await(SYNC_WAIT_TIME_MS, TimeUnit.MILLISECONDS)); final CountDownLatch secondLatch = callGlobalBarriers(workerIds.subList(1, 3)); assertFalse("Cannot enter next state before all workers call the global barrier", secondLatch.await(SYNC_WAIT_TIME_MS, TimeUnit.MILLISECONDS)); callGlobalBarrier(workerIds.get(0)); assertFalse("Cannot enter CLEANUP state before being allowed", secondLatch.await(SYNC_WAIT_TIME_MS, TimeUnit.MILLISECONDS)); synchronizationManager.allowWorkersCleanup(); assertTrue("All workers should be released", secondLatch.await(SYNC_WAIT_TIME_MS, TimeUnit.MILLISECONDS)); }</code><technical_language>this frequently string constant a global static final variable. for below</technical_language>

Target:
public void testSync() throws InjectionException, NetworkException, InterruptedException, ExecutionException { final int numWorkers = 3; final List<String> workerIds = prepare(numWorkers); final SynchronizationManager synchronizationManager = driverComponents.getFirst(); final CountDownLatch firstLatch = callGlobalBarriers(workerIds.subList(0, 2)); assertFalse(MSG_SHOULD_WAIT_OTHER_WORKERS, firstLatch.await(SYNC_WAIT_TIME_MS, TimeUnit.MILLISECONDS)); assertEquals(MSG_SHOULD_WAIT_OTHER_WORKERS, 2, firstLatch.getCount()); final CountDownLatch latch2 = callGlobalBarrier(workerIds.get(2)); assertTrue(MSG_SHOULD_RELEASE_WORKERS, latch2.await(SYNC_WAIT_TIME_MS, TimeUnit.MILLISECONDS)); assertTrue(MSG_SHOULD_RELEASE_WORKERS, firstLatch.await(SYNC_WAIT_TIME_MS, TimeUnit.MILLISECONDS)); final CountDownLatch secondLatch = callGlobalBarriers(workerIds.subList(1, 3)); assertFalse(MSG_SHOULD_WAIT_OTHER_WORKERS, secondLatch.await(SYNC_WAIT_TIME_MS, TimeUnit.MILLISECONDS)); assertEquals(MSG_SHOULD_WAIT_OTHER_WORKERS, 2, secondLatch.getCount()); final CountDownLatch latch0 = callGlobalBarrier(workerIds.get(0)); assertFalse(MSG_SHOULD_WAIT_ALLOW_OF_CLEANUP, latch0.await(SYNC_WAIT_TIME_MS, TimeUnit.MILLISECONDS)); assertEquals(MSG_SHOULD_WAIT_ALLOW_OF_CLEANUP, 2, secondLatch.getCount()); synchronizationManager.allowWorkersCleanup(); assertTrue(MSG_SHOULD_RELEASE_WORKERS, latch0.await(SYNC_WAIT_TIME_MS, TimeUnit.MILLISECONDS)); assertTrue(MSG_SHOULD_RELEASE_WORKERS, secondLatch.await(SYNC_WAIT_TIME_MS, TimeUnit.MILLISECONDS)); }
Source:
<code>public Map<String, Map<String, Integer>> dumpHashTableStats() { <START> Map<String, Map<String, Integer>> ret = new HashMap<String, Map<String, Integer>>(); <END> for (LocalFragment t : fragments) { ret.putAll(t.dumpHashTableStats(t.getRootOp())); } return ret; }</code><technical_language>I diamond operator</technical_language>

Target:
public Map<String, Map<String, Integer>> dumpHashTableStats() { Map<String, Map<String, Integer>> ret = new HashMap<>(); for (LocalFragment t : fragments) { ret.putAll(t.dumpHashTableStats(t.getRootOp())); } return ret; }
Source:
<code>public static Image getImage(IAdaptable adaptable) { if (adaptable != null) { <START> IWorkbenchAdapter o= adaptable.getAdapter(IWorkbenchAdapter.class); <END> ImageDescriptor id= o.getImageDescriptor(adaptable); if (id != null) { Image image= fgImages2.get(id); if (image == null) { image= id.createImage(); try { fgImages2.put(id, image); } catch (NullPointerException ex) { } fgDisposeOnShutdownImages.add(image); } return image; } } return null; }</code><technical_language>Adapters.adapt(...)</technical_language>

Target:
public static Image getImage(IAdaptable adaptable) { if (adaptable != null) { IWorkbenchAdapter o= Adapters.adapt(adaptable, IWorkbenchAdapter.class); ImageDescriptor id= o.getImageDescriptor(adaptable); if (id != null) { Image image= fgImages2.get(id); if (image == null) { image= id.createImage(); try { fgImages2.put(id, image); } catch (NullPointerException e) { } fgDisposeOnShutdownImages.add(image); } return image; } } return null; }
Source:
<code>public PlanNode visitJoin(JoinNode node, RewriteContext<Set<DynamicFilter>> context) { JoinNode join = (JoinNode) context.defaultRewrite(node, context.get()); Optional<Expression> filter = join.getFilter(); if (filter.isPresent()) { Expression original = filter.get(); Expression modified = removeDynamicFilters(original, context.get()); <START> if (BooleanLiteral.TRUE_LITERAL.equals(modified)) { <END> filter = Optional.empty(); } else if (!original.equals(modified)) { filter = Optional.of(modified); } } Assignments assignments = join.getDynamicFilterAssignments(); Set<DynamicFilter> removedFilters = context.get(); if (!removedFilters.isEmpty()) { Assignments originalAssignments = join.getDynamicFilterAssignments(); Assignments modifiedAssignments = cleanupAssignments(join.getId(), originalAssignments, removedFilters); if (!originalAssignments.equals(modifiedAssignments)) { assignments = modifiedAssignments; } } if (!filter.equals(join.getFilter()) || !assignments.equals(join.getDynamicFilterAssignments())) { return new JoinNode( join.getId(), join.getType(), join.getLeft(), join.getRight(), join.getCriteria(), join.getOutputSymbols(), filter, join.getLeftHashSymbol(), join.getRightHashSymbol(), join.getDistributionType(), assignments); } else { return join; } }</code><technical_language>static import TRUE_LITERAL</technical_language>

Target:
public PlanNode visitJoin(JoinNode node, RewriteContext<Set<DynamicFilter>> context) { JoinNode join = (JoinNode) context.defaultRewrite(node, context.get()); Optional<Expression> filterOptional = join.getFilter().map(filter -> { Expression modified = removeDynamicFilters(filter, context.get()); if (TRUE_LITERAL.equals(modified)) { return null; } else if (!filter.equals(modified)) { return modified; } return filter; }); Assignments assignments = join.getDynamicFilterAssignments(); Set<DynamicFilter> removedFilters = context.get(); if (!removedFilters.isEmpty()) { Assignments originalAssignments = join.getDynamicFilterAssignments(); Assignments modifiedAssignments = cleanupAssignments(join.getId(), originalAssignments, removedFilters); if (!originalAssignments.equals(modifiedAssignments)) { assignments = modifiedAssignments; } } if (!filterOptional.equals(join.getFilter()) || !assignments.equals(join.getDynamicFilterAssignments())) { return new JoinNode( join.getId(), join.getType(), join.getLeft(), join.getRight(), join.getCriteria(), join.getOutputSymbols(), filterOptional, join.getLeftHashSymbol(), join.getRightHashSymbol(), join.getDistributionType(), assignments); } return join; }
Source:
<code>private CalibrationMeasures(List<? extends CalibrationMeasure<? extends Trade>> measures) { <START> ImmutableMap.Builder<Class<?>, CalibrationMeasure<? extends Trade>> builder = ImmutableMap.builder(); <END> for (CalibrationMeasure<? extends Trade> measure : measures) { builder.put(measure.getTradeType(), measure); } measuresByTrade = builder.build(); }</code><technical_language>measuresByTrade = measures.stream().collect(toImmutableMap(CalibrationMeasure::getTradeType, m -> m));</technical_language>

Target:
private CalibrationMeasures(List<? extends CalibrationMeasure<? extends Trade>> measures) { measuresByTrade = measures.stream() .collect(toImmutableMap(CalibrationMeasure::getTradeType, m -> m)); }
Source:
<code>protected void executeCommand() { getStoragePool().setstatus(getParameters().getStatus()); setVdsIdRef(getStoragePool().getspm_vds_id()); DbFacade.getInstance().getStoragePoolDAO().updateStatus(getStoragePool().getId(), getStoragePool().getstatus()); if (getParameters().getStatus() == StoragePoolStatus.Problematic || getParameters().getStatus() == StoragePoolStatus.NotOperational) { List<storage_pool_iso_map> storagesStatusInPool = DbFacade.getInstance() .getStoragePoolIsoMapDAO().getAllForStoragePool(getStoragePool().getId()); for (storage_pool_iso_map storageStatusInPool : storagesStatusInPool) { if (storageStatusInPool.getstatus() != null && storageStatusInPool.getstatus() == StorageDomainStatus.Active) { storageStatusInPool.setstatus(StorageDomainStatus.Unknown); DbFacade.getInstance() .getStoragePoolIsoMapDAO() .updateStatus(storageStatusInPool.getId(), storageStatusInPool.getstatus()); <START> final List<Guid> asyncTasks = getDbFacade().getAsyncTaskDAO().getAsyncTaskIdsByEntity(storageStatusInPool.getstorage_id()); <END> for(Guid taskId: asyncTasks) { AuditLogableBase auditLogableBase = new AuditLogableBase(); auditLogableBase.setStorageDomain(getStorageDomain()); auditLogableBase.setJobId(taskId); AuditLogDirector.log(auditLogableBase, AuditLogType.STORAGE_DOMAIN_TASKS_ERROR); } } } } StoragePoolStatusHandler.PoolStatusChanged(getStoragePool().getId(), getStoragePool().getstatus()); setSucceeded(true); }</code><technical_language>I a single event log is enough storage domain, number of running jobs if wishes log job-id</technical_language>

Target:
protected void executeCommand() { getStoragePool().setstatus(getParameters().getStatus()); setVdsIdRef(getStoragePool().getspm_vds_id()); DbFacade.getInstance().getStoragePoolDAO().updateStatus(getStoragePool().getId(), getStoragePool().getstatus()); if (getParameters().getStatus() == StoragePoolStatus.Problematic || getParameters().getStatus() == StoragePoolStatus.NotOperational) { List<storage_pool_iso_map> storagesStatusInPool = DbFacade.getInstance() .getStoragePoolIsoMapDAO().getAllForStoragePool(getStoragePool().getId()); for (storage_pool_iso_map storageStatusInPool : storagesStatusInPool) { if (storageStatusInPool.getstatus() != null && storageStatusInPool.getstatus() == StorageDomainStatus.Active) { storageStatusInPool.setstatus(StorageDomainStatus.Unknown); DbFacade.getInstance() .getStoragePoolIsoMapDAO() .updateStatus(storageStatusInPool.getId(), storageStatusInPool.getstatus()); final List<Guid> asyncTasks = getDbFacade().getAsyncTaskDAO() .getAsyncTaskIdsByEntity(storageStatusInPool.getstorage_id()); if (!asyncTasks.isEmpty()) { AuditLogableBase auditLogableBase = new AuditLogableBase(); auditLogableBase.setStorageDomain(getDbFacade().getStorageDomainDAO() .get(storageStatusInPool.getstorage_id())); AuditLogDirector.log(auditLogableBase, AuditLogType.STORAGE_DOMAIN_TASKS_ERROR); } } } } StoragePoolStatusHandler.PoolStatusChanged(getStoragePool().getId(), getStoragePool().getstatus()); setSucceeded(true); }
Source:
<code>public BlockLocation[] getFileBlockLocations(final FileStatus fs, final long start, final long len) throws FileNotFoundException, IOException { if (fs.getPath() != InodeTree.SlashPath && this.fsState .getRootFallbackLink() != null) { FileSystem linkedFallbackFs = this.fsState.getRootFallbackLink().getTargetFileSystem(); Path parent = Path.getPathWithoutSchemeAndAuthority( new Path(theInternalDir.fullPath)); <START> String leafChild = (InodeTree.SlashPath.equals(fs.getPath())) ? InodeTree.SlashPath.toString() : fs.getPath().getName(); <END> Path pathToFallbackFs = new Path(parent, leafChild); return linkedFallbackFs .getFileBlockLocations(pathToFallbackFs, start, len); } checkPathIsSlash(fs.getPath()); throw new FileNotFoundException("Path points to dir not a file"); }</code><technical_language>(InodeTree.SlashPath.equals(fs.getPath())) In case this true? Provided is a check in if condition</technical_language>

Target:
public BlockLocation[] getFileBlockLocations(final FileStatus fs, final long start, final long len) throws FileNotFoundException, IOException { if (!InodeTree.SlashPath.equals(fs.getPath()) && this.fsState .getRootFallbackLink() != null) { FileSystem linkedFallbackFs = this.fsState.getRootFallbackLink().getTargetFileSystem(); Path parent = Path.getPathWithoutSchemeAndAuthority( new Path(theInternalDir.fullPath)); Path pathToFallbackFs = new Path(parent, fs.getPath().getName()); return linkedFallbackFs .getFileBlockLocations(pathToFallbackFs, start, len); } checkPathIsSlash(fs.getPath()); throw new FileNotFoundException("Path points to dir not a file"); }
Source:
<code>private void init() { if (jp == null) { try { jp = objectMapper.getFactory().createParser(future.get()); <START> if (null == jp.getInputSource()) { <END> log.warn("JSON parser has a NULL input source"); } final JsonToken nextToken = jp.nextToken(); if (nextToken == JsonToken.START_OBJECT) { QueryInterruptedException e = jp.getCodec().readValue(jp, QueryInterruptedException.class); throw e; } else if (nextToken != JsonToken.START_ARRAY) { throw new IAE("Next token wasn't a START_ARRAY, was[%s] from url [%s]", jp.getCurrentToken(), url); } else { jp.nextToken(); objectCodec = jp.getCodec(); } } catch (IOException | InterruptedException | ExecutionException e) { throw new RE(e, "Failure getting results from[%s] because of [%s]", url, e.getMessage()); } catch (CancellationException e) { throw new QueryInterruptedException("Query cancelled"); } } }</code><technical_language>situation in expect this happen</technical_language>

Target:
private void init() { if (jp == null) { try { jp = objectMapper.getFactory().createParser(future.get()); final JsonToken nextToken = jp.nextToken(); if (nextToken == JsonToken.START_OBJECT) { QueryInterruptedException e = jp.getCodec().readValue(jp, QueryInterruptedException.class); throw e; } else if (nextToken != JsonToken.START_ARRAY) { throw new IAE("Next token wasn't a START_ARRAY, was[%s] from url [%s]", jp.getCurrentToken(), url); } else { jp.nextToken(); objectCodec = jp.getCodec(); } } catch (IOException | InterruptedException | ExecutionException e) { throw new RE(e, "Failure getting results from[%s] because of [%s]", url, e.getMessage()); } catch (CancellationException e) { throw new QueryInterruptedException("Query cancelled"); } } }
Source:
<code>public Optional<InsightCard.Category> generateFutureInsightsByCategory(final Long accountId, final InsightCard.Category category, final DateTime dateVisible) { Optional<InsightCard> insightCardOptional = Optional.absent(); switch (category) { case PARTNER_MOTION: insightCardOptional = PartnerMotionInsight.getInsights(accountId, deviceReadDAO, sleepStatsDAODynamoDB, dateVisible); break; } if (insightCardOptional.isPresent()) { if (marketingInsightPool.contains(category)) { marketingInsightsSeenDAODynamoDB.updateSeenCategories(accountId, category); } <START> LOGGER.info("action=generated_insight_card category={} accountId={} next_action=insert_into_dynamo", insightCardOptional.get(), accountId); <END> this.insightsDAODynamoDB.insertInsight(insightCardOptional.get()); final InsightsLastSeen newInsight = new InsightsLastSeen(accountId, insightCardOptional.get().category, DateTime.now(DateTimeZone.UTC)); this.insightsLastSeenDAO.markLastSeen(newInsight); return Optional.of(category); } return Optional.absent(); }</code><technical_language>account_id</technical_language>

Target:
public Optional<InsightCard.Category> generateFutureInsightsByCategory(final Long accountId, final InsightCard.Category category, final DateTime dateVisible) { Optional<InsightCard> insightCardOptional = Optional.absent(); switch (category) { case PARTNER_MOTION: insightCardOptional = PartnerMotionInsight.getInsights(accountId, deviceReadDAO, sleepStatsDAODynamoDB, dateVisible); break; } if (insightCardOptional.isPresent()) { if (marketingInsightPool.contains(category)) { marketingInsightsSeenDAODynamoDB.updateSeenCategories(accountId, category); } LOGGER.info("action=generated_insight_card category={} account_id={} next_action=insert_into_dynamo", insightCardOptional.get(), accountId); this.insightsDAODynamoDB.insertInsight(insightCardOptional.get()); final InsightsLastSeen newInsight = new InsightsLastSeen(accountId, insightCardOptional.get().category, DateTime.now(DateTimeZone.UTC)); this.insightsLastSeenDAO.markLastSeen(newInsight); return Optional.of(category); } return Optional.absent(); }
Source:
<code>public void testRebindDoesNotEffectCatalog() { String persistenceDir = newTempPersistenceContainerName(); BrooklynLauncher launcher = newLauncherForTests(persistenceDir); launcher.start(); BrooklynCatalog catalog = launcher.getServerDetails().getManagementContext().getCatalog(); assertCatalogConsistsOfIds(catalog.getCatalogItems(), EXPECTED_DEFAULT_IDS); catalog.deleteCatalogItem("one", TEST_VERSION); catalog.deleteCatalogItem("two", TEST_VERSION); Assert.assertEquals(((Collection) catalog.getCatalogItems()).size(), 0); catalog.addItems(new ResourceUtils(this).getResourceAsString(CATALOG_ADDITIONS)); assertCatalogConsistsOfIds(catalog.getCatalogItems(), EXPECTED_ADDED_IDS); launcher.terminate(); BrooklynLauncher newLauncher = newLauncherForTests(persistenceDir); newLauncher.start(); <START> assertCatalogConsistsOfIds(newLauncher.getServerDetails().getManagementContext().getCatalog().getCatalogItems(), EXPECTED_DEFAULT_IDS); <END> }</code><technical_language>If rebinding previous state, get EXPECTED_ADDED_IDS here</technical_language>

Target:
public void testRebindDoesNotEffectCatalog() { String persistenceDir = newTempPersistenceContainerName(); BrooklynLauncher launcher = newLauncherForTests(persistenceDir); launcher.start(); BrooklynCatalog catalog = launcher.getServerDetails().getManagementContext().getCatalog(); assertCatalogConsistsOfIds(catalog.getCatalogItems(), EXPECTED_DEFAULT_IDS); catalog.deleteCatalogItem("one", TEST_VERSION); catalog.deleteCatalogItem("two", TEST_VERSION); Assert.assertEquals(((Collection) catalog.getCatalogItems()).size(), 0); catalog.addItems(new ResourceUtils(this).getResourceAsString(CATALOG_ADDITIONS)); assertCatalogConsistsOfIds(catalog.getCatalogItems(), EXPECTED_ADDED_IDS); launcher.terminate(); BrooklynLauncher newLauncher = newLauncherForTests(persistenceDir); newLauncher.start(); assertCatalogConsistsOfIds(newLauncher.getServerDetails().getManagementContext().getCatalog().getCatalogItems(), EXPECTED_ADDED_IDS); }
Source:
<code>public void onChildAdded(DataSnapshot keySnapshot, String previousChildKey) { super.setOnChangedListener(null); super.onChildAdded(keySnapshot, previousChildKey); super.setOnChangedListener(mListener); <START> mRef.child(keySnapshot.getKey()).addValueEventListener(this); <END> }</code><technical_language>I this is relying superclass's error handling for this event listener. In event of a bad request this result in error child bubbled up, is desired behavior hard interpret</technical_language>

Target:
public void onChildAdded(DataSnapshot keySnapshot, String previousChildKey) { super.setOnChangedListener(null); super.onChildAdded(keySnapshot, previousChildKey); super.setOnChangedListener(mListener); Query ref = mQuery.getRef().child(keySnapshot.getKey()); mRefs.put(ref, ref.addValueEventListener(new DataRefListener())); }
Source:
<code>public void doPrefetch(int index, long relativeOffset, long size) throws IOException { BlobReadInfo blobReadInfo = blobReadInfoList.get(index); try { if (!blobReadInfo.isBlobDownloaded()) { blobReadInfo.downloadBlob(blobStore); } ByteBuf byteBuf = blobReadInfoList.get(index).getBlobContent(); <START> byteBuf.readerIndex((int) (relativeOffset)); byteBuf.writerIndex((int) (relativeOffset + size)); <END> } catch (StoreException ex) { throw new IOException("Prefetch of cloud blob " + blobReadInfo.getBlobId().getID() + " failed", ex); } }</code><technical_language>nit: byteBuf.setIndex</technical_language>

Target:
public void doPrefetch(int index, long relativeOffset, long size) throws IOException { BlobReadInfo blobReadInfo = blobReadInfoList.get(index); try { if (!blobReadInfo.isBlobDownloaded()) { blobReadInfo.downloadBlob(blobStore); } ByteBuf byteBuf = blobReadInfoList.get(index).getBlobContent(); byteBuf.setIndex((int) (relativeOffset), (int) (relativeOffset + size)); } catch (StoreException ex) { throw new IOException("Prefetch of cloud blob " + blobReadInfo.getBlobId().getID() + " failed", ex); } }
Source:
<code>public <START> CommonTargetToModelUpdateStrategy(VElement <END> vElement, EStructuralFeature eStructuralFeature, ITargetToModelConverter conversion) { this.vElement = vElement; this.eStructuralFeature = eStructuralFeature; this.conversion = conversion; }</code><technical_language>Missing super() call</technical_language>

Target:
public CommonTargetToModelUpdateStrategy(VElement vElement, EStructuralFeature eStructuralFeature, ITargetToModelConverter conversion) { super(POLICY_UPDATE); this.vElement = vElement; this.eStructuralFeature = eStructuralFeature; this.conversion = conversion; }
Source:
<code>private void registerUserMessage(final SocketSession conn, final Request req, final LoginInformation login) { try { final DatabaseClient client = (DatabaseClient) super.getDatabaseReader(); client.createUser(login.getUsername(), login.getPassword(), login.getEmail(), login.getIsInstructor()); loginUser(conn, req, login); } catch (GeneralSecurityException | AuthenticationException e) { final Message.ProtoException protoEx = ExceptionUtilities.createProtoException(e); conn.send(ExceptionUtilities.createExceptionRequest(req, protoEx)); LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); send(conn, createLoginResponse(req, login, false, e.getMessage(), null)); <START> } catch (RegistrationException | DatabaseAccessException e) { <END> final Message.ProtoException protoEx = ExceptionUtilities.createProtoException(e); conn.send(ExceptionUtilities.createExceptionRequest(req, protoEx)); LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); send(conn, createLoginResponse(req, login, false, e.getMessage(), null)); } }</code><technical_language>combine this catch previous catch do in</technical_language>

Target:
private void registerUserMessage(final SocketSession conn, final Request req, final LoginInformation login) { try { final DatabaseClient client = (DatabaseClient) super.getDatabaseReader(); client.createUser(login.getUsername(), login.getPassword(), login.getEmail(), login.getIsInstructor()); loginUser(conn, req, login); } catch (GeneralSecurityException | AuthenticationException | RegistrationException | DatabaseAccessException e) { final Message.ProtoException protoEx = ExceptionUtilities.createProtoException(e); conn.send(ExceptionUtilities.createExceptionRequest(req, protoEx)); LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); send(conn, createLoginResponse(req, login, false, e.getMessage(), null)); } }
Source:
<code>public GitSubscriberMergeContext(final GitResourceVariantTreeSubscriber subscriber, ISynchronizationScopeManager manager, GitSynchronizeDataSet gsds) { super(subscriber, manager); this.gsds = gsds; repoChangeListener = new RepositoryChangeListener() { public void repositoryChanged(RepositoryMapping which) { handleRepositoryChange(subscriber, which); } }; resourceChangeListener = new IResourceChangeListener() { public void resourceChanged(IResourceChangeEvent event) { IResourceDelta delta = event.getDelta(); IResourceDelta[] children = event.getDelta().getAffectedChildren(); IResource resource = children[0].getResource(); <START> Repository repo = RepositoryMapping.getMapping(resource).getRepository(); <END> GitResourceDeltaVisitor visitor = new GitResourceDeltaVisitor(repo); try { delta.accept(visitor); handleResourceChange(subscriber, repo, visitor.getFileResourcesToUpdate()); } catch (CoreException e) { Activator.logError(e.getMessage(), e); } } }; GitProjectData.addRepositoryChangeListener(repoChangeListener); ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener); initialize(); }</code><technical_language>Need null check here. getMapping(IResource) return null for inaccessible projects (closed). java.lang.NullPointerException org.eclipse.egit.core.synchronize.GitSubscriberMergeContext$2.resourceChanged(GitSubscriberMergeContext.java:70) org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:291) org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285) org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149) org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:395) org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1530) org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:45) org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)</technical_language>

Target:
public GitSubscriberMergeContext(final GitResourceVariantTreeSubscriber subscriber, ISynchronizationScopeManager manager, GitSynchronizeDataSet gsds) { super(subscriber, manager); this.gsds = gsds; repoChangeListener = new RepositoryChangeListener() { public void repositoryChanged(RepositoryMapping which) { handleRepositoryChange(subscriber, which); } }; resourceChangeListener = new IResourceChangeListener() { public void resourceChanged(IResourceChangeEvent event) { IResourceDelta delta = event.getDelta(); if (delta == null) return; handleResourceChange(subscriber, delta); } }; GitProjectData.addRepositoryChangeListener(repoChangeListener); ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener); initialize(); }
Source:
<code>public void signIn(View view) { <START> FirebaseAuth.getInstance() <END> .signInAnonymously() .addOnCompleteListener(new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { startActivityForResult( AuthUI.getInstance().createSignInIntentBuilder() .setTheme(getSelectedTheme()) .setLogo(getSelectedLogo()) .setAvailableProviders(getSelectedProviders()) .setTosAndPrivacyPolicyUrls(getSelectedTosUrl(), getSelectedPrivacyPolicyUrl()) .setIsSmartLockEnabled(mEnableCredentialSelector.isChecked(), mEnableHintSelector.isChecked()) .setAutoUpgradeAnonymousUsers() .build(), RC_SIGN_IN); } }); }</code><technical_language>If (now-closed) PR I added a separate sample Activity for anonymous. copy it, IMO shows flow nicely complicating "normal" one</technical_language>

Target:
public void signIn(View view) { startActivityForResult( AuthUI.getInstance().createSignInIntentBuilder() .setTheme(getSelectedTheme()) .setLogo(getSelectedLogo()) .setAvailableProviders(getSelectedProviders()) .setTosAndPrivacyPolicyUrls(getSelectedTosUrl(), getSelectedPrivacyPolicyUrl()) .setIsSmartLockEnabled(mEnableCredentialSelector.isChecked(), mEnableHintSelector.isChecked()) .build(), RC_SIGN_IN); }
Source:
<code>public OSFileStore[] getFileStores() { List<OSFileStore> fs = new ArrayList<>(); <START> WinDef.DWORD LENGTH = new WinDef.DWORD(255L); <END> char[] volume = new char[LENGTH.intValue()]; WinNT.HANDLE hVol = Kernel32.INSTANCE.FindFirstVolume(volume, LENGTH.intValue()); if (hVol == WinNT.INVALID_HANDLE_VALUE) { return fs.toArray(new OSFileStore[0]); } while (true) { char[] fstype = new char[16]; char[] name = new char[LENGTH.intValue()]; char[] mount = new char[LENGTH.intValue()]; WinNT.LARGE_INTEGER userFreeBytes = new WinNT.LARGE_INTEGER(0L); WinNT.LARGE_INTEGER totalBytes = new WinNT.LARGE_INTEGER(0L); WinNT.LARGE_INTEGER systemFreeBytes = new WinNT.LARGE_INTEGER(0L); Kernel32.INSTANCE.GetVolumeInformation(new String(volume).trim(), name, 255, null, null, null, fstype, 16); Kernel32.INSTANCE.GetVolumePathNamesForVolumeName(new String(volume).trim(), mount, 255, null); Kernel32.INSTANCE.GetDiskFreeSpaceEx(new String(volume).trim(), userFreeBytes, totalBytes, systemFreeBytes); fs.add(new OSFileStore(new String(volume).trim(), new String(mount).trim(), new String(name).trim(), new String(fstype).trim(), systemFreeBytes.getValue(), totalBytes.getValue())); boolean retVal = Kernel32.INSTANCE.FindNextVolume(hVol, volume, 255); if (!retVal) { Kernel32.INSTANCE.FindVolumeClose(hVol); break; } } return fs.toArray(new OSFileStore[fs.size()]); }</code><technical_language>trouble define this a DWORD intValue(). define int, if need a DWORD (Possibly pass GetVolumeInformation() friends) variable number 255 in function calls. caps this implies a constant. Define static final this method or, possibly, find equivalent constant existing in Kernel32 class. more descriptive, VOLUME_NAME_SIZE similar. need a similar constant for 16 thrown well</technical_language>

Target:
public OSFileStore[] getFileStores() { List<OSFileStore> locals, networks; ArrayList<OSFileStore> result; result = new ArrayList<>(); locals = this.getLocalVolumes(); networks = this.getNetworkVolumes(); result.addAll(locals); result.addAll(networks); return result.toArray(new OSFileStore[result.size()]); }
Source:
<code>public void identifiersToUri() { <START> assertThat(gd.getMetadataService().identifiersToUris(project, asList("attr.person.department")).size(), is(1)); <END> }</code><technical_language>add assert. get returned uri compare identifier</technical_language>

Target:
public void identifiersToUri() { final MetadataService metadataService = gd.getMetadataService(); final Map<String, String> idsToUris = metadataService.identifiersToUris(project, asList("attr.person.department")); assertThat(idsToUris.entrySet(), hasSize(1)); final Attribute attribute = metadataService.getObjByUri(idsToUris.get("attr.person.department"), Attribute.class); assertThat(attribute.getIdentifier(), is("attr.person.department")); }
Source:
<code>private WorldSavedData checkLoadOrDefault(World world, Class<? extends WorldSavedData> structureClass, String structureName) { if (world instanceof IMixinWorld) { <START> if (((IMixinWorld) world).getActiveConfig().getConfig().getStructures().structureMap.get(structureName)) { <END> return world.loadItemData(structureClass, structureName); } else { return new MapGenStructureData(structureName); } } else { return world.loadItemData(structureClass, structureName); } }</code><technical_language>This false I - map values (other Mineshaft, is false) true, is populated</technical_language>

Target:
private WorldSavedData checkLoadOrDefault(World world, Class<? extends WorldSavedData> structureClass, String structureName) { if (world instanceof IMixinWorldServer) { Boolean saveStructure = SpongeImpl.getGlobalConfig().getConfig().getOptimizations().structureMap.get(structureName); if (saveStructure == null) { SpongeImpl.getGlobalConfig().getConfig().getOptimizations().structureMap.put(structureName, true); saveStructure = true; } if (saveStructure) { return world.loadItemData(structureClass, structureName); } else { return new MapGenStructureData(structureName); } } else { return world.loadItemData(structureClass, structureName); } }
Source:
<code>public List<String> getUris() { <START> final List<String> uris = identifiersAndUris.stream().map(IdentifierAndUri::getUri).collect(Collectors.toList()); <END> return uris; }</code><technical_language>consider inline uris</technical_language>

Target:
public List<String> getUris() { return identifiersAndUris.stream().map(IdentifierAndUri::getUri).collect(Collectors.toList()); }
Source:
<code>public boolean createStream(StreamSpec streamSpec) { <START> return Optional.ofNullable(inMemorySystemConfig.getSerializedDataSet(streamSpec.getId())) <END> .map(serializedData -> inMemoryManager.initializeStream(streamSpec, serializedData)) .orElse(inMemoryManager.initializeStream(streamSpec)); }</code><technical_language>I do a inMemoryManager.intializeStream(streamSpec, serializedData). Do a null check function</technical_language>

Target:
public boolean createStream(StreamSpec streamSpec) { return inMemoryManager.initializeStream(streamSpec); }
Source:
<code>protected String visitOther(Element element) { Object source = element.getSource(); ElementSource elementSource = null; <START> while (source != null && source instanceof ElementSource) { <END> elementSource = (ElementSource)source; source = elementSource.getOriginalElementSource(); } if (elementSource != null) { return elementSource.getModuleClassNames().toString(); } return null; }</code><technical_language>I able call instanceof a null (which fail instanceof)</technical_language>

Target:
protected String visitOther(Element element) { Object source = element.getSource(); ElementSource elementSource = null; while (source instanceof ElementSource) { elementSource = (ElementSource)source; source = elementSource.getOriginalElementSource(); } if (elementSource != null) { return elementSource.getModuleClassNames().toString(); } return null; }
Source:
<code>public ArrayList<String> getUsedLunsMessages(List<LUNs> luns) { ArrayList<String> usedLunsMessages = new ArrayList<String>(); UIMessages messages = ConstantsManager.getInstance().getMessages(); for (LUNs lun : luns) { if (lun.getStatus() == LunStatus.Used) { String reason = null; if (lun.getvolume_group_id() != null && !lun.getvolume_group_id().isEmpty()) { reason = messages.lunUsedByVG(lun.getvolume_group_id()); } usedLunsMessages.add(reason == null ? lun.getLUN_id() : <START> lun.getLUN_id() + " (" + reason + ")"); END> } } return usedLunsMessages; }</code><technical_language>please 'ApplicationMessages -> nameId' instead (or add similar..)</technical_language>

Target:
public ArrayList<String> getUsedLunsMessages(List<LUNs> luns) { ArrayList<String> usedLunsMessages = new ArrayList<String>(); UIMessages messages = ConstantsManager.getInstance().getMessages(); for (LUNs lun : luns) { if (lun.getStatus() == LunStatus.Used) { String reason = null; if (lun.getvolume_group_id() != null && !lun.getvolume_group_id().isEmpty()) { reason = messages.lunUsedByVG(lun.getvolume_group_id()); } usedLunsMessages.add(reason == null ? lun.getLUN_id() : messages.usedLunIdReason(lun.getLUN_id(), reason)); } } return usedLunsMessages; }
Source:
<code>public List<String> getTextFont() { String[] fonts; <START> if (!(layout.get("text-font") instanceof JSONObject)) { <END> fonts = parse.array(String.class, layout, "text-font", new String[]{"Open Sans Regular", "Arial Unicode MS Regular"}); return Arrays.asList(fonts); } else { return null; } }</code><technical_language>Bit of a nitpick, if-else, using: if (layout.get("text-font") instanceof JSONObject) { return null } else { ... } a bit clearer</technical_language>

Target:
public List<String> getTextFont() { String[] fonts; if (layout.get("text-font") instanceof JSONObject) { return null; } else { fonts = parse.array(String.class, layout, "text-font", new String[]{"Open Sans Regular", "Arial Unicode MS Regular"}); return Arrays.asList(fonts); } }
Source:
<code>public String viewStudyAjax(@ModelAttribute("createTrialForm") final CreateTrialForm form, final Model model, <START> @PathVariable final int datasetId, @PathVariable final int studyId) { <END> Workbook workbook = null; try { workbook = this.fieldbookMiddlewareService.getCompleteDataset(datasetId); this.fieldbookService.setAllPossibleValuesInWorkbook(workbook); SettingsUtil.resetBreedingMethodValueToId(this.fieldbookMiddlewareService, workbook.getObservations(), false, this.ontologyService, contextUtil.getCurrentProgramUUID()); } catch (final MiddlewareException e) { TrialMeasurementsController.LOG.error(e.getMessage(), e); } this.getUserSelection().setMeasurementRowList(workbook.arrangeMeasurementObservation(workbook.getObservations())); form.setMeasurementRowList(this.getUserSelection().getMeasurementRowList()); form.setMeasurementVariables(workbook.getMeasurementDatasetVariables()); this.changeLocationIdToName(form.getMeasurementRowList(), workbook.getMeasurementDatasetVariablesMap(), studyId); this.paginationListSelection.addReviewDetailsList(String.valueOf(datasetId), form.getMeasurementRowList()); this.paginationListSelection.addReviewVariableList(String.valueOf(datasetId), form.getMeasurementVariables()); form.changePage(1); this.getUserSelection().setCurrentPage(form.getCurrentPage()); return super.showAjaxPage(model, TrialMeasurementsController.OBSERVATIONS_HTML); }</code><technical_language>Instead of passing studyId in method, get study id workbook.getStudyDetails().getId();</technical_language>

Target:
public String viewStudyAjax(@ModelAttribute("createTrialForm") final CreateTrialForm form, final Model model, @PathVariable final int datasetId, @PathVariable final int studyId) { Workbook workbook = null; try { workbook = this.fieldbookMiddlewareService.getCompleteDataset(datasetId); this.fieldbookService.setAllPossibleValuesInWorkbook(workbook); SettingsUtil.resetBreedingMethodValueToId(this.fieldbookMiddlewareService, workbook.getObservations(), false, this.ontologyService, this.contextUtil.getCurrentProgramUUID()); } catch (final MiddlewareException e) { TrialMeasurementsController.LOG.error(e.getMessage(), e); } this.getUserSelection() .setMeasurementRowList(workbook.arrangeMeasurementObservation(workbook.getObservations())); form.setMeasurementRowList(this.getUserSelection().getMeasurementRowList()); form.setMeasurementVariables(workbook.getMeasurementDatasetVariables()); this.changeLocationIdToName(form.getMeasurementRowList(), workbook.getMeasurementDatasetVariablesMap(), studyId); this.paginationListSelection.addReviewDetailsList(String.valueOf(datasetId), form.getMeasurementRowList()); this.paginationListSelection.addReviewVariableList(String.valueOf(datasetId), form.getMeasurementVariables()); form.changePage(1); this.getUserSelection().setCurrentPage(form.getCurrentPage()); return super.showAjaxPage(model, TrialMeasurementsController.OBSERVATIONS_HTML); }
Source:
<code>private void createProviderIdIfNotExists(UISClient uisClient, String providerId) throws CloudException { try { uisClient.getDataProvider(providerId); <START> LOGGER.info("A provider already existed " + providerId); <END> } catch (Exception e) { DataProviderProperties dataProviderProperties = new DataProviderProperties(); uisClient.createProvider(providerId, dataProviderProperties); LOGGER.info("A new provider is created " + providerId); } }</code><technical_language>Is needed log information this? In opinion useful information log info level</technical_language>

Target:
private void createProviderIdIfNotExists(UISClient uisClient, String providerId) throws CloudException { try { uisClient.getDataProvider(providerId); } catch (Exception e) { DataProviderProperties dataProviderProperties = new DataProviderProperties(); uisClient.createProvider(providerId, dataProviderProperties); } }
Source:
<code>private List<String> collectSessionInfo(TreeItem aRow, String aName) { <START> if (aName.equals("Session Info")) { <END> return new ArrayList<String>(Arrays.asList(new String[]{aName})); } else { if (aRow.size() == 1) { summaryTableAsList.add(Arrays.asList(new String[]{""})); return fillTestLabels("Test description", aName); } else { List<String> result = new ArrayList<String>(); result.add(aName); for (String sessionName : sessionNames) { result.add(clearHtmlTags(aRow.get(sessionName))); } return result; } } }</code><technical_language>Please constant for "Session Info" string, in places</technical_language>

Target:
private List<String> collectSessionInfo(TreeItem aRow, String aName) { if (aName.equals(SESSION_INFO)) { summaryTableDto.insertTableName(aName); return new ArrayList<String>(Arrays.asList(new String[]{aName})); } else { if (aRow.size() == 1) { summaryTableDto.insertRow(Arrays.asList(new String[]{""})); return fillTestLabels("Test description", aName); } else { List<String> result = new ArrayList<String>(); result.add(aName); for (String sessionName : sessionNames) { result.add(clearHtmlTags(aRow.get(sessionName))); } return result; } } }