Browse Source

Fix 432714: stack map frame and generics

tags/V1_8_0RC3
Andy Clement 10 years ago
parent
commit
5aaca752af

+ 25
- 0
tests/bugs180/pr432714/Code.java View File

@@ -0,0 +1,25 @@
public class Code {
public static void main(String[]argv) {
}

public void foo(UID x) {
bar((x instanceof UID ? E.one : E.two));
}

public static void bar(FM fm) { }
}

aspect X {
void around(): execution(* foo(..)) {
}
}

class E {
static BBB one;
static CCC two;
class BBB extends FM<String> {}
class CCC extends FM<Long> {}
}
class FM<T> {}

class UID {}

+ 8
- 0
tests/src/org/aspectj/systemtest/ajc180/Ajc180Tests.java View File

@@ -20,6 +20,14 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
* @author Andy Clement
*/
public class Ajc180Tests extends org.aspectj.testing.XMLBasedAjcTestCase {

public void testStackmapframe_431976() {
runTest("stackmapframe");
}
public void testStackOverflow_432608() {
runTest("stackoverflow");
}
public void testThisJoinPointNotInitialized_431976() {
runTest("thisJoinPoint not initialized");

+ 9
- 0
tests/src/org/aspectj/systemtest/ajc180/ajc180.xml View File

@@ -2,6 +2,15 @@

<suite>

<ajc-test dir="bugs180/pr432714" title="stackmapframe">
<compile options="-1.8" files="Code.java"/>
<run class="Code"/>
</ajc-test>

<ajc-test dir="bugs180/pr432608" title="stackoverflow">
<compile options="-1.8" files="AbstractControlPoint.java"/>
</ajc-test>

<ajc-test dir="bugs180/pr431976" title="thisJoinPoint not initialized">
<compile options="-1.8" files="Code.java"/>
</ajc-test>

+ 3
- 0
weaver/src/org/aspectj/weaver/bcel/asm/StackMapAdder.java View File

@@ -97,6 +97,9 @@ public class StackMapAdder {
} else {
do {
resolvedType1 = resolvedType1.getSuperclass();
if (resolvedType1.isParameterizedOrGenericType()) {
resolvedType1 = resolvedType1.getRawType();
}
} while (!resolvedType1.isAssignableFrom(resolvedType2));
return resolvedType1.getRawName().replace('.', '/');
}

Loading…
Cancel
Save