commit | 77d99491b26e61294af69e5cb209ea2a1a66a4a4 | [log] [tgz] |
---|---|---|
author | Sovietaced <Sovietaced@gmail.com> | Tue Jun 24 12:58:47 2014 -0700 |
committer | Sovietaced <Sovietaced@gmail.com> | Tue Jun 24 12:58:47 2014 -0700 |
tree | c8b54521ff37aaa0af3c19d6bc062f8798d1b37a | |
parent | 07cc8eb32c4bb3f77ac57765370f5c607aa4cb7a [diff] [blame] |
return false for incompatible ip versions
diff --git a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/IPv6AddressWithMask.java b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/IPv6AddressWithMask.java index 2e7ff5e..4fd9b1c 100644 --- a/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/IPv6AddressWithMask.java +++ b/java_gen/pre-written/src/main/java/org/projectfloodlight/openflow/types/IPv6AddressWithMask.java
@@ -90,12 +90,15 @@ @Override public boolean contains(IPAddress<?> ip) { - if (string == null) { - throw new NullPointerException("String must not be null"); + if (ip == null) { + throw new NullPointerException("ip must not be null"); } - - IPv6Address ipv6 = (IPv6Address) ip; - return this.matches(ipv6); - } + if(ip.getIpVersion() == IPVersion.IPv6) { + IPv6Address ipv6 = (IPv6Address) ip; + return this.matches(ipv6); + } + + return false; + } }