El vie, 20-07-2007 a las 10:38 +0300, Alexandru Popescu ☀ escribió: > 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.
Yes, property.setValue(null) equals to remove() is strange for me too.
