-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
8u60
-
x86
-
windows_7
FULL PRODUCT VERSION :
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
Matcher#find method is very slow when pattern is unmached.
The number of the group is 5.
The number of the input data is 4.
test case is 30min.
REGRESSION. Last worked in version 8u60
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The number of the group is 5.
The number of the input data is 4.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegTest {
public static void main(String[] args) {
Pattern pattern = Pattern.compile(
"\\d{6}\\*\\s+CALL\\s+'XXXXXX'\\s+USING\\s+([\\w-]+)+\\s+"
+ "\\d{6}\\*\\s+([\\w-]+)+\\s+"
+ "\\d{6}\\*\\s+([\\w-]+)+\\s+"
+ "\\d{6}\\*\\s+([\\w-]+)+\\s+"
+ "\\d{6}\\*\\s+([\\w-]+)+\\."
);
String input =
" 000000* CALL 'XXXXXX' USING XXXXXX-XXXXXX " + System.lineSeparator() +
" 000000* XXXXXX-XXXXXX " + System.lineSeparator() +
" 000000* XXXXXX-XXXXXX " + System.lineSeparator() +
" 000000* XXXXXX-XXXXXX. " + System.lineSeparator();
Matcher match = pattern.matcher(input);
if(match.find()){
System.out.println(match.group(0));
System.out.println(match.group(1));
System.out.println(match.group(2));
System.out.println(match.group(3));
System.out.println(match.group(4));
}
}
}
---------- END SOURCE ----------
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
Matcher#find method is very slow when pattern is unmached.
The number of the group is 5.
The number of the input data is 4.
test case is 30min.
REGRESSION. Last worked in version 8u60
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The number of the group is 5.
The number of the input data is 4.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegTest {
public static void main(String[] args) {
Pattern pattern = Pattern.compile(
"\\d{6}\\*\\s+CALL\\s+'XXXXXX'\\s+USING\\s+([\\w-]+)+\\s+"
+ "\\d{6}\\*\\s+([\\w-]+)+\\s+"
+ "\\d{6}\\*\\s+([\\w-]+)+\\s+"
+ "\\d{6}\\*\\s+([\\w-]+)+\\s+"
+ "\\d{6}\\*\\s+([\\w-]+)+\\."
);
String input =
" 000000* CALL 'XXXXXX' USING XXXXXX-XXXXXX " + System.lineSeparator() +
" 000000* XXXXXX-XXXXXX " + System.lineSeparator() +
" 000000* XXXXXX-XXXXXX " + System.lineSeparator() +
" 000000* XXXXXX-XXXXXX. " + System.lineSeparator();
Matcher match = pattern.matcher(input);
if(match.find()){
System.out.println(match.group(0));
System.out.println(match.group(1));
System.out.println(match.group(2));
System.out.println(match.group(3));
System.out.println(match.group(4));
}
}
}
---------- END SOURCE ----------
- duplicates
-
JDK-8154101 matches method halt with some reg expressions
-
- Closed
-
- relates to
-
JDK-8140212 Slow performance of Matcher.find
-
- Closed
-
-
JDK-8141066 Regular expression parsing loop
-
- Closed
-