This method MUST NOT THROW
551865
@Override
    protected void outputPass() {
        if(!prototype.isOutputSupported())
            return;

        // take a snapshot of the current container state.
        final LinkedList<Object> toOutput = new LinkedList<Object>(instances.keySet());

        Executor executorService = null;
        Semaphore taskLock = null;
        executorService = super.getOutputExecutorService();
        if(executorService != null)
            taskLock = new Semaphore(outputConcurrency);

        // This keeps track of the number of concurrently running
        // output tasks so that this method can wait until they're
        // all done to return.
        //
        // It's also used as a condition variable signaling on its
        // own state changes.
        final AtomicLong numExecutingOutputs = new AtomicLong(0);

        // keep going until all of the outputs have been invoked
        while(toOutput.size() > 0 && isRunning.get()) {
            for(final Iterator<Object> iter = toOutput.iterator(); iter.hasNext();) {
                final Object key = iter.next();

                final WorkingPlaceholder wp = new WorkingPlaceholder();
                // we're going to hold up all incomming message to this mp
                wp.mailbox.getAndSet(null); // this blocks other threads from
                                            // dropping messages in the mailbox

                final WorkingPlaceholder alreadyThere = working.putIfAbsent(key, wp); // try to get a lock
                if(alreadyThere == null) { // we got it the lock
                    final Object instance = instances.get(key);

                    if(instance != null) {
                        final Semaphore taskSepaphore = taskLock;

                        // This task will release the wrapper's lock.
                        final Runnable task = new Runnable() {

                            @Override
                            public void run() {
                                final List<KeyedMessageWithType> response;
                                try {
                                    if(isRunning.get())
                                        response = invokeOperation(instance, Operation.output, null);
                                    else
                                        response = null;
                                } finally {
                                    working.remove(key); // releases this back to the world

                                    // this signals that we're done.
                                    synchronized(numExecutingOutputs) {
                                        numExecutingOutputs.decrementAndGet();
                                        numExecutingOutputs.notifyAll();
                                    }
                                    if(taskSepaphore != null)
                                        taskSepaphore.release();
                                }

                                if(response != null) {
                                    try {
                                        dispatcher.dispatch(response);
                                    } catch(final Exception de) {
                                        if(isRunning.get())
                                            LOGGER.warn("Failed on subsequent dispatch of " + response + ": " + de.getLocalizedMessage());
                                    }
                                }
                            }
                        };

                        synchronized(numExecutingOutputs) {
                            numExecutingOutputs.incrementAndGet();
                        }

                        if(executorService != null) {
                            try {
                                taskSepaphore.acquire();
                                executorService.execute(task);
                            } catch(final RejectedExecutionException e) {
                                working.remove(key); // we never got into the run so we need to release the lock
                                // this may happen because of a race condition between the
                                taskSepaphore.release();
                            } catch(final InterruptedException e) {
                                // this can happen while blocked in the semaphore.acquire.
                                // if we're no longer running we should just get out
                                // of here.
                                //
                                // Not releasing the taskSepaphore assumes the acquire never executed.
                                // if (since) the acquire never executed we also need to release the
                                // wrapper lock or that Mp will never be usable again.
                                working.remove(key); // we never got into the run so we need to release the lock
                            }
                        } else
                            task.run();

                        iter.remove();

                    } else {
                        working.remove(key);
                        LOGGER.warn("There was an attempt to evict a non-existent Mp for key " + SafeString.objectDescription(key));
                    }
                } // didn't get the lock
            } // loop over every mp
        } // end while there are still Mps that haven't had output invoked.

        // =======================================================
        // now make sure all of the running tasks have completed
        synchronized(numExecutingOutputs) {
            while(numExecutingOutputs.get() > 0) {
                try {
                    numExecutingOutputs.wait();
                } catch(final InterruptedException e) {
                    // if we were interupted for a shutdown then just stop
                    // waiting for all of the threads to finish
                    if(!isRunning.get())
                        break;
                    // otherwise continue checking.
                }
            }
        }
        // =======================================================

    }
1262430
def _maybe_throw(self):
        
        if self._err:
            ex_cls, ex_obj, ex_bt = self._err
            self._err = None
            PyCBC.raise_helper(ex_cls, ex_obj, ex_bt)
244636
public static void notNull(@Nullable Object value, String name) {
        if (value == null) {
            throw new IllegalArgumentException(name + " must not be null!");
        }
    }
