Hi,

Am 13.01.2012 um 22:36 schrieb Justin Edelson:

> I discovered today that JcrResourceResolver.map(" ") throws a
> NullPointerException from inside the mangleNamespaces() method. This
> is unintuitive, so I was trying to make it more intuitive.
> 

Hmm, the question is, what map("") should do in the first place ?

If we are ok with return the root (URL), then having the mangleNamespaces throw 
any thing is clearly wrong.

Today, it looks like map("") returns the root URL, so the mangleNamespaces 
should be resilient to this.

(I cannot reproduce this NPE, though in the current trunk)

> But then I got stuck trying to think about what it should do. I've
> come up with two options, but am open to others. Note - this isn't a
> formal vote (unless someone else feels it should be):
> 
> 1) throw IllegalArgumentException. In this case, map("") should
> probably throw this exception as well.

I think this is wrong. mangelNamespace should not throw.

> 2) return the root node (which is what map("") does currently).

if "" maps to "/", mangleNamespace should be null-op anyway, because "/" does 
not contain a colon.

Regards
Felix

Reply via email to