Inspectopedia Help

'return' inside 'finally' block

Reports return statements inside of finally blocks.

While occasionally intended, such return statements may mask thrown exceptions and complicate debugging.

Example:

try { foo(); } finally { if (bar()) return; }

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023