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/04/03 14:45:15 UTC

[jira] [Commented] (OAK-739) Asymmetric equals() implementation in AccessControlManagerImpl's nested classes PrincipalACL / NodeACL

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

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

Same problem with {{RestrictionDefinitionImpl}} and {{RestrictionImpl}}.
                
> Asymmetric equals() implementation in AccessControlManagerImpl's nested classes PrincipalACL / NodeACL
> ------------------------------------------------------------------------------------------------------
>
>                 Key: OAK-739
>                 URL: https://issues.apache.org/jira/browse/OAK-739
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.7
>            Reporter: Lukas Eder
>            Priority: Minor
>
> I was digging in the Oak code and I've stumbled upon an assymetric equals() implementation between the following two nested classes:
> - AccessControlManagerImpl.PrincipalACL
> - AccessControlManagerImpl.NodeACL
> Assume the following:
> {code}
>   PrincipalACL p = ...
>   NodeACL n = ...
>   assertTrue(n.equals(p));
>   assertFalse(p.equals(n));
> {code}
> Since PrincipalACL.equals() looks almost the same as NodeACL.equals() except for the instanceof check, I suggest removing the override, or delegating to super.equals() instead of returning false.

--
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