diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComputeData.java')
1 files changed, 6 insertions, 2 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComputeData.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComputeData.java index 43f13ded4c..ec66d0e5b2 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComputeData.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/composition/ComputeData.java @@ -16,10 +16,14 @@ * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= + * Modifications copyright (c) 2019 Nokia + * ================================================================================ */ package org.openecomp.sdc.vendorsoftwareproduct.types.composition; +import java.util.Objects; + public class ComputeData implements CompositionDataEntity { private String name; private String description; @@ -48,7 +52,7 @@ public class ComputeData implements CompositionDataEntity { @Override public int hashCode() { - int result = name.hashCode(); + int result = name != null ? name.hashCode() : 0; result = 31 * result + (description != null ? description.hashCode() : 0); return result; } @@ -64,7 +68,7 @@ public class ComputeData implements CompositionDataEntity { ComputeData that = (ComputeData) object; - if (!name.equals(that.name)) { + if (!Objects.equals(name, that.name)) { return false; } return description != null ? description.equals(that.description): that.description == null; |