[jboss-cvs] JBossCache/src/org/jboss/cache/pojo/collection ...
Jason Thomas Greene
jgreene at jboss.com
Tue Jun 26 17:13:21 EDT 2007
User: jgreene
Date: 07/06/26 17:13:21
Modified: src/org/jboss/cache/pojo/collection
CollectionInterceptorUtil.java
Log:
Don't verify equals
Revision Changes Path
1.5 +13 -2 JBossCache/src/org/jboss/cache/pojo/collection/CollectionInterceptorUtil.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CollectionInterceptorUtil.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/pojo/collection/CollectionInterceptorUtil.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- CollectionInterceptorUtil.java 21 Jun 2007 01:33:03 -0000 1.4
+++ CollectionInterceptorUtil.java 26 Jun 2007 21:13:21 -0000 1.5
@@ -158,6 +158,18 @@
return managedMethods;
}
+ private static boolean skipVerify(Method method)
+ {
+ String name = method.getName();
+ Class<?>[] types = method.getParameterTypes();
+ if ("toString".equals(name) && types.length == 0)
+ return true;
+ if ("equals".equals(name) && types.length == 1 && types[0] == Object.class)
+ return true;
+
+ return false;
+ }
+
public static Object invoke(Invocation invocation,
AbstractCollectionInterceptor interceptor,
Object impl,
@@ -179,8 +191,7 @@
Object[] args = methodInvocation.getArguments();
if (method != null)
{
- // No need to validate toString()
- if (method.getDeclaringClass() != Object.class)
+ if (skipVerify(method))
interceptor.verifyAttached(impl);
return method.invoke(impl, args);
More information about the jboss-cvs-commits
mailing list