Remove the object o from the list l. Different from l.remove(o)
because this method only removes it if it is the same object
@param l the list to remove from
@param o the object to remove
@return removed object if it was found in the list, null otherwise
548942
public static Object removeReference(List l, Object o) {
    Iterator iter = l.iterator();
    while (iter.hasNext()) {
      Object no = iter.next();
      if (no == o) {
        iter.remove();
        return o;
      }
    }
    return null;
  }
631992
public void removeListener(EventListener l) {
        if (l == null) {
            throw new NullPointerException();
        }
        synchronized (notifyLock) {
            if (listeners != null) {
                // identity equality check
                Iterator<EventListener> iter = listeners.iterator();
                while (iter.hasNext()) {
                    if (iter.next() == l) {
                        iter.remove();
                        if (listeners.size() == 0) {
                            listeners = null;
                        }
                        return;
                    }
                }
            }
        }
    }
1131101
public final Object removeOne()
    {
        // Avoid locking the whole Map by looking at the subMaps indivdually starting at a
        // random point in the sequence.
        int index = new java.util.Random(Thread.currentThread().hashCode()).nextInt(subMaps.length);
        int firstIndex = index;
        Object removedObject = null;
        do {
            java.util.Map subMap = subMaps[index];
            synchronized (subMap) {
                if (!subMap.isEmpty()) {
                    java.util.Iterator iterator = subMap.values()
                                    .iterator();
                    removedObject = iterator.next();
                    iterator.remove();

                    break;
                } // if (freeTransactions.isEmpty()).
            } // synchronized (subMap).

            index++;
            if (index == subMaps.length)
                index = 0;
        } while (index != firstIndex);

        return removedObject;
    }
755785
protected Object removeObject(Object objectKey, boolean removeRow) {

        if (objectKey == null) {
            return null;
        }

        int    hash        = objectKey.hashCode();
        int    index       = hashIndex.getHashIndex(hash);
        int    lookup      = hashIndex.hashTable[index];
        int    lastLookup  = -1;
        Object returnValue = null;

        for (; lookup >= 0;
                lastLookup = lookup,
                lookup = hashIndex.getNextLookup(lookup)) {
            if (objectKeyTable[lookup].equals(objectKey)) {
                objectKeyTable[lookup] = null;

                hashIndex.unlinkNode(index, lastLookup, lookup);

                if (isObjectValue) {
                    returnValue              = objectValueTable[lookup];
                    objectValueTable[lookup] = null;
                }

                if (removeRow) {
                    removeRow(lookup);
                }

                return returnValue;
            }
        }

        // not found
        return returnValue;
    }
1194910
@Override
    public void discard(Object o)
    {
        BeanO beanO = (BeanO) o;
        beanO.destroy();
    }
587429
private void remove(Class<?> type, Object object)
    {
        final Set<?> set = items.get(type);
        if (set != null)
        {
            set.remove(object);
        }
    }
21047
public T remove(long seqno) {
        lock.lock();
        try {
            if(seqno < low || seqno > high)
                return null;
            int index=index(seqno);
            T retval=buffer[index];
            if(retval != null && removes_till_compaction > 0)
                num_removes++;
            buffer[index]=null;
            if(seqno == low)
                advanceLow();
            if(removes_till_compaction > 0 && num_removes >= removes_till_compaction) {
                _compact();
                num_removes=0;
            }
            return retval;
        }
        finally {
            lock.unlock();
        }
    }
1191632
@SuppressWarnings("unchecked")
  public static <T> T as(Object o) {
    return o == null ? null : (T) o;
  }
569511
public V remove (int key)
    {
        Record<V> removed = removeImpl(key, true);
        return (removed == null) ? null : removed.value;
    }
1343365
@Override
    public boolean remove(Object o) {
        IAtomContainer atomContainer = (IAtomContainer) o;

        // we should never have a null conformer
        if (atomContainer == null) return false;

        int index = indexOf(atomContainer);
        if (index >= 0) {
            remove(index);
            return true;
        }
        return false;
    }
1234954
public void detach(Object ob)
    {
        Iterator<Map.Entry<String, List<InstanceMethod>>> ki = map.entrySet().iterator();
        while (ki.hasNext())
        {
            Map.Entry<String, List<InstanceMethod>> entry = ki.next();
            Iterator<InstanceMethod> li = entry.getValue().iterator();
            while (li.hasNext())
            {
                InstanceMethod im = li.next();
                if (im.instance.equals(ob))
                {
                    li.remove();
                }
            }
            if (entry.getValue().isEmpty())
            {
                ki.remove();
            }
        }
    }
954443
protected static Object clear (
        EqualityComparator eqc, Object[] list, Object element)
    {
        int dex = indexOf(eqc, list, element);
        if (dex == -1) {
            return null;
        }
        Object elem = list[dex];
        list[dex] = null;
        return elem;
    }
919868
public final synchronized void removeListener(EventListener l) {
        if(l ==null) {
            throw new IllegalArgumentException("Listener " + l +
                                               " is null");
        }

        // Is l on the list?
        int index = -1;
        for(int i = listeners.length-1; i>=0; i--) {
            if(listeners[i].equals(l) == true) {
                index = i;
                break;
            }
        }

        // If so,  remove it
        if(index != -1) {
            EventListener[] tmp = new EventListener[listeners.length-1];
            // Copy the list up to index
            System.arraycopy(listeners, 0, tmp, 0, index);
            // Copy from two past the index, up to
            // the end of tmp (which is two elements
            // shorter than the old list)
            if(index < tmp.length)
                System.arraycopy(listeners, index+1, tmp, index, 
                                 tmp.length - index);
            // set the listener array to the new array or null
            listeners = (tmp.length == 0) ? EMPTY_LISTENERS : tmp;
        }
    }
175373
public Object remove(Object key)
	{
		synchronized(this)
		{
			if (size > 0) // check current size before trying remove
			{
				Object obj =  super.remove(key);
				size = super.size();
				return obj;
			}
			return null;
		}
	}
796565
public Object remove(Object key)
    {
        Object retVal = null;

        if (null == key) throw new IllegalArgumentException("key must not be null");
        if (this.containsKey(key))
        {
            retVal = super.remove(key);

            for (int i = 0; i < this.order.size(); i++)
            {
                Object obj = this.order.get(i);
                if (obj.equals(key))
                {
                    this.order.remove(i);
                    break;
                }
            }
        }
        return retVal;
    }
1322653
public Object remove(int index) {

        if (index >= elementCount) {
            throw new IndexOutOfBoundsException("Index out of bounds: "
                                                + index + " >= "
                                                + elementCount);
        }

        if (index < 0) {
            throw new IndexOutOfBoundsException("Index out of bounds: "
                                                + index + " < 0");
        }

        Object removedObj = elementData[index];

        for (int i = index; i < elementCount - 1; i++) {
            elementData[i] = elementData[i + 1];
        }

        elementCount--;

        if (elementCount == 0) {
            clear();
        } else {
            elementData[elementCount] = null;
        }

        return removedObj;
    }
669027
public void release(Object o)
    {
        synchronized(this)
        {
            usedPool.remove(o);
            freePool.add(o);
            notify();
        }
    }