aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-squid-java-plugin/test-resources/rules/ClassWithSuppressWarningsAnnotation.java
blob: b91bb86843b282679fde01a36631120a47cb5401 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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() {
    }
}