Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-1427

Do not fallback to toString() in UnionStringCodec

    XMLWordPrintable

Details

    • Task
    • Status: Resolved
    • Medium
    • Resolution: Done
    • None
    • 9.0.0
    • data-impl
    • None

    Description

      UnionStringCodec does the wrong thing when it encounters a type which is not handled by TypeDefinitionAwareCodec: it falls back to invoking toString() on the value. The types not handled are: identityref, instance-identifier and leafref. One example of how this can go wrong is YANGTOOLS-1108. Let's just remove the codepath and start flushing out any offenders out there.

      To achieve this, we will take two steps:

      1. we will remove the toString() fallback and perform an eager codec construction to see if we can handle the type at all. If we cannot, we will return null
      2. we will remove UnionStringCodec and always return it as unhandled

      In this issue we will do the first item and introduce a system property to turn the behaviour to the second item.

      Attachments

        Issue Links

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

          Activity

            People

              rovarga Robert Varga
              rovarga Robert Varga
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: