<i18n dev> RFR: 8274640: Cleanup unnecessary null comparison before instanceof check in java.desktop [v2]

Alexey Ivanov aivanov at openjdk.java.net
Mon Nov 29 11:20:17 UTC 2021


On Mon, 29 Nov 2021 08:00:19 GMT, Andrey Turbanov <duke at openjdk.java.net> wrote:

>> src/java.desktop/unix/classes/sun/awt/X11/XWindow.java line 312:
>> 
>>> 310:         }
>>> 311: 
>>> 312:         return window.getContentWindow();
>> 
>> Is the branch where 0 was returned impossible?
>
> Yes. It was impossible.
> Only way out of this cycle is when `peer instanceof XWindow` is `true`
> https://github.com/openjdk/jdk/blob/0c7a4b8aa8bb672e87aae7090494719db018b9b1/src/java.desktop/unix/classes/sun/awt/X11/XWindow.java#L306-L310

Thanks, I just wanted to confirm my own understanding.

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

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


More information about the i18n-dev mailing list