From: David ‘Bombe’ Roden Date: Sat, 27 Nov 2010 15:07:06 +0000 (+0100) Subject: Always use the current session to prevent timeouts. X-Git-Tag: 0.3.2-RC1~19 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6ae5489a852538305421fdebe2c67d368907eeca;p=Sone.git Always use the current session to prevent timeouts. --- 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);