Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
n/a
Description
In Java:
class Thing {
int a;
int b;
}
Thing t = new Thing()
t.a and t.b are both zero.
Since Groovy uses java.lang.Integer in the above case, t.a and t.b are null.
To avoid confusion and to be consistent with Java, uninitialized Groovy "primitive" types should be initialized to a default values consistent with Java.