Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Interceptor
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv30658
Modified Files:
MethodMapTransactionAttributeSource.cs
Log Message:
SPRNET-727 - MethodMatchTransactionAttributeSource does not correctly return transaction attributes on candidate target object if method registered using MethodInfo object is based on an interface
Index: MethodMapTransactionAttributeSource.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Interceptor/MethodMapTransactionAttributeSource.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** MethodMapTransactionAttributeSource.cs 31 Jul 2007 18:18:08 -0000 1.9
--- MethodMapTransactionAttributeSource.cs 17 Sep 2007 19:16:05 -0000 1.10
***************
*** 237,241 ****
public ITransactionAttribute ReturnTransactionAttribute(MethodInfo method, Type targetType)
{
! return (ITransactionAttribute) _methodMap[method];
}
#endregion
--- 237,253 ----
public ITransactionAttribute ReturnTransactionAttribute(MethodInfo method, Type targetType)
{
! //Might have registered MethodInfo objects whose declaring type is the interface, so 'downcast'
! //to the most specific method which is typically what is passed in as the first method argument.
! foreach (DictionaryEntry dictionaryEntry in _methodMap)
! {
! MethodInfo specificMethod =
! ReflectionUtils.GetMostSpecificMethod((MethodInfo) dictionaryEntry.Key, targetType);
! if (method == specificMethod)
! {
! return (ITransactionAttribute) dictionaryEntry.Value;
! }
!
! }
! return (ITransactionAttribute)_methodMap[method];
}
#endregion
|