Bug 2528 - Binding Generator: Generated notification implements ChildOf
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)
commit29b31382f93390aa31c15beff7161c6300004366
tree54407d093a3f87451aa529b9249588c97aa224c8
parent355d463edd89ba01524d1652ef8704c703a2db9a
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]