true if available; false otherwise
+ */
+ public static boolean isMXBeanSupportAvailable() {
+ return mxBeanAnnotationAvailable;
+ }
+
/**
* Inner class to avoid a Java 6 dependency.
*/
private static class MXBeanChecker {
- public static Boolean hasMXBeanAnnotation(Class> iface) {
+ public static Boolean evaluateMXBeanAnnotation(Class> iface) {
MXBean mxBean = iface.getAnnotation(MXBean.class);
return (mxBean != null ? mxBean.value() : null);
}
diff --git a/org.springframework.core/src/main/java/org/springframework/core/CollectionFactory.java b/org.springframework.core/src/main/java/org/springframework/core/CollectionFactory.java
index a2055c2edf2..2cdff0ca5fa 100644
--- a/org.springframework.core/src/main/java/org/springframework/core/CollectionFactory.java
+++ b/org.springframework.core/src/main/java/org/springframework/core/CollectionFactory.java
@@ -26,8 +26,6 @@ import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.NavigableMap;
-import java.util.NavigableSet;
import java.util.Set;
import java.util.SortedMap;
import java.util.SortedSet;
@@ -36,6 +34,7 @@ import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet;
+import org.springframework.util.ClassUtils;
import org.springframework.util.LinkedCaseInsensitiveMap;
/**
@@ -53,21 +52,34 @@ import org.springframework.util.LinkedCaseInsensitiveMap;
*/
public abstract class CollectionFactory {
+ private static final String NAVIGABLE_SET_CLASS_NAME = "java.util.NavigableSet";
+
+ private static final String NAVIGABLE_MAP_CLASS_NAME = "java.util.NavigableMap";
+
private static final SetNote that Spring requires JVM 1.4 or higher, as of Spring 2.5. + *
Note that Spring requires JVM 1.5 or higher, as of Spring 3.0.
*
* @author Rod Johnson
* @author Juergen Hoeller
@@ -62,10 +62,10 @@ public abstract class JdkVersion {
static {
javaVersion = System.getProperty("java.version");
// version String should look like "1.4.2_10"
- if (javaVersion.indexOf("1.7.") != -1) {
+ if (javaVersion.contains("1.7.")) {
majorJavaVersion = JAVA_17;
}
- else if (javaVersion.indexOf("1.6.") != -1) {
+ else if (javaVersion.contains("1.6.")) {
majorJavaVersion = JAVA_16;
}
else {
@@ -99,6 +99,7 @@ public abstract class JdkVersion {
return majorJavaVersion;
}
+
/**
* Convenience method to determine if the current JVM is at least Java 1.4.
* @return true if the current JVM is at least Java 1.4
@@ -133,12 +134,15 @@ public abstract class JdkVersion {
* Convenience method to determine if the current JVM is at least
* Java 1.6 (Java 6).
* @return true if the current JVM is at least Java 1.6
+ * @deprecated as of Spring 3.0, in favor of reflective checks for
+ * the specific Java 1.6 classes of interest
* @see #getMajorJavaVersion()
* @see #JAVA_16
* @see #JAVA_17
*/
+ @Deprecated
public static boolean isAtLeastJava16() {
- return getMajorJavaVersion() >= JAVA_16;
+ return (majorJavaVersion >= JAVA_16);
}
}