Add union deserialization debugs
authorRobert Varga <rovarga@cisco.com>
Tue, 19 Jul 2016 14:58:25 +0000 (16:58 +0200)
committerAnil Belur <abelur@linuxfoundation.org>
Wed, 19 Jun 2024 00:41:20 +0000 (10:41 +1000)
We seem to be hitting the slow instantiation path for some
reason. Add more debugging in an effort to hunt them down.

Change-Id: I64c5630a819d46710f7957c3972a2ba305b21ac7
Signed-off-by: Robert Varga <rovarga@cisco.com>
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/yangtools/binding/data/codec/impl/UnionTypeCodec.java
binding/mdsal-binding-dom-codec/src/main/java/org/opendaylight/yangtools/binding/data/codec/impl/UnionValueOptionContext.java

index bc00693df4287949a9465e8b99138956a8db9ca3..0c7fd575c5a6fc8e41c4e8d92717965aae660ac5 100644 (file)
@@ -80,7 +80,8 @@ final class UnionTypeCodec extends ReflectionBasedCodec {
             }
         }
 
-        LOG.warn("Union value {} failed to deserialize efficiently, falling back to String-based instantiation", input);
+        LOG.warn("Union class {} value {} failed to deserialize efficiently, falling back to String-based instantiation",
+            getTypeClass(), input);
         return deserializeString(input);
     }
 
index b53cd7e4cd8dd07408a6efaae9533211e86055d7..52dd88e33d31d0f9b77c5ae5956847827509a6a9 100644 (file)
@@ -56,7 +56,7 @@ final class UnionValueOptionContext {
         try {
             value = codec.deserialize(input);
         } catch (Exception e) {
-            LOG.debug("Codec failed to deserialize input {}", input, e);
+            LOG.debug("Codec {} failed to deserialize input {}", codec, input, e);
             return null;
         }
 
@@ -64,7 +64,7 @@ final class UnionValueOptionContext {
             return unionCtor.invokeExact(value);
         } catch (ClassCastException e) {
             // This case can happen. e.g. NOOP_CODEC
-            LOG.debug("Codec failed to instantiate {} {}", codec, input);
+            LOG.debug("Failed to instantiate {} for input {} value {}", bindingType, input, value, e);
             return null;
         } catch (Throwable e) {
             throw new IllegalArgumentException("Failed to construct union for value " + value, e);