Skip to main content

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


> What might be the reason for that?

That would be a bug!

The problem is not related to named pointcuts, but the combination of a named pointcut that supplies a parameter whose type is a type variable. What's happened is that one part of the compiler has correctly remembered that this should be a type variable, and the other half has forgotten and replaced the type variable with its upper bound (Object).  When it comes to matching them up, the compiler then thinks they are different and complains.

I see you've raised bug 123553 to cover this and we'll get the fix into 1.5.1...

Regards, Adrian.

On 11/01/06, Jan Hannemann < jan@xxxxxxxxx> wrote:
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
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



--
-- Adrian
adrian.colyer@xxxxxxxxx

Back to the top