RFR JDK-8185582, Update Zip implementation to use Cleaner, not finalizers
peter.levart at gmail.com
Thu Oct 12 15:05:56 UTC 2017
On 10/11/2017 12:22 AM, Xueming Shen wrote:
> Webrev has been updated accordingly to remove the "inflater" from the
> "streams" as the "value" of the map. As suggested, the "streams" now
> itself is a "set".
> And, a package private "Infater()" has been added to avoid registering the
> inflater to Cleaner for those inflaters from ZipFile.
> The @apiNote has been updated accordingly to remove the words regarding
> "finalize() overriding".
This looks good to me.
> On 9/30/17, 12:41 AM, Peter Levart wrote:
>> Right, the Inflater is captured by the cleaning function for the
>> ZipFileInflaterInputStream and is kept strongly reachable until the
>> function fires, which may happen automatically or manually. At that
>> time, it is returned to the inflaters cache, which is rooted at the
>> ZipFile instance and also captured by the ZipFile cleaning function -
>> the Releaser, which is strongly reachable until fired. So I claim
>> that there is no possibility for Inflaters used in ZipFile to ever
>> get cleaned-up (ended) automatically by their cleaner functions as a
>> result of getting phantom reachable. The situation has changed. It
>> could even be beneficial to create a package-private Inflater
>> constructor for this case, which creates Inflaters without cleaner
>> Regards, Peter
More information about the core-libs-dev