1039585
public final void validate(Method method) throws ValidationException {
        final Validator<CalendarComponent> validator = getValidator(method);
        if (validator != null) {
            validator.validate(this);
        }
        else {
            throw new ValidationException("Unsupported method: " + method);
        }
    }
85326
@SuppressWarnings("unused")
    static Void throwUnsafelyIfNonNull(@Nullable Object unused,
                                       @Nullable Throwable cause) {
        throwUnsafelyIfNonNull(cause);
        return null;
    }
1182663
public void valueUnbound(HttpSessionBindingEvent event) {
        for (SessionFieldMapper fieldMapper : this.values()) {
            if (fieldMapper.runnable != null) fieldMapper.runnable.cancel();
        }
    }
1283776
public void not() {
        IntBitSet tmp;

        tmp = new IntBitSet();
        tmp.addRange(0, used - 1);
        tmp.removeAll(ends);
        ends = tmp;
    }
455140
private Throwable throwable(final LoggingEvent loggingEvent) {
		ThrowableInformation throwableInfo = loggingEvent.getThrowableInformation();
		if (throwableInfo != null)
			return throwableInfo.getThrowable();
		
		Object message = loggingEvent.getMessage();
		if (message instanceof Throwable)
			return (Throwable) message;
		
		return null;
	}
643627
static void handleThrowable(Throwable t) {
        if (t instanceof ThreadDeath) {
            throw (ThreadDeath) t;
        }
        if (t instanceof VirtualMachineError) {
            throw (VirtualMachineError) t;
        }
        // All other instances of Throwable will be silently swallowed
    }
653021
def throw(self, typ, val=None, tb=None):  # pylint:disable=method-hidden,invalid-name
        
        self._materialize()
        self._generator.throw(typ, val, tb)
547850
public static <T> T throww(Throwable t) {
		if (isDebugMode()) {
			t.printStackTrace();
		}
		if (t instanceof RuntimeException) {
			throw (RuntimeException) t;
		}
		throw new JKException(t);
	}
1221789
public void stop() {

        String thisMethodName = CLASS_NAME + ".stop()";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            // SibTr.entry(tc, thisMethodName);
        }

        // Get the MEs on this server
        Enumeration meEnum = _messagingEngines.elements();

        // Stop each ME on this server. Any exceptions are caught and
        // deliberately
        // not
        // rethrown as errors in one ME must not affect any others that might
        // exist.
        while (meEnum.hasMoreElements()) {
            Object o = meEnum.nextElement();
            Object c = ((MessagingEngine) o).getRuntime();
            try {

                ((BaseMessagingEngineImpl) c)
                                .stopConditional(JsConstants.ME_STOP_IMMEDIATE);
            } catch (Exception e) {
                FFDCFilter.processException(e, thisMethodName, "1:854:1.108",
                                            this);
                SibTr.exception(tc, e);
                SibTr.error(tc, "INTERNAL_ERROR_SIAS0003", e);
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, thisMethodName);
        }
    }
810477
public synchronized void reject() {
        JingleSession session;
        synchronized (manager) {
            try {
                session = manager.createIncomingJingleSession(this);
                // Acknowledge the IQ reception
                session.setSid(this.getSessionID());
                // session.sendAck(this.getJingle());
                session.updatePacketListener();
                session.terminate("Declined");
            } catch (Exception e) {
                LOGGER.log(Level.SEVERE, "Exception in reject", e);
            }
        }
     }
1187785
@Override
    public void onFailure(Throwable t) {
        if (cancelled) {
            return;
        }

        t = adjustThrowable(t);
        if (handleInternalException(t)) {
            next();
        } else {
            cancel();
        }
    }
295657
private boolean isRetryException(final Throwable th) {
        Throwable current = th;
        boolean res = false;
        while (current != null) {
            if (current instanceof ONeedRetryException) {
                res = true;
                break;
            }
            current = current.getCause();
        }
        return res;
    }
971038
private static RuntimeException cancelThrow(ClientCall<?, ?> call, Throwable t) {
    try {
      call.cancel(null, t);
    } catch (Throwable e) {
      assert e instanceof RuntimeException || e instanceof Error;
      logger.log(Level.SEVERE, "RuntimeException encountered while closing call", e);
    }
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    } else if (t instanceof Error) {
      throw (Error) t;
    }
    // should be impossible
    throw new AssertionError(t);
  }
645256
public static <T, X extends Throwable> T throwThe(X e) throws X {
        if (e == null) {
            throw new ExceptionNotHandled("Cannot throw null exception.");
        }

        throw e;
    }