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

116regress: relative systemResource URLs are broken in 1.1.5

XMLWordPrintable

    • 1.1.6
    • generic
    • generic
    • Verified

      We (I) introduced a regression in 1.1.5 while doing another fix. When a relative URL is given for a systemresource URL, the resulting URL is malformed
      and an exception is raised.

      Here is a regression test:

      /* @test -------
         @bug -------
      @summary regression: relative systemResource URLs are broken in 1.1.5
      @author Eduardo Pelegri-Llopart
      */

      import java.net.URL;

      public class RelativeSysResource {

          public static final String className = "RelativeSysResource.class";
          public static final String javaName = "RelativeSysResource.java";

          public static void main(String[] args) {
      try {
      URL url = RelativeSysResource.class.getResource(className);
      System.out.println("url = " + url);

      // create a relative URL using the obtained URL
      URL relativeURL = new URL(url, javaName);
      System.out.println("relativeURL = " + relativeURL);
      } catch (Exception e) {
      e.printStackTrace();
      }
          }
      }

            epelegrisunw Eduardo Pelegrillopart (Inactive)
            epelegrisunw Eduardo Pelegrillopart (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: