From oak-dev-return-2507-apmail-jackrabbit-oak-dev-archive=jackrabbit.apache.org@jackrabbit.apache.org Thu Sep 6 13:49:21 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 12F3BDDB5 for ; Thu, 6 Sep 2012 13:49:21 +0000 (UTC) Received: (qmail 59680 invoked by uid 500); 6 Sep 2012 13:49:21 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 59650 invoked by uid 500); 6 Sep 2012 13:49:20 -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 59642 invoked by uid 99); 6 Sep 2012 13:49:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2012 13:49:20 +0000 X-ASF-Spam-Status: No, hits=-1.3 required=5.0 tests=FRT_ADOBE2,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mreutegg@adobe.com designates 64.18.1.189 as permitted sender) Received: from [64.18.1.189] (HELO exprod6og105.obsmtp.com) (64.18.1.189) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Sep 2012 13:49:11 +0000 Received: from outbound-smtp-1.corp.adobe.com ([192.150.11.134]) by exprod6ob105.postini.com ([64.18.5.12]) with SMTP ID DSNKUEipwUfEypz/TrhHjVejV26eh/OXhKUA@postini.com; Thu, 06 Sep 2012 06:48:50 PDT Received: from inner-relay-4.eur.adobe.com (inner-relay-4.adobe.com [193.104.215.14]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q86DkFk0020043 for ; Thu, 6 Sep 2012 06:46:16 -0700 (PDT) Received: from nacas01.corp.adobe.com (nacas01.corp.adobe.com [10.8.189.99]) by inner-relay-4.eur.adobe.com (8.12.10/8.12.9) with ESMTP id q86DmgYv026019 for ; Thu, 6 Sep 2012 06:48:47 -0700 (PDT) Received: from eurcas01.eur.adobe.com (10.128.4.27) by nacas01.corp.adobe.com (10.8.189.99) with Microsoft SMTP Server (TLS) id 8.3.264.0; Thu, 6 Sep 2012 06:48:44 -0700 Received: from eurmbx01.eur.adobe.com ([10.128.4.32]) by eurcas01.eur.adobe.com ([10.128.4.27]) with mapi; Thu, 6 Sep 2012 14:48:26 +0100 From: Marcel Reutegger To: "oak-dev@jackrabbit.apache.org" Date: Thu, 6 Sep 2012 14:48:25 +0100 Subject: RE: assert Thread-Topic: assert Thread-Index: Ac2ML4V0UVCLWNX6S4iemhNL/jAIYgABrVzw Message-ID: <9C0FC4C8E9C29945B01766FC7F9D389816FE0B1F47@eurmbx01.eur.adobe.com> References: <9C0FC4C8E9C29945B01766FC7F9D389816FE0B1F32@eurmbx01.eur.adobe.com> <50489E0C.3000100@gmail.com> In-Reply-To: <50489E0C.3000100@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 OK, thanks for your feedback. I'll have a look and create a JIRA issue. regards marcel > -----Original Message----- > From: Michael D=FCrig [mailto:michid@gmail.com] > Sent: Donnerstag, 6. September 2012 14:59 > To: oak-dev@jackrabbit.apache.org > Subject: Re: assert >=20 >=20 > Hi, >=20 > On 6.9.12 13:51, Jukka Zitting wrote: > > Hi, > > > > On Thu, Sep 6, 2012 at 2:36 PM, Marcel Reutegger > wrote: > >> I think we need to throw an exception in this case. > IllegalArgumentException? >=20 > This shouldn't be an assertion agreed. >=20 > > > > Agreed in general. I've already encountered a few cases where a test > > case runs just fine in Eclipse (without assertions enabled) but then > > fails during the Maven build (which enables assertions). It would be > > better if such failsafes were executed always unless they're too > > expensive to compute in normal operation. > > > > The precondition feature [1] in Guava is a pretty nice way to > > implement such checks. >=20 > +1 for using the precondition feature. >=20 > One notable exception might be PathUtils where the precondition check > might turn out to be quite expensive. So I think we should keep the > assertions there. >=20 > Michael >=20 >=20 > > > > [1] http://code.google.com/p/guava-libraries/wiki/PreconditionsExplaine= d > > > > BR, > > > > Jukka Zitting > >