diff options
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java | 22 | ||||
-rw-r--r-- | sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java | 4 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java index 89aa9a7fa3b..7d8a8874896 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java @@ -125,6 +125,10 @@ public class DefaultIssue implements Issue, Trackable, org.sonar.api.ce.measure. private Long selectedAt; private boolean quickFixAvailable; + private boolean isNewCodeReferenceIssue; + + // true if the issue is no longer new in its branch + private boolean isNoLongerNewCodeReferenceIssue = false; @Override public String key() { @@ -548,6 +552,24 @@ public class DefaultIssue implements Issue, Trackable, org.sonar.api.ce.measure. return this; } + public boolean isNewCodeReferenceIssue() { + return isNewCodeReferenceIssue; + } + + public DefaultIssue setIsNewCodeReferenceIssue(boolean isNewCodeReferenceIssue) { + this.isNewCodeReferenceIssue = isNewCodeReferenceIssue; + return this; + } + + public boolean isNoLongerNewCodeReferenceIssue() { + return isNoLongerNewCodeReferenceIssue; + } + + public DefaultIssue setIsNoLongerNewCodeReferenceIssue(boolean isNoLongerNewCodeReferenceIssue) { + this.isNoLongerNewCodeReferenceIssue = isNoLongerNewCodeReferenceIssue; + return this; + } + @CheckForNull public FieldDiffs currentChange() { return currentChange; diff --git a/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java b/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java index 874272d2d40..423dc536b00 100644 --- a/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java +++ b/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java @@ -58,6 +58,8 @@ public class DefaultIssueTest { .setNew(true) .setIsOnReferencedBranch(true) .setIsOnChangedLine(true) + .setIsNewCodeReferenceIssue(true) + .setIsNoLongerNewCodeReferenceIssue(true) .setBeingClosed(true) .setOnDisabledRule(true) .setCopied(true) @@ -87,6 +89,8 @@ public class DefaultIssueTest { assertThat(issue.isNew()).isTrue(); assertThat(issue.isOnReferencedBranch()).isTrue(); assertThat(issue.isOnChangedLine()).isTrue(); + assertThat(issue.isNewCodeReferenceIssue()).isTrue(); + assertThat(issue.isNoLongerNewCodeReferenceIssue()).isTrue(); assertThat(issue.isCopied()).isTrue(); assertThat(issue.isBeingClosed()).isTrue(); assertThat(issue.isOnDisabledRule()).isTrue(); |