openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1674148 - in /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel: SaveFieldManager.java SavepointFieldManager.java TransferFieldManager.java
Date Thu, 16 Apr 2015 20:35:10 GMT
Author: struberg
Date: Thu Apr 16 20:35:10 2015
New Revision: 1674148

URL: http://svn.apache.org/r1674148
Log:
OPENJPA-2287 do not clear object fields for fetchObjectField

* Other objects do not get cleared neither.
* The code dates from JDO times and I've asked a few people and no one had an explanation
for it
* It introduces nullpointer exceptions in cases where we have to navigate over the field a
few times. E.g. in complex scenarios.

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SaveFieldManager.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SavepointFieldManager.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TransferFieldManager.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SaveFieldManager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SaveFieldManager.java?rev=1674148&r1=1674147&r2=1674148&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SaveFieldManager.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SaveFieldManager.java
Thu Apr 16 20:35:10 2015
@@ -193,9 +193,7 @@ public class SaveFieldManager
 
     public Object fetchObjectField(int field) {
         // return the copied field during save, or a null value during restore
-        Object val = _field;
-        _field = null;
-        return val;
+        return _field;
     }
 
     public void storeObjectField(int field, Object curVal) {

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SavepointFieldManager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SavepointFieldManager.java?rev=1674148&r1=1674147&r2=1674148&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SavepointFieldManager.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SavepointFieldManager.java
Thu Apr 16 20:35:10 2015
@@ -194,10 +194,7 @@ class SavepointFieldManager
     }
 
     public Object fetchObjectField(int field) {
-        // return the copied field during save, or a null value during restore
-        Object val = _field;
-        _field = null;
-        return val;
+        return _field;
     }
 
     public void storeObjectField(int field, Object curVal) {

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TransferFieldManager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TransferFieldManager.java?rev=1674148&r1=1674147&r2=1674148&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TransferFieldManager.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/TransferFieldManager.java
Thu Apr 16 20:35:10 2015
@@ -62,10 +62,7 @@ class TransferFieldManager
     }
 
     public Object fetchObjectField(int field) {
-        // don't hold onto strong ref to object
-        Object val = objval;
-        objval = null;
-        return val;
+        return objval;
     }
 
     public short fetchShortField(int field) {



Mime
View raw message