lovubuntu / checker-framework

Automatically exported from code.google.com/p/checker-framework
0 stars 0 forks source link

StubParser: unhandled annotation attribute type #264

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The nullness checker reports no errors for the attached java program, but if I 
rename it with the '.astub' extension and import it as a stub, the stub parser 
crashes:

$ javac -version -processor checkers.nullness.NullnessChecker 
-Astubs=Ensure.java.astub Ensure.java
javac 1.8.0-jsr308-1.6.7
error: StubParser: unhandled annotation attribute type: false class: class 
cfjapa.parser.ast.expr.BooleanLiteralExpr; invoke the compiler with 
-AprintErrorStack to see the stack trace.
error: InvocationTargetException when invoking constructor for class 
checkers.nullness.KeyForVisitor; Underlying cause: InvocationTargetException 
when invoking constructor for class 
checkers.nullness.KeyForAnnotatedTypeFactory; Underlying cause: StubParser: 
unhandled annotation attribute type: false class: class 
cfjapa.parser.ast.expr.BooleanLiteralExpr; invoke the compiler with 
-AprintErrorStack to see the stack trace.
2 errors

Are there plans to support the @EnsuresNonNullIf annotation in stubs?

Thanks!

Original issue reported on code.google.com by cus...@google.com on 12 Oct 2013 at 3:01

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the report. Looks like the StubParser didn't handle boolean literals 
in annotations in general.
This changeset should fix this:

https://code.google.com/p/checker-framework/source/detail?r=0e0193f8dc6f

Please let me know if this works as expected.

We don't have stub file test cases within the Checker Framework, only in 
dependent projects. It would be nice to extract a better test suite for the 
StubParser.

Original comment by wdi...@gmail.com on 12 Oct 2013 at 5:31

GoogleCodeExporter commented 9 years ago
Fixed in Checker Framework version 1.7.0

Original comment by michael.ernst@gmail.com on 24 Oct 2013 at 6:24