aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-06-29 00:54:14 +0200
committersimonbrandhof <simon.brandhof@gmail.com>2011-06-29 00:54:14 +0200
commit18b21f2ce809939ebfe25a31a4663526a1ad8b61 (patch)
treeb0cc7fd6ef466f662cddc6b798aca7f7d5adfa3c /sonar-plugin-api
parent6eabbf7ffb16a904cd288590dd9b13ba37d660c0 (diff)
downloadsonarqube-18b21f2ce809939ebfe25a31a4663526a1ad8b61.tar.gz
sonarqube-18b21f2ce809939ebfe25a31a4663526a1ad8b61.zip
Add the method org.sonar.api.rules.Violation#isNew()
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java
index efab4077464..f4ab32762df 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java
@@ -41,6 +41,7 @@ public class Violation {
private Date createdAt;
private boolean switchedOff=false;
private String checksum;
+ private boolean isNew=false;
/**
* Creates of a violation from a rule. Will need to define the resource later on
@@ -259,6 +260,26 @@ public class Violation {
return this;
}
+ /**
+ * A violation is considered as "new" if it has been created after the reference analysis
+ * (the "previous" analysis).
+ * This method must be used only by post-jobs and decorators depending on the barrier
+ * {@link org.sonar.api.batch.DecoratorBarriers#END_OF_VIOLATION_TRACKING}
+ * @since 2.9
+ */
+ public boolean isNew() {
+ return isNew;
+ }
+
+ /**
+ * For internal use only. MUST NOT BE SET FROM PLUGINS.
+ * @since 2.9
+ */
+ public Violation setNew(boolean b) {
+ isNew = b;
+ return this;
+ }
+
@Override
public String toString() {
return ReflectionToStringBuilder.toString(this);