<AWT Dev> RFR: 8248532: Every time I change keyboard language at my MacBook, Java crashes

Prasanta Sadhukhan psadhukhan at openjdk.java.net
Mon Sep 7 04:20:12 UTC 2020


On Sun, 6 Sep 2020 22:47:11 GMT, Phil Race <prr at openjdk.org> wrote:

>> Marked as reviewed by serb (Reviewer).
>
> You say you need to use NSDistributedNotificationCenter but you don't. So I am confused.

The problem of crash is about not having proper observer. As per
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Notifications/Articles/NotificationCenters.html
NSNotificationCenter delivers notifications to observers synchronously whereas NSDistributedNotificationCenter
notification is usually delivered to the main thread’s run loop, thus not depending on observer setup. Both will work
but since we use NSNotificationCenter in mac so far, it seems prudent to use the same methodology for this case too, so
I have rectified the observer setup.

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

PR: https://git.openjdk.java.net/jdk/pull/28


More information about the awt-dev mailing list