Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-beta-6
-
None
-
None
-
Windows XP, jdk1.4
Description
If a setter method for a mixed case property is used,
the property cannot be set.
Resulting error: Cannot set read-only property: mixedCaseProperty
Example: MixedCasePropertyBug.groovy
bean = new MixedCasePropertyBean()
bean.mixedCaseProperty = "test" // this should work but dont
println(bean.mixedCaseProperty)
//bean.mixedcaseproperty = "test" // this shouldnt work but does
//println(bean.mixedcaseproperty)
class MixedCasePropertyBean {
private mixedCaseProperty
public getMixedCaseProperty()
public setMixedCaseProperty(val)
{ this.mixedCaseProperty = val }}
-----------------------------------
I have tracked down the error to MetaClass.setUpProperties.
Line 793 and 820 should be:
String propName = methodName.substring(3,4).toLowerCase() + methodName.substring(4);
Instead of:
String propName = methodName.substring(3).toLowerCase();