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

    https://github.com/apache/guacamole-client/pull/252#discussion_r167408870
  
    --- Diff: 
guacamole-common/src/main/java/org/apache/guacamole/websocket/GuacamoleWebSocketTunnelEndpoint.java
 ---
    @@ -71,11 +71,15 @@
          *
          * @param session The outbound WebSocket connection to close.
          * @param guac_status The status to send.
    +     * @param webSocketCode The numeric WebSocket status to send.
          */
    -    private void closeConnection(Session session, GuacamoleStatus 
guac_status) {
    +    private void closeConnection(Session session, GuacamoleStatus 
guac_status,
    +            Integer webSocketCode) {
     
             try {
    -            CloseCode code = 
CloseReason.CloseCodes.getCloseCode(guac_status.getWebSocketCode());
    +            if (webSocketCode == null)
    --- End diff --
    
    Why not the same approach that you used with the HTTP status code handling? 
(Separate parameters for each type of status code rather than passing 
`GuacamoleStatus`)
    
    It's generally bad practice to rely on wrapper classes like `Integer` when 
not necessary, and I think this is one of those cases where we really should be 
looking for a way to use a primitive `int`.


---

Reply via email to