auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<LogEntry> queryLogs(AuditQueryBuilder builder) { List<AuditFilterBuilder> filters = builder.filters(); List<AuditOrderBuilder> orders = builder.orders(); long offset = builder.offset(); long limit = builder.limit(); List<Bson> filterList = new ArrayList<>(filters.size()); for (AuditFilterBuilder filter : filters) { switch (filter.getOperator()) { case AuditFilterBuilder.OPERATOR_LT: filterList.add(Filters.lt(filter.getName(), filter.getValue())); break; case AuditFilterBuilder.OPERATOR_LTE: filterList.add(Filters.lte(filter.getName(), filter.getValue())); break; case AuditFilterBuilder.OPERATOR_GTE: filterList.add(Filters.gte(filter.getName(), filter.getValue())); break; case AuditFilterBuilder.OPERATOR_GT: filterList.add(Filters.gt(filter.getName(), filter.getValue())); break; case AuditFilterBuilder.OPERATOR_IN: filterList.add(Filters.in(filter.getName(), (List<?>) filter.getValue())); break; case AuditFilterBuilder.OPERATOR_EQ: default: filterList.add(Filters.eq(filter.getName(), filter.getValue())); break; } } Bson mgFilter = Filters.and(filterList); List<Bson> orderList = new ArrayList<>(orders.size()); for (AuditOrderBuilder order : orders) { if (order.isDescending()) { orderList.add(Sorts.descending(order.getName())); } else { orderList.add(Sorts.ascending(order.getName())); } } Bson mgOrder = Sorts.orderBy(orderList); logRequest(mgFilter, mgOrder); FindIterable<Document> iterable = collection.find(mgFilter) .sort(mgOrder) .skip(Long.valueOf(offset).intValue()) <START> .limit(Long.valueOf(limit).intValue()); <END> return buildLogEntries(iterable); }</code><technical_language>Long.valueOf(offset).intValue() is strange offset is a long. cast int</technical_language>

Target:
public List<LogEntry> queryLogs(AuditQueryBuilder builder) { Predicate andPredicate = builder.predicate(); OrderByList orders = builder.orders(); long offset = builder.offset(); long limit = builder.limit(); List<Predicate> predicates = (List<Predicate>) ((List<?>) ((MultiExpression) andPredicate).values); Bson mgFilter = createFilter(predicates); List<Bson> orderList = new ArrayList<>(orders.size()); for (OrderByExpr order : orders) { String name = order.reference.name; if (order.isDescending) { orderList.add(Sorts.descending(name)); } else { orderList.add(Sorts.ascending(name)); } } Bson mgOrder = Sorts.orderBy(orderList); logRequest(mgFilter, mgOrder); FindIterable<Document> iterable = collection.find(mgFilter) .sort(mgOrder) .skip((int) offset) .limit((int) limit); return buildLogEntries(iterable); }
Source:
<code>public void selectDevfile(Devfile devfile) { waitDevfiles(asList(devfile)); try { seleniumWebDriverHelper.waitAndClick(By.xpath(format(DEVFILE_ROW_XPATH, devfile.getId()))); waitDevfileSelected(devfile); <START> } catch (WebDriverException ex) { <END> seleniumWebDriverHelper.waitAndClick(By.xpath(format(DEVFILE_ROW_XPATH, devfile.getId()))); } }</code><technical_language>more specific here, cover unrecoverable exceptions, timeout exception</technical_language>

Target:
public void selectDevfile(Devfile devfile) { waitDevfiles(asList(devfile)); try { seleniumWebDriverHelper.waitAndClick(By.xpath(format(DEVFILE_ROW_XPATH, devfile.getId()))); waitDevfileSelected(devfile); } catch (TimeoutException ex) { seleniumWebDriverHelper.waitAndClick(By.xpath(format(DEVFILE_ROW_XPATH, devfile.getId()))); } }
Source:
<code>public RevCommit call() throws CorruptObjectException, UnmergedPathException, IOException, IllegalArgumentException { processOptions(); Ref head = repo.getRef(Constants.HEAD); if (head == null) throw new IllegalStateException(CANNOT_COMMIT_WITHOUT_A_HEAD); ObjectId parentID = repo.resolve(Constants.HEAD + "^{commit}"); DirCache index = DirCache.lock(repo); try { ObjectWriter repoWriter = new ObjectWriter(repo); ObjectId indexTreeId = index.writeTree(repoWriter); Commit commit = new Commit(repo); Date currentDate = new Date(); PersonIdent currentCommitter = committer == null ? new PersonIdent( repo) <START> : new PersonIdent(committer, currentDate); <END> commit.setCommitter(currentCommitter); commit.setAuthor(author == null ? currentCommitter : new PersonIdent(author, currentDate)); commit.setMessage(message); if (parentID != null) commit.setParentIds(new ObjectId[] { parentID }); commit.setTreeId(indexTreeId); ObjectId commitId = repoWriter.writeCommit(commit); commit.setCommitId(commitId); RevCommit revCommit = new RevWalk(repo).parseCommit(commitId); RefUpdate ru = repo.updateRef(Constants.HEAD); ru.setNewObjectId(commitId); ru.setRefLogMessage("commit : " + revCommit.getShortMessage(), false); ru.setExpectedOldObjectId(parentID); switch (ru.update()) { case NEW: case FAST_FORWARD: return revCommit; default: throw new IllegalStateException("Updating the ref " + Constants.HEAD + " to " + commitId.toString() + " failed"); } } finally { index.unlock(); } }</code><technical_language>remarks below, reset time</technical_language>

