-
Bug
-
Resolution: Duplicate
-
P4
-
7
-
x86
-
windows_7
FULL PRODUCT VERSION :
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [version 6.1.7601]
EXTRA RELEVANT SYSTEM CONFIGURATION :
Not relevant
A DESCRIPTION OF THE PROBLEM :
The matcher.match() method never returns when called with specific pattern and string to match
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and execute the provided code.
It just declare a specific Pattern and match a string (any string that looks like the provided one will trigger the bug too).
It's obvious that an expression like
string.matches(pattern)
triggers the bug too.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The program should terminate gracefully.
ACTUAL -
The program never ends.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
No error message is displayed
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public static void main(String[] args) {
String s1 = "a().characteristics.characteristics.characteristics;";
Pattern pat = Pattern.compile("(?<assignationtype>[^=(new|throw new)]\\w+\\s+)?(?:(?<assignationTargets>(?<assignationtarget>\\w+\\.)*)(?<assignation>\\w+(?:\\[\\w+\\])?\\s*(?:=|:\\*=)\\s*))?(?<stereotype>new|throw new)?\\s?(?<targets>(?<target>[^\\.]+\\.)*)(?<name>[_\\w]+)\\((?<arguments>(?<argument>[^,]+,?)*)\\);");
Matcher matcher = pat.matcher(s1);
matcher.matches();
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None found at thiss time.
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [version 6.1.7601]
EXTRA RELEVANT SYSTEM CONFIGURATION :
Not relevant
A DESCRIPTION OF THE PROBLEM :
The matcher.match() method never returns when called with specific pattern and string to match
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and execute the provided code.
It just declare a specific Pattern and match a string (any string that looks like the provided one will trigger the bug too).
It's obvious that an expression like
string.matches(pattern)
triggers the bug too.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The program should terminate gracefully.
ACTUAL -
The program never ends.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
No error message is displayed
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public static void main(String[] args) {
String s1 = "a().characteristics.characteristics.characteristics;";
Pattern pat = Pattern.compile("(?<assignationtype>[^=(new|throw new)]\\w+\\s+)?(?:(?<assignationTargets>(?<assignationtarget>\\w+\\.)*)(?<assignation>\\w+(?:\\[\\w+\\])?\\s*(?:=|:\\*=)\\s*))?(?<stereotype>new|throw new)?\\s?(?<targets>(?<target>[^\\.]+\\.)*)(?<name>[_\\w]+)\\((?<arguments>(?<argument>[^,]+,?)*)\\);");
Matcher matcher = pat.matcher(s1);
matcher.matches();
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
None found at thiss time.
- duplicates
-
JDK-6192895 java.util.regex.Matcher: Performance issue
-
- Closed
-
- relates to
-
JDK-6988218 RegEx matcher loops
-
- Resolved
-
-
JDK-7006761 Matcher.matches() has infinite loop
-
- Resolved
-