openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mprud...@apache.org
Subject svn commit: r442030 - /incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java
Date Sun, 10 Sep 2006 23:24:03 GMT
Author: mprudhom
Date: Sun Sep 10 16:24:02 2006
New Revision: 442030

URL: http://svn.apache.org/viewvc?view=rev&rev=442030
Log:
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.

Modified:
    incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java

Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java
URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java?view=diff&rev=442030&r1=442029&r2=442030
==============================================================================
--- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java
(original)
+++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java
Sun Sep 10 16:24:02 2006
@@ -810,8 +810,9 @@
      * 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));



Mime
View raw message