diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2011-08-04 09:50:42 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2011-08-04 09:50:57 +0200 |
commit | b8ae0c40bc4d6dca25a745b01d1d93cbf8430264 (patch) | |
tree | daaa443339fbe187cc04c9b9582c8db497be0f33 /sonar-plugin-api | |
parent | 0d2522a308bbee1d35aed6303d7ce9e4bcfea13b (diff) | |
download | sonarqube-b8ae0c40bc4d6dca25a745b01d1d93cbf8430264.tar.gz sonarqube-b8ae0c40bc4d6dca25a745b01d1d93cbf8430264.zip |
SONAR-2627 False-positive flags disappear after second analysis run
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/violations/ViolationQuery.java | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/violations/ViolationQuery.java b/sonar-plugin-api/src/main/java/org/sonar/api/violations/ViolationQuery.java index 28b9082693c..24c717f181a 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/violations/ViolationQuery.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/violations/ViolationQuery.java @@ -28,7 +28,11 @@ import org.sonar.api.resources.Resource; */ public final class ViolationQuery { - private boolean isSwitchedOff; + public static enum SwitchMode { + OFF, ON, BOTH + } + + private SwitchMode switchMode = SwitchMode.ON; private Resource resource; /** @@ -47,24 +51,33 @@ public final class ViolationQuery { } /** - * Specifies if the query should returned switched-off violations or not. + * Specifies if the query should return only switched-off violations. * - * @param ignore + * @param b * if true, the query will return only switched-off violations. if false, it will return only active violations. * @return the current violation query */ - public ViolationQuery setSwitchedOff(boolean ignore) { - this.isSwitchedOff = ignore; + public ViolationQuery setSwitchedOff(boolean b) { + this.switchMode = (b ? SwitchMode.OFF : SwitchMode.ON); return this; } /** - * Tells if the query should returned switched-off violations or active violations. + * Tells if the query should return only switched-off violations. * * @return */ public boolean isSwitchedOff() { - return isSwitchedOff; + return switchMode == SwitchMode.OFF; + } + + public SwitchMode getSwitchMode() { + return switchMode; + } + + public ViolationQuery setSwitchMode(SwitchMode s) { + this.switchMode = s; + return this; } /** |