]> source.dussan.org Git - vaadin-framework.git/commitdiff
Report an error if RPC interface is parameterized (#10392).
authorDenis Anisimov <denis@vaadin.com>
Sun, 20 Apr 2014 13:34:38 +0000 (16:34 +0300)
committerVaadin Code Review <review@vaadin.com>
Thu, 24 Apr 2014 12:21:38 +0000 (12:21 +0000)
Change-Id: I887c14b1df282c56a1e839eae5a4534501fa3911

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

index c966f7f65e71b375e71554f78f0ca415609ddca4..91b1b44ca560d7ac76957170b4a0c3b79f0941ef 100644 (file)
@@ -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")) {
index 651596c9cf750bce2acf0ab1a4915e31a477ee70..a488c9d83e823c40dd81e51dcd7b663f1770b432 100644 (file)
@@ -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