diff --git a/jode/test/InlinedAnon.java b/jode/test/InlinedAnon.java new file mode 100644 index 0000000..11d0433 --- /dev/null +++ b/jode/test/InlinedAnon.java @@ -0,0 +1,22 @@ +package jode.test; + +public class InlinedAnon { + + private final Object getAnon(final int param) { + return new Object() { + public String toString() { + return ""+param; + } + }; + } + + void test1() { + Object o1 = getAnon(5); + Object o2 = getAnon(3); + } + + void test2() { + Object o3 = getAnon(1); + Object o4 = getAnon(2); + } +} diff --git a/jode/test/NestedAnon.java b/jode/test/NestedAnon.java new file mode 100644 index 0000000..228ca8b --- /dev/null +++ b/jode/test/NestedAnon.java @@ -0,0 +1,18 @@ +package jode.test; + +public class NestedAnon { + public NestedAnon(int maxdepth) { + class NestMyself { + int depth; + NestMyself son; + + public NestMyself(int d) { + depth = d; + if (d > 0) + son = new NestMyself(d-1); + } + } + new NestMyself(maxdepth); + } + +}