Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Config
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32125/Config
Modified Files:
ObjectDefinitionVisitor.cs
Log Message:
PropertyPlaceholderConfigurer does not replace property values in <list element-type=${prop}> [SPRNET-719]
Index: ObjectDefinitionVisitor.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Config/ObjectDefinitionVisitor.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ObjectDefinitionVisitor.cs 28 Aug 2007 14:16:40 -0000 1.7
--- ObjectDefinitionVisitor.cs 26 Nov 2007 14:15:53 -0000 1.8
***************
*** 19,26 ****
--- 19,32 ----
#endregion
+ #region Imports
+
using System;
using System.Collections;
+
using Spring.Collections;
using Spring.Util;
+ using Spring.Objects.Factory.Support;
+
+ #endregion
namespace Spring.Objects.Factory.Config
***************
*** 198,212 ****
}
}
! else if (value is IList)
{
! VisitList((IList)value);
}
! else if (value is ISet)
{
! VisitSet((ISet)value);
}
! else if (value is IDictionary)
{
! VisitDictionary((IDictionary)value);
}
else if (value is TypedStringValue)
--- 204,218 ----
}
}
! else if (value is ManagedList)
{
! VisitManagedList((ManagedList)value);
}
! else if (value is ManagedSet)
{
! VisitManagedSet((ManagedSet)value);
}
! else if (value is ManagedDictionary)
{
! VisitManagedDictionary((ManagedDictionary)value);
}
else if (value is TypedStringValue)
***************
*** 234,241 ****
/// <summary>
! /// Calls <see cref="ResolveValue"/> for list element.
/// </summary>
! protected virtual void VisitList(IList listVal)
{
for (int i = 0; i < listVal.Count; ++i)
{
--- 240,258 ----
/// <summary>
! /// Visits the ManagedList property ElementTypeName and
! /// calls <see cref="ResolveValue"/> for list element.
/// </summary>
! protected virtual void VisitManagedList(ManagedList listVal)
{
+ string elementTypeName = listVal.ElementTypeName;
+ if (elementTypeName != null)
+ {
+ string resolvedName = ResolveStringValue(elementTypeName).ToString();
+ if (!elementTypeName.Equals(resolvedName))
+ {
+ listVal.ElementTypeName = resolvedName;
+ }
+ }
+
for (int i = 0; i < listVal.Count; ++i)
{
***************
*** 250,257 ****
/// <summary>
! /// Calls <see cref="ResolveValue"/> for set element.
/// </summary>
! protected virtual void VisitSet(ISet setVal)
{
ISet clone = (ISet)setVal.Clone();
--- 267,284 ----
/// <summary>
! /// Visits the ManagedSet property ElementTypeName and
! /// calls <see cref="ResolveValue"/> for list element.
/// </summary>
! protected virtual void VisitManagedSet(ManagedSet setVal)
{
+ string elementTypeName = setVal.ElementTypeName;
+ if (elementTypeName != null)
+ {
+ string resolvedName = ResolveStringValue(elementTypeName).ToString();
+ if (!elementTypeName.Equals(resolvedName))
+ {
+ setVal.ElementTypeName = resolvedName;
+ }
+ }
ISet clone = (ISet)setVal.Clone();
***************
*** 268,275 ****
/// <summary>
! /// Calls <see cref="ResolveValue"/> for dictionary's value element.
/// </summary>
! protected virtual void VisitDictionary(IDictionary dictVal)
{
Hashtable mods = new Hashtable();
foreach (DictionaryEntry entry in dictVal)
--- 295,323 ----
/// <summary>
! /// Visits the ManagedSet properties KeyTypeName and ValueTypeName and
! /// calls <see cref="ResolveValue"/> for dictionary's value element.
/// </summary>
! protected virtual void VisitManagedDictionary(ManagedDictionary dictVal)
{
+ string keyTypeName = dictVal.KeyTypeName;
+ if (keyTypeName != null)
+ {
+ string resolvedName = ResolveStringValue(keyTypeName).ToString();
+ if (!keyTypeName.Equals(resolvedName))
+ {
+ dictVal.KeyTypeName = resolvedName;
+ }
+ }
+
+ string valueTypeName = dictVal.ValueTypeName;
+ if (valueTypeName != null)
+ {
+ string resolvedName = ResolveStringValue(valueTypeName).ToString();
+ if (!valueTypeName.Equals(resolvedName))
+ {
+ dictVal.ValueTypeName = resolvedName;
+ }
+ }
+
Hashtable mods = new Hashtable();
foreach (DictionaryEntry entry in dictVal)
|