public boolean setMessage(DefaultIssue issue, @Nullable String s, IssueChangeContext context) { if (!Objects.equal(s, issue.message())) { issue.setMessage(s); issue.setUpdateDate(context.date()); issue.setChanged(true); return true; } return false; }
private void updateIssue(DefaultIssue issue, Rule rule, ActiveRule activeRule) { if (Strings.isNullOrEmpty(issue.message())) { issue.setMessage(rule.name()); } issue.setCreationDate(project.getAnalysisDate()); issue.setUpdateDate(project.getAnalysisDate()); if (issue.severity() == null) { issue.setSeverity(activeRule.severity()); } DebtRemediationFunction function = rule.debtRemediationFunction(); if (rule.debtSubCharacteristic() != null && function != null) { issue.setDebt(calculateDebt(function, issue.effortToFix(), rule.key())); } }
public boolean setPastMessage( DefaultIssue issue, @Nullable String previousMessage, IssueChangeContext context) { String currentMessage = issue.message(); issue.setMessage(previousMessage); return setMessage(issue, currentMessage, context); }