Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryExportAction.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryExportAction.java	(revision 32977)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryExportAction.java	(revision 32978)
@@ -92,9 +92,5 @@
     } else if (this.dialog.group.isSelected(this.dialog.rewrite.getModel())) {
       ArrayList<MapillaryImportedImage> images = new ArrayList<>();
-      for (MapillaryAbstractImage image : MapillaryLayer.getInstance().getData().getImages()) {
-        if (image instanceof MapillaryImportedImage) {
-          images.add((MapillaryImportedImage) image);
-        }
-      }
+      MapillaryLayer.getInstance().getData().getImages().stream().filter(img -> img instanceof MapillaryImportedImage).forEach(img -> images.add((MapillaryImportedImage) img));
       try {
         Main.worker.submit(new MapillaryExportManager(images));
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 32977)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java	(revision 32978)
@@ -7,4 +7,5 @@
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
+import java.util.stream.IntStream;
 
 import javax.swing.JOptionPane;
@@ -23,5 +24,4 @@
  *
  * @author nokutu
- *
  */
 public final class MapillaryDownloader {
@@ -80,12 +80,9 @@
   }
 
-  /** All the Threads that have been run. Used to interrupt them properly. */
-  //private static List<Thread> threads = new ArrayList<>();
-
   /** Max area to be downloaded */
-  public static final double MAX_AREA = Main.pref.getDouble("mapillary.max-download-area", 0.015);
+  private static final double MAX_AREA = Main.pref.getDouble("mapillary.max-download-area", 0.015);
 
   /** 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<>(100));
 
   private MapillaryDownloader() {
@@ -97,8 +94,6 @@
    * sequences that pass through the given rectangle.
    *
-   * @param minLatLon
-   *          The minimum latitude and longitude of the rectangle.
-   * @param maxLatLon
-   *          The maximum latitude and longitude of the rectangle
+   * @param minLatLon The minimum latitude and longitude of the rectangle.
+   * @param maxLatLon The maximum latitude and longitude of the rectangle
    */
   public static void getImages(LatLon minLatLon, LatLon maxLatLon) {
@@ -112,6 +107,5 @@
    * Gets the images within the given bounds.
    *
-   * @param bounds
-   *          A {@link Bounds} object containing the area to be downloaded.
+   * @param bounds A {@link Bounds} object containing the area to be downloaded.
    */
   public static void getImages(Bounds bounds) {
@@ -125,7 +119,7 @@
    */
   public static MapillaryDownloader.DOWNLOAD_MODE getMode() {
-   return MapillaryLayer.hasInstance() && MapillaryLayer.getInstance().tempSemiautomatic
-     ? DOWNLOAD_MODE.VISIBLE_AREA
-     : DOWNLOAD_MODE.fromPrefId(Main.pref.get("mapillary.download-mode"));
+    return MapillaryLayer.hasInstance() && MapillaryLayer.getInstance().tempSemiautomatic
+      ? DOWNLOAD_MODE.VISIBLE_AREA
+      : DOWNLOAD_MODE.fromPrefId(Main.pref.get("mapillary.download-mode"));
   }
 
@@ -159,7 +153,7 @@
       for (int j = 0; j < n; j++) {
         if (isInBounds(new LatLon(view.getMinLat()
-            + (view.getMaxLat() - view.getMinLat()) * ((double) i / n),
-            view.getMinLon() + (view.getMaxLon() - view.getMinLon())
-                * ((double) j / n)))) {
+          + (view.getMaxLat() - view.getMinLat()) * ((double) i / n),
+          view.getMinLon() + (view.getMaxLon() - view.getMinLon())
+            * ((double) j / n)))) {
           inside[i][j] = true;
         }
@@ -179,14 +173,10 @@
    * image.
    *
-   * @param latlon
-   *          The coordinates to check.
+   * @param latlon The coordinates to check.
+   *
    * @return true if it lies inside the bounds; false otherwise;
    */
   private static boolean isInBounds(LatLon latlon) {
-    for (Bounds bounds : MapillaryLayer.getInstance().getData().getBounds()) {
-      if (bounds.contains(latlon))
-        return true;
-    }
-    return false;
+    return MapillaryLayer.getInstance().getData().getBounds().parallelStream().anyMatch(b -> b.contains(latlon));
   }
 
@@ -206,10 +196,8 @@
       throw new IllegalStateException("Must be in automatic mode.");
     }
-    for (Bounds bounds : Main.getLayerManager().getEditLayer().data.getDataSourceBounds()) {
-      if (!MapillaryLayer.getInstance().getData().getBounds().contains(bounds)) {
-        MapillaryLayer.getInstance().getData().getBounds().add(bounds);
-        MapillaryDownloader.getImages(bounds.getMin(), bounds.getMax());
-      }
-    }
+    Main.getLayerManager().getEditLayer().data.getDataSourceBounds().stream().filter(bounds -> !MapillaryLayer.getInstance().getData().getBounds().contains(bounds)).forEach(bounds -> {
+      MapillaryLayer.getInstance().getData().getBounds().add(bounds);
+      MapillaryDownloader.getImages(bounds.getMin(), bounds.getMax());
+    });
   }
 
