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

URI.normalize() throws ArrayIndexOutOfBoundsException

XMLWordPrintable

    • hopper
    • generic
    • generic
    • Verified



      Name: eaR10174 Date: 12/05/2001


        The method java.net.URI.normalize() throws ArrayIndexOutOfBoundsException when it is
      used to normalize the relative uri 'abc/../..' (See test.java below).

        This bug is found in jdk1.4.0-rc-b88.

      ------------------------------------test.java-----------------------------
      import java.net.URI;

      public class test {
          public static void main(String[] argv) {
              try {
                  URI uri = new URI("abc/../..");
                  System.out.println("uri: abc/../..");
                  uri.normalize();
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }
      }
      ---------------------------------------------------------------------------
      ---------------------------------------------------------------------------
      % java -showversion test
      java version "1.4.0-rc"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-rc-b88)
      Java HotSpot(TM) Client VM (build 1.4.0-rc-b88, mixed mode)

      uri: abc/../..
      java.lang.ArrayIndexOutOfBoundsException
              at java.net.URI.maybeAddLeadingDot(URI.java:2282)
              at java.net.URI.normalize(URI.java:2319)
              at java.net.URI.normalize(URI.java:1988)
              at java.net.URI.normalize(URI.java:938)
              at test.main(test.java:8)
      ---------------------------------------------------------------------------

      ======================================================================

            alanb Alan Bateman
            evgsunw Evg Evg (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: