Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.2
-
None
Description
In the following code, synchronizing on the private final field map inside a closure causes a VerifyError. Synchronizing on a protected or public field fixes the problem.
class TaskManager { private final Map<Long, String> map = [1L:'a',2L:'b'] void doh() { def list = [1L] list.each { synchronized (map) { map.remove(it) } } } } new TaskManager().doh()