You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by rl...@apache.org on 2003/08/22 04:31:50 UTC

cvs commit: jakarta-commons/validator/src/share/org/apache/commons/validator GenericTypeValidator.java

rleland     2003/08/21 19:31:50

  Modified:    validator/src/share/org/apache/commons/validator
                        GenericTypeValidator.java
  Log:
  place logging in empty catch block.
  
  Revision  Changes    Path
  1.11      +13 -5     jakarta-commons/validator/src/share/org/apache/commons/validator/GenericTypeValidator.java
  
  Index: GenericTypeValidator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/validator/src/share/org/apache/commons/validator/GenericTypeValidator.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- GenericTypeValidator.java	21 Aug 2003 21:43:05 -0000	1.10
  +++ GenericTypeValidator.java	22 Aug 2003 02:31:50 -0000	1.11
  @@ -67,6 +67,8 @@
   import java.text.DateFormat;
   import java.text.SimpleDateFormat;
   import java.text.ParseException;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
   
   /**
    * <p>This class contains basic methods for performing validations that return the
  @@ -78,6 +80,10 @@
    * @version $Revision$ $Date$
    */
   public class GenericTypeValidator implements Serializable {
  +    /*
  +    * Logger.
  +    */
  +   private static Log log = LogFactory.getLog(GenericTypeValidator.class);
   
       /**
        * Checks if the value can safely be converted to a byte primitive.
  @@ -193,7 +199,7 @@
        * is set to <code>false</code> for all.</p>
        *
        * @param value The value validation is being performed on.
  -     * @param Locale The Locale to use to parse the date (system default if null)
  +     * @param locale The Locale to use to parse the date (system default if null)
        */
       public static Date formatDate(String value, Locale locale) {
           Date date = null;
  @@ -219,6 +225,7 @@
               date = formatter.parse(value);
           } catch(ParseException e) {
               // Bad date so return null
  +            log.warn(value, e);
           }
   
           return date;
  @@ -257,6 +264,7 @@
               }
           } catch(ParseException e) {
               // Bad date so return null
  +            log.warn(value, e);
           }
   
           return date;