Fix checkstyle in CodecsRegistryImpl 28/80828/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 13 Mar 2019 10:58:19 +0000 (11:58 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 13 Mar 2019 11:46:09 +0000 (12:46 +0100)
Suppress warning on caught exception and properly log the codec
which caused the failure.

Change-Id: I3d92592c361bf02e264a4debd7da61fb8a328aad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/CodecsRegistryImpl.java

index 4ab5b0eabc011d098c8a13c89cf72614e748682a..60e9068de4a87f7f19fec08aab90a498b3158785 100644 (file)
@@ -59,6 +59,7 @@ public final class CodecsRegistryImpl implements CodecsRegistry {
         return codecs;
     }
 
+    @SuppressWarnings("checkstyle:illegalCatch")
     void onSchemaContextUpdated(final SchemaContext context) {
         final BindingRuntimeContext runtimeContext = BindingRuntimeContext.create(this.classContext, context);
         this.latestCodecTree  = this.codecFactory.create(runtimeContext);
@@ -66,7 +67,7 @@ public final class CodecsRegistryImpl implements CodecsRegistry {
             try {
                 codecs.onCodecTreeUpdated(this.latestCodecTree);
             } catch (final Exception e) {
-                LOG.error("Codec creation threw {}", e);
+                LOG.error("Failed to propagate SchemaContext to codec {}", codecs, e);
             }
         }
     }