Hi
i try to run Vaadin 6.2.1 with Terracotta 3.1.1 and get a strage behavior in the uidl communication between the server and client. Sometimes the components get mixed up after some user intarcations
It looks like the new automatic component tag generator creates different tags on different machines for the same component types.
On Vaadin 6.1.2 i got these answers:
Server1:
for(;;);[{"changes":[["change",{"format": "uidl","pid": "PID_SlabelTest"},["label",{"id": "PID_SlabelTest","width": "100.0%","immediate":true},"cccc"]
]], "meta" : {}, "resources" : {}, "locales":[]}]
Server2:
for(;;);[{"changes":[["change",{"format": "uidl","pid": "PID_SlabelTest"},["label",{"id": "PID_SlabelTest","width": "100.0%","immediate":true},"cccc"]
]], "meta" : {}, "resources" : {}, "locales":[]}]
→ The component tag is
label
on both server
And with Vaadin 6.2.1 i got these answers:
Server1:
for(;;);[{"changes":[["change",{"format": "uidl","pid": "PID_SlabelTest"},["2",{"id": "PID_SlabelTest","width": "100.0%","immediate":true},"cccc"]
]], "meta" : {}, "resources" : {}, "locales":[]}]
Server2:
for(;;);[{"changes":[["change",{"format": "uidl","pid": "PID_SlabelTest"},["3",{"id": "PID_SlabelTest","width": "100.0%","immediate":true},"cccc"]
]], "meta" : {}, "resources" : {}, "locales":[]}]
→ The component tag is
2
on server1 and
3
on server2!
I think the code below is resposible for the tag creation, is that correct?
AbstractCommunicationManager.java
private static HashMap<Class<? extends Paintable>, Integer> typeToKey = new HashMap<Class<? extends Paintable>, Integer>();
private static int nextTypeKey = 0;
static String getTagForType(Class<? extends Paintable> class1) {
synchronized (typeToKey) {
Integer object = typeToKey.get(class1);
if (object == null) {
object = nextTypeKey++;
typeToKey.put(class1, object);
}
return object.toString();
}
}
any ideas to fix this problem?
Thanks
Silvan