-
Notifications
You must be signed in to change notification settings - Fork 749
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
error_prone_core 2.0.6 adds Objects.requireNonNull() to source (which can crash Android) #375
Comments
Are you compiling with Older versions of javac generate code for null-checks using |
Technically Android runs on 6, but we're actually compiling java8 with retrolambda for backporting. It looks like we'll have to stick with the older javac for the time being. |
I think this issue prevents anyone from compiling against JDK9 and using retrolambda to run on JDK < 7, so I filed a bug: luontola/retrolambda#75 |
Cool, thanks. I'm going to close this in the meantime, since it's not directly an error-prone issue. |
This happens even when not using retrolambda. Specifically this line Will make it so that cc @cushon Can we get this fixed in error-prone-javac or consider making this an option? |
This is happening on error prone 2.0.15 |
This is only an issue when not using retrolambda, right?
This change was made to OpenJDK 9, it is not specific to Error Prone: http://hg.openjdk.java.net/jdk9/jdk9/langtools/file/804b6a348702/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java#l124 |
Yes, but when using jdk8 from oracle, its not a problem. JDK 9 is not available from oracle yet. Yes it is an issue when not using retrolamdba. Which means we cannot use error prone on android without using retrolambda, which is not ideal |
We had to patch I think it would be great if we could fix it in error-prone's javac fork so android projects can continue using error prone. cc @tbroyer |
I'll add a flag to turn it off. I don't want to disable it by default, because using Re: invokeDynamic, are you sure that's necessary? |
InvokeDynamic is not necessary |
What version of Echoing what @kageitt mentioned, when we were investigating this issue we chose to patch on top of |
@cushon great! thanks for adding the option. How can one use this option in the javac invocation? |
|
got it. thanks! We tried out the snapshot and it works as intended |
The fix has been released in 2.0.16. |
I've been using the error-prone compiler for my Android application.
java.util.Objects
was only added recently to Android (API 19). The most recent version of error_prone_core (2.0.6) can addObjects.requireNonNull()
to the source, which causes the Android app to crash if run on an older device.I haven't been able to track down exactly how this happens; I'm not super familiar with error-prone's internals.
I've been using error-prone via the gradle-errorprone-plugin for Android builds. By default it pulls in the latest error_prone_core for use. As a workaround you can force it to use 2.0.5.
As an aside, the stack traces that result are quite mystifying since the source will contain no references to
java.util.Objects
. For example:...Where
StarredBoardsSync
didn't even importjava.util.Objects
in the original source.The text was updated successfully, but these errors were encountered: