mrglavas 2004/08/10 08:29:32
Modified: java/src/org/apache/xerces/impl/xs XMLSchemaValidator.java
Log:
Fixing a potential NPE and some cleanup.
Revision Changes Path
1.159 +7 -3
xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java
Index: XMLSchemaValidator.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XMLSchemaValidator.java,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -r1.158 -r1.159
--- XMLSchemaValidator.java 9 Aug 2004 22:43:36 -0000 1.158
+++ XMLSchemaValidator.java 10 Aug 2004 15:29:29 -0000 1.159
@@ -51,7 +51,6 @@
import org.apache.xerces.util.SymbolTable;
import org.apache.xerces.util.XMLAttributesImpl;
import org.apache.xerces.util.XMLChar;
-import org.apache.xerces.util.XMLResourceIdentifierImpl;
import org.apache.xerces.util.XMLSymbols;
import org.apache.xerces.xni.Augmentations;
import org.apache.xerces.xni.NamespaceContext;
@@ -3442,7 +3441,7 @@
for (int k = 0; k < fFieldCount; ++k) {
final Object value1 = values.elementAt(i+k);
final Object value2 = fValues.elementAt(j+k);
- if (value1 != value2 && !value1.equals(value2)) {
+ if (value1 != value2 && (value1 == null ||
!value1.equals(value2))) {
continue INNER;
}
}
@@ -3491,6 +3490,11 @@
// no values
if (length == 0) {
return "";
+ }
+
+ // one value
+ if (length == 1) {
+ return String.valueOf(values.elementAt(start));
}
// construct value string
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]