Bugs item #1671882, was opened at 2007-03-01 17:26
Message generated for change (Comment added) made by djarma
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397078&aid=1671882&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: None
Group: None
Status: Open
Resolution: None
Priority: 9
Private: No
Submitted By: anb (anbmaconomy)
Assigned to: Nobody/Anonymous (nobody)
Summary: Checkstyle-Plugin: Throwable occured
Initial Comment:
It seems like CheckStyle cannot process the following Java interface:
public interface TestInterface <E extends Throwable> {
public void foo() throws E;
}
The problems seems to be that CheckStyle cannot process a throws clause that
refers to a generic parameter. It creates the following stack trace:
java.lang.RuntimeException: Unable to get class information for E.
at
com.puppycrawl.tools.checkstyle.checks.AbstractTypeAwareCheck.logLoadErrorImpl(AbstractTypeAwareCheck.java:291)
at
com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck.logLoadError(RedundantThrowsCheck.java:121)
at
com.puppycrawl.tools.checkstyle.checks.AbstractTypeAwareCheck.tryLoadClass(AbstractTypeAwareCheck.java:260)
at
com.puppycrawl.tools.checkstyle.checks.AbstractTypeAwareCheck$RegularClass.getClazz(AbstractTypeAwareCheck.java:481)
at
com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck.checkException(RedundantThrowsCheck.java:145)
at
com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck.processAST(RedundantThrowsCheck.java:108)
at
com.puppycrawl.tools.checkstyle.checks.AbstractTypeAwareCheck.visitToken(AbstractTypeAwareCheck.java:146)
at
com.puppycrawl.tools.checkstyle.TreeWalker.notifyVisit(TreeWalker.java:500)
at
com.puppycrawl.tools.checkstyle.TreeWalker.processIter(TreeWalker.java:625)
at com.puppycrawl.tools.checkstyle.TreeWalker.walk(TreeWalker.java:426)
at
com.puppycrawl.tools.checkstyle.TreeWalker.process(TreeWalker.java:244)
at
com.puppycrawl.tools.checkstyle.TreeWalker.process(TreeWalker.java:590)
at com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:239)
at
com.atlassw.tools.eclipse.checkstyle.builder.Auditor.runAudit(Auditor.java:193)
at
com.atlassw.tools.eclipse.checkstyle.builder.CheckstyleBuilder.handleBuildSelection(CheckstyleBuilder.java:341)
at
com.atlassw.tools.eclipse.checkstyle.builder.CheckstyleBuilder.build(CheckstyleBuilder.java:212)
at
org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:603)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:167)
at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
at
org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:230)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:233)
at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:252)
at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:285)
at
org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:145)
at
org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:208)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
----------------------------------------------------------------------
Comment By: djarma (djarma)
Date: 2007-06-06 13:43
Message:
Logged In: YES
user_id=1809875
Originator: NO
This error can be avoided using RedundantThrows check's property ->
logLoadErrors set to true.
See http://checkstyle.sourceforge.net/config_coding.html#RedundantThrows
for more info...
----------------------------------------------------------------------
Comment By: MiSo (coolmischa)
Date: 2007-05-20 14:14
Message:
Logged In: YES
user_id=1797504
Originator: NO
Moin, moin
I've got the same problem. I'm working with RSA 7.0.x on Linux and have
imported source code from a MS Windows source. The default encoding on the
MS Win system is CP1512 or ISO-8859-15, on my linux box the defualt is
UTF-8.
The first error from Checkstyle reported in all files with IS0-8859-15
special Characters like german Umlauts was:
"TreeWalker: Got an exception - null"
After adjusting the charset property in my checkstyle configuration german
Umlauts were not a problem any more but in any File which has a method with
more than one throws clause the error was:
"Got an exception - java.lang.RuntimeException: Unable to get class
information for @throws tag 'e'"
Rebuilding the project removes the errors.
Unfortunatley now my RSA 7.0.x close unexpectedly ;-(
----------------------------------------------------------------------
Comment By: DGardner (dgardner_curam)
Date: 2007-04-24 11:58
Message:
Logged In: YES
user_id=1663951
Originator: NO
Me too. I've just run into this problem with an interface that
takes a parameterized exception type. I get the (legendary)
Eclipse plug-in message:
"Got an exception - java.lang.RuntimeException: Unable to get class
information for @throws tag 'E'."
This is the same message I get when Checkstyle (or the plug-in)
loses the plot and starts complaining about real exception
classes that do exist in the same project, but that is another
story.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397078&aid=1671882&group_id=29721
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
|