[MDSAL-166] Wrong placement of deprecated annotation Created: 12/May/16  Updated: 09/Mar/18  Resolved: 27/May/16

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

Type: Bug
Reporter: Michal Rehak Assignee: Filip Gregor
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 5882

 Description   

There are 3 misplacements:

  • we have unexpected javadoc annotation inside of yang model citation
  • we miss java and javadoc annotations for leaves
  • we miss correctly placed javadoc annotation

Yang citation in javadoc shall not contain any annotations.
In case of leaf the only available place for both annotations is above getter.
In case of sub-container - both annotations can be placed above corresponding getter in parent structure or inside the container's interface.

consider this yang fragment:
list my-list {
key ip-prefix;
leaf ip-prefix

{ type inet:ip-prefix; }

leaf l3-context

{ status deprecated; type gbp-common:context-id; mandatory true; }

container network-containment

{ status deprecated; uses some-grouping; }

}

Then the top level interface has following javadoc (containing 2 unexpected @deprecated annotations):
...

  • <pre>
  • list my-list {
  • key "ip-prefix"
  • leaf ip-prefix { * type ip-prefix; * }
  • @deprecated - status DEPRECATED
  • leaf l3-context { * type context-id; * status DEPRECATED; * }
  • @deprecated - status DEPRECATED
  • container network-containment { * .. items from grouping * uses network-domain-key; * status DEPRECATED; * }
  • }
  • </pre>
    ...

Generated getters look like this (no java nor javadoc annotations):
/**

  • The context for the endpoint's layer 3 address
    *
    */
    ContextId getL3Context();

/**

  • The network domain associated with this endpoint's fowarding context.
    *
    */
    NetworkContainment getNetworkContainment();

And NetworkContainment javadoc looks following (unexpected javadoc annotation and correct java annotation below):

  • <pre>
  • @deprecated - status DEPRECATED
  • container network-containment { * .. items from grouping * uses network-domain-key; * status DEPRECATED; * }
  • </pre>
    *...
    */
    @Deprecated


 Comments   
Comment by Filip Gregor [ 18/May/16 ]

proposed fix https://git.opendaylight.org/gerrit/#/c/38859/

Comment by Robert Varga [ 26/May/16 ]

master fixed, needs backport to Be.

Comment by Filip Gregor [ 27/May/16 ]

backport to Be https://git.opendaylight.org/gerrit/#/c/39508/

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