Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Named pointcuts in gerenic aspects

I'm trying to write a generic abstract aspect containing a named pointcut and associated advice:

public abstract aspect GenericAspect<Par1, Par2> {
   abstract pointcut checkpoint(Par1 par1);

   after(Par1 par1): checkpoint(par1) {
       // do something
   }
}

This does not seem to work, regardless of whether the PC is abstract or concrete. The compiler (1.3.0.20051220093604, AspectJ 1.5.0) complains:

"incompatible type, expected java.lang.Object found BindingTypePattern(TPar1;, 0). Check the type specified in your pointcut"


Note that this works as an unnamed PC:

public abstract aspect GenericAspect<Par1, Par2> {
   after(Par1 par1): target(par1) { // silly example
       // do something
   }
}

What might be the reason for that?

Thanks,

--Jan


Back to the top