[ 
https://issues.apache.org/jira/browse/RANGER-1507?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Qiang Zhang updated RANGER-1507:
--------------------------------
    Description: 
In UserSync.java, there are some duplicate codes.
{code}
if (groupName == null || groupName.isEmpty()) {
            // Perform basic user search and get the group name from the user's 
group attribute name.
            findBasicUserProperties(ldapContext, false);
        }

        if (groupName == null || groupName.isEmpty()) {
            // Perform adv user search and get the group name from the user's 
group attribute name.
            findAdvUserProperties(ldapContext, false);
        }
{code}
We checked if the groupName is null twice, IMO, we can put them together. 

> Do some code improvement in UserSync
> ------------------------------------
>
>                 Key: RANGER-1507
>                 URL: https://issues.apache.org/jira/browse/RANGER-1507
>             Project: Ranger
>          Issue Type: Improvement
>          Components: usersync
>    Affects Versions: 1.0.0
>            Reporter: Qiang Zhang
>            Assignee: Qiang Zhang
>             Fix For: 1.0.0
>
>
> In UserSync.java, there are some duplicate codes.
> {code}
> if (groupName == null || groupName.isEmpty()) {
>             // Perform basic user search and get the group name from the 
> user's group attribute name.
>             findBasicUserProperties(ldapContext, false);
>         }
>         if (groupName == null || groupName.isEmpty()) {
>             // Perform adv user search and get the group name from the user's 
> group attribute name.
>             findAdvUserProperties(ldapContext, false);
>         }
> {code}
> We checked if the groupName is null twice, IMO, we can put them together. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to