summaryrefslogtreecommitdiffstats
path: root/base/util/src/netscape/security/pkcs/PKCS10Attributes.java
diff options
context:
space:
mode:
authorAbhishek Koneru <akoneru@redhat.com>2012-06-11 16:21:26 -0400
committerEndi Sukma Dewata <edewata@redhat.com>2012-06-15 17:12:15 -0500
commit10326ad4fe1b3db620f43feb3f47c4fd008f3f33 (patch)
tree4d4a0f719bbbea6d6db53ef3fab5f3717411cfb9 /base/util/src/netscape/security/pkcs/PKCS10Attributes.java
parentc53ca291e21761f1de5417ef596afba395a7f5d1 (diff)
downloadpki-10326ad4fe1b3db620f43feb3f47c4fd008f3f33.tar.gz
pki-10326ad4fe1b3db620f43feb3f47c4fd008f3f33.tar.xz
pki-10326ad4fe1b3db620f43feb3f47c4fd008f3f33.zip
Fixes for Coverity issues of type Stringbuffer, NO_EQUALS_METHOD , REVERSE_INULL,Wrong_Map_Iterators
Diffstat (limited to 'base/util/src/netscape/security/pkcs/PKCS10Attributes.java')
-rw-r--r--base/util/src/netscape/security/pkcs/PKCS10Attributes.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/base/util/src/netscape/security/pkcs/PKCS10Attributes.java b/base/util/src/netscape/security/pkcs/PKCS10Attributes.java
index d9b463b5f..22a0dce21 100644
--- a/base/util/src/netscape/security/pkcs/PKCS10Attributes.java
+++ b/base/util/src/netscape/security/pkcs/PKCS10Attributes.java
@@ -144,4 +144,30 @@ public class PKCS10Attributes extends Vector<PKCS10Attribute> implements DerEnco
public Enumeration<PKCS10Attribute> getElements() {
return map.elements();
}
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = super.hashCode();
+ result = prime * result + ((map == null) ? 0 : map.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (!super.equals(obj))
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ PKCS10Attributes other = (PKCS10Attributes) obj;
+ if (map == null) {
+ if (other.map != null)
+ return false;
+ } else if (!map.equals(other.map))
+ return false;
+ return true;
+ }
+
}