From de0a3bfa4135f715604178de30e8ed98179a4e94 Mon Sep 17 00:00:00 2001 From: eeichinger Date: Tue, 28 Jul 2009 17:08:05 +0000 Subject: [PATCH] fixed SPRNET-1073 --- .../Validation/ValidationErrors.cs | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/Spring/Spring.Core/Validation/ValidationErrors.cs b/src/Spring/Spring.Core/Validation/ValidationErrors.cs index de96ecd6..2a321e9d 100644 --- a/src/Spring/Spring.Core/Validation/ValidationErrors.cs +++ b/src/Spring/Spring.Core/Validation/ValidationErrors.cs @@ -208,22 +208,35 @@ namespace Spring.Validation /// /// The validation errors to merge; can be . /// - public void MergeErrors(ValidationErrors errorsToMerge) + public void MergeErrors(IValidationErrors errorsToMerge) { if (errorsToMerge != null) { - foreach (DictionaryEntry errorEntry in errorsToMerge.errorMap) + foreach(string provider in errorsToMerge.Providers) { - ArrayList errList = (ArrayList) this.errorMap[errorEntry.Key]; + ArrayList errList = (ArrayList) this.errorMap[provider]; + IList other = errorsToMerge.GetErrors(provider); if (errList == null) { - this.errorMap[errorEntry.Key] = errorEntry.Value; + this.errorMap[provider] = other; } else { - errList.AddRange((IList) errorEntry.Value); + errList.AddRange((IList) other); } } +// foreach (DictionaryEntry errorEntry in errorsToMerge.errorMap) +// { +// ArrayList errList = (ArrayList) this.errorMap[errorEntry.Key]; +// if (errList == null) +// { +// this.errorMap[errorEntry.Key] = errorEntry.Value; +// } +// else +// { +// errList.AddRange((IList) errorEntry.Value); +// } +// } } }