RFR JDK-8185582, Update Zip implementation to use Cleaner, not finalizers

Xueming Shen xueming.shen at oracle.com
Tue Oct 10 22:22:08 UTC 2017


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".



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 
> registration.
> Regards, Peter

More information about the core-libs-dev mailing list