A container being iterated by an “enhanced” for ( : )
loop can’t change it’s size().
Use a vanilla for ( ; ; )
loop instead:
for (int len = cell.size(), i = 0; i < len; ++i)
if (cell.get(i).overlap()) cell.add(new Cell());
A container being iterated by an “enhanced” for ( : )
loop can’t change it’s size().
Use a vanilla for ( ; ; )
loop instead:
for (int len = cell.size(), i = 0; i < len; ++i)
if (cell.get(i).overlap()) cell.add(new Cell());