commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-commons/beanutils/src/java/org/apache/commons/beanutils PropertyUtilsBean.java
Date Sun, 03 Aug 2003 00:43:52 GMT
craigmcc    2003/08/02 17:43:52

  Modified:    beanutils/src/java/org/apache/commons/beanutils
                        PropertyUtilsBean.java
  Log:
  Trivially simple optimization for PropertyUtils.copyProperties() -- remove
  spurious execution of methods through the static accessor method, since we
  always want to execute the local setter method anyway.
  
  Revision  Changes    Path
  1.9       +10 -10    jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/PropertyUtilsBean.java
  
  Index: PropertyUtilsBean.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/PropertyUtilsBean.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PropertyUtilsBean.java	16 May 2003 14:50:22 -0000	1.8
  +++ PropertyUtilsBean.java	3 Aug 2003 00:43:52 -0000	1.9
  @@ -237,10 +237,10 @@
                           Object value = ((DynaBean) orig).get(name);
                           ((DynaBean) dest).set(name, value);
                       }
  -                } else {
  +                } else /* if (dest is a standard JavaBean) */ {
                       if (isWriteable(dest, name)) {
                           Object value = ((DynaBean) orig).get(name);
  -                        PropertyUtils.setSimpleProperty(dest, name, value);
  +                        setSimpleProperty(dest, name, value);
                       }
                   }
               }
  @@ -253,10 +253,10 @@
                           Object value = ((Map) orig).get(name);
                           ((DynaBean) dest).set(name, value);
                       }
  -                } else {
  +                } else /* if (dest is a standard JavaBean) */ {
                       if (isWriteable(dest, name)) {
                           Object value = ((Map) orig).get(name);
  -                        PropertyUtils.setSimpleProperty(dest, name, value);
  +                        setSimpleProperty(dest, name, value);
                       }
                   }
               }
  @@ -271,7 +271,7 @@
                               Object value = getSimpleProperty(orig, name);
                               ((DynaBean) dest).set(name, value);
                           }
  -                    } else {
  +                    } else /* if (dest is a standard JavaBean) */ {
                           if (isWriteable(dest, name)) {
                               Object value = getSimpleProperty(orig, name);
                               setSimpleProperty(dest, name, value);
  @@ -319,7 +319,7 @@
               }
           } else {
               PropertyDescriptor descriptors[] =
  -                PropertyUtils.getPropertyDescriptors(bean);
  +                getPropertyDescriptors(bean);
               for (int i = 0; i < descriptors.length; i++) {
                   String name = descriptors[i].getName();
                   if (descriptors[i].getReadMethod() != null)
  
  
  

Mime
View raw message