Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java	(revision 31164)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java	(revision 31165)
@@ -6,7 +6,7 @@
 import java.io.InputStreamReader;
 
-import org.json.JSONException;
-import org.json.JSONObject;
-import org.json.JSONArray;
+import javax.json.JsonArray;
+import javax.json.JsonObject;
+import javax.json.Json;
 
 import java.util.ArrayList;
@@ -46,30 +46,32 @@
 			br = new BufferedReader(new InputStreamReader(
 					new URL(url).openStream()));
-			String jsonLine = "";
-			while (br.ready()) {
-				jsonLine += br.readLine();
-			}
-			JSONObject jsonall = new JSONObject(jsonLine);
+			/*
+			 * String jsonLine = ""; while (br.ready()) { jsonLine +=
+			 * br.readLine(); }
+			 */
+			JsonObject jsonall = Json.createReader(br).readObject();
 
 			if (!jsonall.getBoolean("more") && !ex.isShutdown()) {
 				ex.shutdownNow();
 			}
-			JSONArray jsonseq = jsonall.getJSONArray("ss");
-			for (int i = 0; i < jsonseq.length(); i++) {
-				JSONObject jsonobj = jsonseq.getJSONObject(i);
-				JSONArray cas = jsonobj.getJSONArray("cas");
-				JSONArray coords = jsonobj.getJSONArray("coords");
-				JSONArray keys = jsonobj.getJSONArray("keys");
+			JsonArray jsonseq = jsonall.getJsonArray("ss");
+			for (int i = 0; i < jsonseq.size(); i++) {
+				JsonObject jsonobj = jsonseq.getJsonObject(i);
+				JsonArray cas = jsonobj.getJsonArray("cas");
+				JsonArray coords = jsonobj.getJsonArray("coords");
+				JsonArray keys = jsonobj.getJsonArray("keys");
 				ArrayList<MapillaryImage> images = new ArrayList<>();
-				for (int j = 0; j < cas.length(); j++) {
+				for (int j = 0; j < cas.size(); j++) {
 					try {
-						images.add(new MapillaryImage(keys.getString(j), coords
-								.getJSONArray(j).getDouble(1), coords
-								.getJSONArray(j).getDouble(0), cas.getDouble(j)));
+						images.add(new MapillaryImage(keys.getString(j),
+								coords.getJsonArray(j).getJsonNumber(1)
+										.doubleValue(), coords.getJsonArray(j)
+										.getJsonNumber(0).doubleValue(), cas
+										.getJsonNumber(j).doubleValue()));
 					} catch (Exception e) {
 						// Mapillary service bug here
-						//System.out.println(cas.length());
-						//System.out.println(coords.length());
-						//System.out.println(keys.length());
+						// System.out.println(cas.length());
+						// System.out.println(coords.length());
+						// System.out.println(keys.length());
 						System.out.println(e);
 					}
@@ -79,5 +81,5 @@
 				int last = -1;
 				int pos = 0;
-				
+
 				// Here it gets only those images which are in the downloaded
 				// area.
@@ -104,5 +106,5 @@
 				sequence.add(finalImages);
 			}
-		} catch (IOException | JSONException e) {
+		} catch (IOException e) {
 			return;
 		}
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java	(revision 31164)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java	(revision 31165)
@@ -2,5 +2,4 @@
 
 import java.util.concurrent.ThreadPoolExecutor;
-import static org.openstreetmap.josm.tools.I18n.tr;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.ArrayBlockingQueue;
@@ -34,15 +33,4 @@
 
 	public void run() {
-		/*
-		 * ThreadPoolExecutor ex = new ThreadPoolExecutor(30, 35, 25,
-		 * TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(20));
-		 * ArrayList<JSONArray> ret = new ArrayList<JSONArray>(); int page = 0;
-		 * while (!ex.isShutdown()) { ex.execute(new
-		 * MapillarySquareDownloadThread(ex, this.data, urlImages + "&page=" +
-		 * page + "&limit=25")); try { if (ex.getQueue().peek() != null)
-		 * Thread.sleep(1000); } catch(Exception e){ System.out.println(e); }
-		 * page++; }
-		 */
-		System.out.println(tr("INFORMATION: GET") + urlSequences);
 		fullfillSequences();
 		return;
Index: /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadThread.java
===================================================================
--- /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadThread.java	(revision 31164)
+++ /applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadThread.java	(revision 31165)
@@ -5,6 +5,7 @@
 import java.io.InputStreamReader;
 
-import org.json.JSONObject;
-import org.json.JSONArray;
+import javax.json.JsonArray;
+import javax.json.JsonObject;
+import javax.json.Json;
 
 import java.util.ArrayList;
@@ -31,21 +32,22 @@
 			br = new BufferedReader(new InputStreamReader(
 					new URL(url).openStream()));
-			String jsonLine = "";
+			/*String jsonLine = "";
 			while (br.ready()) {
 				jsonLine += br.readLine();
-			}
-			JSONObject jsonobj = new JSONObject(jsonLine);
+			}*/
+			JsonObject jsonobj = Json.createReader(br).readObject();
 			if (!jsonobj.getBoolean("more")) {
 				ex.shutdownNow();
 			}
-			JSONArray jsonarr = jsonobj.getJSONArray("ims");
+			JsonArray jsonarr = jsonobj.getJsonArray("ims");
 			ArrayList<MapillaryImage> images = new ArrayList<>();
-			JSONObject image;
-			for (int i = 0; i < jsonarr.length(); i++) {
+			JsonObject image;
+			for (int i = 0; i < jsonarr.size(); i++) {
 				try {
-					image = jsonarr.getJSONObject(i);
+					image = jsonarr.getJsonObject(i);
 					images.add(new MapillaryImage(image.getString("key"), image
-							.getDouble("lat"), image.getDouble("lon"), image
-							.getDouble("ca")));
+							.getJsonNumber("lat")
+							.doubleValue(), image.getJsonNumber("lon").doubleValue(), image
+							.getJsonNumber("ca").doubleValue()));
 				} catch (Exception e) {
 					System.out.println(e);
