From 6d022bf598dea2aabc5e1c2676975cd6565c5b0c Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 29 Jan 2013 06:42:20 +0100 Subject: [PATCH] Remove unnecessary method. --- src/main/java/net/pterodactylus/sone/core/Core.java | 14 -------------- .../pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index b2188e0..cdb7feb 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -372,20 +372,6 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, } /** - * Checks whether the core knows a Sone with the given ID. - * - * @param id - * The ID of the Sone - * @return {@code true} if there is a Sone with the given ID, {@code false} - * otherwise - */ - public boolean hasSone(String id) { - synchronized (sones) { - return sones.containsKey(id); - } - } - - /** * Returns all local Sones. * * @return All local Sones diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java index c029219..3d984b9 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java @@ -45,7 +45,7 @@ public class UnfollowSoneAjaxPage extends JsonPage { @Override protected JsonObject createJsonObject(FreenetRequest request) { String soneId = request.getHttpRequest().getParam("sone"); - if (!webInterface.getCore().hasSone(soneId)) { + if (!webInterface.getCore().getSone(soneId).isPresent()) { return createErrorJsonObject("invalid-sone-id"); } Sone currentSone = getCurrentSone(request.getToadletContext()); -- 2.7.4