[seam-commits] Seam SVN: r7409 - branches/Seam_2_0/src/main/org/jboss/seam/core.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Sat Feb 9 23:01:13 EST 2008


Author: shane.bryzak at jboss.com
Date: 2008-02-09 23:01:13 -0500 (Sat, 09 Feb 2008)
New Revision: 7409

Modified:
   branches/Seam_2_0/src/main/org/jboss/seam/core/Init.java
Log:
JBSEAM-2571

Modified: branches/Seam_2_0/src/main/org/jboss/seam/core/Init.java
===================================================================
--- branches/Seam_2_0/src/main/org/jboss/seam/core/Init.java	2008-02-10 03:54:45 UTC (rev 7408)
+++ branches/Seam_2_0/src/main/org/jboss/seam/core/Init.java	2008-02-10 04:01:13 UTC (rev 7409)
@@ -7,6 +7,7 @@
 import java.io.File;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -279,6 +280,17 @@
       {
          return "ObserverMethod(" + method + ')';
       }
+      
+      @Override
+      public boolean equals(Object obj)
+      {
+         if (!(obj instanceof ObserverMethod)) return false;
+           
+         ObserverMethod other = (ObserverMethod) obj;
+         return this.component.equals(other.component) &&
+           Arrays.equals(this.method.getParameterTypes(), other.method.getParameterTypes()) &&
+           this.method.getName().equals(other.getMethod().getName());         
+      }
    }
    
    public static class ObserverMethodExpression
@@ -320,7 +332,12 @@
          observerList = new ArrayList<ObserverMethod>();
          observerMethods.put(eventType, observerList);
       }
-      observerList.add( new ObserverMethod(method, component, create) );
+      
+      ObserverMethod observerMethod = new ObserverMethod(method, component, create); 
+      if (!observerList.contains(observerMethod))
+      {
+         observerList.add( observerMethod );
+      }
    }
    
    public void addObserverMethodExpression(String eventType, MethodExpression methodBinding)




More information about the seam-commits mailing list