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

    
https://github.com/apache/incubator-guacamole-client/pull/69#discussion_r77475958
  
    --- Diff: 
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java
 ---
    @@ -183,6 +185,19 @@ protected ModeledConnection 
acquire(RemoteAuthenticatedUser user,
                 @Override
                 public int compare(ModeledConnection a, ModeledConnection b) {
     
    +                Directory<ConnectionGroup> directory;
    +                ConnectionGroup group;
    +                           try {
    +                   // Get connection group directory
    +                                   directory = 
a.getCurrentUser().getAuthenticationProvider().getUserContext(a.getCurrentUser()).getConnectionGroupDirectory();
    +                   // Get authorized connection group
    +                   group = directory.get(a.getParentIdentifier());
    +                if (group.getType() == ConnectionGroup.Type.BALANCING)
    +                   return getIdleConnections(a)
    +                                   - getIdleConnections(b);
    +                           } catch (GuacamoleException e) {
    +                                   e.printStackTrace();
    --- End diff --
    
    Production code should not contain `e.printStackTrace()`. If there is an 
error condition here, it should be logged in a human-readable way (and without 
a stack trace) at the appropriate level, and logged again at the debug level 
with the underlying exception (such that the logging framework will include the 
stack trace, but only at debug level).
    
    If you take a peek at the other parts of Guacamole, you'll see that's 
what's been done elsewhere.


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