View Javadoc
1   /*
2   JavadocVariable
3   accessModifiers = public
4   ignoreNamePattern = (default)null
5   tokens = (default)ENUM_CONSTANT_DEF
6   
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.javadoc.javadocvariable;
10  
11  /**
12   * Tests having inner types
13   * @author Oliver Burn
14   */
15  class InputJavadocVariableInner2
16  {
17      class InnerInner2
18      {
19          int fData;
20      }
21  
22      // Ignore - 1 violations
23      interface InnerInterface2
24      {
25  
26          String data = "zxzc"; // violation, 'Missing a Javadoc comment'
27  
28          // Ignore
29          class InnerInterfaceInnerClass
30          {
31              // Ignore - need Javadoc and made private
32              private int rData;
33  
34              /** needs to be made private unless allowProtected. */
35              protected int protectedVariable;
36  
37              /** needs to be made private unless allowPackage. */
38              int packageVariable;
39          }
40      }
41  
42      /** demonstrate bug in handling static final **/
43      protected static Object sWeird = new Object();
44      /** demonstrate bug in handling static final **/
45      static Object sWeird2 = new Object();
46  
47      /** demonstrate bug in local final variable */
48      public interface Inter
49      {
50      }
51  
52       public static void main()
53       {
54          Inter m = new Inter()
55          {
56              private static final int CDS = 1;
57  
58              private int ABC;
59          };
60       }
61  
62      /** annotation field incorrectly named. */
63      @interface InnerAnnotation
64      {
65          /** Ignore - should be all upper case. */
66          String data = "zxzc";
67      }
68  
69      /** enum with public member variable */
70      enum InnerEnum
71      {
72          /** First constant */
73          A,
74  
75          /** Second constant */
76          B;
77  
78          /** Should be private */
79          public int someValue;
80      }
81  }