Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java	(revision 31832)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java	(revision 31833)
@@ -31,5 +31,5 @@
   private final CopyOnWriteArrayList<MapillaryDataListener> listeners = new CopyOnWriteArrayList<>();
   /** The bounds of the areas for which the pictures have been downloaded. */
-  public CopyOnWriteArrayList<Bounds> bounds;
+  public List<Bounds> bounds;
 
   /**
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/FinishedUploadDialog.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/FinishedUploadDialog.java	(revision 31832)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/FinishedUploadDialog.java	(revision 31833)
@@ -8,5 +8,4 @@
 import java.awt.event.ActionListener;
 import java.io.IOException;
-import java.net.URL;
 
 import javax.swing.BoxLayout;
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java	(revision 31832)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java	(revision 31833)
@@ -2,6 +2,6 @@
 package org.openstreetmap.josm.plugins.mapillary.gui;
 
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
-import static org.openstreetmap.josm.tools.I18n.marktr;
 
 import java.awt.BorderLayout;
@@ -15,5 +15,4 @@
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
-import java.net.MalformedURLException;
 import java.util.Arrays;
 import java.util.List;
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java	(revision 31832)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java	(revision 31833)
@@ -3,8 +3,8 @@
 
 import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
 import java.io.IOException;
-import java.net.URL;
 
 import javax.swing.AbstractAction;
@@ -92,5 +92,5 @@
     onLogout();
     panel.add(loginPanel, GBC.eol());
-    panel.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.BOTH));
+    panel.add(Box.createVerticalGlue(), GBC.eol().fill(GridBagConstraints.BOTH));
 
     gui.getDisplayPreference().addSubTab(this, "Mapillary", new JScrollPane(panel));
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java	(revision 31832)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java	(revision 31833)
@@ -6,5 +6,4 @@
 import java.util.ArrayList;
 import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
@@ -39,6 +38,5 @@
 
   /** Executor that will run the petitions. */
