📄 Update year in file headers
[Sone.git] / src / main / java / net / pterodactylus / sone / template / RequestChangeFilter.java
index 3a89021..16cb062 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - RequestChangeFilter.java - Copyright © 2010–2012 David Roden
+ * Sone - RequestChangeFilter.java - Copyright © 2010–2020 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
@@ -34,8 +34,6 @@ import net.pterodactylus.util.template.TemplateContext;
  * This filter expects a {@link FreenetRequest} as input and outputs a
  * {@link URI} that is modified by the parameters. The name of the parameter is
  * handed in as “name”, the new value is stored in “value”.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
  */
 public class RequestChangeFilter implements Filter {
 
@@ -48,7 +46,7 @@ public class RequestChangeFilter implements Filter {
                String name = String.valueOf(parameters.get("name"));
                String value = String.valueOf(parameters.get("value"));
 
-               Map<String, String> values = new HashMap<String, String>();
+               Map<String, String> values = new HashMap<>();
                Collection<String> parameterNames = request.getHttpRequest().getParameterNames();
                for (String parameterName : parameterNames) {
                        values.put(parameterName, request.getHttpRequest().getParam(parameterName));
@@ -68,8 +66,7 @@ public class RequestChangeFilter implements Filter {
                        if (questionMark == -1) {
                                questionMark = oldUri.length();
                        }
-                       URI u = new URI(oldUri.substring(0, questionMark) + query.toString());
-                       return u;
+                       return new URI(oldUri.substring(0, questionMark) + query.toString());
                } catch (UnsupportedEncodingException uee1) {
                        /* UTF-8 not supported? I don’t think so. */
                } catch (URISyntaxException use1) {