classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More finalize woes


From: Per Bothner
Subject: Re: More finalize woes
Date: Thu, 06 Mar 2003 22:57:33 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030210

tephen Crawley wrote:
It is NOT a logical extension of what I'm saying. I'm saying that
non-trivial finalizers should always include a call to super.finalize().

In "contract-oriented" programming more generally, every method
that overrides another should super-call the latter.  (The
langauges Simula67 (the first object-orineted language) and BETA
enforce this by turning this around:  Instead of a overriding
method calling super, the base methiod calls INNER to call the
overriding method.)

It does NOT follow that every class should have a finalizer.

Ok.

Adding a trivial finalizer does NOT help in the event that the
programmer changes the classes position in the class hierarchy.
But having a (previously redundant) super.finalize() call in a
non-trivial finalize method may turn out to be a GOOD THING.

True.  I wasn't thinking clearly.

I still don't think it is a good idea reason to call super,finalize
if super is Object - and I don't think we should warn in that case.
--
        --Per Bothner
address@hidden   http://www.bothner.com/per/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]