commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 13932] New: - Cannot use same name for field and validator, validator is never invoked
Date Thu, 24 Oct 2002 15:30:21 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13932>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13932

Cannot use same name for field and validator, validator is never invoked

           Summary: Cannot use same name for field and validator, validator
                    is never invoked
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Validator
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: padma.ginnaram@s1.com


Cannot use same name for field and validator, validator is never invoked. 

The bug is in Validator.validateFieldForRule

	if (results.getValidatorResult(va.getName()) != null) {
	    return isValid(results.getValidatorResult(va.getName()));
	}

ValidatorResults.getValidatorResult expects a field key not the validator name. 
Here is the fix:

        if (results.getValidatorResult(field.getKey()) != null) {
            ValidatorResult result = results.getValidatorResult(field.getKey());
            if (result.containsAction(va.getName()))
	      return result.isValid(va.getName());
	}

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message