Serialize ID and name as Object rather than UTF to avoid NullPointerException
on mountpoints.
This commit is contained in:
parent
8f53076707
commit
663dae7289
1 changed files with 10 additions and 5 deletions
|
@ -184,8 +184,13 @@ public final class Node implements INode, Serializable {
|
||||||
|
|
||||||
String rawParentID = null;
|
String rawParentID = null;
|
||||||
|
|
||||||
id = in.readUTF();
|
if (version < 8) {
|
||||||
name = in.readUTF();
|
id = in.readUTF();
|
||||||
|
name = in.readUTF();
|
||||||
|
} else {
|
||||||
|
id = (String) in.readObject();
|
||||||
|
name = (String) in.readObject();
|
||||||
|
}
|
||||||
|
|
||||||
if (version < 5) {
|
if (version < 5) {
|
||||||
rawParentID = (String) in.readObject();
|
rawParentID = (String) in.readObject();
|
||||||
|
@ -250,9 +255,9 @@ public final class Node implements INode, Serializable {
|
||||||
* Write out this instance to a stream
|
* Write out this instance to a stream
|
||||||
*/
|
*/
|
||||||
private void writeObject(ObjectOutputStream out) throws IOException {
|
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||||
out.writeShort(7); // serialization version
|
out.writeShort(8); // serialization version
|
||||||
out.writeUTF(id);
|
out.writeObject(id);
|
||||||
out.writeUTF(name);
|
out.writeObject(name);
|
||||||
out.writeObject(parentHandle);
|
out.writeObject(parentHandle);
|
||||||
out.writeLong(created);
|
out.writeLong(created);
|
||||||
out.writeLong(lastmodified);
|
out.writeLong(lastmodified);
|
||||||
|
|
Loading…
Add table
Reference in a new issue