From 576ae2cd595f0ce17abd1f33150b068b7f0f801d Mon Sep 17 00:00:00 2001 From: Tony Tkacik Date: Fri, 27 Mar 2015 11:04:50 +0100 Subject: [PATCH 1/1] Bug 2906 - Added support of entering notification by #streamChild() Root Tree Node context did not allowed to enter notification using binding classes by #streamChild method, since notifications were cached in different collection. Added support for entering notifications using such method. Change-Id: I28779e763a81519d25d71e319776cdc6f179ef33 Signed-off-by: Tony Tkacik --- .../binding/data/codec/impl/SchemaRootCodecContext.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code-generator/binding-data-codec/src/main/java/org/opendaylight/yangtools/binding/data/codec/impl/SchemaRootCodecContext.java b/code-generator/binding-data-codec/src/main/java/org/opendaylight/yangtools/binding/data/codec/impl/SchemaRootCodecContext.java index 681b7906ed..ff8310266c 100644 --- a/code-generator/binding-data-codec/src/main/java/org/opendaylight/yangtools/binding/data/codec/impl/SchemaRootCodecContext.java +++ b/code-generator/binding-data-codec/src/main/java/org/opendaylight/yangtools/binding/data/codec/impl/SchemaRootCodecContext.java @@ -126,6 +126,14 @@ final class SchemaRootCodecContext extends DataContainerCo @Override public DataContainerCodecContext streamChild(Class childClass) throws IllegalArgumentException { + /* FIXME: This is still not solved for RPCs + * TODO: Probably performance wise RPC, Data and Notification loading cache + * should be merge for performance resons. Needs microbenchmark to + * determine which is faster (keeping them separate or in same cache). + */ + if (Notification.class.isAssignableFrom(childClass)) { + return (DataContainerCodecContext) getNotification((Class)childClass); + } return (DataContainerCodecContext) childrenByClass.getUnchecked(childClass); } -- 2.36.6