From 20e0762e43734170fd7d97297693382329877b33 Mon Sep 17 00:00:00 2001 From: Marc Prud'hommeaux Date: Thu, 14 Sep 2006 23:47:13 +0000 Subject: [PATCH] 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 --- .../org/apache/openjpa/lib/conf/ConfigurationImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java b/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java index 58c133c7c..551e5e5e1 100644 --- a/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java +++ b/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java @@ -374,8 +374,12 @@ public class ConfigurationImpl 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; }