-
Improvement
-
Resolution: Won't Do
-
Medium
-
None
-
None
-
None
Unless I'm totally mistaken, the current (v1) binding generated YANG Data Object classes have List getters which return mutable collections. This inconsistent with the fact that Data Objects are otherwise immutable. We should make any collections returned by such getters immutable.
I believe I raised this 2 years ago on https://lists.opendaylight.org/pipermail/yangtools-dev/2016-July/001508.html & Co. including https://wiki.opendaylight.org/view/YANG_Tools:Design:Binding_Specification_v2_Analysis#Other_ideas_for_improving_the_v2_Binding_Spec but I cannot find an issue for this, so here it is.
This is obviously a breaking change, so impossible for Binding v1, but something for Binding v2.
The new non-null getters introduced in MDSAL-18 could then also return immutable empty lists, if null