BUG-1790: detect existing unmodifiableMap encapsulation 95/10995/1
authorRobert Varga <rovarga@cisco.com>
Wed, 10 Sep 2014 14:22:03 +0000 (16:22 +0200)
committerRobert Varga <rovarga@cisco.com>
Wed, 10 Sep 2014 14:26:29 +0000 (16:26 +0200)
commit0d71cb8296652be2da49b50d0ac38e376abb87b2
tree1fad2f13f023f4ca4cb3890d74cff9d96eb93ab2
parent2998df0b0e5aa606d0bd154198847093cf5be868
BUG-1790: detect existing unmodifiableMap encapsulation

Commit 9bcc82d107075da35c8cd01422481eaea395ba29 introduced a way to
reuse children map by builders. Unfortunately there is a codepath which
could see us receiving the returned collection in our constructor, and
the subsequent operation would wrap it again. If you stack these
operations, at some point the nesting becomes unmanageable.

The fix is to detect a previously-encapsulated collection and reusing
it. Analysis also shows that the children field is not needed, so remove
it as well.

Change-Id: I42d604d290326afca4564565760cbcf4586c2908
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableDataContainerNode.java