You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Michael Dürig (JIRA)" <ji...@apache.org> on 2013/01/10 18:36:15 UTC

[jira] [Commented] (OAK-550) PropertyLocation#remove always returns true

    [ https://issues.apache.org/jira/browse/OAK-550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13549821#comment-13549821 ] 

Michael Dürig commented on OAK-550:
-----------------------------------

The Javadoc might be terse but I think the implementation is correct. Removing a non existing property succeeds vacuously. 

The original intention of returning boolean instead of void was to cope with access control restrictions. This turned out to be the wrong place though and was removed in revision 1390577. 

There are two options now:

# change the return type to void. Callers which need to know whether the property existed before the call need to check explicitly. 
# explicitly state in the contract that the method will return false if the property doesn't exist.

I don't like 2) too much since it breaks separation of concerns: removing a property and checking for its existence. It introduces extra complexity and runtime overhead which might not needed by all callers. 



                
> PropertyLocation#remove always returns true
> -------------------------------------------
>
>                 Key: OAK-550
>                 URL: https://issues.apache.org/jira/browse/OAK-550
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>            Reporter: angela
>            Priority: Minor
>
> according to the javadoc (and now to the API definition) the remove
> method should only return true if the underlying property has been
> removed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira