From 9f9b972f00afb8f851b0e12852d6c86432ca090f Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 2 May 2013 11:40:16 +0200 Subject: [PATCH] Prepared for JDK 1.9 Aiming for the JdkVersion class to support one generation ahead now, in order for the test suite to properly detect 1.7/1.8+ JVMs even when running against a JDK 1.9 preview at some point. --- .../main/java/org/springframework/core/JdkVersion.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 9204ad184f..a7c20f32c5 100644 --- a/spring-core/src/main/java/org/springframework/core/JdkVersion.java +++ b/spring-core/src/main/java/org/springframework/core/JdkVersion.java @@ -59,6 +59,11 @@ public abstract class JdkVersion { */ public static final int JAVA_18 = 5; + /** + * Constant identifying the 1.9 JVM (Java 9). + */ + public static final int JAVA_19 = 5; + private static final String javaVersion; @@ -67,7 +72,10 @@ public abstract class JdkVersion { static { javaVersion = System.getProperty("java.version"); // version String should look like "1.4.2_10" - if (javaVersion.contains("1.8.")) { + if (javaVersion.contains("1.9.")) { + majorJavaVersion = JAVA_19; + } + else if (javaVersion.contains("1.8.")) { majorJavaVersion = JAVA_18; } else if (javaVersion.contains("1.7.")) {