Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.0.1-core
-
None
-
n/a
Description
These new JSF 2 methods on the UIComponent (subscribeToEvent and unsubscribeFromEvent) has a very strange contract. The formal parameter for the listener is of type ComponentSystemEventListener. However, the method to query for the registered listeners getListenersForEventClass returns a list of SystemEventListener. The ComponentSystemEventListener and SystemEventListener do not have a common heritage so the subscribeToEvent and unsubscribeFromEvent creates a wrapper that implements the SystemEventListener.
Since the resultant objects from getListenersForEventClass are a wrapper, there is no way to determine if the original listener added by calling subscribeToEvent is in the list of wrapper objects since the wrapper is a private nested class and doesn't necessary implement the ComponentSystemEventListener interfaces.