[
https://issues.apache.org/jira/browse/ODFTOOLKIT-442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Raimund Hölle updated ODFTOOLKIT-442:
-------------------------------------
Description:
Calling next() of the iterator Table.getRowIterator() delivers the same row
repeatedly if no prior call of hasNext() occurs.
Given a spreadsheet with these rows:
row0
row1
row2
Then the code below delivers the following:
row0
row1
row1
Iterator<Row> rowIter = table.getRowIterator();
for (int n = 0; n < table.getRowCount(); n++) {
Row = rowIter.next();
...
}
In some complex scenarios such usage of an iterator may occur (e. g., when
querying several iterators in parallel for comparing two sheets).
SimpleRowIterator should work as any other iterators, hasNext() shouldn't have
any side effects.
The appended patch contains a test class for the problem and a fix.
was:
Calling next() of the iterator Table.getRowIterator() delivers the same row
repeatedly if no prior call of hasNext() occurs.
Given a spreadsheet with the following rows:
row0
row1
row2
Then the following code delivers the following:
row0
row1
row1
Iterator<Row> rowIter = table.getRowIterator();
for (int n = 0; n < table.getRowCount(); n++) {
Row = rowIter.next();
...
}
In some complex scenarios such usage of an iterator may occur (e. g., when
querying several iterators in parallel for comparing to sheets).
SimpleRowIterator should work as any other iterators, hasNext() shouldn't have
any side effects.
The appended patch contains a test class for the problem and a fix.
> Table.getRowIterator() out of sync without calling hasNext()
> ------------------------------------------------------------
>
> Key: ODFTOOLKIT-442
> URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-442
> Project: ODF Toolkit
> Issue Type: Bug
> Components: simple api
> Affects Versions: 0.6.2-incubating
> Reporter: Raimund Hölle
> Priority: Minor
>
> Calling next() of the iterator Table.getRowIterator() delivers the same row
> repeatedly if no prior call of hasNext() occurs.
> Given a spreadsheet with these rows:
> row0
> row1
> row2
> Then the code below delivers the following:
> row0
> row1
> row1
> Iterator<Row> rowIter = table.getRowIterator();
> for (int n = 0; n < table.getRowCount(); n++) {
> Row = rowIter.next();
> ...
> }
> In some complex scenarios such usage of an iterator may occur (e. g., when
> querying several iterators in parallel for comparing two sheets).
> SimpleRowIterator should work as any other iterators, hasNext() shouldn't
> have any side effects.
> The appended patch contains a test class for the problem and a fix.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)