21
21
import java .util .concurrent .CompletableFuture ;
22
22
import java .util .concurrent .Future ;
23
23
24
- import org .springframework .core .SpringVersion ;
25
24
import org .springframework .core .convert .ConversionService ;
26
25
import org .springframework .core .convert .TypeDescriptor ;
27
26
import org .springframework .core .convert .converter .Converter ;
28
27
import org .springframework .core .convert .converter .GenericConverter ;
29
28
import org .springframework .core .convert .support .ConfigurableConversionService ;
30
- import org .springframework .data .util .Version ;
31
29
import org .springframework .scheduling .annotation .AsyncResult ;
32
30
import org .springframework .util .Assert ;
33
31
import org .springframework .util .ClassUtils ;
44
42
*/
45
43
public abstract class QueryExecutionConverters {
46
44
47
- private static final Version SPRING_VERSION = Version .parse (SpringVersion .getVersion ());
48
- private static final Version FOUR_DOT_TWO = new Version (4 , 2 );
45
+ private static final boolean SPRING_4_2_PRESENT = ClassUtils .isPresent (
46
+ "org.springframework.core.annotation.AnnotationConfigurationException" ,
47
+ QueryExecutionConverters .class .getClassLoader ());
49
48
50
49
private static final boolean GUAVA_PRESENT = ClassUtils .isPresent ("com.google.common.base.Optional" ,
51
50
QueryExecutionConverters .class .getClassLoader ());
@@ -67,7 +66,7 @@ public abstract class QueryExecutionConverters {
67
66
WRAPPER_TYPES .add (NullableWrapperToJdk8OptionalConverter .getWrapperType ());
68
67
}
69
68
70
- if (JDK_8_PRESENT && SPRING_VERSION . isGreaterThanOrEqualTo ( FOUR_DOT_TWO ) ) {
69
+ if (JDK_8_PRESENT && SPRING_4_2_PRESENT ) {
71
70
WRAPPER_TYPES .add (NullableWrapperToCompletableFutureConverter .getWrapperType ());
72
71
}
73
72
}
0 commit comments