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

(jrtfs) Path::toUri throws AssertionError for malformed input

XMLWordPrintable

    • b28
    • Fix failed

      A DESCRIPTION OF THE PROBLEM :
      jrt FileSystem's Path.toUri() throws AssertionErrors for paths starting with "/modules" followed by a char sequence which URI considers an invalid IPv6 address.

      The behavior before JDK 13 might be different due to JDK-8224946, there the path must not have the "/modules" prefix, but instead directly have the invalid IPv6 address.


      ---------- BEGIN SOURCE ----------
      try {
          FileSystems.getFileSystem(URI.create("jrt:/")).getPath("/modules/[").toUri();
          throw new RuntimeException("Expected AssertionError");
      }
      catch (AssertionError expected) {
          expected.printStackTrace();
      }
      ---------- END SOURCE ----------

            sundar Sundararajan Athijegannathan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: