[YANGTOOLS-239] Incorrect generation of inheritance relationship from yang file Created: 30/Jul/14  Updated: 10/Apr/22  Resolved: 31/Jul/14

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Michal Kasan Assignee: Ladislav Borak
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Windows
Platform: PC


Attachments: File toaster.yang    
External issue ID: 1454

 Description   

When this construction:
leaf sub-type {
type identityref

{ base openflow-action:experimenter; }

}
is placed into 'module', 'container', 'grouping', 'augment' node,
yangtools generate incorrect hierarchy between abstract classes.

Example:
Here is hierarchy described placed in yang file:

identity action-base

{ description "Base identity for action types"; }

identity experimenter

{ description ""; base action-base; }

leaf sub-type {
type identityref

{ base experimenter; }

}

Therefore correct inheritance relationship should be: 'Experimenter extends ActionBase'.
But generated code is as follows: 'Experimenter extends BaseIdentity'
(Generated abstract class (Experimenter.java) looses it's parent class (ActionBase.java))
If you comment this part of yang file:
"leaf sub-type {
type identityref

{ base openflow-action:experimenter; }

}"
, suddenly generation of inheritance works properly.

Yang file is attached in attachment.



 Comments   
Comment by Michal Kasan [ 30/Jul/14 ]

Attachment toaster.yang has been added with description: yang file as an example

Comment by Ladislav Borak [ 31/Jul/14 ]

I tested included yang file with master branch on yangtools and I can't reproduce this bug. It seems to be all works fine.

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