jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig (JIRA) <j...@apache.org>
Subject [jira] [Commented] (OAK-550) PropertyLocation#remove always returns true
Date Thu, 10 Jan 2013 17:36:15 GMT

    [ 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

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

View raw message