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

java.io.File.getParent should remove redundant separator chars

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.2.0
    • 1.1.5
    • core-libs
    • 1.2beta4
    • x86
    • windows_nt
    • Not verified



      Name: dgC58589 Date: 01/13/98


      1,2,3. the code:

      File f = new File("c:\\a\\b");

      shows
      getParent() c:\a -- as expected,
      getAbsolutePath() c:\a\b (also as expected)
      getCanonicalPath() c:\a\b (also as expected)

      but the code

      File f = new File("c:\\a\\b\\");

      shows
      getParent() c:\a\b -- an ERROR
      getAbsolutePath() c:\a\bgetCanonicalPath() c:\a\b (the same as parent!)

      4. N/A

      5. It might seems like bug 4065506 but it is different errorneous behaviour!
      (Review ID: 23026)
      ======================================================================

            mr Mark Reinhold
            dgrahamcsunw David Graham-cumming (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: