forked from checkstyle/checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue checkstyle#15434: fixed MissingJavadocMethod module in google_c…
…hecks.xml to give warning for missing javadoc for protected methods
- Loading branch information
Showing
8 changed files
with
251 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
135 changes: 121 additions & 14 deletions
135
...yle/test/chapter7javadoc/rule73wherejavadocrequired/InputMissingJavadocTypeIncorrect.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,144 @@ | ||
package com.google.checkstyle.test.chapter7javadoc.rule73wherejavadocrequired; | ||
|
||
public class InputMissingJavadocTypeIncorrect { // violation 'Missing a Javadoc comment.' | ||
// violation below 'Missing a Javadoc comment.' | ||
public class InputMissingJavadocTypeIncorrect { | ||
|
||
public class Inner { // violation 'Missing a Javadoc comment.' | ||
// violation below 'Missing a Javadoc comment.' | ||
public class InnerPublic implements MyInterfacePublic { | ||
@Override | ||
public void testPublicInterfaceMethod() {} | ||
|
||
@Override | ||
public void testPackagePrivateInterfaceMethod() {} | ||
} | ||
|
||
public enum MyEnum { // violation 'Missing a Javadoc comment.' | ||
// violation below 'Missing a Javadoc comment.' | ||
public enum MyEnum {} | ||
|
||
// violation below 'Missing a Javadoc comment.' | ||
public interface MyInterface { | ||
// violation below 'Missing a Javadoc comment.' | ||
class MyInterfaceClass {} | ||
} | ||
|
||
public interface MyInterface { // violation 'Missing a Javadoc comment.' | ||
class MyInterfaceClass {} // violation 'Missing a Javadoc comment.' | ||
// violation below 'Missing a Javadoc comment.' | ||
public @interface MyAnnotation {} | ||
|
||
// violation below 'Missing a Javadoc comment.' | ||
protected @interface MyAnnotationProtected {} | ||
|
||
/** some javadoc. */ | ||
public void myMethod() { | ||
class MyMethodClass {} | ||
} | ||
|
||
public @interface MyAnnotation { // violation 'Missing a Javadoc comment.' | ||
// OK, not public | ||
class AdditionalClass {} | ||
|
||
// violation below 'Missing a Javadoc comment.' | ||
protected int testProtectedMethod1() { | ||
return 0; | ||
} | ||
|
||
protected class InnerProtected { // violation 'Missing a Javadoc comment.' | ||
// violation below 'Missing a Javadoc comment.' | ||
protected void testProtectedMethod2() {} | ||
|
||
// violation below 'Missing a Javadoc comment.' | ||
protected InputMissingJavadocTypeIncorrect() {} | ||
|
||
// violation below 'Missing a Javadoc comment.' | ||
public class InnerClass { | ||
// violation below 'Missing a Javadoc comment.' | ||
public void testPublicInnerMethod() {} | ||
|
||
// violation below 'Missing a Javadoc comment.' | ||
protected void testProtectedInnerMethod() {} | ||
|
||
private void testPrivateInnerMethod() {} | ||
|
||
void testPackagePrivateInnerMethod() {} | ||
|
||
// violation below 'Missing a Javadoc comment.' | ||
public InnerClass(int arg) {} | ||
|
||
// violation below 'Missing a Javadoc comment.' | ||
protected InnerClass() {} | ||
|
||
InnerClass(String arg) {} | ||
|
||
private InnerClass(double arg) {} | ||
} | ||
|
||
protected enum MyEnumProtected { // violation 'Missing a Javadoc comment.' | ||
// violation below 'Missing a Javadoc comment.' | ||
protected class InnerProtected { | ||
protected void testProtectedInnerMethod() {} | ||
|
||
public void testPublicInnerMethod() {} | ||
|
||
private void testPrivateInnerMethod() {} | ||
|
||
void testPackagePrivateInnerMethod() {} | ||
|
||
protected InnerProtected() {} | ||
|
||
InnerProtected(String arg) {} | ||
|
||
private InnerProtected(double arg) {} | ||
} | ||
|
||
protected interface MyInterfaceProtected { // violation 'Missing a Javadoc comment.' | ||
// violation below 'Missing a Javadoc comment.' | ||
public enum MyEnumPublic { | ||
TEST; | ||
|
||
// violation below 'Missing a Javadoc comment.' | ||
public void testPublicEnumMethod() {} | ||
|
||
// violation below 'Missing a Javadoc comment.' | ||
protected void testProtectedEnumMethod() {} | ||
|
||
private void testPrivateEnumMethod() {} | ||
|
||
void testPackagePrivateEnumMethod() {} | ||
|
||
private MyEnumPublic() {} | ||
|
||
MyEnumPublic(String arg) {} | ||
} | ||
|
||
protected @interface MyAnnotationProtected { // violation 'Missing a Javadoc comment.' | ||
// violation below 'Missing a Javadoc comment.' | ||
protected enum MyEnumProtected { | ||
TEST; | ||
|
||
public void testPublicEnumMethod() {} | ||
|
||
protected void testProtectedEnumMethod() {} | ||
|
||
private void testPrivateEnumMethod() {} | ||
|
||
void testPackagePrivateEnumMethod() {} | ||
|
||
private MyEnumProtected() {} | ||
|
||
MyEnumProtected(String arg) {} | ||
} | ||
|
||
/** some javadoc. */ | ||
public void myMethod() { | ||
class MyMethodClass {} | ||
// violation below 'Missing a Javadoc comment.' | ||
protected interface MyInterfaceProtected { | ||
public void testPublicInterfaceMethod(); | ||
|
||
private void testPrivateInterfaceMethod() {} | ||
|
||
void testPackagePrivateInterfaceMethod(); | ||
} | ||
|
||
class AdditionalClass { // OK, not public | ||
// violation below 'Missing a Javadoc comment.' | ||
public interface MyInterfacePublic { | ||
// violation below 'Missing a Javadoc comment.' | ||
public void testPublicInterfaceMethod(); | ||
|
||
private void testPrivateInterfaceMethod() {} | ||
|
||
// violation below 'Missing a Javadoc comment.' | ||
void testPackagePrivateInterfaceMethod(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters