X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftemplate%2FReplyGroupFilter.java;h=9623b620af4fdd5fcfcd403c5fb2c1b133a34985;hb=bf9d78ae8c577a31e6477afc4cfebcf024df3596;hp=fba51f9a1fcbcdb9379de5a8a8476b1101d8a735;hpb=49a8ab6bd09b92822cd8cf1285c0b7a68e2bc8ca;p=Sone.git
diff --git a/src/main/java/net/pterodactylus/sone/template/ReplyGroupFilter.java b/src/main/java/net/pterodactylus/sone/template/ReplyGroupFilter.java
index fba51f9..9623b62 100644
--- a/src/main/java/net/pterodactylus/sone/template/ReplyGroupFilter.java
+++ b/src/main/java/net/pterodactylus/sone/template/ReplyGroupFilter.java
@@ -1,5 +1,5 @@
/*
- * Sone - ReplyGroupFilter.java - Copyright © 2010â2016 David Roden
+ * Sone - ReplyGroupFilter.java - Copyright © 2010â2020 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -30,14 +30,10 @@ import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.util.template.Filter;
import net.pterodactylus.util.template.TemplateContext;
-import com.google.common.base.Optional;
-
/**
* {@link Filter} implementation that groups replies by the post the are in
* reply to, returning a map with the post as key and the list of replies as
* values.
- *
- * @author David âBombeâ Roden
*/
public class ReplyGroupFilter implements Filter {
@@ -55,17 +51,17 @@ public class ReplyGroupFilter implements Filter {
* All replies from a new-reply notification have posts,
* ListNotificationFilters takes care of that.
*/
- Optional post = reply.getPost();
- Set sones = postSones.get(post.get());
+ Post post = reply.getPost().get();
+ Set sones = postSones.get(post);
if (sones == null) {
sones = new HashSet<>();
- postSones.put(post.get(), sones);
+ postSones.put(post, sones);
}
sones.add(reply.getSone());
- Set replies = postReplies.get(post.get());
+ Set replies = postReplies.get(post);
if (replies == null) {
replies = new HashSet<>();
- postReplies.put(post.get(), replies);
+ postReplies.put(post, replies);
}
replies.add(reply);
}