On 7/20/07, Thomas Mueller <[EMAIL PROTECTED]> wrote:
Hi,

There is a difference between an empty String and null.

> if a property was set to null, my xml representation showed nothing at
> all (no property name or value). This isn't acceptable

Why don't you set it to an empty String?

> Well, I agree that having an empty string value and being absent (and having
> a null value) are all completely different things. However, I do see removal
> of the property itself as a side effect of setting the property to null.

Removing the property by setting it to null is not a 'side effect'. It
is the only effect.

> Me too. Making it mandatory even better :-)

That would be a solution. Setting it to null could just throw a
NullPointerException.

Thomas


I don't think I agree on this. As you said: null and empty strings are
distinct values. Another distinct case is: innexistance, which is not
synonymous with null or empty. Atm you cannot store a null value
inside JCR -- and for solving this one must usually create a null-like
value.

The OP is suggesting that this is a spec issue and storing null values
should be allowed. But doing so results in API behavioral changes,
because currently property.setValue(null) is equivalent to remove.

bests,
./alex
--
.w( the_mindstorm )p.

Reply via email to