Target:
public RevCommit call() throws NoHeadException, NoMessageException, UnmergedPathException, JGitInternalException { processOptions(); Ref head; ObjectId parentID; try { head = repo.getRef(Constants.HEAD); if (head == null) throw new NoHeadException( "Commit on repo without HEAD currently not supported"); parentID = repo.resolve(Constants.HEAD + "^{commit}"); DirCache index = DirCache.lock(repo); try { ObjectWriter repoWriter = new ObjectWriter(repo); ObjectId indexTreeId = index.writeTree(repoWriter); Commit commit = new Commit(repo); commit.setCommitter(committer); commit.setAuthor(author); commit.setMessage(message); if (parentID != null) commit.setParentIds(new ObjectId[] { parentID }); commit.setTreeId(indexTreeId); ObjectId commitId = repoWriter.writeCommit(commit); RevCommit revCommit = new RevWalk(repo).parseCommit(commitId); RefUpdate ru = repo.updateRef(Constants.HEAD); ru.setNewObjectId(commitId); ru.setRefLogMessage("commit : " + revCommit.getShortMessage(), false); ru.setExpectedOldObjectId(parentID); switch (ru.update()) { case NEW: case FAST_FORWARD: return revCommit; default: throw new IllegalStateException("Updating the ref " + Constants.HEAD + " to " + commitId.toString() + " failed"); } } finally { index.unlock(); } } catch (UnmergedPathException e) { throw e; } catch (IOException e) { throw new JGitInternalException( "Exception caught during execution of commit command", e); } }
Source:
<code><START> public boolean <END> isDiskExists(Guid id) { return DbFacade.getInstance().getBaseDiskDao().exists(id); }</code><technical_language>why</technical_language>

Target:
protected boolean isDiskExists(Guid id) { return DbFacade.getInstance().getBaseDiskDao().exists(id); }
Source:
<code>public void enterParameter(SwiftParser.ParameterContext ctx) { SwiftBaseListener listener = null; for (ParseTree child : ctx.children) { if (child.getText().equals(VAR)) { <START> listener = new VariableDecListener(this.printer); <END> } } if (listener == null) { listener = new ConstantDecListener(this.printer); } ParseTreeWalker walker = new ParseTreeWalker(); if (ctx.externalParameterName() != null) { listenerHelper.walkListener(walker, ctx.externalParameterName(), listener); } listenerHelper.walkListener(walker, ctx.localParameterName(), listener); }</code><technical_language>Nice strategy for dynamically determining listener instantiate! want a break; this line prevent loop continuing needed</technical_language>

Target:
public void enterParameter(SwiftParser.ParameterContext ctx) { SwiftBaseListener listener = null; for (ParseTree child : ctx.children) { if (child.getText().equals(VAR)) { listener = new VariableDecListener(this.printer); break; } } if (listener == null) { listener = new ConstantDecListener(this.printer); } ParseTreeWalker walker = new ParseTreeWalker(); if (ctx.externalParameterName() != null) { listenerHelper.walkListener(walker, ctx.externalParameterName(), listener); } listenerHelper.walkListener(walker, ctx.localParameterName(), listener); }
Source:
<code>public void testExecuteQuery() { Guid vmID = Guid.NewGuid(); VM expectedResult = new VM(); expectedResult.setId(vmID); GetVmByVmIdParameters paramsMock = getQueryParameters(); when(paramsMock.getId()).thenReturn(vmID); VmDAO vmDAOMock = mock(VmDAO.class); when(vmDAOMock.getById(vmID, getUser().getUserId(), paramsMock.isFiltered())).thenReturn(expectedResult); DiskImage disk = new DiskImage(); disk.setvm_guid(vmID); disk.setactive(true); DiskImageDAO diskImageDAO = mock(DiskImageDAO.class); when(diskImageDAO.getAllForVm(vmID)).thenReturn(Collections.singletonList(disk)); DbFacade dbFacadeMock = getDbFacadeMockInstance(); when(dbFacadeMock.getVmDAO()).thenReturn(vmDAOMock); when(dbFacadeMock.getDiskImageDAO()).thenReturn(diskImageDAO); getQuery().executeQueryCommand(); VM result = (VM) getQuery().getQueryReturnValue().getReturnValue(); <START> assertEquals("Wrong VM pool returned", expectedResult, result); <END> assertEquals("Wrong number of disks on the VM", 1, result.getDiskList().size()); assertEquals("Wrong disk on the VM", disk, result.getDiskList().get(0)); }</code><technical_language>pool.</technical_language>

Target:
public void testExecuteQuery() { Guid vmID = Guid.NewGuid(); VM expectedResult = new VM(); expectedResult.setId(vmID); GetVmByVmIdParameters paramsMock = getQueryParameters(); when(paramsMock.getId()).thenReturn(vmID); VmDAO vmDAOMock = mock(VmDAO.class); when(vmDAOMock.getById(vmID, getUser().getUserId(), paramsMock.isFiltered())).thenReturn(expectedResult); DiskImage disk = new DiskImage(); disk.setvm_guid(vmID); disk.setactive(true); DiskImageDAO diskImageDAO = mock(DiskImageDAO.class); when(diskImageDAO.getAllForVm(vmID)).thenReturn(Collections.singletonList(disk)); DbFacade dbFacadeMock = getDbFacadeMockInstance(); when(dbFacadeMock.getVmDAO()).thenReturn(vmDAOMock); when(dbFacadeMock.getDiskImageDAO()).thenReturn(diskImageDAO); getQuery().executeQueryCommand(); VM result = (VM) getQuery().getQueryReturnValue().getReturnValue(); assertEquals("Wrong VM returned", expectedResult, result); assertEquals("Wrong number of disks on the VM", 1, result.getDiskList().size()); assertEquals("Wrong disk on the VM", disk, result.getDiskList().get(0)); }
Source:
<code>private void hintJobExecutorIfNeeded(JobEntity jobEntity, Date duedate) { <START> if (duedate.getTime() < ClockUtil.getCurrentTime().getTime()) { <END> hintJobExecutor(jobEntity); } }</code><technical_language><=, or</technical_language>

Target:
private void hintJobExecutorIfNeeded(JobEntity jobEntity, Date duedate) { JobExecutor jobExecutor = Context.getProcessEngineConfiguration().getJobExecutor(); int waitTimeInMillis = jobExecutor.getWaitTimeInMillis(); if (duedate.getTime() < (ClockUtil.getCurrentTime().getTime() + waitTimeInMillis)) { hintJobExecutor(jobEntity); } }
Source:
<code>public void close(short code, String reason) <START> { <END> webSocket.close(code, reason); }</code><technical_language>strange checkstyle report error here</technical_language>

Target:
public void close(short code, String reason) { webSocket.close(JSNumber.valueOf(code), JSString.valueOf(reason)); }
Source:
<code>protected boolean validateQuota() { getParameters().setQuotaId(QuotaHelper.getInstance().getQuotaIdToConsume(getParameters().getVmStaticData() .getQuotaId(), getStoragePool())); for (DiskImage dit : getImagesToCheckDestinationStorageDomains()) { dit.setQuotaId(QuotaHelper.getInstance() .getQuotaIdToConsume(getParameters().getVmStaticData().getQuotaId(), getStoragePool())); } if (!isInternalExecution()) { <START> return QuotaManager.validateMultiStorageQuota(getStoragePool().getQuotaEnforcementType(), <END> QuotaHelper.getInstance().getQuotaConsumeMap(getParameters().getDiskInfoDestinationList(), getParameters().getQuotaId()), getCommandId(), getReturnValue().getCanDoActionMessages()); } return true; }</code><technical_language>u need a list for quota, is needed for multiple storage domain feature</technical_language>

Target:
protected boolean validateQuota() { setQuotaId(QuotaHelper.getInstance().getQuotaIdToConsume(getQuotaId(), getStoragePool())); for (DiskImage dit : getImagesToCheckDestinationStorageDomains()) { dit.setQuotaId(QuotaHelper.getInstance().getQuotaIdToConsume(getQuotaId(), getStoragePool())); } if (!isInternalExecution()) { return QuotaManager.validateMultiStorageQuota(getStoragePool().getQuotaEnforcementType(), getQuotaConsumeMap(diskInfoDestinationMap.values()), getCommandId(), getReturnValue().getCanDoActionMessages()); } return true; }
Source:
<code>public HttpResponse doRemoveJobFromView(@QueryParameter String name) throws IOException, ServletException { checkPermission(View.CONFIGURE); if(name==null) throw new Failure("Query parameter 'name' is required"); synchronized (this) { TopLevelItem item = resolveName(name); if (item == null) { <START> throw new Failure("Cannot discover the item by name: '"+name+"'"); <END> } if (remove(item)) owner.save(); } return HttpResponses.ok(); }</code><technical_language>right do, covered test</technical_language>

Target:
public HttpResponse doRemoveJobFromView(@QueryParameter String name) throws IOException, ServletException { checkPermission(View.CONFIGURE); if(name==null) throw new Failure("Query parameter 'name' is required"); synchronized (this) { TopLevelItem item = resolveName(name); if (item==null) { throw new Failure("Query parameter 'name' does not correspond to a known and readable item: " + name); } if (remove(item)) { owner.save(); } } return HttpResponses.ok(); }
Source:
<code>private void updateBatchSize(SweepOutcome outcome) { if (outcome == SweepOutcome.SUCCESS) { batchSizeMultiplier = Math.min(1.0, batchSizeMultiplier * 1.01); return; } <START> if (outcome == SweepOutcome.RETRYING_WITH_SMALLER_BATCH) { <END> SweepBatchConfig lastBatchConfig = specificTableSweeper.getAdjustedBatchConfig(); batchSizeMultiplier = Math.max(batchSizeMultiplier / 2, 1.5 / lastBatchConfig.candidateBatchSize()); log.warn("The background sweep job failed unexpectedly with candidate batch size {}," + " delete batch size {}," + " and cell+timestamp pairs to examine." + " Attempting to continue with new batchSizeMultiplier {}", SafeArg.of("candidateBatchSize", lastBatchConfig.candidateBatchSize()), SafeArg.of("deleteBatchSize", lastBatchConfig.deleteBatchSize()), SafeArg.of("maxCellTsPairsToExamine", lastBatchConfig.maxCellTsPairsToExamine()), SafeArg.of("batchSizeMultiplier", batchSizeMultiplier)); return; } }</code><technical_language>if outcome is ERROR</technical_language>

Target:
private void updateBatchSize(SweepOutcome outcome) { if (outcome == SweepOutcome.SUCCESS) { sweepBatchConfigSource.increaseMultiplier(); } if (outcome == SweepOutcome.ERROR) { sweepBatchConfigSource.decreaseMultiplier(); } }
Source:
<code>private void add(Watchers matching, NotifyConfig nc, Project.NameKey project) throws OrmException, QueryParseException { for (GroupReference ref : nc.getGroups()) { CurrentUser user = new SingleGroupUser(args.capabilityControlFactory, ref.getUUID()); if (filterMatch(user, nc.getFilter())) { deliverToMembers(matching.list(nc.getHeader()), ref.getUUID()); } } if (!nc.getAddresses().isEmpty()) { <START> if (filterMatch(args.anonymousUser, nc.getFilter())) { <END> matching.list(nc.getHeader()).emails.addAll(nc.getAddresses()); } } }</code><technical_language>Instead pass null for user filterMatch recognize null special case anonymousUser queryBuilder avoids putting is_visible predicate filter</technical_language>

Target:
private void add(Watchers matching, NotifyConfig nc, Project.NameKey project) throws OrmException, QueryParseException { for (GroupReference ref : nc.getGroups()) { CurrentUser user = new SingleGroupUser(args.capabilityControlFactory, ref.getUUID()); if (filterMatch(user, nc.getFilter())) { deliverToMembers(matching.list(nc.getHeader()), ref.getUUID()); } } if (!nc.getAddresses().isEmpty()) { if (filterMatch(null, nc.getFilter())) { matching.list(nc.getHeader()).emails.addAll(nc.getAddresses()); } } }
Source:
<code>public List<ModifierProtocol> modifierProtocols() { <START> return Collections.unmodifiableList( modifierProtocols ); <END> }</code><technical_language>unmodifiable in constructor</technical_language>

Target:
public List<ModifierProtocol> modifierProtocols() { return modifierProtocols; }
Source:
<code>private void registerPossibleObjectInnerTypes(String topLevelName, List<String> path, DataType<?> dataType) { if (DataTypes.isCollectionType(dataType)) { dataType = ((CollectionType) dataType).innerType(); } if (dataType.id() != ObjectType.ID) { return; } Map<String, DataType> innerTypes = ((ObjectType) dataType).innerTypes(); int pos = 0; for (Map.Entry<String, DataType> entry : innerTypes.entrySet()) { List<String> subPath = new ArrayList<>(path); subPath.add(entry.getKey()); ColumnIdent ci = new ColumnIdent(topLevelName, subPath); DataType innerType = entry.getValue(); Reference ref = new Reference( new ReferenceIdent(relationName, ci), rowGranularity, innerType, ColumnPolicy.STRICT, Reference.IndexType.NOT_ANALYZED, true, pos, null ); pos++; <START> if (!infos.containsKey(ref.column())) { <END> infos.put(ref.column(), ref); } registerPossibleObjectInnerTypes(ci.name(), ci.path(), innerType); } }</code><technical_language>sense {put/compute}IfAbsent methods here</technical_language>

