aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs150/pr107486part2.aj
blob: f438d56ae20209770603ab7a876a06e5f08ac58f (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
public class pr107486part2 {
    public Object f() {
        return new Object() {
            public String toString() {
                return "f";
            }
        };
    }
    public Object g() {
    	return new Object() {
    		public String toString() {
    			return "g";
    		}
    	};
    }
    
    public static void main(String[] args) {
    	pr107486part2 p = new pr107486part2();
		System.out.println(p.f());
		System.out.println(p.g());
	}
}

aspect ToStringDecorator {
	
	Object around() : execution(* toString()) {
		return new String("[advised] " + proceed()); 
	}
	
}