mike-jumper commented on a change in pull request #348: GUACAMOLE-422: Forward
Timezone to RDP and SSH Connections
URL: https://github.com/apache/guacamole-client/pull/348#discussion_r281048496
##########
File path:
guacamole-common/src/main/java/org/apache/guacamole/protocol/ConfiguredGuacamoleSocket.java
##########
@@ -142,6 +150,13 @@ public ConfiguredGuacamoleSocket(GuacamoleSocket socket,
// Retrieve argument name
String arg_name = arg_names.get(i);
+
+ // Check for protocol version as first argument
+ if (i == 0 && arg_name.startsWith("VERSION_")) {
+ protocol = GuacamoleProtocolVersion.valueOf(arg_name);
Review comment:
As `valueOf()` for an enum is specifically defined based on the names of the
enum values, I'm uncomfortable directly relying on it for parsing of the
Guacamole protocol (something which technically is independent of the Java
objects we may use to implement it).
I suggest providing a function within `GuacamoleProtocolVersion` which is
specifically defined as parsing the Guacamole protocol constant for that
protocol version and returning the corresponding enum value. Even though that
function may internally only wrap `valueOf()`, it will decouple the internals
of the API from the internals of the protocol.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services