From 6ae5489a852538305421fdebe2c67d368907eeca Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 27 Nov 2010 16:07:06 +0100 Subject: [PATCH] Always use the current session to prevent timeouts. --- .../java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java index c556314..ae3dfc2 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetStatusAjaxPage.java @@ -22,6 +22,7 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Date; +import java.util.HashSet; import java.util.List; import java.util.Set; @@ -62,7 +63,10 @@ public class GetStatusAjaxPage extends JsonPage { protected JsonObject createJsonObject(Request request) { /* load Sones. */ boolean loadAllSones = Boolean.parseBoolean(request.getHttpRequest().getParam("loadAllSones", "true")); - Set sones = loadAllSones ? webInterface.getCore().getSones() : Collections.singleton(getCurrentSone(request.getToadletContext())); + Set sones = new HashSet(Collections.singleton(getCurrentSone(request.getToadletContext()))); + if (loadAllSones) { + sones.addAll(webInterface.getCore().getSones()); + } JsonArray jsonSones = new JsonArray(); for (Sone sone : sones) { JsonObject jsonSone = createJsonSone(sone); -- 2.7.4