Very cool, i learn something today :) Rémi
----- Mail original ----- > De: "mandy chung" <mandy.ch...@oracle.com> > À: "core-libs-dev" <core-libs-dev@openjdk.java.net> > Envoyé: Vendredi 29 Septembre 2017 23:45:18 > Objet: Re: RFR JDK-8185582, Update Zip implementation to use Cleaner, not > finalizers > On 9/29/17 2:38 PM, Peter Levart wrote: >> I think the hotspot has an optimization and detects that finalize() >> has no bytecodes and treats the object as not needing finalization. > http://hg.openjdk.java.net/jdk10/master/file/7d67bb6b0599/src/hotspot/share/classfile/classFileParser.cpp#l4250 > > // Check if this klass has an empty finalize method (i.e. one with > return bytecode only), > // in which case we don't have to register objects as finalizable > if (!_has_empty_finalizer) { > if (_has_finalizer || > (super != NULL && super->has_finalizer())) { > ik->set_has_finalizer(); > } > } > > Mandy