Explorar el Código

Fix regressions in RPC handling (#10549)

* 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
tags/7.0.0.beta11
Leif Åstrand hace 11 años
padre
commit
55142ffc2f

+ 1
- 1
client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ServerRpcVisitor.java Ver fichero

for (JMethod method : methods) { for (JMethod method : methods) {
ClientRpcVisitor.checkReturnType(logger, method); ClientRpcVisitor.checkReturnType(logger, method);
bundle.setNeedsDelayedInfo(type, method); bundle.setNeedsDelayedInfo(type, method);
bundle.setNeedsParamTypes(subType, method);
bundle.setNeedsParamTypes(type, method);


JType[] parameterTypes = method.getParameterTypes(); JType[] parameterTypes = method.getParameterTypes();
for (JType paramType : parameterTypes) { for (JType paramType : parameterTypes) {

+ 8
- 1
client/src/com/vaadin/client/ApplicationConnection.java Ver fichero

JSONArray paramJson = new JSONArray(); JSONArray paramJson = new JSONArray();


Type[] parameterTypes = null; Type[] parameterTypes = null;
if (!isLegacyVariableChange(invocation)) {
if (!isLegacyVariableChange(invocation)
&& !isJavascriptRpc(invocation)) {
try { try {
Type type = new Type(invocation.getInterfaceName(), Type type = new Type(invocation.getInterfaceName(),
null); null);
makeUidlRequest(req.toString(), extraParams, forceSync); 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) { private boolean isLegacyVariableChange(MethodInvocation invocation) {
return ApplicationConstants.UPDATE_VARIABLE_METHOD.equals(invocation return ApplicationConstants.UPDATE_VARIABLE_METHOD.equals(invocation
.getInterfaceName()) .getInterfaceName())

Cargando…
Cancelar
Guardar