Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-1247

The ForwardingMethodExpression equals() implementation is incorrect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.1.11.Final, 2.0.0.Beta1
    • 1.1.10.Final
    • None
    • None

      The equals() implementation is incorrect

       
      @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);
      }
      

      If the obj is a WeldMethodExpression, it returns false which cause add duplicated listener in Mojarra 2.1

      Please see Mojarra javax.faces.component.UIComponentBase

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

            marko.luksa@gmail.com Marko Luksa (Inactive)
            pikachu_jira yi gong (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 2 hours
                2h
                Remaining:
                Remaining Estimate - 2 hours
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified