remove the object from the inUse before normal release processing
would remove it. To be used in when some other code knows that
leaving it in the InUse table would create false-positive leak
detection hits.

@param o
482900
public void removeFromInUse(Object o) {
        if (null == o) {
            throw new NullPointerException();
        }

        if (inUseTracking) {
            inUseTable.remove(o);
        }
    }
389543
@Override
    public final boolean remove(Object o) {
        // Short circuit using read-lock
        if (this.isEmpty()) {
            return false;
        }

        @SuppressWarnings("unchecked")
        final K key = this.getElementKey((T) o);
        final Queue<T> queue = this.keyedQueues.get(key);
        if (queue == null) {
            return false;
        }

        this.writeLock.lock();
        try {
            final boolean removed = queue.remove(o);
            if (removed) {
                this.size--;
                this.notFull.signal();
            }
            return removed;
        } finally {
            this.writeLock.unlock();
        }
    }
484823
private boolean internalRemove(Object o, boolean publicApi) {

        if (!contains(o)) return false;

        // todo: for multithreaded usage this block needs to be synchronized
        BeanContextChild bcc = null;
        if (o instanceof BeanContextProxy) {
            bcc = ((BeanContextProxy) o).getBeanContextProxy();
        }
        else if (o instanceof BeanContextChild) {
            bcc = (BeanContextChild) o;
        }

        if (bcc != null) {

            /*
             If remove invoked as a result of the BeanContext receiving an unexpected PropertyChangeEvent
             notification as a result of a 3rd party invoking setBeanContext() then the remove implementation
             shall not invoke setBeanContext(null) on that child as part of the remove() semantics, since
             doing so would overwrite the value previously set by the 3rd party.
            */
            if (publicApi) {

                // remove the property/veto listeners -- we know we want to remove the bean
                // and don't need to be notified if we have initiated the removal
                bcc.removePropertyChangeListener("beanContext", _childPcl);
                bcc.removeVetoableChangeListener("beanContext", _childVcl);

                try {
                    bcc.setBeanContext(null);
                }
                catch (PropertyVetoException e) {
                    // rewire the listeners we removed above then except
                    bcc.addPropertyChangeListener("beanContext", _childPcl);
                    bcc.addVetoableChangeListener("beanContext", _childVcl);
                    throw new IllegalStateException(e);
                }
            }
        }

        if (o instanceof BeanContextMembershipListener) {
            removeBeanContextMembershipListener((BeanContextMembershipListener) o);
        }

        BCChild bc = _children.get(o);
        if (bc.isProxy()) {
            _children.remove(bc.getChild());
        }
        else if (bc.hasProxy()) {
            _children.remove(bc.getProxy());
        }
        _children.remove(o);

        BeanContextMembershipEvent bcme = new BeanContextMembershipEvent((BeanContext) getPeer(), new Object[]{o});
        fireMembershipEvent(bcme, false);
        // end synchronized block
        return true;
    }
215350
function releaseObject(object) {
    object.criteria = object.value = null;
    if (objectPool.length < MAX_POOL_SIZE) {
      objectPool.push(object);
    }
  }
504590
public void remove(Object pKey)
    {
        Identity id;
        if(pKey instanceof Identity)
        {
            id = (Identity) pKey;
        }
        else
        {
            id = transaction.getBroker().serviceIdentity().buildIdentity(pKey);
        }
        mhtObjectEnvelopes.remove(id);
        mvOrderOfIds.remove(id);
    }
1243187
@Override
  public void delete(ApiType obj) {
    String key = keyFunc.apply(obj);
    lock.lock();
    try {
      boolean exists = this.items.containsKey(key);
      if (exists) {
        this.deleteFromIndices(this.items.get(key), key);
        this.items.remove(key);
      }
    } finally {
      lock.unlock();
    }
  }
