/** @see #create(Collection) */ public static RuntimeException create(Throwable... exceptions) { ArrayList<Throwable> temp = new ArrayList<>(Arrays.asList(exceptions)); return create(temp); }
/** Causes teardown to execute. */ public final void runTearDown() { List<Throwable> exceptions = new ArrayList<>(); List<TearDown> stackCopy; synchronized (stack) { stackCopy = Lists.newArrayList(stack); stack.clear(); } for (TearDown tearDown : stackCopy) { try { tearDown.tearDown(); } catch (Throwable t) { if (suppressThrows) { logger.log(Level.INFO, "exception thrown during tearDown", t); } else { exceptions.add(t); } } } if (!suppressThrows && (exceptions.size() > 0)) { throw ClusterException.create(exceptions); } } }
/** @see #create(Collection) */ public static RuntimeException create(Throwable... exceptions) { ArrayList<Throwable> temp = new ArrayList<>(Arrays.asList(exceptions)); return create(temp); }
/** * @see #create(Collection) */ public static RuntimeException create(Throwable... exceptions) { ArrayList<Throwable> temp = new ArrayList<Throwable>(); for (Throwable exception : exceptions) { temp.add(exception); } return create(temp); }
/** Causes teardown to execute. */ public final void runTearDown() { List<Throwable> exceptions = new ArrayList<>(); List<TearDown> stackCopy; synchronized (stack) { stackCopy = Lists.newArrayList(stack); stack.clear(); } for (TearDown tearDown : stackCopy) { try { tearDown.tearDown(); } catch (Throwable t) { if (suppressThrows) { logger.log(Level.INFO, "exception thrown during tearDown", t); } else { exceptions.add(t); } } } if (!suppressThrows && (exceptions.size() > 0)) { throw ClusterException.create(exceptions); } } }
/** * Causes teardown to execute. */ public final void runTearDown() { List<Throwable> exceptions = new ArrayList<Throwable>(); for (TearDown tearDown : stack) { try { tearDown.tearDown(); } catch (Throwable t) { if (suppressThrows) { logger.log(Level.INFO, "exception thrown during tearDown", t); } else { exceptions.add(t); } } } stack.clear(); if ((!suppressThrows) && (exceptions.size() > 0)) { throw ClusterException.create(exceptions); } } }