Hi,

I have started to look into aspectj , now that I have a working dev environment 
in Eclipse 😊


I want to find which classes and methods  outside our application that calls to 
our application classes with public methods that has annotation @Deprecated.


I have created the following 'pointcut':


pointcut deprecatedMethods() : call(public * *.*(..)) && 
@withincode(Deprecated);
    before() : deprecatedMethods() {
      log("[Deprecated Method Usage]" +" --> "+ 
thisEnclosingJoinPointStaticPart.getSignature().toShortString+"\n");

    }


The above will give something like:


[Deprecated Method Usage] --> HandlerImpl.getBoards(..)


 I can see which classes' methods with @Deprecated gets called. But I cannot 
see  what the name of the enclosing class and method is, in this case 
Demo.test() ( see below).


  1.  Is it possible to get this using aspectj?
  2.  What would be the correct pointcut to use?


br.


//mike



public class Demo extends Test{

    @Test
    public void test() {
      Node node = new Node();
      Handler handler = node.getObjectHandler();
      //getBoards() is the deprecated method.
      Boards boards = handler.getBoards();


    }
}






_______________________________________________
aspectj-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to