On Wed, 25 Jun 2025 07:03:33 GMT, Dmitry Kulikov <d...@openjdk.org> wrote:

>> Added an on-demand installation of the native OpenURL event handler to the 
>> `Application.setOpenURIHandler()`.
>> 
>> This does not break the specification for the affected API, since the 
>> requirement of the application being bundled and containing 
>> `CFBundleURLTypes` in the `Info.plist` is still valid: macOS will neither 
>> launch nor send OpenURL events to an application that does not declare such 
>> capabilities it the bundle.
>> 
>> Running tests on macOS showed no regressions after this patch. Other 
>> platforms are not affected.
>
> Dmitry Kulikov has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Update copyright years

Yes, all 3 points are correct. Probably the native URL handler is installed 
during the startup of the bundled application in order to catch the first 
OpenURL event that might have launched the application in the first place (I'll 
conduct more tests to see how an early handler registration affects the startup 
behavior). Java code technically is not required to install any URL handlers 
even in case of a bundled application, however declaring the capability to 
handle OpenURL events in the application bundle requires some actions from the 
application developer. I guess it was thought of as a "common sense" not to 
declare OpenURL handling capability in the bundle without actually handling the 
URLs in the Java code.

Searching the Internet so far did not show up any references to `[bundle 
_hasEAWTOverride:@"URLHandler"]` (or the respective keys in the property list 
file) except the JDK code itself. Under such circumstances I've decided to 
leave these checks intact.

I'm investigating the possibility of composing a regression test for this 
change. It does not look straight impossible so far. I'll post an update on 
this matter shortly.

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

PR Comment: https://git.openjdk.org/jdk/pull/25967#issuecomment-3072648383

Reply via email to