-
Notifications
You must be signed in to change notification settings - Fork 11k
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
Java 9 and Jigsaw compatibility #2571
Comments
Guava's usage of Unsafe always has a fallback if any problem occurs. On Wed, Sep 21, 2016 at 12:36 PM, Jonathan Bluett-Duncan <
Kevin Bourrillion | Java Librarian | Google, Inc. | [email protected] |
Yes, that's true actually! However, I think the fallbacks work on the assumption that sun.misc.Unsafe is a class which exists and which can be made accessible by reflection, which I believe has been "fixed" in Jigsaw by either removing sun.misc.Unsafe completely or moving it to a jdk-internal module which can only be accessed with a command-line argument. If I'm mistaken on this, then I'd be more than happy to be proved so. :) But despite all this, I still think it's important to test Guava against Java 9 and Jigsaw if it's not been done so already, in case there are other crucial areas where backwards-compatibility has been broken and would otherwise prevent open source Guava's uptake by Java 9 users in the future. |
Ah, I see. We'll be receptive to specific fix requests, but probably won't be able to put much thought into this ourselves until we get to the point of testing migrating ourselves to Java 9. (Bear in mind we finally successfully moved to Java 8 last week! But Java 9 should definitely be a quicker project.) |
Ah yes, I learned about your successful migration to Java 8 the other day. Congratulations! Going back to the subject of Java 9 though, you may very well be right about it being quicker to migrate to than Java 8. On one hand, it'll help that with the release of MRJARs, one can have build artifacts that continue to use internal APIs like com.sun.* on Java 8 but use officially supported replacements on Java 9+. But on the other hand, if there are places in Guava where com.sun.* is vital and Oracle have not provided sufficient replacement APIs, then Guava may end up being stuck on Java 8, which concerns me. I'm also concerned by how OpenJDK 9 has, at the time of writing of me writing this, gone past the Feature Complete milestone, which may make improving the replacement APIs difficult if needed. What are your thoughts on this @kevinb9n? Also, whereas I don't feel qualified enough to thoroughly test Guava against Java 9 & Jigsaw and to talk to Oracle in your stead (as I'm not familiar with all of Guava's intricacies), I am more than happy to run Guava against Java 9 and reply back to this issue if I discover anything. Would you be happy if I did this @kevinb9n? |
According to |
I just ran I also did a half-thorough search of the Guava non-test codebase, and it seems that @kevinb9n was actually right, and I was wrong! Although using So it seems this issue is actually not as urgent as I first thought it was! 😝 |
I also just ran through The main pain I encountered while doing this was that the tools used in the maven build can't handle Java 9 yet, so I can't actually make a build of it immediately. |
@kenzierocks Thanks for looking into that. So I suppose this would only be urgent then if Guava starts having users who try to compile the Guava sources or tests with JDK 9+ and they find that certain I also don't know enough to know exactly which classes have been planned for removal/module encapsulation in JDK 9 and which are just deprecated (jdeps doesn't seem to give me the whole picture here), so more research would be needed. |
The transition might be made even easier by the lexicographical |
I found this use of an internal JDK field which doesn't work on Java 9. b5b4b40#commitcomment-20536128 There's a fallback, but it just does nothing. Is that a problem? What goes wrong if we use the fallback? |
ClassLoader that loaded FinalizableReferenceQueue from being garbage-collected subsequently. This is Guava issue http://code.google.com/p/guava-libraries/issues/detail?id=92 ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=28624233
@eamonnmcmanus might know what we'd need to do. |
@cpovirk can you log a separate issue for that and assign it to me? |
Filed #2723 |
…n scheme: https://issues.apache.org/jira/browse/MJAVADOC-442 (part of #2571) ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158429834
FpUtils is going away in Java 9. We'd use Math under Java 7, too, but it's not present until Java 8. (part of #2571) ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158434703
(part of #2571) ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158475485
(part of #2571) ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158545119
(I got confused when I added an argLine in the parent pom (as part of Java 9 testing) and found it had no effect, apparently because it's overwritten in the child.) (part of #2571) ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158738701
Apparently 2.8.40 is out, but currently we're internally upgrading to 2.7.19, so that seems like the safest thing to target. (But I'm sure we'll get to 2.8.40 or later eventually, so maybe I'm wasting time bothering with 2.7.19....) (part of #2571) ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158745717
(part of #2571) ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158747678
Under previous JDKs, we continue to output "java.util.Map.java.util.Map.Entry," just as those JDKs do. (part of #2571) ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=159237707
Filed #2920 |
(I'm already assigned on #2723 and I don't think I'm otherwise involved here.) |
(SGTM, @eamonnmcmanus. Many thanks in advance!) |
@netdpb did a bunch of work here after I stopped, and it's been released in 23.1. Remaining:
I don't believe there's anything to do with Let's track remaining work with the separate bugs. Please open more if you encounter more problems. |
(followup to CL 158434703 to make the Android tests runnable under Java 9) (part of #2571) ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=172804202
…and deprecate JAVA_EXT_DIRS. value()'s return type has been @nullable since 4232450, but I had forgotten the details about why, despite past CLs to update the test for specific missing keys. I assume that we'll never actually *remove* JAVA_EXT_DIRS. (Just slightly relevant to #2571) RELNOTES=`base`: Deprecated `StandardSystemProperty.JAVA_EXT_DIRS`. We do not plan to remove the API, but in recent versions of Java, that property always has a value of `null`. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=345251412
…and deprecate JAVA_EXT_DIRS. value()'s return type has been @nullable since 4232450, but I had forgotten the details about why, despite past CLs to update the test for specific missing keys. I assume that we'll never actually *remove* JAVA_EXT_DIRS. (Just slightly relevant to #2571) RELNOTES=`base`: Deprecated `StandardSystemProperty.JAVA_EXT_DIRS`. We do not plan to remove the API, but in recent versions of Java, that property always has a value of `null`. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=345251412
I wasn't able to find an issue for this, so apologies if this has been raised already.
Has Guava been tested with any of the early-access Java 9 and/or Jigsaw releases yet?
If not, this seems to be a pretty important medium-to-long-term thing to look into, as Guava currently uses sun.misc.Unsafe in a number of places, which by my understanding would prevent Guava from being used in Jigsaw-enabled versions of Java, including Java 9.
The text was updated successfully, but these errors were encountered: