]> source.dussan.org Git - vaadin-framework.git/commitdiff
Show sensible message if variable change target isn't a VariableOwner
authorLeif Åstrand <leif@vaadin.com>
Thu, 21 Jun 2012 11:51:59 +0000 (14:51 +0300)
committerLeif Åstrand <leif@vaadin.com>
Thu, 21 Jun 2012 11:52:17 +0000 (14:52 +0300)
src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java

index e04857f8005d6d536ebdd08295c91cd8f2407222..ecd4fdd1ad6e0d738806b12f4d422cbc71c98f25 100644 (file)
@@ -1535,8 +1535,18 @@ public abstract class AbstractCommunicationManager implements Serializable {
                     Map<String, Object> changes = legacyInvocation
                             .getVariableChanges();
                     try {
-                        changeVariables(source, (VariableOwner) connector,
-                                changes);
+                        if (connector instanceof VariableOwner) {
+                            changeVariables(source, (VariableOwner) connector,
+                                    changes);
+                        } else {
+                            throw new IllegalStateException(
+                                    "Received legacy variable change for "
+                                            + connector.getClass().getName()
+                                            + " ("
+                                            + connector.getConnectorId()
+                                            + ") which is not a VariableOwner. The client-side connector sent these legacy varaibles: "
+                                            + changes.keySet());
+                        }
                     } catch (Exception e) {
                         Component errorComponent = null;
                         if (connector instanceof Component) {