Skip to content

Remove ClassValue implementation of Futures.getChecked from the Android flavor. - #5693

Closed
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_391758063
Closed

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_391758063

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Aug 19, 2021 •

Copy link
Copy Markdown
Contributor

Remove ClassValue implementation of Futures.getChecked from the Android flavor.

It doesn't work there, even under new versions of Android, so it always triggers fallback, and the process of falling back burns resources and produces noise.

(JRE users of guava-android could benefit from the ClassValue implementation, but now that we're dropping support for Java 7 from guava-android, there's no reason for them to use it. OK, probably some users run Robolectric tests against guava-android. But presumably they aren't too sensitive to the performance of getChecked in the failure case.)

Removing ClassValue support also lets us remove a bunch of Animal-Sniffer cruft. That includes upgrading it to 1.19, which in turn forces us to remove some usages of new APIs from our tests -- not nearly as important as usages in prod but still a good idea so that any future Android test failures are reported to us correctly instead of hidden by NoSuchMethodError or similar. Or actually, Animal-Sniffer 1.20 turned checking of test sources back off, but let's opt in anyway, at least to see how it goes, at least for the tests of guava-testlib. (guava-tests itself is more of a pain, so I left a TODO.)

RELNOTES=n/a

@google-cla google-cla Bot added the cla: yes label Aug 19, 2021
…ndroid flavor.

It doesn't work there, even under new versions of Android, so it always triggers fallback, and the process of falling back burns resources and produces noise.

(JRE users of guava-android could benefit from the `ClassValue` implementation, but now that we're dropping support for Java 7 from guava-android, there's no reason for them to use it. OK, probably some users run _Robolectric_ tests against guava-android. But presumably they aren't _too_ sensitive to the performance of `getChecked` in the failure case.)

Removing `ClassValue` support also lets us remove a bunch of Animal-Sniffer cruft. That includes upgrading it to 1.19, which in turn forces us to remove some usages of new APIs from our _tests_ -- not nearly as important as usages in _prod_ but still a good idea so that any future Android test failures are reported to us correctly instead of hidden by `NoSuchMethodError` or similar. Or actually, Animal-Sniffer 1.20 [turned checking of test sources back off](mojohaus/animal-sniffer@ac40ac4), but let's opt in anyway, at least to see how it goes, at least for the tests of guava-testlib. (guava-tests itself is more of a pain, so I left a TODO.)

RELNOTES=n/a
PiperOrigin-RevId: 391758063
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant