Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.2.13, 2.4.3, 2.5.3, 2.6
-
None
Description
In case of a Name which has no namespace (name.getNamespaceURI().length() == 0) there is perhaps no need to cache the resolved jcrName as it will be getLocalName().
If this is true, than I would like to suggest the following slight optimization in the org.apache.jackrabbit.spi.commons.conversion.CachingNameResolver.getJCRName(Name) method:
public String getJCRName(Name name) throws NamespaceException {
if (name.getNamespaceURI().length() == 0)
String jcrName = (String) cache.get(name);
...
This will return earlier and "save" the lookup in the cache and further cache.put() (the GenerationalCache.put(Object, Object) is synchronized so avoiding the call makes things potentially faster).
Thank you in advance!