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.


git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1674148 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Struberg 2015-04-16 20:35:10 +00:00
parent 7b1c24e1fa
commit 950ae7ab76
3 changed files with 3 additions and 11 deletions

View File

@ -193,9 +193,7 @@ public class SaveFieldManager
public Object fetchObjectField(int field) { public Object fetchObjectField(int field) {
// return the copied field during save, or a null value during restore // return the copied field during save, or a null value during restore
Object val = _field; return _field;
_field = null;
return val;
} }
public void storeObjectField(int field, Object curVal) { public void storeObjectField(int field, Object curVal) {

View File

@ -194,10 +194,7 @@ class SavepointFieldManager
} }
public Object fetchObjectField(int field) { public Object fetchObjectField(int field) {
// return the copied field during save, or a null value during restore return _field;
Object val = _field;
_field = null;
return val;
} }
public void storeObjectField(int field, Object curVal) { public void storeObjectField(int field, Object curVal) {

View File

@ -62,10 +62,7 @@ class TransferFieldManager
} }
public Object fetchObjectField(int field) { public Object fetchObjectField(int field) {
// don't hold onto strong ref to object return objval;
Object val = objval;
objval = null;
return val;
} }
public short fetchShortField(int field) { public short fetchShortField(int field) {