Changeset 11995 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2017-04-24T21:16:45+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #14690 - Loading commandline file blocks JOSM (regression from r11986)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/Main.java

    r11988 r11995  
    830830     * Handle command line instructions after GUI has been initialized.
    831831     * @param args program arguments
    832      */
    833     protected static void postConstructorProcessCmdLine(ProgramArguments args) {
     832     * @return the list of submitted tasks
     833     */
     834    protected static List<Future<?>> postConstructorProcessCmdLine(ProgramArguments args) {
    834835        List<Future<?>> tasks = new ArrayList<>();
    835836        List<File> fileList = new ArrayList<>();
     
    843844            tasks.addAll(DownloadParamType.paramType(s).downloadGps(s));
    844845        }
    845         // Make sure all download tasks complete before handling selection arguments
    846         for (Future<?> task : tasks) {
    847             try {
    848                 task.get();
    849             } catch (InterruptedException | ExecutionException e) {
    850                 error(e);
    851             }
    852         }
    853         for (String s : args.get(Option.SELECTION)) {
    854             SearchAction.search(s, SearchAction.SearchMode.add);
    855         }
     846        final Collection<String> selectionArguments = args.get(Option.SELECTION);
     847        if (!selectionArguments.isEmpty()) {
     848            tasks.add(Main.worker.submit(() -> {
     849                for (String s : selectionArguments) {
     850                    SearchAction.search(s, SearchAction.SearchMode.add);
     851                }
     852            }));
     853        }
     854        return tasks;
    856855    }
    857856
Note: See TracChangeset for help on using the changeset viewer.