8133232: [fs] Regex has redundant | in the char class

Reviewed-by: bpb, rriggs
This commit is contained in:
Ivan Gerasimov 2015-08-12 22:24:26 +03:00
parent 5924c95500
commit 6b0aff010f

View File

@ -159,7 +159,7 @@ class MimeTypesFileTypeDetector extends AbstractFileTypeDetector {
final String EXTEQUAL = "exts=";
String extRegex = "\\b" + EXTEQUAL +
"(\"[\\p{Graph}|\\p{Blank}]+?\"|\\p{Graph}+\\b)";
"(\"[\\p{Graph}\\p{Blank}]+?\"|\\p{Graph}+\\b)";
Pattern extPattern = Pattern.compile(extRegex);
Matcher extMatcher = extPattern.matcher(entry);
@ -169,7 +169,7 @@ class MimeTypesFileTypeDetector extends AbstractFileTypeDetector {
if (exts.charAt(0) == '"') {
exts = exts.substring(1, exts.length() - 1);
}
String[] extList = exts.split("[\\p{Blank}|\\p{Punct}]+");
String[] extList = exts.split("[\\p{Blank}\\p{Punct}]+");
for (String ext : extList) {
putIfAbsent(ext, type);
}