[Yanel-dev] [FYI] Yarep chokes on null String properties but this is neither documented nor checked against

Michael Wechner michael.wechner at wyona.com
Fri May 14 10:13:22 CEST 2010


Guillaume Déflache wrote:
> Hi!
>
> When using org.wyona.yarep.core.Node#setProperty(String name, String 
> value) if value is null nothing happens at first but it looks like it 
> can lead to problems later, e.g. a NPE on 
> org.wyona.yarep.impl.repo.vfs.VirtualFileSystemNode.escapeSeparator(VirtualFileSystemNode.java:714) 
> with Yarep r49426.
>
> I am not sure it makes sense to store null property values in Yarep at 
> all and if this is indeed supported, but I thought I would share.

thanks very much for sharing. I would suggest that Yarep is throwing a 
RepositoryException or at least is catching the NullPointer and returns 
a null.

WDYT?
>
> Note: the same would probably happen with 
> org.wyona.yarep.core.Node#setProperty(String name, Date value) and the 
> Property implementation objects' Date-value and String-value setters, 
> and also their constructors with Date and String parameters.

yes, I would suggest to apply my suggestion from above to all 
setProperty methods.

Makes sense?

Thanks

Michi
>
> HTH,
>    Guillaume



More information about the Yanel-development mailing list