From: acolyer Date: Wed, 3 May 2006 06:35:37 +0000 (+0000) Subject: enabled test and committed fix for pr139749 : super call in around advice body of... X-Git-Tag: V1_5_2rc1~174 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=63653d29e9e09ad69a8f4b43431f0d29242c08b6;p=aspectj.git enabled test and committed fix for pr139749 : super call in around advice body of @AspectJ aspect --- diff --git a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java index 4ae8e9d89..0cd43ed2d 100644 --- a/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java @@ -38,7 +38,7 @@ public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testReferencePCutInDeclareWarning_pr138215() { runTest("Reference pointcut fails inside @DeclareWarning");} // public void testReferencePCutInPerClause_pr138219() { runTest("Can't use a FQ Reference pointcut in any pointcut expression referenced by a per-clause");} // public void testDoubleAnnotationMatching_pr138223() { runTest("Double at annotation matching (no binding)");} -// public void testSuperCallsInAtAspectJAdvice_pr139749() { runTest("Super calls in @AspectJ advice");} + public void testSuperCallsInAtAspectJAdvice_pr139749() { runTest("Super calls in @AspectJ advice");} public void testNoClassCastExceptionWithPerThis_pr138286() { runTest("No ClassCastException with perThis");} diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelAccessForInlineMunger.java b/weaver/src/org/aspectj/weaver/bcel/BcelAccessForInlineMunger.java index a772df25d..35456fe8d 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelAccessForInlineMunger.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelAccessForInlineMunger.java @@ -165,8 +165,12 @@ public class BcelAccessForInlineMunger extends BcelTypeMunger { realizedCannotInline = true; } else { // specific handling for super.foo() calls, where foo is non public - if (aspectType.getSuperclass() != null - && aspectType.getSuperclass().getName().equals(callee.getName())) { + ResolvedType memberType = m_aspectGen.getWorld().resolve(resolvedMember.getDeclaringType()); + if (!aspectType.equals(memberType) && + memberType.isAssignableFrom(aspectType)) { + // old test was... + // if (aspectType.getSuperclass() != null + // && aspectType.getSuperclass().getName().equals(resolvedMember.getDeclaringType().getName())) { ResolvedMember accessor = createOrGetInlineAccessorForSuperDispatch(resolvedMember); InvokeInstruction newInst = factory.createInvoke( aspectType.getName(),