Vector.removeAllElements() no concurrent modification detect

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 1.4.0
    • Affects Version/s: 1.2.1
    • Component/s: core-libs
    • beta
    • generic
    • generic
    • Verified



      Name: clC74495 Date: 12/09/99


      import java.util.*;
      public class testmod {
        Vector thevec;

        public testmod() {
          thevec = new Vector();
          thevec.addElement(null); // add one element to the vector
        }

        public void test()
        {
          Iterator it = thevec.iterator();
          thevec.removeAllElements(); // delibrate modification
          try {
            it.next();
          }
          catch (ConcurrentModificationException e1) {
            System.out.println("OK");
          }
          catch (Exception e2) {
            System.out.println("wrong exception");
          }
        }
        public static void main(String[] args) {
          testmod obj = new testmod();
          obj.test();
        }
      }
      (Review ID: 98801)
      ======================================================================

            Assignee:
            Josh Bloch (Inactive)
            Reporter:
            Carlos Lucasius (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: