Menu

#15 ElementMap deserializing null values instead of objects

open
nobody
None
5
2010-08-12
2010-08-12
Dawid Weiss
No

Deserializing an XML of ElementMap may result in converting legitimate objects to null values. An example JUnit test is attached. The bug is caused by a check in CompositeValue#read(InputNode) where the code checks if:

if(next.isEmpty()) {
return null;
}

In a map, an empty node may actually invoke a constructor of an object (and it should). Adding an empty text node inside the serialized XML solves the problem.

Discussion

  • Dawid Weiss

    Dawid Weiss - 2010-08-12

    A test case an aspectj aspect used to trace the calls

     
  • Dawid Weiss

    Dawid Weiss - 2010-08-12

    method trace difference (capture)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.