Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIComponent event-listening APIs are inconsistent #997

Closed
eclipse-faces-bot opened this issue Apr 29, 2011 · 11 comments
Closed

UIComponent event-listening APIs are inconsistent #997

eclipse-faces-bot opened this issue Apr 29, 2011 · 11 comments

Comments

@eclipse-faces-bot
Copy link

UIComponent defines the pair of:

void subscribeToEvent(Class<? extends SystemEvent>, ComponentSystemEventListener)
void unsubscribeFromEvent(Class<? extends SystemEvent>, ComponentSystemEventListener)

The rationale given for ComponentSystemEventListener is that, being installed on a specific component, there is no need for an instance to implement the full-blown SystemEventListener interface. It was not desired that ComponentSystemEventListener be an abstract class itself implementing SystemEventListener presumably because (a) that would force a listener into a particular inheritance hierarchy and (b) in order to narrow the argument accepted for .processEvent(), would most likely have necessitated the introduction of generics into the SystemEventListener taxonomy. The point at which the inconsistency arises is when UIComponent defines:

List getListenersForEventClass(Class<? extends SystemEvent>)

Ignoring the contrived possibility that all ComponentSystemEventListeners installed on a given UIComponent also implement SystemEventListener, the getListeners... method is meaningless and cannot return the objects registered via subscribeToEvent().

Affected Versions

[2.2 Sprint 8]

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
Reported by mattbenson

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
rogerk said:
triage

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
File: changebundle.txt
Attached By: @edburns

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
@edburns said:
Sending jsf-api/src/main/java/javax/faces/component/UIComponent.java
Sending jsf-api/src/main/java/javax/faces/event/ComponentSystemEvent.java
Sending jsf-api/src/main/java/javax/faces/event/SystemEvent.java
Adding jsf-test/#997
Adding jsf-test/#997/build.xml
Adding jsf-test/#997/i_spec_997_htmlunit
Adding jsf-test/#997/i_spec_997_htmlunit/pom.xml
Adding jsf-test/#997/i_spec_997_htmlunit/src
Adding jsf-test/#997/i_spec_997_htmlunit/src/main
Adding jsf-test/#997/i_spec_997_htmlunit/src/main/java
Adding jsf-test/#997/i_spec_997_htmlunit/src/main/java/com
Adding jsf-test/#997/i_spec_997_htmlunit/src/main/java/com/sun
Adding jsf-test/#997/i_spec_997_htmlunit/src/main/java/com/sun/faces
Adding jsf-test/#997/i_spec_997_htmlunit/src/main/java/com/sun/faces/regression
Adding jsf-test/#997/i_spec_997_htmlunit/src/main/java/com/sun/faces/regression/i_spec_997
Adding jsf-test/#997/i_spec_997_htmlunit/src/main/java/com/sun/faces/regression/i_spec_997/Issue997TestCase.java
Adding jsf-test/#997/i_spec_997_htmlunit/src/main/resources
Adding jsf-test/#997/i_spec_997_jar
Adding jsf-test/#997/i_spec_997_jar/pom.xml
Adding jsf-test/#997/i_spec_997_jar/src
Adding jsf-test/#997/i_spec_997_jar/src/main
Adding jsf-test/#997/i_spec_997_jar/src/main/java
Adding jsf-test/#997/i_spec_997_jar/src/main/java/com
Adding jsf-test/#997/i_spec_997_jar/src/main/java/com/sun
Adding jsf-test/#997/i_spec_997_jar/src/main/java/com/sun/faces
Adding jsf-test/#997/i_spec_997_jar/src/main/java/com/sun/faces/i_spec_997
Adding jsf-test/#997/i_spec_997_jar/src/main/java/com/sun/faces/i_spec_997/ListenerForComponent.java
Adding jsf-test/#997/i_spec_997_jar/src/main/java/com/sun/faces/i_spec_997/ListenersForComponent.java
Adding jsf-test/#997/i_spec_997_jar/src/main/resources
Adding jsf-test/#997/i_spec_997_jar/src/main/resources/META-INF
Adding jsf-test/#997/i_spec_997_jar/src/main/resources/META-INF/faces-config.xml
Adding jsf-test/#997/i_spec_997_jar/src/main/resources/META-INF/i_jsf_1948.taglib.xml
Adding jsf-test/#997/i_spec_997_war
Adding jsf-test/#997/i_spec_997_war/pom.xml
Adding jsf-test/#997/i_spec_997_war/src
Adding jsf-test/#997/i_spec_997_war/src/main
Adding jsf-test/#997/i_spec_997_war/src/main/java
Adding jsf-test/#997/i_spec_997_war/src/main/webapp
Adding jsf-test/#997/i_spec_997_war/src/main/webapp/WEB-INF
Adding jsf-test/#997/i_spec_997_war/src/main/webapp/WEB-INF/web.xml
Adding jsf-test/#997/i_spec_997_war/src/main/webapp/main.xhtml
Sending jsf-test/build.xml
Transmitting file data ...............
Committed revision 9035.

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
dougd said:
I am hitting a ClassCastException when calling to ComponentSystemEvent.processListener(ComponentSystemEventListener).

This is due to the fact that we call SystemEvent.processListener() from ComponentSystemEvent.processListenerwhich is now trying to cast to a SystemEventListener(). The issue is that ComponentSystemEventLIstener and SystemEventListener are peers. This is unlike ComponentSystemEvent which is a SystemEvent in the hierarchy.

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
File: 20120201-1427-i_spec_997.patch
Attached By: @edburns

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
@edburns said:
Sending jsf-api/src/main/java/javax/faces/event/ComponentSystemEvent.java
Transmitting file data .
Committed revision 9630.

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
Marked as fixed on Wednesday, February 1st 2012, 12:30:23 pm

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
@manfredriem said:
Closing resolved issue out

@eclipse-faces-bot
Copy link
Author

@glassfishrobot Commented
This issue was imported from java.net JIRA JAVASERVERFACES_SPEC_PUBLIC-997

@eclipse-faces-bot
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant