View Javadoc
1   /*
2   AnnotationUseStyle
3   elementStyle = (default)compact_no_array
4   closingParens = (default)never
5   trailingArrayComma = ignore
6   
7   
8   */
9   
10  package com.puppycrawl.tools.checkstyle.checks.annotation.annotationusestyle;
11  //this file compiles in eclipse 3.4 but not with Sun's JDK 1.6.0.11
12  
13  public class InputAnnotationUseStyleWithTrailingCommaIgnore
14  {
15      @SuppressWarnings({"common",}) // violation 'Annotation style must be 'COMPACT_NO_ARRAY''
16      public void foo() {
17  
18  
19          @SuppressWarnings({"common","foo",})
20          Object o = new Object() {
21  
22              // violation below 'Annotation style must be 'COMPACT_NO_ARRAY''
23              @SuppressWarnings(value={"common",})
24              public String toString() {
25  
26                  @SuppressWarnings(value={"leo","herbie",})
27                  final String pooches = "leo.herbie";
28  
29                  return pooches;
30              }
31          };
32      }
33  
34      // violation below 'Annotation style must be 'COMPACT_NO_ARRAY''
35      @Test3(value={"foo",}, more={"bar",})
36      /**
37  
38      */
39      enum P {
40  
41          // violation below 'Annotation style must be 'COMPACT_NO_ARRAY''
42          @Pooches3(tokens={Pooches3.class,},other={1,})
43          L,
44  
45          /**
46  
47          */
48          Y;
49      }
50  
51  }
52  
53  @interface Test3 {
54      String[] value();
55      String[] more() default {};
56  }
57  
58  @interface Pooches3 {
59  
60      Class<?>[] tokens();
61      int[] other();
62  }