aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2019-09-09 13:38:21 -0700
committerAndy Clement <aclement@pivotal.io>2019-09-09 13:38:21 -0700
commit589e3dc730d57c4d9c63fa79db97653a8e30c898 (patch)
tree9cbdaffa31f12c5c7dd5a07c9d0d1399708a63a1 /weaver
parent8c0ba7e6a60a79ba8e8689be76afa68f08012fc5 (diff)
downloadaspectj-589e3dc730d57c4d9c63fa79db97653a8e30c898.tar.gz
aspectj-589e3dc730d57c4d9c63fa79db97653a8e30c898.zip
Fix Bug 550696 - ClassCastException during load time weaving: InstructionHandle cannot be cast to BranchHandle
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/main/java/org/aspectj/weaver/bcel/BcelShadow.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelShadow.java
index 7e1e0bfc4..adb7fc921 100644
--- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelShadow.java
+++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelShadow.java
@@ -25,6 +25,7 @@ import org.aspectj.apache.bcel.Constants;
import org.aspectj.apache.bcel.classfile.ConstantPool;
import org.aspectj.apache.bcel.classfile.Field;
import org.aspectj.apache.bcel.generic.ArrayType;
+import org.aspectj.apache.bcel.generic.BranchHandle;
import org.aspectj.apache.bcel.generic.FieldInstruction;
import org.aspectj.apache.bcel.generic.INVOKEINTERFACE;
import org.aspectj.apache.bcel.generic.Instruction;
@@ -2987,8 +2988,7 @@ public class BcelShadow extends Shadow {
.forName("org.aspectj.runtime.internal.AroundClosure"), Modifier.PUBLIC, "unlink",
"()V")));
- InstructionHandle jumpOverHandler = advice.append(InstructionConstants.NOP);
-
+ BranchHandle jumpOverHandler = advice.append(new InstructionBranch(Constants.GOTO, null));
// Call unlink in finally block
// Do not POP the exception off, we need to rethrow it
@@ -2999,7 +2999,7 @@ public class BcelShadow extends Shadow {
// After that exception is on the top of the stack again
advice.append(InstructionConstants.ATHROW);
InstructionHandle jumpTarget = advice.append(InstructionConstants.NOP);
- jumpOverHandler.setInstruction(InstructionFactory.createBranchInstruction(Constants.GOTO, jumpTarget));
+ jumpOverHandler.setTarget(jumpTarget);
enclosingMethod.addExceptionHandler(tryUnlinkPosition, unlinkInsn, handlerStart, null/* ==finally */, false);
}
}