Skip to content

Commit

Permalink
Fix one instance of incorrect nullability of type argument in FluentI…
Browse files Browse the repository at this point in the history
…terable.

RELNOTES=n/a
PiperOrigin-RevId: 678224792
  • Loading branch information
java-team-github-bot authored and Google Java Core Libraries committed Sep 24, 2024
1 parent a3b5188 commit d9dbb15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,9 @@ public final boolean allMatch(Predicate<? super E> predicate) {
*
* <p><b>{@code Stream} equivalent:</b> {@code stream.filter(predicate).findFirst()}.
*/
@SuppressWarnings("nullness") // Unsafe, but we can't do much about it now.
public final Optional<@NonNull E> firstMatch(Predicate<? super E> predicate) {
return Iterables.<E>tryFind((Iterable<@NonNull E>) getDelegate(), predicate);
// Unsafe, but we can't do much about it now.
return Iterables.<@NonNull E>tryFind((Iterable<@NonNull E>) getDelegate(), predicate);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions guava/src/com/google/common/collect/FluentIterable.java
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,9 @@ public final boolean allMatch(Predicate<? super E> predicate) {
*
* <p><b>{@code Stream} equivalent:</b> {@code stream.filter(predicate).findFirst()}.
*/
@SuppressWarnings("nullness") // Unsafe, but we can't do much about it now.
public final Optional<@NonNull E> firstMatch(Predicate<? super E> predicate) {
return Iterables.<E>tryFind((Iterable<@NonNull E>) getDelegate(), predicate);
// Unsafe, but we can't do much about it now.
return Iterables.<@NonNull E>tryFind((Iterable<@NonNull E>) getDelegate(), predicate);
}

/**
Expand Down

0 comments on commit d9dbb15

Please sign in to comment.