1   //non-compiled with eclipse: non-compilable annotation, for testing
2   package com.puppycrawl.tools.checkstyle.checks.annotation.suppresswarnings;
3   import java.lang.annotation.Documented;
4   
5   @SuppressWarnings(value={"unchecked", "unused"})
6   public class InputSuppressWarningsExpandedNonConstant
7   {
8       @SuppressWarnings(value={"   "})
9       class Empty {
10  
11          @SuppressWarnings(value={"unchecked", ""})
12          public Empty() {
13  
14          }
15      }
16  
17      @SuppressWarnings(value={"unused"})
18      enum Duh {
19  
20          @SuppressWarnings(value={"unforgiven", "    un"})
21          D;
22  
23          public static void foo() {
24  
25              @SuppressWarnings(value={"unused"})
26              Object o = new InputSuppressWarningsExpandedNonConstant() {
27  
28                  @Override
29                  @SuppressWarnings(value={"unchecked"})
30                  public String toString() {
31                      return "";
32                  }
33              };
34          }
35      }
36  
37      @SuppressWarnings(value={"abcun"})
38      @Documented
39      @interface Sweet {
40          int cool();
41      }
42  
43      @Documented
44      @SuppressWarnings(value={})
45      @interface MoreSweetness {
46  
47          @SuppressWarnings(value={"unused", "bleh"})
48          int cool();
49      }
50  
51      public class Junk {
52  
53          @SuppressWarnings(value={})
54          int a = 1;
55  
56          @SuppressWarnings(value={"unchecked"})
57          @Deprecated
58          int b = 1;
59          void doFoo(String s, @SuppressWarnings(value={"unchecked"})String y) {
60  
61          }
62      }
63  
64      @SuppressWarnings(value={(false) ? "unchecked" : "", (false) ? "unchecked" : ""})
65      class Cond {
66  
67          @SuppressWarnings(value={(false) ? "" : "unchecked"})
68          public Cond() {
69  
70          }
71  
72          @SuppressWarnings(value={(false) ? (true) ? "   " : "unused" : "unchecked",
73              (false) ? (true) ? "   " : "unused" : "unchecked"})
74          public void aCond1() {
75  
76          }
77  
78          @SuppressWarnings(value={(false) ? "unchecked" : (true) ? "   " : "unused"})
79          public void aCond2() {
80  
81          }
82  
83          @java.lang.SuppressWarnings(value={(false) ? "unchecked" :
84                      ("" == "") ? (false) ? (true) ? "" : "foo" : "   " : "unused",
85                  (false) ? "unchecked" :
86                      ("" == "") ? (false) ? (true) ? "" : "foo" : "   " : "unused"})
87          public void seriously() {
88  
89          }
90      }
91  }