Index: /trunk/src/org/openstreetmap/josm/gui/oauth/TestAccessTokenTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/oauth/TestAccessTokenTask.java	(revision 19659)
+++ /trunk/src/org/openstreetmap/josm/gui/oauth/TestAccessTokenTask.java	(revision 19660)
@@ -7,4 +7,5 @@
 import java.io.IOException;
 import java.net.HttpURLConnection;
+import java.net.URI;
 import java.net.URL;
 
@@ -86,5 +87,5 @@
         boolean authenticatorEnabled = true;
         try {
-            URL url = new URL(apiUrl + "/0.6/user/details");
+            final URL url = URI.create(apiUrl + "/0.6/user/details").toURL();
             authenticatorEnabled = DefaultAuthenticator.getInstance().isEnabled();
             DefaultAuthenticator.getInstance().setEnabled(false);
@@ -98,17 +99,20 @@
 
             final String oauthKey = getAuthKey();
-            if (connection.getResponse().getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED)
+            if (connection.getResponse().getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED) {
                 throw new OsmApiException(HttpURLConnection.HTTP_UNAUTHORIZED,
                         tr("Retrieving user details with Access Token Key ''{0}'' was rejected.",
                                 oauthKey), null);
-
-            if (connection.getResponse().getResponseCode() == HttpURLConnection.HTTP_FORBIDDEN)
+            }
+
+            if (connection.getResponse().getResponseCode() == HttpURLConnection.HTTP_FORBIDDEN) {
                 throw new OsmApiException(HttpURLConnection.HTTP_FORBIDDEN,
                         tr("Retrieving user details with Access Token Key ''{0}'' was forbidden.", oauthKey), null);
-
-            if (connection.getResponse().getResponseCode() != HttpURLConnection.HTTP_OK)
+            }
+
+            if (connection.getResponse().getResponseCode() != HttpURLConnection.HTTP_OK) {
                 throw new OsmApiException(connection.getResponse().getResponseCode(),
                         connection.getResponse().getHeaderField("Error"), null);
-            Document d = XmlUtils.parseSafeDOM(connection.getResponse().getContent());
+            }
+            final Document d = XmlUtils.parseSafeDOM(connection.getResponse().getContent());
             return OsmServerUserInfoReader.buildFromXML(d);
         } catch (SAXException | ParserConfigurationException e) {
@@ -234,13 +238,19 @@
         try {
             getProgressMonitor().indeterminateSubTask(tr("Retrieving user info..."));
-            UserInfo userInfo = getUserDetails();
-            if (canceled) return;
+            final UserInfo userInfo = getUserDetails();
+            if (canceled) {
+                return;
+            }
             notifySuccess(userInfo);
         } catch (OsmOAuthAuthorizationException e) {
-            if (canceled) return;
+            if (canceled) {
+                return;
+            }
             Logging.error(e);
             alertFailedSigning();
         } catch (OsmApiException e) {
-            if (canceled) return;
+            if (canceled) {
+                return;
+            }
             Logging.error(e);
             if (e.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR) {
@@ -256,5 +266,7 @@
             alertFailedConnection();
         } catch (OsmTransferException e) {
-            if (canceled) return;
+            if (canceled) {
+                return;
+            }
             Logging.error(e);
             alertFailedConnection();
