Skip to content

Commit

Permalink
Add @since tags for the first batch of Java-8-related APIs.
Browse files Browse the repository at this point in the history
(Those are the ones from cl/597243015, cl/598637400, and cl/598664192.)

RELNOTES=n/a
PiperOrigin-RevId: 599916105
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Jan 19, 2024
1 parent 78d27dd commit 93b4d93
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* stream before asserting on it.
*
* @author Kurt Alfred Kluever
* @since 1.3.0 (previously part of {@code truth-java8-extension})
*/
@SuppressWarnings({
"deprecation", // TODO(b/134064106): design an alternative to no-arg check()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* stream before asserting on it.
*
* @author Kurt Alfred Kluever
* @since 1.3.0 (previously part of {@code truth-java8-extension})
*/
@SuppressWarnings({
"deprecation", // TODO(b/134064106): design an alternative to no-arg check()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* Propositions for Java 8 {@link OptionalDouble} subjects.
*
* @author Ben Douglass
* @since 1.3.0 (previously part of {@code truth-java8-extension})
*/
@SuppressWarnings("Java7ApiChecker") // used only from APIs with Java 8 in their signatures
@IgnoreJRERequirement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* Propositions for Java 8 {@link OptionalInt} subjects.
*
* @author Ben Douglass
* @since 1.3.0 (previously part of {@code truth-java8-extension})
*/
@SuppressWarnings("Java7ApiChecker") // used only from APIs with Java 8 in their signatures
@IgnoreJRERequirement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* Propositions for Java 8 {@link OptionalLong} subjects.
*
* @author Ben Douglass
* @since 1.3.0 (previously part of {@code truth-java8-extension})
*/
@SuppressWarnings("Java7ApiChecker") // used only from APIs with Java 8 in their signatures
@IgnoreJRERequirement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* Propositions for Java 8 {@link Optional} subjects.
*
* @author Christian Gruber
* @since 1.3.0 (previously part of {@code truth-java8-extension})
*/
@SuppressWarnings("Java7ApiChecker") // used only from APIs with Java 8 in their signatures
@IgnoreJRERequirement
Expand Down
6 changes: 5 additions & 1 deletion core/src/main/java/com/google/common/truth/PathSubject.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
import com.google.j2objc.annotations.J2ObjCIncompatible;
import java.nio.file.Path;

/** Assertions for {@link Path} instances. */
/**
* Assertions for {@link Path} instances.
*
* @since 1.3.0 (previously part of {@code truth-java8-extension})
*/
@GwtIncompatible
@J2ObjCIncompatible
@J2ktIncompatible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ public final TableSubject that(@Nullable Table<?, ?, ?> actual) {
return new TableSubject(metadata(), actual);
}

/**
* @since 1.3.0 (with access to {@link OptionalSubject} previously part of {@code
* truth-java8-extension})
*/
@SuppressWarnings({
"Java7ApiChecker", // no more dangerous that wherever the user got the Optional
"NullableOptional", // Truth always accepts nulls, no matter the type
Expand All @@ -178,6 +182,10 @@ public final OptionalSubject that(@Nullable Optional<?> actual) {
return new OptionalSubject(metadata(), actual, "optional");
}

/**
* @since 1.3.0 (with access to {@link StreamSubject} previously part of {@code
* truth-java8-extension})
*/
@SuppressWarnings("Java7ApiChecker") // no more dangerous that wherever the user got the Stream
public final StreamSubject that(@Nullable Stream<?> actual) {
return new StreamSubject(metadata(), actual);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
* stream before asserting on it.
*
* @author Kurt Alfred Kluever
* @since 1.3.0 (previously part of {@code truth-java8-extension})
*/
@SuppressWarnings("Java7ApiChecker") // used only from APIs with Java 8 in their signatures
@IgnoreJRERequirement
Expand Down
6 changes: 6 additions & 0 deletions core/src/main/java/com/google/common/truth/Truth.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,18 @@ public static TableSubject assertThat(@Nullable Table<?, ?, ?> actual) {

@SuppressWarnings("Java7ApiChecker") // no more dangerous that wherever the user got the Optional
@GwtIncompatible // creates ambiguities (Eclipse bug 577808 or similar?)
/**
* @since 1.3.0 (present in {@link Truth8} since before 1.0)
*/
public static <T> OptionalSubject assertThat(@Nullable Optional<T> actual) {
return assert_().that(actual);
}

@SuppressWarnings("Java7ApiChecker") // no more dangerous that wherever the user got the Stream
@GwtIncompatible // creates ambiguities (Eclipse bug 577808 or similar?)
/**
* @since 1.3.0 (present in {@link Truth8} since before 1.0)
*/
public static <T extends @Nullable Object> StreamSubject assertThat(@Nullable Stream<T> actual) {
return assert_().that(actual);
}
Expand Down

0 comments on commit 93b4d93

Please sign in to comment.