Clear the current context at the end of a batch - should only be used by
{@link RetryOperations} implementations.
@return the old value if there was one.
486804
public static RetryContext clear() {
		RetryContext value = getContext();
		RetryContext parent = value == null ? null : value.getParent();
		RetrySynchronizationManager.context.set(parent);
		return value;
	}
778091
public E removeLast () {
		if (size > 0) {
			E e = data[--size];
			data[size] = null;
			return e;
		}

		return null;
	}
1295721
public JsonXOutput clear(boolean clearBuffer)
    {
        if(clearBuffer)
            tail = head.clear();
        
        lastRepeated = false;
        lastNumber = 0;
        
        return this;
    }
1017153
public final T pop()
    {
        if (size > 0)
        {
            T result = heap[1]; // save first value
            heap[1] = heap[size]; // move last to first
            heap[size] = null; // permit GC of objects
            size--;
            downHeap(); // adjust heap
            return result;
        }
        else
        {
            return null;
        }
    }
374
@Override
  public void clear() {
    // iterate over all keys in originalMap and set them to null in deltaMap
    for (K key : originalMap.keySet()) {
      deltaMap.put(key, ErasureUtils.<Collection<V>>uncheckedCast(removedValue));
    }
  }
419229
public StackNode<E> clean() {
        do {
            final StackNode<E> oldTop = top.get();
            if (top.compareAndSet(oldTop, null))
                return oldTop;

        } while (true);
    }
600947
public CompletableFuture<Void> close() {
    threadContext.close();
    if (closeOnStop) {
      threadContextFactory.close();
    }
    return CompletableFuture.completedFuture(null);
  }
831408
public final long clear(long numberToClear)
    {
        long numberRemainingToClear = numberToClear;
        // Avoid locking the Map by looking at the subMaps indivdually starting at a
        // random point in the sequence, so as not to disturb the distribution.
        int index = new java.util.Random(Thread.currentThread().hashCode()).nextInt(subMaps.length);
        int numberEmpty = 0;
        while (numberRemainingToClear > 0 && numberEmpty < subMaps.length) {
            java.util.Map subMap = subMaps[index];
            synchronized (subMap) {
                if (!subMap.isEmpty()) {
                    java.util.Iterator iterator = subMap.entrySet().iterator();
                    iterator.next();
                    iterator.remove();
                    numberRemainingToClear--;
                    numberEmpty = 0;
                } else {
                    numberEmpty++;
                } // if (subMap.isEmpty()).
            } // synchronized (subMap).

            index++;
            if (index == subMaps.length)
                index = 0;
        } // while (numberRemainingToClear > 0).

        return numberToClear - numberRemainingToClear;
    }
243462
public long cleanup() {
		int garbageSize = 0;
		if (isCachingEnabled()) {
			System.out.println(new LogEntry(Level.VERBOSE, "Identifying expired objects"));
			ArrayList<K> garbage = getExpiredObjects();
			garbageSize = garbage.size();
			System.out.println(new LogEntry("cache cleanup: expired objects: " + garbageSize));
			for (K key : garbage) {
				clear(key);
			}
		}
		return garbageSize;
	}
311273
def _clear_context():
    '''
    
    '''
    for var in [x for x in __context__ if x.startswith('lxc.')]:
        log.trace('Clearing __context__[\'%s\']', var)
        __context__.pop(var, None)
512768
public void popContextData(){
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "popContextData");
        }
        
        // If we pushed thread context onto the thread, be sure to reset it before
        // taking it off.
        if (this.originalCD != null) {
          //Each producer service of the Transfer service is accessed in order to get the thread context data
          Iterator<ITransferContextService> TransferIterator = com.ibm.ws.webcontainer.osgi.WebContainer.getITransferContextServices();
          if (TransferIterator != null) {
            while(TransferIterator.hasNext()){
              ITransferContextService tcs = TransferIterator.next();
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                  Tr.debug(tc, "Calling resetState on: " + tcs);
              }
              tcs.resetState();
            }
          }
        }
        
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Restoring the current thread's class loader");
        }
        if(currentCL != null){
            //Revert back to the thread's current class loader
            AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
                public ClassLoader run() {
                    Thread.currentThread().setContextClassLoader(currentCL);
                    return currentCL;
                }
            });
        }
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Restoring the current thread's context data");
        }
        //When popping we are going to reset the thread context to clear everything off, then we are going to set it back to the state when we first pushed
        //our stuff onto the thread
        if(currentCD != null){
            Iterator<ITransferContextService> TransferIterator = com.ibm.ws.webcontainer.osgi.WebContainer.getITransferContextServices();
            if (TransferIterator != null) { 
                while(TransferIterator.hasNext()){
                    ITransferContextService tcs = TransferIterator.next();
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "calling restoreState on: " + tcs);
                    }
                    tcs.restoreState(currentCD);
                }  
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Ending the current ComponentMetaData context");
        }
        //Reset data for other components that we already have hooks into
        ComponentMetaDataAccessorImpl cmdai = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor();
        cmdai.endContext();
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "popContextData");
        }
    }
702464
E unlinkLast() {
    final E l = last;
    final E prev = l.getPrevious();
    l.setPrevious(null);
    last = prev;
    if (prev == null) {
      first = null;
    } else {
      prev.setNext(null);
    }
    return l;
  }
1053256
public Object endContext() { // modified to return object d131914
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            ComponentMetaData cmd = getComponentMetaData();
            Tr.debug(tc, "end context " + (cmd == null ? null : cmd.getJ2EEName()));
        }
        return threadContext.endContext(); //d131914
    }
815726
@Override
  protected void clearCache() {
    if (lastX != null) lastX[0] = Double.NaN;
    if (lastXBatch != null) lastXBatch[0] = Double.NaN;
    if (lastVBatch != null) lastVBatch[0] = Double.NaN;
  }
1370366
public boolean getClearDigitBuffer() {
        String value = Optional.fromNullable(getParameter(SignalParameters.CLEAR_DIGIT_BUFFER.symbol())).or("false");
        return Boolean.parseBoolean(value);
    }
1173073
public void clearExpired() {
		Iterator keys = cacheLineTable.keySet().iterator();

		while (keys.hasNext()) {
			Object key = keys.next();

			if (hasExpired(key)) {
				removeObject(key);
			}
		}
	}
660389
public Tree clear() {
		if (value != null) {
			if (isMap()) {

				((Map<?, ?>) value).clear();

			} else if (value instanceof Collection) {

				((Collection<?>) value).clear();

			} else if (isArray()) {

				setObjectInternal(new LinkedList<Object>());

			} else {

				setObjectInternal(null);

			}
		}
		return this;
	}