Age | Commit message (Collapse) | Author |
|
Closes https://github.com/google/guava/pull/5671.
RELNOTES=n/a
PiperOrigin-RevId: 389640023
|
|
While there, improve documentation of `RangeMap.merge`.
RELNOTES=n/a
PiperOrigin-RevId: 388989572
|
|
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
|
|
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
|
|
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
|
|
RELNOTES=n/a
PiperOrigin-RevId: 388688929
|
|
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
|
|
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
|
|
Fixes https://github.com/google/guava/pull/5660
RELNOTES=n/a
PiperOrigin-RevId: 388254609
|
|
PiperOrigin-RevId: 387721415
|
|
Also add some more test cases for `hashString`.
Closes https://github.com/google/guava/pull/5654.
RELNOTES=n/a
PiperOrigin-RevId: 387627464
|
|
RELNOTES=n/a
PiperOrigin-RevId: 386648794
|
|
RELNOTES=n/a
PiperOrigin-RevId: 385566350
|
|
RELNOTES=n/a
PiperOrigin-RevId: 385562511
|
|
list of files that we pass to the nullness checker.
RELNOTES=n/a
PiperOrigin-RevId: 385199502
|
|
Also, standardize some code comments about `contains(o) && o instanceof Entry` in `entrySet` implementations.)
RELNOTES=n/a
PiperOrigin-RevId: 384932881
|
|
(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
|
|
- 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
|
|
needed.
RELNOTES=n/a
PiperOrigin-RevId: 383457715
|
|
The latest versions of javadoc require html5, and disallow the `<tt>` tag.
RELNOTES=N/A
PiperOrigin-RevId: 383454712
|
|
RELNOTES=n/a
PiperOrigin-RevId: 383167534
|
|
RELNOTES=n/a
PiperOrigin-RevId: 382354441
|
|
RELNOTES=n/a
PiperOrigin-RevId: 382268713
|
|
RELNOTES=n/a
PiperOrigin-RevId: 382143120
|
|
RELNOTES=n/a
PiperOrigin-RevId: 381992970
|
|
Closes https://github.com/google/guava/pull/5624.
RELNOTES=n/a
PiperOrigin-RevId: 381661212
|
|
RELNOTES=n/a
PiperOrigin-RevId: 381501115
|
|
RELNOTES=`net`: Added `HttpHeaders` constant for `Sec-CH-Prefers-Color-Scheme`.
PiperOrigin-RevId: 381113848
|
|
Fixes #5618. Closes #5619.
RELNOTES=n/a
PiperOrigin-RevId: 380583729
|
|
RELNOTES=n/a
PiperOrigin-RevId: 380473490
|
|
RELNOTES=n/a
PiperOrigin-RevId: 380443580
|
|
RELNOTES=n/a
PiperOrigin-RevId: 380429805
|
|
RELNOTES=n/a
PiperOrigin-RevId: 379569531
|
|
RELNOTES=n/a
PiperOrigin-RevId: 379532149
|
|
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
|
|
RELNOTES=n/a
PiperOrigin-RevId: 379525383
|
|
RELNOTES=n/a
PiperOrigin-RevId: 379525289
|
|
RELNOTES=n/a
PiperOrigin-RevId: 379524379
|
|
returning `null`.
RELNOTES=n/a
PiperOrigin-RevId: 379523436
|
|
RELNOTES=n/a
PiperOrigin-RevId: 379384601
|
|
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
|
|
RELNOTES=n/a
PiperOrigin-RevId: 379295469
|
|
RELNOTES=`net`: Added `HttpHeaders` constant for Keep-Alive.
PiperOrigin-RevId: 378743056
|
|
IllegalCharsetException
PiperOrigin-RevId: 378646642
|
|
RELNOTES=n/a
PiperOrigin-RevId: 377967452
|
|
RELNOTES=n/a
PiperOrigin-RevId: 377928567
|
|
RELNOTES=n/a
PiperOrigin-RevId: 377356816
|
|
https://github.com/google/guava/commit/ce4bad32a3f15ffb21cc2a13e6db4ad03f915033#r51511526.
RELNOTES=n/a
PiperOrigin-RevId: 377137506
|
|
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
|
|
RELNOTES=n/a
PiperOrigin-RevId: 376944801
|