aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-02-14 01:58:32 +0000
committerjhugunin <jhugunin>2003-02-14 01:58:32 +0000
commit8e6cef02952075a7ad3c43229bb48bea159a6cb8 (patch)
treebbebaabbd280859e8b72a356818c338982ab5591 /tests
parent19c3e16d2212bdd41144da2150c8ef46b4a759a5 (diff)
downloadaspectj-8e6cef02952075a7ad3c43229bb48bea159a6cb8.tar.gz
aspectj-8e6cef02952075a7ad3c43229bb48bea159a6cb8.zip
added test for 30026 , even though its working in the current version
Diffstat (limited to 'tests')
-rw-r--r--tests/ajcTests.xml7
-rw-r--r--tests/bugs/Finalizer.java26
2 files changed, 33 insertions, 0 deletions
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 @@
<compile files="AdviceExec.java"/>
<run class="AdviceExec"/>
</ajc-test>
+
+ <ajc-test dir="bugs" pr="30026"
+ title="problems with finalize call">
+ <compile files="Finalizer.java">
+ <message kind="error" line="22"/>
+ </compile>
+ </ajc-test>
</suite>
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);
+ }
+}