Empty example table row values cause exception

Description

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.

Assignee

Mauro Talevi

Reporter

Frank Grimm

Labels

None

Components

Fix versions

Priority

Minor
Configure