Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8249190

File-Constructor returns without Slash

XMLWordPrintable

    • b01
    • 11
    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      Windows 7 / OpenJDK 11.02

      A DESCRIPTION OF THE PROBLEM :
      If you do something like this, in earlier Version in return C:\IPC now it Returns C:IPC
      File f = new File ("C:", "IPC");
      String path =f.getPath();

      The Problem occurs in Java.io.WinNtFilesystem in the resolve method on line 239:

              boolean isDirectoryRelative =
                  pn == 2 && isLetter(parent.charAt(0)) && parent.charAt(1) == ':';



      REGRESSION : Last worked in version 8u192

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      File f = new File ("C:", "IPC");
      String path =f.getPath();

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      path = C:\IPC
      ACTUAL -
      path = C:IPC

      FREQUENCY : always

            bpb Brian Burkhalter
            tongwan Andrew Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: