]> source.dussan.org Git - aspectj.git/commitdiff
enabled test and committed fix for pr139749 : super call in around advice body of...
authoracolyer <acolyer>
Wed, 3 May 2006 06:35:37 +0000 (06:35 +0000)
committeracolyer <acolyer>
Wed, 3 May 2006 06:35:37 +0000 (06:35 +0000)
tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java
weaver/src/org/aspectj/weaver/bcel/BcelAccessForInlineMunger.java

index 4ae8e9d895b2ac7ad241caae840f1a09a3f80bf0..0cd43ed2dba6e0f878ecd57a7f3807ead3d5be1a 100644 (file)
@@ -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");}
   
index a772df25d2ed2bc48a774c31b2992ac6b724bd9a..35456fe8dd69c6c580dfec6132347b03ecfa21e8 100644 (file)
@@ -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(),