From d99d0a3ef409b634ce257bbf5ecb783c0e4ebff8 Mon Sep 17 00:00:00 2001 From: Oleksandr Moliavko Date: Wed, 11 Sep 2019 14:13:24 +0300 Subject: Removed redundant null checks (at these points vnfCustom can be empty, but not null) Issue-ID: SO-1841 Signed-off-by: Oleksandr Moliavko Change-Id: I174635fd0df71811c05ea3ad52f8ec5e5b56c58c --- .../main/java/org/onap/so/adapters/catalogdb/rest/VnfRestImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'adapters/mso-catalog-db-adapter/src/main') diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/VnfRestImpl.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/VnfRestImpl.java index 4353526872..a3e3a8ee53 100644 --- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/VnfRestImpl.java +++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/VnfRestImpl.java @@ -72,7 +72,7 @@ public class VnfRestImpl { List vnfCustom = service.getVnfCustomizations().stream() .filter(vnfCust -> vnfCust.getModelCustomizationUUID().equals(modelCustomizationUUID)) .collect(Collectors.toList()); - if (vnfCustom.isEmpty() || vnfCustom == null) { + if (vnfCustom.isEmpty()) { return null; } else if (vnfCustom.size() > 1) { throw new RuntimeException( @@ -92,7 +92,7 @@ public class VnfRestImpl { List vnfCustom = service.getVnfCustomizations().stream() .filter(vnfCust -> vnfCust.getModelCustomizationUUID().equals(modelCustomizationUUID)) .collect(Collectors.toList()); - if (vnfCustom.isEmpty() || vnfCustom == null) { + if (vnfCustom.isEmpty()) { throw new RuntimeException("No Vnf Found"); } else if (vnfCustom.size() > 1) { throw new RuntimeException( -- cgit 1.2.3-korg