Last active
August 29, 2015 14:10
-
-
Save stubillwhite/a96545347e471e2284e7 to your computer and use it in GitHub Desktop.
Test case for Checkstyle behaviour change between 5.9 and 6.0 for Javadoc referencing checked exception that is not thrown
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
Output for run-checkstyle-5.9.bat | |
-- | |
Starting audit... | |
C:\TRASH\checkstyle-behaviour-change\ExceptionJavadoc.java:8:8: warning: Unused @throws tag for 'java.io.IOException'. | |
Audit done. | |
Output for run-checkstyle-6.0.bat | |
-- | |
Starting audit... | |
Audit done. |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> | |
<module name="Checker"> | |
<property name="severity" value="warning"/> | |
<module name="TreeWalker"> | |
<module name="JavadocMethod"> | |
<property name="scope" value="protected"/> | |
<property name="allowMissingThrowsTags" value="true"/> | |
<property name="logLoadErrors" value="true"/> | |
<property name="suppressLoadErrors" value="true"/> | |
<property name="allowUndeclaredRTE" value="true" /> | |
</module> | |
</module> | |
</module> |
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 is my class. | |
*/ | |
public final class ExceptionJavadoc | |
{ | |
/** | |
* This is a method. | |
* @throws java.io.IOException sometimes. | |
*/ | |
public void badMethod() | |
{ | |
// Bad method Javadocs a CHECKED exception that isn't declared in the throws clause. | |
} | |
} |
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
@echo off | |
java -cp checkstyle-5.9-all.jar com.puppycrawl.tools.checkstyle.Main -c CheckstyleConfig.xml ExceptionJavadoc.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
@echo off | |
java -cp checkstyle-6.0-all.jar com.puppycrawl.tools.checkstyle.Main -c CheckstyleConfig.xml ExceptionJavadoc.java |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment