LANG-1384: Fix NPE when version >= 11
The fix is likely to be insufficient if the version naming scheme changes.
This commit is contained in:
parent
0820c4c895
commit
cb686673a7
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue