[YANGTOOLS-1427] Do not fallback to toString() in UnionStringCodec Created: 12/Apr/22  Updated: 05/Jan/24  Resolved: 20/Jun/22

Status: Resolved
Project: yangtools
Component/s: data-impl
Affects Version/s: None
Fix Version/s: 9.0.0

Type: Task Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split to YANGTOOLS-1560 Disable support for union TypeDefinit... In Review
Relates
relates to YANGTOOLS-1332 Remove concepts.IllegalArgumentCodec Resolved
relates to NETCONF-845 Support of namespace for referred yan... Resolved

 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.


Generated at Wed Feb 07 20:56:07 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.