From 35d379f9d3882a02f0368f928b2cecb975404334 Mon Sep 17 00:00:00 2001 From: Jens Dietrich Date: Wed, 14 Sep 2022 13:43:21 +1200 Subject: [PATCH 1/2] Add missing @Nullable in SettableListenableFuture Closes gh-29150 --- .../util/concurrent/SettableListenableFuture.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-core/src/main/java/org/springframework/util/concurrent/SettableListenableFuture.java b/spring-core/src/main/java/org/springframework/util/concurrent/SettableListenableFuture.java index e046fbd38cf..e0cce04a604 100644 --- a/spring-core/src/main/java/org/springframework/util/concurrent/SettableListenableFuture.java +++ b/spring-core/src/main/java/org/springframework/util/concurrent/SettableListenableFuture.java @@ -114,7 +114,7 @@ public class SettableListenableFuture implements ListenableFuture { * {@link java.util.concurrent.CancellationException} if the future has been cancelled. * @return the value associated with this future */ - @Override + @Override @Nullable public T get() throws InterruptedException, ExecutionException { return this.settableTask.get(); } From 529481c44c375c336de8b3b956aaadb13cfef6f9 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 14 Sep 2022 14:35:43 +0200 Subject: [PATCH 2/2] Polish contribution See gh-29150 --- .../util/concurrent/SettableListenableFuture.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/util/concurrent/SettableListenableFuture.java b/spring-core/src/main/java/org/springframework/util/concurrent/SettableListenableFuture.java index e0cce04a604..1bde73f6867 100644 --- a/spring-core/src/main/java/org/springframework/util/concurrent/SettableListenableFuture.java +++ b/spring-core/src/main/java/org/springframework/util/concurrent/SettableListenableFuture.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -114,7 +114,8 @@ public class SettableListenableFuture implements ListenableFuture { * {@link java.util.concurrent.CancellationException} if the future has been cancelled. * @return the value associated with this future */ - @Override @Nullable + @Nullable + @Override public T get() throws InterruptedException, ExecutionException { return this.settableTask.get(); } @@ -129,6 +130,7 @@ public class SettableListenableFuture implements ListenableFuture { * @param unit the unit of the timeout argument * @return the value associated with this future */ + @Nullable @Override public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return this.settableTask.get(timeout, unit);