From 6c73f2643f2d418d07f2c33d9d2a681ba8fee1df Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Thu, 21 Jun 2012 14:51:59 +0300 Subject: [PATCH] Show sensible message if variable change target isn't a VariableOwner --- .../gwt/server/AbstractCommunicationManager.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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) { -- 2.39.5