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