From 8e6cef02952075a7ad3c43229bb48bea159a6cb8 Mon Sep 17 00:00:00 2001 From: jhugunin Date: Fri, 14 Feb 2003 01:58:32 +0000 Subject: [PATCH] added test for 30026 , even though its working in the current version --- tests/ajcTests.xml | 7 +++++++ tests/bugs/Finalizer.java | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 tests/bugs/Finalizer.java diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml index ab1a6fe0d..df307d751 100644 --- a/tests/ajcTests.xml +++ b/tests/ajcTests.xml @@ -5578,5 +5578,12 @@ + + + + + + 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); + } +} -- 2.39.5