compare null to non-null or not-empty-string

This commit is contained in:
Daan Hoogland 2014-01-02 21:24:32 +01:00
parent 7c8ef7836c
commit 61d48154fd
2 changed files with 7 additions and 0 deletions

View File

@ -1406,6 +1406,12 @@ public class NetUtils {
{
return true;
}
if ((one == null || other == null)
&&
!(one == null && other == null))
{
return false;
}
// check 'untagged'
if (VLAN_UNTAGGED.equalsIgnoreCase(one) && VLAN_UNTAGGED.equalsIgnoreCase(other))
{

View File

@ -178,5 +178,6 @@ public class NetUtilsTest extends TestCase {
public void testSameIsolationId() {
assertTrue(NetUtils.isSameIsolationId("1", "vlan://1"));
assertTrue(NetUtils.isSameIsolationId("", null));
assertFalse(NetUtils.isSameIsolationId("bla", null));
}
}