summaryrefslogtreecommitdiffstats
path: root/tests/new/TwoAnonymous.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/new/TwoAnonymous.java')
-rw-r--r--tests/new/TwoAnonymous.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/new/TwoAnonymous.java b/tests/new/TwoAnonymous.java
new file mode 100644
index 000000000..09489cef1
--- /dev/null
+++ b/tests/new/TwoAnonymous.java
@@ -0,0 +1,45 @@
+public class TwoAnonymous {
+ /**/
+ Runnable i = new Runnable() {
+ public void run() {
+ System.out.println("i");
+ }
+ private Object foo() { return null; }
+ };
+ Runnable j = new Runnable() {
+ public void run() {
+ System.out.println(new Integer(0));
+ }
+ };
+ /**/
+ public static void main(String[] args) {
+ Runnable k = new Runnable() {
+ int x = 0;
+ public void run() {
+ System.out.println("k");
+ x = 4;
+ }
+ private Object foo() { return null; }
+ };
+
+ Runnable k1 = new Runnable() { public void run() { } };
+
+ k.run();
+
+ }
+}
+
+aspect A {
+
+ before(Runnable r): call(void Runnable.run()) && target(r) {
+ System.out.println("calling run: " + r + ", " + thisJoinPoint.getArgs() +", " + thisJoinPoint.getTarget());
+ }
+
+ after() returning(Runnable r): call(Runnable+.new()) {
+ System.out.println("new runnable: " + r);
+ }
+
+ before(): set(int x) {
+ System.out.println("setting x");
+ }
+}