#473 Checkstyle-Plugin: Throwable occured

release_1.0
closed
nobody
None
2
2014-07-26
2007-03-01
anb
No

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)

Discussion

<< < 1 2 (Page 2 of 2)
  • Roman Ivanov
    Roman Ivanov
    2014-07-26

    • status: open --> closed
    • Group: --> release_1.0
     
  • Roman Ivanov
    Roman Ivanov
    2014-07-26

    resolved in github.

     
<< < 1 2 (Page 2 of 2)