(fs) FileSystem.getPathMatcher does not check for ":" at last index

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 20
    • Affects Version/s: 20
    • Component/s: core-libs
    • None
    • b10

      The implementations of the getPathMatcher in the default, zipfs, and jrtfs implementations have the following code:

      int pos = syntaxAndInput.indexOf(':');
      if (pos <= 0 || pos == syntaxAndInput.length())
          throw new IllegalArgumentException();

      Checking pos == syntaxAndInput.length() is not needed here as pos is alway less than length.

      First reported here:
      https://mail.openjdk.org/pipermail/core-libs-dev/2022-April/088000.html

            Assignee:
            Brian Burkhalter
            Reporter:
            Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: