Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-384

YANG Data Object List Getters should return Immutable Lists (in Binding v2, only)

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Medium
    • Resolution: Won't Do
    • None
    • None
    • Binding V2 codegen
    • None

    Description

      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

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            vorburger Michael Vorburger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: