Skip to content

Commit f2076cb

Browse files
kriegaexKimmingLau
andcommitted
Improve unwoven class file handling in SimpleCache
Also update lib/aspectj/aspectjweaver.jar to fix integration tests. Fixes #285. Co-authored-by: Kimming Lau <[email protected]> Signed-off-by: Alexander Kriegisch <[email protected]>
1 parent 047d3c4 commit f2076cb

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/aspectj/lib/aspectjweaver.jar

610 Bytes
Binary file not shown.

weaver/src/main/java/org/aspectj/weaver/tools/cache/SimpleCache.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ public byte[] getAndInitialize(String classname, byte[] bytes,
7272
byte[] res = get(classname, bytes);
7373

7474
if (Arrays.equals(SAME_BYTES, res)) {
75-
// TODO: Should we return null (means "not transformed") in this case?
76-
return bytes;
75+
return null;
7776
} else {
7877
if (res != null) {
7978
initializeClass(classname, res, loader, protectionDomain);
@@ -97,7 +96,7 @@ public void put(String classname, byte[] origbytes, byte[] wovenbytes) {
9796

9897
String key = generateKey(classname, origbytes);
9998

100-
if (Arrays.equals(origbytes, wovenbytes)) {
99+
if (wovenbytes == null || Arrays.equals(origbytes, wovenbytes)) {
101100
cacheMap.put(key, SAME_BYTES);
102101
return;
103102
}

0 commit comments

Comments
 (0)