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 2001/11/02 21:21:15 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/impl/xs XSElementDecl.java
sandygao 01/11/02 12:21:15
Modified: java/src/org/apache/xerces/impl/xs XSElementDecl.java
Log:
1. it's possible that fTargetNamespace == null, in this case, don't use it to generate hashcode;
2. implement equals().
Revision Changes Path
1.4 +12 -2 xml-xerces/java/src/org/apache/xerces/impl/xs/XSElementDecl.java
Index: XSElementDecl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/XSElementDecl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XSElementDecl.java 2001/11/01 21:25:36 1.3
+++ XSElementDecl.java 2001/11/02 20:21:15 1.4
@@ -65,7 +65,7 @@
*
* @author Elena Litani, IBM
* @author Sandy Gao, IBM
- * @version $Id: XSElementDecl.java,v 1.3 2001/11/01 21:25:36 sandygao Exp $
+ * @version $Id: XSElementDecl.java,v 1.4 2001/11/02 20:21:15 sandygao Exp $
*/
public class XSElementDecl {
@@ -173,6 +173,16 @@
* get the hash code
*/
public int hashCode() {
- return (fName.hashCode()<<16)+fTargetNamespace.hashCode();
+ int code = fName.hashCode();
+ if (fTargetNamespace != null)
+ code = (code<<16)+fTargetNamespace.hashCode();
+ return code;
+ }
+
+ /**
+ * whether two decls are the same
+ */
+ public boolean equals(Object o) {
+ return o == this;
}
} // class XMLElementDecl
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org