summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRama-Huawei <rama.subba.reddy.s@huawei.com>2019-08-05 09:40:46 +0530
committerRama-Huawei <rama.subba.reddy.s@huawei.com>2019-08-05 09:47:46 +0530
commit2c4763545f1e0089d68815c735fc6255adc2aa56 (patch)
tree9705202401e9fd55c000d065e06d30415fc8db7e
parent5417daa15185c9d17f8b0797b8b02c3587a5eebe (diff)
Used isEmpty to check collection is empty or not
Issue-ID: DCAEGEN2-1468 Signed-off-by: Rama-Huawei <rama.subba.reddy.s@huawei.com> Change-Id: Ice0fe7a0119442f7cf7f6171ea1e2a2c8a0c8cab
-rwxr-xr-xcomponents/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/DesignService.java2
-rwxr-xr-xcomponents/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/DesignTypeService.java2
-rw-r--r--components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/service/TopicService.java8
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 {