commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ohe...@apache.org
Subject svn commit: r1089793 - /commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/beanutils/BeanHelper.java
Date Thu, 07 Apr 2011 09:45:52 GMT
Author: oheger
Date: Thu Apr  7 09:45:51 2011
New Revision: 1089793

URL: http://svn.apache.org/viewvc?rev=1089793&view=rev
Log:
Removed some duplicate code.

Modified:
    commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/beanutils/BeanHelper.java

Modified: commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/beanutils/BeanHelper.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/beanutils/BeanHelper.java?rev=1089793&r1=1089792&r2=1089793&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/beanutils/BeanHelper.java
(original)
+++ commons/proper/configuration/trunk/src/java/org/apache/commons/configuration/beanutils/BeanHelper.java
Thu Apr  7 09:45:51 2011
@@ -16,15 +16,15 @@
  */
 package org.apache.commons.configuration.beanutils;
 
+import java.beans.PropertyDescriptor;
 import java.lang.reflect.InvocationTargetException;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.Collection;
-import java.util.List;
-import java.beans.PropertyDescriptor;
 
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.beanutils.PropertyUtils;
@@ -282,28 +282,18 @@ public final class BeanHelper
 
     /**
      * Set a property on the bean only if the property exists
+     *
      * @param bean the bean
      * @param propName the name of the property
      * @param value the property's value
      * @throws ConfigurationRuntimeException if the property is not writeable or
-     * an error occurred
+     *         an error occurred
      */
     public static void setProperty(Object bean, String propName, Object value)
     {
         if (PropertyUtils.isWriteable(bean, propName))
         {
-            try
-            {
-                BeanUtils.setProperty(bean, propName, value);
-            }
-            catch (IllegalAccessException iaex)
-            {
-                throw new ConfigurationRuntimeException(iaex);
-            }
-            catch (InvocationTargetException itex)
-            {
-                throw new ConfigurationRuntimeException(itex);
-            }
+            initProperty(bean, propName, value);
         }
     }
 



Mime
View raw message