Increased serialization version to 7. String properties are now serialized
as objects, because there seems to be a limit around 60000 chars for UTF.
This commit is contained in:
parent
56e5201f8e
commit
2ca5232637
2 changed files with 7 additions and 3 deletions
|
@ -107,7 +107,7 @@ public final class Node implements INode, Serializable {
|
|||
* Write out this instance to a stream
|
||||
*/
|
||||
private void writeObject (ObjectOutputStream out) throws IOException {
|
||||
out.writeShort (6); // serialization version
|
||||
out.writeShort (7); // serialization version
|
||||
out.writeUTF (id);
|
||||
out.writeUTF (name);
|
||||
out.writeObject (parentHandle);
|
||||
|
|
|
@ -40,7 +40,11 @@ public final class Property implements IProperty, Serializable, Cloneable {
|
|||
type = in.readInt ();
|
||||
switch (type) {
|
||||
case STRING:
|
||||
svalue = in.readUTF ();
|
||||
// try to convert from old format
|
||||
if (node.version < 7)
|
||||
svalue = in.readUTF ();
|
||||
else
|
||||
svalue = (String) in.readObject ();
|
||||
break;
|
||||
case BOOLEAN:
|
||||
bvalue = in.readBoolean ();
|
||||
|
@ -74,7 +78,7 @@ public final class Property implements IProperty, Serializable, Cloneable {
|
|||
out.writeInt (type);
|
||||
switch (type) {
|
||||
case STRING:
|
||||
out.writeUTF (svalue);
|
||||
out.writeObject (svalue);
|
||||
break;
|
||||
case BOOLEAN:
|
||||
out.writeBoolean (bvalue);
|
||||
|
|
Loading…
Add table
Reference in a new issue