From: Leif Åstrand Date: Thu, 21 Jun 2012 11:51:59 +0000 (+0300) Subject: Show sensible message if variable change target isn't a VariableOwner X-Git-Tag: 7.0.0.alpha3~90 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6c73f2643f2d418d07f2c33d9d2a681ba8fee1df;p=vaadin-framework.git Show sensible message if variable change target isn't a VariableOwner --- diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index e04857f800..ecd4fdd1ad 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -1535,8 +1535,18 @@ public abstract class AbstractCommunicationManager implements Serializable { Map 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) {