From 9a75bab3eff8b4ceedabda3e2df384703ab8013b Mon Sep 17 00:00:00 2001 From: Vladimir Lagunov Date: Thu, 31 Oct 2024 10:15:00 +0100 Subject: [PATCH] IJPL-162726 IJent: implement forgotten methods, protect from NPE (cherry picked from commit db932a499a925944f75ea10cdfb0e6cbcb070b7f) IJ-CR-148204 GitOrigin-RevId: 4b83ac7a5674ad5417a15b27debb4ed6a3466144 --- .../core/nio/fs/MultiRoutingWatchServiceDelegate.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/platform/core-nio-fs/src/com/intellij/platform/core/nio/fs/MultiRoutingWatchServiceDelegate.java b/platform/core-nio-fs/src/com/intellij/platform/core/nio/fs/MultiRoutingWatchServiceDelegate.java index 674505314df3..fa1e425a7e85 100644 --- a/platform/core-nio-fs/src/com/intellij/platform/core/nio/fs/MultiRoutingWatchServiceDelegate.java +++ b/platform/core-nio-fs/src/com/intellij/platform/core/nio/fs/MultiRoutingWatchServiceDelegate.java @@ -25,16 +25,21 @@ class MultiRoutingWatchServiceDelegate implements WatchService { @Override public WatchKey poll() { WatchKey watchKey = myDelegate.poll(); + if (watchKey == null) return null; return new MultiRoutingWatchKeyDelegate(watchKey, myProvider); } @Override public WatchKey poll(long timeout, TimeUnit unit) throws InterruptedException { - return null; + WatchKey watchKey = myDelegate.poll(timeout, unit); + if (watchKey == null) return null; + return new MultiRoutingWatchKeyDelegate(watchKey, myProvider); } @Override public WatchKey take() throws InterruptedException { - return null; + WatchKey watchKey = myDelegate.take(); + if (watchKey == null) return null; + return new MultiRoutingWatchKeyDelegate(watchKey, myProvider); } }