From 1cdf71119c5e3434772f3b51705b7bb8ba5980fe Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Sat, 2 Mar 2024 09:44:03 +0100 Subject: Improve unwoven class file handling in SimpleCache 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 --- weaver/src/main/java/org/aspectj/weaver/tools/cache/SimpleCache.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'weaver') diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/SimpleCache.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/SimpleCache.java index 0cf759e73..31102c96f 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/SimpleCache.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/SimpleCache.java @@ -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; } -- cgit v1.2.3