Apologies if this is a FAQ, but I tried for some time to find it and
couldn't.
If I have a bean with a Long or Number property, e.g.
class TestBean {
private Long number = null;
public Long getNumber() { return number; }
public void setNumber(Long number) { this.number = number; }
}
and serialize an instance where the "number" property is null, for
example using
JSONSerializer.toJSON(new TestBean()).toString()
it gives the result
{"number":0}
and deserializing this gives an instance that is not equal to the original.
Is this expected or a bug?
I was expecting a serialized form of
{"number":null}
which, when deserialized does give me an instance equal to the original.
--a.
|