diff options
Diffstat (limited to 'tests/bugs')
-rw-r--r-- | tests/bugs/Finalizer.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/bugs/Finalizer.java b/tests/bugs/Finalizer.java new file mode 100644 index 000000000..f66643bc7 --- /dev/null +++ b/tests/bugs/Finalizer.java @@ -0,0 +1,26 @@ +// for Bug#: 30026 +import org.aspectj.testing.Tester; + + +public class Finalizer { + public static void main(String args[]) { + Finalizer np = new Finalizer(); + np = null; + } + + public void finalize() throws Throwable { + } +} + +aspect FinalizeContract { + pointcut finalizeCall(Object o): + this(Object+) && + this(o) && + execution(void finalize()); + + void around(Object o) throws Throwable: finalizeCall(o) { + o.finalize(); // error + //((Finalizer) o).finalize(); // ok + proceed(o); + } +} |