Ends the data swap phase<p />

While out of the data swap phase, using {@link PhasedHeapFriendlyHashMap#put(Object, Object)}
will throw an {@link IllegalStateException} <p />
425015
public void endDataSwapPhase(){

        if (nextMap == null) {
            throw new IllegalStateException("Cannot call PhasedHeapFriendlyHashMap.endDataSwapPhase(), not currently in data swap phase");
        }

        HeapFriendlyHashMap<K, V> temp = currentMap;

        currentMap = nextMap;
        nextMap = null;

        temp.releaseObjectArrays();

        recycler.clearNextCycleObjectArrays();
    }
394416
@Override
    public void put(int index, Scriptable start, Object value)
    {
        if (externalData != null) {
            if (index < externalData.getArrayLength()) {
                externalData.setArrayElement(index, value);
            } else {
                throw new JavaScriptException(
                    ScriptRuntime.newNativeError(Context.getCurrentContext(), this,
                                                 TopLevel.NativeErrors.RangeError,
                                                 new Object[] { "External array index out of bounds " }),
                    null, 0);
            }
            return;
        }

        if (putImpl(null, index, start, value))
            return;

        if (start == this) throw Kit.codeBug();
        start.put(index, start, value);
    }
332950
public static void store(final long pointer,
                             final Object object) {
        final Object oldValue = MAPPED_OBJECTS.put(pointer,
                                                   object);
        if (oldValue != null) {
            //put it back!
            MAPPED_OBJECTS.put(pointer,
                               oldValue);
            throw new IllegalStateException(String.format("Can not re-map existing pointer.\n" +
                                                          "Pointer=%s\n" +
                                                          "old value=%s" +
                                                          "\nnew value=%s",
                                                          pointer,
                                                          oldValue,
                                                          object));
        }
    }
91729
public void stop() throws IllegalStateException {
        if (log.isDebugEnabled()) {
            log.debug("stop - subscriber stream state: {}", (subscriberStream != null ? subscriberStream.getState() : null));
        }
        // allow stop if playing or paused
        switch (subscriberStream.getState()) {
            case PLAYING:
            case PAUSED:
                subscriberStream.setState(StreamState.STOPPED);
                IMessageInput in = msgInReference.get();
                if (in != null && !pullMode) {
                    in.unsubscribe(this);
                    msgInReference.set(null);
                }
                subscriberStream.onChange(StreamState.STOPPED, currentItem.get());
                clearWaitJobs();
                cancelDeferredStop();
                if (subscriberStream instanceof IPlaylistSubscriberStream) {
                    IPlaylistSubscriberStream pss = (IPlaylistSubscriberStream) subscriberStream;
                    if (!pss.hasMoreItems()) {
                        releasePendingMessage();
                        sendCompleteStatus();
                        bytesSent.set(0);
                        sendStopStatus(currentItem.get());
                        sendClearPing();
                    } else {
                        if (lastMessageTs > 0) {
                            // remember last timestamp so we can generate correct headers in playlists.
                            timestampOffset = lastMessageTs;
                        }
                        pss.nextItem();
                    }
                }
                break;
            case CLOSED:
                clearWaitJobs();
                cancelDeferredStop();
                break;
            case STOPPED:
                log.trace("Already in stopped state");
                break;
            default:
                throw new IllegalStateException(String.format("Cannot stop in current state: %s", subscriberStream.getState()));
        }
    }
660750
private void put(Object obj, XmlParser.Node node) throws NoSuchMethodException,
            ClassNotFoundException, InvocationTargetException, IllegalAccessException
    {
        if (!(obj instanceof Map))
                throw new IllegalArgumentException("Object for put is not a Map: " + obj);
        Map map = (Map) obj;

        String name = node.getAttribute("name");
        Object value = value(obj, node);
        map.put(name, value);
        if (log.isDebugEnabled()) log.debug(obj + ".put(" + name + "+" + value + ")");
    }
521481
public void finish() throws IOException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
        { // 306998.15
            Tr.debug(tc, "finish");
        }

        if (length == -1 && total != 0)
            length = total;

        //PM71666 - DBCS and application calls out.close(), the length set here is not correct (depending on # of bytes for each character)
        //          It will be more length by the time the data is encoded by the JDK sun.nio.cs.StreamEncoder, so more bytes are
        //          sent to client than specified in content-length.  Those extra will be dropped by the client without any exception.
        if (WCCustomProperties.SET_CONTENT_LENGTH_ON_CLOSE){
            if (!committed)
            {
                // first write on the close/finish path should set an explicit
                // content-length if we can
                if (!_hasFlushed && obs != null)
                {
                    if (!this.response.isCommitted())
                    {
                        setContentLengthHeader(length);
                    }
                    _hasFlushed = true;
                    obs.alertFirstFlush();
                }
                committed = true;
            }
        } //PM71666
        flush();
    }
997370
public boolean put(T object) {
        if (object == null) {
            throw new IllegalArgumentException("returning null object to pool");
        }

        while (true) {
            // 1. get the index of the next free cell
            int g = m_get.get();
            int p = m_put.get();
            if (p >= LIMIT) {
                // this happens very seldom - once every 1**31 calls, the put
                // index completes a full cycle.
                // to handle this simply, we just wait for the pool to
                // drain, and start placing objects back in the pool only when
                // the get index completes its cycle too.
                return false;
            }
            if (p - g >= (m_arraySize - 1)) {
                // put index is far from the get pointer, implying full pool.
                // note that (p >= g + m_capacity) is a bug.
                return false;
            }

            // 2. conquer this cell by incrementing the put index
            if (!m_put.compareAndSet(p, p + 1)) {
                // some other thread got here first. try again.
                continue;
            }

            // 3. put the object in the cell
            int index = p % m_arraySize;
            AtomicReference<T> reference = m_array[index];
            if (reference.compareAndSet(null, object)) {
                return true;
            }

            // getting here is rare. the object that was supposedly conquered
            // locally was replaced with a different object in the same cell.
        }
    }
913516
@Override
    public void endDocument() throws SAXException {

        LOG.info("Content Processing finished, saving...");
        try {
            this.session.save();
        } catch (final RepositoryException e) {
            throw new AssertionError("Saving failed", e);
        }
        if (LOG.isInfoEnabled()) {
            LOG.info("Content imported in {} ms", (System.nanoTime() - this.startTime) / 1_000_000);
            LOG.info("END ContentImport");
        }
    }
789235
@Override
    public void commit() throws DataCorruptedException, IOException, IllegalStateException
    {
        try {
            this.txContext.finish();
        } catch (final TransactionFailureException tfe1) {
            try {
                this.txContext.abort();
            } catch (final TransactionFailureException tfe2) {
            }
            throw new IOException("Error trying to commit transaction.", tfe1);
        }
    }
864504
@Override
	// @NotThreadSafe
	public void put(long position, byte value) throws IOException {
		int bufferNum = getBufferNum(position);
		mappedBuffers.get(bufferNum).put(getIndex(position), value);
		if(modifiedBuffers!=null) modifiedBuffers.set(bufferNum, true);
	}
1062867
public V put(K key, V value) {

        if ((key != null) && (value != null)) {
            return m_internalMap.put(key, value);
        }
        Exception e = new Exception();
        try {
            // we want to print a stack trace when null is used as a key/value
            throw e;
        } catch (Exception e2) {
            e = e2;
        }
        if (key == null) {
            LOG.warn("Invalid null key in map", e);
            return null;
        }
        if (value == null) {
            LOG.warn("Invalid null value in map", e);
            return m_internalMap.remove(key);
        }
        return null;
    }
1222759
public void setData(byte[] data, int offset, int length) {
        if (immutable) {
            throw new IllegalStateException(ERR_MSG_IMMUTABLE);
        }
        this.data = new byte[length];
        System.arraycopy(data, offset, this.data, 0, length);
    }
1285762
public synchronized int put(byte[] src, int off, int len) {
        if (available == capacity) {
            return 0;
        }

        // limit is last index to put + 1
        int limit = idxPut < idxGet ? idxGet : capacity;
        int count = Math.min(limit - idxPut, len);
        System.arraycopy(src, off, buffer, idxPut, count);
        idxPut += count;

        if (idxPut == capacity) {
            // Array end reached, check if we have more
            int count2 = Math.min(len - count, idxGet);
            if (count2 > 0) {
                System.arraycopy(src, off + count, buffer, 0, count2);
                idxPut = count2;
                count += count2;
            } else {
                idxPut = 0;
            }
        }
        available += count;
        return count;
    }
1193009
public void put(Object o)
        throws InterruptedException
    {
        synchronized(lock)
        {
            while (size==maxSize)
                lock.wait();

            elements[tail]=o;
            if(++tail==maxSize)
                tail=0;
            size++;
            lock.notify();
        }
    }
452433
public V put(final Object key, final Object value)
    {
        final Object val = mapNullValue(value);
        requireNonNull(val, "value cannot be null");

        final Object[] entries = this.entries;
        final int mask = entries.length - 1;
        int index = Hashing.evenHash(key.hashCode(), mask);
        Object oldValue = null;

        while (entries[index + 1] != null)
        {
            if (entries[index] == key || entries[index].equals(key))
            {
                oldValue = entries[index + 1];
                break;
            }

            index = next(index, mask);
        }

        if (oldValue == null)
        {
            ++size;
            entries[index] = key;
        }

        entries[index + 1] = val;

        increaseCapacity();

        return unmapNullValue(oldValue);
    }
777995
@Nullable
  public synchronized V put(K key, V value) {
    // We do remove and insert instead of just replace, in order to cause a structural change
    // to the map, as we always want the latest inserted element to be last in the queue.
    V oldValue = mMap.remove(key);
    mSizeInBytes -= getValueSizeInBytes(oldValue);
    mMap.put(key, value);
    mSizeInBytes += getValueSizeInBytes(value);
    return oldValue;
  }
267384
@Override
    public void putSystemContextItem(String name, Serializable item) throws IllegalArgumentException, IOException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "putSystemContextItem", new Object[] { name, item });

        /* If we have a non-null name */
        if (name != null) {

            /* If we really have an item */
            if (item != null) {

                /* If the item is of a JMS supported type, we can store it as is. */
                if (isValidForJms(item)) {
                    getSystemContextMap().put(name, item);
                }

                /* Otherwise, we need to take a safe copy & 'flatten it' suitably. */
                else {
                    getSystemContextMap().put(name, flattenMapObject(item));
                }

            }

            /* If item is null, just call deleteProperty */
            else {
                getSystemContextMap().remove(name);
            }
        }

        /* A null name is invalid. */
        else {
            throw new IllegalArgumentException("null");
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "putSystemContextItem");
    }