Remove unnecessary method.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 29 Jan 2013 05:42:20 +0000 (06:42 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 29 Jan 2013 05:42:20 +0000 (06:42 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java
src/main/java/net/pterodactylus/sone/web/ajax/UnfollowSoneAjaxPage.java

index b2188e0..cdb7feb 100644 (file)
@@ -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
         * Returns all local Sones.
         *
         * @return All local Sones
index c029219..3d984b9 100644 (file)
@@ -45,7 +45,7 @@ public class UnfollowSoneAjaxPage extends JsonPage {
        @Override
        protected JsonObject createJsonObject(FreenetRequest request) {
                String soneId = request.getHttpRequest().getParam("sone");
        @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());
                        return createErrorJsonObject("invalid-sone-id");
                }
                Sone currentSone = getCurrentSone(request.getToadletContext());