Browse Source

deal with theoretical case of version scheme changing again

master
Stefan Bodewig 7 years ago
parent
commit
6cd989e534
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      src/main/org/apache/tools/ant/util/JavaEnvUtils.java

+ 6
- 2
src/main/org/apache/tools/ant/util/JavaEnvUtils.java View File

@@ -187,8 +187,12 @@ public final class JavaEnvUtils {
javaVersionNumber = VERSION_9;
// at least Java9 and this should properly support the purely numeric version property
String v = System.getProperty("java.specification.version");
javaVersionNumber = Integer.parseInt(v) * 10;
javaVersion = v;
DeweyDecimal pv = new DeweyDecimal(v);
javaVersionNumber = pv.get(0) * 10;
if (pv.getSize() > 1) {
javaVersionNumber += pv.get(1);
}
javaVersion = pv.toString();
} catch (Throwable t) {
// swallow as we've hit the max class version that
// we have


Loading…
Cancel
Save