diff options
author | Yan Yang <yangyanyj@chinamobile.com> | 2019-08-05 23:43:26 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-08-05 23:43:26 +0000 |
commit | 98dc95d0e58ea094fe0d8cdfa8fac8e8d9183aa8 (patch) | |
tree | d27701dbef74738f06b5043961193f9a4e25f0a3 /components | |
parent | 2395392436605ec2cd683c28831d7e319c051f60 (diff) | |
parent | 2c4763545f1e0089d68815c735fc6255adc2aa56 (diff) |
Merge "Used isEmpty to check collection is empty or not"
Diffstat (limited to 'components')
3 files changed, 6 insertions, 6 deletions
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 d0940baa..d4924972 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 @@ public class DesignService { 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 86baebf8..58bc35e4 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 @@ public class DesignTypeService { 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 ed9b5c20..043cc653 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 @@ public class TopicService { 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 @@ public class TopicService { relateKafka.add(sinkKafka.get()); } } - if (relateKafka.size() > 0) { + if (!relateKafka.isEmpty()) { topic.setKafkas(relateKafka); - } else if (relateKafka.size() == 0) { + } else { topic.getKafkas().clear(); } } else { |