Skip to content

Commit bcd722f

Browse files
committed
Annotate android LocalCache.spliterator() with @IgnoreJRERequirement.
CI's animal-sniffer check on the android variant (gummy-bears-api-23) rejected the Spliterator override added in the previous commit because java.util.Spliterator and Spliterators.spliteratorUnknownSize(...) are not part of Android API 23. Following the established pattern in ImmutableCollection.java, Ints.java, and Longs.java under android/guava/src, annotate the method with the package-local @IgnoreJRERequirement. The method is only invoked from APIs whose signatures already carry Java 8 types, so callers are already gated by the same constraint. The guava/src variant is unaffected because it uses the java18 signature, which includes Spliterator. Made-with: Cursor
1 parent 6f9a06c commit bcd722f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

android/guava/src/com/google/common/cache/LocalCache.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4406,6 +4406,7 @@ public void clear() {
44064406
}
44074407

44084408
@Override
4409+
@IgnoreJRERequirement // used only from APIs with Java 8 types in them
44094410
public Spliterator<T> spliterator() {
44104411
return Spliterators.spliteratorUnknownSize(
44114412
iterator(), Spliterator.CONCURRENT | Spliterator.DISTINCT | Spliterator.NONNULL);

0 commit comments

Comments
 (0)