Declare potentially-static methods as static.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / GetNotificationsAjaxPage.java
index d0020ca..98a204b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - GetNotificationsAjaxPage.java - Copyright © 2011 David Roden
+ * Sone - GetNotificationsAjaxPage.java - Copyright © 2011–2012 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
@@ -20,6 +20,7 @@ package net.pterodactylus.sone.web.ajax;
 import java.io.IOException;
 import java.io.StringWriter;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 
 import net.pterodactylus.sone.data.Sone;
@@ -79,6 +80,7 @@ public class GetNotificationsAjaxPage extends JsonPage {
                Sone currentSone = getCurrentSone(request.getToadletContext(), false);
                Collection<Notification> notifications = webInterface.getNotifications().getNotifications();
                List<Notification> filteredNotifications = ListNotificationFilters.filterNotifications(notifications, currentSone);
+               Collections.sort(filteredNotifications, Notification.CREATED_TIME_SORTER);
                int notificationHash = HashCode.hashCode(filteredNotifications);
                JsonArray jsonNotifications = new JsonArray();
                for (Notification notification : filteredNotifications) {
@@ -140,7 +142,7 @@ public class GetNotificationsAjaxPage extends JsonPage {
         *            The current Sone (may be {@code null})
         * @return The current options
         */
-       private JsonObject createJsonOptions(Sone currentSone) {
+       private static JsonObject createJsonOptions(Sone currentSone) {
                JsonObject options = new JsonObject();
                if (currentSone != null) {
                        options.put("ShowNotification/NewSones", currentSone.getOptions().getBooleanOption("ShowNotification/NewSones").get());