You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Emmanuel Bourg (JIRA)" <ji...@apache.org> on 2007/04/26 00:46:15 UTC

[jira] Updated: (CONFIGURATION-58) [configuration] Wrong primitive conversion in DataConfiguration

     [ 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