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); } }