Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 25741 invoked from network); 24 May 2003 19:48:07 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 24 May 2003 19:48:07 -0000 Received: (qmail 14067 invoked by uid 97); 24 May 2003 19:50:20 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@nagoya.betaversion.org Received: (qmail 14060 invoked from network); 24 May 2003 19:50:20 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 24 May 2003 19:50:20 -0000 Received: (qmail 25482 invoked by uid 500); 24 May 2003 19:48:04 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 25471 invoked by uid 500); 24 May 2003 19:48:04 -0000 Received: (qmail 25468 invoked from network); 24 May 2003 19:48:04 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 24 May 2003 19:48:04 -0000 Received: (qmail 24115 invoked by uid 1581); 24 May 2003 19:48:03 -0000 Date: 24 May 2003 19:48:03 -0000 Message-ID: <20030524194803.24113.qmail@icarus.apache.org> From: dgraham@apache.org To: jakarta-commons-cvs@apache.org Subject: cvs commit: jakarta-commons/validator/src/share/org/apache/commons/validator ValidatorResults.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N dgraham 2003/05/24 12:48:03 Modified: validator/src/share/org/apache/commons/validator ValidatorResults.java Log: Call getValidatorResult() internally instead of referencing map directly. Revision Changes Path 1.6 +20 -23 jakarta-commons/validator/src/share/org/apache/commons/validator/ValidatorResults.java Index: ValidatorResults.java =================================================================== RCS file: /home/cvs/jakarta-commons/validator/src/share/org/apache/commons/validator/ValidatorResults.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ValidatorResults.java 24 May 2003 18:54:13 -0000 1.5 +++ ValidatorResults.java 24 May 2003 19:48:03 -0000 1.6 @@ -95,30 +95,27 @@ * Add a the result of a validator action. */ public void add(Field field, String validatorName, boolean result) { - add(field, validatorName, result, null); + this.add(field, validatorName, result, null); } /** * Add a the result of a validator action. */ - public void add( - Field field, - String validatorName, - boolean result, - Object value) { - - ValidatorResult validatorResult = null; - - if (hResults.containsKey(field.getKey())) { - validatorResult = (ValidatorResult) hResults.get(field.getKey()); - } else { - validatorResult = new ValidatorResult(field); - } - - validatorResult.add(validatorName, result, value); + public void add( + Field field, + String validatorName, + boolean result, + Object value) { + + ValidatorResult validatorResult = this.getValidatorResult(field.getKey()); + + if (validatorResult == null) { + validatorResult = new ValidatorResult(field); + this.hResults.put(field.getKey(), validatorResult); + } - hResults.put(field.getKey(), validatorResult); - } + validatorResult.add(validatorName, result, value); + } /** * Clear all results recorded by this object. @@ -200,7 +197,7 @@ for (Iterator i = hResults.keySet().iterator(); i.hasNext();) { String propertyKey = (String) i.next(); - ValidatorResult vr = (ValidatorResult) hResults.get(propertyKey); + ValidatorResult vr = this.getValidatorResult(propertyKey); Map actions = vr.getActionMap(); for (Iterator x = actions.keySet().iterator(); x.hasNext();) { --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org