]> source.dussan.org Git - aspectj.git/commitdiff
Exclude delegation loader on JDK11 too (it has been renamed)
authorAndy Clement <aclement@pivotal.io>
Tue, 23 Oct 2018 23:44:14 +0000 (16:44 -0700)
committerAndy Clement <aclement@pivotal.io>
Tue, 23 Oct 2018 23:44:14 +0000 (16:44 -0700)
loadtime/src/org/aspectj/weaver/loadtime/Aj.java

index e9c347acbd8188d97631d53294bbe81684489865..652ea09320d0c9d3bbd5b7e33010af84542ef466 100644 (file)
@@ -72,19 +72,12 @@ public class Aj implements ClassPreProcessor {
        }
 
        private final static String deleLoader = "sun.reflect.DelegatingClassLoader";
+       private final static String deleLoader2 = "jdk.internal.reflect.DelegatingClassLoader"; // On JDK11+
 
-       /**
-        * Weave
-        * 
-        * @param className
-        * @param bytes
-        * @param loader
-        * @return woven bytes
-        */
        @Override
        public byte[] preProcess(String className, byte[] bytes, ClassLoader loader, ProtectionDomain protectionDomain) {
-               // TODO AV needs to doc that
-               if (loader == null || className == null || loader.getClass().getName().equals(deleLoader)) {
+               if (loader == null || className == null || 
+                       loader.getClass().getName().equals(deleLoader) || loader.getClass().getName().equals(deleLoader2)) {
                        // skip boot loader, null classes (hibernate), or those from a reflection loader
                        return bytes;
                }