|
From: Colin S. <col...@ex...> - 2004-08-05 13:59:03
|
Rob Harrop wrote: > All, > > I am noticing some strange behavior when using method replacement. > > I have a bean that has two methods: foo(String) and foo(Object). My > method replacer will only replace foo(String) and in my configuration > I specify: > > <replaced-method name="fooBean" replacer="methodReplacer"> > <arg-type>String</arg-type> > </replaced-method> > > Yet the method replacer is getting invoked whenever I invoke > foo(Object) is this correct or is this a bug? > > rob Rod can give a qualified answer, but I think that this is probably happening due to the way that resolution is happening, where the arg-type will match any target method that can take that arg type. In general, it's not a great practice in your classes to overload methods such that one method takes a superclass of another... Colin |