luetzkendorf    2005/01/14 01:39:23

  Modified:    webdavclient/clientlib/src/java/org/apache/webdav/lib/util
                        QName.java
  Log:
  no message
  
  Revision  Changes    Path
  1.2       +16 -11    
jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/util/QName.java
  
  Index: QName.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/util/QName.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- QName.java        2 Aug 2004 15:45:49 -0000       1.1
  +++ QName.java        14 Jan 2005 09:39:23 -0000      1.2
  @@ -40,10 +40,12 @@
                this.namespaceURI = (namespaceURI == null ? "" : 
namespaceURI).intern();
                this.localName = localName.intern();
                
  -             String hash1 = this.namespaceURI.hashCode() + "";
  -             String hash2 = this.localName.hashCode() + "";
  -             String hash3 = hash1 + '_' + hash2;
  -             this.hashCode=hash3.hashCode();
  +             this.hashCode= new StringBuffer()
  +            .append(this.namespaceURI.hashCode())
  +            .append('_')
  +            .append(this.localName.hashCode())
  +            .toString()
  +            .hashCode();
        }
   
        public String getNamespaceURI()
  @@ -63,10 +65,13 @@
   
        public boolean equals(Object obj)
        {
  -             return (obj != null
  -                     && (obj instanceof QName)
  -             && namespaceURI == ((QName)obj).getNamespaceURI()
  -             && localName == ((QName)obj).getLocalName());
  +      if (this == obj) return true;
  +      if (obj instanceof QName) {
  +          QName that = (QName)obj;
  +          return this.namespaceURI == that.namespaceURI &&
  +                 this.localName == that.localName;
  +      }
  +      return false;
        }
   
        public boolean matches(Node node)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to