From f613a74340e59d61aa9a7a7908ff949b3473e8e9 Mon Sep 17 00:00:00 2001 From: cpovirk Date: Sat, 27 Jan 2024 17:52:48 -0800 Subject: [PATCH] Remove temporary type parameters. This will break most users who static import both `Truth.assertThat` and `Truth8.assertThat`. The fix is usually as simple as replacing every reference to `Truth8` with a reference to `Truth`. But we'll post some additional migration information as part of the release notes, as we've already done for [1.3.0](https://github.com/google/truth/releases/tag/v1.3.0) and [1.4.0](https://github.com/google/truth/releases/tag/v1.4.0). (The type parameters existed to avoid that static import conflict. However, the type parameters also _cause other static import conflicts_, so we don't want them in place in the long term.) This is one of the remaining loose ends of https://github.com/google/truth/issues/746. RELNOTES=Removed temporary type parameters from `Truth.assertThat(Stream)` and `Truth.assertThat(Optional)`. This can create build errors, which you can fix by replacing all your references to `Truth8` with references to `Truth`. PiperOrigin-RevId: 602078126 --- core/src/main/java/com/google/common/truth/Truth.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/google/common/truth/Truth.java b/core/src/main/java/com/google/common/truth/Truth.java index 837a7f20b..5754b8df6 100644 --- a/core/src/main/java/com/google/common/truth/Truth.java +++ b/core/src/main/java/com/google/common/truth/Truth.java @@ -265,7 +265,7 @@ public static TableSubject assertThat(@Nullable Table actual) { "Java7ApiChecker", // no more dangerous than wherever the user got the Optional "NullableOptional", // Truth always accepts nulls, no matter the type }) - public static OptionalSubject assertThat(@Nullable Optional actual) { + public static OptionalSubject assertThat(@Nullable Optional actual) { return assert_().that(actual); } @@ -297,7 +297,7 @@ public static OptionalDoubleSubject assertThat(@Nullable OptionalDouble actual) * @since 1.4.0 (present in {@link Truth8} since before 1.0) */ @SuppressWarnings("Java7ApiChecker") // no more dangerous than wherever the user got the Stream - public static StreamSubject assertThat(@Nullable Stream actual) { + public static StreamSubject assertThat(@Nullable Stream actual) { return assert_().that(actual); }