Target:
private void registerPossibleObjectInnerTypes(String topLevelName, List<String> path, DataType<?> dataType) { if (DataTypes.isCollectionType(dataType)) { dataType = ((CollectionType) dataType).innerType(); } if (dataType.id() != ObjectType.ID) { return; } Map<String, DataType> innerTypes = ((ObjectType) dataType).innerTypes(); int pos = 0; for (Map.Entry<String, DataType> entry : innerTypes.entrySet()) { List<String> subPath = new ArrayList<>(path); subPath.add(entry.getKey()); ColumnIdent ci = new ColumnIdent(topLevelName, subPath); DataType innerType = entry.getValue(); Reference ref = new Reference( new ReferenceIdent(relationName, ci), rowGranularity, innerType, ColumnPolicy.STRICT, Reference.IndexType.NOT_ANALYZED, true, pos, null ); pos++; infos.putIfAbsent(ref.column(), ref); registerPossibleObjectInnerTypes(ci.name(), ci.path(), innerType); } }
Source:
<code>List<String> headers() { if (node.hasProperty(HEADERS) && !DYNAMIC_HEADERS.matcher(node.getPropertyValue(HEADERS)).find()) { <START> return Arrays.asList(node.getPropertyValue(HEADERS).split("\\s+")).stream().filter(header -> !header.isEmpty()).collect(Collectors.toList()); <END> } else { return Collections.emptyList(); } }</code><technical_language>Arrays.stream instead</technical_language>

Target:
List<String> headers() { if (node.hasProperty(HEADERS) && !DYNAMIC_HEADERS.matcher(node.getPropertyValue(HEADERS)).find()) { return Arrays.stream(node.getPropertyValue(HEADERS).split("\\s+")).filter(header -> !header.isEmpty()).collect(Collectors.toList()); } else { return Collections.emptyList(); } }
Source:
<code>private void initialize() { this.setLayout(new CardLayout()); <START> this.setName("Callbacks"); <END> this.setIcon(new ImageIcon(CallbackPanel.class.getResource("/resource/icon/16/callbacks.png"))); this.add(getMainPanel(), getMainPanel().getName()); }</code><technical_language>Good catch :)</technical_language>

Target:
private void initialize() { this.setLayout(new CardLayout()); this.setName(Constant.messages.getString("callback.panel.name")); this.setIcon(new ImageIcon(CallbackPanel.class.getResource("/resource/icon/16/callbacks.png"))); this.add(getMainPanel(), getMainPanel().getName()); }
Source:
<code>private void usingIsEmpty2() { <START> Optional<Object> op = Optional.emtpy(); <END> if (op.isEmpty()) { } else { op.get(); } }</code><technical_language>above, Optional.empty</technical_language>

Target:
private void usingIsEmpty2() { Optional<Object> op = Optional.empty(); if (op.isEmpty()) { } else { op.get(); } }
Source:
<code>public MediaType getMediaType(ObjectNode contentNode, String location, ParseResult result){ if (contentNode == null) { return null; } MediaType mediaType = new MediaType(); ObjectNode schemaObject = getObject("schema",contentNode,false,location,result); if(schemaObject!=null){ mediaType.setSchema(getSchema(schemaObject,location,result)); } String value = getString("example", contentNode, false, location, result); mediaType.setExample(value); ObjectNode examplesObject = getObject("examples",contentNode,false,location,result); if(examplesObject!=null) { mediaType.setExamples(getExamples(examplesObject, location, result)); } ObjectNode encodingObject = getObject("encoding",contentNode,false,location,result); if(encodingObject!=null) { mediaType.setEncoding(getEncoding(encodingObject, location, result)); } <START> mediaType.setExtensions(new LinkedHashMap<>()); <END> Set<String> keys = getKeys(contentNode); for (String key : keys) { if (key.startsWith("x-")) { mediaType.getExtensions().put(key, Json.mapper().convertValue(contentNode.get(key), Object.class)); } } return mediaType; }</code><technical_language>set map size > 0</technical_language>

Target:
public MediaType getMediaType(ObjectNode contentNode, String location, ParseResult result){ if (contentNode == null) { return null; } MediaType mediaType = new MediaType(); ObjectNode schemaObject = getObject("schema",contentNode,false,location,result); if(schemaObject!=null){ mediaType.setSchema(getSchema(schemaObject,location,result)); } String value = getString("example", contentNode, false, location, result); if(StringUtils.isNotBlank(value)) { mediaType.setExample(value); } ObjectNode examplesObject = getObject("examples",contentNode,false,location,result); if(examplesObject!=null) { mediaType.setExamples(getExamples(examplesObject, location, result)); } ObjectNode encodingObject = getObject("encoding",contentNode,false,location,result); if(encodingObject!=null) { mediaType.setEncoding(getEncoding(encodingObject, location, result)); } Map <String,Object> extensions = getExtensions(contentNode,location,result); if(extensions != null && extensions.size() > 0) { mediaType.setExtensions(extensions); } return mediaType; }
Source:
<code>public Optional<IndexNullAsExpectactions<String>> getIndexNullAsExpectations() { <START> return Optional.empty(); <END> }</code><technical_language>here, if supported need a test checking set indexNullAs fails</technical_language>

Target:
public Optional<IndexNullAsExpectactions<String>> getIndexNullAsExpectations() { return Optional.of( new IndexNullAsExpectactions<>( "", "Aaron" ) ); }
Source:
<code>public Integer getMaxVmNameLength() { Integer <START> maxVmNameLengthNonWindows = <END> (Integer) getConfigValuePreConverted(ConfigurationValues.MaxVmNameLength); if (maxVmNameLengthNonWindows == null) { return 64; } return maxVmNameLengthNonWindows; }</code><technical_language>please rename this maxVmNameLength</technical_language>

Target:
public Integer getMaxVmNameLength() { Integer maxVmNameLength = (Integer) getConfigValuePreConverted(ConfigurationValues.MaxVmNameLength); if (maxVmNameLength == null) { return 64; } return maxVmNameLength; }
Source:
<code>public void WikiActivityTests_005_newEditionWoVisualChangeNotRecordedOnActivityModule() { String articleTitle = "newEditionWoVisualChangeNotRecordedOnActivityModule"; new ArticleContent().push("content", articleTitle); ArticlePageObject article = new ArticlePageObject().open(articleTitle); String articleName = article.getArticleName(); String articleContent = article.getContent(); VisualEditModePageObject visualEditMode = article.navigateToArticleEditPage(); visualEditMode.addContent(articleContent); visualEditMode.submitArticle(); article.verifyContent(articleContent); new SpecialWikiActivityPageObject(driver) .open() <START> .verifyNoRecentEditionIsPresent(articleName, credentials.userName); <END> }</code><technical_language>assertion in this test</technical_language>

