From e9e5013ccc3bc6f619836a36e95c94f964a74de7 Mon Sep 17 00:00:00 2001 From: Chris Povirk Date: Tue, 3 Dec 2024 13:01:01 -0500 Subject: [PATCH] Make function output types nullable instead of unspecified. --- .../github/benmanes/caffeine/cache/AsyncCache.java | 12 ++++++------ .../com/github/benmanes/caffeine/cache/Cache.java | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/caffeine/src/main/java/com/github/benmanes/caffeine/cache/AsyncCache.java b/caffeine/src/main/java/com/github/benmanes/caffeine/cache/AsyncCache.java index 5e1dc29a8a..94406763e0 100644 --- a/caffeine/src/main/java/com/github/benmanes/caffeine/cache/AsyncCache.java +++ b/caffeine/src/main/java/com/github/benmanes/caffeine/cache/AsyncCache.java @@ -75,7 +75,7 @@ public interface AsyncCache { */ @NullUnmarked @NonNull CompletableFuture get( - @NonNull K key, @NonNull Function mappingFunction); + @NonNull K key, @NonNull Function mappingFunction); /** * Returns the future associated with the {@code key} in this cache, obtaining that value from @@ -95,10 +95,10 @@ public interface AsyncCache { * @param mappingFunction the function to asynchronously compute a value, optionally using the * given executor * @return the current (existing or computed) future value associated with the specified key - * @throws NullPointerException if the specified key or mappingFunction is null, or if the future - * returned by the mappingFunction is null - * @throws RuntimeException or Error if the mappingFunction does when constructing the future, in - * which case the mapping is left unestablished + * @throws NullPointerException if the specified key or mappingFunction is null, or if the + * future returned by the mappingFunction is null + * @throws RuntimeException or Error if the mappingFunction does when constructing the future, + * in which case the mapping is left unestablished */ @NullUnmarked @NonNull CompletableFuture get( @@ -107,7 +107,7 @@ public interface AsyncCache { BiFunction< ? super @NonNull K, ? super @NonNull Executor, - ? extends @NonNull CompletableFuture> + ? extends @NonNull CompletableFuture> mappingFunction); /** diff --git a/caffeine/src/main/java/com/github/benmanes/caffeine/cache/Cache.java b/caffeine/src/main/java/com/github/benmanes/caffeine/cache/Cache.java index 4459fd0a5c..47dbd6f9ec 100644 --- a/caffeine/src/main/java/com/github/benmanes/caffeine/cache/Cache.java +++ b/caffeine/src/main/java/com/github/benmanes/caffeine/cache/Cache.java @@ -80,7 +80,7 @@ public interface Cache { * left unestablished */ @NullUnmarked - V get(@NonNull K key, Function mappingFunction); + V get(@NonNull K key, Function mappingFunction); /** * Returns a map of the values associated with the {@code keys} in this cache. The returned map