Comment 1 for bug 592201

Revision history for this message
Andy Schneider (aschneider-getcollc) wrote :

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.