From f0201af05ba0b1827260f8a1b54119173f7814dc Mon Sep 17 00:00:00 2001 From: Bogdan Bondar Date: Wed, 22 May 2019 19:34:58 +0200 Subject: [PATCH] fixed conditions evaluations, that always resulted in true Signed-off-by: Bogdan Bondar --- .../org/eclipse/hawkbit/repository/jpa/JpaSystemManagement.java | 2 +- .../detailslayout/DistributionSetMetadataDetailsLayout.java | 2 +- .../ui/common/detailslayout/TargetMetadataDetailsLayout.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaSystemManagement.java b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaSystemManagement.java index 8e6f84f06e..6692f2fb30 100644 --- a/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaSystemManagement.java +++ b/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaSystemManagement.java @@ -340,7 +340,7 @@ public void forEachTenant(final Consumer consumer) { } return null; })); - } while (tenants.hasNext() && (query = tenants.nextPageable()) != null); + } while ((query = tenants.nextPageable()) != Pageable.unpaged()); } } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/DistributionSetMetadataDetailsLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/DistributionSetMetadataDetailsLayout.java index d6b55ce1a9..138483d79a 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/DistributionSetMetadataDetailsLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/DistributionSetMetadataDetailsLayout.java @@ -66,7 +66,7 @@ public void populateDSMetadata(final DistributionSet distributionSet) { selectedDistSetId = distributionSet.getId(); final List dsMetadataList = distributionSetManagement .findMetaDataByDistributionSetId(PageRequest.of(0, MAX_METADATA_QUERY), selectedDistSetId).getContent(); - if (null != dsMetadataList && !dsMetadataList.isEmpty()) { + if (!dsMetadataList.isEmpty()) { dsMetadataList.forEach(this::setMetadataProperties); } } diff --git a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/TargetMetadataDetailsLayout.java b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/TargetMetadataDetailsLayout.java index aae34d46f1..f5821c9e7f 100644 --- a/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/TargetMetadataDetailsLayout.java +++ b/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/common/detailslayout/TargetMetadataDetailsLayout.java @@ -66,7 +66,7 @@ public void populateMetadata(final Target target) { final List targetMetadataList = targetManagement .findMetaDataByControllerId(PageRequest.of(0, MAX_METADATA_QUERY), target.getControllerId()) .getContent(); - if (targetMetadataList != null && !targetMetadataList.isEmpty()) { + if (!targetMetadataList.isEmpty()) { targetMetadataList.forEach(this::setMetadataProperties); } }