[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Debug aspect


I have an application A in Eclipse that uses another library  that has an aspect implemented. Purpose of of aspect is to see when application A
calls deprecated methods in the library.

Both application A and library are java maven projects in Eclipse. Application A has a dependency to the library and I can see that in Eclipse. So I have the source
available for both projects. In eclipse the library is also a aspect project so I can see when it builds it output saying "woven class".

What I want to accomplish is , when I run a class in application A that calls a deprecated method in the library, I want the debugger to halt in my aspect.

Here is where I set my breakpoint:

pointcut deprecated() :
        @annotation(Deprecated) && (call(public * *(..)) || call(*.new(..)));

    pointcut beta() :

    pointcut deprecatedMethods() :
        deprecated() && !beta();

before() : deprecatedMethods() {
        DeprecatedMethodData deprecatedMethodData = new DeprecatedMethodData();
                "Deprecated method " + thisJoinPoint.getSignature() +
                        " called by " + thisEnclosingJoinPointStaticPart.getSignature());

But there is no halt on:

  DeprecatedMethodData deprecatedMethodData = new DeprecatedMethodData();

where I put my breakpoint on.

Any ideas what I am lacking?