struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@locus.apache.org
Subject cvs commit: jakarta-struts/src/share/org/apache/struts/util PropertyUtils.java
Date Sun, 15 Oct 2000 03:25:14 GMT
craigmcc    00/10/14 20:25:14

  Modified:    src/share/org/apache/struts/util PropertyUtils.java
  Log:
  Make PropertyUtils.copyProperties() skip properties for which the origin
  bean has a getter method but the destination bean has no setter method.
  
  Revision  Changes    Path
  1.5       +9 -5      jakarta-struts/src/share/org/apache/struts/util/PropertyUtils.java
  
  Index: PropertyUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/util/PropertyUtils.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PropertyUtils.java	2000/09/23 23:19:33	1.4
  +++ PropertyUtils.java	2000/10/15 03:25:14	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/util/PropertyUtils.java,v
1.4 2000/09/23 23:19:33 craigmcc Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/09/23 23:19:33 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/util/PropertyUtils.java,v
1.5 2000/10/15 03:25:14 craigmcc Exp $
  + * $Revision: 1.5 $
  + * $Date: 2000/10/15 03:25:14 $
    *
    * ====================================================================
    *
  @@ -117,7 +117,7 @@
    * @author Craig R. McClanahan
    * @author Ralph Schaer
    * @author Chris Audley
  - * @version $Revision: 1.4 $ $Date: 2000/09/23 23:19:33 $
  + * @version $Revision: 1.5 $ $Date: 2000/10/15 03:25:14 $
    */
   
   public final class PropertyUtils {
  @@ -187,7 +187,11 @@
   	    String name = origDescriptors[i].getName();
   	    if (getPropertyDescriptor(dest, name) != null) {
   		Object value = getSimpleProperty(orig, name);
  -		setSimpleProperty(dest, name, value);
  +                try {
  +                    setSimpleProperty(dest, name, value);
  +                } catch (NoSuchMethodException e) {
  +                    ;   // Skip non-matching property
  +                }
   	    }
   	}
   
  
  
  

Mime
View raw message