Menu

#426 @Nonnull annotation before ellipsis operator causes exception

8.5.0
wont-fix
nobody
None
1
2017-12-20
2017-11-08
Duesentrieb
No

The CheckStyle plugin (8.0.0.201707161816) stumbles over the second @Nonnull annotation before the ellipsis operator:

public Marker(final @NonNull String format, final Object @NonNull... args) {
this(String.format(format, args));
}

com.puppycrawl.tools.checkstyle.api.CheckstyleException: Exception was thrown while processing ...
at com.puppycrawl.tools.checkstyle.Checker.processFiles(Checker.java:295)
at com.puppycrawl.tools.checkstyle.Checker.process(Checker.java:213)
at net.sf.eclipsecs.core.builder.Auditor.runAudit(Auditor.java:158)
at net.sf.eclipsecs.core.builder.CheckstyleBuilder.handleBuildSelection(CheckstyleBuilder.java:301)
at net.sf.eclipsecs.core.builder.CheckstyleBuilder.build(CheckstyleBuilder.java:172)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:142)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:232)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: MismatchedTokenException occurred during the analysis of file ..\ContextInfo.java.
at com.puppycrawl.tools.checkstyle.TreeWalker.processFiltered(TreeWalker.java:199)
at com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck.process(AbstractFileSetCheck.java:78)
at com.puppycrawl.tools.checkstyle.Checker.processFile(Checker.java:316)
at com.puppycrawl.tools.checkstyle.Checker.processFiles(Checker.java:286)
... 16 more
Caused by: ...\ContextInfo.java:39:9: expecting EOF, found '}'
at antlr.Parser.match(Parser.java:211)
at com.puppycrawl.tools.checkstyle.grammars.GeneratedJavaRecognizer.compilationUnit(GeneratedJavaRecognizer.java:211)
at com.puppycrawl.tools.checkstyle.TreeWalker.parse(TreeWalker.java:446)
at com.puppycrawl.tools.checkstyle.TreeWalker.processFiltered(TreeWalker.java:179)
... 19 more

Discussion

  • Lars Koedderitzsch

    This is a problem in Checkstyle core, which might have been fixed already. Please try eclipse-cs 8.5.0 once it's out. If the problem persists please report this to the Checkstyle core project (https://github.com/checkstyle/checkstyle).

     
  • Lars Koedderitzsch

    • status: open --> wont-fix
    • Group: Future --> 8.5.0
     
  • Duesentrieb

    Duesentrieb - 2017-12-20

    The problem still exists, but thanks for your efforts. I'll turn to the core project.

     

Log in to post a comment.