jakarta-bcel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject svn commit: r392823 - /jakarta/bcel/trunk/src/java/org/apache/bcel/generic/Type.java
Date Sun, 09 Apr 2006 20:02:17 GMT
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() {



---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-dev-help@jakarta.apache.org


Mime
View raw message