Target:
public void WikiActivityTests_005_newEditionWoVisualChangeNotRecordedOnActivityModule() { new ArticleContent().push("content"); ArticlePageObject article = new ArticlePageObject().open(); String articleName = article.getArticleName(); String articleContent = article.getContent(); VisualEditModePageObject visualEditMode = article.navigateToArticleEditPage(); visualEditMode.addContent(articleContent); visualEditMode.submitArticle(); Assertion.assertFalse( new SpecialWikiActivityPageObject(driver) .open().doesLastNRecentEditionsContain(2, articleName, User.USER.getUserName()) ); }
Source:
<code>private static void closeHttpClientGracefully(CloseableHttpClient client) { <START> if(client != null) { <END> try { client.close(); } catch (IOException exception) { } } }</code><technical_language>reduce nesting depth here</technical_language>

Target:
private static void closeHttpClientGracefully(CloseableHttpClient client) { if (client == null) return; try { client.close(); } catch (IOException exception) { } }
Source:
<code>protected NodeFigure createNodePlate() { <START> RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(72, 250) { <END> @Override public IFigure findMouseEventTargetAt(int x, int y) { IFigure f = findMouseEventTargetInDescendantsAt(x, y); if (f != null) { return f; } if (!containsPoint(x, y)) { return null; } if (isMouseEventTarget()) { return this; } return null; } @Override public IFigure findFigureAt(int x, int y, TreeSearch search) { if (search.prune(this)) { return null; } IFigure child = findDescendantAtExcluding(x, y, search); if (child != null) { return child; } if (!containsPoint(x, y)) { return null; } if (search.accept(this)) { return this; } return null; } @Override public boolean containsPoint(int x, int y) { if (primaryShape != null) { return primaryShape.containsPoint(x, y); } return super.containsPoint(x, y); } @Override protected boolean isDefaultAnchorArea(PrecisionPoint p) { return false; } }; return result; }</code><technical_language>Whey this coordinate, variable somewhere, computed</technical_language>

Target:
protected NodeFigure createNodePlate() { RoundedRectangleNodePlateFigure result = new RoundedRectangleNodePlateFigure(100, 250) { @Override public IFigure findMouseEventTargetAt(int x, int y) { IFigure f = findMouseEventTargetInDescendantsAt(x, y); if (f != null) { return f; } if (!containsPoint(x, y)) { return null; } if (isMouseEventTarget()) { return this; } return null; } @Override public IFigure findFigureAt(int x, int y, TreeSearch search) { if (search.prune(this)) { return null; } IFigure child = findDescendantAtExcluding(x, y, search); if (child != null) { return child; } if (!containsPoint(x, y)) { return null; } if (search.accept(this)) { return this; } return null; } @Override public boolean containsPoint(int x, int y) { if (primaryShape != null) { return primaryShape.containsPoint(x, y); } return super.containsPoint(x, y); } @Override protected boolean isDefaultAnchorArea(PrecisionPoint p) { return false; } }; return result; }
Source:
<code>public InMemoryObservationStore(NetworkConfig config) { <START> int healthStatusInterval = config.getInt(NetworkConfig.Keys.HEALTH_STATUS_INTERVAL, 0); END> if (healthStatusInterval > 0 && HEALTH_LOGGER.isDebugEnabled()) { ScheduledExecutorService scheduler = Executors .newSingleThreadScheduledExecutor(new DaemonThreadFactory("ObservationStore")); scheduler.scheduleAtFixedRate(new Runnable() { @Override public void run() { if (enableStatus) { HEALTH_LOGGER.debug("{} observes", map.size()); Iterator<Token> iterator = map.keySet().iterator(); int max = 5; while (iterator.hasNext()) { HEALTH_LOGGER.debug(" observe {}", iterator.next()); --max; if (max == 0) { break; } } } } }, healthStatusInterval, healthStatusInterval, TimeUnit.SECONDS); } }</code><technical_language>yes, adding explicit default done earlier me. maybe, add :-)</technical_language>

Target:
public InMemoryObservationStore(NetworkConfig config) { this.config = config; }
Source:
<code>private int executeWithParameters(Map<String, Object> params, Query query) { applyMetaQueryParameters(params, query); query.getParameters() .stream() .filter(e -> params.containsKey(e.getName())) <START> .forEach(p -> query.setParameter(p.getName(), params.get(p.getName()))); <END> return query.executeUpdate(); }</code><technical_language>I applyMetaQueryParameters handles this. is this of else</technical_language>

Target:
private int executeWithParameters(Map<String, Object> params, Query query) { applyMetaQueryParameters(params, query); return query.executeUpdate(); }
Source:
<code>private void validateGatewayAccount(ValidatableResponse response) { String type = "test"; <START> String serviceName = "a cool service"; <END> response .body("containsKey('gateway_account')", is(true)) .body("gateway_account.gateway_account_id", is(Long.valueOf(accountId))) .body("gateway_account.containsKey('credentials')", is(false)) .body("gateway_account.service_name", is(serviceName)) .body("gateway_account.payment_provider", is(paymentProvider)) .body("gateway_account.type", is(type)) .body("gateway_account.analytics_id", is(analyticsId)) .body("gateway_account.corporate_credit_card_surcharge_amount", isNumber(corporateCreditCardSurchargeAmount)) .body("gateway_account.corporate_debit_card_surcharge_amount", isNumber(corporateDebitCardSurchargeAmount)) .body("gateway_account.card_types", is(notNullValue())) .body("gateway_account.card_types[0].id", is(notNullValue())) .body("gateway_account.card_types[0].label", is("Mastercard")) .body("gateway_account.card_types[0].type", is("CREDIT")) .body("gateway_account.card_types[0].brand", is("master-card")) .body("gateway_account.card_types[1].id", is(notNullValue())) .body("gateway_account.card_types[1].label", is("Visa")) .body("gateway_account.card_types[1].type", is("CREDIT")) .body("gateway_account.card_types[1].brand", is("visa")); }</code><technical_language>lines</technical_language>

