public void pop(){
  Deque<TaskContext> stack=contextStacks.get();
  if (stack == null) {
    throw new IllegalStateException("Invalid execution context stack state: " + stack + " trying to remove: "+ this);
  }
  final TaskContext last=stack.pollLast();
  if (last != this) {
    if (last != null) {
      stack.addLast(last);
    }
    throw new IllegalStateException("Invalid execution context stack state: " + stack + " trying to remove: "+ this+ " but got: "+ last);
  }
}

public void pop ( ) { Deque < TaskContext > stack = contextStacks . get ( ) ; if ( stack == null ) { throw new IllegalStateException ( "Invalid execution context stack state: " + stack + " trying to remove: " + this ) ; } final TaskContext last = stack . pollLast ( ) ; if ( last != this ) { if ( last != null ) { stack . addLast ( last ) ; } throw new IllegalStateException ( "Invalid execution context stack state: " + stack + " trying to remove: " + this + " but got: " + last ) ; } }
removes the this execution context from the context stack for the current thread . this will fail with illegalstateexception if the current context is not at the top of the stack .
