diff options
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java | 21 |
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); |