aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2021-03-13 14:16:30 +0700
committerAlexander Kriegisch <Alexander@Kriegisch.name>2021-03-13 14:16:30 +0700
commit07af5d416e94791eb92ae1123e87394e8d22ad80 (patch)
tree3ebcb45b6f5a159cc10bdc4bd9391b05ba6cbdc8
parent8ea523635a79807c9b9db79f0c90ff3e2d2d29aa (diff)
downloadaspectj-07af5d416e94791eb92ae1123e87394e8d22ad80.tar.gz
aspectj-07af5d416e94791eb92ae1123e87394e8d22ad80.zip
Make BCEL classpath utility recognise Java 15, fixing many tests
Inside org.aspectj.apache.bcel.util.ClassPath.getClassPath(), some JVM version matching occurs which previously did not include Java 15. Technically, AspectJ 1.9.6 does not support Java 15, but on GitHub Actions there is a build job running on a JVM 15. This change should at least make the weaver tests pass, making that test job more meaningful. This fixes test errors like java.lang.ClassCastException: class org.aspectj.weaver.MissingResolvedTypeWithKnownSignature cannot be cast to class org.aspectj.weaver.ReferenceType (org.aspectj.weaver.MissingResolvedTypeWithKnownSignature and org.aspectj.weaver.ReferenceType are in unnamed module of loader 'app') Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java6
1 files changed, 1 insertions, 5 deletions
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java
index 35666b334..7d3d18de6 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ClassPath.java
@@ -227,11 +227,7 @@ public class ClassPath implements Serializable {
}
// On Java9 the sun.boot.class.path won't be set. System classes accessible through JRT filesystem
- if (vm_version.startsWith("9") || vm_version.startsWith("10")
- || vm_version.startsWith("11")
- || vm_version.startsWith("12")
- || vm_version.startsWith("13")
- || vm_version.startsWith("14")) {
+ if (vm_version.matches("^(9|10|11|12|13|14|15).*")) {
buf.insert(0, File.pathSeparatorChar);
buf.insert(0, System.getProperty("java.home") + File.separator + "lib" + File.separator + JRT_FS);
}