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

The Check Framework assumes annotation processor options only contain one underscore #3528

Closed
cushon opened this issue Jul 30, 2020 · 0 comments · Fixed by #3537
Closed

The Check Framework assumes annotation processor options only contain one underscore #3528

cushon opened this issue Jul 30, 2020 · 0 comments · Fixed by #3537
Milestone

Comments

@cushon
Copy link
Contributor

cushon commented Jul 30, 2020

In the following example the Checker Framework crashes after seeing a -A annotation processor option with multiple underscores. This prevents it from being used in combination with other annotation processors that define their own -A flags.

I think it should probably just ignore -A options it doesn't recognize?

$ ./checker-framework-3.5.0/checker/bin/javac -processor nullness -Anot_a_checker_framework_option=true T.java
An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
org.checkerframework.javacutil.UserError: Invalid option name: not_a_checker_framework_option At most one separator _ expected, but found 5.
        at org.checkerframework.framework.source.SourceChecker.createActiveOptions(SourceChecker.java:1502)
        at org.checkerframework.framework.source.SourceChecker.getOptions(SourceChecker.java:1597)
        at org.checkerframework.common.basetype.BaseTypeChecker.getOptions(BaseTypeChecker.java:726)
        at org.checkerframework.framework.source.SourceChecker.hasOption(SourceChecker.java:1538)
        at org.checkerframework.framework.source.SourceChecker.init(SourceChecker.java:515)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:679)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:779)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:874)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2200(JavacProcessingEnvironment.java:111)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1215)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1327)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1234)
        at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:918)
        at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:311)
        at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170)
        at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
        at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
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

Successfully merging a pull request may close this issue.

2 participants