mirror of
https://github.com/apache/openjpa.git
synced 2025-03-06 16:39:11 +00:00
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:
parent
7b1c24e1fa
commit
950ae7ab76
@ -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) {
|
||||||
|
@ -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) {
|
||||||
|
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user