From f23fd9d8a99e886cf882f1b0b3dd18727052958e Mon Sep 17 00:00:00 2001 From: cpovirk Date: Fri, 9 Jan 2026 15:43:05 -0800 Subject: [PATCH] Automatically reformat, manually intervening to fix a few more doc issues. RELNOTES=n/a PiperOrigin-RevId: 854369812 --- .../com/google/common/truth/BigDecimalSubject.java | 4 +--- .../com/google/common/truth/BooleanSubject.java | 4 +--- .../java/com/google/common/truth/ClassSubject.java | 4 +--- .../com/google/common/truth/DoubleSubject.java | 4 +--- .../main/java/com/google/common/truth/Fact.java | 3 +-- .../java/com/google/common/truth/FloatSubject.java | 4 +--- .../com/google/common/truth/IntegerSubject.java | 4 +--- .../java/com/google/common/truth/LongSubject.java | 4 +--- .../java/com/google/common/truth/MapSubject.java | 4 +--- .../com/google/common/truth/MultimapSubject.java | 4 +--- .../com/google/common/truth/MultisetSubject.java | 4 +--- .../google/common/truth/ObjectArraySubject.java | 4 +--- .../common/truth/PrimitiveBooleanArraySubject.java | 4 +--- .../common/truth/PrimitiveByteArraySubject.java | 4 +--- .../common/truth/PrimitiveCharArraySubject.java | 4 +--- .../common/truth/PrimitiveDoubleArraySubject.java | 4 +--- .../common/truth/PrimitiveFloatArraySubject.java | 10 ++++------ .../common/truth/PrimitiveIntArraySubject.java | 4 +--- .../common/truth/PrimitiveLongArraySubject.java | 4 +--- .../common/truth/PrimitiveShortArraySubject.java | 4 +--- .../com/google/common/truth/StackTraceCleaner.java | 5 +++-- .../com/google/common/truth/StreamSubject.java | 4 +--- .../com/google/common/truth/StringSubject.java | 4 +--- .../java/com/google/common/truth/SubjectUtils.java | 4 +--- .../java/com/google/common/truth/TableSubject.java | 4 +--- .../main/java/com/google/common/truth/Truth.java | 3 +-- .../common/truth/CustomFailureMessageTest.java | 4 +--- .../truth/IterableSubjectCorrespondenceTest.java | 4 ++-- .../com/google/common/truth/MapSubjectTest.java | 12 ++++++------ .../java/com/google/common/truth/MathUtilTest.java | 4 +--- .../google/common/truth/NumericComparisonTest.java | 4 +--- .../truth/PrimitiveShortArraySubjectTest.java | 4 +--- .../truth/extensions/proto/LiteProtoTruth.java | 2 +- .../common/truth/extensions/proto/DiffResult.java | 10 +++++----- .../truth/extensions/proto/FieldScopeLogic.java | 14 +++++++------- .../extensions/proto/FluentEqualityConfig.java | 2 -- .../CorrespondenceSubclassToFactoryCall.java | 11 +++++++++-- 37 files changed, 65 insertions(+), 115 deletions(-) diff --git a/core/src/main/java/com/google/common/truth/BigDecimalSubject.java b/core/src/main/java/com/google/common/truth/BigDecimalSubject.java index d8c91e40d..1efb2edd5 100644 --- a/core/src/main/java/com/google/common/truth/BigDecimalSubject.java +++ b/core/src/main/java/com/google/common/truth/BigDecimalSubject.java @@ -21,9 +21,7 @@ import java.math.BigDecimal; import org.jspecify.annotations.Nullable; -/** - * A subject for {@link BigDecimal} values. - */ +/** A subject for {@link BigDecimal} values. */ public final class BigDecimalSubject extends ComparableSubject { private final @Nullable BigDecimal actual; diff --git a/core/src/main/java/com/google/common/truth/BooleanSubject.java b/core/src/main/java/com/google/common/truth/BooleanSubject.java index 30f751e72..e4340b02e 100644 --- a/core/src/main/java/com/google/common/truth/BooleanSubject.java +++ b/core/src/main/java/com/google/common/truth/BooleanSubject.java @@ -19,9 +19,7 @@ import org.jspecify.annotations.Nullable; -/** - * A subject for {@link Boolean} values. - */ +/** A subject for {@link Boolean} values. */ public final class BooleanSubject extends Subject { private final @Nullable Boolean actual; diff --git a/core/src/main/java/com/google/common/truth/ClassSubject.java b/core/src/main/java/com/google/common/truth/ClassSubject.java index a6e0d3c8b..01d20d761 100644 --- a/core/src/main/java/com/google/common/truth/ClassSubject.java +++ b/core/src/main/java/com/google/common/truth/ClassSubject.java @@ -20,9 +20,7 @@ import com.google.common.annotations.GwtIncompatible; import org.jspecify.annotations.Nullable; -/** - * A subject for {@link Class} values. - */ +/** A subject for {@link Class} values. */ @GwtIncompatible("reflection") @J2ktIncompatible public final class ClassSubject extends Subject { diff --git a/core/src/main/java/com/google/common/truth/DoubleSubject.java b/core/src/main/java/com/google/common/truth/DoubleSubject.java index 562b3598d..065bb07ea 100644 --- a/core/src/main/java/com/google/common/truth/DoubleSubject.java +++ b/core/src/main/java/com/google/common/truth/DoubleSubject.java @@ -26,9 +26,7 @@ import org.jspecify.annotations.Nullable; -/** - * A subject for {@link Double} values. - */ +/** A subject for {@link Double} values. */ public final class DoubleSubject extends ComparableSubject { private final @Nullable Double actual; diff --git a/core/src/main/java/com/google/common/truth/Fact.java b/core/src/main/java/com/google/common/truth/Fact.java index d3dfafb20..1e67611fe 100644 --- a/core/src/main/java/com/google/common/truth/Fact.java +++ b/core/src/main/java/com/google/common/truth/Fact.java @@ -168,8 +168,7 @@ String getKey() { return key; } - @Nullable - String getValue() { + @Nullable String getValue() { return value; } diff --git a/core/src/main/java/com/google/common/truth/FloatSubject.java b/core/src/main/java/com/google/common/truth/FloatSubject.java index 2c259c4e0..e1ffdda4e 100644 --- a/core/src/main/java/com/google/common/truth/FloatSubject.java +++ b/core/src/main/java/com/google/common/truth/FloatSubject.java @@ -26,9 +26,7 @@ import org.jspecify.annotations.Nullable; -/** - * A subject for {@link Float} values. - */ +/** A subject for {@link Float} values. */ public final class FloatSubject extends ComparableSubject { private final @Nullable Float actual; private final DoubleSubject asDouble; diff --git a/core/src/main/java/com/google/common/truth/IntegerSubject.java b/core/src/main/java/com/google/common/truth/IntegerSubject.java index b860a9653..a5d14df72 100644 --- a/core/src/main/java/com/google/common/truth/IntegerSubject.java +++ b/core/src/main/java/com/google/common/truth/IntegerSubject.java @@ -23,9 +23,7 @@ import org.jspecify.annotations.Nullable; -/** - * A subject for {@link Integer} values. - */ +/** A subject for {@link Integer} values. */ public class IntegerSubject extends ComparableSubject { private final @Nullable Integer actual; diff --git a/core/src/main/java/com/google/common/truth/LongSubject.java b/core/src/main/java/com/google/common/truth/LongSubject.java index 51365c4c6..a97072a7f 100644 --- a/core/src/main/java/com/google/common/truth/LongSubject.java +++ b/core/src/main/java/com/google/common/truth/LongSubject.java @@ -22,9 +22,7 @@ import org.jspecify.annotations.Nullable; -/** - * A subject for {@link Long} values. - */ +/** A subject for {@link Long} values. */ public class LongSubject extends ComparableSubject { private final @Nullable Long actual; diff --git a/core/src/main/java/com/google/common/truth/MapSubject.java b/core/src/main/java/com/google/common/truth/MapSubject.java index 08dca6e6b..d08a2324e 100644 --- a/core/src/main/java/com/google/common/truth/MapSubject.java +++ b/core/src/main/java/com/google/common/truth/MapSubject.java @@ -48,9 +48,7 @@ import java.util.Set; import org.jspecify.annotations.Nullable; -/** - * A subject for {@link Map} values. - */ +/** A subject for {@link Map} values. */ public class MapSubject extends Subject { private final @Nullable Map actual; diff --git a/core/src/main/java/com/google/common/truth/MultimapSubject.java b/core/src/main/java/com/google/common/truth/MultimapSubject.java index 33046b7a8..7ca6546b4 100644 --- a/core/src/main/java/com/google/common/truth/MultimapSubject.java +++ b/core/src/main/java/com/google/common/truth/MultimapSubject.java @@ -49,9 +49,7 @@ import java.util.Set; import org.jspecify.annotations.Nullable; -/** - * A subject for {@link Multimap} values. - */ +/** A subject for {@link Multimap} values. */ public class MultimapSubject extends Subject { private final @Nullable Multimap actual; diff --git a/core/src/main/java/com/google/common/truth/MultisetSubject.java b/core/src/main/java/com/google/common/truth/MultisetSubject.java index c91bea2e0..37ee09043 100644 --- a/core/src/main/java/com/google/common/truth/MultisetSubject.java +++ b/core/src/main/java/com/google/common/truth/MultisetSubject.java @@ -21,9 +21,7 @@ import com.google.common.collect.Multiset; import org.jspecify.annotations.Nullable; -/** - * A subject for {@link Multiset} values. - */ +/** A subject for {@link Multiset} values. */ public final class MultisetSubject extends IterableSubject { private final @Nullable Multiset actual; diff --git a/core/src/main/java/com/google/common/truth/ObjectArraySubject.java b/core/src/main/java/com/google/common/truth/ObjectArraySubject.java index 6f3dbe7f6..101ddd81a 100644 --- a/core/src/main/java/com/google/common/truth/ObjectArraySubject.java +++ b/core/src/main/java/com/google/common/truth/ObjectArraySubject.java @@ -21,9 +21,7 @@ import java.util.Arrays; import org.jspecify.annotations.Nullable; -/** - * A subject for {@code Object[]} and more generically {@code T[]}. - */ +/** A subject for {@code Object[]} and more generically {@code T[]}. */ public final class ObjectArraySubject extends Subject { private final T @Nullable [] actual; diff --git a/core/src/main/java/com/google/common/truth/PrimitiveBooleanArraySubject.java b/core/src/main/java/com/google/common/truth/PrimitiveBooleanArraySubject.java index 229687268..a54e12c5f 100644 --- a/core/src/main/java/com/google/common/truth/PrimitiveBooleanArraySubject.java +++ b/core/src/main/java/com/google/common/truth/PrimitiveBooleanArraySubject.java @@ -21,9 +21,7 @@ import com.google.common.primitives.Booleans; import org.jspecify.annotations.Nullable; -/** - * A subject for {@code boolean[]} values. - */ +/** A subject for {@code boolean[]} values. */ public final class PrimitiveBooleanArraySubject extends Subject { private final boolean @Nullable [] actual; diff --git a/core/src/main/java/com/google/common/truth/PrimitiveByteArraySubject.java b/core/src/main/java/com/google/common/truth/PrimitiveByteArraySubject.java index a76f91e14..264a2184e 100644 --- a/core/src/main/java/com/google/common/truth/PrimitiveByteArraySubject.java +++ b/core/src/main/java/com/google/common/truth/PrimitiveByteArraySubject.java @@ -21,9 +21,7 @@ import com.google.common.primitives.Bytes; import org.jspecify.annotations.Nullable; -/** - * A subject for {@code byte[]} values. - */ +/** A subject for {@code byte[]} values. */ public final class PrimitiveByteArraySubject extends Subject { private final byte @Nullable [] actual; diff --git a/core/src/main/java/com/google/common/truth/PrimitiveCharArraySubject.java b/core/src/main/java/com/google/common/truth/PrimitiveCharArraySubject.java index 29b760f79..dd9482901 100644 --- a/core/src/main/java/com/google/common/truth/PrimitiveCharArraySubject.java +++ b/core/src/main/java/com/google/common/truth/PrimitiveCharArraySubject.java @@ -21,9 +21,7 @@ import com.google.common.primitives.Chars; import org.jspecify.annotations.Nullable; -/** - * A subject for {@code char[]} values. - */ +/** A subject for {@code char[]} values. */ public final class PrimitiveCharArraySubject extends Subject { private final char @Nullable [] actual; diff --git a/core/src/main/java/com/google/common/truth/PrimitiveDoubleArraySubject.java b/core/src/main/java/com/google/common/truth/PrimitiveDoubleArraySubject.java index aba4a2bc9..4053b13f8 100644 --- a/core/src/main/java/com/google/common/truth/PrimitiveDoubleArraySubject.java +++ b/core/src/main/java/com/google/common/truth/PrimitiveDoubleArraySubject.java @@ -28,9 +28,7 @@ import java.util.Arrays; import org.jspecify.annotations.Nullable; -/** - * A subject for {@code double[]} values. - */ +/** A subject for {@code double[]} values. */ public final class PrimitiveDoubleArraySubject extends Subject { private final double @Nullable [] actual; diff --git a/core/src/main/java/com/google/common/truth/PrimitiveFloatArraySubject.java b/core/src/main/java/com/google/common/truth/PrimitiveFloatArraySubject.java index 396018c47..bb57d6e5f 100644 --- a/core/src/main/java/com/google/common/truth/PrimitiveFloatArraySubject.java +++ b/core/src/main/java/com/google/common/truth/PrimitiveFloatArraySubject.java @@ -28,9 +28,7 @@ import java.util.Arrays; import org.jspecify.annotations.Nullable; -/** - * A subject for {@code float[]} values. - */ +/** A subject for {@code float[]} values. */ public final class PrimitiveFloatArraySubject extends Subject { private final float @Nullable [] actual; @@ -131,9 +129,9 @@ private static float checkedToFloat(Number expected) { expected instanceof Float || expected instanceof Integer || expected instanceof Long; if (!okType) { throw new IllegalArgumentException( - "Expected value in assertion using exact float equality was of unsupported type " - + SubjectUtils.longName(expected.getClass()) - + " (it may not have an exact float representation)"); + "Expected value in assertion using exact float equality was of unsupported type " + + SubjectUtils.longName(expected.getClass()) + + " (it may not have an exact float representation)"); } if (expected instanceof Integer) { checkArgument( diff --git a/core/src/main/java/com/google/common/truth/PrimitiveIntArraySubject.java b/core/src/main/java/com/google/common/truth/PrimitiveIntArraySubject.java index e2eae4a3a..2dcce65ff 100644 --- a/core/src/main/java/com/google/common/truth/PrimitiveIntArraySubject.java +++ b/core/src/main/java/com/google/common/truth/PrimitiveIntArraySubject.java @@ -21,9 +21,7 @@ import com.google.common.primitives.Ints; import org.jspecify.annotations.Nullable; -/** - * A subject for {@code int[]} values. - */ +/** A subject for {@code int[]} values. */ public final class PrimitiveIntArraySubject extends Subject { private final int @Nullable [] actual; diff --git a/core/src/main/java/com/google/common/truth/PrimitiveLongArraySubject.java b/core/src/main/java/com/google/common/truth/PrimitiveLongArraySubject.java index 9d1111923..6ab4bb177 100644 --- a/core/src/main/java/com/google/common/truth/PrimitiveLongArraySubject.java +++ b/core/src/main/java/com/google/common/truth/PrimitiveLongArraySubject.java @@ -21,9 +21,7 @@ import com.google.common.primitives.Longs; import org.jspecify.annotations.Nullable; -/** - * A subject for {@code long[]} values. - */ +/** A subject for {@code long[]} values. */ public final class PrimitiveLongArraySubject extends Subject { private final long @Nullable [] actual; diff --git a/core/src/main/java/com/google/common/truth/PrimitiveShortArraySubject.java b/core/src/main/java/com/google/common/truth/PrimitiveShortArraySubject.java index fbed101b1..ccb5c22dc 100644 --- a/core/src/main/java/com/google/common/truth/PrimitiveShortArraySubject.java +++ b/core/src/main/java/com/google/common/truth/PrimitiveShortArraySubject.java @@ -21,9 +21,7 @@ import com.google.common.primitives.Shorts; import org.jspecify.annotations.Nullable; -/** - * A subject for {@code short[]} values. - */ +/** A subject for {@code short[]} values. */ public final class PrimitiveShortArraySubject extends Subject { private final short @Nullable [] actual; diff --git a/core/src/main/java/com/google/common/truth/StackTraceCleaner.java b/core/src/main/java/com/google/common/truth/StackTraceCleaner.java index 386469100..338417e03 100644 --- a/core/src/main/java/com/google/common/truth/StackTraceCleaner.java +++ b/core/src/main/java/com/google/common/truth/StackTraceCleaner.java @@ -204,8 +204,9 @@ private static boolean isTruthEntrance(StackTraceElement stackTraceElement) { return isFromClassOrClassNestedInside(stackTraceElement, SUBJECT_CLASS) /* * Don't match classes _nested inside_ StandardSubjectBuilder because that would match - * Expect's Statement implementation. While we want to strip everything from there _down_, we - * don't want to strip everything from there _up_ (which would strip the test class itself!). + * Expect's Statement implementation. While we want to strip everything from there _down_, + * we don't want to strip everything from there _up_ (which would strip the test class + * itself!). * * (StandardSubjectBuilder is listed here only for its fail() methods, anyway, so we don't * have to worry about nested classes like we do with Subject.) diff --git a/core/src/main/java/com/google/common/truth/StreamSubject.java b/core/src/main/java/com/google/common/truth/StreamSubject.java index 1b49898ca..2e243b056 100644 --- a/core/src/main/java/com/google/common/truth/StreamSubject.java +++ b/core/src/main/java/com/google/common/truth/StreamSubject.java @@ -55,9 +55,7 @@ public final class StreamSubject extends Subject { private final @Nullable Stream actual; private final Supplier<@Nullable List> listSupplier; - private StreamSubject( - FailureMetadata metadata, - @Nullable Stream actual) { + private StreamSubject(FailureMetadata metadata, @Nullable Stream actual) { super(metadata, actual); this.actual = actual; this.listSupplier = diff --git a/core/src/main/java/com/google/common/truth/StringSubject.java b/core/src/main/java/com/google/common/truth/StringSubject.java index cf5bc1db9..7fbe43a8b 100644 --- a/core/src/main/java/com/google/common/truth/StringSubject.java +++ b/core/src/main/java/com/google/common/truth/StringSubject.java @@ -25,9 +25,7 @@ import java.util.regex.Pattern; import org.jspecify.annotations.Nullable; -/** - * A subject for {@link String} values. - */ +/** A subject for {@link String} values. */ public class StringSubject extends ComparableSubject { private final @Nullable String actual; diff --git a/core/src/main/java/com/google/common/truth/SubjectUtils.java b/core/src/main/java/com/google/common/truth/SubjectUtils.java index c082164f3..b5eff83f1 100644 --- a/core/src/main/java/com/google/common/truth/SubjectUtils.java +++ b/core/src/main/java/com/google/common/truth/SubjectUtils.java @@ -55,9 +55,7 @@ import java.util.concurrent.TimeoutException; import org.jspecify.annotations.Nullable; -/** - * Utility methods used in {@link Subject} implementors. - */ +/** Utility methods used in {@link Subject} implementors. */ final class SubjectUtils { private SubjectUtils() {} diff --git a/core/src/main/java/com/google/common/truth/TableSubject.java b/core/src/main/java/com/google/common/truth/TableSubject.java index 5ac9c4909..47dc24412 100644 --- a/core/src/main/java/com/google/common/truth/TableSubject.java +++ b/core/src/main/java/com/google/common/truth/TableSubject.java @@ -23,9 +23,7 @@ import com.google.common.collect.Tables; import org.jspecify.annotations.Nullable; -/** - * A subject for {@link Table} values. - */ +/** A subject for {@link Table} values. */ public final class TableSubject extends Subject { private final @Nullable Table actual; 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 844b1e5d8..ab648df9c 100644 --- a/core/src/main/java/com/google/common/truth/Truth.java +++ b/core/src/main/java/com/google/common/truth/Truth.java @@ -101,8 +101,7 @@ public static StandardSubjectBuilder assert_() { * StandardSubjectBuilder#about about(...)}, as discussed in this FAQ entry. */ - public static StandardSubjectBuilder assertWithMessage( - @Nullable String message) { + public static StandardSubjectBuilder assertWithMessage(@Nullable String message) { return assert_().withMessage(message); } diff --git a/core/src/test/java/com/google/common/truth/CustomFailureMessageTest.java b/core/src/test/java/com/google/common/truth/CustomFailureMessageTest.java index 62fa13620..04c32af38 100644 --- a/core/src/test/java/com/google/common/truth/CustomFailureMessageTest.java +++ b/core/src/test/java/com/google/common/truth/CustomFailureMessageTest.java @@ -25,9 +25,7 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -/** - * Tests (and effectively sample code) for custom error message for checks. - */ +/** Tests (and effectively sample code) for custom error message for checks. */ @SuppressWarnings("LenientFormatStringValidation") // Intentional for testing @RunWith(JUnit4.class) public class CustomFailureMessageTest { diff --git a/core/src/test/java/com/google/common/truth/IterableSubjectCorrespondenceTest.java b/core/src/test/java/com/google/common/truth/IterableSubjectCorrespondenceTest.java index ae3f86fe3..0b3b21c33 100644 --- a/core/src/test/java/com/google/common/truth/IterableSubjectCorrespondenceTest.java +++ b/core/src/test/java/com/google/common/truth/IterableSubjectCorrespondenceTest.java @@ -1277,8 +1277,8 @@ public void containsExactly_nullValueInArray() { public void containsExactly_nullArray() { // Truth is tolerant of this erroneous varargs call. List actual = Arrays.asList((String) null); - IterableSubject.UsingCorrespondence subject = assertThat(actual) - .comparingElementsUsing(STRING_PARSES_TO_INTEGER_CORRESPONDENCE); + IterableSubject.UsingCorrespondence subject = + assertThat(actual).comparingElementsUsing(STRING_PARSES_TO_INTEGER_CORRESPONDENCE); Ordered ordered; try { ordered = subject.containsExactly((Integer[]) null); diff --git a/core/src/test/java/com/google/common/truth/MapSubjectTest.java b/core/src/test/java/com/google/common/truth/MapSubjectTest.java index edeb1421c..9fb103c04 100644 --- a/core/src/test/java/com/google/common/truth/MapSubjectTest.java +++ b/core/src/test/java/com/google/common/truth/MapSubjectTest.java @@ -1518,8 +1518,8 @@ public void comparingValuesUsing_containsEntry_handlesFormatDiffExceptions() { assertThat(e) .factValue("first exception", 0) .startsWith( - "compare(null, 60) threw" - + " com.google.common.truth.TestCorrespondences$NullPointerExceptionFromWithin10Of"); + "compare(null, 60) threw " + + "com.google.common.truth.TestCorrespondences$NullPointerExceptionFromWithin10Of"); assertThat(e) .factValue("first exception", 1) .startsWith("formatDiff(null, 60) threw java.lang.NullPointerException"); @@ -2059,8 +2059,8 @@ public void comparingValuesUsing_containsExactlyEntriesIn_handlesFormatDiffExcep assertThat(e) .factValue("first exception", 0) .startsWith( - "compare(null, 60) threw" - + " com.google.common.truth.TestCorrespondences$NullPointerExceptionFromWithin10Of"); + "compare(null, 60) threw " + + "com.google.common.truth.TestCorrespondences$NullPointerExceptionFromWithin10Of"); assertThat(e) .factValue("first exception", 1) .startsWith("formatDiff(null, 60) threw java.lang.NullPointerException"); @@ -2494,8 +2494,8 @@ public void comparingValuesUsing_containsAtLeastEntriesIn_handlesFormatDiffExcep assertThat(e) .factValue("first exception", 0) .startsWith( - "compare(null, 60) threw" - + " com.google.common.truth.TestCorrespondences$NullPointerExceptionFromWithin10Of"); + "compare(null, 60) threw " + + "com.google.common.truth.TestCorrespondences$NullPointerExceptionFromWithin10Of"); assertThat(e) .factValue("first exception", 1) .startsWith("formatDiff(null, 60) threw java.lang.NullPointerException"); diff --git a/core/src/test/java/com/google/common/truth/MathUtilTest.java b/core/src/test/java/com/google/common/truth/MathUtilTest.java index fe9d08e22..364051476 100644 --- a/core/src/test/java/com/google/common/truth/MathUtilTest.java +++ b/core/src/test/java/com/google/common/truth/MathUtilTest.java @@ -24,9 +24,7 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -/** - * Tests for {@link MathUtil} used by numeric subjects. - */ +/** Tests for {@link MathUtil} used by numeric subjects. */ @RunWith(JUnit4.class) public class MathUtilTest { @Test diff --git a/core/src/test/java/com/google/common/truth/NumericComparisonTest.java b/core/src/test/java/com/google/common/truth/NumericComparisonTest.java index 6ce3712fd..a38ec35e5 100644 --- a/core/src/test/java/com/google/common/truth/NumericComparisonTest.java +++ b/core/src/test/java/com/google/common/truth/NumericComparisonTest.java @@ -24,9 +24,7 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -/** - * Tests for comparisons between various integral types. - */ +/** Tests for comparisons between various integral types. */ @RunWith(JUnit4.class) @SuppressWarnings("SelfAssertion") public class NumericComparisonTest { diff --git a/core/src/test/java/com/google/common/truth/PrimitiveShortArraySubjectTest.java b/core/src/test/java/com/google/common/truth/PrimitiveShortArraySubjectTest.java index 8b5094cc5..7beb461b7 100644 --- a/core/src/test/java/com/google/common/truth/PrimitiveShortArraySubjectTest.java +++ b/core/src/test/java/com/google/common/truth/PrimitiveShortArraySubjectTest.java @@ -24,9 +24,7 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -/** - * Tests for {@link PrimitiveShortArraySubject}. - */ +/** Tests for {@link PrimitiveShortArraySubject}. */ @RunWith(JUnit4.class) public class PrimitiveShortArraySubjectTest { diff --git a/extensions/liteproto/src/main/java/com/google/common/truth/extensions/proto/LiteProtoTruth.java b/extensions/liteproto/src/main/java/com/google/common/truth/extensions/proto/LiteProtoTruth.java index 2166e713b..2673534ab 100644 --- a/extensions/liteproto/src/main/java/com/google/common/truth/extensions/proto/LiteProtoTruth.java +++ b/extensions/liteproto/src/main/java/com/google/common/truth/extensions/proto/LiteProtoTruth.java @@ -21,8 +21,8 @@ import com.google.common.truth.Subject; import com.google.errorprone.annotations.CheckReturnValue; import com.google.protobuf.MessageLite; -import org.jspecify.annotations.Nullable; import org.jspecify.annotations.NullMarked; +import org.jspecify.annotations.Nullable; /** * A set of static methods to begin a Truth assertion chain for the lite version of protocol diff --git a/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/DiffResult.java b/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/DiffResult.java index 990d350d1..b2c91f358 100644 --- a/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/DiffResult.java +++ b/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/DiffResult.java @@ -260,7 +260,7 @@ private static String indexed(String fieldPrefix, Optional fieldIndex) @Override final void printContents(boolean includeMatches, String fieldPrefix, StringBuilder sb) { printContentsForRepeatedField( - /* includeSelfAlways = */ false, includeMatches, fieldPrefix, sb); + /* includeSelfAlways= */ false, includeMatches, fieldPrefix, sb); } // When printing results for a repeated field, we want to print matches even if @@ -432,7 +432,7 @@ final void printContents(boolean includeMatches, String fieldPrefix, StringBuild fieldPrefix = newFieldPrefix(fieldPrefix, fieldDescriptor().getName()); for (PairResult pairResult : pairResults()) { pairResult.printContentsForRepeatedField( - /* includeSelfAlways = */ !isMatched(), includeMatches, fieldPrefix, sb); + /* includeSelfAlways= */ !isMatched(), includeMatches, fieldPrefix, sb); } } @@ -627,11 +627,11 @@ final String printToString(boolean reportMismatchesOnly) { if (!isMatched()) { sb.append("Differences were found:\n"); - printContents(/* includeMatches = */ false, /* fieldPrefix = */ "", sb); + printContents(/* includeMatches= */ false, /* fieldPrefix= */ "", sb); if (!reportMismatchesOnly && isAnyChildMatched()) { sb.append("\nFull diff report:\n"); - printContents(/* includeMatches = */ true, /* fieldPrefix = */ "", sb); + printContents(/* includeMatches= */ true, /* fieldPrefix= */ "", sb); } } else { sb.append("No differences were found."); @@ -641,7 +641,7 @@ final String printToString(boolean reportMismatchesOnly) { } else { sb.append("\nFull diff report:\n"); } - printContents(/* includeMatches = */ true, /* fieldPrefix = */ "", sb); + printContents(/* includeMatches= */ true, /* fieldPrefix= */ "", sb); } } diff --git a/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/FieldScopeLogic.java b/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/FieldScopeLogic.java index 312c04e6d..00d031471 100644 --- a/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/FieldScopeLogic.java +++ b/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/FieldScopeLogic.java @@ -120,7 +120,7 @@ FieldScopeLogic ignoringFields(Iterable fieldNumbers) { } return and( this, - new NegationFieldScopeLogic(new FieldNumbersLogic(fieldNumbers, /* isRecursive = */ true))); + new NegationFieldScopeLogic(new FieldNumbersLogic(fieldNumbers, /* isRecursive= */ true))); } FieldScopeLogic ignoringFieldDescriptors(Iterable fieldDescriptors) { @@ -130,35 +130,35 @@ FieldScopeLogic ignoringFieldDescriptors(Iterable fieldDescript return and( this, new NegationFieldScopeLogic( - new FieldDescriptorsLogic(fieldDescriptors, /* isRecursive = */ true))); + new FieldDescriptorsLogic(fieldDescriptors, /* isRecursive= */ true))); } FieldScopeLogic allowingFields(Iterable fieldNumbers) { if (isEmpty(fieldNumbers)) { return this; } - return or(this, new FieldNumbersLogic(fieldNumbers, /* isRecursive = */ true)); + return or(this, new FieldNumbersLogic(fieldNumbers, /* isRecursive= */ true)); } FieldScopeLogic allowingFieldsNonRecursive(Iterable fieldNumbers) { if (isEmpty(fieldNumbers)) { return this; } - return or(this, new FieldNumbersLogic(fieldNumbers, /* isRecursive = */ false)); + return or(this, new FieldNumbersLogic(fieldNumbers, /* isRecursive= */ false)); } FieldScopeLogic allowingFieldDescriptors(Iterable fieldDescriptors) { if (isEmpty(fieldDescriptors)) { return this; } - return or(this, new FieldDescriptorsLogic(fieldDescriptors, /* isRecursive = */ true)); + return or(this, new FieldDescriptorsLogic(fieldDescriptors, /* isRecursive= */ true)); } FieldScopeLogic allowingFieldDescriptorsNonRecursive(Iterable fieldDescriptors) { if (isEmpty(fieldDescriptors)) { return this; } - return or(this, new FieldDescriptorsLogic(fieldDescriptors, /* isRecursive = */ false)); + return or(this, new FieldDescriptorsLogic(fieldDescriptors, /* isRecursive= */ false)); } ////////////////////////////////////////////////////////////////////////////////////////////////// @@ -331,7 +331,7 @@ final FieldScopeResult policyFor(Descriptor rootDescriptor, SubScopeId subScopeI } if (matchesFieldDescriptor(rootDescriptor, fieldDescriptor)) { - return FieldScopeResult.of(/* included = */ true, isRecursive); + return FieldScopeResult.of(/* included= */ true, isRecursive); } // We return 'EXCLUDED_NONRECURSIVELY' for both field descriptor scopes and field number diff --git a/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/FluentEqualityConfig.java b/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/FluentEqualityConfig.java index 9659b1e09..5b6d55639 100644 --- a/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/FluentEqualityConfig.java +++ b/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/FluentEqualityConfig.java @@ -90,7 +90,6 @@ public ProtoTruthMessageDifferencer load(Descriptor descriptor) { abstract FieldScopeLogicMap> floatCorrespondenceMap(); - abstract boolean compareExpectedFieldsOnly(); // Whether 'withExpectedMessages()' has been invoked. This is a book-keeping boolean to ensure @@ -411,7 +410,6 @@ abstract Builder setDoubleCorrespondenceMap( abstract Builder setFloatCorrespondenceMap( FieldScopeLogicMap> floatCorrespondenceMap); - abstract Builder setCompareExpectedFieldsOnly(boolean compare); abstract Builder setHasExpectedMessages(boolean hasExpectedMessages); diff --git a/refactorings/src/main/java/com/google/common/truth/refactorings/CorrespondenceSubclassToFactoryCall.java b/refactorings/src/main/java/com/google/common/truth/refactorings/CorrespondenceSubclassToFactoryCall.java index 3c78f6fb6..1e0e32bfb 100644 --- a/refactorings/src/main/java/com/google/common/truth/refactorings/CorrespondenceSubclassToFactoryCall.java +++ b/refactorings/src/main/java/com/google/common/truth/refactorings/CorrespondenceSubclassToFactoryCall.java @@ -285,7 +285,10 @@ private String visibilityModifierOnConstructor(ClassTree tree) { .orElse(""); } - /** Returns all calls to the constructor for the given {@code classSymbol}, organized by {@linkplain ParentType whether they happen inside a call to {@code comparingElementsUsing}. */ + /** + * Returns all calls to the constructor for the given {@code classSymbol}, organized by {@link + * ParentType} (i.e., whether they happen inside a call to {@code comparingElementsUsing}). + */ private static SetMultimap findCalls( Symbol classSymbol, VisitorState state) { SetMultimap calls = HashMultimap.create(); @@ -410,7 +413,11 @@ private static ImmutableList computePossibleReplacements( .collect(toImmutableList()); } - /** Returns one or more possible replacements for the given correspondence's {@code compare} method's definition and for code to pass to {@code Correspondence.from) to construct a correspondence that uses the replacement. */ + /** + * Returns one or more possible replacements for the given correspondence's {@code compare} + * method's definition and for code to pass to {@code Correspondence.from} to construct a + * correspondence that uses the replacement. + */ private static ImmutableList makeBinaryPredicates( ClassTree classTree, MethodTree compareMethod, VisitorState state) { Tree comparison = maybeMakeLambdaBody(compareMethod, state);