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

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

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 20
    • core-libs
    • None
    • behavioral
    • minimal
    • Little risk as the change documents longstanding behavior.
    • Java API
    • SE

      Summary

      Document that the syntax part of the syntaxAndPattern parameter of java.nio.file.FileSystem.getPathMatcher(String) must not be empty.

      Problem

      The current specification states:

      The syntaxAndPattern parameter identifies the syntax and the pattern and takes the form:

       syntax:pattern

      where ':' stands for itself.

      which does not make it explicit that syntax must not be empty.

      Solution

      Change the description of the parameter to

      The syntaxAndPattern parameter identifies the syntax and the pattern and takes the form:

       syntax:pattern

      where syntax must not be empty and ':' stands for itself.

      Specification

      @@ -304,7 +304,8 @@ public abstract class FileSystem
            * <blockquote><pre>
            * <i>syntax</i><b>:</b><i>pattern</i>
            * </pre></blockquote>
      -     * where {@code ':'} stands for itself.
      +     * where <i>syntax</i> is the non-empty name of the syntax, <i>pattern</i>
      +     * is a possibly-empty pattern string, and {@code ':'} stands for itself.
            *
            * <p> A {@code FileSystem} implementation supports the "{@code glob}" and
            * "{@code regex}" syntaxes, and may support others. The value of the syntax

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

              Created:
              Updated:
              Resolved: