logo       

[ checkstyle-Bugs-1755944 ] @throws tag checking - unexpected error: msg#00261

Subject: [ checkstyle-Bugs-1755944 ] @throws tag checking - unexpected error
Bugs item #1755944, was opened at 2007-07-18 03:19
Message generated for change (Comment added) made by joseph_cruz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397078&aid=1755944&group_id=29721

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Other
Group:  release 4.3
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: waysider (waysider)
Assigned to: Nobody/Anonymous (nobody)
Summary: @throws tag checking - unexpected error

Initial Comment:
Grateful for any help on this :-)

Trying to resolve a problem with Checkstyle where, if a method's javadoc 
declares a method to be thrown and treewalker cannot load
info for the Exception class it performs no further analysis on the class (as 
documented). So added what I believe to be the correct options to the 
appropriate Checkstyle rules (i.e 'logLoadErrors' and 'suppressLoadErrors') but 
now I get a different error.

The following Java code (a very simple maven plugin) :-

    /**
     * Execute method (entry point).
     * @throws MojoFailureException if an error occurs
     * @throws MojoExecutionException if an error occurs
     */
    public void execute()
        throws MojoFailureException, MojoExecutionException

Produces no violations in the Eclipse checkstyle plugin but in Maven checkstyle 
plugin report I get:-

                JavadocMethodCheck          Expected @throws tag for 
'MojoExecutionException'. 
                RedundantThrowsCheck    Redundant throws: 
'MojoExecutionException' listed more then one time. 

The relevant checkstyle config entries (same in both environments) are:-

<module name="JavadocMethod">
        <property name="severity" value="error"/>
        <property name="logLoadErrors" value="true"/>
        <property name="suppressLoadErrors" value="true"/>
</module>

<module name="RedundantThrows">
         <property name="logLoadErrors" value="true"/>
         <property name="suppressLoadErrors" value="true"/>
</module>

I have tried various combinations of the above without success. Can anyone shed 
any light on why Checkstyle says it wants a @throws tag when its got one ?

TIA

----------------------------------------------------------------------

Comment By: Joseph Cruz (joseph_cruz)
Date: 2007-09-05 13:49

Message:
Logged In: YES 
user_id=1883800
Originator: NO

I also got the Expected @throws error described in this issue. In my case,
Checkstyle could not load the exception classes because they did not exist.
I was executing Checkstyle during the 'validate' phase, before compile.
Executing Checkstyle during the 'test' phase resolved this problem for me.

Solution:
    <executions>
        <execution>
            <phase>test</phase>
            <goals>
                <goal>checkstyle</goal>
            </goals>
        </execution>
    </executions>

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397078&aid=1755944&group_id=29721

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/


<Prev in Thread] Current Thread [Next in Thread>