Target:
private void validateGatewayAccount(ValidatableResponse response) { response .body("containsKey('gateway_account')", is(true)) .body("gateway_account.gateway_account_id", is(Long.valueOf(accountId))) .body("gateway_account.containsKey('credentials')", is(false)) .body("gateway_account.service_name", is("a cool service")) .body("gateway_account.payment_provider", is(paymentProvider)) .body("gateway_account.type", is("test")) .body("gateway_account.analytics_id", is(analyticsId)) .body("gateway_account.corporate_credit_card_surcharge_amount", isNumber(corporateCreditCardSurchargeAmount)) .body("gateway_account.corporate_debit_card_surcharge_amount", isNumber(corporateDebitCardSurchargeAmount)) .body("gateway_account.card_types", is(notNullValue())) .body("gateway_account.card_types", contains( allOf( hasKey("id"), hasEntry("label", "Mastercard"), hasEntry("type", "CREDIT"), hasEntry("brand", "master-card") ), allOf( hasKey("id"), hasEntry("label","Visa"), hasEntry("type", "CREDIT"), hasEntry("brand", "visa") ) )); }
Source:
<code>protected void addRow(EClass clazz, EObject eObject, EStructuralFeature structuralFeature) { Optional<EObject> eObjectToAdd; if (!getViewModelContext().hasService(TableControlService.class)) { <START> final ReferenceService referenceService = getViewModelContext().getService(ReferenceService.class); <END> eObjectToAdd = referenceService.addNewModelElements(eObject, EReference.class.cast(structuralFeature), false); } else { final TableControlService tableService = getViewModelContext() .getService(TableControlService.class); eObjectToAdd = tableService.createNewElement(clazz, eObject, structuralFeature); } if (!eObjectToAdd.isPresent()) { return; } final EObject instance = eObjectToAdd.get(); final EditingDomain editingDomain = getEditingDomain(eObject); if (editingDomain == null) { return; } editingDomain.getCommandStack().execute( AddCommand.create(editingDomain, eObject, structuralFeature, instance)); tableViewer.setSelection(new StructuredSelection(eObjectToAdd.get()), true); }</code><technical_language>I revert logic here, if is TableControlService try it, if returns null is provided, reference service</technical_language>

Target:
protected void addRow(EClass clazz, EObject eObject, EStructuralFeature structuralFeature) { Optional<EObject> eObjectToAdd = null; if (getViewModelContext().hasService(TableControlService.class)) { final TableControlService tableService = getViewModelContext() .getService(TableControlService.class); eObjectToAdd = tableService.createNewElement(clazz, eObject, structuralFeature); } if (eObjectToAdd == null) { final ReferenceService referenceService = getViewModelContext().getService(ReferenceService.class); eObjectToAdd = referenceService.addNewModelElements(eObject, EReference.class.cast(structuralFeature), false); } if (!eObjectToAdd.isPresent()) { return; } final EObject instance = eObjectToAdd.get(); final EditingDomain editingDomain = getEditingDomain(eObject); if (editingDomain == null) { return; } editingDomain.getCommandStack().execute( AddCommand.create(editingDomain, eObject, structuralFeature, instance)); tableViewer.setSelection(new StructuredSelection(eObjectToAdd.get()), true); }
Source:
<code>protected void <START> doExecute() <END> { if (childViewsAdapters == null && childViewsAdaptersForCenterLayout == null) { executeLayoutOnDiagramOpening(); } else { executeLayoutDueToExternalChanges(); } }</code><technical_language>current method executed other thread UI thread ? layout command need get figure info wth ui thread access</technical_language>

Target:
protected void doExecute() { Display.getDefault().syncExec(new Runnable() { @Override public void run() { if (childViewsAdapters == null && childViewsAdaptersForCenterLayout == null) { executeLayoutOnDiagramOpening(); } else { executeLayoutDueToExternalChanges(); } } }); }
Source:
<code>protected void internalReceiveCommand(String itemName, Command command) { for (ModbusBindingProvider provider : providers) { if (provider.providesBindingFor(itemName)) { ModbusBindingConfig config = provider.getConfig(itemName); ModbusSlave slave = modbusSlaves.get(config.slaveName); <START> if(config.getItemClass() == RollershutterItem.class) { <END> if(command instanceof StopMoveType) { slave.executeCommand(command, config.readIndex, config.writeIndex+1); return; } if(command instanceof UpDownType) { slave.executeCommand(command, config.readIndex+1, config.writeIndex); return; } } slave.executeCommand(command, config.readIndex, config.writeIndex); } } }</code><technical_language>if this logic of handling roller shutter rules in slave? feels some commands handled in slave, some</technical_language>

Target:
protected void internalReceiveCommand(String itemName, Command command) { for (ModbusBindingProvider provider : providers) { if (provider.providesBindingFor(itemName)) { ModbusBindingConfig config = provider.getConfig(itemName); ModbusSlave slave = modbusSlaves.get(config.slaveName); if (config.getItemClass() == RollershutterItem.class) { if (command instanceof StopMoveType) { slave.executeCommand(command, config, config.readIndex, config.writeIndex + 1); return; } if (command instanceof UpDownType) { slave.executeCommand(command, config, config.readIndex + 1, config.writeIndex); return; } } slave.executeCommand(command, config, config.readIndex, config.writeIndex); } } }
Source:
<code>public MethodOutcome updatePatientByIdentifier(@ResourceParam Patient patient, @IdParam IdDt theId, @ConditionalUrlParam String theConditional) { MethodOutcome outcome = new MethodOutcome(); if (theConditional != null) { List<Patient> patientList = null; String args[] = theConditional.split("?"); String parameterPart = args[1]; String paraArgs[] = parameterPart.split("="); String parameterName = paraArgs[0]; <START> if ("name".equals(parameterName)) { <END> StringParam param = new StringParam(); param.setValue(paraArgs[1]); patientList = patientResource.searchByName(param); } else if ("identifier".equals(parameterName)) { TokenParam params = new TokenParam(); params.setValue(paraArgs[1]); patientList = patientResource.searchByIdentifier(params); } else if ("givenName".equals(parameterName)) { StringParam param = new StringParam(); param.setValue(paraArgs[1]); patientList = patientResource.searchByGivenName(param); } if (patientList != null) { if (patientList.size() == 0) { outcome = updatePatient(patient, null); } else if (patientList.size() == 1) { outcome = updatePatient(patient, patientList.get(0).getId()); } else { throw new PreconditionFailedException("There are more than one patient for the given condition"); } } } else { outcome = updatePatient(patient, theId); } return outcome; }</code><technical_language>move name a constant filed</technical_language>

