OPENJPA-2369, eliminate the duplicate call to getUnloadedInternal function.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1468536 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Helen Xu 2013-04-16 18:04:55 +00:00
parent 96751867c9
commit 8b75df3c9b
1 changed files with 6 additions and 3 deletions

View File

@ -3145,11 +3145,13 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
FetchConfiguration fetch = _broker.getFetchConfiguration();
FieldMetaData fmd = _meta.getField(field);
BitSet fields = null;
boolean unloadedDFGFieldMarked = false;
// if this is a dfg field or we need to load our dfg, do so
if (fgs && (_flags & FLAG_LOADED) == 0)
if (fgs && (_flags & FLAG_LOADED) == 0){
fields = getUnloadedInternal(fetch, LOAD_FGS, null);
unloadedDFGFieldMarked = true;
}
// check for load fetch group
String lfg = fmd.getLoadFetchGroup();
boolean lfgAdded = false;
@ -3172,7 +3174,8 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
}
} else if (fmd.isInDefaultFetchGroup() && fields == null) {
// no load group but dfg: add dfg fields if we haven't already
fields = getUnloadedInternal(fetch, LOAD_FGS, null);
if (!unloadedDFGFieldMarked)
fields = getUnloadedInternal(fetch, LOAD_FGS, null);
} else if (!_loaded.get(fmd.getIndex())) {
// no load group or dfg: load individual field
if (fields == null)