[Top][All Lists]

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

Re: More finalize woes

From: Stephen Crawley
Subject: Re: More finalize woes
Date: Fri, 07 Mar 2003 10:27:21 +1000

> Sascha Brawer wrote:
> > So, should a Java-to-Bytecode compiler emit a warning if a finalize()
> > implementation does not call super.finalize()? This might be a suggestion
> > for gcj, jikes, javac etc. Also, we might want to add a note to the
> > Classpath hacker's guide.
> What about classes inheriting directly from Object ? Should they also be 
> forced to call super.finalize() ?

I'd say yes.  A compiler cannot know what the target VM's implementation of
java.lang.Object.finalize() does, and hence whether calling it is necessary.  
An unnecessary call to java.lang.Object.finalize() won't hurt anyone.
Besides, this would only be a compiler warning, and the user would be
free to ignore it.

-- Steve

reply via email to

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