gjoseph / BarbaryWatchService

An implementation of Java 7’s WatchService for OS X
41 stars 10 forks source link

Make the service work with Java 7 APIs (true interop) #3

Closed gjoseph closed 2 years ago

gjoseph commented 9 years ago

This isn't straightforward, because sun.nio.fs.UnixPath#register validates the WatchService instance is sun.nio.fs.AbstractWatchService, but sun.nio.fs.AbstractWatchService is package private, so we can't extend it. A lot of code in sun.nio.fs is actually package-private and make extensions difficult.

Additionally, it is considered poor practice to replace the Default FileSystem (see Kevin Bourillon's comment on https://plus.google.com/+googleguava/posts/a3idqfdnpzC); however in this particular case, we might consider it an exception to the rule.

This will also mean removing a host of code duplicated from OpenJDK.

gjoseph commented 2 years ago

yeah nah