Ignore:
Timestamp:
2015-12-16T17:17:13+01:00 (9 years ago)
Author:
floscher
Message:

[mapillary] Fix issues reported by Codacy

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

Legend:

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

    r31840 r31841  
    5656public class UploadUtils {
    5757
     58  /** Required keys for POST */
     59  private static final String[] keys = { "key", "AWSAccessKeyId", "acl",
     60      "policy", "signature", "Content-Type" };
     61
     62  /** Mapillary upload URL */
     63  private static final String UPLOAD_URL = "https://s3-eu-west-1.amazonaws.com/mapillary.uploads.manual.images";
     64
     65  /** Count to name temporal files. */
     66  private static int c;
     67
    5868  private static class SequenceUploadThread extends Thread {
    5969    private final List<MapillaryAbstractImage> images;
    6070    private final UUID uuid;
    6171    private final boolean delete;
    62     private ThreadPoolExecutor ex;
     72    private final ThreadPoolExecutor ex;
    6373
    6474    private SequenceUploadThread(List<MapillaryAbstractImage> images,
     
    6676      this.images = images;
    6777      this.uuid = UUID.randomUUID();
    68       this.ex = new ThreadPoolExecutor(8, 8, 25, TimeUnit.SECONDS,
    69           new ArrayBlockingQueue<Runnable>(15));
     78      this.ex = new ThreadPoolExecutor(8, 8, 25, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(15));
    7079      this.delete = delete;
    7180    }
     
    7786      for (MapillaryAbstractImage img : this.images) {
    7887        if (!(img instanceof MapillaryImportedImage))
    79           throw new IllegalArgumentException(
    80               "The sequence contains downloaded images.");
    81         this.ex.execute(new SingleUploadThread((MapillaryImportedImage) img,
    82             this.uuid));
    83         while (this.ex.getQueue().remainingCapacity() == 0)
     88          throw new IllegalArgumentException("The sequence contains downloaded images.");
     89        this.ex.execute(new SingleUploadThread((MapillaryImportedImage) img, this.uuid));
     90        while (this.ex.getQueue().remainingCapacity() == 0) {
    8491          try {
    8592            Thread.sleep(100);
     
    8794            Main.error(e);
    8895          }
     96        }
    8997      }
    9098      this.ex.shutdown();
     
    114122    }
    115123  }
    116   /** Required keys for POST */
    117   private static final String[] keys = { "key", "AWSAccessKeyId", "acl",
    118       "policy", "signature", "Content-Type" };
    119 
    120   /** Mapillary upload URL */
    121   private static final String UPLOAD_URL = "https://s3-eu-west-1.amazonaws.com/mapillary.uploads.manual.images";
    122 
    123   /** Count to name temporal files. */
    124   private static int c = 0;
    125124
    126125  /**
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/utils/PluginState.java

    r31838 r31841  
    1515 *
    1616 */
    17 public class PluginState {
     17public final class PluginState {
    1818
    1919  private static int runningDownloads;
Note: See TracChangeset for help on using the changeset viewer.