You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-cvs@xml.apache.org by mr...@apache.org on 2007/07/14 19:31:21 UTC
svn commit: r556303 -
/xml/commons/trunk/java/external/src/javax/xml/datatype/DatatypeFactory.java
Author: mrglavas
Date: Sat Jul 14 10:31:20 2007
New Revision: 556303
URL: http://svn.apache.org/viewvc?view=rev&rev=556303
Log:
Performance: Use BigDecimal.valueOf(long, int) instead of movePointLeft(). This
reduces the number of BigDecimal instances created in the factory methods from
two to one.
Modified:
xml/commons/trunk/java/external/src/javax/xml/datatype/DatatypeFactory.java
Modified: xml/commons/trunk/java/external/src/javax/xml/datatype/DatatypeFactory.java
URL: http://svn.apache.org/viewvc/xml/commons/trunk/java/external/src/javax/xml/datatype/DatatypeFactory.java?view=diff&rev=556303&r1=556302&r2=556303
==============================================================================
--- xml/commons/trunk/java/external/src/javax/xml/datatype/DatatypeFactory.java (original)
+++ xml/commons/trunk/java/external/src/javax/xml/datatype/DatatypeFactory.java Sat Jul 14 10:31:20 2007
@@ -751,8 +751,7 @@
+ "with invalid millisecond: " + millisecond
);
}
-
- realMillisecond = BigDecimal.valueOf((long) millisecond).movePointLeft(3);
+ realMillisecond = BigDecimal.valueOf((long) millisecond, 3);
}
return newXMLGregorianCalendar(
@@ -920,8 +919,7 @@
+ "with invalid milliseconds: " + milliseconds
);
}
-
- realMilliseconds = BigDecimal.valueOf((long) milliseconds).movePointLeft(3);
+ realMilliseconds = BigDecimal.valueOf((long) milliseconds, 3);
}
return newXMLGregorianCalendarTime(