RFR: 8305083: Remove finalize() from test/hotspot/jtreg/vmTestbase/nsk/share/ and /jpda that are used in serviceability/dcmd/framework tests
Afshin Zafari
duke at openjdk.org
Tue May 9 09:43:14 UTC 2023
On Tue, 9 May 2023 09:12:51 GMT, Afshin Zafari <duke at openjdk.org> wrote:
> This PR is continuation of https://github.com/openjdk/jdk/pull/13420 which was far behind the master.
reply to @dholmes-ora comment:
> I think a better design for the classes that can't extend FinalizableObject would be for them to contain a FinalizableObject, the cleanup action for which would cleanup the host object. That could allow the removal of the Finalizable interface and simplify the general usage patterns. But that may be going too far for this particular PR ... ?
We still need the `Finalizable` interface to call the `cleanup` of the host object:
class FinalizableObject implements Finalizable {
public void registerCleanupForObject(Finalizable obj) {
Cleaner.create().register(obj, obj->cleanup());
}
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13884#issuecomment-1539796995
More information about the serviceability-dev
mailing list