On Wed, 11 Nov 2026 04:49:41 GMT, Prasanta Sadhukhan <[email protected]> 
wrote:

>> yes, fixed.
>
> @prrace I was waiting for this comment to be resolved actually...As mentioned 
> above, it seems to me that sjm_printerJob should be  DECLARE_FIELD_ONLY 
> (instead of DECLARE_METHOD_ONLY) as it returns a GetObjectField via 
> GET_FIELD_RETURN(sjm_printerJob, ...)...Let me know if it is not valid?!!

That one surprised me.  It is declared as a jmethodID, but used throughout 
(correctly) as a jfieldID
So everything works fine but .. how could there not be a compilation error that 
this was the wrong pointer type ?
Turns out that libawt_awt on macOS disables  the warning 
'incompatible-pointer-types'

So I fixed this one but then enabled the warning to find any more such cases.

I found 2 problems of a similar type in each of 2 of the A11Y files. I've fixed 
those too.
They actually look like they ought to have caused problems .. the method handle 
was passed
in the place the class was supposed to be for CallStaticObjectMethod. I've 
fixed those.

What I have not done (and will not do) is fix the cause of a bunch of other 
sources of this warning across the library.
There's about 10 files that cause the warning. 6 in the metal code, 3 in the 
A11Y code, and 1 font file.

But it points out that suppressing this warning is dangerous, even if most 
actual sources are not a problem.
So what I will do, as part of this patch, is to move the warning from being 
'library-wide' to file-specific.
That would have caught at least the CPrinterJob.m case since nothing else in 
that file would trigger the warning.

I went through each of these 10 files and I think there are no JNI sources to 
these warnings left.

I'll (later) file some bugs asking to resolve this warning in those files.
And many of the rest of the disabled warnings ought to get some attention too 
but this would be a start.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33481#discussion_r4546013874

Reply via email to