diff --git a/src/main/java/org/apache/commons/lang3/JavaVersion.java b/src/main/java/org/apache/commons/lang3/JavaVersion.java index a07445363..60258f63a 100644 --- a/src/main/java/org/apache/commons/lang3/JavaVersion.java +++ b/src/main/java/org/apache/commons/lang3/JavaVersion.java @@ -191,6 +191,8 @@ public enum JavaVersion { if (Float.parseFloat(nom.substring(firstComma + 1, end)) > .9f) { return JAVA_RECENT; } + } else if (v > 10) { + return JAVA_RECENT; } return null; } diff --git a/src/test/java/org/apache/commons/lang3/JavaVersionTest.java b/src/test/java/org/apache/commons/lang3/JavaVersionTest.java index 4d4202c49..ad285654f 100644 --- a/src/test/java/org/apache/commons/lang3/JavaVersionTest.java +++ b/src/test/java/org/apache/commons/lang3/JavaVersionTest.java @@ -59,6 +59,7 @@ public class JavaVersionTest { assertEquals("1.10 failed", JAVA_RECENT, get("1.10")); // assertNull("2.10 unexpectedly worked", get("2.10")); assertEquals("Wrapper method failed", get("1.5"), getJavaVersion("1.5")); + assertEquals("Unhandled", JAVA_RECENT, get("11")); // LANG-1384 } @Test