summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-08-24 11:46:23 +0300
committerLeif Åstrand <leif@vaadin.com>2012-08-24 11:46:23 +0300
commit86bbe59bb855b6cf57486322bca92e2ace88e8a2 (patch)
tree1d162cb508a986a1f9a530a6e6c51a4d87002f0c /server
parent58cec95f137f1f7d464c5dde8198245c10a4e32e (diff)
downloadvaadin-framework-86bbe59bb855b6cf57486322bca92e2ace88e8a2.tar.gz
vaadin-framework-86bbe59bb855b6cf57486322bca92e2ace88e8a2.zip
Don't ever send state diffs for JavaScript connectors (#9026)
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java9
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());