From 65bd1f02e386c0e8b11fdd444b7b8caabbe8d081 Mon Sep 17 00:00:00 2001 From: "A. Abram White" Date: Thu, 22 Feb 2007 20:11:00 +0000 Subject: [PATCH] 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 --- .../org/apache/openjpa/lib/conf/ConfigurationImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java b/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java index 67516add1..a72d99777 100644 --- a/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java +++ b/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/ConfigurationImpl.java @@ -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;