Optimize code

This commit is contained in:
Him188 2020-08-31 19:25:34 +08:00
parent e8bb0f0bb4
commit 0acc99ed42

View File

@ -32,7 +32,9 @@ import java.net.URLClassLoader
internal object JarPluginLoaderImpl :
AbstractFilePluginLoader<JvmPlugin, JvmPluginDescription>(".jar"),
CoroutineScope,
CoroutineScope by MiraiConsole.childScope("JarPluginLoader", CoroutineExceptionHandler { _, throwable ->
JarPluginLoaderImpl.logger.error("Unhandled Jar plugin exception: ${throwable.message}", throwable)
}),
JarPluginLoader {
override val configStorage: PluginDataStorage
@ -44,11 +46,6 @@ internal object JarPluginLoaderImpl :
override val dataStorage: PluginDataStorage
get() = MiraiConsoleImplementationBridge.dataStorageForJarPluginLoader
override val coroutineContext: CoroutineContext =
MiraiConsole.childScopeContext("JarPluginLoader", CoroutineExceptionHandler { _, throwable ->
logger.error("Unhandled Jar plugin exception: ${throwable.message}", throwable)
})
internal val classLoaders: MutableList<ClassLoader> = mutableListOf()
@Suppress("EXTENSION_SHADOWED_BY_MEMBER") // doesn't matter