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

Incorrect generation of inheritance relationship from yang file

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Cannot Reproduce
    • None
    • None
    • None
    • None
    • Operating System: Windows
      Platform: PC

    • 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.

      Attachments

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

        Activity

          People

            lborak@cisco.com Ladislav Borak
            mkasan@cisco.com Michal Kasan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: