aboutsummaryrefslogtreecommitdiffstats
path: root/tests/other-systems/util/Trace.java
blob: 72aa89b20d55c9d1d6f8e092fc222bd1fe0f5df5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.io.Serializable;

abstract aspect Trace {
    abstract pointcut targets();

    /*
     * toString() can throw exceptions, so we'll print
     * the java.lang.Class instead.
     */

    before (): targets() {
	System.out.println("entering " + thisJoinPoint);
    }
    after (): targets() {
	System.out.println("exiting "  +
			   thisJoinPointStaticPart);
    }

    after () throwing (Throwable t): targets() {
	System.out.println("throwing "  + t);
    }

    after () throwing (java.io.IOException ioe): targets() {
	System.out.println("throwing "  + ioe);
    }

    after () returning (Object o): targets() {
	System.out.println("returning "  + (o!=null ? o.getClass() : null));
    }


    private static int initCounter() {
	return 0;
    }

    //private int Serializable.counter = initCounter();
}