RFR: 8284672: Collapse identical catch branches in java.desktop [v2]

Alexey Ivanov aivanov at openjdk.org
Fri Jun 17 14:00:01 UTC 2022


On Wed, 1 Jun 2022 20:55:30 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

>> Let's take advantage of Java 7 language feature - "Catching Multiple Exception Types".
>> It simplifies code. Reduces duplication.
>> Found by IntelliJ IDEA inspection Identical 'catch' branches in 'try' statement
>
> Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8284672: Collapse identical catch branches in java.desktop
>   fix formatting

Marked as reviewed by aivanov (Reviewer).

src/java.desktop/share/classes/javax/swing/text/InternationalFormatter.java line 531:

> 529:                         updateMask(iterator);
> 530:                     }
> 531:                     catch (ParseException | NullPointerException | IllegalArgumentException e) {}

Maybe move `catch` to the line with the closing brace? The try block above follows the regular Java code style.

src/java.desktop/share/classes/javax/swing/text/InternationalFormatter.java line 1049:

> 1047:                                 }
> 1048:                             }
> 1049:                             catch (ParseException | BadLocationException e) { }

Same here?

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

PR: https://git.openjdk.org/jdk/pull/8154



More information about the client-libs-dev mailing list