In the same function I also see null pointer exceptions on exit from the following code (line marked *** )
if (e.isIgnored()) { if (path == null) path = watchPathMap.get(wd); watchPathMap.remove(wd); *** pathWatchMap.remove(path); watchListenerMap.remove(wd); }
In the above case I'd de-registered all listeners and watches. I fixed this this (and the issue described above) with this patch:
714c710,713 < InotifyEvent e = queue.take(); --- > InotifyEvent e = queue.poll(1, TimeUnit.SECONDS); > > if (e == null) continue; > 744c743 < pathWatchMap.remove(path); --- > if (path != null) pathWatchMap.remove(path);
BTW: Nice library.
In the same function I also see null pointer exceptions on exit from the following code (line marked *** )
*** pathWatchMap.
In the above case I'd de-registered all listeners and watches. I fixed this this (and the issue described above) with this patch:
714c710,713 remove( path); remove( path);
< InotifyEvent e = queue.take();
---
> InotifyEvent e = queue.poll(1, TimeUnit.SECONDS);
>
> if (e == null) continue;
>
744c743
< pathWatchMap.
---
> if (path != null) pathWatchMap.
BTW: Nice library.