From 663dae728990a28673e53f84d35965c93c6f0569 Mon Sep 17 00:00:00 2001 From: hns Date: Mon, 7 Jul 2003 12:45:11 +0000 Subject: [PATCH] Serialize ID and name as Object rather than UTF to avoid NullPointerException on mountpoints. --- src/helma/objectmodel/db/Node.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/helma/objectmodel/db/Node.java b/src/helma/objectmodel/db/Node.java index aa8e3669..c3e9806f 100644 --- a/src/helma/objectmodel/db/Node.java +++ b/src/helma/objectmodel/db/Node.java @@ -184,8 +184,13 @@ public final class Node implements INode, Serializable { String rawParentID = null; - id = in.readUTF(); - name = in.readUTF(); + if (version < 8) { + id = in.readUTF(); + name = in.readUTF(); + } else { + id = (String) in.readObject(); + name = (String) in.readObject(); + } if (version < 5) { rawParentID = (String) in.readObject(); @@ -250,9 +255,9 @@ public final class Node implements INode, Serializable { * Write out this instance to a stream */ private void writeObject(ObjectOutputStream out) throws IOException { - out.writeShort(7); // serialization version - out.writeUTF(id); - out.writeUTF(name); + out.writeShort(8); // serialization version + out.writeObject(id); + out.writeObject(name); out.writeObject(parentHandle); out.writeLong(created); out.writeLong(lastmodified);