Synopsis: | Merge identical catch branches |
Language: | Java |
Severity Level: | 6 |
Category: | Basic |
Description: |
Identical try { // do something } catch (IllegalArgumentException e) { throw e; } catch (IllegalStateException e) { // Can be collapsed into the previous block throw e; } try { // do something } catch (IllegalArgumentException | IllegalStateException e) { // This is better throw e; } |