Code Clean Up
[bgpcep.git] / bgp / config-loader-impl / src / main / java / org / opendaylight / protocol / bgp / config / loader / impl / BGPFileWatcher.java
index 87607178daafec432ac6b9d00b3629358bd20b1e..78fe148c6018dc83486624d7425bc5d1eec8a0b8 100644 (file)
@@ -29,16 +29,13 @@ public final class BGPFileWatcher implements FileWatcher, AutoCloseable {
 
     public BGPFileWatcher() throws IOException {
         this.watchService = FileSystems.getDefault().newWatchService();
-        Runtime.getRuntime().addShutdownHook(new Thread() {
-            @Override
-            public void run() {
-                try {
-                    BGPFileWatcher.this.watchService.close();
-                } catch (final IOException e) {
-                    LOG.warn(INTERRUPTED, e);
-                }
+        Runtime.getRuntime().addShutdownHook(new Thread(() -> {
+            try {
+                BGPFileWatcher.this.watchService.close();
+            } catch (final IOException e) {
+                LOG.warn(INTERRUPTED, e);
             }
-        });
+        }));
         PATH.register(this.watchService, OVERFLOW, ENTRY_CREATE);
     }