[jboss-dev-forums] [Design of EJB 3.0] - Re: Weird issue with interceptors

adrian@jboss.org do-not-reply at jboss.com
Wed Nov 14 14:39:22 EST 2007


"adrian at jboss.org" wrote : 
  | If I run the bank ejb3 test from a fresh boot then the interceptor test works.
  | However if I rerun the test it fails.
  | 

You've also got to rebuild the bank.jar to make the test pass.

It looks like the problem is because EJBContainer::isBusinessMethod() is returning false
when EJB3InterceptorsFactory invokes to see if it should apply interceptors.

But I also see this return false when the test passes? And I haven't
figured out why the test passes only when I rebuild the jar?????

Also this code looks wrong to me. Since it doesn't take into account Covariant
return types. It should be testing whether the return type is assignable
not equal.


  |    private static boolean isCallable(Method method, Method other)
  |    {
  |       if ((method.getDeclaringClass().isAssignableFrom(other.getDeclaringClass())) && (method.getName() == other.getName()))
  |       {
  |          if (!method.getReturnType().equals(other.getReturnType()))
  |             return false;
  |          Class[] params1 = method.getParameterTypes();
  |          Class[] params2 = other.getParameterTypes();
  |          if (params1.length == params2.length)
  |          {
  |             for (int i = 0; i < params1.length; i++)
  |             {
  |                if (params1 != params2)
  |                   return false;
  |             }
  |             return true;
  |          }
  |       }
  |       return false;
  |    }   
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104753#4104753

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104753



More information about the jboss-dev-forums mailing list