}
private static boolean exhaustiveCollectionCompare(
Collection collection, Object candidateValue, BindStatus bindStatus) {
PropertyEditorRegistry editorRegistry = null;
if (bindStatus.getErrors() instanceof BindingResult) {
editorRegistry = ((BindingResult) bindStatus.getErrors()).getPropertyEditorRegistry();
}
Map convertedValueCache = new HashMap(1);
PropertyEditor editor = null;
boolean candidateIsString = (candidateValue instanceof String);
if (editorRegistry != null && !candidateIsString) {
editor = editorRegistry.findCustomEditor(candidateValue.getClass(), bindStatus.getPath());
}
for (Iterator it = collection.iterator(); it.hasNext();) {
Object element = it.next();
if (editor == null && editorRegistry != null && element != null && candidateIsString) {
editor = editorRegistry.findCustomEditor(element.getClass(), bindStatus.getPath());
}
if (exhaustiveCompare(element, candidateValue, editor, convertedValueCache)) {
return true;
}
}