]> source.dussan.org Git - aspectj.git/commitdiff
added test for 30026 , even though its working in the current version
authorjhugunin <jhugunin>
Fri, 14 Feb 2003 01:58:32 +0000 (01:58 +0000)
committerjhugunin <jhugunin>
Fri, 14 Feb 2003 01:58:32 +0000 (01:58 +0000)
tests/ajcTests.xml
tests/bugs/Finalizer.java [new file with mode: 0644]

index ab1a6fe0da2d3aa882691b72978c3e284b1357eb..df307d751d3f8b76546f24cdb8b162d2ab24b793 100644 (file)
         <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 (file)
index 0000000..f66643b
--- /dev/null
@@ -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);
+    }
+}