From: David ‘Bombe’ Roden Date: Tue, 29 Jan 2013 05:42:20 +0000 (+0100) Subject: Remove unnecessary method. X-Git-Tag: 0.8.5^2~3^2~32 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6d022bf598dea2aabc5e1c2676975cd6565c5b0c;p=Sone.git Remove unnecessary method. --- 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());