do {
......
while ( index <row.length)

Once the inner for loop ends the value of index will be greater than row.length, therefore outer do/while loop will also end.