1. opensymphony
  2. xwork

Commits

unkyaku  committed 1a70b9f

Issue number: XW-189
Submitted by: Bruce Ritchie
Reviewed by: Mark Woon

I think it works better if I check in the right file... ;)

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@267e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 13970f0
  • Branches master

Comments (0)

Files changed (1)

File src/java/com/opensymphony/xwork/validator/ActionValidatorManager.java

View file
 
             if (validator instanceof ShortCircuitableValidator && ((ShortCircuitableValidator) validator).isShortCircuit()) {
                 // get number of existing errors
-                int errs = 0;
-
+                List errs = null;
                 if (fValidator != null) {
                     if (validatorContext.hasFieldErrors()) {
                         Collection fieldErrors = (Collection) validatorContext.getFieldErrors().get(fValidator.getFieldName());
 
                         if (fieldErrors != null) {
-                            errs = fieldErrors.size();
+                            errs = new ArrayList(fieldErrors);
                         }
                     }
                 } else if (validatorContext.hasActionErrors()) {
                     Collection actionErrors = validatorContext.getActionErrors();
 
                     if (actionErrors != null) {
-                        errs = actionErrors.size();
+                        errs = new ArrayList(actionErrors);
                     }
                 }
 
                     if (validatorContext.hasFieldErrors()) {
                         Collection errCol = (Collection) validatorContext.getFieldErrors().get(fValidator.getFieldName());
 
-                        if ((errCol != null) && (errCol.size() > errs)) {
+                        if ((errCol != null) && !errCol.equals(errs)) {
                             if (LOG.isDebugEnabled()) {
                                 LOG.debug("Short-circuiting on field validation");
                             }
                 } else if (validatorContext.hasActionErrors()) {
                     Collection errCol = validatorContext.getActionErrors();
 
-                    if ((errCol != null) && (errCol.size() > errs)) {
+                    if ((errCol != null) && !errCol.equals(errs)) {
                         if (LOG.isDebugEnabled()) {
                             LOG.debug("Short-circuiting");
                         }