xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r700590 - /xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java
Date Tue, 30 Sep 2008 21:51:24 GMT
Author: radup
Date: Tue Sep 30 14:51:24 2008
New Revision: 700590

URL: http://svn.apache.org/viewvc?rev=700590&view=rev
Log:
Fixed a bug in GDate.getMillisecond() whereby if the value contained fractions of a millisecond,
it got rounded, which in some cases (999.9 milliseconds for example) produced an invalid millisecond
value (1000 in that case with milliseconds being restricted to 0-999). Used truncate instead
of round to make sure the millisecond value stays in bounds.

Modified:
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java?rev=700590&r1=700589&r2=700590&view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/GDate.java Tue Sep 30 14:51:24 2008
@@ -675,7 +675,7 @@
     {
         if (_fs == null)
             return 0;
-        return _fs.setScale(3, BigDecimal.ROUND_HALF_UP).unscaledValue().intValue();
+        return _fs.setScale(3, BigDecimal.ROUND_DOWN).unscaledValue().intValue();
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org


Mime
View raw message