diff options
author | Godin <mandrikov@gmail.com> | 2010-11-26 22:22:53 +0000 |
---|---|---|
committer | Godin <mandrikov@gmail.com> | 2010-11-26 22:22:53 +0000 |
commit | 3c72827ae0ab6c7ab95535df1b4ae611d31d6e3a (patch) | |
tree | 2cf6cdb784f86cf447f280c8ef8786d53f351ce7 /plugins/sonar-squid-java-plugin/test-resources | |
parent | 6502189ac6cec41d2a8f35d7adb48d38b599c39b (diff) | |
download | sonarqube-3c72827ae0ab6c7ab95535df1b4ae611d31d6e3a.tar.gz sonarqube-3c72827ae0ab6c7ab95535df1b4ae611d31d6e3a.zip |
SONAR-1760: Support the annotation "@SuppressWarnings" at class and method level
Diffstat (limited to 'plugins/sonar-squid-java-plugin/test-resources')
-rw-r--r-- | plugins/sonar-squid-java-plugin/test-resources/rules/ClassWithSuppressWarningsAnnotation.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/plugins/sonar-squid-java-plugin/test-resources/rules/ClassWithSuppressWarningsAnnotation.java b/plugins/sonar-squid-java-plugin/test-resources/rules/ClassWithSuppressWarningsAnnotation.java new file mode 100644 index 00000000000..b91bb86843b --- /dev/null +++ b/plugins/sonar-squid-java-plugin/test-resources/rules/ClassWithSuppressWarningsAnnotation.java @@ -0,0 +1,42 @@ +@SuppressWarnings("all") +class ClassWithSuppressWarningsAnnotation { + + @java.lang.SuppressWarnings("all") + public void fullyQualifiedName() { + } + + @SuppressWarnings("all") + public void singleValue() { + } + + @SuppressWarnings(value = { "all" }) + public void arrayWithSingleValue() { + } + + @SuppressWarnings(value = { "null", "all" }) + public void arrayWithMultipleValues() { + } + + public void doJob() { + Object o = new Object() { + @SuppressWarnings("all") + public void methodInAnonymousInnerClass() { + } + }; + } + + // Currently Sonar is unable to properly handle following cases + + @SuppressWarnings("a" + "ll") + public void notHandled() { + } + + @SuppressWarnings(false ? "null" : "all") + public void notHandled2() { + } + + private static final String SUPPRESS = "all"; + @SuppressWarnings(SUPPRESS) + public void notHandled3() { + } +} |