Empty example table row causes exception
----------------------------------------

                 Key: JBEHAVE-353
                 URL: http://jira.codehaus.org/browse/JBEHAVE-353
             Project: JBehave
          Issue Type: Bug
          Components: Core
         Environment: JBehave core 3.0.2
            Reporter: Frank Grimm
            Priority: Minor


Given the following example table:

|C1|C2|C3|
||||

JBehave fails to parse the table. It reports the following error:

|C1|C2|C3|
|||| (FAILED)
(java.lang.IndexOutOfBoundsException: Index: 0, Size: 0)

The stack trace reads:

Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.RangeCheck(ArrayList.java:547)
        at java.util.ArrayList.remove(ArrayList.java:387)
        at 
org.jbehave.core.model.ExamplesTable.columnsFor(ExamplesTable.java:76)
        at org.jbehave.core.model.ExamplesTable.parse(ExamplesTable.java:60)
        at org.jbehave.core.model.ExamplesTable.<init>(ExamplesTable.java:48)
        at 
org.jbehave.core.steps.ParameterConverters$ExamplesTableConverter.convertValue(ParameterConverters.java:328)
        at 
org.jbehave.core.steps.ParameterConverters.convert(ParameterConverters.java:68)
        at 
org.jbehave.core.steps.StepCreator.convertParameters(StepCreator.java:253)
        at org.jbehave.core.steps.StepCreator.access$1100(StepCreator.java:25)
        at 
org.jbehave.core.steps.StepCreator$5.parametriseStep(StepCreator.java:161)
        at org.jbehave.core.steps.StepCreator$5.perform(StepCreator.java:129)
        at 
org.jbehave.core.embedder.StoryRunner$FineSoFar.run(StoryRunner.java:189)
        at org.jbehave.core.embedder.StoryRunner.runSteps(StoryRunner.java:174)
        at 
org.jbehave.core.embedder.StoryRunner.runScenarioSteps(StoryRunner.java:162)
        at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:84)
        at org.jbehave.core.embedder.StoryRunner.run(StoryRunner.java:62)
        at 
org.jbehave.core.embedder.Embedder.runStoriesAsPaths(Embedder.java:160)
        ... 43 more

Parsing the table works fine if the last row contains at least one space in one 
of the cells. So

|C1|C2|C3|
||| |

and


|C1|C2|C3|
||||
|| ||

works fine.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to