[core] Move structureToString from .core.utils.debug to .core.utils

due to compiler bug.
This commit is contained in:
Him188 2022-08-27 01:21:14 +08:00
parent 965ab57aaa
commit f4db93745d
No known key found for this signature in database
GPG Key ID: BA439CDDCF652375
26 changed files with 21 additions and 30 deletions

View File

@ -9,9 +9,8 @@
@file:JvmName("StructureToStringTransformerKt_common")
package net.mamoe.mirai.utils.debug
package net.mamoe.mirai.utils
import net.mamoe.mirai.utils.loadService
import kotlin.jvm.JvmName
public interface StructureToStringTransformer {

View File

@ -7,7 +7,7 @@
* https://github.com/mamoe/mirai/blob/dev/LICENSE
*/
package net.mamoe.mirai.utils.debug
package net.mamoe.mirai.utils
internal actual fun getPlatformDefaultStructureToStringTransformer(): StructureToStringTransformer? {
return StructureToStringTransformerLegacy()

View File

@ -7,10 +7,9 @@
* https://github.com/mamoe/mirai/blob/dev/LICENSE
*/
package net.mamoe.mirai.utils.debug
package net.mamoe.mirai.utils
import kotlinx.serialization.Transient
import net.mamoe.mirai.utils.toUHexString
import java.lang.reflect.Modifier
import kotlin.reflect.KClass
import kotlin.reflect.KProperty

View File

@ -7,7 +7,7 @@
* https://github.com/mamoe/mirai/blob/dev/LICENSE
*/
package net.mamoe.mirai.utils.debug
package net.mamoe.mirai.utils
internal actual fun getPlatformDefaultStructureToStringTransformer(): StructureToStringTransformer? {
return null

View File

@ -40,7 +40,6 @@ import net.mamoe.mirai.internal.utils.C2CPkgMsgParsingCache
import net.mamoe.mirai.message.MessageReceipt
import net.mamoe.mirai.message.data.*
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.debug.structureToString
import kotlin.contracts.contract
import kotlin.coroutines.CoroutineContext

View File

@ -19,9 +19,9 @@ import net.mamoe.mirai.internal.network.protocol.data.proto.NotOnlineImageExtPb
import net.mamoe.mirai.internal.utils.io.serialization.loadAs
import net.mamoe.mirai.message.data.Image
import net.mamoe.mirai.message.data.ImageType
import net.mamoe.mirai.utils.debug.structureToString
import net.mamoe.mirai.utils.generateImageId
import net.mamoe.mirai.utils.generateImageIdFromResourceId
import net.mamoe.mirai.utils.structureToString
internal sealed interface OnlineImage : Image, ConstOriginUrlAware {
override val originUrl: String

View File

@ -45,7 +45,6 @@ import net.mamoe.mirai.message.data.*
import net.mamoe.mirai.message.data.visitor.RecursiveMessageVisitor
import net.mamoe.mirai.message.data.visitor.accept
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.debug.structureToString
import kotlin.reflect.KClass
internal interface MessageProtocolFacade {

View File

@ -17,7 +17,6 @@ import net.mamoe.mirai.internal.pipeline.*
import net.mamoe.mirai.message.data.Message
import net.mamoe.mirai.message.data.MessageSourceKind
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.debug.structureToStringAndDesensitizeIfAvailable
import kotlin.coroutines.RestrictsSuspension
internal interface MessageDecoderPipeline :

View File

@ -37,9 +37,9 @@ import net.mamoe.mirai.message.data.MessageSourceKind
import net.mamoe.mirai.message.data.OnlineMessageSource
import net.mamoe.mirai.message.data.visitor.MessageVisitor
import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.utils.debug.structureToString
import net.mamoe.mirai.utils.encodeBase64
import net.mamoe.mirai.utils.mapToIntArray
import net.mamoe.mirai.utils.structureToString
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@Serializable(OnlineMessageSourceFromFriendImpl.Serializer::class)

View File

@ -21,7 +21,6 @@ import net.mamoe.mirai.internal.network.protocol.data.proto.OnlinePushTrans
import net.mamoe.mirai.internal.network.protocol.data.proto.Structmsg
import net.mamoe.mirai.internal.network.protocol.packet.chat.NewContact
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.debug.structureToString
internal class UnconsumedNoticesAlerter(
logger: MiraiLogger,

View File

@ -30,7 +30,6 @@ import net.mamoe.mirai.internal.network.protocol.data.proto.TroopTips0x857
import net.mamoe.mirai.internal.utils.io.serialization.loadAs
import net.mamoe.mirai.internal.utils.parseToMessageDataList
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.debug.structureToString
import kotlin.jvm.JvmName
internal class GroupNotificationProcessor(

View File

@ -36,8 +36,8 @@ import net.mamoe.mirai.internal.utils.parseToMessageDataList
import net.mamoe.mirai.internal.utils.toMemberInfo
import net.mamoe.mirai.utils.MiraiLogger
import net.mamoe.mirai.utils.context
import net.mamoe.mirai.utils.debug.structureToString
import net.mamoe.mirai.utils.read
import net.mamoe.mirai.utils.structureToString
/**

View File

@ -36,7 +36,6 @@ import net.mamoe.mirai.internal.network.protocol.packet.list.FriendList.GetFrien
import net.mamoe.mirai.internal.utils.io.ProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.loadAs
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.debug.structureToString
/**
* All [FriendEvent] except [FriendMessageEvent]

View File

@ -35,7 +35,7 @@ import net.mamoe.mirai.internal.utils.io.serialization.loadAs
import net.mamoe.mirai.message.data.PlainText
import net.mamoe.mirai.message.data.buildMessageChain
import net.mamoe.mirai.utils.context
import net.mamoe.mirai.utils.debug.structureToString
import net.mamoe.mirai.utils.structureToString
/**
* @see OtherClientOnlineEvent

View File

@ -19,9 +19,9 @@ import net.mamoe.mirai.internal.utils.io.NestedStructureDesensitizer
import net.mamoe.mirai.internal.utils.io.ProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.loadAs
import net.mamoe.mirai.utils.EMPTY_BYTE_ARRAY
import net.mamoe.mirai.utils.debug.structureToStringIfAvailable
import net.mamoe.mirai.utils.inflate
import net.mamoe.mirai.utils.isSameType
import net.mamoe.mirai.utils.structureToStringIfAvailable
import kotlin.jvm.JvmField
@Serializable

View File

@ -22,8 +22,8 @@ import net.mamoe.mirai.internal.network.protocol.packet.OutgoingPacketFactory
import net.mamoe.mirai.internal.network.protocol.packet.buildOutgoingUniPacket
import net.mamoe.mirai.internal.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.writeProtoBuf
import net.mamoe.mirai.utils.debug.structureToString
import net.mamoe.mirai.utils.md5
import net.mamoe.mirai.utils.structureToString
internal class MessageValidationData(
val data: ByteArray,

View File

@ -43,7 +43,6 @@ import net.mamoe.mirai.internal.network.protocol.packet.*
import net.mamoe.mirai.internal.utils.NetworkType
import net.mamoe.mirai.internal.utils.io.serialization.*
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.debug.structureToString
@Suppress("EnumEntryName", "unused")
internal enum class RegPushReason {

View File

@ -25,7 +25,7 @@ import net.mamoe.mirai.internal.network.protocol.packet.login.wtlogin.orEmpty
import net.mamoe.mirai.internal.utils.crypto.TEA
import net.mamoe.mirai.internal.utils.printStructure
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.debug.structureToString
import net.mamoe.mirai.utils.structureToString
internal class WtLogin {
/**

View File

@ -14,7 +14,7 @@ import net.mamoe.mirai.internal.message.contextualBugReportException
import net.mamoe.mirai.internal.message.protocol.outgoing.OutgoingMessagePipelineContext
import net.mamoe.mirai.internal.network.components.NoticeProcessor
import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.debug.structureToStringAndDesensitizeIfAvailable
import net.mamoe.mirai.utils.structureToStringAndDesensitizeIfAvailable
import kotlin.jvm.JvmInline
internal interface Processor<C : ProcessorPipelineContext<D, *>, D> : PipelineConsumptionMarker {

View File

@ -13,8 +13,8 @@ package net.mamoe.mirai.internal.utils
import net.mamoe.mirai.utils.MiraiLogger
import net.mamoe.mirai.utils.debug
import net.mamoe.mirai.utils.debug.StructureToStringTransformer
import net.mamoe.mirai.utils.debug.structureToString
import net.mamoe.mirai.utils.StructureToStringTransformer
import net.mamoe.mirai.utils.structureToString
private val SoutvLogger: MiraiLogger by lazy {

View File

@ -16,7 +16,7 @@ import net.mamoe.mirai.internal.message.DeepMessageRefiner.refineDeep
import net.mamoe.mirai.internal.message.SimpleRefineContext
import net.mamoe.mirai.internal.test.runBlockingUnit
import net.mamoe.mirai.message.data.*
import net.mamoe.mirai.utils.debug.structureToString
import net.mamoe.mirai.utils.structureToString
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue

View File

@ -20,7 +20,7 @@ import net.mamoe.mirai.internal.test.AbstractTest
import net.mamoe.mirai.message.MessageSerializers
import net.mamoe.mirai.message.data.*
import net.mamoe.mirai.utils.cast
import net.mamoe.mirai.utils.debug.structureToString
import net.mamoe.mirai.utils.structureToString
import net.mamoe.mirai.utils.mapToByteArray
import kotlin.test.*

View File

@ -16,7 +16,7 @@ import net.mamoe.mirai.message.MessageSerializers
import net.mamoe.mirai.message.data.MessageChain.Companion.serializeToJsonString
import net.mamoe.mirai.message.data.SingleMessage
import net.mamoe.mirai.message.data.messageChainOf
import net.mamoe.mirai.utils.debug.structureToStringIfAvailable
import net.mamoe.mirai.utils.structureToStringIfAvailable
import kotlin.test.assertNotNull
import kotlin.test.asserter

View File

@ -17,8 +17,8 @@ import net.mamoe.mirai.internal.testFramework.codegen.visitors.OptimizeByteArray
import net.mamoe.mirai.internal.testFramework.codegen.visitors.renderToString
import net.mamoe.mirai.internal.testFramework.desensitizer.DesensitizationVisitor
import net.mamoe.mirai.internal.testFramework.desensitizer.Desensitizer
import net.mamoe.mirai.utils.debug.StructureToStringTransformer
import net.mamoe.mirai.utils.debug.StructureToStringTransformerLegacy
import net.mamoe.mirai.utils.StructureToStringTransformer
import net.mamoe.mirai.utils.StructureToStringTransformerLegacy
internal class StructureToStringTransformerNew : StructureToStringTransformer {
private val legacy = StructureToStringTransformerLegacy()

View File

@ -11,8 +11,8 @@ package net.mamoe.mirai.internal.utils.test
import net.mamoe.mirai.internal.test.AbstractTest
import net.mamoe.mirai.internal.utils.StructureToStringTransformerNew
import net.mamoe.mirai.utils.debug.StructureToStringTransformer
import net.mamoe.mirai.utils.debug.structureToString
import net.mamoe.mirai.utils.StructureToStringTransformer
import net.mamoe.mirai.utils.structureToString
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertIs