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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 20
    • 20
    • core-libs
    • None
    • b10

    Description

      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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: