powered by Jive Software

Bug? in Event Classes

It appears that few if any of the custom event classes defined by XIFF implement the clone() method. According to most of the documentation I can find, any subclass of the Event class should define this method to make sure the event is cloned properly (i.e. all properties are set) when the EventDispatcher clones the event when it is being re-dispatched. I have written some classes which wrap the Connection and Room classes. I wish to handle the events locally in many cases, but in many cases I also want my classes to redispatch the events to be handled by other classes. The problem is that when I redispatch, all I get is a generic Event class with none of the necessary properties because the default clone() method for Event is always used.

Shouldn’'t this be considered a bug? It certainly excludes a whole set of use cases for the API. I can add the missing clone methods to the events where I need them, but I am not too keen on modifying the source … and having to re-modify it each time a new release is available. Suggestions?

Bill Bailey