diff options
3 files changed, 11 insertions, 5 deletions
diff --git a/client/src/com/vaadin/client/communication/MessageSender.java b/client/src/com/vaadin/client/communication/MessageSender.java index cde8be48ac..5862809b0c 100644 --- a/client/src/com/vaadin/client/communication/MessageSender.java +++ b/client/src/com/vaadin/client/communication/MessageSender.java @@ -33,6 +33,7 @@ import com.vaadin.shared.ui.ui.UIState.PushConfigurationState; import elemental.json.Json; import elemental.json.JsonArray; import elemental.json.JsonObject; +import elemental.json.JsonValue; /** * MessageSender is responsible for sending messages to the server. @@ -161,7 +162,8 @@ public class MessageSender { if (extraJson != null) { for (String key : extraJson.keys()) { - payload.put(key, extraJson.get(key)); + JsonValue value = extraJson.get(key); + payload.put(key, value); } } diff --git a/server/src/com/vaadin/ui/declarative/DesignFormatter.java b/server/src/com/vaadin/ui/declarative/DesignFormatter.java index dbeb756dd8..509015130d 100644 --- a/server/src/com/vaadin/ui/declarative/DesignFormatter.java +++ b/server/src/com/vaadin/ui/declarative/DesignFormatter.java @@ -292,8 +292,9 @@ public class DesignFormatter implements Serializable { if (object == null) { return null; } else { - return findConverterFor(object.getClass()).convertToPresentation( - object, String.class, null); + Converter<String, Object> converter = findConverterFor(object + .getClass()); + return converter.convertToPresentation(object, String.class, null); } } diff --git a/server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java b/server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java index 6510d8ad40..e2a91000c1 100644 --- a/server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java +++ b/server/tests/src/com/vaadin/tests/design/DesignFormatterTest.java @@ -143,8 +143,11 @@ public class DesignFormatterTest { public void testFloatingPoint() { float f = 123.4567f; assertEquals("123.457", formatter.format(f)); - assertEquals(f, formatter.parse("123.4567", float.class), 1e-4); - assertEquals(f, formatter.parse("123.4567", Float.class), 1e-4); + + float f1 = formatter.parse("123.4567", float.class); + assertEquals(f, f1, 1e-4); + Float f2 = formatter.parse("123.4567", Float.class); + assertEquals(f, f2, 1e-4); double d = 123456789.123456789; assertEquals("123456789.123", formatter.format(d)); |