RFR 9: 8165641 : Deprecate Object.finalize
stuart.marks at oracle.com
Fri Mar 31 17:29:37 UTC 2017
On 3/31/17 6:55 AM, Roger Riggs wrote:
> The webrev for deprecating finalize has been updated:
> - to improve the advice existing JDK subclasses overriding finalize provides in
> @deprecated javadoc,
> - to expand Object.finalize() javadoc to reinforce the correct use of
> super.finalize() by subclasses,
> - and to remove redundant @SuppressWarnings annotations.
> Please review and comment.
The main text in Object.finalize(), and the text for each of the occurrences of
an overriding finalize() method, look good.
I don't think j.l.Enum.finalize() needs to be deprecated. The main point of
deprecating finalize() is to inform subclassers. But Enum.finalize() can't be
overriden. I suppose somebody could *call* it from an enum, and deprecation
would serve to generate a warning, but this is pretty obscure.
I'd suggest replacing the deprecation of Enum.finalize() with @SuppressWarnings.
More information about the core-libs-dev