axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Conroy (JIRA)" <j...@apache.org>
Subject [jira] Updated: (AXIS2-3423) ConverterUtil.convertToDateTime is adding portion of fractions of a second to time as milliseconds during conversion
Date Wed, 30 Jan 2008 00:06:35 GMT

     [ https://issues.apache.org/jira/browse/AXIS2-3423?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Matt Conroy updated AXIS2-3423:
-------------------------------

    Attachment: ConverterUtil.java.diff

> ConverterUtil.convertToDateTime is adding portion of fractions of a second to time as
milliseconds during conversion
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3423
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3423
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: databinding
>    Affects Versions: 1.4, nightly
>         Environment: Java 1.5 
>            Reporter: Rob Decker
>         Attachments: ConverterUtil.java, ConverterUtil.java.diff
>
>
> In org.apache.axis2.databinding.utils.ConverterUtil method convertToDateTime lines 946
to 955 of the 20071231 nitely build is trying to round the fractions of a millisecond but
is instead parsing out millionths of a second, stripping the thousands and adding the left
over millionths of a second to time:
>             if (milliSecondPartLength != 3){
>                 // milisecond part represenst the fraction of the second so we have to
>                 // find the fraction and multiply it by 1000. So if milisecond part
>                 // has three digits nothing required
>                 miliSecond = miliSecond * 1000;
>                 for (int i = 0; i < milliSecondPartLength; i++) {
>                     miliSecond = miliSecond / 10;
>                 }
>             }
>             calendar.set(Calendar.MILLISECOND, miliSecond);  // <-- this adds millionths
of a second as milliseconds
> The loop should be:
>     double ms = milliSecond * 1000;
>     for (int =0; i < milliSecondPartLength; i++) {
>         ms = ms /10;
>    }
>    miliSecond = (ms%1)*1000;

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


Mime
View raw message