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 InputJavadocMethodProtectedScopeJavadocTwo {
16          // ignore - need Javadoc
17      private InputJavadocMethodProtectedScopeJavadocTwo(int aA)
18      {
19      }
20  
21      // ignore - need Javadoc when not relaxed
22      InputJavadocMethodProtectedScopeJavadocTwo(String aA)
23      {
24      }
25  
26      // ignore - always need javadoc
27      protected InputJavadocMethodProtectedScopeJavadocTwo(Object aA)
28      {
29      }
30  
31      // ignore - always need javadoc
32      public InputJavadocMethodProtectedScopeJavadocTwo(Class<Object> aA)
33      {
34      }
35  
36      /** Here should not be an error, Out of scope */
37      private void method(int aA)
38      {
39      }
40  
41      /** Here should not be an error, Out of scope */
42      void method(Long aA)
43      {
44      }
45  
46      /** Here should be an error, In scope */
47      protected void method(Class<Object> aA) // violation 'Expected @param tag for 'aA'.'
48      {
49      }
50  
51      /** Here should be an error, In scope */
52      public void method(StringBuffer aA) // violation 'Expected @param tag for 'aA'.'
53      {
54      }
55  
56  
57      /**
58       A param tag should not be required here when relaxed about Javadoc.
59       Writing a little documentation should not be worse than not
60       writing any documentation at all.
61       */
62      private void method(String aA)
63      {
64      }
65  
66      /**
67       This inner class has no author tag, which is OK.
68       */
69      public class InnerWithoutAuthor
70      {
71  
72      }
73  
74      /** {@inheritDoc} */
75      public String toString()
76      {
77          return super.toString();
78      }
79  
80      @Deprecated @Override
81      public int hashCode()
82      {
83          return super.hashCode();
84      }
85  }