public class ReportedException extends java.lang.RuntimeException
It is used to capture more information about an exception that was already thrown.
BugReport
,
Serialized FormModifier and Type | Class and Description |
---|---|
private static class |
ReportedException.Section |
private static class |
ReportedException.SectionEntry |
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.Thread,java.lang.StackTraceElement[]> |
allStackTraces
We capture all stack traces on exception creation.
|
private java.lang.Thread |
caughtOnThread |
private java.lang.Throwable |
exception |
private static int |
MAX_COLLECTION_ENTRIES |
private java.lang.String |
methodWarningFrom |
private java.util.LinkedList<ReportedException.Section> |
sections |
private static long |
serialVersionUID |
Constructor and Description |
---|
ReportedException(java.lang.Throwable exception) |
ReportedException(java.lang.Throwable exception,
java.lang.Thread caughtOnThread) |
Modifier and Type | Method and Description |
---|---|
private static boolean |
hasSameStackTrace(java.util.Set<java.lang.Throwable> dejaVu,
java.lang.Throwable e1,
java.lang.Throwable e2) |
boolean |
isSame(ReportedException e)
Checks if this exception is considered the same as an other exception.
|
private static java.lang.String |
makeCollectionNice(java.util.Collection<?> value) |
private static java.lang.String |
niceThreadName(java.lang.Thread thread) |
void |
printReportDataTo(java.io.PrintWriter out)
Prints the captured data of this report to a
PrintWriter . |
void |
printReportStackTo(java.io.PrintWriter out)
Prints the stack trace of this report to a
PrintWriter . |
void |
printReportThreadsTo(java.io.PrintWriter out)
Prints the stack traces for other threads of this report to a
PrintWriter . |
ReportedException |
put(java.lang.String key,
java.lang.Object value)
Adds some debug values to this exception.
|
void |
startSection(java.lang.String sectionName)
Starts a new debug data section.
|
java.lang.String |
toString() |
void |
warn()
Displays a warning for this exception.
|
private static final int MAX_COLLECTION_ENTRIES
private static final long serialVersionUID
private final transient java.util.Map<java.lang.Thread,java.lang.StackTraceElement[]> allStackTraces
private final transient java.util.LinkedList<ReportedException.Section> sections
private final transient java.lang.Thread caughtOnThread
private final java.lang.Throwable exception
private java.lang.String methodWarningFrom
ReportedException(java.lang.Throwable exception)
ReportedException(java.lang.Throwable exception, java.lang.Thread caughtOnThread)
public void warn()
public void startSection(java.lang.String sectionName)
sectionName
- The section name.public void printReportDataTo(java.io.PrintWriter out)
PrintWriter
.out
- The writer to print to.public void printReportStackTo(java.io.PrintWriter out)
PrintWriter
.out
- The writer to print to.public void printReportThreadsTo(java.io.PrintWriter out)
PrintWriter
.out
- The writer to print to.private static java.lang.String niceThreadName(java.lang.Thread thread)
public boolean isSame(ReportedException e)
e
- The exception to check against.true
if they are considered the same.private static boolean hasSameStackTrace(java.util.Set<java.lang.Throwable> dejaVu, java.lang.Throwable e1, java.lang.Throwable e2)
public ReportedException put(java.lang.String key, java.lang.Object value)
key
- The key to add this for. Does not need to be unique but it would be nice.value
- The value.private static java.lang.String makeCollectionNice(java.util.Collection<?> value)
public java.lang.String toString()
toString
in class java.lang.Throwable