aboutsummaryrefslogtreecommitdiffstats
path: root/client-compiler
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2014-04-20 16:34:38 +0300
committerVaadin Code Review <review@vaadin.com>2014-04-24 12:21:38 +0000
commit8e632ae093f53e6822ee2a39b2820be2bcf3e776 (patch)
treeaccab2d62dcdbc62d70c4d5b7092ef379618c38b /client-compiler
parenta32a15c6452a1eeece33512b352da70413df4bb4 (diff)
downloadvaadin-framework-8e632ae093f53e6822ee2a39b2820be2bcf3e776.tar.gz
vaadin-framework-8e632ae093f53e6822ee2a39b2820be2bcf3e776.zip
Report an error if RPC interface is parameterized (#10392).
Change-Id: I887c14b1df282c56a1e839eae5a4534501fa3911
Diffstat (limited to 'client-compiler')
-rw-r--r--client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ClientRpcVisitor.java12
-rw-r--r--client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ServerRpcVisitor.java1
2 files changed, 13 insertions, 0 deletions
diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ClientRpcVisitor.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ClientRpcVisitor.java
index c966f7f65e..91b1b44ca5 100644
--- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ClientRpcVisitor.java
+++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ClientRpcVisitor.java
@@ -29,6 +29,7 @@ public class ClientRpcVisitor extends TypeVisitor {
@Override
public void visitClientRpc(TreeLogger logger, JClassType type,
ConnectorBundle bundle) throws UnableToCompleteException {
+ checkGenericType(logger, type);
Set<? extends JClassType> hierarchy = type
.getFlattenedSupertypeHierarchy();
for (JClassType subType : hierarchy) {
@@ -47,6 +48,17 @@ public class ClientRpcVisitor extends TypeVisitor {
}
}
+ public static void checkGenericType(TreeLogger logger, JClassType type)
+ throws UnableToCompleteException {
+ if (type.isGenericType() != null) {
+ logger.log(Type.ERROR,
+ "Type " + type.getParameterizedQualifiedSourceName()
+ + "is parameterizied generic. RPC proxy "
+ + "for parameterizied types is not supported.");
+ throw new UnableToCompleteException();
+ }
+ }
+
public static void checkReturnType(TreeLogger logger, JMethod method)
throws UnableToCompleteException {
if (!method.getReturnType().getQualifiedSourceName().equals("void")) {
diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ServerRpcVisitor.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ServerRpcVisitor.java
index 651596c9cf..a488c9d83e 100644
--- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ServerRpcVisitor.java
+++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ServerRpcVisitor.java
@@ -28,6 +28,7 @@ public class ServerRpcVisitor extends TypeVisitor {
@Override
public void visitServerRpc(TreeLogger logger, JClassType type,
ConnectorBundle bundle) throws UnableToCompleteException {
+ ClientRpcVisitor.checkGenericType(logger, type);
bundle.setNeedsProxySupport(type);
Set<? extends JClassType> superTypes = type