diff options
-rw-r--r-- | tests/ajcTests.xml | 7 | ||||
-rw-r--r-- | tests/bugs/InterPerCall.java | 21 | ||||
-rw-r--r-- | weaver/src/org/aspectj/weaver/ResolvedTypeX.java | 2 |
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml index 6f9e4dddf..24569cf2a 100644 --- a/tests/ajcTests.xml +++ b/tests/ajcTests.xml @@ -6730,4 +6730,11 @@ <message line="7" kind="warning" text="throws both"/> </compile> </ajc-test> + + <!-- This test needs a corresponding bug report --> + <ajc-test dir="bugs" + title="perthis and signature bad interaction"> + <compile files="InterPerCall.java"/> + <run class="InterPerCall"/> + </ajc-test> </suite> diff --git a/tests/bugs/InterPerCall.java b/tests/bugs/InterPerCall.java new file mode 100644 index 000000000..5ee4f821e --- /dev/null +++ b/tests/bugs/InterPerCall.java @@ -0,0 +1,21 @@ +public class InterPerCall { + public static void main(String[] args) { + new D().m(); + } +} + +class C { +} + +class D extends C { + public void m() { } +} + +aspect A perthis(p1()) { + pointcut p1(): execution(void D.m()); + pointcut p2(): execution(void C.m()); + + before(): p2() { + System.out.println("hello"); + } +}
\ No newline at end of file diff --git a/weaver/src/org/aspectj/weaver/ResolvedTypeX.java b/weaver/src/org/aspectj/weaver/ResolvedTypeX.java index 1861254a5..e3504fcbe 100644 --- a/weaver/src/org/aspectj/weaver/ResolvedTypeX.java +++ b/weaver/src/org/aspectj/weaver/ResolvedTypeX.java @@ -242,6 +242,8 @@ public abstract class ResolvedTypeX extends TypeX { public static boolean matches(Member m1, Member m2) { + if (m1 == null) return m2 == null; + if (m2 == null) return false; return m1.getName().equals(m2.getName()) && m1.getSignature().equals(m2.getSignature()); } |