List diagnostics = validator.getDiagnostics();
// If we are pruning and this validatable object is also prunable, then
// prune it before we report any errors.
if (pruning && validatable instanceof Pruneable) {
Pruneable pruneable = (Pruneable) validatable;
pruneable.prune(validator.getValidationContext(), diagnostics);
}
if (!diagnostics.isEmpty()) {
StringBuffer buffer = new StringBuffer();
boolean foundError = false;