Author: simonetripodi
Date: Fri Jun  8 20:05:44 2012
New Revision: 1348221

URL: http://svn.apache.org/viewvc?rev=1348221&view=rev
Log:
check a property exists and can be writable when setting from populate()

Modified:
    
commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultBeanAccessor.java

Modified: 
commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultBeanAccessor.java
URL: 
http://svn.apache.org/viewvc/commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultBeanAccessor.java?rev=1348221&r1=1348220&r2=1348221&view=diff
==============================================================================
--- 
commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultBeanAccessor.java
 (original)
+++ 
commons/sandbox/beanutils2/trunk/src/main/java/org/apache/commons/beanutils2/DefaultBeanAccessor.java
 Fri Jun  8 20:05:44 2012
@@ -199,16 +199,9 @@ final class DefaultBeanAccessor<B>
     private void setIfWritable( String propertyName, Object propertyValue )
         throws IntrospectionException, IllegalAccessException, 
InvocationTargetException, NoSuchMethodException
     {
-        try
+        if ( properties.hasProperty( propertyName ) && properties.isWritable( 
propertyName ) )
         {
-            if ( properties.isWritable( propertyName ) )
-            {
-                set( propertyName ).with( propertyValue );
-            }
-        }
-        catch ( IntrospectionException e )
-        {
-            // either the property there is no property with the given name or 
it is not writable so we skip it.
+            set( propertyName ).with( propertyValue );
         }
     }
 


Reply via email to