Cleanup eclipse warnings
[bgpcep.git] / bgp / parser-impl / src / main / java / org / opendaylight / protocol / bgp / parser / impl / message / BGPUpdateMessageParser.java
index 710ca910ffc2ff481073b1842eb677cd3c0dc608..588e1d72c5aafc6079a538335b41e8d722ab4113 100755 (executable)
@@ -26,7 +26,7 @@ import org.opendaylight.protocol.bgp.parser.spi.PeerSpecificParserConstraint;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.protocol.util.ByteBufWriteUtil;
 import org.opendaylight.protocol.util.Ipv4Util;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.Update;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.UpdateBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.path.attributes.Attributes;
@@ -90,7 +90,7 @@ public final class BGPUpdateMessageParser implements MessageParser, MessageSeria
             messageBody.writeZero(TOTAL_PATH_ATTR_LENGTH_SIZE);
         }
         final Nlri nlri = update.getNlri();
-        if (nlri != null) {
+        if (nlri != null && nlri.getNlri() !=null) {
             for (final Ipv4Prefix prefix : nlri.getNlri()) {
                 ByteBufWriteUtil.writeMinimalPrefix(prefix, messageBody);
             }
@@ -153,7 +153,7 @@ public final class BGPUpdateMessageParser implements MessageParser, MessageSeria
      * @param message Update message
      * @throws BGPDocumentedException
      */
-    private void checkMandatoryAttributesPresence(final Update message) throws BGPDocumentedException {
+    private static void checkMandatoryAttributesPresence(final Update message) throws BGPDocumentedException {
         Preconditions.checkNotNull(message, "Update message cannot be null");
 
         final Attributes attrs = message.getAttributes();