On Thu, 7 Aug 2025 15:34:52 GMT, Andy Goryachev <ango...@openjdk.org> wrote:
> > How widespread are the cases of unused Java fields/methods/classes that are > > used in the native code? > > Probably a few cases. The main benefit is maintainability in the long run. WebKit is the main place where we do this. By convention, all methods in WebView impl classes that are named `fwk*` are called via JNI from native code. Outside WebKit we have a handful of cases. I hope they are all documented. As for an annotation, we wouldn't define one for JavaFX. If the JDK had some sort of `@UsedByNative` annotation (which would be the converse of `@Native`), we could consider using it. Unless / until we have such an annotation, a clear comment is in order. ------------- PR Comment: https://git.openjdk.org/jfx/pull/1824#issuecomment-3164805775