Github user mike-jumper commented on a diff in the pull request:

    
https://github.com/apache/incubator-guacamole-client/pull/129#discussion_r106696635
  
    --- Diff: 
extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/user/UserService.java
 ---
    @@ -101,21 +102,24 @@ private void putAllUsers(Map<String, User> users, 
LDAPConnection ldapConnection,
     
                 // Read all visible users
                 while (results.hasMore()) {
    -
    -                LDAPEntry entry = results.next();
    -
    -                // Get username from record
    -                LDAPAttribute username = 
entry.getAttribute(usernameAttribute);
    -                if (username == null) {
    -                    logger.warn("Queried user is missing the username 
attribute \"{}\".", usernameAttribute);
    -                    continue;
    +                try {
    +                    LDAPEntry entry = results.next();
    +
    +                    // Get username from record
    +                    LDAPAttribute username = 
entry.getAttribute(usernameAttribute);
    +                    if (username == null) {
    +                        logger.warn("Queried user is missing the username 
attribute \"{}\".", usernameAttribute);
    +                        continue;
    +                    }
    +
    +                    // Store user using their username as the identifier
    +                    String identifier = username.getStringValue();
    +                    if (users.put(identifier, new SimpleUser(identifier)) 
!= null)
    +                        logger.warn("Possibly ambiguous user account: 
\"{}\".", identifier);
    +
    +                } catch (LDAPReferralException e) {
    --- End diff --
    
    Please do not cuddle the `catch`. For more information, see the general 
style of other code in the codebase, or the overview of the style we use at 
http://guacamole.incubator.apache.org/guac-style/.
    
    The most important thing here style-wise is consistency.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to