Remove javadoc comments from overriding methods.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / SoneTemplatePage.java
index 3218b58..9df00b7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - SoneTemplatePage.java - Copyright © 2010 David Roden
+ * Sone - SoneTemplatePage.java - Copyright © 2010–2013 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
@@ -21,6 +21,7 @@ import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
@@ -29,16 +30,17 @@ import net.pterodactylus.sone.main.SonePlugin;
 import net.pterodactylus.sone.notify.ListNotificationFilters;
 import net.pterodactylus.sone.web.page.FreenetRequest;
 import net.pterodactylus.sone.web.page.FreenetTemplatePage;
-import net.pterodactylus.util.collection.ListBuilder;
-import net.pterodactylus.util.collection.MapBuilder;
 import net.pterodactylus.util.notify.Notification;
-import net.pterodactylus.util.object.HashCode;
 import net.pterodactylus.util.template.Template;
 import net.pterodactylus.util.template.TemplateContext;
+
 import freenet.clients.http.SessionManager.Session;
 import freenet.clients.http.ToadletContext;
 import freenet.support.api.HTTPRequest;
 
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+
 /**
  * Base page for the Sone web interface.
  *
@@ -200,9 +202,6 @@ public class SoneTemplatePage extends FreenetTemplatePage {
        // TEMPLATEPAGE METHODS
        //
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        protected String getPageTitle(FreenetRequest request) {
                if (pageTitleKey != null) {
@@ -211,25 +210,16 @@ public class SoneTemplatePage extends FreenetTemplatePage {
                return "";
        }
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        protected List<Map<String, String>> getAdditionalLinkNodes(FreenetRequest request) {
-               return new ListBuilder<Map<String, String>>().add(new MapBuilder<String, String>().put("rel", "search").put("type", "application/opensearchdescription+xml").put("title", "Sone").put("href", "http://" + request.getHttpRequest().getHeader("host") + "/Sone/OpenSearch.xml").get()).get();
+               return ImmutableList.<Map<String, String>> builder().add(ImmutableMap.<String, String> builder().put("rel", "search").put("type", "application/opensearchdescription+xml").put("title", "Sone").put("href", "http://" + request.getHttpRequest().getHeader("host") + "/Sone/OpenSearch.xml").build()).build();
        }
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        protected Collection<String> getStyleSheets() {
                return Arrays.asList("css/sone.css");
        }
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        protected String getShortcutIcon() {
                return "images/icon.png";
@@ -245,9 +235,6 @@ public class SoneTemplatePage extends FreenetTemplatePage {
                return requireLogin;
        }
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
                super.processTemplate(request, templateContext);
@@ -262,13 +249,11 @@ public class SoneTemplatePage extends FreenetTemplatePage {
                templateContext.set("latestVersion", webInterface.getCore().getUpdateChecker().getLatestVersion());
                templateContext.set("latestVersionTime", webInterface.getCore().getUpdateChecker().getLatestVersionDate());
                List<Notification> notifications = ListNotificationFilters.filterNotifications(webInterface.getNotifications().getNotifications(), currentSone);
+               Collections.sort(notifications, Notification.CREATED_TIME_SORTER);
                templateContext.set("notifications", notifications);
-               templateContext.set("notificationHash", HashCode.hashCode(notifications));
+               templateContext.set("notificationHash", notifications.hashCode());
        }
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        protected String getRedirectTarget(FreenetRequest request) {
                if (requiresLogin() && (getCurrentSone(request.getToadletContext(), false) == null)) {
@@ -296,17 +281,11 @@ public class SoneTemplatePage extends FreenetTemplatePage {
                return null;
        }
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        protected boolean isFullAccessOnly() {
                return webInterface.getCore().getPreferences().isRequireFullAccess();
        }
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
        public boolean isEnabled(ToadletContext toadletContext) {
                if (webInterface.getCore().getPreferences().isRequireFullAccess() && !toadletContext.isAllowedFullAccess()) {