Skip to content

Commit

Permalink
Fix grammar in Javadoc comments.
Browse files Browse the repository at this point in the history
Fixes #1022

COPYBARA_INTEGRATE_REVIEW=#1022 from hpa16:fix-docs b3619e9
PiperOrigin-RevId: 647376732
  • Loading branch information
hpa16 authored and Google Java Core Libraries committed Jun 27, 2024
1 parent afda443 commit af140d6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
29 changes: 15 additions & 14 deletions core/src/main/java/com/google/common/truth/IterableSubject.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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.
*
Expand All @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -1043,7 +1044,7 @@ public final String toString() {
*
* <p>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.
*
Expand Down Expand Up @@ -1085,8 +1086,8 @@ public UsingCorrespondence<A, E> displayingDiffsPairedBy(Function<? super E, ?>
* <p>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.
*
* <p>The expected elements given in the assertion should be uniquely keyed by {@code
Expand Down Expand Up @@ -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.
*
* <p>To also test that the contents appear in the given order, make a call to {@code inOrder()}
Expand All @@ -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.
*
* <p>To also test that the contents appear in the given order, make a call to {@code inOrder()}
Expand Down Expand Up @@ -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.
*
* <p>To also test that the contents appear in the given order, make a call to {@code inOrder()}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/com/google/common/truth/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit af140d6

Please sign in to comment.