From c5df7f5bf60cea004e146cf559f4f36de6e9c48b Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Tue, 8 Jul 2014 18:19:28 +0300 Subject: Box and unbox long values in state fields (#14176) We actually want to pass around the primitive long values emulated by GWT even though JavaScript code can't do anything with the values. Skipping the unboxing caused long fields to always be 0 since that's how JavaScript converts an object into a number. This patch also makes the test assert that the expected state values are received and updates those values to actually make sense in some situations. Change-Id: Id9c3696d699593bd9e59e249c5daf077873b85fc --- .../vaadin/server/widgetsetutils/metadata/FieldProperty.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'client-compiler/src') diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java index 6c242dfd74..a31dafe05c 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java @@ -45,25 +45,17 @@ public class FieldProperty extends Property { @Override public void writeSetterBody(TreeLogger logger, SourceWriter w, String beanVariable, String valueVariable) { - // Don't try to unbox Longs in javascript, as it's not supported. - // (#13692) - boolean shouldUnbox = !"long".equals(field.getType() - .getSimpleSourceName()); w.println("%s.@%s::%s = %s;", beanVariable, getBeanType() - .getQualifiedSourceName(), getName(), - shouldUnbox ? unboxValue(valueVariable) : valueVariable); + .getQualifiedSourceName(), getName(), unboxValue(valueVariable)); } @Override public void writeGetterBody(TreeLogger logger, SourceWriter w, String beanVariable) { - // Longs are not unboxed, as it's not supported. (#13692) - boolean shouldBox = !"long".equals(field.getType() - .getSimpleSourceName()); String value = String.format("%s.@%s::%s", beanVariable, getBeanType() .getQualifiedSourceName(), getName()); w.print("return "); - w.print(shouldBox ? boxValue(value) : value); + w.print(boxValue(value)); w.println(";"); } -- cgit v1.2.3