[MDSAL-732] Binding generator generates uncompilable code for leafref chain with identityref at the end Created: 11/Mar/22  Updated: 14/Mar/22  Resolved: 12/Mar/22

Status: Resolved
Project: mdsal
Component/s: Binding codegen
Affects Version/s: 8.0.0, 8.0.12
Fix Version/s: 9.0.0, 8.0.13

Type: Bug Priority: Medium
Reporter: Igor Foltin Assignee: Robert Varga
Resolution: Done Votes: 1
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: JPEG File ConfigBuilder-constructor-issue.jpg     JPEG File ConfigBuilder-fieldsFrom-issue.jpg     Text File binding-class-compilation-error.txt     Zip Archive minimized-test-case-model.zip    
Issue Links:
Relates
relates to MDSAL-733 Change 'type identityref' Binding rep... Resolved
relates to MDSAL-426 Specialize relative leafref types dur... Resolved
relates to MDSAL-533 Generated code with incompatible types Resolved

 Description   

Problem was encountered in openconfig-sonic YANG model using the MDSAL version 8.0.12.
I prepared a minimized YANG model that reproduces the issue.
Attached are the minimized YANG model, maven build error message and screenshots of the compilation error as seen in the IDE.



 Comments   
Comment by Robert Varga [ 11/Mar/22 ]

Looks like a missing check for wildcard specifier in the corresponding template. The wildcard should just take the upper bound use it for class. Should be trivial to diagnose & fix.

Comment by Robert Varga [ 11/Mar/22 ]

A prototype for a fix is attached, needs to be validated with tests.

Comment by Robert Varga [ 12/Mar/22 ]

Seems to have been caused by MDSAL-649.
Initial implementation used a plan Class as the bounding check, which is also incorrect.

Comment by Igor Foltin [ 14/Mar/22 ]

I've tried the fix and it solved the issue. Thanks. 

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