Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
2.2.1, 2.2.2
-
None
-
None
-
Mavericks, JDK 1.7.0_12-ea
Description
finally blocks do not always run, e.g. when an exception is thrown from another nested finally block. I can confirm this issue in at least 2.2.2, 2.2.1, 2.0.5 and 1.8
/tmp$ cat finally.groovy count = 0 def outer() { try { inner() } catch (Exception e) { println 'count is: ' + count } } def inner() { try { try { count = 1 } finally { count = 2 throw new RuntimeException('barf') } } finally { count = 3 } } outer() /tmp$ groovy-2.2.2/bin/groovy finally.groovy count is: 2