diff --git a/spring-core/src/main/java/org/springframework/core/DefaultParameterNameDiscoverer.java b/spring-core/src/main/java/org/springframework/core/DefaultParameterNameDiscoverer.java index 3bb8759a97b..72c07672344 100644 --- a/spring-core/src/main/java/org/springframework/core/DefaultParameterNameDiscoverer.java +++ b/spring-core/src/main/java/org/springframework/core/DefaultParameterNameDiscoverer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2015 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. @@ -16,6 +16,8 @@ package org.springframework.core; +import org.springframework.util.ClassUtils; + /** * Default implementation of the {@link ParameterNameDiscoverer} strategy interface, * using the Java 8 standard reflection mechanism (if available), and falling back @@ -31,8 +33,8 @@ package org.springframework.core; */ public class DefaultParameterNameDiscoverer extends PrioritizedParameterNameDiscoverer { - private static final boolean standardReflectionAvailable = - (JdkVersion.getMajorJavaVersion() >= JdkVersion.JAVA_18); + private static final boolean standardReflectionAvailable = ClassUtils.isPresent( + "java.lang.reflect.Executable", DefaultParameterNameDiscoverer.class.getClassLoader()); public DefaultParameterNameDiscoverer() { diff --git a/spring-core/src/main/java/org/springframework/core/JdkVersion.java b/spring-core/src/main/java/org/springframework/core/JdkVersion.java index 06da1f27220..2f359b9b036 100644 --- a/spring-core/src/main/java/org/springframework/core/JdkVersion.java +++ b/spring-core/src/main/java/org/springframework/core/JdkVersion.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2015 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. @@ -27,7 +27,10 @@ package org.springframework.core; * @author Juergen Hoeller * @author Rick Evans * @author Sam Brannen + * @deprecated as of Spring 4.2.1, in favor of direct checks for the desired + * JDK API variants via reflection */ +@Deprecated public abstract class JdkVersion { /** diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlRowSetResultSetExtractor.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlRowSetResultSetExtractor.java index f0347bb5774..355009656d7 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlRowSetResultSetExtractor.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlRowSetResultSetExtractor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2015 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. @@ -22,7 +22,6 @@ import javax.sql.rowset.CachedRowSet; import javax.sql.rowset.RowSetFactory; import javax.sql.rowset.RowSetProvider; -import org.springframework.core.JdkVersion; import org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet; import org.springframework.jdbc.support.rowset.SqlRowSet; import org.springframework.lang.UsesJava7; @@ -34,8 +33,8 @@ import org.springframework.util.ClassUtils; * *
The default implementation uses a standard JDBC CachedRowSet underneath.
* This means that JDBC RowSet support needs to be available at runtime:
- * by default, Sun's {@code com.sun.rowset.CachedRowSetImpl} class on Java 5 and 6,
- * or the {@code javax.sql.rowset.RowSetProvider} mechanism on Java 7 / JDBC 4.1.
+ * by default, Sun's {@code com.sun.rowset.CachedRowSetImpl} class on Java 6,
+ * or the {@code javax.sql.rowset.RowSetProvider} mechanism on Java 7+ / JDBC 4.1+.
*
* @author Juergen Hoeller
* @since 1.2
@@ -49,12 +48,13 @@ public class SqlRowSetResultSetExtractor implements ResultSetExtractor