commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Bourg (JIRA)" <j...@apache.org>
Subject [jira] Updated: (CONFIGURATION-58) [configuration] Wrong primitive conversion in DataConfiguration
Date Wed, 25 Apr 2007 22:46:15 GMT

     [ 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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message