Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParseError on annotated varargs #5465

Closed
Bananeweizen opened this issue Jan 17, 2018 · 1 comment
Closed

ParseError on annotated varargs #5465

Bananeweizen opened this issue Jan 17, 2018 · 1 comment

Comments

@Bananeweizen
Copy link
Contributor

/var/tmp $ javac YOUR_FILE.java:

not using javac, but ecc

/var/tmp $ cat YOUR_FILE.java:

package reproduction

import org.eclipse.jdt.annotation.NonNull;

public class Failure {

    public Object parseError(@NonNull final Object @NonNull... problematicArgument) {
        return this;
    }

}

The problematic part is "@nonnull...". The import is https://mvnrepository.com/artifact/org.eclipse.jdt/org.eclipse.jdt.annotation/2.0.0 (or more recent), the Eclipse Java compiler type annotations for nullness. I'm sure this can be reproduced with other type annotations, too.

/var/tmp $ java -Duser.language=en -Duser.country=US -jar checkstyle-X.XX-all.jar -c config.xml YOUR_FILE.java:

 com.puppycrawl.tools.checkstyle.api.CheckstyleException: MismatchedTokenException occurred during the analysis of file D:\development\esdl\git\project33\plugins\com.etas.esdl\src\com\etas\esdl\validation\utils\Failure.java.
	at com.puppycrawl.tools.checkstyle.TreeWalker.processFiltered(TreeWalker.java:229)
	at com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck.process(AbstractFileSetCheck.java:83)
	at com.puppycrawl.tools.checkstyle.Checker.processFile(Checker.java:319)
	at com.puppycrawl.tools.checkstyle.Checker.processFiles(Checker.java:289)
	... 16 more
Caused by: D:\development\esdl\git\project33\plugins\com.etas.esdl\src\com\etas\esdl\validation\utils\Failure.java:9:5: 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:498)
	at com.puppycrawl.tools.checkstyle.TreeWalker.processFiltered(TreeWalker.java:200)

This is checkstyle 8.7.0, being used from Eclipse-CS 8.7.0

@rnveach
Copy link
Member

rnveach commented Jan 17, 2018

duplicate of #3238

@rnveach rnveach closed this as completed Jan 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants