Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java	(revision 32340)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java	(revision 32341)
@@ -32,12 +32,12 @@
   protected double ca;
   /** Temporal position of the picture until it is uploaded. */
-  public LatLon tempLatLon;
+  private LatLon tempLatLon;
   /**
    * When the object is being dragged in the map, the temporal position is
    * stored here.
    */
-  public LatLon movingLatLon;
+  private LatLon movingLatLon;
   /** Temporal direction of the picture until it is uploaded */
-  public double tempCa;
+  private double tempCa;
   /**
    * When the object direction is being moved in the map, the temporal direction
@@ -132,13 +132,13 @@
   /**
    * Returns the sequence which contains this image.
+   * Never null.
    *
    * @return The MapillarySequence object that contains this MapillaryImage.
    */
   public MapillarySequence getSequence() {
-    if (this.sequence == null) {
-      this.sequence = new MapillarySequence();
-      this.sequence.add(this);
-    }
-
+    if (sequence == null) {
+      sequence = new MapillarySequence();
+      sequence.add(this);
+    }
     return this.sequence;
   }
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryImageInfoDownloadThread.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryImageInfoDownloadThread.java	(revision 32340)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryImageInfoDownloadThread.java	(revision 32341)
@@ -5,5 +5,4 @@
 import java.io.IOException;
 import java.io.InputStreamReader;
-import java.net.MalformedURLException;
 import java.util.concurrent.ExecutorService;
 
@@ -11,4 +10,5 @@
 import javax.json.JsonArray;
 import javax.json.JsonObject;
+import javax.json.JsonReader;
 
 import org.openstreetmap.josm.Main;
@@ -50,25 +50,25 @@
       ));
     ) {
-      JsonObject jsonobj = Json.createReader(br).readObject();
-      if (!jsonobj.getBoolean("more"))
-        this.ex.shutdown();
-      JsonArray jsonarr = jsonobj.getJsonArray("ims");
-      JsonObject data;
-      for (int i = 0; i < jsonarr.size(); i++) {
-        data = jsonarr.getJsonObject(i);
-        String key = data.getString("key");
-        for (MapillaryAbstractImage image : MapillaryLayer.getInstance().getData().getImages()) {
-          if (
-            image instanceof MapillaryImage
-              && ((MapillaryImage) image).getKey().equals(key)
-              && ((MapillaryImage) image).getUser() == null
-          ) {
-            ((MapillaryImage) image).setUser(data.getString("user"));
-            ((MapillaryImage) image).setCapturedAt(data.getJsonNumber("captured_at").longValue());
+      try (JsonReader reader = Json.createReader(br)) {
+        JsonObject jsonObj = reader.readObject();
+        if (!jsonObj.getBoolean("more"))
+          this.ex.shutdown();
+        JsonArray jsonArr = jsonObj.getJsonArray("ims");
+        JsonObject data;
+        for (int i = 0; i < jsonArr.size(); i++) {
+          data = jsonArr.getJsonObject(i);
+          String key = data.getString("key");
+          for (MapillaryAbstractImage image : MapillaryLayer.getInstance().getData().getImages()) {
+            if (
+              image instanceof MapillaryImage
+                && ((MapillaryImage) image).getKey().equals(key)
+                && ((MapillaryImage) image).getUser() == null
+            ) {
+              ((MapillaryImage) image).setUser(data.getString("user"));
+              ((MapillaryImage) image).setCapturedAt(data.getJsonNumber("captured_at").longValue());
+            }
           }
         }
       }
-    } catch (MalformedURLException e) {
-      Main.error(e);
     } catch (IOException e) {
       Main.error(e);
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryURL.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryURL.java	(revision 32340)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryURL.java	(revision 32341)
@@ -79,5 +79,5 @@
    * @param bounds the bounds in which you want to search for images
    * @param page number of the page to retrieve from the API
-   * @param selector
+   * @param selector if set, only a specific type of image is returned by the URL
    * @return the API-URL which gives you the images in the given bounds as JSON
    */
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryUtils.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryUtils.java	(revision 32340)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryUtils.java	(revision 32341)
@@ -90,5 +90,5 @@
    * @param format The format of the date.
    * @return The date in Epoch format.
-   * @throws ParseException
+   * @throws ParseException if the date cannot be parsed with the given format
    */
   public static long getEpoch(String date, String format) throws ParseException {
@@ -153,8 +153,8 @@
 
   /**
-   * Joins two images into the same sequence.
-   *
-   * @param mapillaryAbstractImage
-   * @param mapillaryAbstractImage2
+   * Joins two images into the same sequence. One of them must be the last image of a sequence, the other one the beginning of a different one.
+   *
+   * @param mapillaryAbstractImage the first image, into whose sequence the images from the sequence of the second image are merged
+   * @param mapillaryAbstractImage2 the second image, whose sequence is merged into the sequence of the first image
    */
   public static synchronized void join(
@@ -210,5 +210,5 @@
       });
     } else {
-      Bounds zoomBounds = null;
+      Bounds zoomBounds;
       if (images.isEmpty()) {
         zoomBounds = new Bounds(new LatLon(0, 0));
@@ -236,8 +236,10 @@
 
   /**
-   * Separates two images belonging to the same sequence.
-   *
-   * @param mapillaryAbstractImage
-   * @param mapillaryAbstractImage2
+   * Separates two images belonging to the same sequence. The two images have to be consecutive in the same sequence.
+   * Two new sequences are created and all images up to (and including) either {@code imgA} or {@code imgB} (whichever appears first in the sequence) are put into the first of the two sequences.
+   * All others are put into the second new sequence.
+   *
+   * @param mapillaryAbstractImage one of the images marking where to split the sequence
+   * @param mapillaryAbstractImage2 the other image marking where to split the sequence, needs to be a direct neighbour of {@code mapillaryAbstractImage} in the sequence.
    */
   public static synchronized void unjoin(
