file: URL's don't handle .. properly

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P1
    • 1.2.0
    • Affects Version/s: 1.2.0
    • Component/s: core-libs
    • None
    • 1.2beta4
    • generic, sparc
    • solaris_2.6
    • Verified

      datsun$ cat url4.java
      import java.net.*;

      public class url4 {

          public static void main(String args[]) {
              try {
                  URL u = new URL(new URL(args[0]), args[1]);
                  System.out.println("URL: " + u.toString());
              } catch (Exception e) {
                  System.out.println(e);
              }
          }
      }
      datsun$ /usr/local/java/jdk1.2/solaris/bin/java url4 file:/x/y/z a
      URL: file:/x/y/a
      datsun$ /usr/local/java/jdk1.1.6/solaris/bin/java url4 file:/x/y/z a
      URL: file:/x/y/a
      datsun$ /usr/local/java/jdk1.2/solaris/bin/java url4 file:/x/y/z ../../a
      URL: file:/x/y//a
      datsun$ /usr/local/java/jdk1.1.6/solaris/bin/java url4 file:/x/y/z ../../a
      URL: file:/a
      datsun$ /usr/local/java/jdk1.2/solaris/bin/java url4 file:/x/y/z ../a
      URL: file:/x/y/../a
      datsun$ /usr/local/java/jdk1.1.6/solaris/bin/java url4 file:/x/y/z ../a
      URL: file:/x/a

      Note how all the cases involving .. are handled quite differently from 1.1.6.

      This is preventing HotJava Views from working on JDK 1.2.

            Assignee:
            Michael Mccloskey (Inactive)
            Reporter:
            Bill Shannon (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: