svn commit: r392823 - /jakarta/bcel/trunk/src/java/org/apache/bcel/generic/Type.java

[email protected]
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]>
Author: dbrosius
Date: Sun Apr  9 13:02:13 2006
New Revision: 392823

URL: http://svn.apache.org/viewcvs?rev=392823&view=rev
Log:
implement hashCode and equals for Type

Modified:
    jakarta/bcel/trunk/src/java/org/apache/bcel/generic/Type.java

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/Type.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/Type.java?rev=392823&r1=392822&r2=392823&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/Type.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/Type.java Sun Apr  9 13:02:13 2006
@@ -63,6 +63,26 @@
 
 
     /**
+     * @return hashcode of Type
+     */
+    public int hashCode() {
+    	return type ^ signature.hashCode();
+    }
+    
+    
+    /**
+     * @return whether the Types are equal
+     */
+    public boolean equals(Object o) {
+  		if (o instanceof Type) {
+  			Type t = (Type)o;
+  			return (type == t.type) && signature.equals(t.signature);
+  		}
+  		return false;
+    }
+    
+    
+    /**
      * @return signature for given type.
      */
     public String getSignature() {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.