1187530
@Override
    public boolean remove(Object o) {

        if (o == null) {
            return false;
        }

        if (size() == 0) {
            return false;
        }

        synchronized (this) {
            //First check the expedited buffer
            synchronized (lock) {
                //Check if we wrap around the end of the array before iterating
                if (expeditedPutIndex > expeditedTakeIndex) {
                    for (int i = expeditedTakeIndex; i <= expeditedPutIndex; i++) {
                        if (o.equals(expeditedBuffer[i])) {
                            //Remove element and shift all remaining elements
                            for (int j = i; j < expeditedPutIndex; j++) {
                                expeditedBuffer[j] = expeditedBuffer[j + 1];
                            }
                            //Null the putIndex
                            expeditedBuffer[expeditedPutIndex] = null;
                            expeditedPutIndex--;

                            //Decrement used slots counter
                            numberOfUsedExpeditedSlots.getAndDecrement();

                            //TODO if expedited is added for put or offer with timeout add notification here

                            return true;
                        }
                    }
                } else {
                    //We wrap around the array. Loop through in two passes(upper and lower)
                    for (int i = expeditedTakeIndex; i < expeditedBuffer.length; i++) {
                        if (o.equals(expeditedBuffer[i])) {
                            //Remove element and shift all remaining elements up
                            for (int j = i; j > expeditedTakeIndex; j--) {
                                expeditedBuffer[j] = expeditedBuffer[j - 1];
                            }
                            //Null the putIndex
                            expeditedBuffer[expeditedTakeIndex] = null;
                            if (expeditedTakeIndex == expeditedBuffer.length - 1) {
                                expeditedTakeIndex = 0;
                            } else {
                                expeditedTakeIndex++;
                            }

                            //Decrement used slots counter
                            numberOfUsedExpeditedSlots.getAndDecrement();

                            //TODO if expedited is added for put or offer with timeout add notification here

                            return true;
                        }
                    }
                    for (int i = 0; i < expeditedPutIndex; i++) {
                        if (o.equals(expeditedBuffer[i])) {
                            //Remove element and shift all remaining elements down
                            for (int j = i; j < expeditedPutIndex; j++) {
                                expeditedBuffer[j] = expeditedBuffer[j + 1];
                            }
                            //Null the putIndex
                            expeditedBuffer[expeditedPutIndex] = null;
                            expeditedPutIndex--;

                            //Decrement used slots counter
                            numberOfUsedExpeditedSlots.getAndDecrement();

                            //TODO if expedited is added for put or offer with timeout add notification here

                            return true;
                        }
                    }
                }

                //Next check the main buffer
                //Check if we wrap around the end of the array before iterating
                if (putIndex > takeIndex) {
                    for (int i = takeIndex; i <= putIndex; i++) {
                        if (o.equals(buffer[i])) {
                            //Remove element and shift all remaining elements
                            for (int j = i; j < putIndex; j++) {
                                buffer[j] = buffer[j + 1];
                            }
                            //Null the putIndex
                            buffer[putIndex] = null;
                            putIndex--;

                            //Decrement used slots counter
                            numberOfUsedSlots.getAndDecrement();

                            //Notify a waiting put thread that space has cleared
                            notifyPut_();

                            return true;
                        }
                    }
                } else {
                    //We wrap around the array. Loop through in two passes(upper and lower)
                    for (int i = takeIndex; i < buffer.length; i++) {
                        if (o.equals(buffer[i])) {
                            //Remove element and shift all remaining elements up
                            for (int j = i; j > takeIndex; j--) {
                                buffer[j] = buffer[j - 1];
                            }
                            //Null the putIndex
                            buffer[takeIndex] = null;
                            if (takeIndex == buffer.length - 1) {
                                takeIndex = 0;
                            } else {
                                takeIndex++;
                            }

                            //Decrement used slots counter
                            numberOfUsedSlots.getAndDecrement();

                            //Notify a waiting put thread that space has cleared
                            notifyPut_();

                            return true;
                        }
                    }
                    for (int i = 0; i < putIndex; i++) {
                        if (o.equals(buffer[i])) {
                            //Remove element and shift all remaining elements down
                            for (int j = i; j < putIndex; j++) {
                                buffer[j] = buffer[j + 1];
                            }
                            //Null the putIndex
                            buffer[putIndex] = null;
                            putIndex--;

                            //Decrement used slots counter
                            numberOfUsedSlots.getAndDecrement();

                            //Notify a waiting put thread that space has cleared
                            notifyPut_();

                            return true;
                        }
                    }
                }
            }
        }
        return false;
    }
889007
function(object) {
            this.map.remove(object.x, object.y);
            var index = this.objects.indexOf(object);
            this.objects.splice(index, 1);
            if(object.onRemove){
                object.onRemove();
            }
        }
611825
public boolean remove(O object) {
		Integer multiplicity = multiplicities.get(object);
		if (multiplicities.remove(object) == null) {
			return false;
		}
		decMultiplicityCount(multiplicity);
		return true;
	}
724627
public Object remove(Object key)
    {
        synchronized (objects)
        {
            Object remove = objects.remove(key);
            objectTimeStamps.remove(key);
            if (remove != null)
            {
                findNextExpireTime();
            }
            return remove;
        }
    }
