Bug 2528 - Binding Generator: Generated notification implements ChildOf 94/13994/10
authorPeter Kajsa <pkajsa@cisco.com>
Thu, 8 Jan 2015 12:50:02 +0000 (13:50 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 26 May 2015 12:10:16 +0000 (12:10 +0000)
commit1fa4f51ce27b8a625d01f622f1261d51c0e852cb
tree51f0d035ddf4dcf0399a5fbd1a4b97c75112e377
parentc0a31b3cf43f8150706f4cef8d61d8e6a2d7bf56
Bug 2528 - Binding Generator: Generated notification implements ChildOf
interface

Generated Notification interface implements ChildOf<DataObject> interface
which is incorrect. Generated Notification should not implement ChildOf
interface since it is not part of data tree. This could lead to use of
Notification in wrong context and may confuse consumers of APIs.

Notice: The solution replaces "implements ChildOf<DataObject>" with
"implements DataObject" in generated Notification interface. Notification
has structured content, so I think the generated Notification interface should
implements at least DataObject interface in order to be able to construct
InstanceIdentifier for the notification (analogously as it is by RPC's input
and output).

Change-Id: I55c7a8cc4ce450fd712c63f8e77881d4a18674e6
Signed-off-by: Peter Kajsa <pkajsa@cisco.com>
code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/BindingGeneratorImpl.java
code-generator/binding-generator-impl/src/test/java/org/opendaylight/yangtools/sal/binding/generator/impl/BindingGeneratorImplTest.java
code-generator/binding-generator-impl/src/test/resources/binding-generator-impl-test/notification-test.yang [new file with mode: 0644]