Allow for building and testing the 3.2.x line against OpenJDK 8
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2013 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.
|
||||
@@ -54,6 +54,11 @@ public abstract class JdkVersion {
|
||||
*/
|
||||
public static final int JAVA_17 = 4;
|
||||
|
||||
/**
|
||||
* Constant identifying the 1.8 JVM (Java 8).
|
||||
*/
|
||||
public static final int JAVA_18 = 5;
|
||||
|
||||
|
||||
private static final String javaVersion;
|
||||
|
||||
@@ -62,7 +67,10 @@ public abstract class JdkVersion {
|
||||
static {
|
||||
javaVersion = System.getProperty("java.version");
|
||||
// version String should look like "1.4.2_10"
|
||||
if (javaVersion.contains("1.7.")) {
|
||||
if (javaVersion.contains("1.8.")) {
|
||||
majorJavaVersion = JAVA_18;
|
||||
}
|
||||
else if (javaVersion.contains("1.7.")) {
|
||||
majorJavaVersion = JAVA_17;
|
||||
}
|
||||
else if (javaVersion.contains("1.6.")) {
|
||||
@@ -87,7 +95,7 @@ public abstract class JdkVersion {
|
||||
|
||||
/**
|
||||
* Get the major version code. This means we can do things like
|
||||
* {@code if (getMajorJavaVersion() < JAVA_14)}.
|
||||
* {@code if (getMajorJavaVersion() >= JAVA_17)}.
|
||||
* @return a code comparable to the JAVA_XX codes in this class
|
||||
* @see #JAVA_13
|
||||
* @see #JAVA_14
|
||||
|
||||
Reference in New Issue
Block a user