Description
The ResourceUtil.getParent(Resource) method uses the ResourceResolver.resolve method to get the parent resource of the given resource. This is incorrect, since the resolve method applies mapping methods, which are not appropriate here. Here we just want to get resource, therefore the getResource method is to be used.
Using resolve here may create an endless loop in the JcrResourceResolver2.map(HttpServletRequest, String) method, which uses this method to walk up the parent resource chain - which may result in repated sling:alias resolution.