openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curti...@apache.org
Subject svn commit: r1342747 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java
Date Fri, 25 May 2012 17:58:06 GMT
Author: curtisr7
Date: Fri May 25 17:58:06 2012
New Revision: 1342747

URL: http://svn.apache.org/viewvc?rev=1342747&view=rev
Log:
OPENJPA-2151: Fix NPE in ClassMetaData.hasInverseManagedFields.

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

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java?rev=1342747&r1=1342746&r2=1342747&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java
Fri May 25 17:58:06 2012
@@ -2787,12 +2787,14 @@ public class ClassMetaData
 
     public boolean hasInverseManagedFields() {
         if (inverseManagedFields == null) {
-            for(FieldMetaData fmd: getFields()){
-                if(fmd.getInverseMetaDatas().length > 0){
-                    inverseManagedFields = Boolean.TRUE;
+            Boolean res = Boolean.FALSE;
+            for (FieldMetaData fmd : getFields()) {
+                if (fmd.getInverseMetaDatas().length > 0) {
+                    res = Boolean.TRUE;
                     break;
                 }
             }
+            inverseManagedFields = res;
         }
         return inverseManagedFields.booleanValue();
     }



Mime
View raw message