1321182
@Override
  public V remove(Object o) {
    checkMutable();
    @SuppressWarnings("unchecked")
    final K key = (K) o;
    final int index = binarySearchInArray(key);
    if (index >= 0) {
      return removeArrayEntryAt(index);
    }
    // overflowEntries might be Collections.unmodifiableMap(), so only
    // call remove() if it is non-empty.
    if (overflowEntries.isEmpty()) {
      return null;
    } else {
      return overflowEntries.remove(key);
    }
  }
802555
void remove(T obj) {
        _queue.remove(obj);
        if (_prioritize == obj) {
            _prioritize = null;
        }
    }
1157261
boolean removeMapping(Object o) {
        if (!(o instanceof Map.Entry))
            return false;
        Entry<K,V>[] tab = getTable();
        Map.Entry<?,?> entry = (Map.Entry<?,?>)o;
        Object k = maskNull(entry.getKey());
        int h = sun.misc.Hashing.singleWordWangJenkinsHash(k);
        int i = indexFor(h, tab.length);
        Entry<K,V> prev = tab[i];
        Entry<K,V> e = prev;

        while (e != null) {
            Entry<K,V> next = e.next;
            if (h == e.hash && e.equals(entry)) {
                modCount++;
                size--;
                if (prev == e)
                    tab[i] = next;
                else
                    prev.next = next;
                return true;
            }
            prev = e;
            e = next;
        }

        return false;
    }
944906
public void clear(Object key) {
		Object removed;
		if (isCachingEnabled()) {
			synchronized (mirror) {
				synchronized (data) {
					removed = data.remove(key);
					mirror.remove(key);
				}
			}
			System.out.println(new LogEntry("object with key " + key + (removed == null ? " NOT" : "") + " removed from cache"));
		}
	}
1114090
public void removeLockedObject() {
        if (this != resourceLocks.root && !this.getPath().equals("/")) {

            int size = parent.children.length;
            for (int i = 0; i < size; i++) {
                if (parent.children[i].equals(this)) {
                    LockedObject[] newChildren = new LockedObject[size - 1];
                    for (int i2 = 0; i2 < (size - 1); i2++) {
                        if (i2 < i) {
                            newChildren[i2] = parent.children[i2];
                        } else {
                            newChildren[i2] = parent.children[i2 + 1];
                        }
                    }
                    if (newChildren.length != 0) {
                        parent.children = newChildren;
                    } else {
                        parent.children = null;
                    }
                    break;
                }
            }

            // removing from hashtable
            resourceLocks.locksByID.remove(getID());
            resourceLocks.locks.remove(getPath());

            // now the garbage collector has some work to do
        }
    }
948973
def delete_object(self, obj):
        """"""
        if _debug: Application._debug("delete_object %r", obj)

        # extract the object name and identifier
        object_name = obj.objectName
        object_identifier = obj.objectIdentifier

        # delete it from the application
        del self.objectName[object_name]
        del self.objectIdentifier[object_identifier]

        # remove the object's identifier from the device's object list
        # if there is one and it has an object list property
        if self.localDevice and self.localDevice.objectList:
            indx = self.localDevice.objectList.index(object_identifier)
            del self.localDevice.objectList[indx]

        # make sure the object knows it's detached from an application
        obj._app = None
978174
@Override
	public void writeObject(Object o)
	{
		synchronized (this)
		{
			ArrayList<Object> prePending = objPrePendingCache.get(o);
			if (prePending == null)
			{
				boolean oldWritingObject = writingObject;
				writingObject = true;
				try
				{
					super.writeObject(o);
				}
				finally
				{
					writingObject = oldWritingObject;
				}
			}
			else
			{
				flushPrePending.clear();
				flushPrePending.addAll(prePending);
			}

			// root object
			if (!writingObject)
			{
				boolean isNotCached = prePending == null;
				// is not cached, add to cache
				if (isNotCached && o != null)
				{
					prePending = new ArrayList<Object>();
					prePending.addAll(flushPrePending);
					objPrePendingCache.put(o, prePending);
				}

				// add to pending
				flushPending.addAll(flushPrePending);
				flushPendingStat.addAll(flushPrePending);
				flushPrePending.clear();

				if (isNotCached && flushPending.contains(o))
				{
					flushPendingStat.remove(o);
				}
				else
				{
					flushPending.add(o);
				}
				if (needOwner)
				{
					this.flushPending.remove(owner);
					this.flushPending.add(0, owner);
				}
			}
		}
	}