Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-beta-8, 1.0-beta-9, 1.0-beta-10, 1.0-JSR-1, 1.0-JSR-2, 1.0-JSR-3
-
None
-
None
-
Java 1.5.0_03 on Windows XP
Description
In the following code, I declare a member as a primitive type. In Java, it could never have a "null" value, and its value would default to 0. But in Groovy:
groovy> class Foo
{ public float x }groovy> y = new Foo()
groovy> println y.x
groovy> go
null
So, when the primitive type is boxed (i.e. changed from float to Float), it should also get a default value if it doesn't already have one.
This is part of GROOVY-683 that somehow got overlooked.