aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-02-09Merge "`guava` target is alias depending on configuration"android-t-preview-2android-t-preview-1android-t-beta-3android-s-v2-beta-3android-s-qpr3-beta-1android-t-preview-1android-s-v2-beta-3android-s-qpr3-beta-1Treehugger Robot
2022-02-03`guava` target is alias depending on configurationSam Delmerico
Instead of requiring modules to explicitly depend on one of the guava targets, we provide an alias that matches the correct dependency depending on what Bazel configuration is available for that dependency edge. In particular, this allows error_prone to build as a host module and depend on the host-only Guava library. Bug: 215229742 Test: build/bazel/bp2build.sh Change-Id: I714834695a124316c1d80cd734555d177f608bd6
2021-12-10Merge "Add instructions for updating external/guava" am: a04a846786Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/external/guava/+/1916937 Change-Id: If7ada921b99f60a9c57ab208aa440bd0231699dc
2021-12-10Merge "Add instructions for updating external/guava"Treehugger Robot
2021-12-10Add instructions for updating external/guavaSantiago Seifert
Bug: 209959432 Test: N/A. Only comments added. Change-Id: I66f027cd08d0fe8a98b3d8440a1c3908ac57df07
2021-12-07Merge "Update external/guava to v31.0.1" am: 0ca418161dTreehugger Robot
Original change: https://android-review.googlesource.com/c/platform/external/guava/+/1913366 Change-Id: I4b7cc803fdc3e763f438882e27ad01a1e2c4b7e2
2021-12-07Merge "Update external/guava to v31.0.1"Treehugger Robot
2021-12-07Update external/guava to v31.0.1Santiago Seifert
The update was made using the following commands: git fetch upstream-guava-v31.0.1 git merge FETCH_HEAD In order to update guava, you need a branch (tags are not supported). See b/209469232 for more context. The following (preferred method) was attempted without success: m external_updater external_updater update guava Bug: 208828829 Test: m Change-Id: I948d94b6eaabc0c39910eaae84835d683bd69517
2021-09-27Set version number for guava-parent to 31.0.1.upstream/v31.0.1upstream-guava-v31.0.1Chris Povirk
2021-09-27Prepare for release 31.0.1.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 399242763
2021-09-27Strip `@Nullable` annotations from GWT sources.cpovirk
If we use `@Nullable`, the GWT compiler requires access to _the source code for `@Nullable`_ -- at least when `@Nullable` appears in _certain_ locations (type parameter bounds, type arguments, maybe others?). When we began using those annotations in those locations, I inserted a workaround into our own build to supply access to the source code for `@Nullable`. (That required not only depending on that source code but also providing a hacky, local `.gwt.xml` file. That means that our _users_ would _also_ need to do both of those things, which we really shouldn't require.) I had intended to improve upon this before the 31.0 release, but I didn't make a note about it in the right place :( The fix of simply removing the annotations works fine, since only the GWT compiler ever sees these sources, and it doesn't care about type annotations. (OK, our j2cl users could eventually care about the lack of annotations. But we haven't yet we applied `@NullMarked` to our classes externally, so the difference to them is between "lack of nullness information" and "possibly null" -- which means essentially nothing.) (One way to look at this CL is as an edited, very partial rollback of CL 364918297.) RELNOTES=Fixed [GWT compilation failure](https://groups.google.com/g/guava-discuss/c/I32pgyyj1N8/m/pXcyky2hAgAJ) introduced in release 31.0. PiperOrigin-RevId: 399190627
2021-09-24Prepare for release 31.0.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 398792880
2021-09-24Annotate `ClassToInstanceMap` and `MutableClassToInstanceMap` for nullness.cpovirk
The docs in `ClassToInstanceMap` describe some compromises we have to make to do this as best we can with our existing nullness annotations. RELNOTES=n/a PiperOrigin-RevId: 398734814
2021-09-23Chuck a few more `@DoNotCall`s around GuavaGoogle Java Core Libraries
RELNOTES=n/a PiperOrigin-RevId: 398498984
2021-09-22Add `HttpHeaders` constants for Accept-CH, Client-CH, Sec-CH-UA-Reduced, ↵Google Java Core Libraries
Device-Memory, Downlink, ECT, RTT, Save-Data, Viewport-Width, Width, and Permissions-Policy. RELNOTES=n/a PiperOrigin-RevId: 398305066
2021-09-22Merge "Add a Bazel BUILD file for external/guava." am: de7de846e8 am: ↵Romain Jobredeaux
a78cbbc85b am: 3c1fe6ec61 Original change: https://android-review.googlesource.com/c/platform/external/guava/+/1822092 Change-Id: I7218d6f3ebf9b102c1a55ebd08c36a429604ecde
2021-09-22Merge "Add a Bazel BUILD file for external/guava." am: de7de846e8 am: a78cbbc85bRomain Jobredeaux
Original change: https://android-review.googlesource.com/c/platform/external/guava/+/1822092 Change-Id: Idfa35b959804adf0115bccff50aafcaae15ad10b
2021-09-22Merge "Add a Bazel BUILD file for external/guava." am: de7de846e8android-s-v2-preview-2android-s-v2-preview-1android-s-v2-beta-2android-s-v2-preview-1Romain Jobredeaux
Original change: https://android-review.googlesource.com/c/platform/external/guava/+/1822092 Change-Id: Ia161aa249786f02952f464dc556c66e06b2951eb
2021-09-22Merge "Add a Bazel BUILD file for external/guava."Romain Jobredeaux
2021-09-21Replace usage of `murmur3_32()` with `murmur3_32_fixed()`.Éamonn McManus
PiperOrigin-RevId: 398119439
2021-09-21Optimize ImmutableSet.Builder for singleton elementslowasser
RELNOTES=n/a PiperOrigin-RevId: 398094937
2021-09-21Reduce SingletonImmutableSet memory consumption.lowasser
RELNOTES=n/a PiperOrigin-RevId: 398090070
2021-09-21Add `HttpHeaders` constants for `X-Device-IP`, `X-Device-Referer`, ↵Google Java Core Libraries
`X-Device-Accept-Language`, and `X-Device-Requested-With`. RELNOTES=`net`: Added `HttpHeaders` constants for `X-Device-Ip`, `X-Device-Referer`, `X-Device-Accept-Language`, and `X-Device-Requested-With`. PiperOrigin-RevId: 398045292
2021-09-21Migrate off deprecated mockito APIsLiam Miller-Cushon
PiperOrigin-RevId: 398039336
2021-09-20Fix typo, and remove unused method.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 397761983
2021-09-17Optimize ImmutableSet.Builder for empty sets.lowasser
RELNOTES=n/a PiperOrigin-RevId: 397392532
2021-09-17Add `@InlineMe` to `Strings.repeat(String, int)`.Kurt Alfred Kluever
RELNOTES=n/a PiperOrigin-RevId: 397391544
2021-09-17update `StringsRepeatBenchmark`Kurt Alfred Kluever
RELNOTES=n/a PiperOrigin-RevId: 397386982
2021-09-16Add a Bazel BUILD file for external/guava.Romain Jobredeaux
Test: b build external/guava/... Change-Id: I6fad9e02cf1d4850407abd4a36757b83fe2a4a94
2021-09-15Introduce `ImmutableMap.Builder.buildOrThrow()`.Éamonn McManus
This new method is equivalent to the existing `ImmutableMap.Builder.build()`. `build()` now just calls `buildOrThrow()` and will soon be deprecated. The idea is to make it more obvious that duplicate keys will cause an exception. Make similar changes to the builders of `ImmutableBiMap`, `ImmutableSortedMap`, and `ImmutableTable`. RELNOTES=The method `ImmutableMap.Builder.build()` is now renamed to `buildOrThrow()`. The existing `build()` method will continue to exist but will be deprecated and the new name should be used in new code. PiperOrigin-RevId: 396865988
2021-09-10Add `ImmutableMap.ofEntries`.Éamonn McManus
Add to `ImmutableMap` a method like this: ``` @SafeVarargs public static <K, V> ImmutableMap<K, V> ofEntries(Map.Entry<? extends K, ? extends V>... entries) ``` The method throws IllegalArgumentException if two entries have the same key. It throws NullPointerExeption if `entries` is null or if any key or value in any entry is null. These specifications make it a drop-in replacement for [`Map.ofEntries`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html#ofEntries(java.util.Map.Entry...)) with the added advantages that it has an explicitly immutable type and that it has a defined iteration order (which is the order of the entries as they appear in the arguments to `ofEntries`). We hide `ofEntries` with a method in the subclass `ImmutableSortedMapFauxverrideShim` that has the same signature and throws an exception. We already do this for `ImmutableMap.of`, for example. If we did not do it then people could write `ImmutableSortedMap.ofEntries` and they would actually end up calling `ImmutableMap.ofEntries` since `ImmutableMap` is an ancestor of `ImmutableSortedMap`. We can't override `ofEntries` to return `ImmutableSortedMap` because we would want the `K` type parameter to have a `Comparable` bound, but you can't change type parameter bounds when overriding (really "hiding") static methods. People can achieve the desired effect with `ImmutableSortedMap.copyOf(ImmutableMap.ofEntries(...))`. (`java.util` has `Map.ofEntries` but it doesn't have `SortedMap.ofEntries` or `NavigableMap.ofEntries`.) We are not planning anything currently for `ImmutableMultimap` etc. RELNOTES=`collect`: Added `ImmutableMap.ofEntries`, like `Map.ofEntries` but for `ImmutableMap`. PiperOrigin-RevId: 395991240
2021-09-10Document that a bug in `getAnnotatedBounds()` on an `AnnotatedTypeVariable` ↵cpovirk
affects `NullPointerTester`. Concretely, if I remove `@ParametricNullness` from the parameter in `Equivalence.wrap`, `NullPointerTester` thinks that `null` is never a valid input. RELNOTES=n/a PiperOrigin-RevId: 395942764
2021-09-09Avoid calling methods whose return type changed in Java 9 -- even from tests.cpovirk
This doesn't fix a practical problem today. What it does do is unblock us from adding checking (which will run in our internal builds) that will detect the main problems described in https://github.com/google/guava/issues/3990. RELNOTES=n/a PiperOrigin-RevId: 395740030
2021-09-08Warn that `directExecutor` lets exceptions propagate without invoking an ↵cpovirk
`UncaughtExceptionHandler`. RELNOTES=n/a PiperOrigin-RevId: 395541203
2021-09-08Add overloads of `ImmutableMap.of`, `ImmutableBiMap.of`, and ↵Liam Miller-Cushon
`ImmutableSortedMap.of` for up to 10 entries RELNOTES=`collect`: Added overloads of `ImmutableMap.of`, `ImmutableBiMap.of`, and `ImmutableSortedMap.of` for up to 10 entries. PiperOrigin-RevId: 395508372
2021-09-08Deprecate buggy `murmur3_32` and introduce `murmur3_32_fixed`.Piotr Findeisen
The bug was found by @findepi who also contributed the fix and the new tests via https://github.com/google/guava/pull/5649. Fixes https://github.com/google/guava/issues/5648. RELNOTES=`hash`: Deprecated buggy `murmur3_32`, and introduced `murmur3_32_fixed`. PiperOrigin-RevId: 395463974
2021-09-07Add `@InlineMe` to `Streams.stream(Optional)` and friends.Kurt Alfred Kluever
RELNOTES=Add `@InlineMe` to `Streams.stream(Optional)` and friends. PiperOrigin-RevId: 395248008
2021-09-02Simplify TopKSelectorTest.testExceedMaxIteration()perceptron8
Fixes #5698 PiperOrigin-RevId: 394579757
2021-09-01Warn that [`elapsedRealtimeNanos` requires API Level ↵cpovirk
17](https://developer.android.com/reference/android/os/SystemClock#elapsedRealtimeNanos()). RELNOTES=n/a PiperOrigin-RevId: 394251009
2021-08-26Fix bug in `TopKSelector` call to `Arrays.sort`.liulietong
Fixes #5691 Fixes #5692 RELNOTES=n/a PiperOrigin-RevId: 393150511
2021-08-25Mention the dangers of minimization/optimization for EventBus users.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 392914141
2021-08-19Remove `ClassValue` implementation of `Futures.getChecked` from the Android ↵cpovirk
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](https://github.com/mojohaus/animal-sniffer/commit/ac40ac46b3e02f0edf986bb43be7a45cc5382937), 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: 391779058
2021-08-18Copy the `setUp` and `tearDown` from the parent builder to derived test suites.Éamonn McManus
Fixes https://github.com/google/guava/issues/5674. RELNOTES=In collection test suites, the `setUp` and `tearDown` are copied to derived test suites. PiperOrigin-RevId: 391626825
2021-08-18Add a few nullness annotations that I'd deferred for later.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 391583762
2021-08-18Add `@SuppressWarnings("nullness")` for classes that we haven't enabled ↵cpovirk
continuous nullness checking for. RELNOTES=n/a PiperOrigin-RevId: 391583418
2021-08-17Don't set the executable bit on backport files.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 391298503
2021-08-12Reject non-ASCII digits in `HostAndPort` port numbers.Éamonn McManus
In `HostAndPort.fromString`, we previously allowed any Unicode digit. But the RFCs generally call for ASCII digits specifically. Document that `InetAddresses.forString` and related methods _do_ allow non-ASCII digits and explain how to check for their presence. We found that a number of projects were testing that these digits work, so changing that seems risky. Fixes https://github.com/google/guava/issues/5681. Fixes https://github.com/google/guava/issues/5682. Thanks to @Marcono1234 for the bug report. RELNOTES=`net`: Port numbers spelled with non-ASCII digits are no longer allowed in `HostAndPort.fromString`. PiperOrigin-RevId: 390396550
2021-08-10Modified description of `MoreCollectors.toOptional` for increased readability.Google Java Core Libraries
RELNOTES=n/a PiperOrigin-RevId: 389909243
2021-08-10Temporarily add a nullness suppression, which we'll remove after annotating ↵cpovirk
`ClassToInstanceMap` in an upcoming CL. RELNOTES=n/a PiperOrigin-RevId: 389869643
2021-08-09Update Public Suffix data.Google Java Core Libraries
RELNOTES=n/a PiperOrigin-RevId: 389761126