You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2003/03/17 16:51:15 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/impl/dv/xs AbstractDateTimeDV.java
sandygao 2003/03/17 07:51:15
Modified: java/src/org/apache/xerces/impl/dv/xs
AbstractDateTimeDV.java
Log:
Fixing bug 18034. Need to check whether there is anything unexpected
between "second" and "time zone".
Revision Changes Path
1.10 +7 -17 xml-xerces/java/src/org/apache/xerces/impl/dv/xs/AbstractDateTimeDV.java
Index: AbstractDateTimeDV.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/dv/xs/AbstractDateTimeDV.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- AbstractDateTimeDV.java 21 Feb 2003 17:00:11 -0000 1.9
+++ AbstractDateTimeDV.java 17 Mar 2003 15:51:15 -0000 1.10
@@ -57,8 +57,6 @@
package org.apache.xerces.impl.dv.xs;
-import org.apache.xerces.impl.dv.InvalidDatatypeValueException;
-
/**
* This is the base class of all date/time datatype validators.
* It implements common code for parsing, validating and comparing datatypes.
@@ -257,24 +255,16 @@
//parse miliseconds
if ( milisec != -1 ) {
-
- if ( sign<0 ) {
-
- //get all digits after "."
- data[ms]=parseInt(buffer, milisec+1, end);
- start = end;
- }
- else {
-
- //get ms before UTC sign
- data[ms]=parseInt(buffer, milisec+1,sign);
- start = sign;
- }
-
+ // The end of millisecond part is between . and
+ // either the end of the UTC sign
+ start = sign < 0 ? end : sign;
+ data[ms]=parseInt(buffer, milisec+1, start);
}
//parse UTC time zone (hh:mm)
if ( sign>0 ) {
+ if (start != sign)
+ throw new RuntimeException("Error in parsing time zone" );
getTimeZone(buffer, data, sign, end, timeZone);
}
else if (start != end) {
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org