commit | 6a6fdac2d81cd38390c11cfbb81ec0168665cfea | [log] [tgz] |
---|---|---|
author | Gary Wu <gary.i.wu@huawei.com> | Mon Apr 10 15:40:00 2017 -0700 |
committer | Gary Wu <gary.i.wu@huawei.com> | Tue Apr 11 17:06:08 2017 +0000 |
tree | 7a786fee51b2d72e80ed0f5a1887f10250785e61 | |
parent | b6b7bef8bdcad15af01ac88a038dd763ce59f68f [diff] |
Simplify MsoHeatEnvironmentParameter methods Change-Id: I199008128f28903ea28ecfba437511c4c4a6c8e7 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentParameter.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentParameter.java index 4cf9023..7444e1c 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentParameter.java +++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentParameter.java
@@ -20,7 +20,7 @@ package org.openecomp.mso.openstack.utils; - +import java.util.Objects; public class MsoHeatEnvironmentParameter { @@ -66,20 +66,11 @@ } MsoHeatEnvironmentParameter hep = (MsoHeatEnvironmentParameter) o; // If the name of the parameter is the same, then they're equal - if (hep.getName().equals(this.getName())) { - return true; - } - return false; + return hep.getName().equals(this.getName()); } public int hashCode() { - int result = 0; - try { - result = this.name.hashCode(); - } catch (Exception e) { - // in case it's null - return zero - } - return result; + return Objects.hashCode(this.name); }