-
Notifications
You must be signed in to change notification settings - Fork 394
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
predictNullPointerExceptions is enabled when not optimizing aggressively #374
Comments
Thank you for reporting this. You should be able to work around this by disabling optimization for the affected method(s), i.e.:
|
Thank you for your answer. As we have a very large application, this happens in many hundreds of places. This workaround would require a lot of time to implement, and developers would have to think about ProGuard optimization when they write code. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After upgrading from 7.2 to 7.4.1, we notice the generation of
throw new NullPointerException()
for statements that use a field injected by Spring DI.Commit 3445fa0 shows how the
predictNullPointerExceptions
feature is introduced. Apparently,predictNullPointerExceptions
is set to true when not optimizing aggressively, and is omitted when you do optimize aggressively.This seems counterintuitive. We don't want aggresive optimization, but these incorrect
throw new NullPointerException()
statements make our application crash.Our only way forward now is to don't optimize anything with
-dontoptimize
? 🤷The text was updated successfully, but these errors were encountered: