-
Notifications
You must be signed in to change notification settings - Fork 745
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
NullPointerException when using matcher in Refaster since 2.16 #3484
Comments
Thanks, and sorry. (I added that null check....) I believe @nick-someone has been looking at an internal report we just got about this a couple days ago. |
copybara-service bot
pushed a commit
that referenced
this issue
Oct 14, 2022
PiperOrigin-RevId: 481211730
copybara-service bot
pushed a commit
that referenced
this issue
Oct 14, 2022
PiperOrigin-RevId: 481216285
(The above change by @cushon works around this. I don't know if he has plans to go further at this point.) |
Not at the moment :) |
sosy-bot
pushed a commit
to sosy-lab/cpachecker
that referenced
this issue
Dec 16, 2022
Somehow the NullPointerException that we previously only saw with Error Prone 2.16 (google/error-prone#3484) has now started to appear with Error Prone 2.15 as well. We will wait for Error Prone 2.17 and then try again. This is not critical as Refaster suggestions come with a patch, so even if lots of issues are introduced in the meantime, we can easily fix them all automatically later on. git-svn-id: https://svn.sosy-lab.org/software/cpachecker/trunk@42571 4712c6d2-40bb-43ae-aa4b-fec3f1bdfe4c
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have the following Refaster rule that produces a
NullPointerException
when being applied to one of our projects with Error Prone 2.16, but not with 2.15.0:The compiled version of this rule that I am using is in rule.zip.
I am using OpenJDK 11.0.16 on Ubuntu 22.04, as mentioned with Error Prone 2.16.
The stack trace is
The crash does not occur if I remove
@Matches(CompileTimeConstantExpressionMatcher.class)
. We have other (working) rules with@Matches
, so maybe it is related only toCompileTimeConstantExpressionMatcher
?Unfortunately, it is hard to debug further because I do not know a way how to find out which of our 2800 Java files causes this. If I run the compiler with verbose=true, the last lines before the crash are
However, it does not seem as if
VariableClassificationBuilder
is the problematic class because the crash still occurs if I delete basically all source code from this class except for empty methods. The annotationCompileTimeConstant
is not used in our code base (but maybe in libraries).So if you have some hints on what could I do to find out the problematic source code, I would be happy to debug this further.
Alternatively, here is how this could be reproduced locally:
sed -e 's/2\.15\.0/2.16/' -i lib/ivy.xml
ant refaster -Drefaster.rule.file=rule.refaster
(this will download all required build dependencies including Error Prone 2.16).lib/java/build/
can be replaced if-Divy.disable=true
is passed toant
after the first time (otherwiseant
will overwrite the JARs again).If there is anything else I could do to help debugging this, please let me know.
The text was updated successfully, but these errors were encountered: