Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I noticed the io spec was failing on my mac on jdk9 (but passing on travis, which was running jdk 8). The relativize method arguably didn't work correctly on pre jdk 9 jres (at least on osx). For example, I ran the following in the console: scala> import java.nio.file._ scala> val base = Paths.get("/foo/bar/..") val base = Paths.get("/foo/bar/..") base: java.nio.file.Path = /foo/bar/.. scala> val file = Paths.get("/foo/buzz") val file = Paths.get("/foo/buzz") file: java.nio.file.Path = /foo/buzz scala> val relative = base.relativize(file) val relative = base.relativize(file) ^ relative: java.nio.file.Path = ../../buzz scala> base.resolve(relative).normalize base.resolve(relative).normalize ^ res5: java.nio.file.Path = /buzz This result is certainly not what I would expect. The fix is very easy, just always normalize the paths (which is not very expensive, especially compared to any file system operation).
- Loading branch information