提交 eaca6bff 编写于 作者: I igerasim

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

Reviewed-by: bpb, rriggs
上级 631f8f13
......@@ -171,7 +171,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);
......@@ -181,7 +181,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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册