View Javadoc
1   package com.google.checkstyle.test.chapter4formatting.rule485annotations;
2   
3   @MyAnnotation2 @MyAnnotation1 //warn
4   class InputAnnotationLocation
5   {
6   
7       @MyAnnotation2 @MyAnnotation1
8       public int a;
9   
10      @MyAnnotation1 public int b;
11  
12      @MyAnnotation2
13      @MyAnnotation1
14      public int c;
15  
16      @MyAnnotation1
17      public int d;
18  
19      @MyAnnotation2
20          @MyAnnotation1 //warn
21      public InputAnnotationLocation() {}
22  
23      @MyAnnotationWithParam("foo")
24      @MyAnnotation2 void foo1() {}
25  
26      @MyAnnotation1
27         @MyAnnotation2 //warn
28      void foo2() {}
29  
30      @MyAnnotation1
31          @MyAnnotation2 //warn
32        @MyAnnotation3 //warn
33            @MyAnnotation4 //warn
34      class InnerClass
35      {
36          @MyAnnotation2 @MyAnnotation1
37          public int a;
38  
39          @MyAnnotation1 public int b;
40          
41          @MyAnnotation2
42          @MyAnnotation1
43          public int c;
44          
45          @MyAnnotation1
46          public int d;
47          
48          @MyAnnotation2
49          @MyAnnotation1 public InnerClass()
50          {
51              // TODO Auto-generated constructor stub
52          }
53          @MyAnnotation1
54              @MyAnnotation2 //warn
55          void foo1() {}
56          
57          @MyAnnotation1
58              @MyAnnotation2 //warn
59          void foo2() {}
60      }
61  
62      @MyAnnotation1
63         @MyAnnotation2
64      InnerClass anon = new InnerClass()
65      {
66          @MyAnnotation2 @MyAnnotation1 public int a;
67  
68          @MyAnnotation1 public int b;
69          
70          @MyAnnotation2
71          @MyAnnotation1
72          public int c;
73          
74          @MyAnnotation1
75          public int d;
76          
77          @MyAnnotation1
78             @MyAnnotation2 void foo1() {} //warn
79          
80          @MyAnnotation1
81            @MyAnnotation2 //warn
82          void foo2() {}
83          
84          @MyAnnotation1 void foo42() {}
85      };
86      
87  }
88  
89  @MyAnnotation1
90   @MyAnnotation2 //warn
91  class Foo {}
92  
93  @interface MyAnnotation1 {}
94  
95  @interface MyAnnotation2 {}
96  
97  @interface MyAnnotation3 {}
98  
99  @interface MyAnnotation4 {}
100 
101 @interface MyAnnotationWithParam {
102 
103 	String value();}