mirror of https://github.com/apache/openjpa.git
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:
parent
3b2f6a720d
commit
25e80a994e
|
@ -810,8 +810,9 @@ public class ClassMetaData
|
||||||
* Return the superclass copy of the given field.
|
* Return the superclass copy of the given field.
|
||||||
*/
|
*/
|
||||||
protected FieldMetaData getSuperclassField(FieldMetaData supField) {
|
protected FieldMetaData getSuperclassField(FieldMetaData supField) {
|
||||||
FieldMetaData fmd = getPCSuperclassMetaData().
|
ClassMetaData sm = getPCSuperclassMetaData();
|
||||||
getField(supField.getName());
|
FieldMetaData fmd = sm == null ? null : sm.getField(supField.getName());
|
||||||
|
|
||||||
if (fmd == null || fmd.getManagement() != fmd.MANAGE_PERSISTENT)
|
if (fmd == null || fmd.getManagement() != fmd.MANAGE_PERSISTENT)
|
||||||
throw new MetaDataException(_loc.get("unmanaged-sup-field",
|
throw new MetaDataException(_loc.get("unmanaged-sup-field",
|
||||||
supField, this));
|
supField, this));
|
||||||
|
|
Loading…
Reference in New Issue