FSchumacher commented on code in PR #6694:
URL: https://github.com/apache/jmeter/pull/6694#discussion_r3119629628
##########
src/functions/src/main/java/org/apache/jmeter/functions/FileRowColContainer.java:
##########
@@ -119,13 +120,18 @@ public String getColumn(int row, int col) throws
IndexOutOfBoundsException {
*
*/
public int nextRow() {
- int row = nextRow;
- nextRow++;
- if (nextRow >= fileData.size()) {// 0-based
- nextRow = 0;
+ int size = fileData.size();
+ if (size <= 0) {
+ throw new IllegalStateException("CSV file has no data rows");
+ }
+ while (true) {
+ int current = nextRow.get();
+ int next = (current + 1) % size;
Review Comment:
Nothing wrong with the zero per se, but it should have been the 55 in the
example I gave.
And we still would have the other problem, that we would have to either
decrement the value before returning or start with -1 and look at other uses of
nextRow, which doesn't feel right to me, either.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]