Java
Multi-catch can be split into separate catch blocks
Info
New
Last modified: 03 December 2024 Reports multi-catch
sections and suggests splitting them into separate catch
blocks.
Example:
try {
int i = getIndex();
} catch (NullPointerException|IndexOutOfBoundsException e) {
e.printStackTrace();
}
After the quick-fix is applied:
try {
int i = getIndex();
} catch (NullPointerException e) {
e.printStackTrace();
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
}
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
MultiCatchCanBeSplit
This inspection depends on the Java feature 'Multi-catches', which is available since Java 7.
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Java, 243.23126 |
Thanks for your feedback!
Was this page helpful?