Throwable stackTrace property instead of getStackTrace() function.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
@file:kotlin.jvm.JvmMultifileClass
|
@file:kotlin.jvm.JvmMultifileClass
|
||||||
@file:kotlin.jvm.JvmName("ExceptionsKt")
|
@file:kotlin.jvm.JvmName("ExceptionsKt")
|
||||||
|
@file:Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")
|
||||||
package kotlin
|
package kotlin
|
||||||
|
|
||||||
import java.io.PrintStream
|
import java.io.PrintStream
|
||||||
@@ -24,8 +25,13 @@ public fun Throwable.printStackTrace(stream: PrintStream): Unit {
|
|||||||
/**
|
/**
|
||||||
* Returns the list of stack trace elements in a Kotlin stack trace.
|
* Returns the list of stack trace elements in a Kotlin stack trace.
|
||||||
*/
|
*/
|
||||||
public fun Throwable.getStackTrace(): Array<StackTraceElement> {
|
@Deprecated("Use 'stackTrace' property instead.", ReplaceWith("stackTrace"))
|
||||||
val jlt = this as java.lang.Throwable
|
@JvmName("getStackTraceDeprecated")
|
||||||
return jlt.getStackTrace()!!
|
public inline fun Throwable.getStackTrace(): Array<StackTraceElement> = stackTrace
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an array of stack trace elements representing the stack trace
|
||||||
|
* pertaining to this throwable.
|
||||||
|
*/
|
||||||
|
public val Throwable.stackTrace: Array<StackTraceElement>
|
||||||
|
get() = (this as java.lang.Throwable).stackTrace!!
|
||||||
|
|||||||
Reference in New Issue
Block a user