View Javadoc
1   /*
2   JavadocMethod
3   allowedAnnotations = (default)Override
4   validateThrows = (default)false
5   accessModifiers = public, protected
6   allowMissingParamTags = (default)false
7   allowMissingReturnTag = (default)false
8   tokens = (default)METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, COMPACT_CTOR_DEF
9   
10  
11  */
12  
13  package com.puppycrawl.tools.checkstyle.checks.javadoc.javadocmethod;
14  
15  public class InputJavadocMethodProtectedScopeJavadoc // ignore - need javadoc
16  {
17      private interface InnerInterface // ignore - when not relaxed about Javadoc
18      {
19          String CONST = "InnerInterface"; // ignore - w.n.r.a.j
20          void method(); // ignore - when not relaxed about Javadoc
21  
22          class InnerInnerClass // ignore - when not relaxed about Javadoc
23          {
24              private int mData; // ignore - when not relaxed about Javadoc
25  
26              private InnerInnerClass()
27              {
28                  final Runnable r = new Runnable() {
29                      public void run() {};
30                  };
31              }
32  
33              void method2() // ignore - when not relaxed about Javadoc
34              {
35                  final Runnable r = new Runnable() {
36                      public void run() {};
37                  };
38              }
39          }
40      }
41  
42      private class InnerClass // ignore
43      {
44          private int mDiff; // ignore - when not relaxed about Javadoc
45  
46          void method() // ignore - when not relaxed about Javadoc
47          {
48          }
49      }
50  
51      private int mSize; // ignore - when not relaxed about Javadoc
52      int mLen; // ignore - when not relaxed about Javadoc
53      protected int mDeer; // ignore
54      public int aFreddo; // ignore
55  
56      // ignore - need Javadoc
57      private InputJavadocMethodProtectedScopeJavadoc(int aA)
58      {
59      }
60  
61      // ignore - need Javadoc when not relaxed
62      InputJavadocMethodProtectedScopeJavadoc(String aA)
63      {
64      }
65  
66      // ignore - always need javadoc
67      protected InputJavadocMethodProtectedScopeJavadoc(Object aA)
68      {
69      }
70  
71      // ignore - always need javadoc
72      public InputJavadocMethodProtectedScopeJavadoc(Class<Object> aA)
73      {
74      }
75  
76      /** Here should not be an error, Out of scope */
77      private void method(int aA)
78      {
79      }
80  
81      /** Here should not be an error, Out of scope */
82      void method(Long aA)
83      {
84      }
85  
86      /** Here should be an error, In scope */
87      protected void method(Class<Object> aA) // violation 'Expected @param tag for 'aA'.'
88      {
89      }
90  
91      /** Here should be an error, In scope */
92      public void method(StringBuffer aA) // violation 'Expected @param tag for 'aA'.'
93      {
94      }
95  
96  
97      /**
98       A param tag should not be required here when relaxed about Javadoc.
99       Writing a little documentation should not be worse than not
100      writing any documentation at all.
101      */
102     private void method(String aA)
103     {
104     }
105 
106     /**
107      This inner class has no author tag, which is OK.
108      */
109     public class InnerWithoutAuthor
110     {
111 
112     }
113 
114     /** {@inheritDoc} */
115     public String toString()
116     {
117         return super.toString();
118     }
119 
120     @Deprecated @Override
121     public int hashCode()
122     {
123         return super.hashCode();
124     }
125 }