Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.0-BETA
-
None
-
All
Description
An array value passed as:
this_is_my_first_value,this_is_my_second_value
causes an NPE after the first token is returned:
java.lang.NullPointerException
at org.apache.commons.beanutils.converters.ArrayConverter.parseElements(ArrayConverter.java:440)
at org.apache.commons.beanutils.converters.ArrayConverter.convertToCollection(ArrayConverter.java:343)
at org.apache.commons.beanutils.converters.ArrayConverter.convertToType(ArrayConverter.java:279)
at org.apache.commons.beanutils.converters.AbstractConverter.convert(AbstractConverter.java:171)
at org.apache.commons.beanutils.converters.ConverterFacade.convert(ConverterFacade.java:60)
at org.apache.commons.beanutils.BeanUtilsBean.convert(BeanUtilsBean.java:1079)
at org.apache.commons.beanutils.BeanUtilsBean.copyProperty(BeanUtilsBean.java:437)
at org.apache.commons.beanutils.BeanUtilsBean.copyProperties(BeanUtilsBean.java:270)
at org.apache.commons.beanutils.BeanUtils.copyProperties(BeanUtils.java:137)
The parse list being built contains "this". The sval field of the StreamTokenizer is indeed null - presumably because it has found the the underscore.
Workaround is to quote the string. See BEANUTILS-301 for an improvement request to allow _ as part of the default word character set.