Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WatchEvent.context() may be null #112

Closed
raboof opened this issue Dec 22, 2017 · 6 comments
Closed

WatchEvent.context() may be null #112

raboof opened this issue Dec 22, 2017 · 6 comments

Comments

@raboof
Copy link
Contributor

raboof commented Dec 22, 2017

While watching I sometimes see:

[error] Error occurred obtaining files to watch.  Terminating continuous execution...
[error] java.lang.NullPointerException
[error] 	at sun.nio.fs.UnixPath.toUnixPath(UnixPath.java:198)
[error] 	at sun.nio.fs.UnixPath.resolve(UnixPath.java:397)
[error] 	at sun.nio.fs.UnixPath.resolve(UnixPath.java:43)
[error] 	at sbt.internal.io.SourceModificationWatch$.expandEvent(SourceModificationWatch.scala:70)
[error] 	at sbt.internal.io.SourceModificationWatch$.$anonfun$watch$1(SourceModificationWatch.scala:
28)
[error] 	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
[error] 	at scala.collection.immutable.List.foreach(List.scala:389)
[error] 	at scala.collection.TraversableLike.map(TraversableLike.scala:234)
[error] 	at scala.collection.TraversableLike.map$(TraversableLike.scala:227)
[error] 	at scala.collection.immutable.List.map(List.scala:295)
[error] 	at sbt.internal.io.SourceModificationWatch$.watch(SourceModificationWatch.scala:28)
[error] 	at sbt.Watched$.liftedTree1$1(Watched.scala:106)
[error] 	at sbt.Watched$.executeContinuously(Watched.scala:104)
[error] 	at sbt.BasicCommands$.$anonfun$continuous$2(BasicCommands.scala:231)
[error] 	at sbt.CommandUtil$.withAttribute(CommandUtil.scala:49)
[error] 	at sbt.BasicCommands$.$anonfun$continuous$1(BasicCommands.scala:229)
[error] 	at sbt.Command$.$anonfun$applyEffect$4(Command.scala:134)
[error] 	at sbt.Command$.$anonfun$applyEffect$2(Command.scala:130)
[error] 	at sbt.MainLoop$.processCommand(MainLoop.scala:153)
[error] 	at sbt.MainLoop$.$anonfun$next$2(MainLoop.scala:136)
[error] 	at sbt.State$$anon$1.runCmd$1(State.scala:242)

It seems indeed WatchEvent.context() may be null (https://docs.oracle.com/javase/7/docs/api/java/nio/file/WatchEvent.html), and I suspect UnixPath.resolve does not accept null.

@dwijnand dwijnand added the Bug label Jan 2, 2018
@felher
Copy link

felher commented Apr 1, 2018

This is very annoying to me, but I have neither the knowledge nor the time to look into it. I'm willing to spend 50 bucks to help fix this issue and improve SBT. So if anyone wants to take a shot at it: https://www.bountysource.com/issues/53003420-watchevent-context-may-be-null

@dwijnand
Copy link
Member

dwijnand commented Apr 3, 2018

@felher nice! I've added the "help wanted" label to draw attention to it.

@eed3si9n
Copy link
Member

eed3si9n commented Apr 3, 2018

Not sure if it's related but there's #138 and sbt/sbt#4052 for macOS.

@eed3si9n eed3si9n added the ready label Apr 6, 2018
@dwijnand dwijnand added this to the 1.1.7 milestone Apr 9, 2018
@dwijnand
Copy link
Member

dwijnand commented Apr 9, 2018

fixed in #140, which is due in sbt/io 1.1.7 and probably sbt 1.1.4.

@dwijnand dwijnand closed this as completed Apr 9, 2018
@dwijnand dwijnand removed the ready label Apr 9, 2018
@felher
Copy link

felher commented Apr 10, 2018

Great. Can I already test hat? Did it make it into 1.1.4? :)

@dwijnand
Copy link
Member

no sorry sbt/io 1.1.7 wasn't updated in sbt 1.1.4, so this will be either sbt 1.1.5 or sbt 1.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants