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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 1.2.0
    • Affects Version/s: 1.1.5
    • Component/s: 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)
      ======================================================================

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: