123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- public aspect Pr103157 {
-
- // verify after returning behaviour with join points that have no "return" value
-
- // these are:
- // ConstructorExecution
- // FieldSet
- // StaticInitialization
- // Initialization
- // PreInitialization
- // ExceptionHandler -- but handler can't have after returning advice anyway
- // arguably all adviceexecution join points except for around, but allow this for now
-
- after() returning(Object obj) : execution(C.new(..)) {
- System.out.println("returning obj on cons exe " + obj);
- }
-
- after() returning : execution(C.new(..)) {
- System.out.println("returning from cons exe");
- }
-
- after() returning(Object obj) : set(* C.*) {
- System.out.println("returning obj on set " + obj);
- }
-
- after() returning : set(* C.*) {
- System.out.println("returning from set");
- }
-
- after() returning(Object obj) : staticinitialization(C) {
- System.out.println("returning obj on staticinit " + obj);
- }
-
- after() returning : staticinitialization(C) {
- System.out.println("returning from staticinit");
- }
-
- after() returning(Object obj) : initialization(C.new(..)) {
- System.out.println("returning obj on init " + obj);
- }
-
- after() returning : initialization(C.new(..)) {
- System.out.println("returning from init");
- }
-
- after() returning(Object obj) : preinitialization(C.new(..)) {
- System.out.println("returning obj on preinit " + obj);
- }
-
- after() returning : preinitialization(C.new(..)) {
- System.out.println("returning from preinit");
- }
-
- public static void main(String[] args) {
- new C();
- }
-
- }
-
- class C {
-
- String s;
-
- public C() { this.s = "xxx"; }
-
- }
|