summaryrefslogtreecommitdiff
path: root/javax/security
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2005-10-01 18:48:45 +0000
committerTom Tromey <tromey@redhat.com>2005-10-01 18:48:45 +0000
commit74e307684760a215be923021f3fa2c7e0cad6194 (patch)
tree04d8f36bdb69de4c76ae94a9f206fe57f902d920 /javax/security
parent442fe0aea24ee710aa54300f7fcf767bd0612e88 (diff)
downloadclasspath-74e307684760a215be923021f3fa2c7e0cad6194.tar.gz
PR classpath/23880:
* gnu/java/security/x509/ext/Extension.java (Value.hashCode): New method. * gnu/java/security/der/BitString.java (hashCode): New method. * javax/security/auth/x500/X500Principal.java (hashCode): New method.
Diffstat (limited to 'javax/security')
-rw-r--r--javax/security/auth/x500/X500Principal.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/javax/security/auth/x500/X500Principal.java b/javax/security/auth/x500/X500Principal.java
index 78c35ade1..fcbb4950a 100644
--- a/javax/security/auth/x500/X500Principal.java
+++ b/javax/security/auth/x500/X500Principal.java
@@ -140,6 +140,22 @@ public final class X500Principal implements Principal, Serializable
// Instance methods.
// ------------------------------------------------------------------------
+ public int hashCode()
+ {
+ int result = size();
+ for (int i = 0; i < size(); ++i)
+ {
+ Map m = (Map) components.get(i);
+ for (Iterator it2 = m.entrySet().iterator(); it2.hasNext(); )
+ {
+ Map.Entry e = (Map.Entry) it2.next();
+ // We don't bother looking at the value of the entry.
+ result = result * 31 + ((OID) e.getKey()).hashCode();
+ }
+ }
+ return result;
+ }
+
public boolean equals(Object o)
{
if (!(o instanceof X500Principal))