View Javadoc
1   /*
2   AnnotationLocation
3   allowSamelineMultipleAnnotations = true
4   allowSamelineSingleParameterlessAnnotation = (default)true
5   allowSamelineParameterizedAnnotation = true
6   tokens = (default)CLASS_DEF, INTERFACE_DEF, PACKAGE_DEF, ENUM_CONSTANT_DEF, \
7            ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF, RECORD_DEF, COMPACT_CTOR_DEF
8   
9   
10  */
11  
12  package com.puppycrawl.tools.checkstyle.checks.annotation.annotationlocation;
13  
14  @MyAnn_22 @com.puppycrawl.tools.checkstyle.checks.annotation.annotationlocation.MyAnn_2
15  (value = "")
16  class InputAnnotationLocationIncorrect2One
17  {
18  
19      @MyAnn_22 @MyAnnotation_12(value = "")
20      public int a;
21  
22      @MyAnnotation_12(value = "") public int b;
23  
24      @MyAnn_22
25          @MyAnnotation_12 // violation '.* incorrect .* level 8, .* should be 4.'
26  (value = "")
27      public int c;
28  
29      @MyAnnotation_12(value = "")
30      public int d;
31  
32      @MyAnn_22
33          @MyAnnotation_12 // violation '.* incorrect .* level 8, .* should be 4.'
34  (value = "")
35      public InputAnnotationLocationIncorrect2One() {}
36  
37      @MyAnnotation_12("foo") @MyAnn_22 void foo1() {}
38  
39      @MyAnnotation_12(value = "")
40         @MyAnn_22 // violation '.*'MyAnn_22' have incorrect indentation level 7, .* should be 4.'
41      void foo2() {}
42  
43      @MyAnnotation_12(value = "")
44          @MyAnn_22 // violation '.* incorrect .* level 8, .* should be 4.'
45        @MyAnnotation_32 // violation '.* incorrect .* level 6, .* should be 4.'
46            @MyAnnotation_42 // violation '.* incorrect .* level 10, .* should be 4.'
47      class InnerClass
48      {
49          @MyAnn_22 @MyAnnotation_12
50  (value = "")
51          public int a;
52  
53          @MyAnnotation_12(value = "") public int b;
54  
55          @MyAnn_22
56              @MyAnnotation_12 // violation '.* incorrect .* level 12, .* should be 8.'
57  (value = "")
58          public int c;
59  
60          @MyAnnotation_12(value = "")
61          public int d;
62  
63          @MyAnn_22
64          @MyAnnotation_12(value = "") public InnerClass()
65          {
66              // comment
67          }
68          @MyAnnotation_12(value = "")
69              @MyAnn_22 // violation '.* incorrect .* level 12, .* should be 8.'
70          void foo1() {}
71  
72          @MyAnnotation_12(value = "")
73              @MyAnn_22 // violation '.* incorrect .* level 12, .* should be 8.'
74          void foo2() {}
75      }
76  
77      @MyAnnotation_12(value = "")
78         @MyAnn_22 // violation '.* incorrect .* level 7, .* should be 4.'
79      InnerClass anon = new InnerClass()
80      {
81          @MyAnn_22 @MyAnnotation_12(value = "") public int a;
82  
83          @MyAnnotation_12(value = "") public int b;
84  
85          @MyAnn_22
86          @MyAnnotation_12(value = "")
87          public int c;
88  
89          @MyAnnotation_12(value = "")
90          public int d;
91  
92          @MyAnnotation_12(value = "")
93             @MyAnn_22 void foo1() {} // violation '.* incorrect .* level 11, .* should be 8.'
94  
95          @MyAnnotation_12(value = "")
96            @MyAnn_22 // violation '.* incorrect .* level 10, .* should be 8.'
97          void foo2() {}
98  
99          @MyAnnotation_12(value = "") void foo42() {}
100     };
101 
102 }
103 
104 
105 @interface MyAnnotation_12 {
106 
107         String value();}
108 
109 @interface MyAnn_22 {}
110 
111 @interface MyAnnotation_32 {}
112 
113 @interface MyAnnotation_42 {}
114 
115 @interface MyAnn_2 {
116 
117     String value();}