diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/src/org/aspectj/util/LangUtil.java | 3 | ||||
-rw-r--r-- | util/testsrc/org/aspectj/util/LangUtilTest.java | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/util/src/org/aspectj/util/LangUtil.java b/util/src/org/aspectj/util/LangUtil.java index d33e54d99..fa831c457 100644 --- a/util/src/org/aspectj/util/LangUtil.java +++ b/util/src/org/aspectj/util/LangUtil.java @@ -92,7 +92,8 @@ public class LangUtil { private static boolean is15VMOrGreater = false; static { - String vm = System.getProperty("java.runtime.version"); + String vm = System.getProperty("java.version"); // JLS 20.18.7 + if (vm==null) vm = System.getProperty("java.runtime.version"); if (vm==null) vm = System.getProperty("java.vm.version"); if (vm.startsWith("1.3")) { is14VMOrGreater = false; diff --git a/util/testsrc/org/aspectj/util/LangUtilTest.java b/util/testsrc/org/aspectj/util/LangUtilTest.java index 8877815ee..eda805d38 100644 --- a/util/testsrc/org/aspectj/util/LangUtilTest.java +++ b/util/testsrc/org/aspectj/util/LangUtilTest.java @@ -100,6 +100,13 @@ public class LangUtilTest extends TestCase { resultString = "" + extracted; assertTrue(resultString + " != " + EXP, resultString.equals(EXP)); } + + public void testVersion() { + assertTrue(LangUtil.is13VMOrGreater()); // min vm now - floor may change + if (LangUtil.is15VMOrGreater()) { + assertTrue(LangUtil.is14VMOrGreater()); + } + } /** @see LangUtil.extractOptions(String[], String[][]) */ public void testExtractOptionsArrayCollector() { |