From 5e1b2d16ec87329633e2795ed8e07f420975b27c Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Tue, 30 Nov 2004 02:19:58 +0000 Subject: [PATCH] Added custom deserializer to initialize transient casted reference. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3253 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/parlor/data/Table.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/parlor/data/Table.java b/src/java/com/threerings/parlor/data/Table.java index e987b15e6..5010632d1 100644 --- a/src/java/com/threerings/parlor/data/Table.java +++ b/src/java/com/threerings/parlor/data/Table.java @@ -1,5 +1,5 @@ // -// $Id: Table.java,v 1.18 2004/08/27 02:20:13 mdb Exp $ +// $Id$ // // Narya library - tools for developing networked games // Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved @@ -21,6 +21,10 @@ package com.threerings.parlor.data; +import java.io.IOException; + +import com.threerings.io.ObjectInputStream; + import com.samskivert.util.StringUtil; import com.threerings.util.Name; @@ -94,6 +98,18 @@ public class Table { } + /** + * Extends default behavior to initialize transient members. + */ + public void readObject (ObjectInputStream in) + throws IOException, ClassNotFoundException + { + in.defaultReadObject(); + + // initialize casted reference + _tconfig = (TableConfig)config; + } + /** * A convenience function for accessing the table id as an int. */