diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/src/org/aspectj/util/LangUtil.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/util/src/org/aspectj/util/LangUtil.java b/util/src/org/aspectj/util/LangUtil.java index ce339e0a1..9d3103011 100644 --- a/util/src/org/aspectj/util/LangUtil.java +++ b/util/src/org/aspectj/util/LangUtil.java @@ -86,6 +86,24 @@ public class LangUtil { return false; } } + + private static boolean is13VMOrGreater = true; + private static boolean is14VMOrGreater = true; + private static boolean is15VMOrGreater = false; + + static { + String vm = System.getProperty("java.runtime.version"); + if (vm==null) vm = System.getProperty("java.vm.version"); + if (vm.startsWith("1.3")) { + is14VMOrGreater = false; + } else if (vm.startsWith("1.5")) { + is15VMOrGreater = true; + } + } + + public static boolean is13VMOrGreater() { return is13VMOrGreater;} + public static boolean is14VMOrGreater() { return is14VMOrGreater;} + public static boolean is15VMOrGreater() { return is15VMOrGreater;} /** * Shorthand for "if null, throw IllegalArgumentException" |