Fix Sonar EntitlementPoolZusammenDaoImpl 77/28277/1
authorAbhai Singh <Abhai.Singh@amdocs.com>
Tue, 16 Jan 2018 08:39:32 +0000 (14:09 +0530)
committerAbhai Singh <Abhai.Singh@amdocs.com>
Tue, 16 Jan 2018 08:39:44 +0000 (14:09 +0530)
Fixed reported sonar issues

Change-Id: I0a6d965a20d1bfe04b8d7ba62e12a830d763cec0
Issue-ID: SDC-343
Signed-off-by: Abhai Singh <Abhai.Singh@amdocs.com>
openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/EntitlementPoolZusammenDaoImpl.java

index 35182a3..be073ab 100644 (file)
@@ -77,7 +77,7 @@ public class EntitlementPoolZusammenDaoImpl implements EntitlementPoolDao {
       if (entitlmentpoolElement.getRelations() == null) {
         entitlmentpoolElement.setRelations(new ArrayList<>());
       }
-      if (epFromDb.get().getRelations() != null && epFromDb.get().getRelations().size() > 0) {
+      if (epFromDb.get().getRelations() != null && !epFromDb.get().getRelations().isEmpty()) {
         entitlmentpoolElement.getRelations().addAll(epFromDb.get().getRelations());
       }
     }
@@ -228,7 +228,7 @@ public class EntitlementPoolZusammenDaoImpl implements EntitlementPoolDao {
     entitlementPoolElement.setInfo(info);
 
     if (entitlementPool.getReferencingFeatureGroups() != null
-        && entitlementPool.getReferencingFeatureGroups().size() > 0) {
+        && !entitlementPool.getReferencingFeatureGroups().isEmpty()) {
       entitlementPoolElement.setRelations(entitlementPool.getReferencingFeatureGroups().stream()
           .map(rel -> VlmZusammenUtil
               .createRelation(RelationType.EntitlmentPoolToReferencingFeatureGroup, rel))