Inspectopedia Help

Empty 'finally' block

Reports empty finally blocks.

Empty finally blocks usually indicate coding errors. They may also remain after code refactoring and can safely be removed.

This inspection doesn't report empty finally blocks found in JSP files.

Example:

try { Files.readString(Paths.get("in.txt")); } catch (IOException e) { throw new RuntimeException(e); } finally { }

After the quick-fix is applied:

try { Files.readString(Paths.get("in.txt")); } catch (IOException e) { throw new RuntimeException(e); }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023