[
https://issues.apache.org/jira/browse/RANGER-2708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17021979#comment-17021979
]
Lars Francke commented on RANGER-2708:
--------------------------------------
Thank you!
I didn't know about PMD at that point. Only looked for checkstyle :)
> Ranger public group check uses wrong comparison for equality
> ------------------------------------------------------------
>
> Key: RANGER-2708
> URL: https://issues.apache.org/jira/browse/RANGER-2708
> Project: Ranger
> Issue Type: Bug
> Components: Ranger
> Reporter: Lars Francke
> Assignee: Lars Francke
> Priority: Major
> Attachments: RANGER-2708.1.patch
>
>
> In {{RangerBizUtil#checkUsrPermForPolicy}} we can find this piece of code:
> {code:java}
> matchFound = (publicGroupId != null && publicGroupId == permMap.getGroupId())
> || isGroupInList(permMap.getGroupId(), userGroups);
> {code}
> {{publicGroupId}} and {{permMap.getGroupId()}} are both Long so testing
> equality using "{{==}}" is wrong and only works "by accident" or not at all
> depending on the JVM.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)