Detector for remove(Object) within collection iteration (concurrent modification)

View: New views
1 Messages — Rating Filter:   Alert me  

Detector for remove(Object) within collection iteration (concurrent modification)

by jan_bar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

FindBugs doesn't have detector for this bug:

public static void main( final String[] args )
{
  // just prepare some data
  ArrayList<Integer> al = new ArrayList<Integer>();
  for ( int i = 0; i < 10; i++ )
    al.add( Integer.valueOf( i ) );

  // buggy loop
  for ( Integer entry : al )//==> next(), ConcurrentModificationException
    al.remove( entry );
}

Is there some issue why this detector is not present?

Thank you, Jan



     
_______________________________________________
Findbugs-discuss mailing list
Findbugs-discuss@...
https://mailman.cs.umd.edu/mailman/listinfo/findbugs-discuss