in src/main/java/org/apache/commons/validator/Form.java [144:168]
protected void merge(final Form depends) {
final List<Field> templFields = new ArrayList<>();
@SuppressWarnings("unchecked") // FastHashMap is not generic
final
Map<String, Field> temphFields = new FastHashMap();
for (final Field defaultField : depends.getFields()) {
if (defaultField != null) {
final String fieldKey = defaultField.getKey();
if (!this.containsField(fieldKey)) {
templFields.add(defaultField);
temphFields.put(fieldKey, defaultField);
}
else {
final Field old = getField(fieldKey);
getFieldMap().remove(fieldKey);
lFields.remove(old);
templFields.add(old);
temphFields.put(fieldKey, old);
}
}
}
lFields.addAll(0, templFields);
getFieldMap().putAll(temphFields);
}