Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
Description
This is really inefficient and very easy to improve in performance.
Also the #matchFacetRule already has
if (NameConstants.JCR_UUID.equals(facetRule.getFacetName())) { boolean uuidMatch = false; log.trace("Checking node : {} for matching jcr:uuid with : {}", nodeState.getId(), facetRule); if (nodeState.getNodeId().toString().equals(facetRule.getValue())) { uuidMatch = true; } if (facetRule.isEqual()) { return uuidMatch; } else { return !uuidMatch; } }
and then later on in #matchPropertyWithFacetRule there is
else if (rule.getFacetName().equals(NameConstants.JCR_UUID)) { return nodeState.getNodeId().toString().equals(rule.getValue()) ? rule.isEqual() : !rule.isEqual(); }
The code can never reach this part in matchPropertyWithFacetRule since #matchFacetRule already returns a value