-  private static ThreadPoolExecutor EXECUTOR = new ThreadPoolExecutor(3, 5,
-      100, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(100));;
+  private static ThreadPoolExecutor executor = new ThreadPoolExecutor(3, 5, 100, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(100));
 
   /**
@@ -52,5 +50,5 @@
    */
   public static void getImages(LatLon minLatLon, LatLon maxLatLon) {
-    if (maxLatLon == null || maxLatLon == null) {
+    if (minLatLon == null || maxLatLon == null) {
       throw new IllegalArgumentException();
     }
@@ -90,5 +88,5 @@
   private static void run(Thread t) {
     threads.add(t);
-    EXECUTOR.execute(t);
+    executor.execute(t);
   }
 
@@ -214,11 +212,11 @@
     }
     threads.clear();
-    EXECUTOR.shutdownNow();
+    executor.shutdownNow();
     try {
-      EXECUTOR.awaitTermination(30, TimeUnit.SECONDS);
+      executor.awaitTermination(30, TimeUnit.SECONDS);
     } catch (InterruptedException e) {
       Main.error(e);
     }
-    EXECUTOR = new ThreadPoolExecutor(3, 5, 100, TimeUnit.SECONDS,
+    executor = new ThreadPoolExecutor(3, 5, 100, TimeUnit.SECONDS,
         new ArrayBlockingQueue<Runnable>(100));
   }
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthPortListener.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthPortListener.java	(revision 31832)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthPortListener.java	(revision 31833)
@@ -37,11 +37,10 @@
   @Override
   public void run() {
-    try {
-      ServerSocket serverSocket = new ServerSocket(PORT);
-      Socket clientSocket = serverSocket.accept();
-      PrintWriter out = new PrintWriter(new OutputStreamWriter(
-          clientSocket.getOutputStream(), "UTF-8"), true);
-      Scanner in = new Scanner(new InputStreamReader(
-          clientSocket.getInputStream(), "UTF-8"));
+    try (
+        ServerSocket serverSocket = new ServerSocket(PORT);
+        Socket clientSocket = serverSocket.accept();
+        PrintWriter out = new PrintWriter(new OutputStreamWriter(clientSocket.getOutputStream(), "UTF-8"), true);
+        Scanner in = new Scanner(new InputStreamReader(clientSocket.getInputStream(), "UTF-8"));
+    ) {
       String s;
       String accessToken = null;
Index: /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySequenceDownloadThreadTest.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySequenceDownloadThreadTest.java	(revision 31832)
+++ /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/io/download/MapillarySequenceDownloadThreadTest.java	(revision 31833)
@@ -6,5 +6,4 @@
 import static org.junit.Assert.assertTrue;
 
-import java.util.Locale;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -15,7 +14,4 @@
 import org.openstreetmap.josm.plugins.mapillary.AbstractTest;
 import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
-import org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin;
-import org.openstreetmap.josm.plugins.mapillary.io.download.MapillaryDownloader;
-import org.openstreetmap.josm.plugins.mapillary.io.download.MapillarySequenceDownloadThread;
 
 /**
Index: /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryURLTest.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryURLTest.java	(revision 31832)
+++ /applications/editors/josm/plugins/mapillary/test/unit/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryURLTest.java	(revision 31833)
@@ -3,4 +3,5 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -61,15 +62,27 @@
   @Test
   public void testConnectURL() throws MalformedURLException {
-    assertEquals(
-        new URL("https://www.mapillary.com/connect/?client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz&scope=user%3Aread+public%3Aupload+public%3Awrite&response_type=token&redirect_uri=http%3A%2F%2Fredirect-host%2F%C3%A4"),
-        MapillaryURL.connectURL("http://redirect-host/ä")
-    );
-    assertEquals(
-        new URL("https://www.mapillary.com/connect/?client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz&scope=user%3Aread+public%3Aupload+public%3Awrite&response_type=token"),
-        MapillaryURL.connectURL(null)
-    );
-    assertEquals(
-        new URL("https://www.mapillary.com/connect/?client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz&scope=user%3Aread+public%3Aupload+public%3Awrite&response_type=token"),
-        MapillaryURL.connectURL("")
+    assertUrlEquals(
+        MapillaryURL.connectURL("http://redirect-host/ä"),
+        "https://www.mapillary.com/connect/",
+        "client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz",
+        "scope=user%3Aread+public%3Aupload+public%3Awrite",
+        "response_type=token",
+        "redirect_uri=http%3A%2F%2Fredirect-host%2F%C3%A4"
+    );
+
+    assertUrlEquals(
+        MapillaryURL.connectURL(null),
+        "https://www.mapillary.com/connect/",
+        "client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz",
+        "scope=user%3Aread+public%3Aupload+public%3Awrite",
+        "response_type=token"
+    );
+
+    assertUrlEquals(
+        MapillaryURL.connectURL(""),
+        "https://www.mapillary.com/connect/",
+        "client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz",
+        "scope=user%3Aread+public%3Aupload+public%3Awrite",
+        "response_type=token"
     );
   }
@@ -77,11 +90,21 @@
   @Test
   public void testSearchImageURL() throws MalformedURLException {
-    assertEquals(
-        new URL("https://a.mapillary.com/v2/search/im/?client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz&min_lon=2.220000&max_lat=3.333000&max_lon=4.444400&limit=20&page=42&min_lat=1.100000"),
-        MapillaryURL.searchImageURL(new Bounds(1.1, 2.22, 3.333, 4.4444), 42)
-    );
-    assertEquals(
-        new URL("https://a.mapillary.com/v2/search/im/?client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz&limit=20&page=-73"),
-        MapillaryURL.searchImageURL(null, -73)
+    assertUrlEquals(
+        MapillaryURL.searchImageURL(new Bounds(1.1, 2.22, 3.333, 4.4444), 42),
+        "https://a.mapillary.com/v2/search/im/",
+        "client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz",
+        "min_lon=2.220000",
+        "max_lon=4.444400",
+        "min_lat=1.100000",
+        "max_lat=3.333000",
+        "limit=20",
+        "page=42"
+    );
+    assertUrlEquals(
+        MapillaryURL.searchImageURL(null, -73),
+        "https://a.mapillary.com/v2/search/im/",
+        "client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz",
+        "limit=20",
+        "page=-73"
     );
   }
@@ -89,11 +112,21 @@
   @Test
   public void testSearchSequenceURL() throws MalformedURLException {
-    assertEquals(
-        new URL("https://a.mapillary.com/v2/search/s/?client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz&min_lon=-66.666666&max_lat=77.777778&max_lon=88.888889&limit=10&page=42&min_lat=-55.555550"),
-        MapillaryURL.searchSequenceURL(new Bounds(-55.55555, -66.666666, 77.7777777, 88.88888888, false), 42)
-    );
-    assertEquals(
-        new URL("https://a.mapillary.com/v2/search/s/?client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz&limit=10&page=-73"),
-        MapillaryURL.searchSequenceURL(null, -73)
+    assertUrlEquals(
+        MapillaryURL.searchSequenceURL(new Bounds(-55.55555, -66.666666, 77.7777777, 88.88888888, false), 42),
+        "https://a.mapillary.com/v2/search/s/",
+        "client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz",
+        "min_lon=-66.666666",
+        "max_lon=88.888889",
+        "min_lat=-55.555550",
+        "max_lat=77.777778",
+        "limit=10",
+        "page=42"
+    );
+    assertUrlEquals(
+        MapillaryURL.searchSequenceURL(null, -73),
+        "https://a.mapillary.com/v2/search/s/",
+        "client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz",
+        "limit=10",
+        "page=-73"
     );
   }
@@ -101,11 +134,21 @@
   @Test
   public void testSearchTrafficSignURL() throws MalformedURLException {
-    assertEquals(
-        new URL("https://a.mapillary.com/v2/search/im/or/?client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz&min_lon=2.220000&max_lat=3.333000&max_lon=4.444400&limit=20&page=-42&min_lat=1.100000"),
-        MapillaryURL.searchTrafficSignURL(new Bounds(1.1, 2.22, 3.333, 4.4444), -42)
-    );
-    assertEquals(
-        new URL("https://a.mapillary.com/v2/search/im/or/?client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz&limit=20&page=73"),
-        MapillaryURL.searchTrafficSignURL(null, 73)
+    assertUrlEquals(
+        MapillaryURL.searchTrafficSignURL(new Bounds(1.1, 2.22, 3.333, 4.4444), -42),
+        "https://a.mapillary.com/v2/search/im/or/",
+        "client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz",
+        "min_lon=2.220000",
+        "max_lon=4.444400",
+        "min_lat=1.100000",
+        "max_lat=3.333000",
+        "limit=20",
+        "page=-42"
+    );
+    assertUrlEquals(
+        MapillaryURL.searchTrafficSignURL(null, 73),
+        "https://a.mapillary.com/v2/search/im/or/",
+        "client_id=T1Fzd20xZjdtR0s1VDk5OFNIOXpYdzoxNDYyOGRkYzUyYTFiMzgz",
+        "limit=20",
+        "page=73"
     );
   }
@@ -128,5 +171,6 @@
 
   @Test
-  public void testString2URL() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+  public void testString2MalformedURL()
+      throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
     Method method = MapillaryURL.class.getDeclaredMethod("string2URL", String.class);
     method.setAccessible(true);
@@ -138,3 +182,19 @@
     TestUtil.testUtilityClass(MapillaryURL.class);
   }
+
+  private void assertUrlEquals(URL actualUrl, String expectedBaseUrl, String... expectedParams) {
+    assertEquals(expectedBaseUrl, actualUrl.toString().substring(0, actualUrl.toString().indexOf('?')));
+    String[] actualParams = actualUrl.getQuery().split("&");
+    assertEquals(expectedParams.length, actualParams.length);
+    for (int exIndex = 0; exIndex < expectedParams.length; exIndex++) {
+      boolean parameterIsPresent = false;
+      for (int acIndex = 0; !parameterIsPresent && acIndex < actualParams.length; acIndex++) {
+        parameterIsPresent |= actualParams[acIndex].equals(expectedParams[exIndex]);
+      }
+      assertTrue(
+          expectedParams[exIndex] + " was expected in the query string of " + actualUrl.toString() + " but wasn't there." ,
+          parameterIsPresent
+      );
+    }
+  }
 }
