BUG-4862: catch ClassCastException 33/33633/1
authorRobert Varga <rovarga@cisco.com>
Wed, 27 Jan 2016 14:21:03 +0000 (15:21 +0100)
committerRobert Varga <rovarga@cisco.com>
Wed, 27 Jan 2016 14:21:03 +0000 (15:21 +0100)
When the looked up serializer does not implement the expected
HeaderDesersializer interface we end up with a ClassCastException. Catch
it, issue a warning and continue.

Change-Id: I70f23733078710507bdc65931e41c1bd02c0684f
Signed-off-by: Robert Varga <rovarga@cisco.com>
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ListDeserializer.java

index a53749c28e6cbaddfaf8a57da3cbe06a75ba8d9e..f5d0c2bace6dcb9af04c87f5e9d0dc519f35688b 100644 (file)
@@ -77,8 +77,9 @@ public final class ListDeserializer {
                 MessageCodeKey key = keyMaker.make(input);
                 try {
                     deserializer = registry.getDeserializer(key);
-                } catch (IllegalStateException e) {
-                    LOG.warn("Problem during reading table feature property. Skipping unknown feature property: {}", key);
+                } catch (ClassCastException | IllegalStateException e) {
+                    LOG.warn("Problem during reading table feature property. Skipping unknown feature property: {}",
+                        key, e);
                     input.skipBytes(2 * EncodeConstants.SIZE_OF_SHORT_IN_BYTES);
                     continue;
                 }