[
https://issues.apache.org/jira/browse/OAK-8949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17057998#comment-17057998
]
Angela Schreiber commented on OAK-8949:
---------------------------------------
[~larsgrefer], thanks for reporting this issue. i will take a look.
> Senseless code in PrincipalRestrictionProvider
> ----------------------------------------------
>
> Key: OAK-8949
> URL: https://issues.apache.org/jira/browse/OAK-8949
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: core, security
> Affects Versions: 1.20.0
> Reporter: Lars Grefer
> Assignee: Angela Schreiber
> Priority: Major
>
> {{org.apache.jackrabbit.oak.security.authorization.restriction.PrincipalRestrictionProvider#writeRestrictions}}
> sems too contain useless code right here:
> [https://github.com/apache/jackrabbit-oak/blob/e1ababdc2db085a3e73413382262e8adcec716f3/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/restriction/PrincipalRestrictionProvider.java#L100]
> The {{restrictions}} set is copied to a new HashSet and then some elements
> are removed from the new set. After that, the new set seems to be never used
> again.
> -The change was introduced by OAK-7944. Before that, the elements were
> removed from the {{restrictions}} set itself and not from the copy.-
> Update:
> OAK-7944 only changed the Iteration-Logic, the creation of the new, temporary
> set was acutally introduced in OAK-758:
> https://github.com/apache/jackrabbit-oak/commit/645533f1db898b2e9332385cf50ee3feae0da5ce#diff-45fef5680c5074709fba3b2187330e60R86
--
This message was sent by Atlassian Jira
(v8.3.4#803005)