Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.7.0
-
None
-
Windows XP, JDK 1.6.0
Description
I tried to set a field of type Long with a double value (e.g. 100.0) and I got 0.
In BeanUtilsBean, in the following code:
} else if (getConvertUtils().lookup(value.getClass()) != null)
{ newValue = getConvertUtils().convert(value.toString(), type); }else {
value.toString() is passed to LongConverter which would handle value (Double) correctly but fails when a String (e.g. "100.0") is passed in. It seems changing "value.toString()" to "value" should fix the problem.
Attachments
Issue Links
- depends upon
-
BEANUTILS-258 Improve Converter Implementations
- Closed
- is duplicated by
-
BEANUTILS-275 BeanUtils.setProperty: crashes when setting a java.util.Date simple property with a java.sql.Timestamp value
- Closed