yi gong updated Bug WELD-1247
Change By: yi gong (06/Nov/12 3:26 AM)
Description: The equals() implementation is incorrect

{code} 
 @Override
    public boolean equals(Object obj) {
//my fix
     if (obj !=null && obj instanceof ForwardingMethodExpression){
     obj=((ForwardingMethodExpression)obj).delegate();
     }
//my fix end
        return this == obj || delegate().equals(obj);
    }
{code}
if If  the obj is a WeldMethodExpression, it returns false which cause add duplicated  Listener  listener in Mojarra 2.1

Please see Mojarra
javax.faces.componentUIComponentBase
{code} 
    public void subscribeToEvent(Class<? extends SystemEvent> eventClass,
                                 ComponentSystemEventListener componentListener) {
...
        if (!listenersForEventClass.contains(facesLifecycleListener)) {
 // see here
            listenersForEventClass.add(facesLifecycleListener);
        }

    }
{code}
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira