]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix regressions in RPC handling (#10549) 35/535/1
authorLeif Åstrand <leif@vaadin.com>
Wed, 19 Dec 2012 06:59:07 +0000 (08:59 +0200)
committerLeif Åstrand <leif@vaadin.com>
Wed, 19 Dec 2012 06:59:07 +0000 (08:59 +0200)
* Generate parameter types based on RPC interface instead of defining
interface
* Don't try to find parameter types for JavaScript RPC invocations

Change-Id: I0e61e74f57dd34665c8befe826aa2759aeb01b54

client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ServerRpcVisitor.java
client/src/com/vaadin/client/ApplicationConnection.java

index e14e8234d50410c10c61695af34ad5dacddc3fd1..f444abf0ad552ed3c50d4e357c44e797b17f3599 100644 (file)
@@ -38,7 +38,7 @@ public class ServerRpcVisitor extends TypeVisitor {
                 for (JMethod method : methods) {
                     ClientRpcVisitor.checkReturnType(logger, method);
                     bundle.setNeedsDelayedInfo(type, method);
-                    bundle.setNeedsParamTypes(subType, method);
+                    bundle.setNeedsParamTypes(type, method);
 
                     JType[] parameterTypes = method.getParameterTypes();
                     for (JType paramType : parameterTypes) {
index 00b0d75c6c43e1420de2c1ffd4e9ee358b7d58ec..2e8387c5da4431d3a457839eb53a5c573b0b0e33 100644 (file)
@@ -2396,7 +2396,8 @@ public class ApplicationConnection {
                 JSONArray paramJson = new JSONArray();
 
                 Type[] parameterTypes = null;
-                if (!isLegacyVariableChange(invocation)) {
+                if (!isLegacyVariableChange(invocation)
+                        && !isJavascriptRpc(invocation)) {
                     try {
                         Type type = new Type(invocation.getInterfaceName(),
                                 null);
@@ -2457,6 +2458,12 @@ public class ApplicationConnection {
         makeUidlRequest(req.toString(), extraParams, forceSync);
     }
 
+    private boolean isJavascriptRpc(MethodInvocation invocation) {
+        String connectorId = invocation.getConnectorId();
+        ServerConnector connector = connectorMap.getConnector(connectorId);
+        return connector instanceof HasJavaScriptConnectorHelper;
+    }
+
     private boolean isLegacyVariableChange(MethodInvocation invocation) {
         return ApplicationConstants.UPDATE_VARIABLE_METHOD.equals(invocation
                 .getInterfaceName())