Drop Throwable#printStackTrace, make it a JVM-specific extension

This commit is contained in:
Alexander Udalov
2015-12-24 03:53:27 +03:00
parent 3d44471659
commit 75f046fa81
14 changed files with 14 additions and 27 deletions
@@ -7,7 +7,15 @@ import java.io.PrintStream
import java.io.PrintWriter
/**
* Allows a stack trace to be printed from Kotlin's [Throwable].
* Prints the stack trace of this throwable to the standard output.
*/
public fun Throwable.printStackTrace(): Unit {
val jlt = this as java.lang.Throwable
jlt.printStackTrace()
}
/**
* Prints the stack trace of this throwable to the specified [writer].
*/
public fun Throwable.printStackTrace(writer: PrintWriter): Unit {
val jlt = this as java.lang.Throwable
@@ -15,7 +23,7 @@ public fun Throwable.printStackTrace(writer: PrintWriter): Unit {
}
/**
* Allows a stack trace to be printed from Kotlin's [Throwable].
* Prints the stack trace of this throwable to the specified [stream].
*/
public fun Throwable.printStackTrace(stream: PrintStream): Unit {
val jlt = this as java.lang.Throwable