Skip to content

Commit

Permalink
Drop inline-only extensions and hide non-inline-only ones that are av…
Browse files Browse the repository at this point in the history
…ailable now as mapped methods of mapped builtins.

 #KT-10887 Fixed
  • Loading branch information
ilya-g committed May 13, 2016
1 parent 9bd3be6 commit 9bfb226
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 23 deletions.
25 changes: 3 additions & 22 deletions libraries/stdlib/src/kotlin/util/Exceptions.kt
@@ -1,33 +1,14 @@
@file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("ExceptionsKt")
@file:kotlin.jvm.JvmVersion
@file:Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")
@file:Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "DeprecatedCallableAddReplaceWith")
package kotlin

import java.io.PrintStream
import java.io.PrintWriter

/**
* Prints the stack trace of this throwable to the standard output.
*/
@kotlin.internal.InlineOnly
public inline fun Throwable.printStackTrace(): Unit = (this as java.lang.Throwable).printStackTrace()

/**
* Prints the stack trace of this throwable to the specified [writer].
*/
@kotlin.internal.InlineOnly
public inline fun Throwable.printStackTrace(writer: PrintWriter): Unit = (this as java.lang.Throwable).printStackTrace(writer)

/**
* Prints the stack trace of this throwable to the specified [stream].
*/
@kotlin.internal.InlineOnly
public inline fun Throwable.printStackTrace(stream: PrintStream): Unit = (this as java.lang.Throwable).printStackTrace(stream)

/**
* Returns an array of stack trace elements representing the stack trace
* pertaining to this throwable.
*/
@Deprecated("Provided for binary compatibility", level = DeprecationLevel.HIDDEN)
public val Throwable.stackTrace: Array<StackTraceElement>
get() = (this as java.lang.Throwable).stackTrace!!
get() = stackTrace!!
8 changes: 8 additions & 0 deletions libraries/stdlib/test/ExceptionTest.kt
Expand Up @@ -41,4 +41,12 @@ class ExceptionTest {
val bytes = assertNotNull(byteBuffer.toByteArray())
assertTrue(bytes.size > 10)
}

@test fun changeStackTrace() {
val exception = RuntimeException("Fail")
var stackTrace = exception.stackTrace
stackTrace = stackTrace.dropLast(1).toTypedArray()
exception.stackTrace = stackTrace
assertArrayNotSameButEquals(stackTrace, exception.stackTrace)
}
}
@@ -1,5 +1,5 @@
public final class kotlin/ExceptionsKt {
public static final fun getStackTrace (Ljava/lang/Throwable;)[Ljava/lang/StackTraceElement;
public static final synthetic fun getStackTrace (Ljava/lang/Throwable;)[Ljava/lang/StackTraceElement;
}

public abstract interface class kotlin/Lazy {
Expand Down

0 comments on commit 9bfb226

Please sign in to comment.