8133232: [fs] Regex has redundant | in the char class
authorigerasim
Wed, 12 Aug 2015 22:24:26 +0300
changeset 32140 28ab875c1537
parent 32139 caacc3d1a348
child 32141 06929447eac0
8133232: [fs] Regex has redundant | in the char class Reviewed-by: bpb, rriggs
jdk/src/java.base/unix/classes/sun/nio/fs/MimeTypesFileTypeDetector.java
--- a/jdk/src/java.base/unix/classes/sun/nio/fs/MimeTypesFileTypeDetector.java	Wed Aug 12 07:55:24 2015 -0700
+++ b/jdk/src/java.base/unix/classes/sun/nio/fs/MimeTypesFileTypeDetector.java	Wed Aug 12 22:24:26 2015 +0300
@@ -159,7 +159,7 @@
 
                 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 @@
                     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);
                     }