-
Notifications
You must be signed in to change notification settings - Fork 291
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
Support JDK 11 #259
Comments
Another issue here: WALA seems to fail on JDK 11:
|
This is mostly so that we can have a somewhat-functional NullAway on JDK 11 sooner (see #259). But also, removing a handler may give a small performance boost. With this change, you need to pass `-XepOpt:NullAway:JarInferEnabled=true` to enable JarInfer. Also, we separate out the JarInfer tests into their own module, so that there is no direct dependence from the `nullaway` module to the `jarinfer` libraries. This will enable us to get the `:nullaway:test` target passing on JDK 11 sooner.
For now, only the `:nullaway:test` target is passing on CI. We need to address issues outlined in #259 to get everything working, and it may be a while before the sample Android app can easily be built. That said, I think this initial level of support is useful and worth landing.
Did some digging here around what it would take to support running JarInfer on JDK 11. There are two issues:
FYI @lazaroclapp @kageiit |
I think code using UrlClassLoader is fine as we can just ignore classloaders which do not typecast safely. That said, the eventual plan is to rewrite jarinfer to embed stubs in jars along with bytecode instead of producing stub jars. We can probably have a switch to jarinfer to support both output jar/aar modes. |
@lazaroclapp thoughts here? |
Basically, I agree that the long term solution is bytecode rewriting to add the annotations, which further buys us Kotlin support automatically. As for the short term solutions, I see two options: add a check around that cast that will make that handler basically a no-op for Java 9 and above, or make code specific to Java 9+ to get the url out of a BuiltinClassLoader. The later seems doable by using reflection to access private fields (e.g. |
Ok that makes sense. It might be better to crash with a relevant message rather than no-op. The JarInfer handler is off by default now, so users would only see the crash if they opted into JarInfer. Even better would be the workaround via reflection. I’m fine with only supporting JDK 11 but not intermediate releases since it’s a temporary fix. |
current status? |
I think core NullAway should work fine on JDK 11. It's lesser-used features like JarInfer that are still being worked on. @lazaroclapp any other details? |
Any news related with Java 11 support? Recently, I tried to integrate NullAway with a small Java 11 project built with Gradle and it didn't work. I received errors during the build, but I don't have logs now. I can try to reproduce this situation later. |
Basic NullAway on Java 11 should work, we'd be happy to look at an issue here with a repo case. |
WIP at https://github.com/uber/NullAway/tree/ms/jdk-11. We should get the core NullAway functionality working first. Some notes:
The text was updated successfully, but these errors were encountered: