View Javadoc
1   /*
2   AnnotationUseStyle
3   elementStyle = ignore
4   closingParens = ignore
5   trailingArrayComma = NEVER
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 InputAnnotationUseStyleWithTrailingCommaNever
14  {
15      // violation below 'Annotation array values cannot contain trailing comma'
16      @SuppressWarnings({"common",})
17      public void foo() {
18  
19  
20          // violation below 'Annotation array values cannot contain trailing comma'
21          @SuppressWarnings({"common","foo",})
22          Object o = new Object() {
23  
24              // violation below 'Annotation array values cannot contain trailing comma'
25              @SuppressWarnings(value={"common",})
26              public String toString() {
27  
28                  // violation below 'Annotation array values cannot contain trailing comma'
29                  @SuppressWarnings(value={"leo","herbie",})
30                  final String pooches = "leo.herbie";
31  
32                  return pooches;
33              }
34          };
35      }
36  
37      @Test4(value={"foo",}, more={"bar",}) // 2 violations
38      /**
39  
40      */
41      enum P {
42  
43          @Pooches4(tokens={Pooches4.class,},other={1,}) // 2 violations
44          L,
45  
46          /**
47  
48          */
49          Y;
50      }
51  
52  }
53  
54  @interface Test4 {
55      String[] value();
56      String[] more() default {};
57  }
58  
59  @interface Pooches4 {
60  
61      Class<?>[] tokens();
62      int[] other();
63  }