On Thu, 15 Feb 2024 17:43:03 GMT, Alexander Zuev <[email protected]> wrote:

>> test/jdk/javax/swing/JTabbedPane/TabbedPaneNPECheck.java line 90:
>> 
>>> 88:             if (accessible instanceof AccessibleComponent) {
>>> 89:                 try {
>>> 90:                     AccessibleComponent component = 
>>> (AccessibleComponent) accessible;
>> 
>> You can you pattern matching if you like:
>> Suggestion:
>> 
>>             if (accessible instanceof AccessibleComponent component) {
>>                 try {
>
> Since this fix can be backported to the previous releases where this nice 
> feature is not available i prefer not to use it. I guess backporting is why 
> we can't get nice things for ourselves.

Yeah, it's a consideration. Pattern matching for `instanceof` is available 
since Java 16, so only 11 and below will need slight modification.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17736#discussion_r1491407399

Reply via email to