[seam-commits] Seam SVN: r15450 - branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/intercept.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Mar 18 05:14:20 EDT 2013


Author: manaRH
Date: 2013-03-18 05:14:20 -0400 (Mon, 18 Mar 2013)
New Revision: 15450

Modified:
   branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/intercept/JavaBeanInterceptor.java
Log:
enhancing JBSEAM-5066 fix

Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/intercept/JavaBeanInterceptor.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/intercept/JavaBeanInterceptor.java	2013-03-18 09:01:08 UTC (rev 15449)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/intercept/JavaBeanInterceptor.java	2013-03-18 09:14:20 UTC (rev 15450)
@@ -80,22 +80,27 @@
                return (bean instanceof HttpSessionActivationListener) ? method.invoke(bean, params) : null;
             }
          }
-         else if ( params.length==1 && method.getName().equals("equals") && (params[0] == proxy) )
+         else if ( params.length==1 && method.getName().equals("equals") )
          {
             //make default equals() method return true when called on itself
             //by unwrapping the proxy
             //We don't let calling this equals make us dirty, as we assume it is without side effects
             //this assumption is required, as Mojarra 2.0 calls equals during SessionMap.put, see JBSEAM-4966
-            if ( method.getParameterTypes().length == 1 && method.getParameterTypes()[0] == Object.class) 
+            if ( method.getParameterTypes()[0] == Object.class ) 
             {
-               return proceed.invoke(proxy, params);
-            }
+               //  JBSEAM-5066 - we need to skip the interceptInvocation in case of Object.equals(otherObject)
+               if (params[0] == proxy )
+               {
+                  return method.invoke(bean, new Object[]{bean});   
+               }
+               else
+               {
+                  return method.invoke(bean, params);   
+               }
+               
+            } 
 
-         } // JBSEAM-5066 - we need to skip the interceptInvocation in case of Object.equals(otherObject)
-         else if (  params.length==1 && method.getName().equals("equals") && (params[0] != proxy))
-         {
-            return proceed.invoke(bean, params);
-         }
+         } 
       }
 
       if ( markDirty(method) )



More information about the seam-commits mailing list