瀏覽代碼

Add implementation note and JDK-8325536 link to Aj.preProcess

See https://bugs.openjdk.org/browse/JDK-8325536.

Relates to #277.

Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
tags/V1_9_21_1
Alexander Kriegisch 3 月之前
父節點
當前提交
45d593b8cb
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5
    0
      loadtime/src/main/java/org/aspectj/weaver/loadtime/Aj.java

+ 5
- 0
loadtime/src/main/java/org/aspectj/weaver/loadtime/Aj.java 查看文件

@@ -76,6 +76,11 @@ public class Aj implements ClassPreProcessor {

@Override
public byte[] preProcess(String className, final byte[] bytes, ClassLoader classLoader, ProtectionDomain protectionDomain) {

// Implementation note: Try to return null, whenever it is clear that the original byte code was not changed by the
// weaver. While not strictly necessary, the changes from commit 3e3c83712e are defensive programming, which helps
// to avoid problems like https://bugs.openjdk.org/browse/JDK-8325536, even if unfixed in the JDK.

if (classLoader == null || className == null ||
classLoader.getClass().getName().equals(deleLoader) || classLoader.getClass().getName().equals(deleLoader2)) {
// skip boot loader, null classes (hibernate), or those from a reflection loader

Loading…
取消
儲存