Git Product home page Git Product logo

xeger's People

Watchers

 avatar

xeger's Issues

Random java.lang.StackOverflowError

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

generation of regex is not consistently repeatable

If I want to use a Random with a fixed seem across two instances of Xeger this 
randomly fails to generate the same set of regex values.

The reason seems to be because Automatom internally uses Set for most 
everything and the order of the Transitions is not guaranteed regardless if the 
regex are the same.

The solution is to change from using 

List<Transition> transitions = state.getSortedTransitions(true);

to 

List<Transition> transitions = state.getSortedTransitions(false);

This ensures that the order of transitions is consistent (because it is using 
the min / max values rather than the State number values which can differ)

I am unsure if this will always solve the problem.  The more bullet proof 
approach would be to get the upstream Automatum to use List rather than Set.

Original issue reported on code.google.com by [email protected] on 26 Jul 2012 at 2:00

Attachments:

Support {,m} like {n,}

Could you support {,m} as syntatic sugar for {0,m}?
This improves the symmetry of the interface since
 {n,} is also supported.


Original issue reported on code.google.com by [email protected] on 20 Dec 2013 at 9:53

Invalid string generated from regular expression

What steps will reproduce the problem?
1. Create new Xeger as outlined in code example below.
2. Run code example.
3. Output string does not match regular expression.

public static void main(String[] arguments)
{
    SecureRandom random = SecureRandom.getInstance("SHA1PRNG", "SUN");
    random.nextBytes(new byte[1]);
    Xeger xeger = new Xeger("[m-zM-Z&&[^iolIOL]][a-zA-Z&&[^iolIOL]][0-9][a-nA-N&&[^iolIOL]][4-9]-[a-fA-F0-9]{5}-[a-zA-Z&&[^iolIOL]][4-9][a-nA-N&&[^iolIOL]][m-zM-Z&&[^iolIOL]][0-6]-[a-fA-F0-9]{5}-[a-fA-F0-9]{5}-[0-6][a-nA-N&&[^iolIOL]][a-nA-N&&[^iolIOL]][0-9][m-zM-Z&&[^iolIOL]]", random);
    System.out.println(xeger.generate());
}

What is the expected output? What do you see instead?
Expected: something like "ZZ9A9-98765-Z9AZ6-A35D8-A19CE-0EN9P" or 
"TW7G8-0FA9B-M8FN3-98765-ABC9E-1FJ8Q".

Actual: Something like "^]&]1&]7-DDADA-V]8m]&]3-2d8fe-BC2D4-6[]&]6^]" or 
"i]^]5^]7-EcEc6-^]6[]^]1-B7eEA-0eceB-3[]A]3i]".

What version of the product are you using? On what operating system?
1.0.20091017
Java 1.7.0_05
Windows 7 Professional 64-bit

If you can get this fixed in the next few days, that would be great. I 
understand, however, that it might be harder than that, in which case we'll 
just have to find something else to use. I do hope we get to use this, though.

Original issue reported on code.google.com by [email protected] on 24 Jul 2012 at 6:03

Exception expected not empty string

