public void checkException() throws QueryEvaluationException { synchronized (exceptions) { if (!exceptions.isEmpty()) { try { throw exceptions.remove(); } catch (QueryEvaluationException e) { List<StackTraceElement> stack = new ArrayList<StackTraceElement>(); stack.addAll(Arrays.asList(e.getStackTrace())); StackTraceElement[] thisStack = new Throwable().getStackTrace(); stack.addAll(Arrays.asList(thisStack).subList(1, thisStack.length)); e.setStackTrace(stack.toArray(new StackTraceElement[stack.size()])); throw e; } catch (RuntimeException e) { List<StackTraceElement> stack = new ArrayList<StackTraceElement>(); stack.addAll(Arrays.asList(e.getStackTrace())); StackTraceElement[] thisStack = new Throwable().getStackTrace(); stack.addAll(Arrays.asList(thisStack)); e.setStackTrace(stack.toArray(new StackTraceElement[stack.size()])); throw e; } catch (Throwable e) { throw new QueryEvaluationException(e); } } } }
public void checkException() throws QueryEvaluationException { synchronized (exceptions) { if (!exceptions.isEmpty()) { try { throw exceptions.remove(); } catch (QueryEvaluationException e) { List<StackTraceElement> stack = new ArrayList<StackTraceElement>(); stack.addAll(Arrays.asList(e.getStackTrace())); StackTraceElement[] thisStack = new Throwable().getStackTrace(); stack.addAll(Arrays.asList(thisStack).subList(1, thisStack.length)); e.setStackTrace(stack.toArray(new StackTraceElement[stack.size()])); throw e; } catch (RuntimeException e) { List<StackTraceElement> stack = new ArrayList<StackTraceElement>(); stack.addAll(Arrays.asList(e.getStackTrace())); StackTraceElement[] thisStack = new Throwable().getStackTrace(); stack.addAll(Arrays.asList(thisStack)); e.setStackTrace(stack.toArray(new StackTraceElement[stack.size()])); throw e; } catch (Throwable e) { throw new QueryEvaluationException(e); } } } }