1
2
3
4 package joeq.ClassLib.Common.java.lang.ref;
5
6 import joeq.Class.jq_InstanceMethod;
7 import joeq.Class.jq_NameAndDesc;
8 import joeq.Class.jq_Reference;
9 import joeq.Runtime.Reflection;
10 import joeq.UTF.Utf8;
11 import jwutil.util.Assert;
12
13 /***
14 * Finalizer
15 *
16 * @author John Whaley <jwhaley@alum.mit.edu>
17 * @version $Id: Finalizer.java 1941 2004-09-30 03:37:06Z joewhaley $
18 */
19 public abstract class Finalizer {
20
21 public static native void runFinalization();
22 public static native void runAllFinalizers();
23
24 static void invokeFinalizeMethod(Object o) throws Throwable {
25 jq_Reference c = jq_Reference.getTypeOf(o);
26 jq_InstanceMethod m = c.getVirtualMethod(new jq_NameAndDesc(Utf8.get("finalize"), Utf8.get("()V")));
27 Assert._assert(m != null);
28 Reflection.invokeinstance_V(m, o);
29 }
30 }