diff options
Diffstat (limited to 'plugins/sonar-squid-java-plugin/test-resources/rules/ClassWithSuppressWarningsAnnotation.java')
-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() { + } +} |