RFR: 8305083: Remove finalize() from test/hotspot/jtreg/vmTestbase/nsk/share/ and /jpda that are used in serviceability/dcmd/framework tests [v2]

Coleen Phillimore coleenp at openjdk.org
Fri May 5 14:01:17 UTC 2023


On Fri, 5 May 2023 07:42:17 GMT, Afshin Zafari <duke at openjdk.org> wrote:

>> Default methods for interface classes were invented to solve a problem of compatibility if I remember correctly.  Forcing subclasses to implement the interface method or have a superclass of the subclass to implement the interface method seems like it avoids the problem of silently not registering the cleanup or action that the interface method should force you to do.  To solve the duplicated registerCleanup() cases, the two other classes could extend FinalizableObject then inherit its implementation of registerCleanup().
>
>> To solve the duplicated registerCleanup() cases, the two other classes could extend FinalizableObject then inherit its implementation of registerCleanup().
> 
> The other two cases already extend the `Log.Logger` and cannot extend `FinalizableObject`.

I though default methods were bad design just like default parameters.  maybe not.  I didn’t think yours would compile either but I guess it does.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13420#discussion_r1186130453


More information about the serviceability-dev mailing list