jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: assert
Date Thu, 06 Sep 2012 12:51:25 GMT

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?

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] http://code.google.com/p/guava-libraries/wiki/PreconditionsExplained


Jukka Zitting

View raw message