닷지(총알피하기)만드는데 java.util.ConcurrentModificationException 이런 오류가 떠서 찾아봤더니 Iterator을 쓰라길래

 

for (bullet b : white_bullet_list) {
    if(b.tempX < 0 || b.tempX > width || b.tempY < 0 || b.tempY > height) {
     b.aim(player_x, player_y);
    }
    b.move();
    g.setColor(Color.WHITE);
    g.fillOval((int)b.tempX, (int)b.tempY, bullet_size, bullet_size);
   }

오류나는 이 부분을

 

Iterator it = white_bullet_list.iterator();
   while(it.hasNext()){
    if(b.tempX < 0 || b.tempX > width || b.tempY < 0 || b.tempY > height) {
     b.aim(player_x, player_y);
    }
    b.move();
    g.setColor(Color.WHITE);
    g.fillOval((int)b.tempX, (int)b.tempY, bullet_size, bullet_size);
   }

이렇게 바꿨더니 무한루프도는것같아요.. 뭐가틀린걸까요?