scolebourne    2003/12/06 17:15:36

  Modified:    collections/src/java/org/apache/commons/collections/bag
                        AbstractMapBag.java
  Log:
  Remove commented out code now replaced with better code
  
  Revision  Changes    Path
  1.5       +2 -53     
jakarta-commons/collections/src/java/org/apache/commons/collections/bag/AbstractMapBag.java
  
  Index: AbstractMapBag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/bag/AbstractMapBag.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractMapBag.java       3 Dec 2003 11:19:10 -0000       1.4
  +++ AbstractMapBag.java       7 Dec 2003 01:15:36 -0000       1.5
  @@ -212,58 +212,7 @@
        */
       public Iterator iterator() {
           return new BagIterator(this);
  -//        List result = new ArrayList();
  -//        Iterator i = map.keySet().iterator();
  -//        while (i.hasNext()) {
  -//            Object current = i.next();
  -//            for (int index = getCount(current); index > 0; index--) {
  -//                result.add(current);
  -//            }
  -//        }
  -//        return new BagIterator(this, result.iterator());
       }
  -
  -//    static class BagIterator implements Iterator {
  -//        private AbstractMapBag parent;
  -//        private Iterator support;
  -//        private Object current;
  -//        private int mods;
  -//        private boolean canRemove;
  -//
  -//        public BagIterator(AbstractMapBag parent, Iterator support) {
  -//            this.parent = parent;
  -//            this.support = support;
  -//            this.current = null;
  -//            this.mods = parent.modCount;
  -//            this.canRemove = false;
  -//        }
  -//
  -//        public boolean hasNext() {
  -//            return support.hasNext();
  -//        }
  -//
  -//        public Object next() {
  -//            if (parent.modCount != mods) {
  -//                throw new ConcurrentModificationException();
  -//            }
  -//            current = support.next();
  -//            canRemove = true;
  -//            return current;
  -//        }
  -//
  -//        public void remove() {
  -//            if (parent.modCount != mods) {
  -//                throw new ConcurrentModificationException();
  -//            }
  -//            if (canRemove == false) {
  -//                throw new IllegalStateException();
  -//            }
  -//            support.remove();
  -//            parent.remove(current, 1);
  -//            canRemove = false;
  -//            mods++;
  -//        }
  -//    }
   
       static class BagIterator implements Iterator {
           private AbstractMapBag parent;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to