commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Svyatoslav Ivashkevich" <...@minsk2000.to>
Subject [BeanUtils] PropertyUtils.copyProperties
Date Mon, 23 Sep 2002 14:37:03 GMT
Right now if I have DynaBean that implements DynaBean interface only (doesn't supply getPropertyDescriptor()
call) PropertyUtils.copyProperties not work if orig bean is simple JavaBean. Yes I know that
WrapDynaBean supply this interface, but I wrote my own Serializable DynaBean, and perfomance
issues don't allow me copy data from JavaBean to WrapDynaBean and then to my DynaBean. The
only fix requried is:

--- PropertyUtils.java 2002-07-21 03:20:44.000000000 +0300
+++ PropertyUtils.java 2002-09-19 14:29:31.000000000 +0300
@@ -294,7 +294,7 @@
                     continue; // This is a write-only property
                 }
                 String name = origDescriptors[i].getName();
-                if (getPropertyDescriptor(dest, name) != null) {
+                if ((getPropertyDescriptor(dest, name) != null)||((dest instanceof DynaBean)&&(((DynaBean)
dest).getDynaClass().getDynaProperty(name) != null))) {
                     Object value = getSimpleProperty(orig, name);
                     try {
                         setSimpleProperty(dest, name, value);

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message