openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mprud...@apache.org
Subject svn commit: r443524 - /incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
Date Thu, 14 Sep 2006 23:47:13 GMT
Author: mprudhom
Date: Thu Sep 14 16:47:13 2006
New Revision: 443524

URL: http://svn.apache.org/viewvc?view=rev&rev=443524
Log:
Fixed getMethodDescriptors to not try to create a MethodDescriptor for a non-existant method
(which would cause an NPE).

Modified:
    incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java

Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java?view=diff&rev=443524&r1=443523&r2=443524
==============================================================================
--- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
(original)
+++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java
Thu Sep 14 16:47:13 2006
@@ -374,8 +374,12 @@
         PropertyDescriptor[] pds = getPropertyDescriptors();
         _mds = new MethodDescriptor[pds.length * 2];
         for (int i = 0; i < pds.length; i++) {
-            _mds[i * 2] = new MethodDescriptor(pds[i].getWriteMethod());
-            _mds[(i * 2) + 1] = new MethodDescriptor(pds[i].getReadMethod());
+            Method write = pds[i].getWriteMethod();
+            if (write != null)
+                _mds[i * 2] = new MethodDescriptor(write);
+            Method read = pds[i].getReadMethod();
+            if (read != null)
+                _mds[(i * 2) + 1] = new MethodDescriptor(read);
         }
         return _mds;
     }



Mime
View raw message