Skip to content

AllPathPermutationsGenerator() causes nullPointerException if no StopCondition is added as constructor argument #17

@bengchuan

Description

@bengchuan

I have the model to use AllPathPermutationsGenerator() as such:

   modelhandler.add("test", new TestModel(file, true, new AllPathPermutationsGenerator(), true));

I got the following error when trying to run it:

2014-02-18 15:22:10,147 [Thread-0] ERROR org.graphwalker.Util - java.lang.NullPointerException
    at org.graphwalker.generators.PathGenerator.hasNext(PathGenerator.java:44)
    at org.graphwalker.ModelBasedTesting.hasNextStep(ModelBasedTesting.java:396)

This is caused by a the code in org.graphwalker.generators.PathGenerator:

43  public boolean More ...hasNext() {
44    return !stopCondition.isFulfilled();
45  }

stopCondition variable is not initialised when we use AllPathPermutationsGenerator without argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions