Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Inter-type declarations: super.print() to invoke the method in the parent failed

I have the following codes:
//
public abstract class Order {
      .....
      public void print() { ......  }
}
//
public class SalesOrder {
}
//
public abstract aspect OrderDecorator 
{
    declare parents : SalesOrder extends Order;
    public void SalesOrder.print()
    {
       super.print();  //  Line 12
    }
    protected pointcut print(Order order) : target(order) && call(public void print());
}

In Line 12 above, I want to call Order.print(), but AspectJ M3a dislay the following error message:
     [iajc] D:\workdir\DPsample\main\src\com\designpattern\decorator\OrderDecora
tor.aj:12 [error] The method print() is undefined for the type Object
     [iajc] super.print();
 
I donot know what's wrong with my code.
 
Thanks for your help.
 
guofeng
 


Back to the top