Commit Graph

6656 Commits

Author SHA1 Message Date
cpovirk
10c64d93b7 Internal change.
PiperOrigin-RevId: 688529810
2024-10-22 06:49:09 -07:00
cpovirk
3d14f1d81b Complete the automatable migration to assertThrows.
And update some attempted suppressions to make them actually work.

RELNOTES=n/a
PiperOrigin-RevId: 688267287
2024-10-21 14:13:09 -07:00
cpovirk
67f914985e Extract shared helper methods in UrlEscapersTest into UrlEscaperTesting.
PiperOrigin-RevId: 688195240
2024-10-21 10:53:22 -07:00
Google Java Core Libraries
79c9e7a36c Remove a couple more obsolete workarounds for FilterOutputStream trouble.
See https://github.com/google/guava/issues/1330.

I have the others taken care of in cl/687314611.

PiperOrigin-RevId: 688191691
2024-10-21 10:44:34 -07:00
cpovirk
9911c8347f Internal change.
RELNOTES=n/a
PiperOrigin-RevId: 688163700
2024-10-21 09:27:30 -07:00
cpovirk
031cefac62 Remove a couple more obsolete workarounds for FilterOutputStream trouble.
See https://github.com/google/guava/issues/1330.

I have the others taken care of in cl/687314611.

RELNOTES=n/a
PiperOrigin-RevId: 688155711
2024-10-21 09:03:37 -07:00
cpovirk
f617e81434 Use assertThrows even in GWT/J2CL/J2KT-compatible code, common.net and common.util.concurrent edition.
(continuing the path started in cl/675634517)

RELNOTES=n/a
PiperOrigin-RevId: 688149269
2024-10-21 08:41:36 -07:00
cpovirk
6544c1edbc Update links from code.google.com to github.com.
RELNOTES=n/a
PiperOrigin-RevId: 688127704
2024-10-21 07:28:19 -07:00
cpovirk
fea7a3635b Use assertThrows even in GWT/J2CL/J2KT-compatible code, common.primitives edition.
(continuing the path started in cl/675634517)

RELNOTES=n/a
PiperOrigin-RevId: 687502286
2024-10-18 19:56:12 -07:00
cpovirk
cdc225474e Make most util.concurrent Duration overloads available to Android users.
(and also the `BooleanSupplier`-based `newGuard` method in `Monitor`)

I skipped the `default` methods, as we're not yet sure how safe those are.

RELNOTES=`util.concurrent`: Made most `Duration` overloads available to Android users.
PiperOrigin-RevId: 687476839
2024-10-18 17:51:36 -07:00
cpovirk
89ca0ef778 Use some static imports.
RELNOTES=n/a
PiperOrigin-RevId: 687471414
2024-10-18 17:26:48 -07:00
cpovirk
8bbbefd6e6 Use _more_ static imports.
(followup to cl/687404334)

