commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dgra...@apache.org
Subject cvs commit: jakarta-commons/validator/src/share/org/apache/commons/validator ValidatorResults.java
Date Sat, 24 May 2003 19:48:03 GMT
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


Mime
View raw message