Hi all,

I downloaded commons-validator v1.1.4 and I think I ran into a bug in
the method:

    ValidatorResults validate(Map params, Map actions)
        throws ValidatorException 

specifically the block:
********************************

        for (int fieldNumber = 0; fieldNumber <
numberOfFieldsToValidate; fieldNumber++) {
            
            ValidatorResults results = new ValidatorResults();
            // this is the "fix the bug" location

            Iterator dependencies = this.dependencyList.iterator();
            while (dependencies.hasNext()) {
                String depend = (String) dependencies.next();

                ValidatorAction action = (ValidatorAction) actions.get(depend);
                if (action == null) {
                    this.handleMissingAction(depend);
                }

                //ValidatorResults results = new ValidatorResults();
                // this is the "original" location that is "buggy"

                boolean good =
                    validateForRule(action, results, actions, params,
fieldNumber);

                allResults.merge(results);

                if (!good) {
                    return allResults;
                }
            }
        }
********************************

I moved the line that instantiates the local var: 'results'
(ValidatorResults ) OUTSIDE of the while loop so the validations
performed based on the dependencies (resolved to actions) are not lost
between passes of the while loop.

Please advise.

Thanks!

Jon Kirton
[EMAIL PROTECTED]
-- 
-jpk-

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to