-
Bug
-
Resolution: Fixed
-
P4
-
8u31
-
b54
-
x86
-
windows_8
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8084000 | emb-9 | Brian Burkhalter | P4 | Resolved | Fixed | team |
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
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
- backported by
-
JDK-8084000 (fs) FileSystem.getPathMatcher(...) should check syntax component without regard to case
-
- Resolved
-