]> source.dussan.org Git - aspectj.git/commitdiff
Improve unwoven class file handling in SimpleCache
authorAlexander Kriegisch <Alexander@Kriegisch.name>
Sat, 2 Mar 2024 08:44:03 +0000 (09:44 +0100)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Sat, 2 Mar 2024 09:34:26 +0000 (10:34 +0100)
Also update lib/aspectj/aspectjweaver.jar to fix integration tests.

Fixes #285.

Co-authored-by: Kimming Lau <294001791@qq.com>
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
lib/aspectj/lib/aspectjweaver.jar
weaver/src/main/java/org/aspectj/weaver/tools/cache/SimpleCache.java

index 63d5843d78a97fbc10f269128603ae942b387096..2e29cf8b0731de3396701bb9c30fa17792417101 100644 (file)
Binary files a/lib/aspectj/lib/aspectjweaver.jar and b/lib/aspectj/lib/aspectjweaver.jar differ
index 0cf759e73f221a5ab8aa4ebaf8578cebd678c546..31102c96f4aed66f96e3c9f0fc1dc0485ade4e1c 100644 (file)
@@ -72,8 +72,7 @@ public class SimpleCache {
                byte[] res = get(classname, bytes);
 
                if (Arrays.equals(SAME_BYTES, res)) {
-                       // TODO: Should we return null (means "not transformed") in this case?
-                       return bytes;
+                       return null;
                } else {
                        if (res != null) {
                                initializeClass(classname, res, loader, protectionDomain);
@@ -97,7 +96,7 @@ public class SimpleCache {
 
                String key = generateKey(classname, origbytes);
 
-               if (Arrays.equals(origbytes, wovenbytes)) {
+               if (wovenbytes == null || Arrays.equals(origbytes, wovenbytes)) {
                        cacheMap.put(key, SAME_BYTES);
                        return;
                }