-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
ArC - improve error message when annotation default value cannot be read #1838
Conversation
mkouba
commented
Apr 3, 2019
- resolves NPE from ArcAnnotationProcessor when default value() is used #1832
@sarxos I hope the updated error message is a little bit more clear ;-) |
retValue = loadValue(valueMethod, value, annotationClass, method); | ||
throw new NullPointerException(String.format( | ||
"Value is not set for %s.%s(). Most probably an older version of Jandex was used to index an application dependency. Make sure that Jandex 2.1+ is used.", | ||
method.declaringClass().name(), method.name())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we don't need to handle the primitive case anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do handle primitives in AnnotationLiteralGenerator.loadValue()
. I've just removed the part which sets the values to the default JLS values - this wouldn't help much and the produced literal would be incorrect.
@sarxos Could pls you verify the re-indexing fallback works? |
Sure, let me checkout this PR. |
I confirm. Re-indexing fallback works as expected. Before your patchset has been applied all my tests were failing. After patchset was applied all my tests passed. I also observed warning you included in a
👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes indexing issue. 👍
@sarxos Thanks for verification ;-) |
Merged, thanks! |