Add since tags

Formatting


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137207 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2002-12-23 00:15:19 +00:00
parent 725fd755a1
commit 010e0a3f2e
5 changed files with 142 additions and 238 deletions

View File

@ -1,5 +1,3 @@
package org.apache.commons.lang.exception;
/* ==================================================================== /* ====================================================================
* The Apache Software License, Version 1.1 * The Apache Software License, Version 1.1
* *
@ -53,6 +51,7 @@ package org.apache.commons.lang.exception;
* information on the Apache Software Foundation, please see * information on the Apache Software Foundation, please see
* <http://www.apache.org/>. * <http://www.apache.org/>.
*/ */
package org.apache.commons.lang.exception;
import java.io.PrintStream; import java.io.PrintStream;
import java.io.PrintWriter; import java.io.PrintWriter;
@ -65,10 +64,11 @@ import java.io.PrintWriter;
* @author <a href="mailto:dlr@collab.net">Daniel Rall</a> * @author <a href="mailto:dlr@collab.net">Daniel Rall</a>
* @author <a href="mailto:knielsen@apache.org">Kasper Nielsen</a> * @author <a href="mailto:knielsen@apache.org">Kasper Nielsen</a>
* @author <a href="mailto:steven@caswell.name">Steven Caswell</a> * @author <a href="mailto:steven@caswell.name">Steven Caswell</a>
* @version $Id: Nestable.java,v 1.4 2002/09/12 01:20:25 stevencaswell Exp $ * @since 1.0
* @version $Id: Nestable.java,v 1.5 2002/12/23 00:15:19 scolebourne Exp $
*/ */
public interface Nestable public interface Nestable {
{
/** /**
* Returns the reference to the exception or error that caused the * Returns the reference to the exception or error that caused the
* exception implementing the <code>Nestable</code> to be thrown. * exception implementing the <code>Nestable</code> to be thrown.
@ -129,7 +129,7 @@ public interface Nestable
* @return the throwable count * @return the throwable count
*/ */
public int getThrowableCount(); public int getThrowableCount();
/** /**
* Returns this <code>Nestable</code> and any nested <code>Throwable</code>s * Returns this <code>Nestable</code> and any nested <code>Throwable</code>s
* in an array of <code>Throwable</code>s, one element for each * in an array of <code>Throwable</code>s, one element for each
@ -166,7 +166,7 @@ public interface Nestable
* chain * chain
*/ */
public int indexOfThrowable(Class type, int fromIndex); public int indexOfThrowable(Class type, int fromIndex);
/** /**
* Prints the stack trace of this exception to the specified print * Prints the stack trace of this exception to the specified print
* writer. Includes inforamation from the exception--if * writer. Includes inforamation from the exception--if

View File

@ -1,5 +1,3 @@
package org.apache.commons.lang.exception;
/* ==================================================================== /* ====================================================================
* The Apache Software License, Version 1.1 * The Apache Software License, Version 1.1
* *
@ -53,6 +51,7 @@ package org.apache.commons.lang.exception;
* information on the Apache Software Foundation, please see * information on the Apache Software Foundation, please see
* <http://www.apache.org/>. * <http://www.apache.org/>.
*/ */
package org.apache.commons.lang.exception;
import java.io.PrintStream; import java.io.PrintStream;
import java.io.PrintWriter; import java.io.PrintWriter;
@ -64,17 +63,17 @@ import java.io.StringWriter;
* @author <a href="mailto:knielsen@apache.org">Kasper Nielsen</a> * @author <a href="mailto:knielsen@apache.org">Kasper Nielsen</a>
* @author <a href="mailto:steven@caswell.name">Steven Caswell</a> * @author <a href="mailto:steven@caswell.name">Steven Caswell</a>
* @author Sean C. Sullivan * @author Sean C. Sullivan
* @version $Id: NestableDelegate.java,v 1.10 2002/10/09 05:29:52 sullis Exp $ * @since 1.0
* @version $Id: NestableDelegate.java,v 1.11 2002/12/23 00:15:19 scolebourne Exp $
*/ */
public class NestableDelegate public class NestableDelegate implements java.io.Serializable {
implements java.io.Serializable
{
/** /**
* Constructor error message. * Constructor error message.
*/ */
private transient static final String MUST_BE_THROWABLE = private transient static final String MUST_BE_THROWABLE =
"The Nestable implementation passed to the NestableDelegate(Nestable) " "The Nestable implementation passed to the NestableDelegate(Nestable) "
+ "constructor must extend java.lang.Throwable"; + "constructor must extend java.lang.Throwable";
/** /**
* Holds the reference to the exception or error that we're * Holds the reference to the exception or error that we're
@ -90,14 +89,10 @@ public class NestableDelegate
* @param nestable the Nestable implementation (<i>must</i> extend * @param nestable the Nestable implementation (<i>must</i> extend
* {@link java.lang.Throwable}) * {@link java.lang.Throwable})
*/ */
NestableDelegate(Nestable nestable) // package NestableDelegate(Nestable nestable) {
{ if (nestable instanceof Throwable) {
if (nestable instanceof Throwable)
{
this.nestable = (Throwable) nestable; this.nestable = (Throwable) nestable;
} } else {
else
{
throw new IllegalArgumentException(MUST_BE_THROWABLE); throw new IllegalArgumentException(MUST_BE_THROWABLE);
} }
} }
@ -114,19 +109,15 @@ public class NestableDelegate
* negative or not less than the count of <code>Throwable</code>s in the * negative or not less than the count of <code>Throwable</code>s in the
* chain * chain
*/ */
String getMessage(int index) String getMessage(int index) {
{
Throwable t = this.getThrowable(index); Throwable t = this.getThrowable(index);
if(Nestable.class.isInstance(t)) if (Nestable.class.isInstance(t)) {
{
return ((Nestable) t).getMessage(0); return ((Nestable) t).getMessage(0);
} } else {
else
{
return t.getMessage(); return t.getMessage();
} }
} }
/** /**
* Returns the full message contained by the <code>Nestable</code> * Returns the full message contained by the <code>Nestable</code>
* and any nested <code>Throwable</code>s. * and any nested <code>Throwable</code>s.
@ -139,22 +130,17 @@ public class NestableDelegate
* @return The concatenated message for this and all nested * @return The concatenated message for this and all nested
* <code>Throwable</code>s * <code>Throwable</code>s
*/ */
String getMessage(String baseMsg) // package String getMessage(String baseMsg) {
{
StringBuffer msg = new StringBuffer(); StringBuffer msg = new StringBuffer();
if (baseMsg != null) if (baseMsg != null) {
{
msg.append(baseMsg); msg.append(baseMsg);
} }
Throwable nestedCause = ExceptionUtils.getCause(this.nestable); Throwable nestedCause = ExceptionUtils.getCause(this.nestable);
if (nestedCause != null) if (nestedCause != null) {
{
String causeMsg = nestedCause.getMessage(); String causeMsg = nestedCause.getMessage();
if (causeMsg != null) if (causeMsg != null) {
{ if (baseMsg != null) {
if (baseMsg != null)
{
msg.append(": "); msg.append(": ");
} }
msg.append(causeMsg); msg.append(causeMsg);
@ -174,15 +160,14 @@ public class NestableDelegate
* *
* @return the error messages * @return the error messages
*/ */
String[] getMessages() // package String[] getMessages() {
{
Throwable[] throwables = this.getThrowables(); Throwable[] throwables = this.getThrowables();
String[] msgs = new String[throwables.length]; String[] msgs = new String[throwables.length];
for(int i = 0; i < throwables.length; i++) for (int i = 0; i < throwables.length; i++) {
{ msgs[i] =
msgs[i] = (Nestable.class.isInstance(throwables[i]) ? (Nestable.class.isInstance(throwables[i])
((Nestable) throwables[i]).getMessage(0) : ? ((Nestable) throwables[i]).getMessage(0)
throwables[i].getMessage()); : throwables[i].getMessage());
} }
return msgs; return msgs;
} }
@ -198,27 +183,24 @@ public class NestableDelegate
* negative or not less than the count of <code>Throwable</code>s in the * negative or not less than the count of <code>Throwable</code>s in the
* chain * chain
*/ */
Throwable getThrowable(int index) Throwable getThrowable(int index) {
{ if (index == 0) {
if(index == 0)
{
return this.nestable; return this.nestable;
} }
Throwable[] throwables = this.getThrowables(); Throwable[] throwables = this.getThrowables();
return throwables[index]; return throwables[index];
} }
/** /**
* Returns the number of <code>Throwable</code>s contained in the * Returns the number of <code>Throwable</code>s contained in the
* <code>Nestable</code> contained by this delegate. * <code>Nestable</code> contained by this delegate.
* *
* @return the throwable count * @return the throwable count
*/ */
int getThrowableCount() // package int getThrowableCount() {
{
return ExceptionUtils.getThrowableCount(this.nestable); return ExceptionUtils.getThrowableCount(this.nestable);
} }
/** /**
* Returns this delegate's <code>Nestable</code> and any nested * Returns this delegate's <code>Nestable</code> and any nested
* <code>Throwable</code>s in an array of <code>Throwable</code>s, one * <code>Throwable</code>s in an array of <code>Throwable</code>s, one
@ -226,8 +208,7 @@ public class NestableDelegate
* *
* @return the <code>Throwable</code>s * @return the <code>Throwable</code>s
*/ */
Throwable[] getThrowables() // package Throwable[] getThrowables() {
{
return ExceptionUtils.getThrowables(this.nestable); return ExceptionUtils.getThrowables(this.nestable);
} }
@ -246,17 +227,15 @@ public class NestableDelegate
* is negative or not less than the count of <code>Throwable</code>s in the * is negative or not less than the count of <code>Throwable</code>s in the
* chain * chain
*/ */
int indexOfThrowable(Class type, int fromIndex) // package int indexOfThrowable(Class type, int fromIndex) {
{
return ExceptionUtils.indexOfThrowable(this.nestable, type, fromIndex); return ExceptionUtils.indexOfThrowable(this.nestable, type, fromIndex);
} }
/** /**
* Prints the stack trace of this exception the the standar error * Prints the stack trace of this exception the the standar error
* stream. * stream.
*/ */
public void printStackTrace() public void printStackTrace() {
{
printStackTrace(System.err); printStackTrace(System.err);
} }
@ -267,10 +246,8 @@ public class NestableDelegate
* @param out <code>PrintStream</code> to use for output. * @param out <code>PrintStream</code> to use for output.
* @see #printStackTrace(PrintWriter) * @see #printStackTrace(PrintWriter)
*/ */
public void printStackTrace(PrintStream out) public void printStackTrace(PrintStream out) {
{ synchronized (out) {
synchronized (out)
{
PrintWriter pw = new PrintWriter(out, false); PrintWriter pw = new PrintWriter(out, false);
printStackTrace(pw); printStackTrace(pw);
// Flush the PrintWriter before it's GC'ed. // Flush the PrintWriter before it's GC'ed.
@ -284,24 +261,17 @@ public class NestableDelegate
* *
* @param out <code>PrintWriter</code> to use for output. * @param out <code>PrintWriter</code> to use for output.
*/ */
public void printStackTrace(PrintWriter out) public void printStackTrace(PrintWriter out) {
{ synchronized (out) {
synchronized (out)
{
String[] st = getStackFrames(this.nestable); String[] st = getStackFrames(this.nestable);
Throwable nestedCause = ExceptionUtils.getCause(this.nestable); Throwable nestedCause = ExceptionUtils.getCause(this.nestable);
if (nestedCause != null) if (nestedCause != null) {
{ if (nestedCause instanceof Nestable) {
if (nestedCause instanceof Nestable)
{
// Recurse until a non-Nestable is encountered. // Recurse until a non-Nestable is encountered.
((Nestable) nestedCause).printStackTrace(out); ((Nestable) nestedCause).printStackTrace(out);
} } else {
else
{
String[] nst = getStackFrames(nestedCause); String[] nst = getStackFrames(nestedCause);
for (int i = 0; i < nst.length; i++) for (int i = 0; i < nst.length; i++) {
{
out.println(nst[i]); out.println(nst[i]);
} }
} }
@ -309,8 +279,7 @@ public class NestableDelegate
} }
// Output desired frames from stack trace. // Output desired frames from stack trace.
for (int i = 0; i < st.length; i++) for (int i = 0; i < st.length; i++) {
{
out.println(st[i]); out.println(st[i]);
} }
} }
@ -324,18 +293,14 @@ public class NestableDelegate
* @param t The <code>Throwable</code>. * @param t The <code>Throwable</code>.
* @return An array of strings describing each stack frame. * @return An array of strings describing each stack frame.
*/ */
private String[] getStackFrames(Throwable t) private String[] getStackFrames(Throwable t) {
{
StringWriter sw = new StringWriter(); StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw, true); PrintWriter pw = new PrintWriter(sw, true);
// Avoid infinite loop between decompose() and printStackTrace(). // Avoid infinite loop between decompose() and printStackTrace().
if (t instanceof Nestable) if (t instanceof Nestable) {
{
((Nestable) t).printPartialStackTrace(pw); ((Nestable) t).printPartialStackTrace(pw);
} } else {
else
{
t.printStackTrace(pw); t.printStackTrace(pw);
} }
return ExceptionUtils.getStackFrames(sw.getBuffer().toString()); return ExceptionUtils.getStackFrames(sw.getBuffer().toString());

View File

@ -1,5 +1,3 @@
package org.apache.commons.lang.exception;
/* ==================================================================== /* ====================================================================
* The Apache Software License, Version 1.1 * The Apache Software License, Version 1.1
* *
@ -53,6 +51,7 @@ package org.apache.commons.lang.exception;
* information on the Apache Software Foundation, please see * information on the Apache Software Foundation, please see
* <http://www.apache.org/>. * <http://www.apache.org/>.
*/ */
package org.apache.commons.lang.exception;
import java.io.PrintStream; import java.io.PrintStream;
import java.io.PrintWriter; import java.io.PrintWriter;
@ -63,9 +62,10 @@ import java.io.PrintWriter;
* @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a> * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
* @see org.apache.commons.lang.exception.NestableException * @see org.apache.commons.lang.exception.NestableException
* @since 1.0 * @since 1.0
* @version $Id: NestableError.java,v 1.4 2002/12/23 00:15:19 scolebourne Exp $
*/ */
public class NestableError extends Error implements Nestable public class NestableError extends Error implements Nestable {
{
/** /**
* The helper instance which contains much of the code which we * The helper instance which contains much of the code which we
* delegate to. * delegate to.
@ -82,8 +82,7 @@ public class NestableError extends Error implements Nestable
* Constructs a new <code>NestableError</code> without specified * Constructs a new <code>NestableError</code> without specified
* detail message. * detail message.
*/ */
public NestableError() public NestableError() {
{
super(); super();
} }
@ -93,8 +92,7 @@ public class NestableError extends Error implements Nestable
* *
* @param msg The error message. * @param msg The error message.
*/ */
public NestableError(String msg) public NestableError(String msg) {
{
super(msg); super(msg);
} }
@ -105,8 +103,7 @@ public class NestableError extends Error implements Nestable
* @param cause the exception or error that caused this exception to be * @param cause the exception or error that caused this exception to be
* thrown * thrown
*/ */
public NestableError(Throwable cause) public NestableError(Throwable cause) {
{
super(); super();
this.cause = cause; this.cause = cause;
} }
@ -119,81 +116,64 @@ public class NestableError extends Error implements Nestable
* @param cause the exception or error that caused this exception to be * @param cause the exception or error that caused this exception to be
* thrown * thrown
*/ */
public NestableError(String msg, Throwable cause) public NestableError(String msg, Throwable cause) {
{
super(msg); super(msg);
this.cause = cause; this.cause = cause;
} }
public Throwable getCause() public Throwable getCause() {
{
return cause; return cause;
} }
public String getMessage() public String getMessage() {
{
return delegate.getMessage(super.getMessage()); return delegate.getMessage(super.getMessage());
} }
public String getMessage(int index) public String getMessage(int index) {
{ if (index == 0) {
if (index == 0)
{
return super.getMessage(); return super.getMessage();
} } else {
else
{
return delegate.getMessage(index); return delegate.getMessage(index);
} }
} }
public String[] getMessages() public String[] getMessages() {
{
return delegate.getMessages(); return delegate.getMessages();
} }
public Throwable getThrowable(int index) public Throwable getThrowable(int index) {
{
return delegate.getThrowable(index); return delegate.getThrowable(index);
} }
public int getThrowableCount() public int getThrowableCount() {
{
return delegate.getThrowableCount(); return delegate.getThrowableCount();
} }
public Throwable[] getThrowables() public Throwable[] getThrowables() {
{
return delegate.getThrowables(); return delegate.getThrowables();
} }
public int indexOfThrowable(Class type) public int indexOfThrowable(Class type) {
{
return delegate.indexOfThrowable(type, 0); return delegate.indexOfThrowable(type, 0);
} }
public int indexOfThrowable(Class type, int fromIndex) public int indexOfThrowable(Class type, int fromIndex) {
{
return delegate.indexOfThrowable(type, fromIndex); return delegate.indexOfThrowable(type, fromIndex);
} }
public void printStackTrace() public void printStackTrace() {
{
delegate.printStackTrace(); delegate.printStackTrace();
} }
public void printStackTrace(PrintStream out) public void printStackTrace(PrintStream out) {
{
delegate.printStackTrace(out); delegate.printStackTrace(out);
} }
public void printStackTrace(PrintWriter out) public void printStackTrace(PrintWriter out) {
{
delegate.printStackTrace(out); delegate.printStackTrace(out);
} }
public final void printPartialStackTrace(PrintWriter out) public final void printPartialStackTrace(PrintWriter out) {
{
super.printStackTrace(out); super.printStackTrace(out);
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.commons.lang.exception;
/* ==================================================================== /* ====================================================================
* The Apache Software License, Version 1.1 * The Apache Software License, Version 1.1
* *
@ -53,6 +51,7 @@ package org.apache.commons.lang.exception;
* information on the Apache Software Foundation, please see * information on the Apache Software Foundation, please see
* <http://www.apache.org/>. * <http://www.apache.org/>.
*/ */
package org.apache.commons.lang.exception;
import java.io.PrintStream; import java.io.PrintStream;
import java.io.PrintWriter; import java.io.PrintWriter;
@ -120,10 +119,11 @@ import java.io.PrintWriter;
* @author <a href="mailto:dlr@collab.net">Daniel Rall</a> * @author <a href="mailto:dlr@collab.net">Daniel Rall</a>
* @author <a href="mailto:knielsen@apache.org">Kasper Nielsen</a> * @author <a href="mailto:knielsen@apache.org">Kasper Nielsen</a>
* @author <a href="mailto:steven@caswell.name">Steven Caswell</a> * @author <a href="mailto:steven@caswell.name">Steven Caswell</a>
* @version $Id: NestableException.java,v 1.5 2002/09/29 08:20:52 bayard Exp $ * @since 1.0
* @version $Id: NestableException.java,v 1.6 2002/12/23 00:15:19 scolebourne Exp $
*/ */
public class NestableException extends Exception implements Nestable public class NestableException extends Exception implements Nestable {
{
/** /**
* The helper instance which contains much of the code which we * The helper instance which contains much of the code which we
* delegate to. * delegate to.
@ -140,8 +140,7 @@ public class NestableException extends Exception implements Nestable
* Constructs a new <code>NestableException</code> without specified * Constructs a new <code>NestableException</code> without specified
* detail message. * detail message.
*/ */
public NestableException() public NestableException() {
{
super(); super();
} }
@ -151,8 +150,7 @@ public class NestableException extends Exception implements Nestable
* *
* @param msg The error message. * @param msg The error message.
*/ */
public NestableException(String msg) public NestableException(String msg) {
{
super(msg); super(msg);
} }
@ -163,8 +161,7 @@ public class NestableException extends Exception implements Nestable
* @param cause the exception or error that caused this exception to be * @param cause the exception or error that caused this exception to be
* thrown * thrown
*/ */
public NestableException(Throwable cause) public NestableException(Throwable cause) {
{
super(); super();
this.cause = cause; this.cause = cause;
} }
@ -177,82 +174,65 @@ public class NestableException extends Exception implements Nestable
* @param cause the exception or error that caused this exception to be * @param cause the exception or error that caused this exception to be
* thrown * thrown
*/ */
public NestableException(String msg, Throwable cause) public NestableException(String msg, Throwable cause) {
{
super(msg); super(msg);
this.cause = cause; this.cause = cause;
} }
public Throwable getCause() public Throwable getCause() {
{
return cause; return cause;
} }
public String getMessage() public String getMessage() {
{
return delegate.getMessage(super.getMessage()); return delegate.getMessage(super.getMessage());
} }
public String getMessage(int index) public String getMessage(int index) {
{ if (index == 0) {
if (index == 0)
{
return super.getMessage(); return super.getMessage();
} } else {
else
{
return delegate.getMessage(index); return delegate.getMessage(index);
} }
} }
public String[] getMessages() public String[] getMessages() {
{
return delegate.getMessages(); return delegate.getMessages();
} }
public Throwable getThrowable(int index) public Throwable getThrowable(int index) {
{
return delegate.getThrowable(index); return delegate.getThrowable(index);
} }
public int getThrowableCount() public int getThrowableCount() {
{
return delegate.getThrowableCount(); return delegate.getThrowableCount();
} }
public Throwable[] getThrowables() public Throwable[] getThrowables() {
{
return delegate.getThrowables(); return delegate.getThrowables();
} }
public int indexOfThrowable(Class type) public int indexOfThrowable(Class type) {
{
return delegate.indexOfThrowable(type, 0); return delegate.indexOfThrowable(type, 0);
} }
public int indexOfThrowable(Class type, int fromIndex) public int indexOfThrowable(Class type, int fromIndex) {
{
return delegate.indexOfThrowable(type, fromIndex); return delegate.indexOfThrowable(type, fromIndex);
} }
public void printStackTrace() public void printStackTrace() {
{
delegate.printStackTrace(); delegate.printStackTrace();
} }
public void printStackTrace(PrintStream out) public void printStackTrace(PrintStream out) {
{
delegate.printStackTrace(out); delegate.printStackTrace(out);
} }
public void printStackTrace(PrintWriter out) public void printStackTrace(PrintWriter out) {
{
delegate.printStackTrace(out); delegate.printStackTrace(out);
} }
public final void printPartialStackTrace(PrintWriter out) public final void printPartialStackTrace(PrintWriter out) {
{
super.printStackTrace(out); super.printStackTrace(out);
} }
} }

View File

@ -1,5 +1,3 @@
package org.apache.commons.lang.exception;
/* ==================================================================== /* ====================================================================
* The Apache Software License, Version 1.1 * The Apache Software License, Version 1.1
* *
@ -53,6 +51,7 @@ package org.apache.commons.lang.exception;
* information on the Apache Software Foundation, please see * information on the Apache Software Foundation, please see
* <http://www.apache.org/>. * <http://www.apache.org/>.
*/ */
package org.apache.commons.lang.exception;
import java.io.PrintStream; import java.io.PrintStream;
import java.io.PrintWriter; import java.io.PrintWriter;
@ -66,11 +65,11 @@ import java.io.PrintWriter;
* @author <a href="mailto:dlr@collab.net">Daniel Rall</a> * @author <a href="mailto:dlr@collab.net">Daniel Rall</a>
* @author <a href="mailto:knielsen@apache.org">Kasper Nielsen</a> * @author <a href="mailto:knielsen@apache.org">Kasper Nielsen</a>
* @author <a href="mailto:steven@caswell.name">Steven Caswell</a> * @author <a href="mailto:steven@caswell.name">Steven Caswell</a>
* @version $Id: NestableRuntimeException.java,v 1.5 2002/09/29 08:20:52 bayard Exp $ * @since 1.0
* @version $Id: NestableRuntimeException.java,v 1.6 2002/12/23 00:15:19 scolebourne Exp $
*/ */
public class NestableRuntimeException extends RuntimeException public class NestableRuntimeException extends RuntimeException implements Nestable {
implements Nestable
{
/** /**
* The helper instance which contains much of the code which we * The helper instance which contains much of the code which we
* delegate to. * delegate to.
@ -87,8 +86,7 @@ public class NestableRuntimeException extends RuntimeException
* Constructs a new <code>NestableRuntimeException</code> without specified * Constructs a new <code>NestableRuntimeException</code> without specified
* detail message. * detail message.
*/ */
public NestableRuntimeException() public NestableRuntimeException() {
{
super(); super();
} }
@ -98,8 +96,7 @@ public class NestableRuntimeException extends RuntimeException
* *
* @param msg the error message * @param msg the error message
*/ */
public NestableRuntimeException(String msg) public NestableRuntimeException(String msg) {
{
super(msg); super(msg);
} }
@ -110,8 +107,7 @@ public class NestableRuntimeException extends RuntimeException
* @param cause the exception or error that caused this exception to be * @param cause the exception or error that caused this exception to be
* thrown * thrown
*/ */
public NestableRuntimeException(Throwable cause) public NestableRuntimeException(Throwable cause) {
{
super(); super();
this.cause = cause; this.cause = cause;
} }
@ -124,82 +120,65 @@ public class NestableRuntimeException extends RuntimeException
* @param cause the exception or error that caused this exception to be * @param cause the exception or error that caused this exception to be
* thrown * thrown
*/ */
public NestableRuntimeException(String msg, Throwable cause) public NestableRuntimeException(String msg, Throwable cause) {
{
super(msg); super(msg);
this.cause = cause; this.cause = cause;
} }
public Throwable getCause() public Throwable getCause() {
{
return cause; return cause;
} }
public String getMessage() public String getMessage() {
{
return delegate.getMessage(super.getMessage()); return delegate.getMessage(super.getMessage());
} }
public String getMessage(int index) public String getMessage(int index) {
{ if (index == 0) {
if (index == 0)
{
return super.getMessage(); return super.getMessage();
} } else {
else
{
return delegate.getMessage(index); return delegate.getMessage(index);
} }
} }
public String[] getMessages() public String[] getMessages() {
{
return delegate.getMessages(); return delegate.getMessages();
} }
public Throwable getThrowable(int index) public Throwable getThrowable(int index) {
{
return delegate.getThrowable(index); return delegate.getThrowable(index);
} }
public int getThrowableCount() public int getThrowableCount() {
{
return delegate.getThrowableCount(); return delegate.getThrowableCount();
} }
public Throwable[] getThrowables() public Throwable[] getThrowables() {
{
return delegate.getThrowables(); return delegate.getThrowables();
} }
public int indexOfThrowable(Class type) public int indexOfThrowable(Class type) {
{
return delegate.indexOfThrowable(type, 0); return delegate.indexOfThrowable(type, 0);
} }
public int indexOfThrowable(Class type, int fromIndex) public int indexOfThrowable(Class type, int fromIndex) {
{
return delegate.indexOfThrowable(type, fromIndex); return delegate.indexOfThrowable(type, fromIndex);
} }
public void printStackTrace() public void printStackTrace() {
{
delegate.printStackTrace(); delegate.printStackTrace();
} }
public void printStackTrace(PrintStream out) public void printStackTrace(PrintStream out) {
{
delegate.printStackTrace(out); delegate.printStackTrace(out);
} }
public void printStackTrace(PrintWriter out) public void printStackTrace(PrintWriter out) {
{
delegate.printStackTrace(out); delegate.printStackTrace(out);
} }
public final void printPartialStackTrace(PrintWriter out) public final void printPartialStackTrace(PrintWriter out) {
{
super.printStackTrace(out); super.printStackTrace(out);
} }
} }