What steps will reproduce the problem?
1. Have an invalid pattern (e.g. (.{12})&(a{3}).
2. Ensure assertions are disabled.
3. Generate pattern based on invalid pattern.

What is the expected output? What do you see instead?
I expect an exception.
I get the empty string ("").
The empty string is however valid for some patterns (such as a*).

What version of the product are you using? On what operating system?
Latest version on windows.

Please provide any additional information below.
The patterns are not under my control: I get them at run-time.
I would like to inform the users of their incorrect pattern, but I can't check 
that! 

Original issue reported on code.google.com by [email protected] on 20 Dec 2013 at 9:51

Clean up of unneeded imports

What steps will reproduce the problem?
1. Open XegerTest or XegerUtilsTest in src/test/java/nl/flotsam/xeger
2. Read import statements

There are a couple of unneeded imports left over from developing I guess.

I'm using the revision 4 from SVN.

A patch file to fix the unneeded imports is included


Original issue reported on code.google.com by [email protected] on 20 Oct 2009 at 11:02

Attachments:

Maven GAV for Automaton doesn't match public repo version

Automaton library is publicly available in maven central repo2 
(http://repo2.maven.org/maven2/) as:

        <dependency>
            <groupId>dk.brics.automaton</groupId>
            <artifactId>automaton</artifactId>
            <version>1.11-8</version>
        </dependency>

This should clear the way to deploy xeger to central repo as well.

Original issue reported on code.google.com by [email protected] on 25 Jul 2012 at 4:58

Empty and Union

What steps will reproduce the problem?
1. make a regex containing a union with an empty string e.g. "|a" "a|" or "a||b"
2. create a Xeger object with this regex, 
3. Using the Xeger object, create an instance of this regex.

What is the expected output? What do you see instead?
The expected output is either an empty string, or a valid string from the union.
Xeger will raise a parse error or produce the wrong output: it seems '|' is 
read as a normal character.

What version of the product are you using? On what operating system?
The latest version of Xeger.
On windows 7, service pack 1.

Please provide any additional information below.
See Unit tests attached to this issue for examples and expectations (as set by 
the build-in regex matching functionality of java).

A workaround of this bug is as follows:
replace all occurrences of "|" by "()|()" before passing your regex to Xeger.

Original issue reported on code.google.com by [email protected] on 30 Jun 2014 at 6:54

Attachments:

No _released_ version of Xeger in central repo

For a project moving towards stability, it needs to eliminate using SNAPSHOT 
versions of dependencies, and as such, the Maven release plugin will not allow 
SNAPSHOT versions as dependencies. Locking down this library to a non-SNAPSHOT 
version in a central repo will make it more widely accessible to more 
users/projects as a dependency.

Original issue reported on code.google.com by [email protected] on 25 Jul 2012 at 5:05

Doesn't work for some regular expression

What steps will reproduce the problem?
1. Download included jUnit-Testcase, place in src/test/java/nl/flotsam/
xeger and run test.
2. Check the values for the tests where xeger fails

Expected output?
For every possible java regex a random string that matches the regex.

What do you see instead?
That the library only supports a certain very restricted subset of the 
possible regular expression java.util.regex.Pattern understands.

Actually it also supports regular expressions which aren't supported in 
java.

Either you should provide info on what kind of regular expressions xeger 
supports (hint:http://www.brics.dk/automaton/doc/index.html?dk/brics/
automaton/RegExp.html).

Or fix the library (extend the used automaton library?) to support the yet 
unsupported parts of the java regular expression syntax.

I'm using revision 4 from SVN and java 1.6

Original issue reported on code.google.com by [email protected] on 20 Oct 2009 at 11:28

Attachments:

maven dependency is not valid(

i use a maven plugin for intellij idea and it says it can not resolve the 
dependency, which i wrote like this:

<dependency>
    <groupId>nl.flotsam</groupId>
    <artifactId>xeger</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>

is the dependency correct? is it supposed to be working?
i did not try the maven from the command line, but i don't think this is the 
problem, cause the plugin works perfectly fine.

Original issue reported on code.google.com by [email protected] on 4 Oct 2011 at 11:02

GitHub fork

Hi Wilfred,

Thanks you for your library. It's look like you stop to support it, but it 
still used in a lot of projects. 
I found some fork of this repo on GitHub https://github.com/bluezio/xeger.
Also I found your account on GitHub :)
It looks for me better to move this project to GitHub, where anybody can fork 
and help with development. 

Unfortunately current sources are not fully mavenized and deployed to Maven 
Central.
Also there is no support of OSGI, and Antonio García fixed this in a GitHub 
fork https://github.com/bluezio/xeger/commits/master

Could you move this repo to GitHub and leave here redirect url?
Thanks

Original issue reported on code.google.com by [email protected] on 14 Aug 2013 at 7:09

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.