openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fa...@apache.org
Subject svn commit: r741994 - in /openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java
Date Sun, 08 Feb 2009 01:43:45 GMT
Author: fancy
Date: Sun Feb  8 01:43:45 2009
New Revision: 741994

URL: http://svn.apache.org/viewvc?rev=741994&view=rev
Log:
OPENJPA-912 Potential NPE in setInverseRelation

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java?rev=741994&r1=741993&r2=741994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java
Sun Feb  8 01:43:45 2009
@@ -392,6 +392,10 @@
                     for (Iterator itr = ((Collection) coll).iterator();
                         itr.hasNext();) {
                         PersistenceCapable pc = (PersistenceCapable) itr.next();
+
+                        if (pc == null)
+                            continue;
+
                         OpenJPAStateManager sm = (OpenJPAStateManager) pc.
                             pcGetStateManager();
                         FieldMapping[] fmd = ((ClassMapping) sm.getMetaData()).

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java?rev=741994&r1=741993&r2=741994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java
Sun Feb  8 01:43:45 2009
@@ -32,7 +32,8 @@
 	long aid;
 
 	public void setUp () {
-		setUp (ChainEntityA.class, ChainEntityB.class, ChainEntityC.class);
+		setUp (DROP_TABLES,
+		    ChainEntityA.class, ChainEntityB.class, ChainEntityC.class);
 		// Create A
 		ChainEntityA a = new ChainEntityA ();
 		a.setName ("TEST_A");



Mime
View raw message