Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 1.7-rc-1, 1.6.7, 1.6.8
-
Fix Version/s: 1.7.2
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
With following code, the finally block is executed twice:
try { throw new RuntimeException() } catch (Throwable t) { } finally { println "in finally" throw new RuntimeException() }
Output:
in finally in finally Exception thrown java.lang.RuntimeException at ConsoleScript3.run(ConsoleScript3:8)
Let me add a bit to its weirdness:
executes the finally block 3 times:
in finally in finally in finally Caught: java.lang.RuntimeException at Try.run(Try.groovy:8)