On Thu, 22 Jun 2023 18:45:27 GMT, Alexander Zuev <[email protected]> wrote:

>> src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessible.java line 185:
>> 
>>> 183:                     // Do send check box state changes to native side
>>> 184:                     if (thisRole == AccessibleRole.CHECK_BOX) {
>>> 185:                         if (newValue != null && 
>>> !newValue.equals(oldValue)) {
>> 
>> Is it possible to have "newValue == null" and the "oldValue != null"? Do we 
>> need to update the native in this case?
>
> No. Null value is not a correct value to be set for these types of control so 
> if null is passed then it is not a real value update event.

[`Objects.equals`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Objects.html#equals(java.lang.Object,java.lang.Object))
 can be used to avoid null-check, it handles `null` values gracefully.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14605#discussion_r1239014266

Reply via email to