You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "angela (JIRA)" <ji...@apache.org> on 2017/05/30 12:52:04 UTC

[jira] [Created] (OAK-6277) UserQueryManager: redundant check for colliding bound and offset

angela created OAK-6277:
---------------------------

             Summary: UserQueryManager: redundant check for colliding bound and offset
                 Key: OAK-6277
                 URL: https://issues.apache.org/jira/browse/OAK-6277
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: core
            Reporter: angela
            Assignee: angela
            Priority: Trivial


while writing unit tests for the {{UserQueryManager}} i noticed the following check for collision between the bound value and the offset:
{code}
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;
}
{code}

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]
            



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)