From af140d666537d8a74f7fb3207e6a45403169901c Mon Sep 17 00:00:00 2001 From: Harini Pa Date: Thu, 27 Jun 2024 10:59:25 -0700 Subject: [PATCH] Fix grammar in Javadoc comments. Fixes #1022 COPYBARA_INTEGRATE_REVIEW=https://github.com/google/truth/pull/1022 from hpa16:fix-docs b3619e9cffebaae3168d2347e8f197f2e7c02f9b PiperOrigin-RevId: 647376732 --- .../google/common/truth/IterableSubject.java | 29 ++++++++++--------- .../com/google/common/truth/Platform.java | 2 +- .../com/google/common/truth/Platform.java | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/core/src/main/java/com/google/common/truth/IterableSubject.java b/core/src/main/java/com/google/common/truth/IterableSubject.java index c22f28682..8b3bc667c 100644 --- a/core/src/main/java/com/google/common/truth/IterableSubject.java +++ b/core/src/main/java/com/google/common/truth/IterableSubject.java @@ -115,7 +115,8 @@ protected IterableSubject(FailureMetadata metadata, @Nullable Iterable iterab protected String actualCustomStringRepresentation() { if (actual != null) { // Check the value of iterable.toString() against the default Object.toString() implementation - // so we can avoid things like "com.google.common.graph.Traverser$GraphTraverser$1@5e316c74" + // so that we can avoid things like + // "com.google.common.graph.Traverser$GraphTraverser$1@5e316c74" String objectToString = actual.getClass().getName() + '@' + Integer.toHexString(System.identityHashCode(actual)); if (actual.toString().equals(objectToString)) { @@ -256,7 +257,7 @@ public final void containsAnyIn(@Nullable Object[] expected) { } /** - * Checks that the actual iterable contains at least all of the expected elements or fails. If an + * Checks that the actual iterable contains at least all the expected elements or fails. If an * element appears more than once in the expected elements to this call then it must appear at * least that number of times in the actual elements. * @@ -273,7 +274,7 @@ public final Ordered containsAtLeast( } /** - * Checks that the actual iterable contains at least all of the expected elements or fails. If an + * Checks that the actual iterable contains at least all the expected elements or fails. If an * element appears more than once in the expected elements then it must appear at least that * number of times in the actual elements. * @@ -333,7 +334,7 @@ public void inOrder() { } /** - * Checks that the actual iterable contains at least all of the expected elements or fails. If an + * Checks that the actual iterable contains at least all the expected elements or fails. If an * element appears more than once in the expected elements then it must appear at least that * number of times in the actual elements. * @@ -711,7 +712,7 @@ enum ElementFactGrouping { } /** - * Checks that a actual iterable contains none of the excluded objects or fails. (Duplicates are + * Checks that an actual iterable contains none of the excluded objects or fails. (Duplicates are * irrelevant to this test, which fails if any of the actual elements equal any of the excluded.) */ public final void containsNoneOf( @@ -1043,7 +1044,7 @@ public final String toString() { * *

On assertions where it makes sense to do so, the elements are paired as follows: they are * keyed by {@code keyFunction}, and if an unexpected element and a missing element have the - * same non-null key then the they are paired up. (Elements with null keys are not paired.) The + * same non-null key then they are paired up. (Elements with null keys are not paired.) The * failure message will show paired elements together, and a diff will be shown if the {@link * Correspondence#formatDiff} method returns non-null. * @@ -1085,8 +1086,8 @@ public UsingCorrespondence displayingDiffsPairedBy(Function *

On assertions where it makes sense to do so, the elements are paired as follows: the * unexpected elements are keyed by {@code actualKeyFunction}, the missing elements are keyed by * {@code expectedKeyFunction}, and if an unexpected element and a missing element have the same - * non-null key then the they are paired up. (Elements with null keys are not paired.) The - * failure message will show paired elements together, and a diff will be shown if the {@link + * non-null key then they are paired up. (Elements with null keys are not paired.) The failure + * message will show paired elements together, and a diff will be shown if the {@link * Correspondence#formatDiff} method returns non-null. * *

The expected elements given in the assertion should be uniquely keyed by {@code @@ -1561,8 +1562,8 @@ private boolean failIfOneToOneMappingHasMissingOrExtra( } /** - * Checks that the subject contains elements that corresponds to all of the expected elements, - * i.e. that there is a 1:1 mapping between any subset of the actual elements and the expected + * Checks that the subject contains elements that correspond to all the expected elements, i.e. + * that there is a 1:1 mapping between any subset of the actual elements and the expected * elements where each pair of elements correspond. * *

To also test that the contents appear in the given order, make a call to {@code inOrder()} @@ -1576,8 +1577,8 @@ public final Ordered containsAtLeast(E first, E second, E @Nullable ... rest) { } /** - * Checks that the subject contains elements that corresponds to all of the expected elements, - * i.e. that there is a 1:1 mapping between any subset of the actual elements and the expected + * Checks that the subject contains elements that correspond to all the expected elements, i.e. + * that there is a 1:1 mapping between any subset of the actual elements and the expected * elements where each pair of elements correspond. * *

To also test that the contents appear in the given order, make a call to {@code inOrder()} @@ -1642,8 +1643,8 @@ public void inOrder() { } /** - * Checks that the subject contains elements that corresponds to all of the expected elements, - * i.e. that there is a 1:1 mapping between any subset of the actual elements and the expected + * Checks that the subject contains elements that correspond to all the expected elements, i.e. + * that there is a 1:1 mapping between any subset of the actual elements and the expected * elements where each pair of elements correspond. * *

To also test that the contents appear in the given order, make a call to {@code inOrder()} diff --git a/core/src/main/java/com/google/common/truth/Platform.java b/core/src/main/java/com/google/common/truth/Platform.java index 69944c1e4..59e47c37d 100644 --- a/core/src/main/java/com/google/common/truth/Platform.java +++ b/core/src/main/java/com/google/common/truth/Platform.java @@ -58,7 +58,7 @@ static boolean containsMatch(String actual, String regex) { } /** - * Returns an array containing all of the exceptions that were suppressed to deliver the given + * Returns an array containing all the exceptions that were suppressed to deliver the given * exception. If suppressed exceptions are not supported (pre-Java 1.7), an empty array will be * returned. */ diff --git a/core/src/main/java/com/google/common/truth/super/com/google/common/truth/Platform.java b/core/src/main/java/com/google/common/truth/super/com/google/common/truth/Platform.java index e50bd28ea..ff273b277 100644 --- a/core/src/main/java/com/google/common/truth/super/com/google/common/truth/Platform.java +++ b/core/src/main/java/com/google/common/truth/super/com/google/common/truth/Platform.java @@ -60,7 +60,7 @@ static boolean containsMatch(String subject, String regex) { } /** - * Returns an array containing all of the exceptions that were suppressed to deliver the given + * Returns an array containing all the exceptions that were suppressed to deliver the given * exception. Delegates to the getSuppressed() method on Throwable that is available in Java 1.7+ */ static Throwable[] getSuppressed(Throwable throwable) {