Skip to content

Commit dff13e5

Browse files
MANISH-K-07romani
authored andcommitted
Issue #11163: Enforced filesize TypeNoJavadoc1
1 parent 23da5f9 commit dff13e5

File tree

4 files changed

+79
-58
lines changed

4 files changed

+79
-58
lines changed

config/checkstyle-resources-suppressions.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,6 @@
204204
files="[\\/]test[\\/]resources[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]missingjavadoctype[\\/]InputMissingJavadocTypePublicOnly2\.java"/>
205205
<suppress checks="FileLength"
206206
files="[\\/]test[\\/]resources[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]missingjavadoctype[\\/]InputMissingJavadocTypePublicOnly1\.java"/>
207-
<suppress checks="FileLength"
208-
files="[\\/]test[\\/]resources[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]missingjavadoctype[\\/]InputMissingJavadocTypeNoJavadoc1\.java"/>
209207
<suppress checks="FileLength"
210208
files="[\\/]test[\\/]resources[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]checks[\\/]javadoc[\\/]javadoctagcontinuationindentation[\\/]InputJavadocTagContinuationIndentation\.java"/>
211209
<suppress checks="FileLength"

src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheckTest.java

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,21 +177,31 @@ public void testEclipse() throws Exception {
177177
}
178178

179179
@Test
180-
public void testScopes() throws Exception {
180+
public void testScopesOne() throws Exception {
181181
final String[] expected = {
182182
"13:1: " + getCheckMessage(MSG_JAVADOC_MISSING),
183183
"25:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
184184
"37:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
185185
"49:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
186-
"62:1: " + getCheckMessage(MSG_JAVADOC_MISSING),
187-
"73:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
188-
"85:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
189-
"97:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
190-
"109:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
191-
"121:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
192186
};
193187
verifyWithInlineConfigParser(
194-
getPath("InputMissingJavadocTypeNoJavadoc1.java"),
188+
getPath("InputMissingJavadocTypeNoJavadoc1One.java"),
189+
expected);
190+
}
191+
192+
@Test
193+
public void testScopesTwo() throws Exception {
194+
final String[] expected = {
195+
"13:1: " + getCheckMessage(MSG_JAVADOC_MISSING),
196+
"15:1: " + getCheckMessage(MSG_JAVADOC_MISSING),
197+
"26:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
198+
"38:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
199+
"50:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
200+
"62:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
201+
"74:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
202+
};
203+
verifyWithInlineConfigParser(
204+
getPath("InputMissingJavadocTypeNoJavadoc1Two.java"),
195205
expected);
196206
}
197207

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
MissingJavadocType
3+
scope = PRIVATE
4+
excludeScope = (default)null
5+
skipAnnotations = (default)Generated
6+
tokens = (default)INTERFACE_DEF, CLASS_DEF, ENUM_DEF, ANNOTATION_DEF, RECORD_DEF
7+
8+
9+
*/
10+
11+
package com.puppycrawl.tools.checkstyle.checks.javadoc.missingjavadoctype;
12+
13+
public class InputMissingJavadocTypeNoJavadoc1One // violation
14+
{
15+
public int i1;
16+
protected int i2;
17+
int i3;
18+
private int i4;
19+
20+
public void foo1() {}
21+
protected void foo2() {}
22+
void foo3() {}
23+
private void foo4() {}
24+
25+
protected class ProtectedInner { // violation
26+
public int i1;
27+
protected int i2;
28+
int i3;
29+
private int i4;
30+
31+
public void foo1() {}
32+
protected void foo2() {}
33+
void foo3() {}
34+
private void foo4() {}
35+
}
36+
37+
class PackageInner { // violation
38+
public int i1;
39+
protected int i2;
40+
int i3;
41+
private int i4;
42+
43+
public void foo1() {}
44+
protected void foo2() {}
45+
void foo3() {}
46+
private void foo4() {}
47+
}
48+
49+
private class PrivateInner { // violation
50+
public int i1;
51+
protected int i2;
52+
int i3;
53+
private int i4;
54+
55+
public void foo1() {}
56+
protected void foo2() {}
57+
void foo3() {}
58+
private void foo4() {}
59+
}
60+
}

src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/missingjavadoctype/InputMissingJavadocTypeNoJavadoc1.java renamed to src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/missingjavadoctype/InputMissingJavadocTypeNoJavadoc1Two.java

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -10,54 +10,7 @@
1010

1111
package com.puppycrawl.tools.checkstyle.checks.javadoc.missingjavadoctype;
1212

13-
public class InputMissingJavadocTypeNoJavadoc1 // violation
14-
{
15-
public int i1;
16-
protected int i2;
17-
int i3;
18-
private int i4;
19-
20-
public void foo1() {}
21-
protected void foo2() {}
22-
void foo3() {}
23-
private void foo4() {}
24-
25-
protected class ProtectedInner { // violation
26-
public int i1;
27-
protected int i2;
28-
int i3;
29-
private int i4;
30-
31-
public void foo1() {}
32-
protected void foo2() {}
33-
void foo3() {}
34-
private void foo4() {}
35-
}
36-
37-
class PackageInner { // violation
38-
public int i1;
39-
protected int i2;
40-
int i3;
41-
private int i4;
42-
43-
public void foo1() {}
44-
protected void foo2() {}
45-
void foo3() {}
46-
private void foo4() {}
47-
}
48-
49-
private class PrivateInner { // violation
50-
public int i1;
51-
protected int i2;
52-
int i3;
53-
private int i4;
54-
55-
public void foo1() {}
56-
protected void foo2() {}
57-
void foo3() {}
58-
private void foo4() {}
59-
}
60-
}
13+
public class InputMissingJavadocTypeNoJavadoc1Two {} // violation
6114

6215
class PackageClass1 { // violation
6316
public int i1;

0 commit comments

Comments
 (0)