Skip to content

Deserializing singleton object causes different instancesΒ #141

Closed
@ingramchen

Description

@ingramchen

Step to reproduce:

object Singleton

val mapper = ObjectMapper().registerModule(KotlinModule())
val decoded = mapper.readValue("{}", Singleton::class.java)
assert(Singleton == decoded)  // failed

Expect behavior: object declaration should be only one instance per VM

Environment:
Oracle JDK 1.8 (also reproduce in Android)
Kotlin 1.2.30
Jackson, Jackson kotlin - 2.9.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions