jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <mreut...@adobe.com>
Subject RE: assert
Date Thu, 06 Sep 2012 13:48:25 GMT
OK, thanks for your feedback. I'll have a look and create
a JIRA issue.

regards
 marcel

> -----Original Message-----
> From: Michael Dürig [mailto:michid@gmail.com]
> Sent: Donnerstag, 6. September 2012 14:59
> To: oak-dev@jackrabbit.apache.org
> Subject: Re: assert
> 
> 
> Hi,
> 
> On 6.9.12 13:51, Jukka Zitting wrote:
> > Hi,
> >
> > On Thu, Sep 6, 2012 at 2:36 PM, Marcel Reutegger
> <mreutegg@adobe.com> wrote:
> >> I think we need to throw an exception in this case.
> IllegalArgumentException?
> 
> This shouldn't be an assertion agreed.
> 
> >
> > 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.
> 
> +1 for using the precondition feature.
> 
> 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.
> 
> Michael
> 
> 
> >
> > [1] http://code.google.com/p/guava-libraries/wiki/PreconditionsExplained
> >
> > BR,
> >
> > Jukka Zitting
> >

Mime
View raw message