From oak-dev-return-2537-apmail-jackrabbit-oak-dev-archive=jackrabbit.apache.org@jackrabbit.apache.org Thu Sep 13 02:22:18 2012 Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D8B65D327 for ; Thu, 13 Sep 2012 02:22:17 +0000 (UTC) Received: (qmail 90610 invoked by uid 500); 13 Sep 2012 02:22:17 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 90529 invoked by uid 500); 13 Sep 2012 02:22:17 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 90521 invoked by uid 99); 13 Sep 2012 02:22:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Sep 2012 02:22:17 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aklimets@adobe.com designates 64.18.1.37 as permitted sender) Received: from [64.18.1.37] (HELO exprod6og116.obsmtp.com) (64.18.1.37) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Sep 2012 02:22:07 +0000 Received: from outbound-smtp-2.corp.adobe.com ([193.104.215.16]) by exprod6ob116.postini.com ([64.18.5.12]) with SMTP ID DSNKUFFDOvWWodaW+b03AB6GiseZ/Bp+HMFw@postini.com; Wed, 12 Sep 2012 19:21:47 PDT Received: from inner-relay-1.corp.adobe.com (inner-relay-1.adobe.com [153.32.1.51]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q8D2LiL1004788 for ; Wed, 12 Sep 2012 19:21:45 -0700 (PDT) Received: from nacas01.corp.adobe.com (nacas01.corp.adobe.com [10.8.189.99]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q8D2LhLd029291 for ; Wed, 12 Sep 2012 19:21:43 -0700 (PDT) Received: from eurhub01.eur.adobe.com (10.128.4.30) by nacas01.corp.adobe.com (10.8.189.99) with Microsoft SMTP Server (TLS) id 8.3.264.0; Wed, 12 Sep 2012 19:21:43 -0700 Received: from eurmbx01.eur.adobe.com ([10.128.4.32]) by eurhub01.eur.adobe.com ([10.128.4.30]) with mapi; Thu, 13 Sep 2012 03:21:40 +0100 From: Alexander Klimetschek To: "oak-dev@jackrabbit.apache.org" Date: Thu, 13 Sep 2012 03:21:42 +0100 Subject: Re: The infamous getSize() == -1 (Was: [jira] [Created] (OAK-300) Query: QueryResult.getRows().getSize()) Thread-Topic: The infamous getSize() == -1 (Was: [jira] [Created] (OAK-300) Query: QueryResult.getRows().getSize()) Thread-Index: Ac2RVoJQYiTxhxdzT2awEml2TcEy3w== Message-ID: References: <50504691.3010803@apache.org> In-Reply-To: <50504691.3010803@apache.org> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE, en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 On 12.09.2012, at 01:23, Michael D=FCrig wrote: > As an alternative: we could use a separate method getSize(int max) which >=20 > * if called with max =3D=3D -1 returns the exact size if quickly availabl= e, > * returns -1 otherwise, and > * returns the exact size but not more then max when called with max >=3D = 0. +1 clean and obvious (points the app developer to the issue without having = to know another method like hasSize()) Cheers, Alex=