From f4b41e8b19c69589eaf919f39c070ecdfcfb9926 Mon Sep 17 00:00:00 2001 From: Virtually Nick Date: Mon, 6 May 2019 16:25:08 -0400 Subject: [PATCH] GUACAMOLE-422: Use null exclusively for missing timezone. --- .../guacamole/protocol/ConfiguredGuacamoleSocket.java | 2 +- .../guacamole/protocol/GuacamoleClientInformation.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/guacamole-common/src/main/java/org/apache/guacamole/protocol/ConfiguredGuacamoleSocket.java b/guacamole-common/src/main/java/org/apache/guacamole/protocol/ConfiguredGuacamoleSocket.java index 0480d19fa..450cef7f5 100644 --- a/guacamole-common/src/main/java/org/apache/guacamole/protocol/ConfiguredGuacamoleSocket.java +++ b/guacamole-common/src/main/java/org/apache/guacamole/protocol/ConfiguredGuacamoleSocket.java @@ -204,7 +204,7 @@ public class ConfiguredGuacamoleSocket implements GuacamoleSocket { if (protocol.isSupported(GuacamoleProtocolCapability.TIMEZONE_HANDSHAKE)) { // Send client timezone, if available String timezone = info.getTimezone(); - if (timezone != null && !timezone.isEmpty()) { + if (timezone != null) { writer.writeInstruction( new GuacamoleInstruction( "timezone", diff --git a/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleClientInformation.java b/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleClientInformation.java index 1a1d9e306..65d7ad7eb 100644 --- a/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleClientInformation.java +++ b/guacamole-common/src/main/java/org/apache/guacamole/protocol/GuacamoleClientInformation.java @@ -62,7 +62,7 @@ public class GuacamoleClientInformation { /** * The timezone reported by the client. */ - private String timezone = ""; + private String timezone; /** * Returns the optimal screen width requested by the client, in pixels. @@ -151,8 +151,8 @@ public class GuacamoleClientInformation { } /** - * Return the timezone as reported by the client, or an empty String if - * one is not set. + * Return the timezone as reported by the client, or null if the timezone + * is not set. Valid timezones are specified in tz database format. * * @return * A string value of the timezone reported by the client. @@ -162,7 +162,9 @@ public class GuacamoleClientInformation { } /** - * Set the string value of the timezone. + * Set the string value of the timezone, or null if the timezone will not + * be provided by the client. Valid timezones are specified in tz + * database format. * * @param timezone * The string value of the timezone reported by the client.