Hi Andy!
Yes now I got the message 😊
I have exactly the same code. I think it has something to do with the compile and execution of my test case. I can see that ajc i done:
aspectj-maven-plugin:1.10:compile (compile_with_aspectj) @ resource-manager ---
[INFO] Showing AJC message detail for messages of types: [error, warning, fail]
[WARNING] invalid Class-Path header in manifest of jar file: /repo/eraonel/.m2/repository/org/restlet/jse/org.restlet/2.3.3/org.restlet-2.3.3.jar
invalid Class-Path header in manifest of jar file: /repo/eraonel/.m2/repository/org/uncommons/maths/uncommons-maths/1.2.2a/uncommons-maths-1.2.2a.jar
<unknown source file>:<no line information>
[INFO] Join point 'method-call(......)
However when I try to execute my test case I try to do it within Eclipse.
I have a 'Run configuration' for m2build making:
mvn clean compile
Then I have another 'Run configuration', testng, for my Demo test.
I execute it using a suite file that I have pointed out in Eclipse.
Is there anything that is different if I execute from within Eclipse?
br,
//mikael
Hey, hope you get this email :)
Here is a complete program:
==== 8< ==== 8< ==== Demo.java =========
public class Demo {
public static void main(String []argv) {
new Demo().test();
}
public void test() {
Node node = new Node();
Handler handler = node.getObjectHandler();
//getBoards() is the deprecated method.
Boards boards = handler.getBoards();
}
}
aspect X {
pointcut deprecatedMethods() : call(public * *(..)) && @annotation(Deprecated);
before() : deprecatedMethods() {
System.out.println("Caller: "+thisEnclosingJoinPointStaticPart.getSignature());
System.out.println("Called: "+thisJoinPoint.getSignature());
}
}
==== 8< ==== 8< ==== Demo.java =========
ajc -1.8 Demo.java
java Demo
Caller: void Demo.test()
Called: Boards Handler.getBoards()
You could use a declare warning to achieve some of this but I don't think it includes the enclosing join point as a key insert right now (see declare warning in
https://eclipse.org/aspectj/doc/released/README-169.html ).
Using declare warning means you'd see the message at compile time and not runtime.
It is now possible to ITD member types. The syntax is as would be expected. This example introduces a new member type called Inner into type Foo: public class Foo ...
|
cheers,
Andy