diff --git a/src/java/com/threerings/io/ObjectInputStream.java b/src/java/com/threerings/io/ObjectInputStream.java index 6cb8d39e4..4f7a7675d 100644 --- a/src/java/com/threerings/io/ObjectInputStream.java +++ b/src/java/com/threerings/io/ObjectInputStream.java @@ -1,5 +1,5 @@ // -// $Id: ObjectInputStream.java,v 1.1 2002/07/23 05:42:34 mdb Exp $ +// $Id: ObjectInputStream.java,v 1.2 2002/12/02 22:10:10 mdb Exp $ package com.threerings.io; @@ -8,6 +8,7 @@ import java.io.DataInputStream; import java.io.IOException; import com.samskivert.util.HashIntMap; +import com.samskivert.util.StringUtil; import com.threerings.presents.Log; @@ -79,7 +80,14 @@ public class ObjectInputStream extends DataInputStream // sanity check if (cmap == null) { - String errmsg = "Aiya! Read object code for which we " + + // this will help with debugging + Log.warning("Internal stream error, no class metadata " + + "[code=" + code + ", ois=" + this + "]."); + Thread.dumpStack(); + Log.warning("ObjectInputStream mappings " + + StringUtil.toString(_classmap.entrySet()) + + "."); + String errmsg = "Read object code for which we " + "have no registered class metadata [code=" + code + "]"; throw new RuntimeException(errmsg); } @@ -147,6 +155,16 @@ public class ObjectInputStream extends DataInputStream _streamer.readObject(_current, this, false); } + /** + * Generates a string representation of this instance. + */ + public String toString () + { + return "[hash=" + hashCode() + ", mappings=" + _classmap.size() + + ", current=" + StringUtil.safeToString(_current) + + ", streamer=" + _streamer + "]"; + } + /** * Used by a {@link Streamer} that is reading an array of {@link * Streamable} instances. diff --git a/src/java/com/threerings/io/Streamer.java b/src/java/com/threerings/io/Streamer.java index 8cbc786a4..eadb4c2ad 100644 --- a/src/java/com/threerings/io/Streamer.java +++ b/src/java/com/threerings/io/Streamer.java @@ -1,5 +1,5 @@ // -// $Id: Streamer.java,v 1.1 2002/07/23 05:42:34 mdb Exp $ +// $Id: Streamer.java,v 1.2 2002/12/02 22:10:10 mdb Exp $ package com.threerings.io; @@ -299,6 +299,16 @@ public class Streamer } } + /** + * Generates a string representation of this instance. + */ + public String toString () + { + return "[target=" + _target.getName() + ", delegate=" + _delegate + + ", fcount=" + _fields.length + ", reader=" + _reader + + ", writer=" + _writer + "]"; + } + /** * The constructor used by the basic streamers. */