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 f849292263656c01f3bfb52138abfbbfbee6fbd1..16fffe84d057e6bcd731f2a7964a6f1d441b9796 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 dd19d8bb9b8097270e34a811a6f2c2d9d200f9d3..ef5d6572efe5bf8ec59d0b230f909d36420e1a62 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())