Martin Buchholz wrote:
:
So I suspect we can get rid of that icky C code in getNativePath entirely,
perhaps simply replacing it by java calls to getPath() or similar functionality
extracted from something in NIO2, which is in jdk7 since b50.
Eliminating this native code would be good although I don't think we'll
find code that is completely compatible with the existing behavior. For
example, in addition to normalizing the path separator, it trims
trailing spaces. If you passed such input to
FileSystem.getDefault().getPath method it would reject it immediately
(because trailing spaces are prohibited in directory names). The
simplest solution is probably to put this trimming in the Windows
java.lang.ProcessImpl. I don't think it needs to worry about the
separator because the working directory should already be normalized.
-Alan.