Use java.lang.Throwable.setStackTrace. Proper fix for #543.

This commit is contained in:
Eugene Vigdorchik
2012-11-15 10:14:59 -05:00
committed by Mark Harrah
parent 1c1e5c4977
commit 960d17c358
3 changed files with 13 additions and 12 deletions
@@ -48,17 +48,15 @@ public class ForkMain {
}
}
}
static class ForkError extends Exception implements Serializable {
static class ForkError extends Exception {
private String originalMessage;
private StackTraceElement[] originalStackTrace;
private ForkError cause;
ForkError(Throwable t) {
originalMessage = t.getMessage();
originalStackTrace = t.getStackTrace();
setStackTrace(t.getStackTrace());
if (t.getCause() != null) cause = new ForkError(t.getCause());
}
public String getMessage() { return originalMessage; }
public StackTraceElement[] getStackTrace() { return originalStackTrace; }
public Exception getCause() { return cause; }
}
static class ForkEvent implements Event, Serializable {