aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/src/main/java/org/aspectj/util/LangUtil.java86
-rw-r--r--util/src/test/java/org/aspectj/util/LangUtilTest.java8
2 files changed, 8 insertions, 86 deletions
diff --git a/util/src/main/java/org/aspectj/util/LangUtil.java b/util/src/main/java/org/aspectj/util/LangUtil.java
index 9db8f629b..baf8d440e 100644
--- a/util/src/main/java/org/aspectj/util/LangUtil.java
+++ b/util/src/main/java/org/aspectj/util/LangUtil.java
@@ -110,90 +110,12 @@ public class LangUtil {
return result;
}
- @Deprecated
- public static boolean is1dot3VMOrGreater() {
- return 1.3 <= vmVersion;
+ public static boolean isVMGreaterOrEqual(int javaVersion) {
+ return isVMGreaterOrEqual((double) javaVersion);
}
- @Deprecated
- public static boolean is1dot4VMOrGreater() {
- return 1.4 <= vmVersion;
- }
-
- @Deprecated
- public static boolean is1dot5VMOrGreater() {
- return 1.5 <= vmVersion;
- }
-
- @Deprecated
- public static boolean is1dot6VMOrGreater() {
- return 1.6 <= vmVersion;
- }
-
- @Deprecated
- public static boolean is1dot7VMOrGreater() {
- return 1.7 <= vmVersion;
- }
-
- public static boolean is1dot8VMOrGreater() {
- return 1.8 <= vmVersion;
- }
-
- public static boolean is9VMOrGreater() {
- return 9 <= vmVersion;
- }
-
- public static boolean is10VMOrGreater() {
- return 10 <= vmVersion;
- }
-
- public static boolean is11VMOrGreater() {
- return 11 <= vmVersion;
- }
-
- public static boolean is12VMOrGreater() {
- return 12 <= vmVersion;
- }
-
- public static boolean is13VMOrGreater() {
- return 13 <= vmVersion;
- }
-
- public static boolean is14VMOrGreater() {
- return 14 <= vmVersion;
- }
-
- public static boolean is15VMOrGreater() {
- return 15 <= vmVersion;
- }
-
- public static boolean is16VMOrGreater() {
- return 16 <= vmVersion;
- }
-
- public static boolean is17VMOrGreater() {
- return 17 <= vmVersion;
- }
-
- public static boolean is18VMOrGreater() {
- return 18 <= vmVersion;
- }
-
- public static boolean is19VMOrGreater() {
- return 19 <= vmVersion;
- }
-
- public static boolean is20VMOrGreater() {
- return 20 <= vmVersion;
- }
-
- public static boolean is21VMOrGreater() {
- return 21 <= vmVersion;
- }
-
- // AspectJ_JDK_Update
- public static boolean is22VMOrGreater() {
- return 22 <= vmVersion;
+ public static boolean isVMGreaterOrEqual(double javaVersion) {
+ return javaVersion <= vmVersion;
}
/**
diff --git a/util/src/test/java/org/aspectj/util/LangUtilTest.java b/util/src/test/java/org/aspectj/util/LangUtilTest.java
index 0ac3e846e..7bd898e9b 100644
--- a/util/src/test/java/org/aspectj/util/LangUtilTest.java
+++ b/util/src/test/java/org/aspectj/util/LangUtilTest.java
@@ -101,10 +101,10 @@ public class LangUtilTest extends TestCase {
// }
public void testVersion() {
- assertTrue(LangUtil.is1dot8VMOrGreater()); // min vm now - floor may change
- if (LangUtil.is11VMOrGreater()) {
- assertTrue(LangUtil.is9VMOrGreater());
- assertTrue(LangUtil.is10VMOrGreater());
+ assertTrue(LangUtil.isVMGreaterOrEqual(1.8)); // min vm now - floor may change
+ if (LangUtil.isVMGreaterOrEqual(11)) {
+ assertTrue(LangUtil.isVMGreaterOrEqual(9));
+ assertTrue(LangUtil.isVMGreaterOrEqual(10));
}
}