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

(fs) FileSystem.getPathMatcher(...) should check syntax component without regard to case

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u31
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b54
    • CPU:
      x86
    • OS:
      windows_8
    • Verification:
      Verified

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.8.0_31"
        Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
        Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows [Version 6.3.9600]

        A DESCRIPTION OF THE PROBLEM :
        The method getPathMatcher in the class java.nio.file.FileSystem specifies: "The value of the syntax component is compared without regard to case."
        However, this is not the case: in the current implementation, the syntax component must be lowercase or else an UnsupportedOperationException is thrown.

        Either it has to be specified that the syntax component must always be lowercase, or the implementation has to be fixed to obey the specification.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Run the program in the test case


        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The program exits successfully.
        ACTUAL -
        An UnsupportedOperationException is thrown.

        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        Exception in thread "main" java.lang.UnsupportedOperationException: Syntax 'Regex' not recognized
        at sun.nio.fs.WindowsFileSystem.getPathMatcher(WindowsFileSystem.java:299)
        at com.mooo.ther.lang.Test.main(Test.java:8)

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        import java.nio.file.FileSystems;

        class Test {

        public static void main(String[] args) {
            FileSystems.getDefault().getPathMatcher("Regex:java");
        }

        }
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        always use lowercase for the syntax component

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  bpb Brian Burkhalter
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: