Skip to content

Deserialization of case object creates a new instance of case object #211

@wsowa

Description

@wsowa

This test will fail at assertion

case object TestObject

val mapper = new ObjectMapper() with ScalaObjectMapper
mapper.registerModule(DefaultScalaModule)

val original = TestObject
val deserialized = mapper.readValue[TestObject.type](mapper.writeValueAsString(original))

assert(deserialized == original)

After quick investigation i found out that original and deserialized are two instances of the case object. In my opinion it is a bug since I wound never expect to have two instances of a case object in one JVM.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions