for (ClientConnector connector : dirtyVisibleConnectors) {
// encode and send shared state
try {
JsonObject stateJson = connector.encodeState();
if (stateJson != null && stateJson.keys().length != 0) {
sharedStates.put(connector.getConnectorId(), stateJson);
}
} catch (JsonException e) {
throw new PaintException(
"Failed to serialize shared state for connector "