You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2007/11/23 17:36:35 UTC
svn commit: r597697 -
/xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java
Author: mrglavas
Date: Fri Nov 23 08:36:34 2007
New Revision: 597697
URL: http://svn.apache.org/viewvc?rev=597697&view=rev
Log:
Use valueOf() instead of directly calling the BigInteger/BigDecimal constructors.
Modified:
xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java
Modified: xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java?rev=597697&r1=597696&r2=597697&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/DurationImpl.java Fri Nov 23 08:36:34 2007
@@ -324,7 +324,7 @@
wrap(days),
wrap(hours),
wrap(minutes),
- seconds != 0 ? new BigDecimal(String.valueOf(seconds)) : null);
+ seconds != 0 ? BigDecimal.valueOf(seconds) : null);
}
/**
@@ -335,14 +335,13 @@
* @return BigInteger representation of int.
*/
private static BigInteger wrap(final int i) {
-
// field may not be set
if (i == DatatypeConstants.FIELD_UNDEFINED) {
return null;
}
// int -> BigInteger
- return new BigInteger(String.valueOf(i));
+ return BigInteger.valueOf(i);
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org