ikvmnet / ikvm

A Java Virtual Machine and Bytecode-to-IL Converter for .NET
Other
1.22k stars 111 forks source link

`(new java.io.File(".")).toPath().toRealPath()` throws `java.io.IOException` #330

Closed Kojoley closed 1 year ago

Kojoley commented 1 year ago
public final class Main
{
    public static void main(String[] args) throws java.io.IOException
    {
        (new java.io.File(".")).toPath().toRealPath();
    }
}
C:\w>"C:\Program Files\Java\jdk1.8.0_301\bin\javac.exe" Main.java

C:\w>"C:\Program Files\Java\jdk1.8.0_301\bin\java.exe" Main

C:\w>"C:\ikvm\bin\java.exe" Main
Exception in thread "main" java.io.IOException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
    at IKVM.Java.Externs.java.io.WinNTFileSystem.canonicalize0(Unknown Source)
    at java.io.WinNTFileSystem.canonicalize0(Native Method)
    at java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:428)
    at IKVM.Java.Externs.sun.nio.fs.DotNetPath.toRealPathImpl(Unknown Source)
    at sun.nio.fs.DotNetPath.toRealPathImpl(Native Method)
    at sun.nio.fs.DotNetPath.toRealPath(DotNetPath.java:509)
    at Main.main(Main.java:6)
    at java.lang.reflect.Method.invoke(Method.java:486)
    at IKVM.Java.Externs.ikvm.runtime.Launcher.run(Unknown Source)