View Javadoc
1   /*
2   MissingJavadocMethod
3   minLineCount = 2
4   allowedAnnotations = MyAnnotation, Override
5   scope = private
6   excludeScope = (default)null
7   allowMissingPropertyJavadoc = (default)false
8   ignoreMethodNamesRegex = (default)null
9   tokens = (default)METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, COMPACT_CTOR_DEF
10  
11  
12  */
13  
14  package com.puppycrawl.tools.checkstyle.checks.javadoc.missingjavadocmethod;
15  
16  /**
17   * The following is a bad tag.
18   * @mytag Hello
19   */
20  public class InputMissingJavadocMethodSmallMethods extends Some
21  {
22      //with comments
23  
24      /**
25       * Some javadoc.
26       * @return Some javadoc.
27       */
28      int foo1()
29      {
30          return 1;
31      }
32  
33      /**
34       * Some javadoc.
35       * @return Some javadoc.
36       */
37      String foo2()
38      {
39              return "Fooooooooooooooo"
40                  + "ooooo"
41                  + "ooo";
42      }
43  
44      /**
45       * Some javadoc.
46       */
47      void foo3()
48      {
49          foo2();
50      }
51  
52      /**
53       * Some javadoc.
54       */
55      void foo4() {}
56  
57      //without comments
58  
59      int foo5()
60      {
61          return 1;
62      }
63  
64      String foo6()
65      {
66          return "Fooooooooooooooo"
67                  + "oooooooo";
68      }
69  
70      String foo7() // violation
71      {
72          return "Fooooooooooooooo"
73                  + "ooooo"
74                  + "ooo";
75      }
76  
77      void foo8()
78      {
79          foo2();
80      }
81  
82      void foo9() {
83  
84  
85  
86  
87  
88      }
89  
90      @MyAnnotation
91      String foo10()
92      {
93          return "Fooooooooooooooo"
94                  + "ooooo"
95                  + "ooo";
96      }
97  
98      @Override
99      protected String foo11()
100     {
101         return "Fooooo"
102                         + "ooo"
103                         + "ooooooo"
104                 + "ooooo"
105                 + "ooo";
106     }
107 }
108 
109 @interface MyAnnotation {}
110 
111 class Some {
112     protected String foo11() {
113         return "4";
114     }
115 }