OPENJPA-42 Check for the existence of superclass metadata in getSuperclassField so we throw a better exception than an NPE if it doesn't exist.

git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@442030 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Marc Prud'hommeaux 2006-09-10 23:24:02 +00:00
parent 3b2f6a720d
commit 25e80a994e
1 changed files with 3 additions and 2 deletions

View File

@ -810,8 +810,9 @@ public class ClassMetaData
* Return the superclass copy of the given field.
*/
protected FieldMetaData getSuperclassField(FieldMetaData supField) {
FieldMetaData fmd = getPCSuperclassMetaData().
getField(supField.getName());
ClassMetaData sm = getPCSuperclassMetaData();
FieldMetaData fmd = sm == null ? null : sm.getField(supField.getName());
if (fmd == null || fmd.getManagement() != fmd.MANAGE_PERSISTENT)
throw new MetaDataException(_loc.get("unmanaged-sup-field",
supField, this));