aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-08-09Fix a typo in `TypeResolver`.arfy slowy
Closes https://github.com/google/guava/pull/5671. RELNOTES=n/a PiperOrigin-RevId: 389640023
2021-08-05Annotate remaining `Range`-related classes for nullness.cpovirk
While there, improve documentation of `RangeMap.merge`. RELNOTES=n/a PiperOrigin-RevId: 388989572
2021-08-04Qualify `Entry` as `Map.Entry` or `Multiset.Entry` throughout `Synchronized`.Éamonn McManus
Previously we imported `java.util.Map.Entry`, but some occurrences of plain `Entry` were actually `Multiset.Entry` because inherited nested classes take precedence over imports. RELNOTES=n/a PiperOrigin-RevId: 388838496
2021-08-04Annotate most remaining classes in `collect` for nullness.cpovirk
These classes aren't publicly visible, so this CL might not really matter to users (unless, of course, it help us find bugs before they affect users!). But to be sure, I'd want to verify that none have publicly visible subclasses. (I suspect that none do, but I haven't looked carefully.) I skipped `MapMakerInternalMap`, which, like its successor `LocalCache`, I deemed to be too much trouble to be worth it. (Still, since I still added `MapMakerInternalMap` to the list of files to run through the nullness checker, I had to add `@SuppressWarnings("nullness")` on at least part of it, since it assigns `null` to a field that it also dereferences. Maybe it would have been nicer for me to suppress only where needed (or to use `requireNonNull`/`uncheckedCastNullableTToT`), leaving a comment about the safety of that particular operation. But I figured it was best to not give any impression that we're getting our usual automated nullness checking in the class. This is similar to what I did for `LocalCache` in CL 384759595.) RELNOTES=n/a PiperOrigin-RevId: 388823277
2021-08-04Remove newly redundant overrides from `EvictingQueue`.cpovirk
These signatures match the ones inherited from `ForwardingCollection`, including matching their types' nullness. The implementation matches, too. This CL is a followup to CL 388688929. It was also made possible by CL 382143120, which annotated `ForwardingCollection`. RELNOTES=n/a PiperOrigin-RevId: 388748996
2021-08-04Stop rejecting nulls in `EvictingQueue.contains` and `remove`.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 388688929
2021-08-04Annotate the remaining public classes under `collect` for nullness.cpovirk
And fix the annotations on the `paddedPartition` methods: I had annotated them as returning a series of lists of `T`, but in fact they return a series of lists of `@Nullable T`. We got away with this because of a combination of: - an unncessary cast to `List<T>` in `Iterators.paddedPartition` - a bug in our nullness checker that permits a cast from `List<@Nullable T>` to `List<T>` without warning I was going to say that I suspected that the bug is fundamentally the same bug as b/192579700. (Regardless, I'll try to add a sample input for both this problem and b/192579700 so that we can eventually work toward fixing both.) But from glancing at how I originally annotated this file when I was using the stock Checker Framework back in 2019, I get the impression that even it may have somehow missed this. If so, I'll ideally also report the problem upstream. Finally, I'll note that this CL includes tiny steps toward addressing https://github.com/google/guava/issues/989 (particularly the part reported as https://github.com/google/guava/issues/1015), albeit only inside implementation code. RELNOTES=n/a PiperOrigin-RevId: 388680701
2021-08-02Add text to `CompactHashMap` to explain its internal workings in more detail.Éamonn McManus
The motivation is that we were recently visiting this class and related classes to improve their nullness annotations, and I as a reviewer found it hard to understand how the various arrays worked. RELNOTES=n/a PiperOrigin-RevId: 388306855
2021-08-02Bump styfle/cancel-workflow-action from 0.9.0 to 0.9.1Colin Decker
Fixes https://github.com/google/guava/pull/5660 RELNOTES=n/a PiperOrigin-RevId: 388254609
2021-07-29Suppress errorprone warnings for unit testsGoogle Java Core Libraries
PiperOrigin-RevId: 387721415
2021-07-29Remove redundant bit masking.Piotr Findeisen
Also add some more test cases for `hashString`. Closes https://github.com/google/guava/pull/5654. RELNOTES=n/a PiperOrigin-RevId: 387627464
2021-07-24Annotate the compact collections for nullness.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 386648794
2021-07-19Annotate most remaining static utility APIs for nullness.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 385566350
2021-07-19Internal change.David P. Baker
RELNOTES=n/a PiperOrigin-RevId: 385562511
2021-07-16Suppress nullness warnings in `LocalCache` so that we can include it in the ↵cpovirk
list of files that we pass to the nullness checker. RELNOTES=n/a PiperOrigin-RevId: 385199502
2021-07-15Annotate `Table` classes for nullness.cpovirk
Also, standardize some code comments about `contains(o) && o instanceof Entry` in `entrySet` implementations.) RELNOTES=n/a PiperOrigin-RevId: 384932881
2021-07-14Annotate the core `Range` classes for nullness.cpovirk
(Rather than annotate the helper method `Range.cast`, inline it, which is incremental progress toward resolving https://github.com/google/guava/issues/3679.) This work highlighted that `DiscreteDomain.offset` would behave wrongly if passed a too-large `distance`: It would return `null` or throw `NullPointerException`. I believe that this is currently academic: `offset` is called only by `RegularContiguousSet`, and the call there is safe for not just one but two reasons: - `RegularContiguousSet` first calls `checkElementIndex` to ensure that the distance is valid. - `RegularContiguousSet` uses `offset` only for domains that set `supportsFastOffset`, which can be set only within the package -- and which is set only by `integers()` and `longs()`, which handled this correctly already. Still, it's trivial to fix properly and add a test for, so I've done that. Maybe it will matter someday in the future. RELNOTES=n/a PiperOrigin-RevId: 384753216
2021-07-09- Annotate some `Iterator` classes for nullness.cpovirk
- Update some of the usages of those classes inside `com.google.common` to reflect that nulls may pass through `endOfData()` and `computeNext()`. - Belatedly add a corresponding `@ParametricNullness` annotation to the package-private `common.base` copy of `AbstractIterator`. (I think it's academic there, since we don't create `AbstractIterator` instances with potentially null elements in `common.base`, but we might as well keep the 2 copies of `AbstractIterator` in sync.) - Standardize a few TODOs around b/192579700. RELNOTES=n/a PiperOrigin-RevId: 383873880
2021-07-07Annotate remaining immutable map classes for nullness, updating callers as ↵cpovirk
needed. RELNOTES=n/a PiperOrigin-RevId: 383457715
2021-07-07Fix javadoc lintLiam Miller-Cushon
The latest versions of javadoc require html5, and disallow the `<tt>` tag. RELNOTES=N/A PiperOrigin-RevId: 383454712
2021-07-05Fix Javadoc links in c.g.common.Google Java Core Libraries
RELNOTES=n/a PiperOrigin-RevId: 383167534
2021-06-30Annotate bimaps for nullness.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 382354441
2021-06-30Annotate `collect` static utilities for nullness.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 382268713
2021-06-29Annotate some forwarding classes for nullness.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 382143120
2021-06-28Annotate some "sorted" types for nullness.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 381992970
2021-06-26Fix BloomFilter tutorial URL.George Gastaldi
Closes https://github.com/google/guava/pull/5624. RELNOTES=n/a PiperOrigin-RevId: 381661212
2021-06-25Fix an incorrect javadoc tag. Thanks to @1993heqiang for the bug report.Éamonn McManus
RELNOTES=n/a PiperOrigin-RevId: 381501115
2021-06-23Add `HttpHeaders` constant for `Sec-CH-Prefers-Color-Scheme`.Google Java Core Libraries
RELNOTES=`net`: Added `HttpHeaders` constant for `Sec-CH-Prefers-Color-Scheme`. PiperOrigin-RevId: 381113848
2021-06-21Add an explicit project URL to Guava's main `pom.xml`.Jakob Braun
Fixes #5618. Closes #5619. RELNOTES=n/a PiperOrigin-RevId: 380583729
2021-06-20Annotate `RangeSet` classes for nullness.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 380473490
2021-06-20Annotate `Ordering` classes for nullness.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 380443580
2021-06-20Annotate the rest of `util.concurrent` for nullness.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 380429805
2021-06-15Annotate `Multimap` classes for nullness.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 379569531
2021-06-15Add CheckForNull to Throwables.getCauseAs.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 379532149
2021-06-15Annotate most of `cache` for nullness.cpovirk
I've skipped `LocalCache`. On the one hand, skipping it is a missed opportunity, as it's entirely believable that the complex, concurrent implementation code could have a bug. On the other hand, annotating it would be a huge effort to sink into a non-user-visible type. Plus, the complexity may force us to suppress errors (in which case we losing the benefit of checking for some code), and the concurrency may violate some of the assumptions of our checker, which doesn't account for concurrency (in which case the checker isn't actually proving what we want). It would still be good to do someday, but it seems like not the most valuable use of our time right now, especially given that we recommend Caffeine to most users, anyway. RELNOTES=n/a PiperOrigin-RevId: 379525997
2021-06-15Finish annotating `io` for nullness.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 379525383
2021-06-15Annotate a few more classes in `base`.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 379525289
2021-06-15Finish annotating `SortedMultiset` for nullness.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 379524379
2021-06-15Annotate `ImmutableMap.get`, `Table.get`, and similar methods as potentially ↵cpovirk
returning `null`. RELNOTES=n/a PiperOrigin-RevId: 379523436
2021-06-14Annotate Function for nullness.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 379384601
2021-06-14Remove `@Beta` from `Interner` and `Interners`.Éamonn McManus
They have been public since 2010. Realistically, we are not going to make incompatible API changes to them. Fixes https://github.com/google/guava/issues/5594. RELNOTES=`Interner` and `Interners` are no longer `@Beta` but are fully supported. PiperOrigin-RevId: 379363216
2021-06-14Internal change.David P. Baker
RELNOTES=n/a PiperOrigin-RevId: 379295469
2021-06-10Add Keep-Alive to `HttpHeaders`.Google Java Core Libraries
RELNOTES=`net`: Added `HttpHeaders` constant for Keep-Alive. PiperOrigin-RevId: 378743056
2021-06-10Widen acceptable exception type for code path that currently throws ↵Nick Glorioso
IllegalCharsetException PiperOrigin-RevId: 378646642
2021-06-07Update Public Suffix data.Google Java Core Libraries
RELNOTES=n/a PiperOrigin-RevId: 377967452
2021-06-07Finish annotating `AbstractInvocationHandler`.cpovirk
RELNOTES=n/a PiperOrigin-RevId: 377928567
2021-06-03Optimize ImmutableSet hash flooding detection.lowasser
RELNOTES=n/a PiperOrigin-RevId: 377356816
2021-06-02Fix typo noted by @ben-manes in ↵cpovirk
https://github.com/google/guava/commit/ce4bad32a3f15ffb21cc2a13e6db4ad03f915033#r51511526. RELNOTES=n/a PiperOrigin-RevId: 377137506
2021-06-02Use `<? extends @Nullable Object>` instead of `<?>`.cpovirk
The two should be equivalent, but Kotlin 1.5.10 appears to be interpreting `@ElementTypesAreNonnullByDefault` to mean that `<?>` excludes nulls, thanks to `@TypeQualifierDefault({PARAMETER, ...}) @Nonnull`. (We suspect that this is a bug, so we're looking into that, but we haven't come up with a minimal repo yet.) It's possible that we'll want to make similar changes to other APIs. My initial stab at a list is: - `AbstractMultiset.removeAll` and `retainAll` - `FowardingCollection.containsAll`, `removeAll`, and `retainAll` - `ImmutableCollection.removeAll` and `retainAll` - `Iterables.size`, `toString`, and `isEmpty` - `Iterators.size`, `toString`, and `advance` For now, though, I'm sticking to modifying only `Joiner`. ...and that's probably just as well: There are side effects: Prior to this CL, the following is accepted by javac without warning: ``` joiner.join((List) foo); ``` After this CL, that same code produces an `unchecked` warning. That's because of the raw type `List`, which javac presumably cares about _now_ because it runs some extra checks on account of the explicit bound, even though that bound is `Object`. RELNOTES=n/a PiperOrigin-RevId: 377083162
2021-06-01Include toString() of delegate executor with listening decoratorGoogle Java Core Libraries
RELNOTES=n/a PiperOrigin-RevId: 376944801