From 7a25c049fab85b86baf081e9d2380c4f7de5da5e Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 15 Dec 2011 01:26:36 +0000 Subject: [PATCH] where to do the work for handler+multicatch --- .../src/org/aspectj/weaver/bcel/BcelClassWeaver.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java index 0cfc4cf08..a6f2c0fe6 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java @@ -2682,6 +2682,7 @@ class BcelClassWeaver implements IClassWeaver { // Exception handlers (pr230817) if (canMatch(Shadow.ExceptionHandler) && !Range.isRangeHandle(ih)) { Set targeters = ih.getTargetersCopy(); + // If in Java7 there may be overlapping exception ranges for multi catch - we should recognize that for (InstructionTargeter t : targeters) { if (t instanceof ExceptionRange) { // assert t.getHandler() == ih @@ -2692,18 +2693,14 @@ class BcelClassWeaver implements IClassWeaver { if (isInitFailureHandler(ih)) { return; } - if (!ih.getInstruction().isStoreInstruction() && ih.getInstruction().getOpcode() != Constants.NOP) { // If using cobertura, the catch block stats with - // INVOKESTATIC rather than ASTORE, in order that - // the - // ranges + // INVOKESTATIC rather than ASTORE, in order that the ranges // for the methodcall and exceptionhandler shadows // that occur at this same // line, we need to modify the instruction list to // split them - adding a - // NOP before the invokestatic that gets all the - // targeters + // NOP before the invokestatic that gets all the targeters // that were aimed at the INVOKESTATIC mg.getBody().insert(ih, InstructionConstants.NOP); InstructionHandle newNOP = ih.getPrev(); @@ -3109,7 +3106,7 @@ class BcelClassWeaver implements IClassWeaver { && s.charAt(4) == 'a' && (s.equals("org.aspectj.runtime.internal.CFlowCounter") || s.equals("org.aspectj.runtime.internal.CFlowStack") || s - .equals("org.aspectj.runtime.reflect.Factory"))) { + .equals("org.aspectj.runtime.reflect.Factory"))) { proceed = false; } else { if (methodName.equals("aspectOf")) { -- 2.39.5