From 40a9d99496e098562f090fb7ffce9e749011b131 Mon Sep 17 00:00:00 2001 From: Benjamin Culkin Date: Mon, 20 May 2024 17:58:16 -0400 Subject: Formatting pass --- .../foundation/internal/WotonomyException.java | 135 +++++++++------------ 1 file changed, 59 insertions(+), 76 deletions(-) (limited to 'projects/net.wotonomy.foundation/src/main/java/net/wotonomy/foundation/internal/WotonomyException.java') diff --git a/projects/net.wotonomy.foundation/src/main/java/net/wotonomy/foundation/internal/WotonomyException.java b/projects/net.wotonomy.foundation/src/main/java/net/wotonomy/foundation/internal/WotonomyException.java index e2210d0..21b47b3 100644 --- a/projects/net.wotonomy.foundation/src/main/java/net/wotonomy/foundation/internal/WotonomyException.java +++ b/projects/net.wotonomy.foundation/src/main/java/net/wotonomy/foundation/internal/WotonomyException.java @@ -22,113 +22,96 @@ import java.io.PrintStream; import java.io.PrintWriter; /** -* This is a simple RuntimeException that can encapsulate -* another throwable. Behaves as a normal RuntimeException -* except that it prints a stack trace of the wrapped -* throwable if one is specified. -* -* Intended to be used anytime you'd -* report an exception with System.out.println: that is, -* for debugging and non-user-visible exceptions. -* -* @author michael@mpowers.net -* @author $Author: cgruber $ -* @version $Revision: 893 $ -*/ + * This is a simple RuntimeException that can encapsulate another throwable. + * Behaves as a normal RuntimeException except that it prints a stack trace of + * the wrapped throwable if one is specified. + * + * Intended to be used anytime you'd report an exception with + * System.out.println: that is, for debugging and non-user-visible exceptions. + * + * @author michael@mpowers.net + * @author $Author: cgruber $ + * @version $Revision: 893 $ + */ -public class WotonomyException extends RuntimeException -{ +public class WotonomyException extends RuntimeException { protected String message; protected Throwable wrappedThrowable; - + /** - * Default constructor. - */ - public WotonomyException() - { + * Default constructor. + */ + public WotonomyException() { super(); message = null; - wrappedThrowable = null; + wrappedThrowable = null; } - + /** - * Standard constructor with message. - */ - public WotonomyException( String aMessage ) - { - super( aMessage ); + * Standard constructor with message. + */ + public WotonomyException(String aMessage) { + super(aMessage); message = aMessage; wrappedThrowable = null; } - + /** - * Specifies a throwable to wrap. - */ - public WotonomyException( Throwable aThrowable ) - { + * Specifies a throwable to wrap. + */ + public WotonomyException(Throwable aThrowable) { super(); message = null; wrappedThrowable = aThrowable; } - + /** - * Specifies a message and a throwable to wrap. - */ - public WotonomyException( String aMessage, Throwable aThrowable ) - { - super( aMessage ); + * Specifies a message and a throwable to wrap. + */ + public WotonomyException(String aMessage, Throwable aThrowable) { + super(aMessage); message = aMessage; wrappedThrowable = aThrowable; } - - /** - * Returns the wrapped throwable. - */ - public Throwable getWrappedThrowable() - { - return wrappedThrowable; - } - - public void printStackTrace(PrintWriter s) - { - if ( message != null ) - { - s.println( "Exception: " + message ); + + /** + * Returns the wrapped throwable. + */ + public Throwable getWrappedThrowable() { + return wrappedThrowable; + } + + public void printStackTrace(PrintWriter s) { + if (message != null) { + s.println("Exception: " + message); } - if ( wrappedThrowable != null ) - { - wrappedThrowable.printStackTrace( s ); + if (wrappedThrowable != null) { + wrappedThrowable.printStackTrace(s); return; } - super.printStackTrace( s ); + super.printStackTrace(s); } - - public void printStackTrace(PrintStream s) - { - if ( message != null ) - { - s.println( "Exception: " + message ); + + public void printStackTrace(PrintStream s) { + if (message != null) { + s.println("Exception: " + message); } - if ( wrappedThrowable != null ) - { - wrappedThrowable.printStackTrace( s ); + if (wrappedThrowable != null) { + wrappedThrowable.printStackTrace(s); return; } - super.printStackTrace( s ); + super.printStackTrace(s); } - - public void printStackTrace() - { - if ( message != null ) - { - System.err.println( "Exception: " + message ); + + public void printStackTrace() { + if (message != null) { + System.err.println("Exception: " + message); } - if ( wrappedThrowable != null ) - { - wrappedThrowable.printStackTrace(); + if (wrappedThrowable != null) { + wrappedThrowable.printStackTrace(); return; } super.printStackTrace(); } - + } -- cgit v1.2.3