RFR: 8278021: Fix warnings in macOS glass native code and treat warnings as errors [v4]

Martin Fox mfox at openjdk.org
Fri Feb 2 20:14:07 UTC 2024


On Fri, 2 Feb 2024 19:47:17 GMT, Martin Fox <mfox at openjdk.org> wrote:

>> Turning on warnings-as-errors for the macOS glass native code. Deprecated declarations are excluded and still appear as warnings.
>> 
>> In the code that tries to locate the application's dock icon there were three instances where `NO` was being passed into a method that required a pointer to a `BOOL`, not a `BOOL`. I suspect the intent was to check that the path pointed to an existing file but not a directory. Since JavaFX has gone this long without screening out directories correctly I decided not to fix that behavior except at the very end.
>> 
>> The only other changes of note are sending some NSNotification objects to delegate API's that require them even though we know they're ignored on the other side. It was the easiest way to get rid of the warning.
>
> Martin Fox has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Added OS version guard for NSApp activate call

Ouch.

We're targeting a minimum macOS version of 11.0 but `[NSApp activate]` is only available on 14.0 and above. Xcode 15 should issue a warning about this but doesn't *if this is the only version warning in the file*. I've tried this with a standalone app and also tweaked the Glass code and the result is the same; I get no warning unless I add some other 14.0-specific call in the same file. At that point I'll get a warning about the other violation in addition to the `[NSApp activate]` call.

Adding an `@available` check around this is the right thing to do but not enough to appease the pre-submit bot which is building with the 13.3 SDK. To clean this up either the bot needs to be upgraded or I need to add a localized pragma to disable this check.

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

PR Comment: https://git.openjdk.org/jfx/pull/687#issuecomment-1924616685


More information about the openjfx-dev mailing list