Package org.jboss.util
Class NestedThrowable.Util
- java.lang.Object
-
- org.jboss.util.NestedThrowable.Util
-
- Enclosing interface:
- NestedThrowable
public static final class NestedThrowable.Util extends java.lang.Object
Utilitiy methods for the various flavors ofNestedThrowable
.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.jboss.logging.Logger
pvtLog
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkNested(NestedThrowable parent, java.lang.Throwable child)
Check and possibly warn if the nested exception type is the same as the parent type (duplicate nesting).protected static boolean
getBoolean(java.lang.String name, boolean defaultValue)
A helper to get a boolean property.private static org.jboss.logging.Logger
getLogger()
Something is very broken with class nesting, which can sometimes leave log uninitialized durring one of the following method calls.static java.lang.String
getMessage(java.lang.String msg, java.lang.Throwable nested)
Returns a formated message for the given detail message and nestedThrowable
.static void
print(java.lang.Throwable nested, java.io.PrintStream stream)
Prints the nestedThrowable
to the given stream.static void
print(java.lang.Throwable nested, java.io.PrintWriter writer)
Prints the nestedThrowable
to the given writer.
-
-
-
Method Detail
-
getLogger
private static org.jboss.logging.Logger getLogger()
Something is very broken with class nesting, which can sometimes leave log uninitialized durring one of the following method calls.This is a HACK to keep those methods from NPE until this problem can be resolved.
-
getBoolean
protected static boolean getBoolean(java.lang.String name, boolean defaultValue)
A helper to get a boolean property.
-
checkNested
public static void checkNested(NestedThrowable parent, java.lang.Throwable child)
Check and possibly warn if the nested exception type is the same as the parent type (duplicate nesting).
-
getMessage
public static java.lang.String getMessage(java.lang.String msg, java.lang.Throwable nested)
Returns a formated message for the given detail message and nestedThrowable
.- Parameters:
msg
- Detail message.nested
- NestedThrowable
.- Returns:
- Formatted message.
-
print
public static void print(java.lang.Throwable nested, java.io.PrintStream stream)
Prints the nestedThrowable
to the given stream.- Parameters:
nested
- NestedThrowable
.stream
- Stream to print to.
-
print
public static void print(java.lang.Throwable nested, java.io.PrintWriter writer)
Prints the nestedThrowable
to the given writer.- Parameters:
nested
- NestedThrowable
.writer
- Writer to print to.
-
-