You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Run following code couple of times. Usually exception is thrown between
first and tenth iteration:
import nl.flotsam.xeger.Xeger;
public class Test {
public static void main(String[] args) {
String pattern = "[\\w\\-.]+(@[a-zA-Z0-9.\\-]+\\.[a-zA-Z0-9]{2,})?";
Xeger generator = new Xeger(pattern);
for (int i = 0; i < 1000; i++) {
System.out.println("iteration " + i);
generator.generate();
}
}
}
What is the expected output?
String according to passed pattern.
What do you see instead?
java.lang.StackOverflowError
What version of the product are you using? On what operating system?
1.0, Red Hat Enterprise Linux Client release 5.4 (Tikanga)
Please provide any additional information below.
Output:
iteration 0
iteration 1
iteration 2
iteration 3
iteration 4
Exception in thread "main" java.lang.StackOverflowError
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:587)
at java.lang.StringBuilder.append(StringBuilder.java:214)
at nl.flotsam.xeger.Xeger.appendChoice(Xeger.java:85)
at nl.flotsam.xeger.Xeger.generate(Xeger.java:79)
at nl.flotsam.xeger.Xeger.generate(Xeger.java:80)
at nl.flotsam.xeger.Xeger.generate(Xeger.java:80)
at nl.flotsam.xeger.Xeger.generate(Xeger.java:80)
at nl.flotsam.xeger.Xeger.generate(Xeger.java:80)
at nl.flotsam.xeger.Xeger.generate(Xeger.java:80)
at nl.flotsam.xeger.Xeger.generate(Xeger.java:80)
at nl.flotsam.xeger.Xeger.generate(Xeger.java:80)
at nl.flotsam.xeger.Xeger.generate(Xeger.java:80)
at nl.flotsam.xeger.Xeger.generate(Xeger.java:80)
at nl.flotsam.xeger.Xeger.generate(Xeger.java:80)
...
Original issue reported on code.google.com by [email protected] on 24 Mar 2015 at 10:50
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 24 Mar 2015 at 10:50The text was updated successfully, but these errors were encountered: