Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] intercept Class but not SubClass

To add to what's said,

  call(MyClass.new())

will pick out a constructor-call join point
but not the corresponding constructor-execution join point,
which as Ron points out runs when subclasses are being
initialized.

(As for what the pointcuts mean, I encourage you{/me/everyone}
to closely read the programming guide semantics appendix.
30-90 minutes spent really absorbing those definitions will
pay off a lot in avoiding common mistakes.)

Wes

Charles N. Harvey III wrote:
Hello.
I have written a simple aspect to run after MyClass.new is executed.
Thing is, I also have MySubClass which extends MyClass.  And the aspect
seems to be intercepting that as well.

public pointcut myCutting() : execution( MyClass.new() ) && !execution( MySubClass.new() );


That doesn't seem to be doing it.  Is that correct or is there some other
way to make sure that no sub-classes get intercepted?

Thanks a lot.


Charlie

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top