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

fix some Findbugs warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.