Changeset 7005 in josm for trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
- Timestamp:
- 2014-04-26T17:39:23+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r7004 r7005 75 75 */ 76 76 public MultiFetchServerObjectReader() { 77 nodes = new LinkedHashSet< Long>();78 ways = new LinkedHashSet< Long>();79 relations = new LinkedHashSet< Long>();77 nodes = new LinkedHashSet<>(); 78 ways = new LinkedHashSet<>(); 79 relations = new LinkedHashSet<>(); 80 80 this.outputDataSet = new DataSet(); 81 this.missingPrimitives = new LinkedHashSet< PrimitiveId>();81 this.missingPrimitives = new LinkedHashSet<>(); 82 82 } 83 83 … … 238 238 */ 239 239 protected Set<Long> extractIdPackage(Set<Long> ids) { 240 HashSet<Long> pkg = new HashSet< Long>();240 HashSet<Long> pkg = new HashSet<>(); 241 241 if (ids.isEmpty()) 242 242 return pkg; … … 333 333 progressMonitor.setTicks(0); 334 334 // The complete set containg all primitives to fetch 335 Set<Long> toFetch = new HashSet< Long>(ids);335 Set<Long> toFetch = new HashSet<>(ids); 336 336 // Build a list of fetchers that will download smaller sets containing only MAX_IDS_PER_REQUEST (200) primitives each. 337 337 // we will run up to MAX_DOWNLOAD_THREADS concurrent fetchers. … … 339 339 threadsNumber = Math.min(Math.max(threadsNumber, 1), OsmApi.MAX_DOWNLOAD_THREADS); 340 340 Executor exec = Executors.newFixedThreadPool(threadsNumber); 341 CompletionService<FetchResult> ecs = new ExecutorCompletionService< FetchResult>(exec);342 List<Future<FetchResult>> jobs = new ArrayList< Future<FetchResult>>();341 CompletionService<FetchResult> ecs = new ExecutorCompletionService<>(exec); 342 List<Future<FetchResult>> jobs = new ArrayList<>(); 343 343 while (!toFetch.isEmpty()) { 344 344 jobs.add(ecs.submit(new Fetcher(type, extractIdPackage(toFetch), progressMonitor))); … … 388 388 progressMonitor.beginTask(trn("Downloading {0} object from ''{1}''", "Downloading {0} objects from ''{1}''", n, n, OsmApi.getOsmApi().getBaseUrl())); 389 389 try { 390 missingPrimitives = new HashSet< PrimitiveId>();390 missingPrimitives = new HashSet<>(); 391 391 if (isCanceled()) return null; 392 392 fetchPrimitives(ways,OsmPrimitiveType.WAY, progressMonitor);
Note:
See TracChangeset
for help on using the changeset viewer.