Return an object. The object may be discarded if the pool is full.
@param e object to return
358396
public final void offer(DataDeSerializer e) {
        //discard if pool is full
        lock();
        try {
            if (count < items.length) {
                items[count++] = e;
            }
        } finally {
            unlock();
        }
    }
831622
public T get( E key )
    {
        Entry<E, T> entry = null;
        synchronized(this) {
            entry = map.get(key);
            if (map.get(key) == null)
                return null;
        
            entry.prev.next = entry.next;
            entry.next.prev = entry.prev;
            
            entry.prev = this.head;
            entry.next = this.head.next;
            this.head.next.prev = entry;
            this.head.next = entry;
        }
        
        return entry.value;
    }
918933
@Override
    public boolean offer(final E e)
    {
        // Objects.requireNonNull(e);
        if (null == e)
        {
            throw new NullPointerException();
        }
        // local load of field to avoid repeated loads after volatile reads
        final E[] buffer = producerBuffer;
        final long index = lpProducerIndex();
        final long mask = producerMask;
        final long offset = calcElementOffset(index, mask);
        // expected hot path
        if (index < producerBufferLimit)
        {
            writeToQueue(buffer, e, index, offset);
            return true;
        }
        return offerColdPath(buffer, mask, index, offset, e, null);
    }
1205428
@Override
    public Object get(int key, Object defaultValue) {
	if (key <= 0) return defaultValue;
	if (key > list.size()) return defaultValue;

	try {
	    Object rtn = list.get(key - 1);
	    if (rtn == null) {
		if (NullSupportHelper.full()) {
		    return null;
		}
		return defaultValue;
	    }
	    return rtn;
	}
	catch (Exception e) {
	    return defaultValue;
	}
    }
68763
public static void e(Throwable e) {
		messager.printMessage(Diagnostic.Kind.ERROR, "exception thrown! " + e.getMessage());
	}
746231
@Override
	public boolean offer(E e) {
		if (sizeLimit > 0 && size() >= sizeLimit){
			return false;
		}else{
			return queue.offer(e);
		}
	}
908283
public void addObject(E object){
		if(stopped==true){
			log.warn("Adding a new object ignored, the pool is stopped");
			return ;
		}

		// add to the end
		objectList.add(object);
//		if (log.isDebugEnabled()){
//			log.debug("ADD, size:'"+objectListSize()+"' "+object.hashCode()+" stopped:"+stopedThreadNumber+" "+object.toString());
//		}

		// Waits for an stoped worked before returning !!!!
		// except if this thread is a thread of the pool 
		if (!objectList.isEmpty() && stopedThreadNumber==0 && !threadMap.containsKey(Thread.currentThread().getName())){
			synchronized (threadList) {
				try {
					threadList.wait();
				} catch (InterruptedException e) {
					
				}
			}
		}
		
		synchronized (objectList) {
			objectList.notify();
		}
	}
56410
@Override
    public Object get() {

        Object oObject = null;
        getCount++;

        // Check if any are free in the free hashtable
        if (lastEntry > -1) {
            // Free array has entries, get the last one.
            // remove last one for best performance
            oObject = free[lastEntry];
            free[lastEntry] = null;
            if (lastEntry == firstEntry) { // none left in pool
                lastEntry = -1;
                firstEntry = -1;
            } else if (lastEntry > 0) {
                lastEntry = lastEntry - 1;
            } else { // last entry = 0, reset to end of list
                lastEntry = poolSize - 1;
            }
        }
        if (oObject == null)
            underflowCount++;
        if (getCurrentNumElements() < minElements)
            minElements = getCurrentNumElements();
        if ((getCount + putCount) > adjustThreshold)
            adjustPoolSize();
        if (oObject == null && factory != null) {
            oObject = factory.create();
        }
        return oObject;
    }
612599
public static RuntimeException rethrow(RequestExecutionException e) throws UnavailableException, TimedOutException
    {
        if (e instanceof RequestTimeoutException)
            throw toThrift((RequestTimeoutException)e);
        else
            throw new UnavailableException();
    }
668619
public Object getObject()
    {
        Object ret = null;
        try {
            ret =  this.proxy.getValue(this.object);
        } catch (final EFapsException e) {
            LOG.error("Catched", e);
        }
        return ret;
    }
811565
public V get(K key) throws E {
        // Quick check without locking.
        V value = mValues.get(key);
        if (value != null) {
            return value;
        }

        // Check again with key lock held.
        Lock lock = mLockPool.get(key);
        lock.lock();
        try {
            value = mValues.get(key);
            if (value == null) {
                try {
                    value = create(key);
                    mValues.put(key, value);
                } catch (Exception e) {
                    // Workaround compiler bug.
                    org.cojen.util.ThrowUnchecked.fire(e);
                }
            }
        } finally {
            lock.unlock();
        }

        return value;
    }
804444
public PoolableObject<V> getFree() {
		if (!borrowed.isEmpty()) {
			for (PoolableObject<V> bo : borrowed) {
				if (bo.isCurrentOwner())
					return bo;
			}
		}
		if (!available.isEmpty()) {
			PoolableObject<V> obj = available.remove();
			borrowed.add(obj);
			return obj;
		}
		return null;
	}
140648
public static Throwable getOriginalCause(Throwable e) {
        if (e instanceof InvocationTargetException) {
            return getOriginalCause(((InvocationTargetException) e).getTargetException());
        }
        if (e.getCause() instanceof Throwable) {
            return getOriginalCause(e.getCause());
        }
        return e;
    }
734190
public void objectTerminated(Object object, Exception e)
	{
		terminated = true;
		Assert.isTrue(object == session);
		// HotCodeReplaceManager.getDefault().removeHotCodeReplaceListener(this);
		manager.terminateThread(this);
	}
1320441
public PooledObject<T> get() {
        T data = pool.pollLast();
        if (data == null) {
            data = function.get();
        }

        return new PooledObjectImpl<>(data, pool);
    }
480501
@Override
    public Object get(Object key)
    {
        Element element = null;
        if(isAlive())
        {
            element = ehcache.get(key);
        }
        return element == null ? null : element.getObjectValue();
    }
1133869
@SuppressWarnings("unchecked")
    public static <E> E getObject(String className) {
        if (className == null) {
            return (E) null;
        }
        try {
            return (E) Class.forName(className).newInstance();
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    }