openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r955402 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedValueHandler.java
Date Wed, 16 Jun 2010 21:31:24 GMT
Author: dwoods
Date: Wed Jun 16 21:31:23 2010
New Revision: 955402

URL: http://svn.apache.org/viewvc?rev=955402&view=rev
Log:
OPENJPA-1700 FindBugs - Possible null pointer dereference; There is a branch where em1 would
not get set.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedValueHandler.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedValueHandler.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedValueHandler.java?rev=955402&r1=955401&r2=955402&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedValueHandler.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/EmbedValueHandler.java
Wed Jun 16 21:31:23 2010
@@ -240,7 +240,11 @@ public abstract class EmbedValueHandler
                     idx = toObjectValue1(em1, vm1, val, store, null,
                             getColumns(fms[i]), idx);
                 }
-                cval = em1.getManagedInstance();
+                if (em1 != null) {
+                    cval = em1.getManagedInstance();
+                } else {
+                    cval = null;
+                }
             } else {
                 ecols = embed.getColumns();
                 if (ecols.length == 0)



Mime
View raw message