@@ -221,8 +209,5 @@
    */
   private static boolean isAreaTooBig() {
-    double area = 0;
-    for (Bounds bounds : Main.getLayerManager().getEditLayer().data.getDataSourceBounds()) {
-      area += bounds.getArea();
-    }
+    double area = Main.getLayerManager().getEditLayer().data.getDataSourceBounds().parallelStream().map(Bounds::getArea).reduce(0.0, Double::sum);
     return area > MAX_AREA;
   }
@@ -233,9 +218,9 @@
       MapillaryPlugin.setMenuEnabled(MapillaryPlugin.getDownloadViewMenu(), true);
       JOptionPane
-          .showMessageDialog(
-              Main.parent,
-              I18n.tr("The downloaded OSM area is too big. Download mode has been changed to semiautomatic until the layer is restarted."));
+        .showMessageDialog(
+          Main.parent,
+          I18n.tr("The downloaded OSM area is too big. Download mode has been changed to semiautomatic until the layer is restarted."));
     } else {
-      SwingUtilities.invokeLater(() -> tooBigErrorDialog());
+      SwingUtilities.invokeLater(MapillaryDownloader::tooBigErrorDialog);
     }
   }
@@ -245,10 +230,4 @@
    */
   public static void stopAll() {
-    /*for (Thread t : threads) {
-      if (t.isAlive())
-        Main.info(t+" is still alive!");
-      t.interrupt();
-    }
-    threads.clear();*/
     executor.shutdownNow();
     try {
@@ -258,5 +237,5 @@
     }
     executor = new ThreadPoolExecutor(3, 5, 100, TimeUnit.SECONDS,
-        new ArrayBlockingQueue<Runnable>(100));
+      new ArrayBlockingQueue<>(100));
   }
 }
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/AbstractMode.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/AbstractMode.java	(revision 32977)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/AbstractMode.java	(revision 32978)
@@ -100,6 +100,7 @@
         synchronized (this) {
           try {
-            wait(100);
+            Thread.sleep(100);
           } catch (InterruptedException e) {
+            return;
           }
         }
Index: applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/JoinMode.java
===================================================================
--- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/JoinMode.java	(revision 32977)
+++ applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/JoinMode.java	(revision 32978)
@@ -57,6 +57,5 @@
           || this.lastClick.previous() == this.data.getHighlightedImage()) {
         MapillaryRecord.getInstance().addCommand(
-            new CommandUnjoin(Arrays.asList(new MapillaryAbstractImage[] {
-                this.lastClick, this.data.getHighlightedImage() })));
+            new CommandUnjoin(Arrays.asList(this.lastClick, this.data.getHighlightedImage())));
       }
       this.lastClick = null;
