X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Fprotocol%2Fserialization%2Fmatch%2FTcpSourcePortEntrySerializer.java;h=6718a306b3a666718890da509096f5107e18a498;hb=a7d93dd9e51a10d5e5d5357c32dbd304d2fe717e;hp=48e124d18ad82364a3b78db9ffa798fe26548154;hpb=c79563939db4b33af869cfba0a8d35e57b5ea5be;p=openflowplugin.git diff --git a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TcpSourcePortEntrySerializer.java b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TcpSourcePortEntrySerializer.java index 48e124d18a..6718a306b3 100644 --- a/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TcpSourcePortEntrySerializer.java +++ b/openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/protocol/serialization/match/TcpSourcePortEntrySerializer.java @@ -20,14 +20,14 @@ public class TcpSourcePortEntrySerializer extends AbstractMatchEntrySerializer { @Override public void serialize(Match match, ByteBuf outBuffer) { super.serialize(match, outBuffer); - outBuffer.writeShort(TcpMatch.class.cast(match.getLayer4Match()).getTcpSourcePort().getValue()); + outBuffer.writeShort(((TcpMatch) match.getLayer4Match()).getTcpSourcePort().getValue()); } @Override public boolean matchTypeCheck(Match match) { - return Objects.nonNull(match.getLayer4Match()) && - TcpMatch.class.isInstance(match.getLayer4Match()) && - Objects.nonNull(TcpMatch.class.cast(match.getLayer4Match()).getTcpSourcePort()); + return Objects.nonNull(match.getLayer4Match()) + && match.getLayer4Match() instanceof TcpMatch + && Objects.nonNull(((TcpMatch) match.getLayer4Match()).getTcpSourcePort()); } @Override