mirror of https://github.com/apache/openjpa.git
Second attempt at serializing to full properties, including defaults, rather
than just user-defined properties. This ensures that on deserialization we get the proper settings despite not running product derivations. Previous attempt caused problems on SunONE. git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@510638 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7eb91d0ec9
commit
65bd1f02e3
|
@ -850,6 +850,7 @@ public class ConfigurationImpl
|
|||
public void readExternal(ObjectInput in)
|
||||
throws IOException, ClassNotFoundException {
|
||||
fromProperties((Map) in.readObject());
|
||||
_props = (Map) in.readObject();
|
||||
_globals = in.readBoolean();
|
||||
}
|
||||
|
||||
|
@ -858,10 +859,8 @@ public class ConfigurationImpl
|
|||
* the properties returned by {@link #toProperties}.
|
||||
*/
|
||||
public void writeExternal(ObjectOutput out) throws IOException {
|
||||
if (_props != null)
|
||||
out.writeObject(_props);
|
||||
else
|
||||
out.writeObject(toProperties(false));
|
||||
out.writeObject(toProperties(true));
|
||||
out.writeObject(_props);
|
||||
out.writeBoolean(_globals);
|
||||
}
|
||||
|
||||
|
@ -875,8 +874,9 @@ public class ConfigurationImpl
|
|||
(new Class[]{ boolean.class });
|
||||
ConfigurationImpl clone = (ConfigurationImpl) cons.newInstance
|
||||
(new Object[]{ Boolean.FALSE });
|
||||
clone._globals = _globals;
|
||||
clone.fromProperties(toProperties(true));
|
||||
clone._props = (_props == null) ? null : new HashMap(_props);
|
||||
clone._globals = _globals;
|
||||
return clone;
|
||||
} catch (RuntimeException re) {
|
||||
throw re;
|
||||
|
|
Loading…
Reference in New Issue