Closed yholkamp closed 11 years ago
Hmm, sounds like a bug indeed. But as I was thinking about this, I think the type of CollabMap should be Object (so CollabMap
Just checking if we're on one line before continuing to fix this bug...
A CollaborativeMap can contain any kind of object (strings, collaborative objects, or just arbitrary objects). So I think the logical approach would be to get rid of the generic parameter and just use CollaborativeMap
with a Map<String, Object>
.
I removed the generic parameter. This has the unfortunate consequence that we need a bunch of type casts wherever we want to use an object from a map.
In commit 10f8773 I've extended the demo app slightly to also access the root map that is now being built. I noticed though that when doing so using
The following exception is thrown: Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to gx.realtime.CollaborativeObject
This makes me suspect that the rootmap is internally instantiated as a
CollaborativeMap<String>
rather than the expectedCollaborativeMap<CollaborativeObject>
, as defined byModel#getRoot
.When I change the signature of the root map to
CollaborativeMap<String>
it appears to behave correctly but I'm thinking this is not the proper behavior. @Rdebokx or @mkrause, could either of you shine some light on this?