RELNOTES=n/a
PiperOrigin-RevId: 687466612
2024-10-18 17:05:46 -07:00
cpovirk
266b30c1f1 Use some static imports.
RELNOTES=n/a
PiperOrigin-RevId: 687437051
2024-10-18 15:10:29 -07:00
cpovirk
3a8463a075 Use some static imports.
RELNOTES=n/a
PiperOrigin-RevId: 687404334
2024-10-18 13:24:49 -07:00
cpovirk
dc12fb2ffe Address [InitializeInline](https://errorprone.info/bugpattern/InitializeInline) warnings.
PiperOrigin-RevId: 687386859
2024-10-18 12:29:46 -07:00
cpovirk
f5108a367d Use some static imports.
RELNOTES=n/a
PiperOrigin-RevId: 687381111
2024-10-18 12:07:49 -07:00
cpovirk
b045bf3a99 Suppress a suggestion that we use the Duration overload.
(followup to cl/687302660)

RELNOTES=n/a
PiperOrigin-RevId: 687317647
2024-10-18 08:48:36 -07:00
cpovirk
b0461b725b Use assertThrows even in GWT/J2CL/J2KT-compatible code, common.cache+io+math+reflect+testing edition.
(continuing the path started in cl/675634517)

And address a few other warnings.

RELNOTES=n/a
PiperOrigin-RevId: 687302660
2024-10-18 08:00:32 -07:00
cpovirk
6082782134 Make Splitter.splitToStream available to Android users.
RELNOTES=`base`: Made `Splitter.splitToStream` available to Android users.
PiperOrigin-RevId: 687039853
2024-10-17 14:14:05 -07:00
cpovirk
99be0a4e5a Use assertThrows even in GWT/J2CL/J2KT-compatible code, common.collect.testing edition.
(continuing the path started in cl/675634517)

RELNOTES=n/a
PiperOrigin-RevId: 687014605
2024-10-17 13:00:30 -07:00
cpovirk
8a1c90e7b3 Prepare for usage of ReflectionFreeAssertThrows from more packages:
- Make `AbstractPackageSanityTests` ignore the class for simplicity. (But also add null checks (which solve only _part_ of the problem) to `ReflectionFreeAssertThrows` because why not.)
- Remove support for `util.concurrent` types so that we can also remove `util.concurrent` deps (mostly added during cl/675634517 and cl/686155720). I'll include support for those types in the packages that actually need it.

RELNOTES=n/a
PiperOrigin-RevId: 687009402
2024-10-17 12:43:49 -07:00
cpovirk
9597b0d290 Use assertThrows even in GWT/J2CL/J2KT-compatible code, common.collect.testing.google edition.
(continuing the path started in cl/675634517)

RELNOTES=n/a
PiperOrigin-RevId: 686998315
2024-10-17 12:10:20 -07:00
cpovirk
7b62a516af Point users to [Math.clamp](https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/lang/Math.html#clamp(long,int,int)).
RELNOTES=n/a
PiperOrigin-RevId: 686930116
2024-10-17 08:52:18 -07:00
cpovirk
585b93a026 Restore the behavior of throwing an IllegalArgumentException directly.
I'd undone this in cl/686728158 as part of addressing #7434, but I subsequently got a guilty conscience. It almost certainly doesn't matter, but it's a little weird.

RELNOTES=n/a
PiperOrigin-RevId: 686919814
2024-10-17 08:16:45 -07:00
cpovirk
dc423d228a Address [StaticQualifiedUsingExpression](https://errorprone.info/bugpattern/StaticQualifiedUsingExpression) and [ExtendsObject](https://errorprone.info/bugpattern/ExtendsObject) warnings.
RELNOTES=n/a
PiperOrigin-RevId: 686893871
2024-10-17 06:41:27 -07:00
cpovirk
22124956ac Migrate more code to use UndeclaredThrowableException.
And generally make our handling more consistent (`throwIfUnchecked` + `UndeclaredThrowableException` with appropriate comments).

This is mostly a no-op (assuming that the undeclared throwables are in fact impossible :)), but I note that the old `ChecksumHashFunction` code appears to be wrapping any _`RuntimeException`_ in an `AssertionError`, which would be bad if there were a practical chance of such a thing (though hopefully there is not).

Compare cl/686064398. I suspect that we could find yet more similar code.

RELNOTES=n/a
PiperOrigin-RevId: 686883397
2024-10-17 06:05:16 -07:00
cpovirk
13374053ab Use addSuppressed in AbstractExecutionThreadService, and otherwise update/clarify code pinned to "Java 7" / old versions of Android.
RELNOTES=n/a
PiperOrigin-RevId: 686882751
2024-10-17 06:00:28 -07:00
cpovirk
0e2fa3ece4 Address https://errorprone.info/bugpattern/ThreadPriorityCheck warnings.
RELNOTES=n/a
PiperOrigin-RevId: 686728364
2024-10-16 19:42:09 -07:00
cpovirk
8f747d0069 Migrate off Throwables.propagate, and stop rethrowing exceptions from other threads.
Plus, simplify `CacheLoader` setup slightly.

Fixes #7434

RELNOTES=n/a
PiperOrigin-RevId: 686728158
2024-10-16 19:38:48 -07:00
cpovirk
ca12c336b7 Address [CatchFail](https://errorprone.info/bugpattern/CatchFail), [StaticQualifiedUsingExpression](https://errorprone.info/bugpattern/StaticQualifiedUsingExpression), [UnusedMethod](https://errorprone.info/bugpattern/UnusedMethod), and [CacheLoaderNull](https://errorprone.info/bugpattern/CacheLoaderNull) warnings.
And use `assertThrows` in some more places where it is now obvious that that is possible.

PiperOrigin-RevId: 686721569
2024-10-16 19:09:00 -07:00
cpovirk
702e4b23c3 Disable Java7ApiChecker for our *tests*, removing most of its suppressions and also most AndroidJdkLibsChecker suppressions.
(`AndroidJdkLibsChecker` (albeit in "desugaring mode") and Animal Sniffer will continue to run.)

It's not clear that `Java7ApiChecker` is useful even for our *prod* code at this point, as discussed in b/336133887. Let's at least start by disabling it for tests, where it's one of the remaining annoyances when adding support for Java 8 APIs to our Android branch.

(The actual immediate motivation for this CL is cl/686562711.)

The _`AndroidJdkLibsChecker`_ suppressions can be removed now that the standard configuration inside Google enables opt-in library desugaring, which signals to `AndroidJdkLibsChecker` not to warn about the methods that we're using. (Again, we still have checking from Animal Sniffer.)

RELNOTES=n/a
PiperOrigin-RevId: 686638643
2024-10-16 14:21:17 -07:00
cpovirk
98d55289fc Address https://errorprone.info/bugpattern/UnnecessaryDefaultInEnumSwitch warnings.
RELNOTES=n/a
PiperOrigin-RevId: 686551836
2024-10-16 10:21:56 -07:00
cpovirk
10d4b1b10a Inline a method that mainly serves to confuse the compiler's reachabililty checking.
It's possible that my motivation for the method was:
- to make it more difficult to accidentally operate on `e` intead of `e.getCause()` (as in https://github.com/google/guava/pull/7434): If so, I hope that I've addressed that sufficiently by renaming `e` to "`wrapper`".
- to share code with [`wrapAndThrowRuntimeExecutionExceptionOrError` in `SimpleTimeLimiter`](5338f7c997/guava/src/com/google/common/util/concurrent/SimpleTimeLimiter.java (L278C16-L278C60)): I mean, I guess we _could_, but meh, especially since the `Futures` copy of the logic benefits from an implementation comment that wouldn't make sense in the `SimpleTimeLimiter` case.

RELNOTES=n/a
PiperOrigin-RevId: 686551569
2024-10-16 10:17:40 -07:00
Google Java Core Libraries
503c9eb8d4 Add Fingerprint2011 to ChecksumBenchmark
PiperOrigin-RevId: 686542171
2024-10-16 09:53:43 -07:00
cpovirk
5338f7c997 Upgrade to a version of plexus-io from after a performance improvement was restored.
(See https://github.com/codehaus-plexus/plexus-io/issues/109.)

This CL _shouldn't_ make a performance difference because cl/650419894 _should_ have moved us to a version before the performance improvement was originally reverted. However, I messed that prior CL up, pinning us to the slow 3.4.1 instead of the fast 3.3.1. So in fact this CL _does_ improve performance back to the point it was at for 3.3.1. Today, that means an improvement from ~75s to ~1s for a clean `mvn source:jar-no-fork -f guava` on our Google workstations.

RELNOTES=n/a
PiperOrigin-RevId: 686509316
2024-10-16 08:08:34 -07:00
cpovirk
0a291292e8 Use assertThrows even in GWT/J2CL/J2KT-compatible code, common.collect edition.
(continuing the path started in cl/675634517)

And clean up a few other warnings.

RELNOTES=n/a
PiperOrigin-RevId: 686155720
2024-10-15 10:36:06 -07:00
Kurt Alfred Kluever
77243d6af2 Add a note about Thread.Factory for Java 21+ users. See https://github.com/google/guava/issues/7427
RELNOTES=n/a
PiperOrigin-RevId: 685860825
2024-10-14 15:50:54 -07:00
cpovirk
9be5c722c4 Bump Maven to 3.9.9 and Wrapper to 3.3.2.
RELNOTES=n/a
PiperOrigin-RevId: 685852848
2024-10-14 15:24:15 -07:00
dependabot[bot]
ccb3c8534d Bump the github-actions group with 3 updates
Bumps the github-actions group with 3 updates: [actions/checkout](https://github.com/actions/checkout), [actions/upload-artifact](https://github.com/actions/upload-artifact) and [github/codeql-action](https://github.com/github/codeql-action).

Updates `actions/checkout` from 4.2.0 to 4.2.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](d632683dd7...eef61447b9)

Updates `actions/upload-artifact` from 4.4.0 to 4.4.3
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](50769540e7...b4b15b8c7c)

Updates `github/codeql-action` from 3.26.11 to 3.26.13
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](6db8d6351f...f779452ac5)

Fixes #7431

RELNOTES=n/a
PiperOrigin-RevId: 685774596
2024-10-14 11:28:00 -07:00
lowasser
b84a41d077 n/a
RELNOTES=n/a
PiperOrigin-RevId: 684964139
2024-10-11 15:00:03 -07:00
cpovirk
d40589de41 Avoid backticks in Javadoc.
RELNOTES=n/a
PiperOrigin-RevId: 684455708
2024-10-10 08:41:27 -07:00
Kurt Alfred Kluever
f5ec2ab85c add ToStringHelper.omitEmptyValues(). Fixes https://github.com/google/guava/issues/7415
RELNOTES=Add `ToStringHelper.omitEmptyValues()`.
PiperOrigin-RevId: 684168908
2024-10-09 14:19:18 -07:00
Google Java Core Libraries
99d2ced9e9 Remove @GwtIncompatible from LongMath.checkedSubtract
RELNOTES=Remove @GwtIncompatible from LongMath.checkedSubtract
PiperOrigin-RevId: 684068945
2024-10-09 09:39:37 -07:00
cpovirk
49776fd832 Address https://errorprone.info/bugpattern/Interruption warnings.
PiperOrigin-RevId: 683725351
2024-10-08 12:36:35 -07:00
Google Java Core Libraries
01e6a5594f Refactor getDoneValue(Object obj) to improve readability of Cancellation and Failure case handling logic.
RELNOTES=n/a
PiperOrigin-RevId: 683695919
2024-10-08 11:20:53 -07:00
Google Java Core Libraries
4d7c71ea79 Add @RetainedLocalRef to volatile value field references to resolve potential memory issues in a J2ObjC context.
RELNOTES=n/a
PiperOrigin-RevId: 683652108
2024-10-08 09:28:54 -07:00
dependabot[bot]
ed33d3dd62 Bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).

Updates `github/codeql-action` from 3.26.10 to 3.26.11
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](e2b3eafc8d...6db8d6351f)

Fixes #7419

RELNOTES=n/a
PiperOrigin-RevId: 683229166
2024-10-07 10:19:09 -07:00
Google Java Core Libraries
a46565dd1c Provide an optimized copyOf method for TreeRangeMap
RELNOTES=Provide an optimized copyOf method for TreeRangeMap
PiperOrigin-RevId: 682878547
2024-10-06 06:04:03 -07:00
Chaoren Lin
81be061f85 Fix @Require annotations so that features implied by absent features are not also required to be absent.
Fixes #7401

RELNOTES=`collect.testing.features`: Fixed `@Require` annotations so that features implied by absent features are not also required to be absent.
PiperOrigin-RevId: 682731934
2024-10-05 15:05:05 -07:00
Chaoren Lin
5da71a7786 Fix some misconfigured collections test suites that were passing due to #7401.
RELNOTES=n/a
PiperOrigin-RevId: 681498058
2024-10-02 10:16:08 -07:00