From 10326ad4fe1b3db620f43feb3f47c4fd008f3f33 Mon Sep 17 00:00:00 2001 From: Abhishek Koneru Date: Mon, 11 Jun 2012 16:21:26 -0400 Subject: Fixes for Coverity issues of type Stringbuffer, NO_EQUALS_METHOD , REVERSE_INULL,Wrong_Map_Iterators --- .../netscape/cmscore/base/SimpleProperties.java | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'base/common/src/com/netscape/cmscore/base') diff --git a/base/common/src/com/netscape/cmscore/base/SimpleProperties.java b/base/common/src/com/netscape/cmscore/base/SimpleProperties.java index 527b4f694..c1ec27a8c 100644 --- a/base/common/src/com/netscape/cmscore/base/SimpleProperties.java +++ b/base/common/src/com/netscape/cmscore/base/SimpleProperties.java @@ -453,4 +453,30 @@ public class SimpleProperties extends Hashtable { h.put(key, get(key)); } } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((defaults == null) ? 0 : defaults.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; + SimpleProperties other = (SimpleProperties) obj; + if (defaults == null) { + if (other.defaults != null) + return false; + } else if (!defaults.equals(other.defaults)) + return false; + return true; + } + } -- cgit