public T run() { try { return getWrapper().newInstance(mRef); } catch (Exception e) { ThrowUnchecked.fire(e); return null; } } });
for (Class declaredType : declaredTypes) { if (declaredType.isInstance(cause)) { fire(cause);
/** * Throws the cause of the given exception, even though it may be * checked. If the cause is null, then the original exception is * thrown. This method only returns normally if the exception is null. * * @param t exception whose cause is to be thrown */ public static void fireCause(Throwable t) { if (t != null) { Throwable cause = t.getCause(); if (cause == null) { cause = t; } fire(cause); } }
/** * Throws the root cause of the given exception, even though it may be * checked. If the root cause is null, then the original exception is * thrown. This method only returns normally if the exception is null. * * @param t exception whose root cause is to be thrown */ public static void fireRootCause(Throwable t) { Throwable root = t; while (root != null) { Throwable cause = root.getCause(); if (cause == null) { break; } root = cause; } fire(root); }
/** * Throws the given exception if it is unchecked or an instance of any of * the given declared types. Otherwise, it is thrown as an * UndeclaredThrowableException. This method only returns normally if the * exception is null. * * @param t exception to throw * @param declaredTypes if exception is checked and is not an instance of * any of these types, then it is thrown as an * UndeclaredThrowableException. */ public static void fireDeclared(Throwable t, Class... declaredTypes) { if (t != null) { if (declaredTypes != null) { for (Class declaredType : declaredTypes) { if (declaredType.isInstance(t)) { fire(t); } } } if (t instanceof RuntimeException) { throw (RuntimeException) t; } if (t instanceof Error) { throw (Error) t; } throw new UndeclaredThrowableException(t); } }
for (Class declaredType : declaredTypes) { if (declaredType.isInstance(cause)) { fire(cause);
/** * Returns a Constructor that accepts an AtomicReference to the wrapped * object. */ private Constructor<T> getWrapper() { Class<T> clazz; synchronized (cWrapperCache) { clazz = (Class<T>) cWrapperCache.get(mType); if (clazz == null) { clazz = createWrapper(); cWrapperCache.put(mType, clazz); } } try { return clazz.getConstructor(AtomicReference.class); } catch (NoSuchMethodException e) { ThrowUnchecked.fire(e); return null; } }
error.setStackTrace(completeTrace); ThrowUnchecked.fire(error);
/** * Throws the given exception, even though it may be checked. This method * only returns normally if the exception is null. * * @param t exception to throw */ public static void fire(Throwable t) { org.cojen.util.ThrowUnchecked.fire(t); }
/** * Throws the given exception, even though it may be checked. This method * only returns normally if the exception is null. * * @param t exception to throw */ public static void fire(Throwable t) { org.cojen.util.ThrowUnchecked.fire(t); }
public T run() { try { return getWrapper().newInstance(mRef); } catch (Exception e) { ThrowUnchecked.fire(e); return null; } } });
/** * Throws the cause of the given exception, even though it may be * checked. If the cause is null, then the original exception is * thrown. This method only returns normally if the exception is null. * * @param t exception whose cause is to be thrown */ public static void fireCause(Throwable t) { if (t != null) { Throwable cause = t.getCause(); if (cause == null) { cause = t; } fire(cause); } }
/** * Throws the root cause of the given exception, even though it may be * checked. If the root cause is null, then the original exception is * thrown. This method only returns normally if the exception is null. * * @param t exception whose root cause is to be thrown */ public static void fireRootCause(Throwable t) { Throwable root = t; while (root != null) { Throwable cause = root.getCause(); if (cause == null) { break; } root = cause; } fire(root); }
public Repository getRootRepository() { // This method is only called when fetching join properties. ThrowUnchecked.fire(new FetchException(MESSAGE)); return null; }
public Repository getRootRepository() { // This method is only called when fetching join properties. ThrowUnchecked.fire(new FetchException(MESSAGE)); return null; }
public void run() { try { selector.selectLoop(); } catch (IOException e) { org.cojen.util.ThrowUnchecked.fire(e); } } });
public final void run() { try { doRun(); } catch (Throwable e) { try { Thread t = Thread.currentThread(); t.getUncaughtExceptionHandler().uncaughtException(t, e); } catch (Throwable e2) { // Uncaught exception handler itself is broken. As a last // resort, throw exception to Future as usual. ThrowUnchecked.fire(e); } } }
/** * Returns a Constructor that accepts an AtomicReference to the wrapped * object. */ private Constructor<T> getWrapper() { Class<T> clazz; synchronized (cWrapperCache) { clazz = (Class<T>) cWrapperCache.get(mType); if (clazz == null) { clazz = createWrapper(); cWrapperCache.put(mType, clazz); } } try { return clazz.getConstructor(AtomicReference.class); } catch (NoSuchMethodException e) { org.cojen.util.ThrowUnchecked.fire(e); return null; } }
/** * Returns a Constructor that accepts an AtomicReference to the wrapped * object. */ private Constructor<T> getWrapper() { Class<T> clazz; synchronized (cWrapperCache) { clazz = (Class<T>) cWrapperCache.get(mType); if (clazz == null) { clazz = createWrapper(); cWrapperCache.put(mType, clazz); } } try { return clazz.getConstructor(AtomicReference.class); } catch (NoSuchMethodException e) { ThrowUnchecked.fire(e); return null; } }
@Override public void accept(Listener listener) { synchronized (this) { if (mNotListening) { mNotListening = false; try { mAcceptor.accept(mBrokerListener); } catch (Throwable e) { mNotListening = true; ThrowUnchecked.fire(e); } } } try { mAcceptListenerQueue.enqueue(listener); } catch (RejectedException e) { mAcceptListenerQueue.dequeue().rejected(e); } }