Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
2.3.3, 2.4.0-beta-1
-
None
Description
Consider the following Java class:
package b; import java.util.concurrent.Callable; public class B { private String name; public B(final String name) { this.name = name; } public void setCallable(final Callable<String> c) { System.out.println(name + ": " + String.valueOf(c)); } }
and the following Groovy class:
@CompileStatic class Test { static main(args) { def clos = { 'bar' } as Callable<String> B b1 = new B('b1') B b2 = new B('b2') b1.callable = b2.callable = clos } }
Run Test class as a Groovy script: b1.callable is assigned null, instead of the clos closure. Remove the @CompileStatic in Test, re-run and... all goes right!