summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/data-provider/provider
diff options
context:
space:
mode:
Diffstat (limited to 'sdnr/wt/data-provider/provider')
-rw-r--r--sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/HtDatabaseEventsService.java2
-rw-r--r--sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/about/MarkdownTable.java2
-rw-r--r--sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataTreeProviderImpl.java6
3 files changed, 5 insertions, 5 deletions
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/HtDatabaseEventsService.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/HtDatabaseEventsService.java
index 948bd7317..b23d882c8 100644
--- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/HtDatabaseEventsService.java
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/data/entity/HtDatabaseEventsService.java
@@ -361,7 +361,7 @@ public class HtDatabaseEventsService implements ArchiveCleanProvider, DataProvid
}
}
- if (failures.size() > 0) {
+ if (!failures.isEmpty()) {
throw new DataInconsistencyException(new ArrayList<>(repairList.values()),
"inventory list is not consistent;\n" + String.join("\n", failures));
}
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/about/MarkdownTable.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/about/MarkdownTable.java
index 9fd6975b6..ac9cb44fe 100644
--- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/about/MarkdownTable.java
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/http/about/MarkdownTable.java
@@ -48,7 +48,7 @@ public class MarkdownTable {
public String toMarkDown() {
StringBuilder sb = new StringBuilder();
final int cols =
- this.columns != null ? this.columns.length : this.rows.size() > 0 ? this.rows.get(0).length : 0;
+ this.columns != null ? this.columns.length : !this.rows.isEmpty() ? this.rows.get(0).length : 0;
if (cols > 0) {
sb.append("|");
for (int i = 0; i < cols; i++) {
diff --git a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataTreeProviderImpl.java b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataTreeProviderImpl.java
index e69ddb737..b44906289 100644
--- a/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataTreeProviderImpl.java
+++ b/sdnr/wt/data-provider/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/impl/DataTreeProviderImpl.java
@@ -134,7 +134,7 @@ public class DataTreeProviderImpl {
public DataTreeObject readInventoryTree(List<String> tree, String filter) throws IOException {
//root nodes will be node-information -> below inventory
- if (tree == null || tree.size() <= 0) {
+ if (tree == null || tree.isEmpty()) {
return this.readInventoryTreeWithNode(filter);
}
//root node will be inventory on tree-level if sliced treePath
@@ -155,7 +155,7 @@ public class DataTreeProviderImpl {
throws IOException {
DataTreeObject tree = new DataTreeObject(INVENTORY_PROPERTY_PARENTUUID, INVENTORY_PROPERTY_UUID);
final String parentUuid = list.size() > 1 ? list.get(list.size() - 2) : null;
- final String uuid = list.size() > 0 ? list.get(list.size() - 1) : null;
+ final String uuid = list.isEmpty() ? null : list.get(list.size() - 1);
List<SearchHit> matches = this.search(Entity.Inventoryequipment, filter, INVENTORY_PROPERTY_NODEID, nodeId,
INVENTORY_PROPERTY_PARENTUUID, parentUuid, INVENTORY_PROPERTY_UUID, uuid, INVENTORY_PROPERTY_TREELEVEL);
@@ -163,7 +163,7 @@ public class DataTreeProviderImpl {
List<SearchHit> others = this.search(Entity.Inventoryequipment, (String) null, INVENTORY_PROPERTY_NODEID, nodeId,
null, null, null, null, INVENTORY_PROPERTY_TREELEVEL);
if (matches.size() > 0) {
- int treeLevelToStart = (list == null || list.size() <= 0) ? 0 : list.size() - 1;
+ int treeLevelToStart = (list == null || list.isEmpty()) ? 0 : list.size() - 1;
//build tree
JSONObject hitData;
//fill root elems