From 9fdb526e3fca96c1a67c7ef3c5e3af23fde0a984 Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Tue, 20 Sep 2022 20:22:59 +0200
Subject: [PATCH] minor cleanus

---
 .../java/de/itvsh/goofy/postfach/PostfachMailController.java  | 4 ++--
 .../de/itvsh/goofy/postfach/PostfachMailModelAssembler.java   | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachMailController.java b/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachMailController.java
index f849292263..16fffe84d0 100644
--- a/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachMailController.java
+++ b/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachMailController.java
@@ -60,8 +60,8 @@ public class PostfachMailController {
 		return Optional.ofNullable(vorgang.getEingang().getAntragsteller()).map(Antragsteller::getPostfachId).map(StringUtils::trimToNull);
 	}
 
-	private Stream<PostfachMail> sort(Stream<PostfachMail> vorgaenge) {
-		return vorgaenge.sorted(new PostfachNachrichtComparator().reversed());
+	private Stream<PostfachMail> sort(Stream<PostfachMail> nachrichten) {
+		return nachrichten.sorted(new PostfachNachrichtComparator().reversed());
 	}
 
 	public boolean isPostfachConfigured() {
diff --git a/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachMailModelAssembler.java b/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachMailModelAssembler.java
index dd19d8bb9b..ef5d6572ef 100644
--- a/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachMailModelAssembler.java
+++ b/goofy-server/src/main/java/de/itvsh/goofy/postfach/PostfachMailModelAssembler.java
@@ -6,6 +6,7 @@ import java.util.Optional;
 import java.util.function.Predicate;
 import java.util.stream.Stream;
 
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.BooleanUtils;
 import org.springframework.hateoas.CollectionModel;
 import org.springframework.hateoas.EntityModel;
@@ -31,7 +32,7 @@ class PostfachMailModelAssembler implements RepresentationModelAssembler<Postfac
 	static final String REL_CREATED_BY = "createdBy";
 
 	private static final Predicate<PostfachMail> SENT_FAILED = postfachMail -> BooleanUtils.isFalse(postfachMail.getSentSuccessful());
-	private static final Predicate<PostfachMail> HAS_ATTACHMENTS = nachricht -> !nachricht.getAttachments().isEmpty();
+	private static final Predicate<PostfachMail> HAS_ATTACHMENTS = nachricht -> CollectionUtils.isNotEmpty(nachricht.getAttachments());
 
 	static final String SYSTEM_USER_IDENTIFIER = "system";
 	private static final Predicate<PostfachMail> SENT_BY_CLIENT_USER = postfachNachricht -> Optional.ofNullable(postfachNachricht.getCreatedBy())
-- 
GitLab