[OWASP-ESAPI] Validator changes

Jim Manico jim at manico.net
Wed Apr 16 18:55:09 EDT 2008

I just checked in a new version of Validator and ValidationTest

1) minValue can not exceed maxValue for numerical range limitations
2) added several tests that expanded upon the current isValidNumber 
tests + added isValidInteger tests
3) cleaned up much of the user facing validation messages to be driven 
by context

Hmm, since the min/max problem below is really a programmer error, 
should we make that a RuntimeException?

    public Double getValidDouble(String context, String input, double 
minValue, double maxValue, boolean allowNull) throws 
ValidationException, IntrusionException {
        *if (minValue > maxValue) {
            //should this be a RunTime?
            throw new ValidationException("maxValue (" + maxValue + ") 
must be greater than minValue (" + minValue + ") for " + context,  
"maxValue (" + maxValue + ") must be greater than minValue (" + minValue 
+ ") for " + context);

Jim Manico, Senior Application Security Engineer
jim.manico at aspectsecurity.com | jim at manico.net
(301) 604-4882 (work)
(808) 652-3805 (cell)

Aspect Security™
Securing your applications at the source

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.owasp.org/pipermail/owasp-esapi/attachments/20080416/e8b9a47a/attachment.html 

More information about the OWASP-ESAPI mailing list