-
Notifications
You must be signed in to change notification settings - Fork 11k
Figure out when to require Java 11 for new Guava versions #6614
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
Comments
I think I failed to actually mention the new "note I wanted to make about this," which was:
|
Notes: - The GWT bump requires changing the browser setting from "FF38" to "FF." - I skipped the `jsinterop-annotations` bump to 2.1.0 because it's built with `-target 11`, while we still support 8. (Closes #1147) (I've noted this in google/guava#6614) - The command I used is: ``` mvn org.codehaus.mojo:versions-maven-plugin:2.16.0:{update-properties,use-latest-releases} -DgenerateBackupPoms=false -Dexcludes=com.google.guava:guava ``` That tried to update protobuf to a release candidate. I had thought that perhaps this was the result of [a protobuf change from "-rc1" to "-rc-1"](protocolbuffers/protobuf#6522), but I'm wondering if it's actually just that `versions-maven-plugin` (in contrast to Dependabot) counts release candidates [as releases](https://www.mojohaus.org/versions/versions-maven-plugin/use-latest-releases-mojo.html)? I'd have to investigate further and perhaps [use `rulesUri`](https://stackoverflow.com/a/46935363/28465). But since we normally rely on Dependabot (and I was using `versions-maven-plugin` here only "to make things easier"... :)), I'm not going to worry about it now.
Notes: - The GWT bump requires changing the browser setting from "FF38" to "FF." - I skipped the `jsinterop-annotations` bump to 2.1.0 because it's built with `-target 11`, while we still support 8. (Closes #1147) (I've noted this in google/guava#6614) - The command I used is: ``` mvn org.codehaus.mojo:versions-maven-plugin:2.16.0:{update-properties,use-latest-releases} -DgenerateBackupPoms=false -Dexcludes=com.google.guava:guava ``` That tried to update protobuf to a release candidate. I had thought that perhaps this was the result of [a protobuf change from "-rc1" to "-rc-1"](protocolbuffers/protobuf#6522), but I'm wondering if it's actually just that `versions-maven-plugin` (in contrast to Dependabot) counts release candidates [as releases](https://www.mojohaus.org/versions/versions-maven-plugin/use-latest-releases-mojo.html)? I'd have to investigate further and perhaps [use `rulesUri`](https://stackoverflow.com/a/46935363/28465). But since we normally rely on Dependabot (and I was using `versions-maven-plugin` here only "to make things easier"... :)), I'm not going to worry about it now. ... Also, it looks like protobuf 4 might remove the `hasPresence()` method that we'd migrated to back in cl/508716698. If so, there's a good chance that the protobuf team will fix things for us :) If not, I'm assuming that this will relate to ["Editions."](https://protobuf.dev/editions/overview/)
Notes: - The GWT bump requires changing the browser setting from "FF38" to "FF." - I skipped the `jsinterop-annotations` bump to 2.1.0 because it's built with `-target 11`, while we still support 8. (Closes #1147) (I've noted this in google/guava#6614) - The command I used is: ``` mvn org.codehaus.mojo:versions-maven-plugin:2.16.0:{update-properties,use-latest-releases} -DgenerateBackupPoms=false -Dexcludes=com.google.guava:guava ``` That tried to update protobuf to a release candidate. I had thought that perhaps this was the result of [a protobuf change from "-rc1" to "-rc-1"](protocolbuffers/protobuf#6522), but I'm wondering if it's actually just that `versions-maven-plugin` (in contrast to Dependabot) counts release candidates [as releases](https://www.mojohaus.org/versions/versions-maven-plugin/use-latest-releases-mojo.html)? I'd have to investigate further and perhaps [use `rulesUri`](https://stackoverflow.com/a/46935363/28465). But since we normally rely on Dependabot (and I was using `versions-maven-plugin` here only "to make things easier"... :)), I'm not going to worry about it now. ... Also, it looks like protobuf 4 might remove the `hasPresence()` method that we'd migrated to back in cl/508716698. If so, there's a good chance that the protobuf team will fix things for us :) If not, I'm assuming that this will relate to ["Editions."](https://protobuf.dev/editions/overview/) Fixes #1149 Fixes #1148 Fixes #1146 Fixes #1145
It turns out that the latest release of jsinterop-annotations is built to require Java 11. That said:
|
Notes: - The GWT bump requires changing the browser setting from "FF38" to "FF." - I skipped the `jsinterop-annotations` bump to 2.1.0 because it's built with `-target 11`, while we still support 8. (Closes #1147) (I've noted this in google/guava#6614) - The command I used is: ``` mvn org.codehaus.mojo:versions-maven-plugin:2.16.0:{update-properties,use-latest-releases} -DgenerateBackupPoms=false -Dexcludes=com.google.guava:guava ``` That tried to update protobuf to a release candidate. I had thought that perhaps this was the result of [a protobuf change from "-rc1" to "-rc-1"](protocolbuffers/protobuf#6522), but I'm wondering if it's actually just that `versions-maven-plugin` (in contrast to Dependabot) counts release candidates [as releases](https://www.mojohaus.org/versions/versions-maven-plugin/use-latest-releases-mojo.html)? I'd have to investigate further and perhaps [use `rulesUri`](https://stackoverflow.com/a/46935363/28465). But since we normally rely on Dependabot (and I was using `versions-maven-plugin` here only "to make things easier"... :)), I'm not going to worry about it now. ... Also, it looks like protobuf 4 might remove the `hasPresence()` method that we'd migrated to back in cl/508716698. If so, there's a good chance that the protobuf team will fix things for us :) If not, I'm assuming that this will relate to ["Editions."](https://protobuf.dev/editions/overview/) Fixes #1149 Fixes #1148 Fixes #1146 Fixes #1145 Fixes #1150 RELNOTES=n/a PiperOrigin-RevId: 550553262
Notes: - The GWT bump requires changing the browser setting from "FF38" to "FF." - I skipped the `jsinterop-annotations` bump to 2.1.0 because it's built with `-target 11`, while we still support 8. (Closes #1147) (I've noted this in google/guava#6614) - The command I used is: ``` mvn org.codehaus.mojo:versions-maven-plugin:2.16.0:{update-properties,use-latest-releases} -DgenerateBackupPoms=false -Dexcludes=com.google.guava:guava ``` That tried to update protobuf to a release candidate. I had thought that perhaps this was the result of [a protobuf change from "-rc1" to "-rc-1"](protocolbuffers/protobuf#6522), but I'm wondering if it's actually just that `versions-maven-plugin` (in contrast to Dependabot) counts release candidates [as releases](https://www.mojohaus.org/versions/versions-maven-plugin/use-latest-releases-mojo.html)? I'd have to investigate further and perhaps [use `rulesUri`](https://stackoverflow.com/a/46935363/28465). But since we normally rely on Dependabot (and I was using `versions-maven-plugin` here only "to make things easier"... :)), I'm not going to worry about it now. ... Also, it looks like protobuf 4 might remove the `hasPresence()` method that we'd migrated to back in cl/508716698. If so, there's a good chance that the protobuf team will fix things for us :) If not, I'm assuming that this will relate to ["Editions."](https://protobuf.dev/editions/overview/) Fixes #1149 Fixes #1148 Fixes #1146 Fixes #1145 Fixes #1150 RELNOTES=n/a PiperOrigin-RevId: 550560426
Java 11 brought nestmates, which would let us make fields like this one Admittedly, making nested classes' members Anyway, the point here is that we'd pick up this improvement (and others, like better string concatenation) if we didn't have to target Java 8. (Hmm, I guess we could theoretically provide a multi-release jar with the exact same classes built for both versions, just with different (I was tempted to add that we could consider targeting a newer version of Java for guava-android, since newer bytecode gets converted to Android bytecode that supports even old versions of Android. But of course we say that guava-android is usable under a JVM, too, so that wouldn't work.) |
Other potentially nice things for the future:
(As always, we'd want to keep in mind that we also still target Android, including fairly old versions, so we might not want to make at least some changes until we can make them there, too.) |
I learned yesterday that nestmates also enable runtime access through |
More notes: Historically, one reason that we've maintained support for Java 8 is the Google Cloud Client Libraries. The documentation for those libraries currently says: I'm not sure how much we've pushed on the idea that those libraries could stick with an older version of Guava if Guava were to drop support for Java 8 before Cloud did. I would expect that approach to work well in practice for Cloud users, but I could imagine that some users would have reservations about running with a newer version of Guava than the one that Cloud recommends, and that may be enough to stop the idea. Anyway, the reason that I'm thinking about this yet again is that the majority of my week is going to reworking our nullness annotations to work better with Java 8 (e.g., #7566). That's turned what should have been a straightforward update of https://github.com/google/guava/tree/jspecify-preview into a Project. |
Whenever we do do this, Cloud (and others) may want us to bump our major version. It's left a bit up in the air in https://opensource.google/documentation/policies/library-breaking-change. Additionally, that policy refers to "vendor support," which can mean a lot of things in the context of Java (and something else in the context of Cloud). It's something for us to look into. |
I see a variety of "implementationy" advantages, but the bigger issue is that Guava public APIs are unable to reference any new library types, so they're unable to provide the best level of service to clients who are on the newer versions. SequencedCollection is a fine enough example of this. I suspect that mr-jars aren't going to be an easy way out of this. It would be useful if we could push on "okay, what does happen if Guava 34.0 requires Java 21 (or even 17, or even 11)?" There has to be a solution that involves certain users and certain ecosystems simply getting pinned to Guava 33 for a while and living with the pain of that. Otherwise, how would it ever be possible? Does anyone at G feel like fleshing out that picture? |
My feeling has been that the API needs just haven't been that big. For pure additions, we also have the option to put whatever we want in another class: There's nothing to stop us from adding I hope to have a better picture of what users want as Google and other Guava users continue to get experience with Java 21 and higher. |
Is there ever a world where Guava updates the required Java, and changes the artifact coordinates + the package names together with that to allow people migrating from one to the other explicitly, perhaps with an intermediary interval in between where applications could have both on their classpath? Or do we consider Guava to be so widespread that such a migration is unlikely to ever happen? Jackson, for one, is preparing to do such a release. With the current Guava being ... stable, can you imagine a world with a new major release where the old branch would still get occasional security updates, but the development would shift to the new world? Quite a lot could potentiall be dropped at that point, and even more could be possibly added. I imagine such a project would have to be business-driven, though, and that sounds unlikely :) |
LoOoOoL, were it not for the size increase, I would not have taken a closer look 😆 Picking a single class at random:
I thought it was a packaging problem, but then:
showed differences which with
i.e. taking advantage of JDK9+ string concatenation, so I thought this was intentional 😄 So yeah, I have 33.4.4 slated for next round of upgrades just because it gets rid of JSR305, but was holding back the upgrade to 33.4.5 to mull over the cost/benefit part of it. #7732 has the potential to being an issue we'd hit right after that. Overall though, I think this goes to reinforce my point above: providing a |
A data point: the packaging in 33.4.5 is equivalent, but JDK9+ classes are ~.44% larger:
|
Thinking about this issue a bit more: let's assume we have IFF that is the case, it should not be a API compatibility problem for With that assumption, it would be relatively easy (yeah, it is not me who does that! 😄) to provide both forward- and backward-compatibility by:
I think the forward-compatibility part provided by 1., i.e. an efficient |
I would like to point out that while the discussion so far has revolved around
we should also consider Java 17 being a major milestore due to sealed classes, which renders quite a bit of code around |
(lots more to follow up on here, but as for fixing #6614 (comment)...) I've been trying to understand how our exclusion for the extra files isn't working. And I think I've figured it out: I don't think we're actually using I'm not immediately seeing a way to exclude files in its configuration. Maybe we could instead delete the files entirely (which, for all I know, might also lead to more accurate testing or something, should some tests try to use the directory of class files instead of the jar (somewhat unlikely for Guava, whose tests live in a separate Maven module)??). Or we could modify the bundle afterward. Or maybe we could produce the OSGi configuration ourselves in some other way. Or we could try something else I've speculated about for performance reasons: We could try to compile fewer files during the second (i.e., modular / Java 9). We might pick a standalone file from each package (e.g., And actually, to my surprise, it looks like we may be able to restrict the compilation to only So I think I have a solution. |
We need to compile Guava twice: - once to build the actual classes with `-source 8` (to maintain Java 8 compatibility) - once to build `module-info`, which requires `-source 9` and thus is incompatible with the "main" build I had been under the mistaken impression that the latter compile still needed to pass all the sources. As a result, we had the second compile build `module-info` _and_ all the classes. We then had configuration in `maven-jar-plugin` to ignore the other classes. But the `maven-jar-plugin` configuration doesn't help because we're using `maven-bundle-plugin` instead, at least for the `guava` itself. (I didn't look into `guava-testlib`, `guava-gwt`, or the tests of any module, though note that (IIRC) the only other one that's modularized (and thus might benefit from our module-related `maven-jar-plugin` configuration) is `guava-testlib`.) Luckily, it turns out that we _can_ compile `module-info` by itself. So now the build does that. See #6614 (comment) RELNOTES=Removed the extra copy of each class from the Guava jar. PiperOrigin-RevId: 740005364
We need to compile Guava twice: - once to build the actual classes with `-source 8` (to maintain Java 8 compatibility) - once to build `module-info`, which requires `-source 9` and thus is incompatible with the "main" build I had been under the mistaken impression that the latter compile still needed to pass all the sources. As a result, we had the second compile build `module-info` _and_ all the classes. We then had configuration in `maven-jar-plugin` to ignore the other classes. But the `maven-jar-plugin` configuration doesn't help because we're using `maven-bundle-plugin` instead, at least for the `guava` itself. (I didn't look into `guava-testlib`, `guava-gwt`, or the tests of any module, though note that (IIRC) the only other one that's modularized (and thus might benefit from our module-related `maven-jar-plugin` configuration) is `guava-testlib`.) Luckily, it turns out that we _can_ compile `module-info` by itself. So now the build does that. (Also, bump `maven-jar-plugin` while in the area.) See #6614 (comment) RELNOTES=Removed the extra copy of each class from the Guava jar. The extra copies were an accidental addition from the modularization work in [Guava 33.4.5](https://github.com/google/guava/releases/tag/v33.4.5). PiperOrigin-RevId: 740005364
We need to compile Guava twice: - once to build the actual classes with `-source 8` (to maintain Java 8 compatibility) - once to build `module-info`, which requires `-source 9` and thus is incompatible with the "main" build I had been under the mistaken impression that the latter compile still needed to pass all the sources. As a result, we had the second compile build `module-info` _and_ all the classes. We then had configuration in `maven-jar-plugin` to ignore the other classes. But the `maven-jar-plugin` configuration doesn't help because we're using `maven-bundle-plugin` instead, at least for the `guava` itself. (I didn't look into `guava-testlib`, `guava-gwt`, or the tests of any module, though note that (IIRC) the only other one that's modularized (and thus might benefit from our module-related `maven-jar-plugin` configuration) is `guava-testlib`.) Luckily, it turns out that we _can_ compile `module-info` by itself. So now the build does that. (Also, bump `maven-jar-plugin` while in the area.) See #6614 (comment) RELNOTES=Removed the extra copy of each class from the Guava jar. The extra copies were an accidental addition from the modularization work in [Guava 33.4.5](https://github.com/google/guava/releases/tag/v33.4.5). PiperOrigin-RevId: 740005364
Coming back to the other stuff:
|
Sorry, I didn't meant |
...didn't mean to publish my comment or close this, sorry.... More to come shortly. |
|
We need to compile Guava twice: - once to build the actual classes with `-source 8` (to maintain Java 8 compatibility) - once to build `module-info`, which requires `-source 9` and thus is incompatible with the "main" build I had been under the mistaken impression that the latter compile still needed to pass all the sources. As a result, we had the second compile build `module-info` _and_ all the classes. We then had configuration in `maven-jar-plugin` to ignore the other classes. But the `maven-jar-plugin` configuration doesn't help because we're using `maven-bundle-plugin` instead, at least for the `guava` itself. (I didn't look into `guava-testlib`, `guava-gwt`, or the tests of any module, though note that (IIRC) the only other one that's modularized (and thus might benefit from our module-related `maven-jar-plugin` configuration) is `guava-testlib`.) Luckily, it turns out that we _can_ compile `module-info` by itself. So now the build does that. (Also, bump `maven-jar-plugin` while in the area.) See #6614 (comment) RELNOTES=Removed the extra copy of each class from the Guava jar. The extra copies were an accidental addition from the modularization work in [Guava 33.4.5](https://github.com/google/guava/releases/tag/v33.4.5). PiperOrigin-RevId: 740019355
ah, so I would suggest taking a look at |
Nice, thanks. It looks like #7741 worked OK, so I'll probably stick with that for now. But if we have more problems, I'll try to remember to look at moving over to |
We need to compile Guava twice: - once to build the actual classes with `-source 8` (to maintain Java 8 compatibility) - once to build `module-info`, which requires `-source 9` and thus is incompatible with the "main" build I had been under the mistaken impression that the latter compile still needed to pass all the sources. As a result, we had the second compile build `module-info` _and_ all the classes. We then had configuration in `maven-jar-plugin` to ignore the other classes. But the `maven-jar-plugin` configuration doesn't help because we're using `maven-bundle-plugin` instead, at least for the `guava` itself. (I didn't look into `guava-testlib`, `guava-gwt`, or the tests of any module, though note that (IIRC) the only other one that's modularized (and thus might benefit from our module-related `maven-jar-plugin` configuration) is `guava-testlib`.) Luckily, it turns out that we _can_ compile `module-info` by itself. So now the build does that. (Also, bump `maven-jar-plugin` while in the area.) See #6614 (comment) RELNOTES=Removed the extra copy of each class from the Guava jar. The extra copies were an accidental addition from the modularization work in [Guava 33.4.5](https://github.com/google/guava/releases/tag/v33.4.5). PiperOrigin-RevId: 740019355
Nearly all access should be performed through the various methods (e.g., `casListeners(...)`, `listeners()`). In fact, we could be principled and perform _all_ access through those methods (except of course for within the implementations of those methods themselves). I haven't done that here just out of fear that it will somehow affect performance or cause stack overflows. Accidental usage has been something that I've historically worried about in, e.g., `AbstractFuture.set(V value)`, whose parameter has had the same name as a field. That _particular_ example matters less at the moment because the field recently became `private` to a new superclass, `AbstractFutureState`, and so it's not accessible in the subclass `AbstractFuture`. But it's going to matter again: I'm likely to make the fields package-private as part of [work to migrate `guava-android` off `Unsafe`](#7742). Currently, the fields can be `private` because we call `MethodHandles.lookup()` from within `AbsractFutureState`. (Yes, it would initially seem that [we shouldn't have to](https://github.com/google/guava/blob/c7363f7fb40698bb5f99d198cc45884f38642f86/guava/src/com/google/common/util/concurrent/AbstractFutureState.java#L612-L632), but we do.) But that requires `AbstractFutureState` to refer to `MethodHandles.Lookup` in one of its method signatures\[*\], and that makes old versions of Android upset. To avoid that, I will make `value` package-private, at which point I won't need the `MethodHandles.Lookup` reference in `AbstractFutureState` itself. And when I tried making `value` package-private, _one test_ started to fail. It should have taken me less time to figure out, but I eventually discovered that the problem was that [the test refers to "`value`" inside an `AbstractFuture` subclass](https://github.com/google/guava/blob/c7363f7fb40698bb5f99d198cc45884f38642f86/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java#L78). Previously, this referred to the local variable `value` from the test method; with my change, it was instead referring to the `value` field. (I wouldn't have to have gone down the road of making the field non-`private` in the first place [if not for Java 8 compatibility](#6614 (comment)).... Still, as discussed above, this rename could protect against problems _within_ the file, too, and such problems could arise even if the field were to remain `private`.) \[*\] Or maybe I could declare the method as returning `Object` instead of `MethodHandles.Lookup`, and the caller could cast it back? But we found during [our `SequencedCollection` work](#6903) that Android (and I think maybe the JVM, but I can't find my record of this) can produce a `VerifyError` in some cases in which _implementation_ code refers to an unknown type, I think specifically when it needs to check whether a `return someThingOfTypeFoo` from that method is compatible with the return type `Bar` of the method. We _might_ be able to work around that by performing an explicit, "redundant" cast to `Object`, but I'm not even sure how to get javac to do that, and it feels very fragile, especially in the presence of optimization/minification tools. RELNOTES=n/a PiperOrigin-RevId: 741511657
Nearly all access should be performed through the various methods (e.g., `casListeners(...)`, `listeners()`). In fact, we could be principled and perform _all_ access through those methods (except of course for within the implementations of those methods themselves). I haven't done that here just out of fear that it will somehow affect performance or cause stack overflows. Accidental usage has been something that I've historically worried about in, e.g., `AbstractFuture.set(V value)`, whose parameter has had the same name as a field. That _particular_ example matters less at the moment because the field recently became `private` to a new superclass, `AbstractFutureState`, and so it's not accessible in the subclass `AbstractFuture`. But it's going to matter again: I'm likely to make the fields package-private as part of [work to migrate `guava-android` off `Unsafe`](#7742). Currently, the fields can be `private` because we call `MethodHandles.lookup()` from within `AbsractFutureState`. (Yes, it would initially seem that [we shouldn't have to](https://github.com/google/guava/blob/c7363f7fb40698bb5f99d198cc45884f38642f86/guava/src/com/google/common/util/concurrent/AbstractFutureState.java#L612-L632), but we do.) But that requires `AbstractFutureState` to refer to `MethodHandles.Lookup` in one of its method signatures\[*\], and that makes old versions of Android upset. To avoid that, I will make `value` package-private, at which point I won't need the `MethodHandles.Lookup` reference in `AbstractFutureState` itself. And when I tried making `value` package-private, _one test_ started to fail. It should have taken me less time to figure out, but I eventually discovered that the problem was that [the test refers to "`value`" inside an `AbstractFuture` subclass](https://github.com/google/guava/blob/c7363f7fb40698bb5f99d198cc45884f38642f86/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java#L78). Previously, this referred to the local variable `value` from the test method; with my change, it was instead referring to the `value` field. (I wouldn't have to have gone down the road of making the field non-`private` in the first place [if not for Java 8 compatibility](#6614 (comment)).... Still, as discussed above, this rename could protect against problems _within_ the file, too, and such problems could arise even if the field were to remain `private`.) \[*\] Or maybe I could declare the method as returning `Object` instead of `MethodHandles.Lookup`, and the caller could cast it back? But we found during [our `SequencedCollection` work](#6903) that Android (and I think maybe the JVM, but I can't find my record of this) can produce a `VerifyError` in some cases in which _implementation_ code refers to an unknown type, I think specifically when it needs to check whether a `return someThingOfTypeFoo` from that method is compatible with the return type `Bar` of the method. We _might_ be able to work around that by performing an explicit, "redundant" cast to `Object`, but I'm not even sure how to get javac to do that, and it feels very fragile, especially in the presence of optimization/minification tools. RELNOTES=n/a PiperOrigin-RevId: 741511657
Nearly all access should be performed through the various methods (e.g., `casListeners(...)`, `listeners()`). In fact, we could be principled and perform _all_ access through those methods (except of course for within the implementations of those methods themselves). I haven't done that here just out of fear that it will somehow affect performance or cause stack overflows. Accidental usage has been something that I've historically worried about in, e.g., `AbstractFuture.set(V value)`, whose parameter has had the same name as a field. That _particular_ example matters less at the moment because the field recently became `private` to a new superclass, `AbstractFutureState`, and so it's not accessible in the subclass `AbstractFuture`. But it's going to matter again: I'm likely to make the fields package-private as part of [work to migrate `guava-android` off `Unsafe`](#7742). Currently, the fields can be `private` because we call `MethodHandles.lookup()` from within `AbsractFutureState`. (Yes, it would initially seem that [we shouldn't have to](https://github.com/google/guava/blob/c7363f7fb40698bb5f99d198cc45884f38642f86/guava/src/com/google/common/util/concurrent/AbstractFutureState.java#L612-L632), but we do.) But that requires `AbstractFutureState` to refer to `MethodHandles.Lookup` in one of its method signatures\[*\], and that makes old versions of Android upset. To avoid that, I will make `value` package-private, at which point I won't need the `MethodHandles.Lookup` reference in `AbstractFutureState` itself. And when I tried making `value` package-private, _one test_ started to fail. It should have taken me less time to figure out, but I eventually discovered that the problem was that [the test refers to "`value`" inside an `AbstractFuture` subclass](https://github.com/google/guava/blob/c7363f7fb40698bb5f99d198cc45884f38642f86/guava-tests/test/com/google/common/util/concurrent/AbstractFutureTest.java#L78). Previously, this referred to the local variable `value` from the test method; with my change, it was instead referring to the `value` field. (I wouldn't have to have gone down the road of making the field non-`private` in the first place [if not for Java 8 compatibility](#6614 (comment)).... Still, as discussed above, this rename could protect against problems _within_ the file, too, and such problems could arise even if the field were to remain `private`.) \[*\] Or maybe I could declare the method as returning `Object` instead of `MethodHandles.Lookup`, and the caller could cast it back? But we found during [our `SequencedCollection` work](#6903) that Android (and I think maybe the JVM, but I can't find my record of this) can produce a `VerifyError` in some cases in which _implementation_ code refers to an unknown type, I think specifically when it needs to check whether a `return someThingOfTypeFoo` from that method is compatible with the return type `Bar` of the method. We _might_ be able to work around that by performing an explicit, "redundant" cast to `Object`, but I'm not even sure how to get javac to do that, and it feels very fragile, especially in the presence of optimization/minification tools. RELNOTES=n/a PiperOrigin-RevId: 741607075
By keeping them `private`, we've mostly been making our lives more complicated, as discussed in cl/741607075. Currently, that would complicate using `VarHandle` in `guava-android`, and that would in turn complicate [our migration off `Unsafe`](#7742). (But then making them _package-private_ complicated things too, as seen in cl/742311780....) This CL continues the trend of work that is necessary [only because of Java 8 compatibility](#6614 (comment)). RELNOTES=n/a PiperOrigin-RevId: 741607263
By keeping them `private`, we've mostly been making our lives more complicated, as discussed in cl/741607075. Currently, that would complicate using `VarHandle` in `guava-android`, and that would in turn complicate [our migration off `Unsafe`](#7742). (But then making them _package-private_ complicated things too, as seen in cl/742311780....) This CL continues the trend of work that is necessary [only because of Java 8 compatibility](#6614 (comment)). RELNOTES=n/a PiperOrigin-RevId: 741607263
By keeping them `private`, we've mostly been making our lives more complicated, as discussed in cl/741607075. Currently, that would complicate using `VarHandle` in `guava-android`, and that would in turn complicate [our migration off `Unsafe`](#7742). (But then making them _package-private_ complicated things too, as seen in cl/742311780....) This CL continues the trend of work that is necessary [only because of Java 8 compatibility](#6614 (comment)). RELNOTES=n/a PiperOrigin-RevId: 742334547
Probably not soon :) I just had another note I wanted to make about this, so now seems like the time to start collecting those notes.
VarHandle
and forProcessHandle
in From Guava 32.0.1-jre, Files.createTempDir() and FileBackedOutputStream can fail or create un-deletable directories/files when used from a Windows service #6634]The text was updated successfully, but these errors were encountered: