From 0effd3c05d4bded1c3f7e27d135ebbfdf1565b27 Mon Sep 17 00:00:00 2001 From: "Ilya.Usov" Date: Fri, 3 Nov 2023 13:06:21 +0100 Subject: [PATCH] Update gold --- .../asis/CallGeneratedCodeRoot.kt | 22 +++- .../reversed/CallGeneratedCodeRoot.kt | 22 +++- .../asis/DefaultNlsValuesRoot.kt | 4 +- .../reversed/DefaultNlsValuesRoot.kt | 4 +- .../exampleModelTest/asis/ExampleModelNova.kt | 121 +++++++++++++----- .../reversed/ExampleModelNova.kt | 121 +++++++++++++----- .../extensionTest/asis/ExtensionRoot.kt | 7 +- .../extensionTest/reversed/ExtensionRoot.kt | 7 +- .../asis/InternedModelsRoot.kt | 7 +- .../reversed/InternedModelsRoot.kt | 7 +- .../perClientId/asis/PerClientIdRoot.kt | 10 +- .../perClientId/reversed/PerClientIdRoot.kt | 10 +- .../asis/RecursivePolymorphicModel.kt | 7 +- .../reversed/RecursivePolymorphicModel.kt | 7 +- .../Reflection/data/Generated/RefExt.cs | 2 +- .../Reflection/data/Generated/RefRoot.cs | 2 +- 16 files changed, 262 insertions(+), 98 deletions(-) diff --git a/rd-kt/rd-gen/src/test/resources/testData/callGeneratedCode/asis/CallGeneratedCodeRoot.kt b/rd-kt/rd-gen/src/test/resources/testData/callGeneratedCode/asis/CallGeneratedCodeRoot.kt index 36f2caf7c..1c307719d 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/callGeneratedCode/asis/CallGeneratedCodeRoot.kt +++ b/rd-kt/rd-gen/src/test/resources/testData/callGeneratedCode/asis/CallGeneratedCodeRoot.kt @@ -25,9 +25,10 @@ class CallGeneratedCodeRoot private constructor( companion object : ISerializersOwner { override fun registerSerializersCore(serializers: ISerializers) { - serializers.register(Editor) - serializers.register(Es.marshaller) - serializers.register(Abc) + val classLoader = javaClass.classLoader + serializers.register(LazyCompanionMarshaller(RdId(18933576544), classLoader, "call.generated.code.root.Editor")) + serializers.register(LazyCompanionMarshaller(RdId(20513), classLoader, "call.generated.code.root.Es")) + serializers.register(LazyCompanionMarshaller(RdId(631631), classLoader, "call.generated.code.root.Abc")) CallGeneratedCodeRoot.register(serializers) } @@ -72,6 +73,7 @@ class Abc ( companion object : IMarshaller { override val _type: KClass = Abc::class + override val id: RdId get() = RdId(631631) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Abc { @@ -127,6 +129,7 @@ class Editor private constructor( companion object : IMarshaller { override val _type: KClass = Editor::class + override val id: RdId get() = RdId(18933576544) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Editor { @@ -213,8 +216,19 @@ enum class Es { b, c; - companion object { + companion object : IMarshaller> { val marshaller = FrameworkMarshallers.enumSet() + + override val _type: KClass = Es::class + override val id: RdId get() = RdId(20513) + + override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): EnumSet { + return marshaller.read(ctx, buffer) + } + + override fun write(ctx: SerializationCtx, buffer: AbstractBuffer, value: EnumSet) { + marshaller.write(ctx, buffer, value) + } } } diff --git a/rd-kt/rd-gen/src/test/resources/testData/callGeneratedCode/reversed/CallGeneratedCodeRoot.kt b/rd-kt/rd-gen/src/test/resources/testData/callGeneratedCode/reversed/CallGeneratedCodeRoot.kt index 36f2caf7c..1c307719d 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/callGeneratedCode/reversed/CallGeneratedCodeRoot.kt +++ b/rd-kt/rd-gen/src/test/resources/testData/callGeneratedCode/reversed/CallGeneratedCodeRoot.kt @@ -25,9 +25,10 @@ class CallGeneratedCodeRoot private constructor( companion object : ISerializersOwner { override fun registerSerializersCore(serializers: ISerializers) { - serializers.register(Editor) - serializers.register(Es.marshaller) - serializers.register(Abc) + val classLoader = javaClass.classLoader + serializers.register(LazyCompanionMarshaller(RdId(18933576544), classLoader, "call.generated.code.root.Editor")) + serializers.register(LazyCompanionMarshaller(RdId(20513), classLoader, "call.generated.code.root.Es")) + serializers.register(LazyCompanionMarshaller(RdId(631631), classLoader, "call.generated.code.root.Abc")) CallGeneratedCodeRoot.register(serializers) } @@ -72,6 +73,7 @@ class Abc ( companion object : IMarshaller { override val _type: KClass = Abc::class + override val id: RdId get() = RdId(631631) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Abc { @@ -127,6 +129,7 @@ class Editor private constructor( companion object : IMarshaller { override val _type: KClass = Editor::class + override val id: RdId get() = RdId(18933576544) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Editor { @@ -213,8 +216,19 @@ enum class Es { b, c; - companion object { + companion object : IMarshaller> { val marshaller = FrameworkMarshallers.enumSet() + + override val _type: KClass = Es::class + override val id: RdId get() = RdId(20513) + + override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): EnumSet { + return marshaller.read(ctx, buffer) + } + + override fun write(ctx: SerializationCtx, buffer: AbstractBuffer, value: EnumSet) { + marshaller.write(ctx, buffer, value) + } } } diff --git a/rd-kt/rd-gen/src/test/resources/testData/defaultNlsValues/asis/DefaultNlsValuesRoot.kt b/rd-kt/rd-gen/src/test/resources/testData/defaultNlsValues/asis/DefaultNlsValuesRoot.kt index 84c582426..eb3f20946 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/defaultNlsValues/asis/DefaultNlsValuesRoot.kt +++ b/rd-kt/rd-gen/src/test/resources/testData/defaultNlsValues/asis/DefaultNlsValuesRoot.kt @@ -25,7 +25,8 @@ class DefaultNlsValuesRoot private constructor( companion object : ISerializersOwner { override fun registerSerializersCore(serializers: ISerializers) { - serializers.register(ClassModel) + val classLoader = javaClass.classLoader + serializers.register(LazyCompanionMarshaller(RdId(17439278522805508), classLoader, "DefaultNlsValuesRoot.ClassModel")) DefaultNlsValuesRoot.register(serializers) } @@ -72,6 +73,7 @@ class ClassModel private constructor( companion object : IMarshaller { override val _type: KClass = ClassModel::class + override val id: RdId get() = RdId(17439278522805508) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): ClassModel { diff --git a/rd-kt/rd-gen/src/test/resources/testData/defaultNlsValues/reversed/DefaultNlsValuesRoot.kt b/rd-kt/rd-gen/src/test/resources/testData/defaultNlsValues/reversed/DefaultNlsValuesRoot.kt index 84c582426..eb3f20946 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/defaultNlsValues/reversed/DefaultNlsValuesRoot.kt +++ b/rd-kt/rd-gen/src/test/resources/testData/defaultNlsValues/reversed/DefaultNlsValuesRoot.kt @@ -25,7 +25,8 @@ class DefaultNlsValuesRoot private constructor( companion object : ISerializersOwner { override fun registerSerializersCore(serializers: ISerializers) { - serializers.register(ClassModel) + val classLoader = javaClass.classLoader + serializers.register(LazyCompanionMarshaller(RdId(17439278522805508), classLoader, "DefaultNlsValuesRoot.ClassModel")) DefaultNlsValuesRoot.register(serializers) } @@ -72,6 +73,7 @@ class ClassModel private constructor( companion object : IMarshaller { override val _type: KClass = ClassModel::class + override val id: RdId get() = RdId(17439278522805508) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): ClassModel { diff --git a/rd-kt/rd-gen/src/test/resources/testData/exampleModelTest/asis/ExampleModelNova.kt b/rd-kt/rd-gen/src/test/resources/testData/exampleModelTest/asis/ExampleModelNova.kt index 64a517c45..71a48cade 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/exampleModelTest/asis/ExampleModelNova.kt +++ b/rd-kt/rd-gen/src/test/resources/testData/exampleModelTest/asis/ExampleModelNova.kt @@ -29,38 +29,39 @@ class ExampleModelNova private constructor( companion object : ISerializersOwner { override fun registerSerializersCore(serializers: ISerializers) { - serializers.register(Selection) - serializers.register(Baz) - serializers.register(FooBar) - serializers.register(Class) - serializers.register(Struct) - serializers.register(OpenClass) - serializers.register(OpenStruct) - serializers.register(DerivedClass) - serializers.register(DerivedStruct) - serializers.register(DerivedOpenClass) - serializers.register(DerivedOpenStruct) - serializers.register(DerivedStructWith2Interfaces) - serializers.register(Document) - serializers.register(ScalarExample) - serializers.register(TextControl) - serializers.register(EnumSetTest.marshaller) - serializers.register(Z.marshaller) - serializers.register(Completion) - serializers.register(Foo_Unknown) - serializers.register(ScalarPrimer_Unknown) - serializers.register(A_Unknown) - serializers.register(BaseClass_Unknown) - serializers.register(BaseStruct_Unknown) - serializers.register(OpenClass_Unknown) - serializers.register(OpenStruct_Unknown) - serializers.register(DerivedOpenClass_Unknown) - serializers.register(DerivedOpenStruct_Unknown) - serializers.register(DerivedBaseClass_Unknown) - serializers.register(DerivedBaseStruct_Unknown) - serializers.register(BaseClassWithInterface_Unknown) - serializers.register(BaseStructWithInterface_Unknown) - serializers.register(DerivedClassWith2Interfaces_Unknown) + val classLoader = javaClass.classLoader + serializers.register(LazyCompanionMarshaller(RdId(576020388116153), classLoader, "org.example.Selection")) + serializers.register(LazyCompanionMarshaller(RdId(632584), classLoader, "org.example.Baz")) + serializers.register(LazyCompanionMarshaller(RdId(18972494688), classLoader, "org.example.FooBar")) + serializers.register(LazyCompanionMarshaller(RdId(609144101), classLoader, "org.example.Class")) + serializers.register(LazyCompanionMarshaller(RdId(19349429704), classLoader, "org.example.Struct")) + serializers.register(LazyCompanionMarshaller(RdId(572905478059643), classLoader, "org.example.OpenClass")) + serializers.register(LazyCompanionMarshaller(RdId(17760070285811506), classLoader, "org.example.OpenStruct")) + serializers.register(LazyCompanionMarshaller(RdId(-1667485286246826738), classLoader, "org.example.DerivedClass")) + serializers.register(LazyCompanionMarshaller(RdId(3648188347942988543), classLoader, "org.example.DerivedStruct")) + serializers.register(LazyCompanionMarshaller(RdId(-5037012260488689180), classLoader, "org.example.DerivedOpenClass")) + serializers.register(LazyCompanionMarshaller(RdId(-8573427485006989079), classLoader, "org.example.DerivedOpenStruct")) + serializers.register(LazyCompanionMarshaller(RdId(4287876202302424743), classLoader, "org.example.DerivedStructWith2Interfaces")) + serializers.register(LazyCompanionMarshaller(RdId(18177246065230), classLoader, "org.example.Document")) + serializers.register(LazyCompanionMarshaller(RdId(-3048302864262156661), classLoader, "org.example.ScalarExample")) + serializers.register(LazyCompanionMarshaller(RdId(554385840109775197), classLoader, "org.example.TextControl")) + serializers.register(LazyCompanionMarshaller(RdId(542326635061440960), classLoader, "org.example.EnumSetTest")) + serializers.register(LazyCompanionMarshaller(RdId(679), classLoader, "org.example.Z")) + serializers.register(LazyCompanionMarshaller(RdId(17442164506690639), classLoader, "org.example.Completion")) + serializers.register(LazyCompanionMarshaller(RdId(543167202472902558), classLoader, "org.example.Foo_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(-427415512200834691), classLoader, "org.example.ScalarPrimer_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(560483126050681), classLoader, "org.example.A_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(-8929432671501473473), classLoader, "org.example.BaseClass_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(-8524399809491771292), classLoader, "org.example.BaseStruct_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(-5669233277524003226), classLoader, "org.example.OpenClass_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(308061035262048285), classLoader, "org.example.OpenStruct_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(-5977551086017277745), classLoader, "org.example.DerivedOpenClass_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(9196953045680089812), classLoader, "org.example.DerivedOpenStruct_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(9208993593714803624), classLoader, "org.example.DerivedBaseClass_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(364492200926270235), classLoader, "org.example.DerivedBaseStruct_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(1299733233306533130), classLoader, "org.example.BaseClassWithInterface_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(-2819848318270682619), classLoader, "org.example.BaseStructWithInterface_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(-485232411962447965), classLoader, "org.example.DerivedClassWith2Interfaces_Unknown")) } @@ -215,6 +216,7 @@ class A_Unknown ( companion object : IMarshaller { override val _type: KClass = A_Unknown::class + override val id: RdId get() = RdId(560483126050681) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): A_Unknown { @@ -351,6 +353,7 @@ class BaseClassWithInterface_Unknown ( companion object : IMarshaller { override val _type: KClass = BaseClassWithInterface_Unknown::class + override val id: RdId get() = RdId(1299733233306533130) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): BaseClassWithInterface_Unknown { @@ -398,6 +401,7 @@ class BaseClass_Unknown ( companion object : IMarshaller { override val _type: KClass = BaseClass_Unknown::class + override val id: RdId get() = RdId(-8929432671501473473) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): BaseClass_Unknown { @@ -510,6 +514,7 @@ class BaseStructWithInterface_Unknown ( companion object : IMarshaller { override val _type: KClass = BaseStructWithInterface_Unknown::class + override val id: RdId get() = RdId(-2819848318270682619) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): BaseStructWithInterface_Unknown { @@ -565,6 +570,7 @@ class BaseStruct_Unknown ( companion object : IMarshaller { override val _type: KClass = BaseStruct_Unknown::class + override val id: RdId get() = RdId(-8524399809491771292) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): BaseStruct_Unknown { @@ -649,6 +655,7 @@ class Baz private constructor( companion object : IMarshaller { override val _type: KClass = Baz::class + override val id: RdId get() = RdId(632584) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Baz { @@ -848,6 +855,7 @@ class Class ( companion object : IMarshaller { override val _type: KClass = Class::class + override val id: RdId get() = RdId(609144101) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Class { @@ -892,6 +900,7 @@ class Completion private constructor( companion object : IMarshaller { override val _type: KClass = Completion::class + override val id: RdId get() = RdId(17442164506690639) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Completion { @@ -996,6 +1005,7 @@ class DerivedBaseClass_Unknown ( companion object : IMarshaller { override val _type: KClass = DerivedBaseClass_Unknown::class + override val id: RdId get() = RdId(9208993593714803624) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedBaseClass_Unknown { @@ -1089,6 +1099,7 @@ class DerivedBaseStruct_Unknown ( companion object : IMarshaller { override val _type: KClass = DerivedBaseStruct_Unknown::class + override val id: RdId get() = RdId(364492200926270235) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedBaseStruct_Unknown { @@ -1156,6 +1167,7 @@ class DerivedClass ( companion object : IMarshaller { override val _type: KClass = DerivedClass::class + override val id: RdId get() = RdId(-1667485286246826738) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedClass { @@ -1250,6 +1262,7 @@ class DerivedClassWith2Interfaces_Unknown ( companion object : IMarshaller { override val _type: KClass = DerivedClassWith2Interfaces_Unknown::class + override val id: RdId get() = RdId(-485232411962447965) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedClassWith2Interfaces_Unknown { @@ -1307,6 +1320,7 @@ open class DerivedOpenClass ( companion object : IMarshaller, IAbstractDeclaration { override val _type: KClass = DerivedOpenClass::class + override val id: RdId get() = RdId(-5037012260488689180) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedOpenClass { @@ -1374,6 +1388,7 @@ class DerivedOpenClass_Unknown ( companion object : IMarshaller { override val _type: KClass = DerivedOpenClass_Unknown::class + override val id: RdId get() = RdId(-5977551086017277745) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedOpenClass_Unknown { @@ -1431,6 +1446,7 @@ open class DerivedOpenStruct ( companion object : IMarshaller, IAbstractDeclaration { override val _type: KClass = DerivedOpenStruct::class + override val id: RdId get() = RdId(-8573427485006989079) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedOpenStruct { @@ -1506,6 +1522,7 @@ class DerivedOpenStruct_Unknown ( companion object : IMarshaller { override val _type: KClass = DerivedOpenStruct_Unknown::class + override val id: RdId get() = RdId(9196953045680089812) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedOpenStruct_Unknown { @@ -1573,6 +1590,7 @@ class DerivedStruct ( companion object : IMarshaller { override val _type: KClass = DerivedStruct::class + override val id: RdId get() = RdId(3648188347942988543) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedStruct { @@ -1641,6 +1659,7 @@ class DerivedStructWith2Interfaces ( companion object : IMarshaller { override val _type: KClass = DerivedStructWith2Interfaces::class + override val id: RdId get() = RdId(4287876202302424743) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedStructWith2Interfaces { @@ -1711,6 +1730,7 @@ class Document private constructor( companion object : IMarshaller { override val _type: KClass = Document::class + override val id: RdId get() = RdId(18177246065230) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Document { @@ -1800,9 +1820,20 @@ enum class EnumSetTest { b, c; - companion object { + companion object : IMarshaller> { val marshaller = FrameworkMarshallers.enumSet() + + override val _type: KClass = EnumSetTest::class + override val id: RdId get() = RdId(542326635061440960) + + override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): EnumSet { + return marshaller.read(ctx, buffer) + } + + override fun write(ctx: SerializationCtx, buffer: AbstractBuffer, value: EnumSet) { + marshaller.write(ctx, buffer, value) + } } } @@ -1861,6 +1892,7 @@ class FooBar ( companion object : IMarshaller { override val _type: KClass = FooBar::class + override val id: RdId get() = RdId(18972494688) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): FooBar { @@ -1918,6 +1950,7 @@ class Foo_Unknown ( companion object : IMarshaller { override val _type: KClass = Foo_Unknown::class + override val id: RdId get() = RdId(543167202472902558) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Foo_Unknown { @@ -1997,6 +2030,7 @@ open class OpenClass ( companion object : IMarshaller, IAbstractDeclaration { override val _type: KClass = OpenClass::class + override val id: RdId get() = RdId(572905478059643) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): OpenClass { @@ -2057,6 +2091,7 @@ class OpenClass_Unknown ( companion object : IMarshaller { override val _type: KClass = OpenClass_Unknown::class + override val id: RdId get() = RdId(-5669233277524003226) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): OpenClass_Unknown { @@ -2108,6 +2143,7 @@ open class OpenStruct ( companion object : IMarshaller, IAbstractDeclaration { override val _type: KClass = OpenStruct::class + override val id: RdId get() = RdId(17760070285811506) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): OpenStruct { @@ -2175,6 +2211,7 @@ class OpenStruct_Unknown ( companion object : IMarshaller { override val _type: KClass = OpenStruct_Unknown::class + override val id: RdId get() = RdId(308061035262048285) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): OpenStruct_Unknown { @@ -2235,6 +2272,7 @@ data class ScalarExample ( companion object : IMarshaller { override val _type: KClass = ScalarExample::class + override val id: RdId get() = RdId(-3048302864262156661) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): ScalarExample { @@ -2326,6 +2364,7 @@ class ScalarPrimer_Unknown ( companion object : IMarshaller { override val _type: KClass = ScalarPrimer_Unknown::class + override val id: RdId get() = RdId(-427415512200834691) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): ScalarPrimer_Unknown { @@ -2390,6 +2429,7 @@ data class Selection ( companion object : IMarshaller { override val _type: KClass = Selection::class + override val id: RdId get() = RdId(576020388116153) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Selection { @@ -2467,6 +2507,7 @@ class Struct ( companion object : IMarshaller { override val _type: KClass = Struct::class + override val id: RdId get() = RdId(19349429704) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Struct { @@ -2521,6 +2562,7 @@ class TextControl private constructor( companion object : IMarshaller { override val _type: KClass = TextControl::class + override val id: RdId get() = RdId(554385840109775197) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): TextControl { @@ -2603,8 +2645,19 @@ enum class Z { Bar, z1; - companion object { + companion object : IMarshaller { val marshaller = FrameworkMarshallers.enum() + + override val _type: KClass = Z::class + override val id: RdId get() = RdId(679) + + override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Z { + return marshaller.read(ctx, buffer) + } + + override fun write(ctx: SerializationCtx, buffer: AbstractBuffer, value: Z) { + marshaller.write(ctx, buffer, value) + } } } diff --git a/rd-kt/rd-gen/src/test/resources/testData/exampleModelTest/reversed/ExampleModelNova.kt b/rd-kt/rd-gen/src/test/resources/testData/exampleModelTest/reversed/ExampleModelNova.kt index 818730302..73825db79 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/exampleModelTest/reversed/ExampleModelNova.kt +++ b/rd-kt/rd-gen/src/test/resources/testData/exampleModelTest/reversed/ExampleModelNova.kt @@ -29,38 +29,39 @@ class ExampleModelNova private constructor( companion object : ISerializersOwner { override fun registerSerializersCore(serializers: ISerializers) { - serializers.register(Selection) - serializers.register(Baz) - serializers.register(FooBar) - serializers.register(Class) - serializers.register(Struct) - serializers.register(OpenClass) - serializers.register(OpenStruct) - serializers.register(DerivedClass) - serializers.register(DerivedStruct) - serializers.register(DerivedOpenClass) - serializers.register(DerivedOpenStruct) - serializers.register(DerivedStructWith2Interfaces) - serializers.register(Document) - serializers.register(ScalarExample) - serializers.register(TextControl) - serializers.register(EnumSetTest.marshaller) - serializers.register(Z.marshaller) - serializers.register(Completion) - serializers.register(Foo_Unknown) - serializers.register(ScalarPrimer_Unknown) - serializers.register(A_Unknown) - serializers.register(BaseClass_Unknown) - serializers.register(BaseStruct_Unknown) - serializers.register(OpenClass_Unknown) - serializers.register(OpenStruct_Unknown) - serializers.register(DerivedOpenClass_Unknown) - serializers.register(DerivedOpenStruct_Unknown) - serializers.register(DerivedBaseClass_Unknown) - serializers.register(DerivedBaseStruct_Unknown) - serializers.register(BaseClassWithInterface_Unknown) - serializers.register(BaseStructWithInterface_Unknown) - serializers.register(DerivedClassWith2Interfaces_Unknown) + val classLoader = javaClass.classLoader + serializers.register(LazyCompanionMarshaller(RdId(576020388116153), classLoader, "org.example.Selection")) + serializers.register(LazyCompanionMarshaller(RdId(632584), classLoader, "org.example.Baz")) + serializers.register(LazyCompanionMarshaller(RdId(18972494688), classLoader, "org.example.FooBar")) + serializers.register(LazyCompanionMarshaller(RdId(609144101), classLoader, "org.example.Class")) + serializers.register(LazyCompanionMarshaller(RdId(19349429704), classLoader, "org.example.Struct")) + serializers.register(LazyCompanionMarshaller(RdId(572905478059643), classLoader, "org.example.OpenClass")) + serializers.register(LazyCompanionMarshaller(RdId(17760070285811506), classLoader, "org.example.OpenStruct")) + serializers.register(LazyCompanionMarshaller(RdId(-1667485286246826738), classLoader, "org.example.DerivedClass")) + serializers.register(LazyCompanionMarshaller(RdId(3648188347942988543), classLoader, "org.example.DerivedStruct")) + serializers.register(LazyCompanionMarshaller(RdId(-5037012260488689180), classLoader, "org.example.DerivedOpenClass")) + serializers.register(LazyCompanionMarshaller(RdId(-8573427485006989079), classLoader, "org.example.DerivedOpenStruct")) + serializers.register(LazyCompanionMarshaller(RdId(4287876202302424743), classLoader, "org.example.DerivedStructWith2Interfaces")) + serializers.register(LazyCompanionMarshaller(RdId(18177246065230), classLoader, "org.example.Document")) + serializers.register(LazyCompanionMarshaller(RdId(-3048302864262156661), classLoader, "org.example.ScalarExample")) + serializers.register(LazyCompanionMarshaller(RdId(554385840109775197), classLoader, "org.example.TextControl")) + serializers.register(LazyCompanionMarshaller(RdId(542326635061440960), classLoader, "org.example.EnumSetTest")) + serializers.register(LazyCompanionMarshaller(RdId(679), classLoader, "org.example.Z")) + serializers.register(LazyCompanionMarshaller(RdId(17442164506690639), classLoader, "org.example.Completion")) + serializers.register(LazyCompanionMarshaller(RdId(543167202472902558), classLoader, "org.example.Foo_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(-427415512200834691), classLoader, "org.example.ScalarPrimer_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(560483126050681), classLoader, "org.example.A_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(-8929432671501473473), classLoader, "org.example.BaseClass_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(-8524399809491771292), classLoader, "org.example.BaseStruct_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(-5669233277524003226), classLoader, "org.example.OpenClass_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(308061035262048285), classLoader, "org.example.OpenStruct_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(-5977551086017277745), classLoader, "org.example.DerivedOpenClass_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(9196953045680089812), classLoader, "org.example.DerivedOpenStruct_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(9208993593714803624), classLoader, "org.example.DerivedBaseClass_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(364492200926270235), classLoader, "org.example.DerivedBaseStruct_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(1299733233306533130), classLoader, "org.example.BaseClassWithInterface_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(-2819848318270682619), classLoader, "org.example.BaseStructWithInterface_Unknown")) + serializers.register(LazyCompanionMarshaller(RdId(-485232411962447965), classLoader, "org.example.DerivedClassWith2Interfaces_Unknown")) } @@ -215,6 +216,7 @@ class A_Unknown ( companion object : IMarshaller { override val _type: KClass = A_Unknown::class + override val id: RdId get() = RdId(560483126050681) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): A_Unknown { @@ -351,6 +353,7 @@ class BaseClassWithInterface_Unknown ( companion object : IMarshaller { override val _type: KClass = BaseClassWithInterface_Unknown::class + override val id: RdId get() = RdId(1299733233306533130) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): BaseClassWithInterface_Unknown { @@ -398,6 +401,7 @@ class BaseClass_Unknown ( companion object : IMarshaller { override val _type: KClass = BaseClass_Unknown::class + override val id: RdId get() = RdId(-8929432671501473473) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): BaseClass_Unknown { @@ -510,6 +514,7 @@ class BaseStructWithInterface_Unknown ( companion object : IMarshaller { override val _type: KClass = BaseStructWithInterface_Unknown::class + override val id: RdId get() = RdId(-2819848318270682619) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): BaseStructWithInterface_Unknown { @@ -565,6 +570,7 @@ class BaseStruct_Unknown ( companion object : IMarshaller { override val _type: KClass = BaseStruct_Unknown::class + override val id: RdId get() = RdId(-8524399809491771292) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): BaseStruct_Unknown { @@ -649,6 +655,7 @@ class Baz private constructor( companion object : IMarshaller { override val _type: KClass = Baz::class + override val id: RdId get() = RdId(632584) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Baz { @@ -848,6 +855,7 @@ class Class ( companion object : IMarshaller { override val _type: KClass = Class::class + override val id: RdId get() = RdId(609144101) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Class { @@ -892,6 +900,7 @@ class Completion private constructor( companion object : IMarshaller { override val _type: KClass = Completion::class + override val id: RdId get() = RdId(17442164506690639) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Completion { @@ -996,6 +1005,7 @@ class DerivedBaseClass_Unknown ( companion object : IMarshaller { override val _type: KClass = DerivedBaseClass_Unknown::class + override val id: RdId get() = RdId(9208993593714803624) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedBaseClass_Unknown { @@ -1089,6 +1099,7 @@ class DerivedBaseStruct_Unknown ( companion object : IMarshaller { override val _type: KClass = DerivedBaseStruct_Unknown::class + override val id: RdId get() = RdId(364492200926270235) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedBaseStruct_Unknown { @@ -1156,6 +1167,7 @@ class DerivedClass ( companion object : IMarshaller { override val _type: KClass = DerivedClass::class + override val id: RdId get() = RdId(-1667485286246826738) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedClass { @@ -1250,6 +1262,7 @@ class DerivedClassWith2Interfaces_Unknown ( companion object : IMarshaller { override val _type: KClass = DerivedClassWith2Interfaces_Unknown::class + override val id: RdId get() = RdId(-485232411962447965) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedClassWith2Interfaces_Unknown { @@ -1307,6 +1320,7 @@ open class DerivedOpenClass ( companion object : IMarshaller, IAbstractDeclaration { override val _type: KClass = DerivedOpenClass::class + override val id: RdId get() = RdId(-5037012260488689180) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedOpenClass { @@ -1374,6 +1388,7 @@ class DerivedOpenClass_Unknown ( companion object : IMarshaller { override val _type: KClass = DerivedOpenClass_Unknown::class + override val id: RdId get() = RdId(-5977551086017277745) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedOpenClass_Unknown { @@ -1431,6 +1446,7 @@ open class DerivedOpenStruct ( companion object : IMarshaller, IAbstractDeclaration { override val _type: KClass = DerivedOpenStruct::class + override val id: RdId get() = RdId(-8573427485006989079) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedOpenStruct { @@ -1506,6 +1522,7 @@ class DerivedOpenStruct_Unknown ( companion object : IMarshaller { override val _type: KClass = DerivedOpenStruct_Unknown::class + override val id: RdId get() = RdId(9196953045680089812) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedOpenStruct_Unknown { @@ -1573,6 +1590,7 @@ class DerivedStruct ( companion object : IMarshaller { override val _type: KClass = DerivedStruct::class + override val id: RdId get() = RdId(3648188347942988543) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedStruct { @@ -1641,6 +1659,7 @@ class DerivedStructWith2Interfaces ( companion object : IMarshaller { override val _type: KClass = DerivedStructWith2Interfaces::class + override val id: RdId get() = RdId(4287876202302424743) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): DerivedStructWith2Interfaces { @@ -1711,6 +1730,7 @@ class Document private constructor( companion object : IMarshaller { override val _type: KClass = Document::class + override val id: RdId get() = RdId(18177246065230) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Document { @@ -1800,9 +1820,20 @@ enum class EnumSetTest { b, c; - companion object { + companion object : IMarshaller> { val marshaller = FrameworkMarshallers.enumSet() + + override val _type: KClass = EnumSetTest::class + override val id: RdId get() = RdId(542326635061440960) + + override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): EnumSet { + return marshaller.read(ctx, buffer) + } + + override fun write(ctx: SerializationCtx, buffer: AbstractBuffer, value: EnumSet) { + marshaller.write(ctx, buffer, value) + } } } @@ -1861,6 +1892,7 @@ class FooBar ( companion object : IMarshaller { override val _type: KClass = FooBar::class + override val id: RdId get() = RdId(18972494688) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): FooBar { @@ -1918,6 +1950,7 @@ class Foo_Unknown ( companion object : IMarshaller { override val _type: KClass = Foo_Unknown::class + override val id: RdId get() = RdId(543167202472902558) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Foo_Unknown { @@ -1997,6 +2030,7 @@ open class OpenClass ( companion object : IMarshaller, IAbstractDeclaration { override val _type: KClass = OpenClass::class + override val id: RdId get() = RdId(572905478059643) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): OpenClass { @@ -2057,6 +2091,7 @@ class OpenClass_Unknown ( companion object : IMarshaller { override val _type: KClass = OpenClass_Unknown::class + override val id: RdId get() = RdId(-5669233277524003226) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): OpenClass_Unknown { @@ -2108,6 +2143,7 @@ open class OpenStruct ( companion object : IMarshaller, IAbstractDeclaration { override val _type: KClass = OpenStruct::class + override val id: RdId get() = RdId(17760070285811506) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): OpenStruct { @@ -2175,6 +2211,7 @@ class OpenStruct_Unknown ( companion object : IMarshaller { override val _type: KClass = OpenStruct_Unknown::class + override val id: RdId get() = RdId(308061035262048285) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): OpenStruct_Unknown { @@ -2235,6 +2272,7 @@ data class ScalarExample ( companion object : IMarshaller { override val _type: KClass = ScalarExample::class + override val id: RdId get() = RdId(-3048302864262156661) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): ScalarExample { @@ -2326,6 +2364,7 @@ class ScalarPrimer_Unknown ( companion object : IMarshaller { override val _type: KClass = ScalarPrimer_Unknown::class + override val id: RdId get() = RdId(-427415512200834691) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): ScalarPrimer_Unknown { @@ -2390,6 +2429,7 @@ data class Selection ( companion object : IMarshaller { override val _type: KClass = Selection::class + override val id: RdId get() = RdId(576020388116153) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Selection { @@ -2467,6 +2507,7 @@ class Struct ( companion object : IMarshaller { override val _type: KClass = Struct::class + override val id: RdId get() = RdId(19349429704) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Struct { @@ -2521,6 +2562,7 @@ class TextControl private constructor( companion object : IMarshaller { override val _type: KClass = TextControl::class + override val id: RdId get() = RdId(554385840109775197) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): TextControl { @@ -2603,8 +2645,19 @@ enum class Z { Bar, z1; - companion object { + companion object : IMarshaller { val marshaller = FrameworkMarshallers.enum() + + override val _type: KClass = Z::class + override val id: RdId get() = RdId(679) + + override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Z { + return marshaller.read(ctx, buffer) + } + + override fun write(ctx: SerializationCtx, buffer: AbstractBuffer, value: Z) { + marshaller.write(ctx, buffer, value) + } } } diff --git a/rd-kt/rd-gen/src/test/resources/testData/extensionTest/asis/ExtensionRoot.kt b/rd-kt/rd-gen/src/test/resources/testData/extensionTest/asis/ExtensionRoot.kt index 2e1f9b6e8..f933d5156 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/extensionTest/asis/ExtensionRoot.kt +++ b/rd-kt/rd-gen/src/test/resources/testData/extensionTest/asis/ExtensionRoot.kt @@ -25,8 +25,9 @@ class ExtensionRoot private constructor( companion object : ISerializersOwner { override fun registerSerializersCore(serializers: ISerializers) { - serializers.register(ClassWithStr) - serializers.register(StructWithStr) + val classLoader = javaClass.classLoader + serializers.register(LazyCompanionMarshaller(RdId(-1687597404575351130), classLoader, "ExtensionRoot.ClassWithStr")) + serializers.register(LazyCompanionMarshaller(RdId(-2602185343174852445), classLoader, "ExtensionRoot.StructWithStr")) ExtensionRoot.register(serializers) } @@ -75,6 +76,7 @@ class ClassWithStr ( companion object : IMarshaller { override val _type: KClass = ClassWithStr::class + override val id: RdId get() = RdId(-1687597404575351130) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): ClassWithStr { @@ -141,6 +143,7 @@ data class StructWithStr ( companion object : IMarshaller { override val _type: KClass = StructWithStr::class + override val id: RdId get() = RdId(-2602185343174852445) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): StructWithStr { diff --git a/rd-kt/rd-gen/src/test/resources/testData/extensionTest/reversed/ExtensionRoot.kt b/rd-kt/rd-gen/src/test/resources/testData/extensionTest/reversed/ExtensionRoot.kt index 2e1f9b6e8..f933d5156 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/extensionTest/reversed/ExtensionRoot.kt +++ b/rd-kt/rd-gen/src/test/resources/testData/extensionTest/reversed/ExtensionRoot.kt @@ -25,8 +25,9 @@ class ExtensionRoot private constructor( companion object : ISerializersOwner { override fun registerSerializersCore(serializers: ISerializers) { - serializers.register(ClassWithStr) - serializers.register(StructWithStr) + val classLoader = javaClass.classLoader + serializers.register(LazyCompanionMarshaller(RdId(-1687597404575351130), classLoader, "ExtensionRoot.ClassWithStr")) + serializers.register(LazyCompanionMarshaller(RdId(-2602185343174852445), classLoader, "ExtensionRoot.StructWithStr")) ExtensionRoot.register(serializers) } @@ -75,6 +76,7 @@ class ClassWithStr ( companion object : IMarshaller { override val _type: KClass = ClassWithStr::class + override val id: RdId get() = RdId(-1687597404575351130) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): ClassWithStr { @@ -141,6 +143,7 @@ data class StructWithStr ( companion object : IMarshaller { override val _type: KClass = StructWithStr::class + override val id: RdId get() = RdId(-2602185343174852445) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): StructWithStr { diff --git a/rd-kt/rd-gen/src/test/resources/testData/interningModelsTest/asis/InternedModelsRoot.kt b/rd-kt/rd-gen/src/test/resources/testData/interningModelsTest/asis/InternedModelsRoot.kt index f6001e2cc..c6d65de0f 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/interningModelsTest/asis/InternedModelsRoot.kt +++ b/rd-kt/rd-gen/src/test/resources/testData/interningModelsTest/asis/InternedModelsRoot.kt @@ -26,8 +26,9 @@ class InternedModelsRoot private constructor( companion object : ISerializersOwner { override fun registerSerializersCore(serializers: ISerializers) { - serializers.register(Editor) - serializers.register(Abc) + val classLoader = javaClass.classLoader + serializers.register(LazyCompanionMarshaller(RdId(18933576544), classLoader, "InternedModelsRoot.Editor")) + serializers.register(LazyCompanionMarshaller(RdId(631631), classLoader, "InternedModelsRoot.Abc")) InternedModelsRoot.register(serializers) } @@ -86,6 +87,7 @@ class Abc ( companion object : IMarshaller { override val _type: KClass = Abc::class + override val id: RdId get() = RdId(631631) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Abc { @@ -137,6 +139,7 @@ class Editor ( companion object : IMarshaller { override val _type: KClass = Editor::class + override val id: RdId get() = RdId(18933576544) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Editor { diff --git a/rd-kt/rd-gen/src/test/resources/testData/interningModelsTest/reversed/InternedModelsRoot.kt b/rd-kt/rd-gen/src/test/resources/testData/interningModelsTest/reversed/InternedModelsRoot.kt index f6001e2cc..c6d65de0f 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/interningModelsTest/reversed/InternedModelsRoot.kt +++ b/rd-kt/rd-gen/src/test/resources/testData/interningModelsTest/reversed/InternedModelsRoot.kt @@ -26,8 +26,9 @@ class InternedModelsRoot private constructor( companion object : ISerializersOwner { override fun registerSerializersCore(serializers: ISerializers) { - serializers.register(Editor) - serializers.register(Abc) + val classLoader = javaClass.classLoader + serializers.register(LazyCompanionMarshaller(RdId(18933576544), classLoader, "InternedModelsRoot.Editor")) + serializers.register(LazyCompanionMarshaller(RdId(631631), classLoader, "InternedModelsRoot.Abc")) InternedModelsRoot.register(serializers) } @@ -86,6 +87,7 @@ class Abc ( companion object : IMarshaller { override val _type: KClass = Abc::class + override val id: RdId get() = RdId(631631) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Abc { @@ -137,6 +139,7 @@ class Editor ( companion object : IMarshaller { override val _type: KClass = Editor::class + override val id: RdId get() = RdId(18933576544) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): Editor { diff --git a/rd-kt/rd-gen/src/test/resources/testData/perClientId/asis/PerClientIdRoot.kt b/rd-kt/rd-gen/src/test/resources/testData/perClientId/asis/PerClientIdRoot.kt index 76d488e7b..eda784399 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/perClientId/asis/PerClientIdRoot.kt +++ b/rd-kt/rd-gen/src/test/resources/testData/perClientId/asis/PerClientIdRoot.kt @@ -30,9 +30,10 @@ class PerClientIdRoot private constructor( companion object : ISerializersOwner { override fun registerSerializersCore(serializers: ISerializers) { - serializers.register(InnerClass) - serializers.register(PerClientIdStruct) - serializers.register(PerClientIdSignal) + val classLoader = javaClass.classLoader + serializers.register(LazyCompanionMarshaller(RdId(17599967238820149), classLoader, "com.jetbrains.rd.framework.test.cases.perClientId.InnerClass")) + serializers.register(LazyCompanionMarshaller(RdId(948719498381570149), classLoader, "com.jetbrains.rd.framework.test.cases.perClientId.PerClientIdStruct")) + serializers.register(LazyCompanionMarshaller(RdId(948719498371076920), classLoader, "com.jetbrains.rd.framework.test.cases.perClientId.PerClientIdSignal")) PerClientIdRoot.register(serializers) } @@ -123,6 +124,7 @@ class InnerClass private constructor( companion object : IMarshaller { override val _type: KClass = InnerClass::class + override val id: RdId get() = RdId(17599967238820149) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): InnerClass { @@ -200,6 +202,7 @@ class PerClientIdSignal ( companion object : IMarshaller { override val _type: KClass = PerClientIdSignal::class + override val id: RdId get() = RdId(948719498371076920) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): PerClientIdSignal { @@ -250,6 +253,7 @@ class PerClientIdStruct ( companion object : IMarshaller { override val _type: KClass = PerClientIdStruct::class + override val id: RdId get() = RdId(948719498381570149) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): PerClientIdStruct { diff --git a/rd-kt/rd-gen/src/test/resources/testData/perClientId/reversed/PerClientIdRoot.kt b/rd-kt/rd-gen/src/test/resources/testData/perClientId/reversed/PerClientIdRoot.kt index 76d488e7b..eda784399 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/perClientId/reversed/PerClientIdRoot.kt +++ b/rd-kt/rd-gen/src/test/resources/testData/perClientId/reversed/PerClientIdRoot.kt @@ -30,9 +30,10 @@ class PerClientIdRoot private constructor( companion object : ISerializersOwner { override fun registerSerializersCore(serializers: ISerializers) { - serializers.register(InnerClass) - serializers.register(PerClientIdStruct) - serializers.register(PerClientIdSignal) + val classLoader = javaClass.classLoader + serializers.register(LazyCompanionMarshaller(RdId(17599967238820149), classLoader, "com.jetbrains.rd.framework.test.cases.perClientId.InnerClass")) + serializers.register(LazyCompanionMarshaller(RdId(948719498381570149), classLoader, "com.jetbrains.rd.framework.test.cases.perClientId.PerClientIdStruct")) + serializers.register(LazyCompanionMarshaller(RdId(948719498371076920), classLoader, "com.jetbrains.rd.framework.test.cases.perClientId.PerClientIdSignal")) PerClientIdRoot.register(serializers) } @@ -123,6 +124,7 @@ class InnerClass private constructor( companion object : IMarshaller { override val _type: KClass = InnerClass::class + override val id: RdId get() = RdId(17599967238820149) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): InnerClass { @@ -200,6 +202,7 @@ class PerClientIdSignal ( companion object : IMarshaller { override val _type: KClass = PerClientIdSignal::class + override val id: RdId get() = RdId(948719498371076920) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): PerClientIdSignal { @@ -250,6 +253,7 @@ class PerClientIdStruct ( companion object : IMarshaller { override val _type: KClass = PerClientIdStruct::class + override val id: RdId get() = RdId(948719498381570149) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): PerClientIdStruct { diff --git a/rd-kt/rd-gen/src/test/resources/testData/recursivePolymorphicModelTest/asis/RecursivePolymorphicModel.kt b/rd-kt/rd-gen/src/test/resources/testData/recursivePolymorphicModelTest/asis/RecursivePolymorphicModel.kt index 67db67506..058ccdb01 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/recursivePolymorphicModelTest/asis/RecursivePolymorphicModel.kt +++ b/rd-kt/rd-gen/src/test/resources/testData/recursivePolymorphicModelTest/asis/RecursivePolymorphicModel.kt @@ -27,8 +27,9 @@ class RecursivePolymorphicModel private constructor( companion object : ISerializersOwner { override fun registerSerializersCore(serializers: ISerializers) { - serializers.register(BeTreeGridLine) - serializers.register(BeTreeGridLine_Unknown) + val classLoader = javaClass.classLoader + serializers.register(LazyCompanionMarshaller(RdId(8163186073645594862), classLoader, "org.example.BeTreeGridLine")) + serializers.register(LazyCompanionMarshaller(RdId(7212854712083994073), classLoader, "org.example.BeTreeGridLine_Unknown")) } @@ -109,6 +110,7 @@ open class BeTreeGridLine protected constructor( companion object : IMarshaller, IAbstractDeclaration { override val _type: KClass = BeTreeGridLine::class + override val id: RdId get() = RdId(8163186073645594862) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): BeTreeGridLine { @@ -179,6 +181,7 @@ class BeTreeGridLine_Unknown ( companion object : IMarshaller { override val _type: KClass = BeTreeGridLine_Unknown::class + override val id: RdId get() = RdId(7212854712083994073) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): BeTreeGridLine_Unknown { diff --git a/rd-kt/rd-gen/src/test/resources/testData/recursivePolymorphicModelTest/reversed/RecursivePolymorphicModel.kt b/rd-kt/rd-gen/src/test/resources/testData/recursivePolymorphicModelTest/reversed/RecursivePolymorphicModel.kt index 67db67506..058ccdb01 100644 --- a/rd-kt/rd-gen/src/test/resources/testData/recursivePolymorphicModelTest/reversed/RecursivePolymorphicModel.kt +++ b/rd-kt/rd-gen/src/test/resources/testData/recursivePolymorphicModelTest/reversed/RecursivePolymorphicModel.kt @@ -27,8 +27,9 @@ class RecursivePolymorphicModel private constructor( companion object : ISerializersOwner { override fun registerSerializersCore(serializers: ISerializers) { - serializers.register(BeTreeGridLine) - serializers.register(BeTreeGridLine_Unknown) + val classLoader = javaClass.classLoader + serializers.register(LazyCompanionMarshaller(RdId(8163186073645594862), classLoader, "org.example.BeTreeGridLine")) + serializers.register(LazyCompanionMarshaller(RdId(7212854712083994073), classLoader, "org.example.BeTreeGridLine_Unknown")) } @@ -109,6 +110,7 @@ open class BeTreeGridLine protected constructor( companion object : IMarshaller, IAbstractDeclaration { override val _type: KClass = BeTreeGridLine::class + override val id: RdId get() = RdId(8163186073645594862) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): BeTreeGridLine { @@ -179,6 +181,7 @@ class BeTreeGridLine_Unknown ( companion object : IMarshaller { override val _type: KClass = BeTreeGridLine_Unknown::class + override val id: RdId get() = RdId(7212854712083994073) @Suppress("UNCHECKED_CAST") override fun read(ctx: SerializationCtx, buffer: AbstractBuffer): BeTreeGridLine_Unknown { diff --git a/rd-net/Test.RdFramework/Reflection/data/Generated/RefExt.cs b/rd-net/Test.RdFramework/Reflection/data/Generated/RefExt.cs index 1a4f9282b..592ef4811 100644 --- a/rd-net/Test.RdFramework/Reflection/data/Generated/RefExt.cs +++ b/rd-net/Test.RdFramework/Reflection/data/Generated/RefExt.cs @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------ // -// This code was generated by a RdGen v1.12. +// This code was generated by a RdGen v1.13. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/rd-net/Test.RdFramework/Reflection/data/Generated/RefRoot.cs b/rd-net/Test.RdFramework/Reflection/data/Generated/RefRoot.cs index d7bb58ad8..d766bf0d7 100644 --- a/rd-net/Test.RdFramework/Reflection/data/Generated/RefRoot.cs +++ b/rd-net/Test.RdFramework/Reflection/data/Generated/RefRoot.cs @@ -1,6 +1,6 @@ //------------------------------------------------------------------------------ // -// This code was generated by a RdGen v1.12. +// This code was generated by a RdGen v1.13. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated.