private static final DomainValidator DOMAIN_VALIDATOR_WITH_LOCAL = new DomainValidator(true);
private final RegexValidator domainRegex =
new RegexValidator(DOMAIN_NAME_REGEX);
private final RegexValidator hostnameRegex =
new RegexValidator(DOMAIN_LABEL_REGEX);
<BUG>public static DomainValidator getInstance() {

return DOMAIN_VALIDATOR;</BUG>
}
<BUG>public static DomainValidator getInstance(boolean allowLocal) {

if (allowLocal) {</BUG>
return DOMAIN_VALIDATOR_WITH_LOCAL;

private static final DomainValidator DOMAIN_VALIDATOR_WITH_LOCAL = new DomainValidator(true);
private final RegexValidator domainRegex =
new RegexValidator(DOMAIN_NAME_REGEX);
private final RegexValidator hostnameRegex =
new RegexValidator(DOMAIN_LABEL_REGEX);
public static synchronized DomainValidator getInstance() {
inUse = true;
return DOMAIN_VALIDATOR;
