add methods to Throwable

This commit is contained in:
Joel Dice
2009-08-13 09:03:04 -06:00
parent 017116d060
commit f96fa82607

View File

@ -55,6 +55,10 @@ public class Throwable implements Serializable {
return message; return message;
} }
public String getLocalizedMessage() {
return getMessage();
}
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(getClass().getName()); sb.append(getClass().getName());
@ -79,6 +83,10 @@ public class Throwable implements Serializable {
return resolveTrace(); return resolveTrace();
} }
public void setStackTrace(StackTraceElement[] trace) {
this.trace = trace;
}
public void printStackTrace(PrintStream out) { public void printStackTrace(PrintStream out) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
printStackTrace(sb, System.getProperty("line.separator")); printStackTrace(sb, System.getProperty("line.separator"));