Hi,
I have a question around the getParent() method on a NonExistingResource.
Currently it returns null in case the parent is also a non existing resource.

According to the javadoc of Resource.getParent() this is kind of unexpected, 
because it states 
(https://github.com/apache/sling/blob/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/Resource.java#L89)
...
Returns the parent resource or <code>null</code> if this resource
* represents the root of the resource tree.
...
Derived from that I would assume that a NonExistingResource would also return a 
NonExistingResource as result of getParent() in case the parent does not exist 
either instead of returning null (which it does right now).

In case the behaviour of returning null is deliberate, we should clarify the 
javadoc of Resource.getParent() with the additional conditions when this method 
may return null.
WDYT?

Thanks,
Konrad

Reply via email to