Skip to content

Commit 6ac6de2

Browse files
committed
Remove ListenableFuture support.
Closes #3232
1 parent 18d66a4 commit 6ac6de2

File tree

5 files changed

+4
-31
lines changed

5 files changed

+4
-31
lines changed

src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java

-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
* @author John Blum
9494
* @author Johannes Englmeier
9595
*/
96-
@SuppressWarnings("removal")
9796
public abstract class RepositoryFactorySupport
9897
implements BeanClassLoaderAware, BeanFactoryAware, EnvironmentAware, EnvironmentCapable {
9998

src/main/java/org/springframework/data/repository/util/QueryExecutionConverters.java

+4-9
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,21 @@
4646
import org.springframework.data.util.Streamable;
4747
import org.springframework.data.util.TypeInformation;
4848
import org.springframework.lang.Nullable;
49-
import org.springframework.scheduling.annotation.AsyncResult;
5049
import org.springframework.util.Assert;
5150
import org.springframework.util.ClassUtils;
5251
import org.springframework.util.ConcurrentReferenceHashMap;
5352
import org.springframework.util.ObjectUtils;
54-
import org.springframework.util.concurrent.ListenableFuture;
5553

5654
/**
5755
* Converters to potentially wrap the execution of a repository method into a variety of wrapper types potentially being
5856
* available on the classpath. Currently supported:
5957
* <ul>
6058
* <li>{@code java.util.concurrent.Future}</li>
6159
* <li>{@code java.util.concurrent.CompletableFuture}</li>
62-
* <li>{@code org.springframework.util.concurrent.ListenableFuture<}</li>
63-
* <li>{@code javaslang.collection.Seq}, {@code javaslang.collection.Map}, {@code javaslang.collection.Set} - as of
64-
* 1.13</li>
65-
* <li>{@code io.vavr.collection.Seq}, {@code io.vavr.collection.Map}, {@code io.vavr.collection.Set} - as of 2.0</li>
60+
* <li>{@code javaslang.collection.Seq}, {@code javaslang.collection.Map}, {@code javaslang.collection.Set} - as of 1.13
61+
* via {@link CustomCollections}</li>
62+
* <li>{@code io.vavr.collection.Seq}, {@code io.vavr.collection.Map}, {@code io.vavr.collection.Set} - as of 2.0 via
63+
* {@link CustomCollections}</li>
6664
* <li>Reactive wrappers supported by {@link org.springframework.data.util.ReactiveWrappers} - as of 2.0</li>
6765
* </ul>
6866
*
@@ -74,7 +72,6 @@
7472
* @since 1.8
7573
* @see NullableWrapperConverters
7674
*/
77-
@SuppressWarnings("removal")
7875
public abstract class QueryExecutionConverters {
7976

8077
private static final boolean VAVR_PRESENT = ClassUtils.isPresent("io.vavr.control.Try",
@@ -92,9 +89,7 @@ public abstract class QueryExecutionConverters {
9289

9390
WRAPPER_TYPES.add(WrapperType.singleValue(Future.class));
9491
UNWRAPPER_TYPES.add(WrapperType.singleValue(Future.class));
95-
WRAPPER_TYPES.add(WrapperType.singleValue(ListenableFuture.class));
9692
WRAPPER_TYPES.add(WrapperType.singleValue(CompletableFuture.class));
97-
UNWRAPPER_TYPES.add(WrapperType.singleValue(ListenableFuture.class));
9893
UNWRAPPER_TYPES.add(WrapperType.singleValue(CompletableFuture.class));
9994

10095
ALLOWED_PAGEABLE_TYPES.add(Slice.class);

src/test/java/org/springframework/data/repository/core/support/RepositoryFactorySupportUnitTests.java

-13
Original file line numberDiff line numberDiff line change
@@ -345,14 +345,6 @@ void wrapsExecutionResultIntoCompletableFutureIfConfigured() throws Exception {
345345
expect(prepareConvertingRepository(reference).findOneByFirstname("Foo"), reference);
346346
}
347347

348-
@Test // DATACMNS-714
349-
void wrapsExecutionResultIntoListenableFutureIfConfigured() throws Exception {
350-
351-
var reference = new User();
352-
353-
expect(prepareConvertingRepository(reference).findOneByLastname("Foo"), reference);
354-
}
355-
356348
@Test // DATACMNS-714
357349
void wrapsExecutionResultIntoCompletableFutureWithEntityCollectionIfConfigured() throws Exception {
358350

@@ -605,7 +597,6 @@ interface AnnotatedRepository {
605597

606598
}
607599

608-
@SuppressWarnings("removal")
609600
interface ConvertingRepository extends Repository<Object, Long> {
610601

611602
Set<String> convertListToStringSet();
@@ -625,10 +616,6 @@ interface ConvertingRepository extends Repository<Object, Long> {
625616
@Async
626617
CompletableFuture<List<User>> readAllByFirstname(String firstname);
627618

628-
// DATACMNS-714
629-
@Async
630-
CompletableFuture<User> findOneByLastname(String lastname);
631-
632619
// DATACMNS-714
633620
@Async
634621
CompletableFuture<List<User>> readAllByLastname(String lastname);

src/test/java/org/springframework/data/repository/util/QueryExecutionConvertersUnitTests.java

-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
import org.springframework.data.util.NullableWrapper;
4646
import org.springframework.data.util.Streamable;
4747
import org.springframework.data.util.TypeInformation;
48-
import org.springframework.util.concurrent.ListenableFuture;
4948

5049
import com.google.common.base.Optional;
5150

@@ -57,7 +56,6 @@
5756
* @author Maciek Opała
5857
* @author Johannes Englmeier
5958
*/
60-
@SuppressWarnings("removal")
6159
class QueryExecutionConvertersUnitTests {
6260

6361
DefaultConversionService conversionService;
@@ -75,7 +73,6 @@ void registersWrapperTypes() {
7573
assertThat(QueryExecutionConverters.supports(Optional.class)).isTrue();
7674
assertThat(QueryExecutionConverters.supports(java.util.Optional.class)).isTrue();
7775
assertThat(QueryExecutionConverters.supports(Future.class)).isTrue();
78-
assertThat(QueryExecutionConverters.supports(ListenableFuture.class)).isTrue();
7976
assertThat(QueryExecutionConverters.supports(CompletableFuture.class)).isTrue();
8077
assertThat(QueryExecutionConverters.supports(Option.class)).isTrue();
8178
assertThat(QueryExecutionConverters.supports(io.vavr.control.Option.class)).isTrue();
@@ -88,7 +85,6 @@ void registersUnwrapperTypes() {
8885
assertThat(QueryExecutionConverters.supportsUnwrapping(java.util.Optional.class)).isTrue();
8986
assertThat(QueryExecutionConverters.supportsUnwrapping(Future.class)).isTrue();
9087
assertThat(QueryExecutionConverters.supportsUnwrapping(CompletableFuture.class)).isTrue();
91-
assertThat(QueryExecutionConverters.supportsUnwrapping(ListenableFuture.class)).isTrue();
9288
assertThat(QueryExecutionConverters.supportsUnwrapping(Option.class)).isTrue();
9389
}
9490

src/test/java/org/springframework/data/util/NullableWrapperConvertersUnitTests.java

-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.junit.jupiter.api.BeforeEach;
2626
import org.junit.jupiter.api.Test;
2727
import org.springframework.core.convert.support.DefaultConversionService;
28-
import org.springframework.util.concurrent.ListenableFuture;
2928

3029
import com.google.common.base.Optional;
3130

@@ -36,7 +35,6 @@
3635
* @author Mark Paluch
3736
* @author Maciek Opała
3837
*/
39-
@SuppressWarnings("removal")
4038
class NullableWrapperConvertersUnitTests {
4139

4240
DefaultConversionService conversionService;
@@ -54,7 +52,6 @@ void registersWrapperTypes() {
5452
assertThat(NullableWrapperConverters.supports(Optional.class)).isTrue();
5553
assertThat(NullableWrapperConverters.supports(java.util.Optional.class)).isTrue();
5654
assertThat(NullableWrapperConverters.supports(Future.class)).isFalse();
57-
assertThat(NullableWrapperConverters.supports(ListenableFuture.class)).isFalse();
5855
assertThat(NullableWrapperConverters.supports(CompletableFuture.class)).isFalse();
5956
assertThat(NullableWrapperConverters.supports(Option.class)).isTrue();
6057
assertThat(NullableWrapperConverters.supports(io.vavr.control.Option.class)).isTrue();
@@ -66,7 +63,6 @@ void registersUnwrapperTypes() {
6663
assertThat(NullableWrapperConverters.supportsUnwrapping(Optional.class)).isTrue();
6764
assertThat(NullableWrapperConverters.supportsUnwrapping(java.util.Optional.class)).isTrue();
6865
assertThat(NullableWrapperConverters.supportsUnwrapping(Future.class)).isFalse();
69-
assertThat(NullableWrapperConverters.supportsUnwrapping(ListenableFuture.class)).isFalse();
7066
assertThat(NullableWrapperConverters.supportsUnwrapping(CompletableFuture.class)).isFalse();
7167
assertThat(NullableWrapperConverters.supportsUnwrapping(Option.class)).isTrue();
7268
}

0 commit comments

Comments
 (0)