Throwable.SetStackTrace(StackTraceElement[]) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the stack trace elements that will be returned by
#getStackTrace()
and printed by #printStackTrace()
and related methods.
[Android.Runtime.Register("setStackTrace", "([Ljava/lang/StackTraceElement;)V", "GetSetStackTrace_arrayLjava_lang_StackTraceElement_Handler")]
public virtual void SetStackTrace (Java.Lang.StackTraceElement[] stackTrace);
[<Android.Runtime.Register("setStackTrace", "([Ljava/lang/StackTraceElement;)V", "GetSetStackTrace_arrayLjava_lang_StackTraceElement_Handler")>]
abstract member SetStackTrace : Java.Lang.StackTraceElement[] -> unit
override this.SetStackTrace : Java.Lang.StackTraceElement[] -> unit
Parameters
- stackTrace
- StackTraceElement[]
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.
- Attributes
Exceptions
if any element in trace
is null
.
Remarks
Sets the stack trace elements that will be returned by #getStackTrace()
and printed by #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 #fillInStackTrace()
when a throwable is constructed or deserialized when a throwable is read from a serialization stream.
If the stack trace of this Throwable
Throwable#Throwable(String, Throwable, boolean, boolean) is not writable, calling this method has no effect other than validating its argument.
Added in 1.4.
Java documentation for java.lang.Throwable.setStackTrace(java.lang.StackTraceElement[])
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.