Bugs item #1755944, was opened at 2007-07-18 08:19
Message generated for change (Comment added) made by chetanjain
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: chetankjain (chetanjain)
Date: 2007-12-14 11:27
Message:
Logged In: YES
user_id=1959910
Originator: NO
Hi,
Even I'm running into this problem
Expected @throws tag for 'SomeException'.
Redundant throws: 'SomeException' listed more then one time.
----------------------------------------------------------------------
Comment By: McCloud (dgmccloud)
Date: 2007-10-01 15:50
Message:
Logged In: YES
user_id=1169258
Originator: NO
I've got exactly the same error using the Checkstyle Eclipse plugin
v.4.3.2 on Rational Application Developer 6.0. I also have to use the
logLoadErrors and suppressLoadErrors set to to 'true' due to the IBM JVM
bug. I'm also developing a Maven plugin and got the exact same errors as
the submitter of this bug ('RedundantThrow' and 'expected @throws tag'
messages).
----------------------------------------------------------------------
Comment By: Joseph Cruz (joseph_cruz)
Date: 2007-09-05 19:57
Message:
Logged In: YES
user_id=1883800
Originator: NO
I recommend executing Checkstyle in the 'verify' phase to work-around this
issue.
----------------------------------------------------------------------
Comment By: Joseph Cruz (joseph_cruz)
Date: 2007-09-05 18: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
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
|