0

There is a possibility in AspectJ to modify the class hierarchy using declare statements :

declare parents : TypePattern extends Type;

From http://eclipse.org/aspectj/doc/released/adk15notebook/annotations-decp.html

Basically it allow you to "insert" a class in the hierarchy, here I insert X class :

 1. Child extends Parent                   -->   Child extends X extends Parent 
 2. Child extends SomeClass extends Parent -->   Child extends X extends SomeClass extends X extends Parent

However I am looking for a notation that will allow me to resolve the second case to :

 2. Child extends SomeClass extends Parent  -->   Child extends SomeClass extends X extends Parent

My problem is I have Child extends X and SomeClass extends X. Do you know AspectJ notation that would solve this problem ?

ebtokyo
  • 2,369
  • 4
  • 23
  • 33

1 Answers1

0

Does this not work?

declare parents : Child extends SomeClass;
declare parents : SomeClass extends X;
declare parents : X extends Parent;

I guess I am not exactly sure what your goal is.

Andrew Eisenberg
  • 28,387
  • 9
  • 92
  • 148