commit | 98dc95d0e58ea094fe0d8cdfa8fac8e8d9183aa8 | [log] [tgz] |
---|---|---|
author | Yan Yang <yangyanyj@chinamobile.com> | Mon Aug 05 23:43:26 2019 +0000 |
committer | Gerrit Code Review <gerrit@onap.org> | Mon Aug 05 23:43:26 2019 +0000 |
tree | d27701dbef74738f06b5043961193f9a4e25f0a3 | |
parent | 2395392436605ec2cd683c28831d7e319c051f60 [diff] | |
parent | 2c4763545f1e0089d68815c735fc6255adc2aa56 [diff] |
Merge "Used isEmpty to check collection is empty or not"
diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/DesignService.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/DesignService.java index d0940ba..d492497 100755 --- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/DesignService.java +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/DesignService.java
@@ -114,7 +114,7 @@ dbs.add(db.get()); } } - if (dbs.size() > 0) + if (!dbs.isEmpty()) design.setDbs(dbs); else { design.getDbs().clear();
diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/DesignTypeService.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/DesignTypeService.java index 86baebf..58bc35e 100755 --- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/DesignTypeService.java +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/DesignTypeService.java
@@ -49,7 +49,7 @@ List<DesignType> designTypeList = null; List<DesignTypeConfig> designTypeConfigList = new ArrayList<>(); designTypeList = (List<DesignType>)designTypeRepository.findAll(); - if (designTypeList != null && designTypeList.size() > 0) { + if (designTypeList != null && !designTypeList.isEmpty()) { log.info("DesignTypeList is not null"); for(DesignType designType : designTypeList) { designTypeConfigList.add(designType.getDesignTypeConfig());
diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/TopicService.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/TopicService.java index ed9b5c2..043cc65 100644 --- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/TopicService.java +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/TopicService.java
@@ -162,9 +162,9 @@ relateDb.add(sinkdb); } } - if (relateDb.size() > 0) + if (!relateDb.isEmpty()) topic.setDbs(relateDb); - else if (relateDb.size() == 0) { + else { topic.getDbs().clear(); } } else { @@ -179,9 +179,9 @@ relateKafka.add(sinkKafka.get()); } } - if (relateKafka.size() > 0) { + if (!relateKafka.isEmpty()) { topic.setKafkas(relateKafka); - } else if (relateKafka.size() == 0) { + } else { topic.getKafkas().clear(); } } else {