title: java.util.ConcurrentModificationException in ArrayList processing
body: <pre><code>java.util.ConcurrentModificationException
  at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
  at java.util.AbstractList$Itr.next(AbstractList.java:343)
  at com.alpha.beta.purchasing.item.VendorItemList.loadItems(VendorItemList.java:51)
  at com.alpha.beta.purchasing.Shipment.loadItems(Shipment.java:1006)
  at com.alpha.beta.purchasing.Shipment.loadItems(Shipment.java:953)
  at com.alpha.beta.purchasing.Shipment.getItemTotal(Shipment.java:1503)
  at com.alpha.beta.purchasing.Shipment.getShipmentTotal(Shipment.java:854)
  at com.alpha.beta.quickreports.PurchasingGenericListSourceMapper.fillPurchaseReceivingItemListForQuickReportsTask(PurchasingGenericListSourceMapper.java:144)
  at com.alpha.beta.quickreports.PurchasingGenericListSourceMapper$2.run(PurchasingGenericListSourceMapper.java:105)
  at java.util.TimerThread.mainLoop(Timer.java:512)
  at java.util.TimerThread.run(Timer.java:462)
  </code></pre>
  
  <p>I am getting above mentioned Exception and source code is below:</p>
  
  <pre><code>public void loadItems(ArrayList list) {
      if(list != null &amp;&amp; list.size() &gt; 0) {
          super.clear();
          Iterator iterator = list.iterator();
          while(iterator.hasNext()) {
              // VendorItem item = (VendorItem)iterator.next();
              //load(new Integer(item.getVendorItemId()), item);
  
              Object obj = iterator.next(); // &lt;&lt; This is where it says exception comes
              if(obj instanceof InvoiceItem) {
                  InvoiceItem item = (InvoiceItem)obj;
                  load(new Integer(item.getInvoiceItemId()), item);
                  //logger.debug("** loading invoice Item " + item.toString());
              }
              else if(obj instanceof PurchaseOrderItem) {
                  PurchaseOrderItem item = (PurchaseOrderItem)obj;
                  load(new Integer(item.getPoItemId()), item);
                  //logger.debug("** loading PO Item " + item.toString());
              }
              else if(obj instanceof ShipmentItem) {
                  ShipmentItem item = (ShipmentItem)obj;
                  load(new Integer(item.getShipmentItemId()), item);
                  logger.debug("** loading ShipmentItem Item " + item.toString());
              }
              //
              else if(obj instanceof VendorItem) {
                  VendorItem item = (VendorItem)obj;
                  load(new Integer(item.getVendorItemId()), item);
                  logger.debug("** loading VendorItem " + item.toString());
              }
              //
              else {
                  logger.debug("*** neither invoice/PO/shipment item");
              }
          }
      }
  
  }
  </code></pre>
  
  <p>I have seen the related questions but they doesn't meet my scenario so i was hoping that if someone can point out the real cause why this is happening.</p>