jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Reschke <julian.resc...@gmx.de>
Subject Re: Branch.move contract
Date Tue, 17 Apr 2012 16:39:52 GMT
On 2012-04-17 18:20, Michael Dürig wrote:
>
>
> Hi,
>
> On 17.4.12 16:15, Julian Reschke wrote:
>> Hi,
>>
>> I just noticed that move() defaults to "do nothing" for all kinds of
>> error conditions:
>>
>> - source not existing
>>
>> - parent of target not existing
>>
>> - target existing
>>
>> At least the latter will require the JCR layer to do an existence check
>> on the target before proceeding.
>>
>> Is this intentional? What's the rational?
>
> It is intentional in so far, that I wanted to avoid having every one
> doing these kind of checks all over again.
>
> We might want to add a utility class which does this checks on top of
> the current interface.

Not convinced.

Not throwing exceptions all the time shouldn't imply silent failure :-)

For the first two cases I can see why you don't want an exception, but 
then the return code needs to tell the caller that the operation failed 
(and optimally why).

For "target existing" I believe there are reasons for both use cases, 
and this might be something that needs a parameter ("allowOverwrite").

Best regards, Julian

Mime
View raw message