Java
Redundant 'close()'
Warning
New
Last modified: 03 December 2024 Reports unnecessary calls to close()
at the end of a try-with-resources block and suggests removing them.
Example:
try(MyAutoCloseable ac = new MyAutoCloseable()) {
foo();
ac.close();
}
After the quick-fix is applied:
try(MyAutoCloseable ac = new MyAutoCloseable()) {
foo();
}
- 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.
RedundantExplicitClose
New in 2018.1
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Java, 243.23126 |
Thanks for your feedback!
Was this page helpful?