RFR: 8365291: Remove finalize() method from sun/awt/X11InputMethodBase.java
Alexander Zvegintsev
azvegint at openjdk.org
Mon Aug 25 19:00:43 UTC 2025
On Tue, 12 Aug 2025 18:56:56 GMT, Phil Race <prr at openjdk.org> wrote:
> It seems that finalize() in X11InputMethodBase.java isn't useful.
> It calls dispose(), which in all actual implementations has just one native resource to release, which
> is a native struct of type X11InputMethodData (this is a JDK-defined struct, not one from Xim),
> and one of the fields is a JNI GlobalRef pointing to the XInputMethod instance which implements the dispose() method.
> So finalize cannot be called unless dispose() is called first. But if dispose() has been called then there's no need for
> finalize() since all it does is call dispose()
>
> Many more details in JBS.
Marked as reviewed by azvegint (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/26751#pullrequestreview-3152664340
More information about the client-libs-dev
mailing list