mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Fix build and fix warnings
This commit is contained in:
parent
b17e60cbc9
commit
662013e4ec
@ -36,7 +36,7 @@ internal open class MultiFilePluginDataStorageImpl(
|
||||
val text = getPluginDataFile(holder, instance).readText()
|
||||
if (text.isNotBlank()) {
|
||||
logger.warning { "Deserializing $text" }
|
||||
Yaml.default.decodeFromString(instance.updaterSerializer, text)
|
||||
Yaml.decodeFromString(instance.updaterSerializer, text)
|
||||
} else {
|
||||
this.store(holder, instance) // save an initial copy
|
||||
}
|
||||
@ -68,7 +68,7 @@ internal open class MultiFilePluginDataStorageImpl(
|
||||
encodeDefaults = true
|
||||
}
|
||||
|
||||
private val yaml = Yaml.default
|
||||
private val yaml = Yaml
|
||||
|
||||
@ConsoleExperimentalApi
|
||||
public override fun store(holder: PluginDataHolder, instance: PluginData) {
|
||||
|
@ -48,7 +48,7 @@ internal inline fun <T : Any> T?.ifNull(block: () -> T): T {
|
||||
return this ?: block()
|
||||
}
|
||||
|
||||
@Suppress("DeprecatedCallableAddReplaceWith", "UnusedParameter")
|
||||
@Suppress("DeprecatedCallableAddReplaceWith", "UnusedParameter", "UNUSED_PARAMETER")
|
||||
@Deprecated("Useless ifNull on not null value.")
|
||||
@JvmName("ifNull1")
|
||||
internal inline fun <T : Any> T.ifNull(block: () -> T): T = this
|
||||
|
@ -52,7 +52,7 @@ public interface JvmPluginDescription : PluginDescription {
|
||||
|
||||
val bytes = stream.use { it.readBytes() }
|
||||
|
||||
return Yaml.default.decodeFromString(SimpleJvmPluginDescription.SerialData.serializer(), String(bytes)).toJvmPluginDescription()
|
||||
return Yaml.decodeFromString(SimpleJvmPluginDescription.SerialData.serializer(), String(bytes)).toJvmPluginDescription()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
* https://github.com/mamoe/mirai/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
@file:Suppress("unused")
|
||||
@file:Suppress("unused", "UNUSED_PARAMETER")
|
||||
|
||||
package net.mamoe.mirai.console.command
|
||||
|
||||
|
@ -62,5 +62,5 @@ class WrapWithResourceUseCallJavaIntention : SelfTargetingIntention<PsiMethodCal
|
||||
}
|
||||
|
||||
fun PsiElement.isJavaVersionAtLeast(version: JavaSdkVersion): Boolean {
|
||||
return this.module?.getService(JavaVersionService::class.java)?.isAtLeast(this, JavaSdkVersion.JDK_1_9) == true
|
||||
return this.module?.getService(JavaVersionService::class.java)?.isAtLeast(this, version) == true
|
||||
}
|
@ -11,7 +11,7 @@ package net.mamoe.mirai.console.intellij.resolve
|
||||
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.*
|
||||
import com.intellij.psi.util.parentsWithSelf
|
||||
import com.intellij.psi.util.parents
|
||||
import net.mamoe.mirai.console.compiler.common.castOrNull
|
||||
import net.mamoe.mirai.console.compiler.common.resolve.*
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
@ -68,7 +68,7 @@ val KtPureClassOrObject.allSuperTypes: Sequence<KtSuperTypeListEntry>
|
||||
yieldAll(superTypeListEntries)
|
||||
for (list in superTypeListEntries.asSequence()) {
|
||||
yieldAll(
|
||||
(list.typeAsUserType?.referenceExpression?.resolve()?.parentsWithSelf?.filterIsInstance<KtClass>()
|
||||
(list.typeAsUserType?.referenceExpression?.resolve()?.parents(true)?.filterIsInstance<KtClass>()
|
||||
?.firstOrNull())?.allSuperTypes.orEmpty()
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user