mirror of https://github.com/apache/openjpa.git
Avoid potential NPE; fix error msg.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@590143 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cd2f9e978e
commit
73b35874f0
|
@ -463,10 +463,11 @@ public class StateManagerImpl
|
||||||
// merge the fetchgroup required fields to the original
|
// merge the fetchgroup required fields to the original
|
||||||
// fields only the fields are not already loaded and
|
// fields only the fields are not already loaded and
|
||||||
// are not in the original fields.
|
// are not in the original fields.
|
||||||
for (int j = 0; j < fgFields.length(); j++) {
|
if (fgFields != null)
|
||||||
if (fgFields.get(j) && !fields.get(j) && !_loaded.get(j))
|
for (int j = 0; j < fgFields.length(); j++) {
|
||||||
fields.set(j);
|
if (fgFields.get(j) && !fields.get(j) &&!_loaded.get(j))
|
||||||
}
|
fields.set(j);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -597,7 +598,7 @@ public class StateManagerImpl
|
||||||
// Just return if there's no value generation strategy
|
// Just return if there's no value generation strategy
|
||||||
if (fmd.getValueStrategy() == ValueStrategies.NONE)
|
if (fmd.getValueStrategy() == ValueStrategies.NONE)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Throw exception if field already has a value assigned.
|
// Throw exception if field already has a value assigned.
|
||||||
// @GeneratedValue overrides POJO initial values and setter methods
|
// @GeneratedValue overrides POJO initial values and setter methods
|
||||||
if (!isDefaultValue(field) && !fmd.isValueGenerated())
|
if (!isDefaultValue(field) && !fmd.isValueGenerated())
|
||||||
|
@ -816,7 +817,8 @@ public class StateManagerImpl
|
||||||
|
|
||||||
SaveFieldManager saved = getSaveFieldManager();
|
SaveFieldManager saved = getSaveFieldManager();
|
||||||
if (saved == null)
|
if (saved == null)
|
||||||
throw new InternalException(_loc.get("no-saved-fields"));
|
throw new InternalException(_loc.get("no-saved-fields",
|
||||||
|
getManagedInstance()));
|
||||||
|
|
||||||
FieldMetaData[] fmds = getMetaData().getFields();
|
FieldMetaData[] fmds = getMetaData().getFields();
|
||||||
for (int i = 0; i < fmds.length; i++) {
|
for (int i = 0; i < fmds.length; i++) {
|
||||||
|
|
Loading…
Reference in New Issue