Remove javadoc comments from overriding methods.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / ajax / DistrustAjaxPage.java
index b86055d..2694abf 100644 (file)
@@ -21,7 +21,8 @@ import net.pterodactylus.sone.core.Core;
 import net.pterodactylus.sone.data.Sone;
 import net.pterodactylus.sone.web.WebInterface;
 import net.pterodactylus.sone.web.page.FreenetRequest;
-import net.pterodactylus.util.json.JsonObject;
+
+import com.google.common.base.Optional;
 
 /**
  * AJAX page that lets the user distrust a Sone.
@@ -41,21 +42,18 @@ public class DistrustAjaxPage extends JsonPage {
                super("distrustSone.ajax", webInterface);
        }
 
-       /**
-        * {@inheritDoc}
-        */
        @Override
-       protected JsonObject createJsonObject(FreenetRequest request) {
+       protected JsonReturnObject createJsonObject(FreenetRequest request) {
                Sone currentSone = getCurrentSone(request.getToadletContext(), false);
                if (currentSone == null) {
                        return createErrorJsonObject("auth-required");
                }
                String soneId = request.getHttpRequest().getParam("sone");
-               Sone sone = webInterface.getCore().getSone(soneId);
-               if (sone == null) {
+               Optional<Sone> sone = webInterface.getCore().getSone(soneId);
+               if (!sone.isPresent()) {
                        return createErrorJsonObject("invalid-sone-id");
                }
-               webInterface.getCore().distrustSone(currentSone, sone);
+               webInterface.getCore().distrustSone(currentSone, sone.get());
                return createSuccessJsonObject().put("trustValue", webInterface.getCore().getPreferences().getNegativeTrust());
        }