Index: trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java	(revision 10293)
+++ trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java	(revision 10294)
@@ -2,14 +2,14 @@
 package org.openstreetmap.josm.data.oauth;
 
-import java.net.MalformedURLException;
-import java.net.URL;
 import java.util.Objects;
 
-import oauth.signpost.OAuthConsumer;
-import oauth.signpost.OAuthProvider;
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.io.OsmApi;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.tools.Utils;
+
+import oauth.signpost.OAuthConsumer;
+import oauth.signpost.OAuthProvider;
 
 /**
@@ -52,11 +52,6 @@
         final String serverUrl;
 
-        if (apiUrl != null) {
-            // validate URL syntax
-            try {
-                new URL(apiUrl);
-            } catch (MalformedURLException e) {
-                apiUrl = null;
-            }
+        if (!Utils.isValidUrl(apiUrl)) {
+            apiUrl = null;
         }
 
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java	(revision 10293)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java	(revision 10294)
@@ -134,10 +134,9 @@
         }
         String path = url.getPath();
-        String query = url.getQuery();
         if (path == null || !path.endsWith("/changesets"))
             return null;
 
         try {
-            return ChangesetQuery.buildFromUrlQuery(query);
+            return ChangesetQuery.buildFromUrlQuery(url.getQuery());
         } catch (ChangesetQueryUrlException e) {
             Main.warn(e.getMessage());
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java	(revision 10293)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java	(revision 10294)
@@ -14,6 +14,4 @@
 import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
-import java.net.MalformedURLException;
-import java.net.URL;
 import java.util.Arrays;
 
@@ -258,11 +256,5 @@
             if (getComponent().getText().trim().isEmpty())
                 return false;
-
-            try {
-                new URL(getComponent().getText().trim());
-                return true;
-            } catch (MalformedURLException e) {
-                return false;
-            }
+            return Utils.isValidUrl(getComponent().getText().trim());
         }
 
Index: trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 10293)
+++ trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 10294)
@@ -12,5 +12,4 @@
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
 import java.net.URL;
 import java.text.MessageFormat;
@@ -206,11 +205,7 @@
             s = attr.getValue("Plugin-Link");
         }
-        if (s != null) {
-            try {
-                new URL(s);
-            } catch (MalformedURLException e) {
-                Main.info(tr("Invalid URL ''{0}'' in plugin {1}", s, name));
-                s = null;
-            }
+        if (s != null && !Utils.isValidUrl(s)) {
+            Main.info(tr("Invalid URL ''{0}'' in plugin {1}", s, name));
+            s = null;
         }
         link = s;
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 10293)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 10294)
@@ -1324,4 +1324,19 @@
 
     /**
+     * Determines if the given URL is valid.
+     * @param url The URL to test
+     * @return {@code true} if the url is valid
+     * @since 10294
+     */
+    public static boolean isValidUrl(String url) {
+        try {
+            new URL(url);
+            return true;
+        } catch (MalformedURLException | NullPointerException e) {
+            return false;
+        }
+    }
+
+    /**
      * Creates a new {@link ThreadFactory} which creates threads with names according to {@code nameFormat}.
      * @param nameFormat a {@link String#format(String, Object...)} compatible name format; its first argument is a unique thread index
