From e8788ad447fb80bb81cfdd41c59376286f7eb855 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 17 Dec 2015 08:24:22 +0200 Subject: Parse true/false as boolean values for push configuration (#19394) Change-Id: I89e99ebd552b00a1bdc79801a8236aff72b6a290 --- .../communication/AtmospherePushConnection.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'client/src') diff --git a/client/src/com/vaadin/client/communication/AtmospherePushConnection.java b/client/src/com/vaadin/client/communication/AtmospherePushConnection.java index 158638a5ec..698ce3be45 100644 --- a/client/src/com/vaadin/client/communication/AtmospherePushConnection.java +++ b/client/src/com/vaadin/client/communication/AtmospherePushConnection.java @@ -175,8 +175,13 @@ public class AtmospherePushConnection implements PushConnection { config.setStringValue("logLevel", "debug"); } for (String param : pushConfiguration.parameters.keySet()) { - config.setStringValue(param, - pushConfiguration.parameters.get(param)); + String value = pushConfiguration.parameters.get(param); + if (value.equalsIgnoreCase("true") + || value.equalsIgnoreCase("false")) { + config.setBooleanValue(param, value.equalsIgnoreCase("true")); + } else { + config.setStringValue(param, value); + } } if (pushConfiguration.pushUrl != null) { url = pushConfiguration.pushUrl; @@ -440,6 +445,16 @@ public class AtmospherePushConnection implements PushConnection { this[key] = value; }-*/; + protected final native boolean getBooleanValue(String key) + /*-{ + return this[key]; + }-*/; + + protected final native void setBooleanValue(String key, boolean value) + /*-{ + this[key] = value; + }-*/; + } public static class AtmosphereConfiguration extends AbstractJSO { -- cgit v1.2.3