aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-squid/src/main
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-11-26 22:22:53 +0000
committerGodin <mandrikov@gmail.com>2010-11-26 22:22:53 +0000
commit3c72827ae0ab6c7ab95535df1b4ae611d31d6e3a (patch)
tree2cf6cdb784f86cf447f280c8ef8786d53f351ce7 /sonar-squid/src/main
parent6502189ac6cec41d2a8f35d7adb48d38b599c39b (diff)
downloadsonarqube-3c72827ae0ab6c7ab95535df1b4ae611d31d6e3a.tar.gz
sonarqube-3c72827ae0ab6c7ab95535df1b4ae611d31d6e3a.zip
SONAR-1760: Support the annotation "@SuppressWarnings" at class and method level
Diffstat (limited to 'sonar-squid/src/main')
-rw-r--r--sonar-squid/src/main/java/org/sonar/squid/api/SourceClass.java13
-rw-r--r--sonar-squid/src/main/java/org/sonar/squid/api/SourceMethod.java13
2 files changed, 26 insertions, 0 deletions
diff --git a/sonar-squid/src/main/java/org/sonar/squid/api/SourceClass.java b/sonar-squid/src/main/java/org/sonar/squid/api/SourceClass.java
index 20287f283f1..1be1ceef863 100644
--- a/sonar-squid/src/main/java/org/sonar/squid/api/SourceClass.java
+++ b/sonar-squid/src/main/java/org/sonar/squid/api/SourceClass.java
@@ -21,6 +21,11 @@ package org.sonar.squid.api;
public class SourceClass extends SourceCode {
+ /**
+ * This is used only for Java for now, but can be used for other languages. So maybe we should push it down to SourceCode.
+ */
+ private boolean suppressWarnings = false;
+
public SourceClass(String key) {
super(key);
}
@@ -28,4 +33,12 @@ public class SourceClass extends SourceCode {
public SourceClass(String key, String className) {
super(key, className);
}
+
+ public void setSuppressWarnings(boolean suppressWarnings) {
+ this.suppressWarnings = suppressWarnings;
+ }
+
+ public boolean isSuppressWarnings() {
+ return suppressWarnings;
+ }
}
diff --git a/sonar-squid/src/main/java/org/sonar/squid/api/SourceMethod.java b/sonar-squid/src/main/java/org/sonar/squid/api/SourceMethod.java
index 0378f655da4..60eab9faf2a 100644
--- a/sonar-squid/src/main/java/org/sonar/squid/api/SourceMethod.java
+++ b/sonar-squid/src/main/java/org/sonar/squid/api/SourceMethod.java
@@ -23,6 +23,11 @@ import org.sonar.squid.measures.Metric;
public class SourceMethod extends SourceCode {
+ /**
+ * This is used only for Java for now, but can be used for other languages. So maybe we should push it down to SourceCode.
+ */
+ private boolean suppressWarnings = false;
+
public SourceMethod(String key) {
super(key);
}
@@ -35,4 +40,12 @@ public class SourceMethod extends SourceCode {
public boolean isAccessor() {
return getInt(Metric.ACCESSORS) != 0;
}
+
+ public void setSuppressWarnings(boolean suppressWarnings) {
+ this.suppressWarnings = suppressWarnings;
+ }
+
+ public boolean isSuppressWarnings() {
+ return suppressWarnings;
+ }
}