Target:
public MethodOutcome updatePatientByIdentifier(@ResourceParam Patient patient, @IdParam IdDt theId, @ConditionalUrlParam String theConditional) { MethodOutcome outcome = new MethodOutcome(); OperationOutcome operationoutcome = null; if (theConditional != null) { String paramValue = null; List<Patient> patientList = null; String parameterName = null; try { String args[] = theConditional.split("?"); String parameterPart = args[1]; String paraArgs[] = parameterPart.split("="); parameterName = paraArgs[0]; paramValue = paraArgs[1]; } catch (Exception e) { operationoutcome = new OperationOutcome(); operationoutcome.addIssue().setDetails("Please check Condition URL format"); outcome.setOperationOutcome(operationoutcome); return outcome; } if (FHIRConstants.PARAMETER_NAME.equals(parameterName)) { StringParam param = new StringParam(); param.setValue(paramValue); patientList = patientResource.searchByName(param); } else if (FHIRConstants.PARAMETER_IDENTIFIER.equals(parameterName)) { TokenParam params = new TokenParam(); params.setValue(paramValue); patientList = patientResource.searchByIdentifier(params); } else if (FHIRConstants.PARAMETER_GIVENNAME.equals(parameterName)) { StringParam param = new StringParam(); param.setValue(paramValue); patientList = patientResource.searchByGivenName(param); } if (patientList != null) { if (patientList.size() == 0) { outcome = updatePatient(patient, null); } else if (patientList.size() == 1) { outcome = updatePatient(patient, patientList.get(0).getId()); } else { throw new PreconditionFailedException("There are more than one patient for the given condition"); } } } else { outcome = updatePatient(patient, theId); } return outcome; }
Source:
<code>protected void createButtonsForButtonBar(Composite parent) { <START> createButton(parent, IDialogConstants.CANCEL_ID, "&Cancel", true); END> createButton(parent, IDialogConstants.OK_ID, "&Ok", true); }</code><technical_language>I IDialogConstants.OK_LABEL CANCEL_LABEL</technical_language>

Target:
protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true); createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); }
Source:
<code>public boolean contains(OGCGeometry another) { if (isEmpty() || another.isEmpty()) return false; if (this == another) return true; OGCConcreteGeometryCollection flattened1 = flatten(); if (flattened1.isEmpty()) <START> return true; <END> OGCConcreteGeometryCollection otherCol = new OGCConcreteGeometryCollection(another, esriSR); OGCConcreteGeometryCollection flattened2 = otherCol.flatten(); if (flattened2.isEmpty()) return true; for (int i = 0, n2 = flattened2.numGeometries(); i < n2; ++i) { OGCGeometry g2 = flattened2.geometryN(i); boolean good = false; for (int j = 0, n1 = flattened1.numGeometries(); j < n1; ++j) { OGCGeometry g1 = flattened1.geometryN(i); if (g1.contains(g2)) { good = true; break; } } if (!good) return false; } return true; }</code><technical_language>logic beginning of this method suggests contains returns false if of geometries is empty. Hence, this return false</technical_language>

Target:
public boolean contains(OGCGeometry another) { if (isEmpty() || another.isEmpty()) return false; if (this == another) return true; return another.difference(this).isEmpty(); }
Source:
<code>protected void configure() { log.debug("configure: entered."); requireBinding(ConfigProvider.class); bind(WebApplicationExceptionMapper.class).asEagerSingleton(); bindVtepDataClientFactory(); bind(ApplicationResource.class); install(new FactoryModuleBuilder().build(ResourceFactory.class)); bind(RestApiService.class).asEagerSingleton(); <START> bind(VxlanGatewayHA.class).asEagerSingleton(); <END> log.debug("configure: exiting."); }</code><technical_language>a question: switch HA non-HA</technical_language>

Target:
protected void configure() { log.debug("configure: entered."); requireBinding(ConfigProvider.class); bind(WebApplicationExceptionMapper.class).asEagerSingleton(); bindVtepDataClientFactory(); bind(ApplicationResource.class); install(new FactoryModuleBuilder().build(ResourceFactory.class)); bind(RestApiService.class).asEagerSingleton(); bind(VxlanGatewayService.class).asEagerSingleton(); log.debug("configure: exiting."); }
Source:
<code>private static Collection<String> findValidFileNames(final ModelNode model) { final Collection<String> names = new ArrayList<>(); for (Property resource : model.asPropertyList()) { final String name = resource.getName(); if (FILE_RESOURCE_NAMES.contains(name)) { for (Property handlerResource : resource.getValue().asPropertyList()) { final ModelNode handlerModel = handlerResource.getValue(); if (handlerModel.hasDefined(CommonAttributes.FILE.getName())) { final ModelNode fileModel = handlerModel.get(CommonAttributes.FILE.getName()); <START> if (fileModel.has(PathResourceDefinition.RELATIVE_TO.getName()) <END> && ServerEnvironment.SERVER_LOG_DIR.equals(fileModel.get(PathResourceDefinition.RELATIVE_TO.getName()).asString()) && fileModel.hasDefined(PathResourceDefinition.PATH.getName())) { names.add(fileModel.get(PathResourceDefinition.PATH.getName()).asString()); } } } } } return names; }</code><technical_language>hasDefined better. A proper resource model return true for "has" for attributes add handler populate a normal undefined</technical_language>

