Skip to content

Commit

Permalink
Suppress NullableOptional, as we already do in, e.g., `Truth.assert…
Browse files Browse the repository at this point in the history
…That(Optional)`.

RELNOTES=n/a
PiperOrigin-RevId: 609047209
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Feb 21, 2024
1 parent 3efe353 commit 559d636
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@
* @author Christian Gruber
*/
public final class GuavaOptionalSubject extends Subject {
@SuppressWarnings("NullableOptional") // Truth always accepts nulls, no matter the type
private final @Nullable Optional<?> actual;

GuavaOptionalSubject(
FailureMetadata metadata, @Nullable Optional<?> actual, @Nullable String typeDescription) {
FailureMetadata metadata,
@SuppressWarnings("NullableOptional") // Truth always accepts nulls, no matter the type
@Nullable Optional<?> actual,
@Nullable String typeDescription) {
super(metadata, actual, typeDescription);
this.actual = actual;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@
@SuppressWarnings("Java7ApiChecker") // used only from APIs with Java 8 in their signatures
@IgnoreJRERequirement
public final class OptionalSubject extends Subject {
@SuppressWarnings("NullableOptional") // Truth always accepts nulls, no matter the type
private final @Nullable Optional<?> actual;

OptionalSubject(
FailureMetadata failureMetadata,
@Nullable Optional<?> subject,
@SuppressWarnings("NullableOptional") // Truth always accepts nulls, no matter the type
@Nullable Optional<?> subject,
@Nullable String typeDescription) {
super(failureMetadata, subject, typeDescription);
this.actual = subject;
Expand Down

0 comments on commit 559d636

Please sign in to comment.