/** * Restores the original exception stack trace after a * previous call to {@link #reduceStackTrace()}. * */ protected void restoreStackTrace() { if(m_stackReduced && null != m_stackTrace) { synchronized(this) { setStackTrace(m_stackTrace); m_stackReduced= false; } } } }
/** * Restores the original exception stack trace after a previous call to {@link * #reduceStackTrace()}. */ protected void restoreStackTrace() { if (m_stackReduced && null != m_stackTrace) { synchronized (this) { setStackTrace(m_stackTrace); m_stackReduced = false; } } } }
/** * Subclasses may use this method to reduce the printed stack trace. * This method keeps only the last frame. * <b>Important</b>: after calling this method the preserved internally * and can be restored called {@link #restoreStackTrace}. */ protected void reduceStackTrace() { if(!m_stackReduced) { synchronized(this) { StackTraceElement[] newStack= new StackTraceElement[1]; StackTraceElement[] originalStack= getStackTrace(); if(originalStack.length > 0) { m_stackTrace= originalStack; newStack[0]= getStackTrace()[0]; setStackTrace(newStack); } m_stackReduced= true; } } }
/** * Subclasses may use this method to reduce the printed stack trace. This method keeps only the * last frame. <b>Important</b>: after calling this method the preserved internally and can be * restored called {@link #restoreStackTrace}. */ protected void reduceStackTrace() { if (!m_stackReduced) { synchronized (this) { StackTraceElement[] newStack = new StackTraceElement[1]; StackTraceElement[] originalStack = getStackTrace(); if (originalStack.length > 0) { m_stackTrace = originalStack; newStack[0] = getStackTrace()[0]; setStackTrace(newStack); } m_stackReduced = true; } } }