RFR: 8231179: Investigate why tools/javac/options/BCPOrSystemNotSpecified.java fails on Window [v2]
Vicente Romero
vromero at openjdk.java.net
Fri Jan 15 19:20:04 UTC 2021
On Thu, 14 Jan 2021 21:49:19 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:
>> test/langtools/tools/javac/options/BCPOrSystemNotSpecified.java line 213:
>>
>>> 211: String sourcePath = file.getName();
>>> 212: // Here, we should use file system separator instead of the operating system separator.
>>> 213: String fileSystemSep = ((PathFileObject) file).getPath().getFileSystem().getSeparator();
>>
>> what about using: System.getProperty("file.separator")?
>
> @vicente-romero-oracle Explaining a bit more ... on Windows, the default file system separator is `` but we're dealing here with `Path` objects from the "internal" JRT file system, which uses `/` as a separator. That's why we have to be careful to use the right separator. On Unix/Linux/macOS, the separators are the same, which is how the test has passed on those platforms.
I see thanks for the clarification
-------------
PR: https://git.openjdk.java.net/jdk/pull/2004
More information about the compiler-dev
mailing list