RFR 9: 8165641 : Deprecate Object.finalize
Roger Riggs
roger.riggs at oracle.com
Wed Mar 15 02:06:47 UTC 2017
Hi Mandy,
Webrev updated in place with your and Stuart's review comments.
http://cr.openjdk.java.net/~rriggs/webrev-finalize-deprecate-8165641/
On 3/14/17 4:53 PM, Mandy Chung wrote:
> This patch looks fine in general.
>
> Does @inheritDoc inherit @deprecated? What does the javadoc of javax.imageio.stream.* look like?
Yes, the deprecation is inherited, see:
http://cr.openjdk.java.net/~rriggs/finalize-doc/api/javax/imageio/stream/FileImageInputStream.html
>
> + * @deprecated Finalization is deprecated and should not be used.
> + * See {@link Object#finalize} for the explanation and recommended replacement.
>
> Also, the second line is rather long and might be good to break into two lines?
The style guide allows a somewhat longer line. I moved the "See" to the
previous line.
it didn't seem worth adding more vertical space for a couple of words.
Thanks, Roger
>
> Mandy
>
>> On Mar 10, 2017, at 1:40 PM, Roger Riggs <Roger.Riggs at oracle.com> wrote:
>>
>> Finalizers are inherently problematic and their use can lead to performance issues,
>> deadlocks, hangs, and other problematic behavior.
>>
>> The problems have been accumulating for many years and the first step to
>> deprecate Object.finalize and the overrides in the JDK to communicate the
>> issues, recommend alternatives, and motivate changes where finalization is currently used.
>>
>> The behavior of finalization nor any uses of finalize are not modified by this change.
>> Most of the changes are to suppress compilation warnings within the JDK.
>>
>> Please review and comment.
>>
>> Webrev:
>> http://cr.openjdk.java.net/~rriggs/webrev-finalize-deprecate-8165641/
>>
>> Issue:
>> https://bugs.openjdk.java.net/browse/JDK-8165641
>>
>> Thanks, Roger
>>
>>
More information about the core-libs-dev
mailing list