Sets the stack trace elements that will be returned by
Throwable.getStackTrace()
and printed by
Throwable.printStackTrace()
and related methods.
This method, which is designed for use by RPC frameworks and other
advanced systems, allows the client to override the default
stack trace that is either generated by
Throwable.fillInStackTrace()
when a throwable is constructed or deserialized when a throwable is
read from a serialization stream.
Parameters:
-
stackTrace - the stack trace elements to be associated with
this
Throwable
. The specified array is copied by this
call; changes in the specified array after the method invocation
returns will have no affect on this
Throwable
's stack
trace.
Throws:
-
NullPointerException - if
stackTrace
is
null
, or if any of the elements of
stackTrace
are
null
Since:
1.4