blob: 2783284e364a4e452364c0a67d11fec9abf5505c (
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
38
39
40
41
42
43
44
|
public class Main {
private static class Foo {
int x;
Foo(int x) { this.x = x; }
};
private static int foo(int x) { return x+1; }
public static void main (String args[])
{ Main.foo(1);
new Foo(2);
}
}
aspect Aspect {
// calls to a private method
before () : call(* foo(..))
{ System.out.println("Matches * foo(..)");
}
before () : call(int foo(int))
{ System.out.println("Matches int foo(int)");
}
before () : call(private * foo(..))
{ System.out.println("Matches private * foo(..)");
}
before () : call(* foo*(..))
{ System.out.println("Matches * foo*(..)");
}
// calls to a constructor that is in a private inner class
before () : call(Main.Foo.new(..)) // <- warning from here
{ System.out.println("Matches Main.Foo.new(..)");
}
before () : call(Main.Foo*.new(..))
{ System.out.println("Matches Main.Foo*.new(..)");
}
}
|