Switch this to "__global__".equalsIgnoreCase(regionName). Besides being good practice anyways, this prevents NPE from occuring if regionName is null. If it were, it would simply return false, instead of throwing an exception.