jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Reschke <julian.resc...@gmx.de>
Subject Re: svn commit: r1334046 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr: NodeDelegate.java NodeImpl.java SessionDelegate.java
Date Mon, 07 May 2012 07:36:47 GMT
On 2012-05-07 09:08, Thomas Mueller wrote:
> Hi,
>
>> +        try {
>> +   return dlg.getNodeStatus() == Status.MODIFIED;
>> +        } catch (InvalidItemStateException ex) {
>> +   return false;
>> +        }
>
> I would rather not use exception handling for flow control. One reason is
> that throwing exceptions is very slow (the fillStackTrace() method is
> slow).
>
> Is there an alternative to the try ... catch, or is the exception only
> thrown in very rare edge cases?
> ...

This was the quickest way to fill a gap; feel free to refactor so it's 
not needed. But keep in mind the old saying about premature 
optimizations :-).

Best regards, Julian

Mime
View raw message