Target:
private static Collection<String> findValidFileNames(final ModelNode model) { final Collection<String> names = new ArrayList<>(); for (Property resource : model.asPropertyList()) { final String name = resource.getName(); if (FILE_RESOURCE_NAMES.contains(name)) { for (Property handlerResource : resource.getValue().asPropertyList()) { final ModelNode handlerModel = handlerResource.getValue(); if (handlerModel.hasDefined(CommonAttributes.FILE.getName())) { final ModelNode fileModel = handlerModel.get(CommonAttributes.FILE.getName()); if (fileModel.hasDefined(PathResourceDefinition.RELATIVE_TO.getName()) && ServerEnvironment.SERVER_LOG_DIR.equals(fileModel.get(PathResourceDefinition.RELATIVE_TO.getName()).asString()) && fileModel.hasDefined(PathResourceDefinition.PATH.getName())) { names.add(fileModel.get(PathResourceDefinition.PATH.getName()).asString()); } } } } } return names; }
Source:
<code>public ComponentTreeWsRequest setBaseComponentKey(@Nullable String baseComponentKey) { return setComponent(baseComponentKey); <START> } <END></code><technical_language>![INFO](<LINK_0> 'Severity: INFO') Do forget remove this deprecated code someday. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public ComponentTreeWsRequest setBaseComponentKey(@Nullable String baseComponentKey) { this.baseComponentKey = baseComponentKey; return this; }
Source:
<code>public static List<BrooklinMetricInfo> getMetricInfos(String connectorName) { List<BrooklinMetricInfo> metrics = new ArrayList<>(); metrics.addAll(AbstractKafkaBasedConnectorTask.getMetricInfos( generateMetricsPrefix(connectorName, CLASS_NAME) + MetricsAware.KEY_REGEX)); metrics.add(new BrooklinCounterInfo( <START> generateMetricsPrefix(connectorName, CLASS_NAME) + TOPIC_MANAGER_METRICS_PREFIX + ".*")); <END> return metrics; }</code><technical_language>dynamic metric name needs MetricsAware.KEY_REGEX</technical_language>

Target:
public static List<BrooklinMetricInfo> getMetricInfos(String connectorName) { List<BrooklinMetricInfo> metrics = new ArrayList<>(); metrics.addAll(AbstractKafkaBasedConnectorTask.getMetricInfos( generateMetricsPrefix(connectorName, CLASS_NAME) + MetricsAware.KEY_REGEX)); metrics.add(new BrooklinCounterInfo( generateMetricsPrefix(connectorName, CLASS_NAME) + TOPIC_MANAGER_METRICS_PREFIX + MetricsAware.KEY_REGEX + ".*")); return metrics; }
Source:
<code>void addSoftware(String software, int nbTokens) { <START> persistedJobsLicenses.put(software, new LinkedBlockingQueue<String>(nbTokens)); <END> persistedTasksLicenses.put(software, new LinkedBlockingQueue<String>(nbTokens)); remainingTokens.put(software, nbTokens); }</code><technical_language>suggestion persistedJobsLicenses.put(software, new LinkedBlockingQueue<>(nbTokens));</technical_language>

Target:
void addSoftware(String software, int nbTokens) { persistedJobsLicenses.put(software, new LinkedBlockingQueue<>(nbTokens)); persistedTasksLicenses.put(software, new LinkedBlockingQueue<>(nbTokens)); remainingTokens.put(software, nbTokens); }
Source:
<code>private void setLoadingLayout() { binding.progressBar.setVisibility(View.VISIBLE); <START> binding.feedDisplay.setVisibility(View.GONE); <END> }</code><technical_language>feedDisplay is a strange name. I xml file find out is. do feel feedDisplayContainer? I guidelines is necessary. do feel this? update guidelines</technical_language>

Target:
private void setLoadingLayout() { viewBinding.progressBar.setVisibility(View.VISIBLE); viewBinding.feedDisplayContainer.setVisibility(View.GONE); }
Source:
<code>private void setGatewayServices(final GatewayServices gws) { try { Field gwsField = GatewayServer.class.getDeclaredField("services"); gwsField.setAccessible(true); gwsField.set(null, gws); } catch (Exception e) { <START> e.printStackTrace(); <END> } }</code><technical_language>need catch here? a test throw it</technical_language>

Target:
private void setGatewayServices(final GatewayServices gws) throws Exception { Field gwsField = GatewayServer.class.getDeclaredField("services"); gwsField.setAccessible(true); gwsField.set(null, gws); }
Source:
<code>public void testCopy() throws Exception { <START> put("/rest/resource/mydir/mynewres?operation=copy", "/mydir/myres"); <END> Resource newRes = getDataDirectory().get("/mydir/mynewres"); Assert.assertTrue(Resources.exists(myRes)); Assert.assertTrue(Resources.exists(newRes)); try (InputStream is = newRes.in()) { Assert.assertEquals("This is my test.", IOUtils.toString(is)); } newRes.delete(); }</code><technical_language>operation=cOpY</technical_language>

Target:
public void testCopy() throws Exception { put("/rest/resource/mydir/mynewres?operation=cOpY", "/mydir/myres"); Resource newRes = getDataDirectory().get("/mydir/mynewres"); Assert.assertTrue(Resources.exists(myRes)); Assert.assertTrue(Resources.exists(newRes)); try (InputStream is = newRes.in()) { Assert.assertEquals(STR_MY_TEST, IOUtils.toString(is)); } newRes.delete(); }
Source:
<code>public AzureBatchSource(AzureBatchConfig config) { <START> super(new FileBatchConfig(config.referenceName, config.fileRegex, config.timeTable, config.inputFormatClass, <END> config.fileSystemProperties, config.maxSplitSize, config.ignoreNonExistingFolders, config.recursive, config.path, config.pathField, config.filenameOnly, config.schema)); this.config = config; }</code><technical_language>i able pass in config</technical_language>

Target:
public AzureBatchSource(AzureBatchConfig config) { super(config); this.config = config; }
Source:
<code>private void compareConsoleToOutput(String console, String output, String alternateOutput) { <START> if (RunningPlatform.isWindows() && alternateOutput != null) { <END> assertTrue("Console text does not contains expected text", console.contains(alternateOutput)); } else if (console.equals(output)) { log.info("Console text corresponds to expected output"); } else if (console.trim().equals(output.trim())) { log.info("Console text corresponds to expected output after trimming"); } else { fail("Console text does not corresponds to the expected output"); } }</code><technical_language>This a logic error (alternate output is some string empty string). I a situation alternateOutput is null</technical_language>

Target:
private void compareConsoleToOutput(String console, String output, String alternateOutput) { if (RunningPlatform.isWindows() && alternateOutput != null && alternateOutput.length() > 0) { log.info("Testing alternative output for windows platform: " + alternateOutput); assertTrue("Console text does not contains expected text", console.contains(alternateOutput)); } else if (console.equals(output)) { log.info("Console text corresponds to expected output"); } else if (console.trim().equals(output.trim())) { log.info("Console text corresponds to expected output after trimming"); } else { fail("Console text does not corresponds to the expected output"); } }