[ https://issues.apache.org/jira/browse/CONFIGURATION-58?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Emmanuel Bourg updated CONFIGURATION-58: ---------------------------------------- Fix Version/s: 1.1 > [configuration] Wrong primitive conversion in DataConfiguration > --------------------------------------------------------------- > > Key: CONFIGURATION-58 > URL: https://issues.apache.org/jira/browse/CONFIGURATION-58 > Project: Commons Configuration > Issue Type: Bug > Environment: Operating System: All > Platform: All > Reporter: Emmanuel Bourg > Fix For: 1.1 > > > The values in getLongArray(), getFloatArray() and getDoubleArray() are not > converted to the right type, they are all converted into integers. > Index: DataConfiguration.java > =================================================================== > --- DataConfiguration.java (revision 153417) > +++ DataConfiguration.java (working copy) > @@ -825,7 +826,7 @@ > Iterator it = values.iterator(); > while (it.hasNext()) > { > - array[i++] = PropertyConverter.toLong(it.next()).intValue(); > + array[i++] = PropertyConverter.toLong(it.next()).longValue(); > } > } > else > @@ -834,7 +835,7 @@ > { > // attempt to convert a single value > array = new long[1]; > - array[0] = PropertyConverter.toLong(value).intValue(); > + array[0] = PropertyConverter.toLong(value).longValue(); > } > catch (ConversionException e) > { > @@ -974,7 +975,7 @@ > Iterator it = values.iterator(); > while (it.hasNext()) > { > - array[i++] = PropertyConverter.toFloat(it.next()).intValue(); > + array[i++] = > PropertyConverter.toFloat(it.next()).floatValue(); > } > } > else > @@ -983,7 +984,7 @@ > { > // attempt to convert a single value > array = new float[1]; > - array[0] = PropertyConverter.toFloat(value).intValue(); > + array[0] = PropertyConverter.toFloat(value).floatValue(); > } > catch (ConversionException e) > { > @@ -1124,7 +1125,7 @@ > Iterator it = values.iterator(); > while (it.hasNext()) > { > - array[i++] = > PropertyConverter.toDouble(it.next()).intValue(); > + array[i++] = > PropertyConverter.toDouble(it.next()).doubleValue(); > } > } > else > @@ -1133,7 +1134,7 @@ > { > // attempt to convert a single value > array = new double[1]; > - array[0] = PropertyConverter.toDouble(value).intValue(); > + array[0] = PropertyConverter.toDouble(value).doubleValue(); > } > catch (ConversionException e) > { -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]