summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/bugs150/pr109614.java13
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java1
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml7
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/BcelShadow.java11
4 files changed, 30 insertions, 2 deletions
diff --git a/tests/bugs150/pr109614.java b/tests/bugs150/pr109614.java
new file mode 100644
index 000000000..d7f1eda3e
--- /dev/null
+++ b/tests/bugs150/pr109614.java
@@ -0,0 +1,13 @@
+public aspect pr109614 {
+ Object around() : call( NoClassDefFoundError.new(..)) {
+ return proceed();
+ }
+
+ public static void main(String []argv) {
+ new ContractChecking();
+ }
+}
+
+class ContractChecking {
+ public static final boolean enabled = Boolean.getBoolean(ContractChecking.class.getName());
+} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index 80bcd4907..4d40e12a9 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -58,6 +58,7 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
public void testAroundAdviceArrayAdviceSigs_pr118781() { runTest("verify error with around advice array sigs");}
public void testAtDeclareParents_pr117681() { runTest("at declare parents");}
public void testPrivilegeProblem_pr87525() { runTest("privilege problem with switch");}
+ public void testRangeProblem_pr109614() { runTest("Range problem");}
public void testGenericAspects_pr115237() { runTest("aspectOf and generic aspects");}
public void testClassFormatError_pr114436() { runTest("ClassFormatError binary weaving perthis");}
public void testParserException_pr115788() { runTest("parser exception");}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index 7729d879e..1834c22f7 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -175,6 +175,7 @@
<compile files="PointcutLibrary.aj,ReflectOnAjcCompiledPointcuts.java" options="-1.5"></compile>
<run class="ReflectOnAjcCompiledPointcuts" classpath="../lib/bcel/bcel.jar"/>
</ajc-test>
+
<ajc-test dir="compatibility/case1" title="generating code for a 1.2.1 runtime - 1">
<compile files="Simple.java" options="-Xajruntimetarget:1.2"/>
@@ -228,6 +229,12 @@
<run class="Pr103097"/>
</ajc-test>
+
+ <ajc-test dir="bugs150" title="Range problem">
+ <compile files="pr109614.java"/>
+ <run class="pr109614"/>
+ </ajc-test>
+
<ajc-test dir="bugs150/pr114436" title="ClassFormatError binary weaving perthis">
<compile files="SimpleTrace.aj,ConcreteSimpleTracing.aj" outjar="aspects.jar"/>
<compile files="TestClass.java" aspectpath="aspects.jar"/>
diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java
index 5ce739a8c..d9ab3af72 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java
@@ -197,7 +197,7 @@ public class BcelShadow extends Shadow {
ih = ih.getPrev();
}
// now IH points to the NEW. We're followed by the DUP, and that is followed
- // by the actual instruciton we care about.
+ // by the actual instruction we care about.
InstructionHandle newHandle = ih;
InstructionHandle endHandle = newHandle.getNext();
InstructionHandle nextHandle;
@@ -214,6 +214,7 @@ public class BcelShadow extends Shadow {
// XXX see next XXX comment
throw new RuntimeException("Unhandled kind of new " + endHandle);
}
+ // Now make any jumps to the 'new', the 'dup' or the 'end' now target the nextHandle
retargetFrom(newHandle, nextHandle);
retargetFrom(dupHandle, nextHandle);
retargetFrom(endHandle, nextHandle);
@@ -237,7 +238,13 @@ public class BcelShadow extends Shadow {
InstructionTargeter[] sources = old.getTargeters();
if (sources != null) {
for (int i = sources.length - 1; i >= 0; i--) {
- sources[i].updateTarget(old, fresh);
+ if (sources[i] instanceof ExceptionRange) {
+ ExceptionRange it = (ExceptionRange)sources[i];
+ System.err.println("...");
+ it.updateTarget(old,fresh,it.getBody());
+ } else {
+ sources[i].updateTarget(old, fresh);
+ }
}
}
}