View Javadoc
1   /*
2   MissingJavadocMethod
3   minLineCount = (default)-1
4   allowedAnnotations = (default)Override
5   scope = private
6   excludeScope = protected
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  /* Config:
17   * scope = "private"
18   * excludeScope = "protected"
19   */
20  public class InputMissingJavadocMethodNoJavadoc3 //comment test
21  {
22      public int i1;
23      protected int i2;
24      int i3;
25      private int i4;
26  
27      public void foo1() {} // violation
28      protected void foo2() {} // ok
29      void foo3() {} // violation
30      private void foo4() {} // violation
31  
32      protected class ProtectedInner {
33          public int i1;
34          protected int i2;
35          int i3;
36          private int i4;
37  
38          public void foo1() {}
39          protected void foo2() {} // ok
40          void foo3() {}
41          private void foo4() {}
42      }
43  
44      class PackageInner {
45          public int i1;
46          protected int i2;
47          int i3;
48          private int i4;
49  
50          public void foo1() {} // violation
51          protected void foo2() {} // ok
52          void foo3() {} // violation
53          private void foo4() {} // violation
54      }
55  
56      private class PrivateInner {
57          public int i1;
58          protected int i2;
59          int i3;
60          private int i4;
61  
62          public void foo1() {} // violation
63          protected void foo2() {} // ok
64          void foo3() {} // violation
65          private void foo4() {} // violation
66      }
67  }
68  
69  class PackageClass3 {
70      public int i1;
71      protected int i2;
72      int i3;
73      private int i4;
74  
75      public void foo1() {} // violation
76      protected void foo2() {} // ok
77      void foo3() {} // violation
78      private void foo4() {} // violation
79  
80      public class PublicInner {
81          public int i1;
82          protected int i2;
83          int i3;
84          private int i4;
85  
86          public void foo1() {} // violation
87          protected void foo2() {} // ok
88          void foo3() {} // violation
89          private void foo4() {} // violation
90      }
91  
92      protected class ProtectedInner {
93          public int i1;
94          protected int i2;
95          int i3;
96          private int i4;
97  
98          public void foo1() {} // violation
99          protected void foo2() {} // ok
100         void foo3() {} // violation
101         private void foo4() {} // violation
102     }
103 
104     class PackageInner {
105         public int i1;
106         protected int i2;
107         int i3;
108         private int i4;
109 
110         public void foo1() {} // violation
111         protected void foo2() {} // ok
112         void foo3() {} // violation
113         private void foo4() {} // violation
114     }
115 
116     private class PrivateInner {
117         public int i1;
118         protected int i2;
119         int i3;
120         private int i4;
121 
122         public void foo1() {} // violation
123         protected void foo2() {} // ok
124         void foo3() {} // violation
125         private void foo4() {} // violation
126     }
127 
128     class IgnoredName {
129         // ignore by name
130         private int logger;
131         // no warning, 'serialVersionUID' fields do not require Javadoc
132         private static final long serialVersionUID = 0;
133     }
134 
135     /**/
136     void methodWithTwoStarComment() {} // violation
137 }