Clean up instance checks and casts
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / protocol / serialization / match / ArpSourceTransportAddressEntrySerializer.java
index 3a2e1d2b6f39f8cbfe59108bb1d79b375c236f2c..e34a96821b8d564a0ac446d8591b618f051fcd45 100644 (file)
@@ -22,21 +22,21 @@ public class ArpSourceTransportAddressEntrySerializer extends AbstractMatchEntry
     @Override
     public void serialize(Match match, ByteBuf outBuffer) {
         super.serialize(match, outBuffer);
-        writeIpv4Prefix(ArpMatch.class.cast(match.getLayer3Match()).getArpSourceTransportAddress(), outBuffer);
+        writeIpv4Prefix(((ArpMatch) match.getLayer3Match()).getArpSourceTransportAddress(), outBuffer);
     }
 
     @Override
     public boolean matchTypeCheck(Match match) {
         return Objects.nonNull(match.getLayer3Match())
-                && ArpMatch.class.isInstance(match.getLayer3Match())
-                && Objects.nonNull(ArpMatch.class.cast(match.getLayer3Match()).getArpSourceTransportAddress());
+                && match.getLayer3Match() instanceof ArpMatch
+                && Objects.nonNull(((ArpMatch) match.getLayer3Match()).getArpSourceTransportAddress());
     }
 
     @Override
     protected boolean getHasMask(Match match) {
         // Split address to IP and mask
         final Iterator<String> addressParts = IpConversionUtil.splitToParts(
-                ArpMatch.class.cast(match.getLayer3Match()).getArpSourceTransportAddress());
+                ((ArpMatch) match.getLayer3Match()).getArpSourceTransportAddress());
         addressParts.next();
 
         // Check if we have mask