jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r574860 - /jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/reflection/ReflectionUtils.java
Date Wed, 12 Sep 2007 09:37:20 GMT
Author: fmeschbe
Date: Wed Sep 12 02:37:20 2007
New Revision: 574860

URL: http://svn.apache.org/viewvc?rev=574860&view=rev
Log:
Prevent NullPointerException if the bean property cannot be set because the bean is null

Modified:
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/reflection/ReflectionUtils.java

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/reflection/ReflectionUtils.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/reflection/ReflectionUtils.java?rev=574860&r1=574859&r2=574860&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/reflection/ReflectionUtils.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/main/java/org/apache/jackrabbit/ocm/reflection/ReflectionUtils.java
Wed Sep 12 02:37:20 2007
@@ -134,7 +134,8 @@
             PropertyUtils.setNestedProperty(object, fieldName, value);
         }
         catch(Exception ex) {
-            throw new JcrMappingException("Cannot set the field " + fieldName + " in the
class : " + object.getClass().toString(),
+            String className = (object == null) ? "<null>" : object.getClass().getName();
+            throw new JcrMappingException("Cannot set the field " + fieldName + " in the
class : " + className,
                     ex);
         }
     }



Mime
View raw message