aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authoraclement <aclement>2005-05-12 10:49:25 +0000
committeraclement <aclement>2005-05-12 10:49:25 +0000
commit9b730456c99c01c7381317e7c4511ae238cfd027 (patch)
tree5e88eea3b29b1f231bb5a855beed9cca4765659f /util
parent6f27813f57cadc4729e9c501233a1c40520b2f43 (diff)
downloadaspectj-9b730456c99c01c7381317e7c4511ae238cfd027.tar.gz
aspectj-9b730456c99c01c7381317e7c4511ae238cfd027.zip
Reduced duplication of vm checking logic.
Diffstat (limited to 'util')
-rw-r--r--util/src/org/aspectj/util/LangUtil.java18
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"