JDK-8133232 : [fs] Regex has redundant | in the char class
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 8,9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2015-08-09
  • Updated: 2016-06-13
  • Resolved: 2015-08-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u72Fixed 9 b78Fixed
Description
In jdk/src/java.base/unix/classes/sun/nio/fs/MimeTypesFileTypeDetector.java there are two regexps:

String extRegex = "\\b" + EXTEQUAL +
    "(\"[\\p{Graph}|\\p{Blank}]+?\"|\\p{Graph}+\\b)";

String[] extList = exts.split("[\\p{Blank}|\\p{Punct}]+");

which have redundant bar-character in the char class.