Uploaded image for project: '[Read Only] - Hippo Repository'
  1. [Read Only] - Hippo Repository
  2. REPO-2255

HippoAccessManager#matchFacetRule is invoked very many times and does endlessly the same equals ignore String comparison

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 14.0.0
    • 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

      Attachments

        Activity

          People

            Unassigned Unassigned
            aschrijvers Ard Schrijvers
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: