Fixed getMethodDescriptors to not try to create a MethodDescriptor for a non-existant method (which would cause an NPE).

git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@443524 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Marc Prud'hommeaux 2006-09-14 23:47:13 +00:00
parent 47edcb8edc
commit 20e0762e43
1 changed files with 6 additions and 2 deletions

View File

@ -374,8 +374,12 @@ public class ConfigurationImpl
PropertyDescriptor[] pds = getPropertyDescriptors(); PropertyDescriptor[] pds = getPropertyDescriptors();
_mds = new MethodDescriptor[pds.length * 2]; _mds = new MethodDescriptor[pds.length * 2];
for (int i = 0; i < pds.length; i++) { for (int i = 0; i < pds.length; i++) {
_mds[i * 2] = new MethodDescriptor(pds[i].getWriteMethod()); Method write = pds[i].getWriteMethod();
_mds[(i * 2) + 1] = new MethodDescriptor(pds[i].getReadMethod()); 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; return _mds;
} }