Update years in copyright line
[Sone.git] / src / main / java / net / pterodactylus / sone / web / RescuePage.java
index feeb0bf..8599a31 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - RescuePage.java - Copyright © 2011–2013 David Roden
+ * Sone - RescuePage.java - Copyright © 2011–2015 David Roden
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -17,6 +17,8 @@
 
 package net.pterodactylus.sone.web;
 
+import static net.pterodactylus.sone.utils.NumberParsers.parseLong;
+
 import net.pterodactylus.sone.core.SoneRescuer;
 import net.pterodactylus.sone.data.Sone;
 import net.pterodactylus.sone.web.page.FreenetRequest;
@@ -24,9 +26,6 @@ import net.pterodactylus.util.template.Template;
 import net.pterodactylus.util.template.TemplateContext;
 import net.pterodactylus.util.web.Method;
 
-import com.google.common.base.Optional;
-import com.google.common.primitives.Longs;
-
 /**
  * Page that lets the user control the rescue mode for a Sone.
  *
@@ -61,7 +60,7 @@ public class RescuePage extends SoneTemplatePage {
                SoneRescuer soneRescuer = webInterface.getCore().getSoneRescuer(currentSone);
                if (request.getMethod() == Method.POST) {
                        if ("true".equals(request.getHttpRequest().getPartAsStringFailsafe("fetch", 4))) {
-                               long edition = Optional.fromNullable(Longs.tryParse(request.getHttpRequest().getPartAsStringFailsafe("edition", 8))).or(-1L);
+                               long edition = parseLong(request.getHttpRequest().getPartAsStringFailsafe("edition", 8), -1L);
                                if (edition > -1) {
                                        soneRescuer.setEdition(edition);
                                }