jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@adobe.com>
Subject Re: The infamous getSize() == -1 (Was: [jira] [Created] (OAK-300) Query: QueryResult.getRows().getSize())
Date Thu, 13 Sep 2012 02:21:42 GMT
On 12.09.2012, at 01:23, Michael Dürig <mduerig@apache.org> wrote:

> As an alternative: we could use a separate method getSize(int max) which
> 
> * if called with max == -1 returns the exact size if quickly available,
> * returns -1 otherwise, and
> * returns the exact size but not more then max when called with max >= 0.

+1 clean and obvious (points the app developer to the issue without having to know another
method like hasSize())

Cheers,
Alex
Mime
View raw message