Gets the top of thread-local shell stack, or null if it is empty.

@return the top of the shell stack
182033
public static CmsShell getTopShell() {

        ArrayList<CmsShell> shells = SHELL_STACK.get();
        if (shells.isEmpty()) {
            return null;
        }
        return shells.get(shells.size() - 1);

    }
969231
public static final CThreadContext getInstance() {
		SoftReference ref = (SoftReference)CThreadContext.contextLocal
				.get(Thread.currentThread());
		CThreadContext context = null;
		if ((ref == null) || (ref.get() == null)) {
			context = new CThreadContext();
			ref = new SoftReference(context);
			CThreadContext.contextLocal.put(Thread.currentThread(), ref);
		} else {
			context = (CThreadContext)ref.get();
		}
		return context;
	}
896084
public T peek() {
		final int top = stack.size() - 1;
		if (top < 0) {
			throw new NoSuchElementException();
		}
		return stack.get(top);
	}
792105
public final int popAndTop()
  {

    m_firstFree--;

    m_map[m_firstFree] = DTM.NULL;

    return (m_firstFree == 0) ? DTM.NULL : m_map[m_firstFree - 1];
  }
957234
@SuppressWarnings("unchecked")
    public static StackFinder getInstance() {
        if (finder == null) {
            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    finder = new StackFinder();
                    return null;
                }
            });
//            finder.hpelClasses.add("com.ibm.ejs.ras.hpel.StackFinder");
//            finder.hpelClasses.add("com.ibm.ejs.ras.hpel.Messages");
//            finder.hpelClasses.add("java.util.logging.Logger");
//            finder.hpelClasses.add("com.ibm.ejs.ras.hpel.TraceNLSResolver");
//
//            finder.hpelClasses.add("com.ibm.ejs.ras.hpel.messages.HpelLogFormatter");
//
//            finder.hpelClasses.add("com.ibm.ws.logging.hpel.WsLogger");
//            finder.hpelClasses.add("com.ibm.ejs.ras.hpel.messages.handlers.LogRecordTextHandler");
//            finder.hpelClasses.add("com.ibm.ejs.ras.hpel.messages.handlers.LogRecordTextHandler$2");
//            finder.hpelClasses.add("com.ibm.ejs.ras.hpel.messages.handlers.LogRecordTextHandler$SerializationBuffer");
//
//            finder.hpelClasses.add("com.ibm.ejs.ras.hpel.messages.handlers.LogRecordHandler$SerializationBuffer");
//            finder.hpelClasses.add("com.ibm.ejs.ras.hpel.messages.handlers.LogRecordHandler$2");
//            finder.hpelClasses.add("com.ibm.ejs.ras.hpel.messages.handlers.LogRecordHandler");
//            
//            finder.hpelClasses.add("com.ibm.ejs.ras.hpel.messages.ras.impl.BinaryLogRecordSerializerImpl");
//            finder.hpelClasses.add("com.ibm.ejs.ras.hpel.messages.ras.impl.BinaryLogRecordSerializerImpl$3");
        }


        return finder;
    }
571302
public static WComponent getTop(final WComponent comp) {
		WComponent top = comp;

		for (WComponent parent = top.getParent(); parent != null; parent = parent.getParent()) {
			top = parent;
		}

		return top;
	}
419229
public StackNode<E> clean() {
        do {
            final StackNode<E> oldTop = top.get();
            if (top.compareAndSet(oldTop, null))
                return oldTop;

        } while (true);
    }
1121837
@Override
    public final N pop() {

        int spin = 0;
        // now pop the stack
        for(;;) {
            final long writeLock = seqLock.tryWriteLock();
            if(writeLock > 0) {
                try {
                    final int stackTop = this.stackTop.get();
                    final int lastRef = stackTop-1;
                    if(stackTop>0) {
                        try {
                            // if we can modify the stack - i.e. nobody else is modifying
                            final N n = stack.get(lastRef);
                            stack.set(lastRef, null);
                            stackNotFullCondition.signal();
                            return n;
                        } finally {
                            this.stackTop.set(lastRef);
                        }
                    } else {
                        return null;
                    }
                } finally {
                    seqLock.unlock(writeLock);
                }
            }

            spin = Condition.progressiveYield(spin);

        }
    }
113194
public Thread getExecutingThread() {
		synchronized (this) {

			if (this.executingThread == null) {
				if (this.taskName == null) {
					this.executingThread = new Thread(this);
				}
				else {
					this.executingThread = new Thread(this, getTaskNameWithIndex());
				}
			}

			return this.executingThread;
		}
	}
1166163
@Override
    public N pop() {
        try {
            return stack[(--stackTop)&mask];
        } finally {
            // remove the reference to the element in the
            // stack to prevent hanging references from living forever
            stack[(stackTop&mask)] = null;
        }
    }
515736
@Override
  public int getCurrentStackSize() {
    int stackSize = -1;
    if (this.tracingContextMap.containsKey(Thread.currentThread()))
      stackSize = this.tracingContextMap.get(Thread.currentThread()).getMethodStack().size();
    
    return stackSize;
  }
1134931
public @Nonnull SetType getBlockingThreads() {
        final ThreadType blocking = getBlockingThread();
        if (blocking == null) return runtime.getEmptyThreadSet();

        return runtime.getThreadSet(Collections.singleton(blocking));
    }
1134956
public Throwable getRootCause() {
		
		Throwable rootCause = null;
		Throwable nextCause = getCause();
		
		while (nextCause != null && !nextCause.equals(rootCause)) {
			rootCause = nextCause;
			nextCause = nextCause.getCause();
		}
		
		return rootCause;
	}
853359
public static ByteBuf threadLocalDirectBuffer() {
        if (THREAD_LOCAL_BUFFER_SIZE <= 0) {
            return null;
        }

        if (PlatformDependent.hasUnsafe()) {
            return ThreadLocalUnsafeDirectByteBuf.newInstance();
        } else {
            return ThreadLocalDirectByteBuf.newInstance();
        }
    }
796311
public java.util.List<Stack> getStacks() {
        if (stacks == null) {
            stacks = new com.amazonaws.internal.SdkInternalList<Stack>();
        }
        return stacks;
    }
1278255
public Optional<String> getRoot() {
        final LinkedList<String> uuids = context.get();
        return uuids.isEmpty()
                ? Optional.empty()
                : Optional.of(uuids.getLast());
    }
595032
public java.util.List<StackResource> getStackResources() {
        if (stackResources == null) {
            stackResources = new com.amazonaws.internal.SdkInternalList<StackResource>();
        }
        return stackResources;
    }