From b80a043a43abc0948378f2d8cbb5a3b819a1f3bc Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 27 Jan 2016 15:21:03 +0100 Subject: [PATCH] BUG-4862: catch ClassCastException 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 --- .../openflowjava/protocol/impl/util/ListDeserializer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ListDeserializer.java b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ListDeserializer.java index a53749c2..f5d0c2ba 100644 --- a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ListDeserializer.java +++ b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/util/ListDeserializer.java @@ -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; } -- 2.36.6