On 5 Mar 2003, Tom Tromey wrote: > >>>>> "Dalibor" == Dalibor Topic <[EMAIL PROTECTED]> writes: > > >> java.util.zip.[De|In]flater both have an empty finalize method "for > >> compatibility". Is this really necessary? > > Dalibor> Yes, in order to have reflection on these methods > Dalibor> working. A pretty good reason in my opinion. > > I'm not so sure. It seems to me that anybody using reflection has to > be aware of, and understand, the Java binary compatibility rules. > Implementing or not implementing finalize doesn't affect binary > compatibility, so it should be a change we are free to make.
I think the main problem lies elsewhere. If you subclass a class which has a finalizer and your subclass needs to do some finalization of its own, then your finalizer needs to contain a call to super.finalize(). If the published API doesn't show a finalizer then you wouldn't include this statement. That's not an argument against trivial finalizers provided for "compatibility", but it it's a strong argument agains non-trivial finalizers where the public API has none: there's areal likelihood that someone will subclass your class and fail to invoke your finalizer. Regards -- Chris Gray VM Architect, ACUNIA _______________________________________________ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath

