aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-07-14 18:29:48 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-07-15 08:16:05 +0200
commit3fc8223f92ba140dbfa8e8371157b3bf782bda85 (patch)
treed45a9dd4c701f79cc8717b132e9fe0e2a2ddcd22 /runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka
parent2c9fe4c22e13f4d84f4085563715162fcdf2ec85 (diff)
downloaddokka-3fc8223f92ba140dbfa8e8371157b3bf782bda85.tar.gz
dokka-3fc8223f92ba140dbfa8e8371157b3bf782bda85.tar.bz2
dokka-3fc8223f92ba140dbfa8e8371157b3bf782bda85.zip
Mark `DokkaBootstrap` with `Throws` annotation to avoid "UndeclaredThrowableException" when used with automagicProxy
Diffstat (limited to 'runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka')
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ProxyUtils.kt17
1 files changed, 7 insertions, 10 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ProxyUtils.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ProxyUtils.kt
index 85b6ea3b..468f597f 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ProxyUtils.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ProxyUtils.kt
@@ -1,9 +1,6 @@
package org.jetbrains.dokka.gradle
-import java.lang.reflect.InvocationHandler
-import java.lang.reflect.InvocationTargetException
-import java.lang.reflect.Method
-import java.lang.reflect.Proxy
+import java.lang.reflect.*
/**
@@ -14,7 +11,7 @@ import java.lang.reflect.Proxy
*/
@Suppress("UNCHECKED_CAST")
internal inline fun <reified T : Any> automagicTypedProxy(targetClassLoader: ClassLoader, delegate: Any): T =
- automagicProxy(targetClassLoader, T::class.java, delegate) as T
+ automagicProxy(targetClassLoader, T::class.java, delegate) as T
/**
@@ -25,11 +22,11 @@ internal inline fun <reified T : Any> automagicTypedProxy(targetClassLoader: Cla
*
*/
internal fun automagicProxy(targetClassLoader: ClassLoader, targetType: Class<*>, delegate: Any): Any =
- Proxy.newProxyInstance(
- targetClassLoader,
- arrayOf(targetType),
- DelegatedInvocationHandler(delegate)
- )
+ Proxy.newProxyInstance(
+ targetClassLoader,
+ arrayOf(targetType),
+ DelegatedInvocationHandler(delegate)
+ )
internal class DelegatedInvocationHandler(private val delegate: Any) : InvocationHandler {