mrglavas 2005/05/16 13:07:07
Modified: java/src/org/apache/xerces/impl/xs/util ShortListImpl.java
Log:
Fixing a bug. We test equality of ShortLists in XSSimpleTypeDecl,
however since there was no equals() method on this class, we
were falling back to Object.equals() which compares by reference.
Revision Changes Path
1.4 +19 -1
xml-xerces/java/src/org/apache/xerces/impl/xs/util/ShortListImpl.java
Index: ShortListImpl.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/util/ShortListImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ShortListImpl.java 6 Oct 2004 15:14:50 -0000 1.3
+++ ShortListImpl.java 16 May 2005 20:07:07 -0000 1.4
@@ -75,5 +75,23 @@
throw new XSException(XSException.INDEX_SIZE_ERR, null);
return fArray[index];
}
+
+ public boolean equals(Object obj) {
+ if (obj == null || !(obj instanceof ShortList)) {
+ return false;
+ }
+ ShortList rhs = (ShortList)obj;
+
+ if (fLength != rhs.getLength()) {
+ return false;
+ }
+
+ for (int i = 0;i < fLength; ++i) {
+ if (fArray[i] != rhs.item(i)) {
+ return false;
+ }
+ }
+ return true;
+ }
} // class XSParticle
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]