Thread
#serialization
    t

    thana

    3 years ago
    does anybody know what the
    SerialDescriptor
    generated for a
    @Serializable
    class depends on?
    s

    sandwwraith

    3 years ago
    what do you mean?
    t

    thana

    3 years ago
    well i have 2 identical* classes in different projects dependening on two identical* classes in those very projects. the serializers are generated with the exact same versions. yet the json strings differ. Using the debugger i can see the
    SerialDescriptor
    is different - so my guess was that might be a good starting point for further debugging * identical except on packages and file structure
    s

    sandwwraith

    3 years ago
    SerialDescriptor
    includes fully-qualified name of the class (i.e. with the package). However, it becomes visible only when using polymorphism. Besides this, it contains the order in which properties in class are declared and some additional metadata from annotations. What do you mean exactly by 'json strings differ' ?
    t

    thana

    3 years ago
    in one case it's completly broken, in the other it's not. i was trying to create some sourcecode for a bugreport. but i cannot reproduce it outside the real project 😞
    i was already guessing it would depend on the order of declared members but... the order is 100% identical - yet in the real project there are even members missing! I have no clue how to hunt this bug down 😞
    i think i will duplicate the project and then remove code until the bug disappears 🤔
    r

    r4zzz4k

    3 years ago
    * identical except on packages
    SerialDescriptor
    includes fully-qualified name of the class (i.e. with the package)
    @thana, did you try to change package name in your reproducer project to match the original one? I understand you've most probably did, just didn't mention this here, but still.
    t

    thana

    3 years ago
    Yep in the end i aligned the package names, top. Lucky that didnt trigger the error 😁
    I will Stop for today. Im Tor tired already anyway
    hallvard

    hallvard

    3 years ago
    ... and, of course, you did a clean rebuild, or even maybe a File --> Invalidate Caches/Restart ?
    t

    thana

    3 years ago
    i always did a clean build
    and it looks like its a source set related problem
    @sandwwraith i could boil it down to https://github.com/mschirmacher/SerializationTest
    the branch
    master
    contains a broken version
    working
    contains the working version. it only differs inthe sourceset that contains the class
    DomainEvent
    yet
    ./gradlew jvmTest
    will pass in the
    working
    branch but fail in
    master
    would you agree here that this is a bug?
    s

    sandwwraith

    3 years ago
    t

    thana

    3 years ago
    Yes, this is somehow related. i say "somehow" because versions 1.3.21/0.10.0 do not seem to reproduce the problem. i this fact known, too?