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/07/07 05:23:10 UTC
svn commit: r554123 -
/xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl.java
Author: mrglavas
Date: Fri Jul 6 20:23:09 2007
New Revision: 554123
URL: http://svn.apache.org/viewvc?view=rev&rev=554123
Log:
Improving the performance of toXMLFormat(). If the year < 10^9 avoid calling getEonAndYear(). This
prevents a new BigInteger from being created. This change also fixes a bug in the serialization of
negative years > -1000 which was causing leading zeros to be written in front of the '-' sign.
Modified:
xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl.java
Modified: xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl.java?view=diff&rev=554123&r1=554122&r2=554123
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl.java Fri Jul 6 20:23:09 2007
@@ -2944,7 +2944,17 @@
switch(format.charAt(fidx++)) {
case 'Y':
- printNumber(buf,getEonAndYear(), 4);
+ if (eon == null) {
+ int absYear = year;
+ if (absYear < 0) {
+ buf.append('-');
+ absYear = -year;
+ }
+ printNumber(buf, absYear, 4);
+ }
+ else {
+ printNumber(buf, getEonAndYear(), 4);
+ }
break;
case 'M':
printNumber(buf,getMonth(),2);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org