commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject cvs commit: jakarta-commons/beanutils/src/java/org/apache/commons/beanutils ConvertUtilsBean.java
Date Mon, 07 Jul 2003 22:06:46 GMT
rdonkin     2003/07/07 15:06:44

  Modified:    beanutils/src/java/org/apache/commons/beanutils
                        ConvertUtilsBean.java
  Log:
  Improved support for ConvertUtils subclasses by replacing calls to convertors field with
calls to lookup method. Patch contributed by Eric Pabst
  
  Revision  Changes    Path
  1.8       +10 -10    jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java
  
  Index: ConvertUtilsBean.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ConvertUtilsBean.java	16 May 2003 14:50:22 -0000	1.7
  +++ ConvertUtilsBean.java	7 Jul 2003 22:06:44 -0000	1.8
  @@ -437,11 +437,11 @@
               if (value == null) {
                   return ((String) null);
               } else {
  -                Converter converter = (Converter) converters.get(String.class);
  +                Converter converter = lookup(String.class);
                   return ((String) converter.convert(String.class, value));
               }
           } else {
  -            Converter converter = (Converter) converters.get(String.class);
  +            Converter converter = lookup(String.class);
               return ((String) converter.convert(String.class, value));
           }
   
  @@ -463,9 +463,9 @@
               log.debug("Convert string '" + value + "' to class '" +
                         clazz.getName() + "'");
           }
  -        Converter converter = (Converter) converters.get(clazz);
  +        Converter converter = lookup(clazz);
           if (converter == null) {
  -            converter = (Converter) converters.get(String.class);
  +            converter = lookup(String.class);
           }
           if (log.isTraceEnabled()) {
               log.trace("  Using converter " + converter);
  @@ -497,9 +497,9 @@
               log.debug("Convert String[" + values.length + "] to class '" +
                         type.getName() + "[]'");
           }
  -        Converter converter = (Converter) converters.get(type);
  +        Converter converter = lookup(type);
           if (converter == null) {
  -            converter = (Converter) converters.get(String.class);
  +            converter = lookup(String.class);
           }
           if (log.isTraceEnabled()) {
               log.trace("  Using converter " + converter);
  
  
  

---------------------------------------------------------------------
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