diff options
Diffstat (limited to 'client-compiler/src')
-rw-r--r-- | client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java | 4 | ||||
-rw-r--r-- | client-compiler/src/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java b/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java index 75225c52dc..cc1841ec05 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java @@ -189,6 +189,8 @@ public class ConnectorBundleLoaderFactory extends Generator { if (isNative) { outdent(); println("}-*/;"); + // To support fields of type long (#13692) + println("@com.google.gwt.core.client.UnsafeNativeLong"); println("private native void %s(%s) /*-{", newMethod, args); } else { println("%s();", newMethod); @@ -313,6 +315,8 @@ public class ConnectorBundleLoaderFactory extends Generator { // Separate method for loading native JS stuff (e.g. callbacks) String loadNativeJsMethodName = "loadNativeJs"; + // To support fields of type long (#13692) + w.println("@com.google.gwt.core.client.UnsafeNativeLong"); w.println("private native void %s(%s store) /*-{", loadNativeJsMethodName, TypeDataStore.class.getName()); w.indent(); 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 a31dafe05c..6c242dfd74 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java @@ -45,17 +45,25 @@ 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(), unboxValue(valueVariable)); + .getQualifiedSourceName(), getName(), + shouldUnbox ? unboxValue(valueVariable) : 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(boxValue(value)); + w.print(shouldBox ? boxValue(value) : value); w.println(";"); } |