RFR: 8231179: Investigate why tools/javac/options/BCPOrSystemNotSpecified.java fails on Window [v2]

Guoxiong Li github.com+13688759+lgxbslgx at openjdk.java.net
Fri Jan 15 12:54:25 UTC 2021


On Thu, 14 Jan 2021 21:33:08 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:

>> Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Use StandardJavaFileManager::asPath
>
> 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();
> 
> It should be possible to get the `Path` without having to cast to the internal `PathFileObject` type.
> 
> See https://docs.oracle.com/en/java/javase/15/docs/api/java.compiler/javax/tools/StandardJavaFileManager.html#asPath(javax.tools.FileObject)

@jonathan-gibbons Thanks for your suggestion. I have updated the code.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2004


More information about the compiler-dev mailing list