From e41e0790c0cb073e9e2e30071afecfcdc4621d42 Mon Sep 17 00:00:00 2001 From: chibash Date: Fri, 27 Oct 2017 06:51:38 +0900 Subject: changes ClassPool#appendSystemPath(). The new implementation appends ClassClassPath when the JVM is earlier than 9. --- src/main/javassist/ClassPoolTail.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/javassist/ClassPoolTail.java b/src/main/javassist/ClassPoolTail.java index 681c550e..1b580855 100644 --- a/src/main/javassist/ClassPoolTail.java +++ b/src/main/javassist/ClassPoolTail.java @@ -240,8 +240,12 @@ final class ClassPoolTail { } public ClassPath appendSystemPath() { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - return appendClassPath(new LoaderClassPath(cl)); + if (javassist.bytecode.ClassFile.MAJOR_VERSION < javassist.bytecode.ClassFile.JAVA_9) + return appendClassPath(new ClassClassPath()); + else { + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + return appendClassPath(new LoaderClassPath(cl)); + } } public ClassPath insertClassPath(String pathname) -- cgit v1.2.3