Changeset 9205 in josm for trunk/src/org


Ignore:
Timestamp:
2015-12-28T21:25:25+01:00 (4 years ago)
Author:
Don-vip
Message:

fix some Findbugs warnings

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r9087 r9205  
    556556        main = this;
    557557        isOpenjdk = System.getProperty("java.vm.name").toUpperCase(Locale.ENGLISH).indexOf("OPENJDK") != -1;
     558        fileWatcher.start();
    558559
    559560        new InitializationTask(tr("Executing platform startup hook")) {
  • trunk/src/org/openstreetmap/josm/io/FileWatcher.java

    r8510 r9205  
    3131
    3232    private WatchService watcher;
     33    private Thread thread;
    3334
    3435    private final Map<Path, StyleSource> styleMap = new HashMap<>();
     
    4142        try {
    4243            watcher = FileSystems.getDefault().newWatchService();
    43             new Thread(new Runnable() {
     44            thread = new Thread(new Runnable() {
    4445                @Override
    4546                public void run() {
    4647                    processEvents();
    4748                }
    48             }, "File Watcher").start();
     49            }, "File Watcher");
    4950        } catch (IOException e) {
    5051            Main.error(e);
     52        }
     53    }
     54
     55    /**
     56     * Starts the File Watcher thread.
     57     */
     58    public final void start() {
     59        if (!thread.isAlive()) {
     60            thread.start();
    5161        }
    5262    }
Note: See TracChangeset for help on using the changeset viewer.