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

This commit is contained in:
Daan Hoogland 2014-01-06 11:28:50 +01:00 committed by Daan Hoogland
parent c2b5addaed
commit 62c9343658
2 changed files with 7 additions and 0 deletions

View File

@ -1398,6 +1398,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

@ -182,5 +182,6 @@ public class NetUtilsTest extends TestCase {
assertTrue(NetUtils.isSameIsolationId("UnTagged", "vlan://uNtAGGED"));
assertFalse(NetUtils.isSameIsolationId("2", "vlan://uNtAGGED"));
assertFalse(NetUtils.isSameIsolationId("2", "vlan://3"));
assertFalse(NetUtils.isSameIsolationId("bla", null));
}
}