Create a new set, the returned set is immutable.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 16 Jan 2013 17:49:09 +0000 (18:49 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 16 Jan 2013 18:04:11 +0000 (19:04 +0100)
src/main/java/net/pterodactylus/sone/web/NewPage.java

index c7281e3..e1edc25 100644 (file)
@@ -19,6 +19,7 @@ package net.pterodactylus.sone.web;
 
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
@@ -64,7 +65,7 @@ public class NewPage extends SoneTemplatePage {
                super.processTemplate(request, templateContext);
 
                /* collect new elements from notifications. */
-               Set<Post> posts = webInterface.getNewPosts();
+               Set<Post> posts = new HashSet<Post>(webInterface.getNewPosts());
                for (PostReply reply : webInterface.getNewReplies()) {
                        posts.add(reply.getPost());
                }