-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
1.4.2, 5.0, 6u10
-
Cause Known
-
x86
-
windows_2000, windows_7
FULL PRODUCT VERSION :
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows 2000 [Version 5.00.2195]
A DESCRIPTION OF THE PROBLEM :
any pattern like (x|y)* (an alternative wrapped in a star) is implemented recursively by Pattern. Each matched alternative uses about 5 method calls on the stack.
This makes that kind of pattern useless on any reasonably-sized input. Is there any chance you can make the Pattern implementation non-recursive in this case?
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
see example code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
matched? true
ACTUAL -
java.lang.StackOverflowError
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.StackOverflowError
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
Exception in thread "main"
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.regex.Pattern;
import java.util.regex.Matcher;
public class RegexpFun {
public static void main(String[] args) {
CharSequence largeString = makeLargeString();
Pattern p = Pattern.compile("(x|y)*");
Matcher m = p.matcher(largeString);
System.out.println("matches? " + m.matches()); // throws StackOverflowError
}
private static CharSequence makeLargeString() {
final int size = 1000;
StringBuffer largeString = new StringBuffer(size);
for (int i = 0; i < size/2; i++) {
largeString.append("xy");
}
return largeString;
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
no workaround
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows 2000 [Version 5.00.2195]
A DESCRIPTION OF THE PROBLEM :
any pattern like (x|y)* (an alternative wrapped in a star) is implemented recursively by Pattern. Each matched alternative uses about 5 method calls on the stack.
This makes that kind of pattern useless on any reasonably-sized input. Is there any chance you can make the Pattern implementation non-recursive in this case?
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
see example code
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
matched? true
ACTUAL -
java.lang.StackOverflowError
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.StackOverflowError
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
at java.util.regex.Pattern$Single.match(Pattern.java:3004)
at java.util.regex.Pattern$Branch.match(Pattern.java:3933)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:3973)
at java.util.regex.Pattern$Loop.match(Pattern.java:4100)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4032)
Exception in thread "main"
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.util.regex.Pattern;
import java.util.regex.Matcher;
public class RegexpFun {
public static void main(String[] args) {
CharSequence largeString = makeLargeString();
Pattern p = Pattern.compile("(x|y)*");
Matcher m = p.matcher(largeString);
System.out.println("matches? " + m.matches()); // throws StackOverflowError
}
private static CharSequence makeLargeString() {
final int size = 1000;
StringBuffer largeString = new StringBuffer(size);
for (int i = 0; i < size/2; i++) {
largeString.append("xy");
}
return largeString;
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
no workaround
- duplicates
-
JDK-6958156 String regex bug
- Closed
- relates to
-
JDK-8078476 StackOverflowError by recursion invocation in java.util.regex.Pattern
- Closed
-
JDK-8187571 String replaceAll throws StackOverflowError on a simple text (Regex issue)
- Closed