I'd prefer not to use the 'throws' keyword to declare unchecked
exceptions as Joshua Bloch suggests in Effective Java (p.181):

    Use the Javadoc @throws tag to document each unchecked exception
    that a method can throw, but do not use the 'throws' keyword to
    include unchecked exceptions in the method declaration.  It is
    important that the programmer using your API be aware of which
    exceptions are checked and which are unchecked, as his
    responsibilities differ in these two cases.  The documentation
    generated by the Javadoc @throws tag in the absence of the method
    header generated by the 'throws' declaration provides a strong
    visual clue to help the programmer distinguish checked exceptions
    from unchecked.

Instead, I'd like to petition the author of CheckStyle to accomodate the
above rather than reporting an error if an exception is declared in the
Javadoc but not via the 'throws' keyword.

On Mon, Apr 22, 2002 at 01:14:57AM -0000, [EMAIL PROTECTED] wrote:
>   Log:
>   Fixed style violations
>   
>   Index: DVSLFormatter.java
>   ===================================================================
>   RCS file: 
>/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/DVSLFormatter.java,v
>   retrieving revision 1.2
>   retrieving revision 1.3
>   diff -u -r1.2 -r1.3
>   --- DVSLFormatter.java      9 Mar 2002 15:55:46 -0000       1.2
>   +++ DVSLFormatter.java      22 Apr 2002 01:14:56 -0000      1.3
>   @@ -86,6 +86,7 @@
>         * specified.
>         */
>        public static final String formatNumber(Number value, String pattern)
>   +        throws IllegalArgumentException
>        {
>            formatter.applyPattern(pattern);
>            return formatter.format(value.doubleValue());

Reply via email to