From: David ‘Bombe’ Roden Date: Thu, 17 Nov 2016 19:37:08 +0000 (+0100) Subject: Use diamond operator for constructor calls X-Git-Tag: 0.9.7^2~428 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=d766553c0918f2522e8d6314b7dc3aca6f78eb7d;p=Sone.git Use diamond operator for constructor calls --- diff --git a/src/main/java/net/pterodactylus/sone/template/ReplyGroupFilter.java b/src/main/java/net/pterodactylus/sone/template/ReplyGroupFilter.java index 9bb5b81..76ca103 100644 --- a/src/main/java/net/pterodactylus/sone/template/ReplyGroupFilter.java +++ b/src/main/java/net/pterodactylus/sone/template/ReplyGroupFilter.java @@ -48,8 +48,8 @@ public class ReplyGroupFilter implements Filter { public Object format(TemplateContext templateContext, Object data, Map parameters) { @SuppressWarnings("unchecked") List allReplies = (List) data; - Map> postSones = new HashMap>(); - Map> postReplies = new HashMap>(); + Map> postSones = new HashMap<>(); + Map> postReplies = new HashMap<>(); for (PostReply reply : allReplies) { /* * All replies from a new-reply notification have posts, @@ -58,23 +58,23 @@ public class ReplyGroupFilter implements Filter { Optional post = reply.getPost(); Set sones = postSones.get(post.get()); if (sones == null) { - sones = new HashSet(); + sones = new HashSet<>(); postSones.put(post.get(), sones); } sones.add(reply.getSone()); Set replies = postReplies.get(post.get()); if (replies == null) { - replies = new HashSet(); + replies = new HashSet<>(); postReplies.put(post.get(), replies); } replies.add(reply); } - Map>> result = new HashMap>>(); + Map>> result = new HashMap<>(); for (Entry> postEntry : postSones.entrySet()) { if (result.containsKey(postEntry.getKey())) { continue; } - Map> postResult = new HashMap>(); + Map> postResult = new HashMap<>(); postResult.put("sones", postEntry.getValue()); postResult.put("replies", postReplies.get(postEntry.getKey())); result.put(postEntry.getKey(), postResult);