You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2017/12/09 19:03:46 UTC
[2/4] ant git commit: deal with theoretical case of version scheme
changing again
deal with theoretical case of version scheme changing again
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/6cd989e5
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/6cd989e5
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/6cd989e5
Branch: refs/heads/1.9.x
Commit: 6cd989e534dd52130f932ce04d3ca8aafe387cc9
Parents: 4ea3946
Author: Stefan Bodewig <bo...@apache.org>
Authored: Sat Dec 9 19:29:09 2017 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Sat Dec 9 19:29:09 2017 +0100
----------------------------------------------------------------------
src/main/org/apache/tools/ant/util/JavaEnvUtils.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/6cd989e5/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/JavaEnvUtils.java b/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
index 7c980c8..359174a 100644
--- a/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
+++ b/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
@@ -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