Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0-beta-8
-
Fix Version/s: 1.0-beta-9
-
Component/s: None
-
Labels:None
-
Environment:Windows XP Pro under Cygwin
-
Number of attachments :
Description
If I create a GroovyBean with a "float" field then try to assign to it, I get an error:
/cygdrive/c/Develop> groovysh
Lets get Groovy!
================
Version: 1.0-beta-8 JVM: 1.4.2_06-b03
Type 'exit' to terminate the shell
Type 'help' for command help
Type 'go' to execute the statements
groovy> class Foo
{ float x }groovy> y = new Foo()
groovy> println y.x
groovy> go
null # How is this possible???
groovy> y.x = 10
groovy> go
Exception: No such property: x for class: Foo. Reason: groovy.lang.GroovyRuntimeException: Cannot set property: x reason: null
groovy.lang.MissingPropertyException: No such property: x for class: Foo. Reason: groovy.lang.GroovyRuntimeException: Cannot set pro
ull
at groovy.lang.MetaClass.setProperty(MetaClass.java:996)
....
No such property: x for class: Foo. Reason: groovy.lang.GroovyRuntimeException: Cannot set property: x reason: null
If Groovy Beans can't take native types, only their object wrappers, then I should get an error in the class definition, no?
- Martin
I hope that this patch can fix such a bug.