Ignore:
Timestamp:
2015-12-15T21:47:02+01:00 (9 years ago)
Author:
floscher
Message:

[mapillary] Fix tests in MapillaryURLTest that were failing in Java 7 due to different ordering of HashMaps

Location:
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java

    r31826 r31833  
    3131  private final CopyOnWriteArrayList<MapillaryDataListener> listeners = new CopyOnWriteArrayList<>();
    3232  /** The bounds of the areas for which the pictures have been downloaded. */
    33   public CopyOnWriteArrayList<Bounds> bounds;
     33  public List<Bounds> bounds;
    3434
    3535  /**
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/FinishedUploadDialog.java

    r31828 r31833  
    88import java.awt.event.ActionListener;
    99import java.io.IOException;
    10 import java.net.URL;
    1110
    1211import javax.swing.BoxLayout;
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java

    r31828 r31833  
    22package org.openstreetmap.josm.plugins.mapillary.gui;
    33
     4import static org.openstreetmap.josm.tools.I18n.marktr;
    45import static org.openstreetmap.josm.tools.I18n.tr;
    5 import static org.openstreetmap.josm.tools.I18n.marktr;
    66
    77import java.awt.BorderLayout;
     
    1515import java.io.ByteArrayInputStream;
    1616import java.io.IOException;
    17 import java.net.MalformedURLException;
    1817import java.util.Arrays;
    1918import java.util.List;
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java

    r31828 r31833  
    33
    44import java.awt.FlowLayout;
     5import java.awt.GridBagConstraints;
    56import java.awt.GridBagLayout;
    67import java.awt.event.ActionEvent;
    78import java.io.IOException;
    8 import java.net.URL;
    99
    1010import javax.swing.AbstractAction;
     
    9292    onLogout();
    9393    panel.add(loginPanel, GBC.eol());
    94     panel.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.BOTH));
     94    panel.add(Box.createVerticalGlue(), GBC.eol().fill(GridBagConstraints.BOTH));
    9595
    9696    gui.getDisplayPreference().addSubTab(this, "Mapillary", new JScrollPane(panel));
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java

    r31828 r31833  
    66import java.util.ArrayList;
    77import java.util.concurrent.ArrayBlockingQueue;
    8 import java.util.concurrent.ConcurrentHashMap;
    98import java.util.concurrent.ThreadPoolExecutor;
    109import java.util.concurrent.TimeUnit;
     
    3938
    4039  /** Executor that will run the petitions. */
    41   private static ThreadPoolExecutor EXECUTOR = new ThreadPoolExecutor(3, 5,
    42       100, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(100));;
     40  private static ThreadPoolExecutor executor = new ThreadPoolExecutor(3, 5, 100, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(100));
    4341
    4442  /**
     
    5250   */
    5351  public static void getImages(LatLon minLatLon, LatLon maxLatLon) {
    54     if (maxLatLon == null || maxLatLon == null) {
     52    if (minLatLon == null || maxLatLon == null) {
    5553      throw new IllegalArgumentException();
    5654    }
     
    9088  private static void run(Thread t) {
    9189    threads.add(t);
    92     EXECUTOR.execute(t);
     90    executor.execute(t);
    9391  }
    9492
     
    214212    }
    215213    threads.clear();
    216     EXECUTOR.shutdownNow();
     214    executor.shutdownNow();
    217215    try {
    218       EXECUTOR.awaitTermination(30, TimeUnit.SECONDS);
     216      executor.awaitTermination(30, TimeUnit.SECONDS);
    219217    } catch (InterruptedException e) {
    220218      Main.error(e);
    221219    }
    222     EXECUTOR = new ThreadPoolExecutor(3, 5, 100, TimeUnit.SECONDS,
     220    executor = new ThreadPoolExecutor(3, 5, 100, TimeUnit.SECONDS,
    223221        new ArrayBlockingQueue<Runnable>(100));
    224222  }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthPortListener.java

    r31827 r31833  
    3737  @Override
    3838  public void run() {
    39     try {
    40       ServerSocket serverSocket = new ServerSocket(PORT);
    41       Socket clientSocket = serverSocket.accept();
    42       PrintWriter out = new PrintWriter(new OutputStreamWriter(
    43           clientSocket.getOutputStream(), "UTF-8"), true);
    44       Scanner in = new Scanner(new InputStreamReader(
    45           clientSocket.getInputStream(), "UTF-8"));
     39    try (
     40        ServerSocket serverSocket = new ServerSocket(PORT);
     41        Socket clientSocket = serverSocket.accept();
     42        PrintWriter out = new PrintWriter(new OutputStreamWriter(clientSocket.getOutputStream(), "UTF-8"), true);
     43        Scanner in = new Scanner(new InputStreamReader(clientSocket.getInputStream(), "UTF-8"));
     44    ) {
    4645      String s;
    4746      String accessToken = null;
Note: See TracChangeset for help on using the changeset viewer.