import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
+import java.util.HashSet;
import java.util.List;
import java.util.Set;
protected JsonObject createJsonObject(Request request) {
/* load Sones. */
boolean loadAllSones = Boolean.parseBoolean(request.getHttpRequest().getParam("loadAllSones", "true"));
- Set<Sone> sones = loadAllSones ? webInterface.getCore().getSones() : Collections.singleton(getCurrentSone(request.getToadletContext()));
+ Set<Sone> sones = new HashSet<Sone>(Collections.singleton(getCurrentSone(request.getToadletContext())));
+ if (loadAllSones) {
+ sones.addAll(webInterface.getCore().getSones());
+ }
JsonArray jsonSones = new JsonArray();
for (Sone sone : sones) {
JsonObject jsonSone = createJsonSone(sone);