Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Troubles with packages and pointcuts

Hi,

I have troubles with packages. My pointcuts only advice the method if the pointcut is in the same package as the advices method. I have no glue why. Following my setup:


Library with an abstract aspect (AbstractContractAspect). The library is in the classpath of the application.

public abstract aspect AbstractContractAspect {

    /**
* Abstract pointcut. This pointcut has to be implemented by the concrete
     * class to advice a method call.
     *
     * @since 25.10.2004
     */
    public abstract pointcut targetPointcut();




The application implements the abstract aspect in package x.y.aspect. From there I implement the pointcut for method xy in package x.y.

public pointcut targetPointcut() : execution(* ContractShowCase.dummyMethod(..));


But the method will not be adviced. I have to modify the pointuct as follows:

public pointcut targetPointcut() : execution(* *.dummyMethod(..));

or place the aspect in the same package as the class with the advices method. Then the first version of the pointcut work.


For me, that is not the normal behaviour. Right? Any hints?

aspectj 1.2, AJDT 1.1.12

If you like, I can send you an eclipse project off list.


Regards,

Cyrill



Back to the top