diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index 7ea4a7d097..b2436b2ce4 100644 --- a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -1250,12 +1250,13 @@ public abstract class AbstractCommunicationManager implements Serializable { Class<? extends SharedState> stateType = connector.getStateType(); Object diffState = connectorTracker.getDiffState(connector); if (diffState == null) { - diffState = new JSONObject(); // Use an empty state object as reference for full // repaints - boolean emptyInitialState = JavaScriptConnectorState.class + + boolean supportsDiffState = !JavaScriptConnectorState.class .isAssignableFrom(stateType); - if (!emptyInitialState) { + if (supportsDiffState) { + diffState = new JSONObject(); try { SharedState referenceState = stateType.newInstance(); diffState = JsonCodec.encode(referenceState, null, @@ -1266,8 +1267,8 @@ public abstract class AbstractCommunicationManager implements Serializable { "Error creating reference object for state of type " + stateType.getName()); } + connectorTracker.setDiffState(connector, diffState); } - connectorTracker.setDiffState(connector, diffState); } JSONObject stateJson = (JSONObject) JsonCodec.encode(state, diffState, stateType, root.getConnectorTracker()); |