jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexandru Popescu ☀" <the.mindstorm.mailingl...@gmail.com>
Subject Re: Removing Items
Date Fri, 20 Jul 2007 07:38:29 GMT
On 7/20/07, Thomas Mueller <thomas.tom.mueller@gmail.com> 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

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.

.w( the_mindstorm )p.

View raw message