Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-6277

UserQueryManager: redundant check for colliding bound and offset

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 1.7.1, 1.8.0
    • core
    • None

    Description

      while writing unit tests for the UserQueryManager i noticed the following check for collision between the bound value and the offset:

      XPathQueryBuilder builder = new XPathQueryBuilder();
      [...]
      Value bound = builder.getBound(); 
      if (bound != null && offset > 0) {
            log.warn("Found bound {} and offset {} in limit. Discarding offset.", builder.getBound(), offset);
            offset = 0;
      }
      

      however, the XPathQueryBuilder already takes care of resetting offset/bound if the other limit is set. The extra check in the query manager is therefore superfluous and the statement will never be reached IMO.

      cc: alex.parvulescu, mduerig

      Attachments

        Activity

          People

            angela Angela Schreiber
            angela Angela Schreiber
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: