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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 20
    • 20
    • 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

            bpb Brian Burkhalter
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: