in src/main/java/org/apache/commons/validator/routines/DomainValidator.java [2121:2158]
public static synchronized void updateTLDOverride(final ArrayType table, final String... tlds) {
if (inUse) {
throw new IllegalStateException("Can only invoke this method before calling getInstance");
}
final String [] copy = new String[tlds.length];
// Comparisons are always done with lower-case entries
for (int i = 0; i < tlds.length; i++) {
copy[i] = tlds[i].toLowerCase(Locale.ENGLISH);
}
Arrays.sort(copy);
switch(table) {
case COUNTRY_CODE_MINUS:
countryCodeTLDsMinus = copy;
break;
case COUNTRY_CODE_PLUS:
countryCodeTLDsPlus = copy;
break;
case GENERIC_MINUS:
genericTLDsMinus = copy;
break;
case GENERIC_PLUS:
genericTLDsPlus = copy;
break;
case LOCAL_MINUS:
localTLDsMinus = copy;
break;
case LOCAL_PLUS:
localTLDsPlus = copy;
break;
case COUNTRY_CODE_RO:
case GENERIC_RO:
case INFRASTRUCTURE_RO:
case LOCAL_RO:
throw new IllegalArgumentException("Cannot update the table: " + table);
default:
throw new IllegalArgumentException(UNEXPECTED_ENUM_VALUE + table);
}
}