From e691c917b7d4771237090edfcfc8fba7bdf1acef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Fri, 8 Jun 2012 13:42:05 +0300 Subject: [PATCH] Use generic parameter types for server->client RPC --- .../terminal/gwt/server/AbstractCommunicationManager.java | 2 +- .../vaadin/terminal/gwt/server/ClientMethodInvocation.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index d6feba9dc0..9e3545cac5 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -935,7 +935,7 @@ public abstract class AbstractCommunicationManager implements Serializable { invocationJson.put(invocation.getMethodName()); JSONArray paramJson = new JSONArray(); for (int i = 0; i < invocation.getParameterTypes().length; ++i) { - Class parameterType = invocation.getParameterTypes()[i]; + Type parameterType = invocation.getParameterTypes()[i]; Object referenceParameter = null; // TODO Use default values for RPC parameter types // if (!JsonCodec.isInternalType(parameterType)) { diff --git a/src/com/vaadin/terminal/gwt/server/ClientMethodInvocation.java b/src/com/vaadin/terminal/gwt/server/ClientMethodInvocation.java index 99633a13d6..ad9484723b 100644 --- a/src/com/vaadin/terminal/gwt/server/ClientMethodInvocation.java +++ b/src/com/vaadin/terminal/gwt/server/ClientMethodInvocation.java @@ -6,6 +6,7 @@ package com.vaadin.terminal.gwt.server; import java.io.Serializable; import java.lang.reflect.Method; +import java.lang.reflect.Type; /** * Internal class for keeping track of pending server to client method @@ -19,7 +20,7 @@ public class ClientMethodInvocation implements Serializable, private final String interfaceName; private final String methodName; private final Object[] parameters; - private Class[] parameterTypes; + private Type[] parameterTypes; // used for sorting calls between different connectors in the same Root private final long sequenceNumber; @@ -31,12 +32,12 @@ public class ClientMethodInvocation implements Serializable, this.connector = connector; this.interfaceName = interfaceName; methodName = method.getName(); - parameterTypes = method.getParameterTypes(); + parameterTypes = method.getGenericParameterTypes(); this.parameters = (null != parameters) ? parameters : new Object[0]; sequenceNumber = ++counter; } - public Class[] getParameterTypes() { + public Type[] getParameterTypes() { return parameterTypes; } -- 2.39.5