///
- string[] DependsOn { get; }
+ IList DependsOn { get; }
///
/// The name of the initializer method.
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/ISingletonObjectRegistry.cs b/src/Spring/Spring.Core/Objects/Factory/Config/ISingletonObjectRegistry.cs
index b2f0a4c7..e1019486 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/ISingletonObjectRegistry.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/ISingletonObjectRegistry.cs
@@ -18,6 +18,8 @@
#endregion
+using System.Collections.Generic;
+
namespace Spring.Objects.Factory.Config
{
///
@@ -138,7 +140,7 @@ namespace Spring.Objects.Factory.Config
///
///
///
- string[] SingletonNames
+ IList SingletonNames
{
get;
}
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/InstantiationAwareObjectPostProcessorAdapter.cs b/src/Spring/Spring.Core/Objects/Factory/Config/InstantiationAwareObjectPostProcessorAdapter.cs
index d96f4557..2d357fad 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/InstantiationAwareObjectPostProcessorAdapter.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/InstantiationAwareObjectPostProcessorAdapter.cs
@@ -19,6 +19,7 @@
#endregion
using System;
+using System.Collections.Generic;
using System.Reflection;
namespace Spring.Objects.Factory.Config
@@ -153,8 +154,7 @@ namespace Spring.Objects.Factory.Config
/// Name of the object.
/// The actual property values to apply to the given object (can be the
/// passed-in PropertyValues instances0 or null to skip property population.
- public virtual IPropertyValues PostProcessPropertyValues(IPropertyValues pvs, PropertyInfo[] pis, object objectInstance,
- string objectName)
+ public virtual IPropertyValues PostProcessPropertyValues(IPropertyValues pvs, IList pis, object objectInstance, string objectName)
{
return pvs;
}
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/ObjectDefinitionHolder.cs b/src/Spring/Spring.Core/Objects/Factory/Config/ObjectDefinitionHolder.cs
index 082842b5..4fa884b9 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/ObjectDefinitionHolder.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/ObjectDefinitionHolder.cs
@@ -21,7 +21,8 @@
#region Imports
using System;
-using Spring.Objects.Factory.Config;
+using System.Collections.Generic;
+
using Spring.Objects.Factory.Xml;
using Spring.Util;
@@ -56,7 +57,7 @@ namespace Spring.Objects.Factory.Config
{
private IObjectDefinition objectDefinition;
private string objectName;
- private string[] aliases;
+ private IList aliases;
#region Constructor () / Destructor
@@ -87,11 +88,11 @@ namespace Spring.Objects.Factory.Config
/// Any aliases for the supplied
///
public ObjectDefinitionHolder(
- IObjectDefinition definition, string name, string[] aliases)
+ IObjectDefinition definition, string name, IList aliases)
{
this.objectDefinition = definition;
this.objectName = name;
- this.aliases = aliases == null ? StringUtils.EmptyStrings : aliases;
+ this.aliases = aliases ?? new List(0);
}
#endregion
@@ -126,7 +127,7 @@ namespace Spring.Objects.Factory.Config
/// array will be returned.
///
///
- public string[] Aliases
+ public IList Aliases
{
get { return aliases; }
}
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/ObjectDefinitionVisitor.cs b/src/Spring/Spring.Core/Objects/Factory/Config/ObjectDefinitionVisitor.cs
index 1b8a4b81..31f23ce4 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/ObjectDefinitionVisitor.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/ObjectDefinitionVisitor.cs
@@ -115,7 +115,7 @@ namespace Spring.Objects.Factory.Config
MutablePropertyValues pvs = objectDefinition.PropertyValues;
if (pvs != null)
{
- for (int j = 0; j < pvs.PropertyValues.Length; j++)
+ for (int j = 0; j < pvs.PropertyValues.Count; j++)
{
PropertyValue pv = pvs.PropertyValues[j];
object newVal = ResolveValue(pv.Value);
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/PropertyPlaceholderConfigurer.cs b/src/Spring/Spring.Core/Objects/Factory/Config/PropertyPlaceholderConfigurer.cs
index 88ea1636..017d5f40 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/PropertyPlaceholderConfigurer.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/PropertyPlaceholderConfigurer.cs
@@ -21,10 +21,12 @@
#region Imports
using System;
-using System.Collections;
+using System.Collections.Generic;
using System.Collections.Specialized;
using System.Globalization;
+
using Common.Logging;
+
using Spring.Collections;
#endregion
@@ -228,10 +230,10 @@ namespace Spring.Objects.Factory.Config
protected override void ProcessProperties(IConfigurableListableObjectFactory factory, NameValueCollection props)
{
PlaceholderResolveHandlerAdapter resolveAdapter = new PlaceholderResolveHandlerAdapter(this, props);
- ObjectDefinitionVisitor visitor = new ObjectDefinitionVisitor(new ObjectDefinitionVisitor.ResolveHandler(resolveAdapter.ParseAndResolveVariables));
+ ObjectDefinitionVisitor visitor = new ObjectDefinitionVisitor(resolveAdapter.ParseAndResolveVariables);
- string[] objectDefinitionNames = factory.GetObjectDefinitionNames();
- for (int i = 0; i < objectDefinitionNames.Length; ++i)
+ IList objectDefinitionNames = factory.GetObjectDefinitionNames();
+ for (int i = 0; i < objectDefinitionNames.Count; ++i)
{
string name = objectDefinitionNames[i];
IObjectDefinition definition = factory.GetObjectDefinition(name);
diff --git a/src/Spring/Spring.Core/Objects/Factory/Config/VariablePlaceholderConfigurer.cs b/src/Spring/Spring.Core/Objects/Factory/Config/VariablePlaceholderConfigurer.cs
index b38ff170..bbb18561 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Config/VariablePlaceholderConfigurer.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Config/VariablePlaceholderConfigurer.cs
@@ -20,6 +20,7 @@
using System;
using System.Collections;
+using System.Collections.Generic;
using System.Globalization;
using Common.Logging;
using Spring.Collections;
@@ -245,8 +246,8 @@ namespace Spring.Objects.Factory.Config
TextProcessor tp = new TextProcessor(this, compositeVariableSource);
ObjectDefinitionVisitor visitor = new ObjectDefinitionVisitor(new ObjectDefinitionVisitor.ResolveHandler(tp.ParseAndResolveVariables));
- string[] objectDefinitionNames = factory.GetObjectDefinitionNames();
- for (int i = 0; i < objectDefinitionNames.Length; ++i)
+ IList objectDefinitionNames = factory.GetObjectDefinitionNames();
+ for (int i = 0; i < objectDefinitionNames.Count; ++i)
{
string name = objectDefinitionNames[i];
IObjectDefinition definition = factory.GetObjectDefinition( name );
diff --git a/src/Spring/Spring.Core/Objects/Factory/IListableObjectFactory.cs b/src/Spring/Spring.Core/Objects/Factory/IListableObjectFactory.cs
index 9866b06b..c071a342 100644
--- a/src/Spring/Spring.Core/Objects/Factory/IListableObjectFactory.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/IListableObjectFactory.cs
@@ -86,141 +86,141 @@ namespace Spring.Objects.Factory
///
int ObjectDefinitionCount { get; }
-
- ///
- /// Return the names of all objects defined in this factory.
- ///
- ///
- /// The names of all objects defined in this factory, or an empty array if none
- /// are defined.
- ///
- string[] GetObjectDefinitionNames();
- ///
- /// Return the names of objects matching the given
- /// (including subclasses), judging from the object definitions.
- ///
- ///
- ///
- /// Does consider objects created by s,
- /// or rather it considers the type of objects created by
- /// (which means that
- /// s will be instantiated).
- ///
- ///
- /// Does not consider any hierarchy this factory may participate in.
- ///
- ///
- ///
- /// The (class or interface) to match, or
- /// for all object names.
- ///
- ///
- /// The names of all objects defined in this factory, or an empty array if none
- /// are defined.
- ///
- string[] GetObjectNamesForType(Type type);
+ ///
+ /// Return the names of all objects defined in this factory.
+ ///
+ ///
+ /// The names of all objects defined in this factory, or an empty array if none
+ /// are defined.
+ ///
+ IList GetObjectDefinitionNames();
+
+ ///
+ /// Return the names of objects matching the given
+ /// (including subclasses), judging from the object definitions.
+ ///
+ ///
+ ///
+ /// Does consider objects created by s,
+ /// or rather it considers the type of objects created by
+ /// (which means that
+ /// s will be instantiated).
+ ///
+ ///
+ /// Does not consider any hierarchy this factory may participate in.
+ ///
+ ///
+ ///
+ /// The (class or interface) to match, or
+ /// for all object names.
+ ///
+ ///
+ /// The names of all objects defined in this factory, or an empty array if none
+ /// are defined.
+ ///
+ IList GetObjectNamesForType(Type type);
- ///
- /// Return the names of objects matching the given
- /// (including subclasses), judging from the object definitions.
- ///
- ///
- ///
- /// Does consider objects created by s,
- /// or rather it considers the type of objects created by
- /// (which means that
- /// s will be instantiated).
- ///
- ///
- /// Does not consider any hierarchy this factory may participate in.
- ///
- ///
- ///
- /// The (class or interface) to match, or
- /// for all object names.
- ///
- ///
- /// The names of all objects defined in this factory, or an empty array if none
- /// are defined.
- ///
- string[] GetObjectNamesForType();
+ ///
+ /// Return the names of objects matching the given
+ /// (including subclasses), judging from the object definitions.
+ ///
+ ///
+ ///
+ /// Does consider objects created by s,
+ /// or rather it considers the type of objects created by
+ /// (which means that
+ /// s will be instantiated).
+ ///
+ ///
+ /// Does not consider any hierarchy this factory may participate in.
+ ///
+ ///
+ ///
+ /// The (class or interface) to match, or
+ /// for all object names.
+ ///
+ ///
+ /// The names of all objects defined in this factory, or an empty array if none
+ /// are defined.
+ ///
+ IList GetObjectNames();
- ///
- /// Return the names of objects matching the given
- /// (including subclasses), judging from the object definitions.
- ///
- ///
- ///
- /// Does consider objects created by s,
- /// or rather it considers the type of objects created by
- /// (which means that
- /// s will be instantiated).
- ///
- ///
- /// Does not consider any hierarchy this factory may participate in.
- /// Use
- /// to include beans in ancestor factories too.
- /// <p>Note: Does <i>not</i> ignore singleton objects that have been registered
- /// by other means than bean definitions.
- ///
- ///
- ///
- /// The (class or interface) to match, or
- /// for all object names.
- ///
- ///
- /// Whether to include prototype objects too or just singletons (also applies to
- /// s).
- ///
- ///
- /// Whether to include s too
- /// or just normal objects.
- ///
- ///
- /// The names of all objects defined in this factory, or an empty array if none
- /// are defined.
- ///
- string[] GetObjectNamesForType(Type type, bool includePrototypes, bool includeFactoryObjects);
+ ///
+ /// Return the names of objects matching the given
+ /// (including subclasses), judging from the object definitions.
+ ///
+ ///
+ ///
+ /// Does consider objects created by s,
+ /// or rather it considers the type of objects created by
+ /// (which means that
+ /// s will be instantiated).
+ ///
+ ///
+ /// Does not consider any hierarchy this factory may participate in.
+ /// Use
+ /// to include beans in ancestor factories too.
+ /// <p>Note: Does <i>not</i> ignore singleton objects that have been registered
+ /// by other means than bean definitions.
+ ///
+ ///
+ ///
+ /// The (class or interface) to match, or
+ /// for all object names.
+ ///
+ ///
+ /// Whether to include prototype objects too or just singletons (also applies to
+ /// s).
+ ///
+ ///
+ /// Whether to include s too
+ /// or just normal objects.
+ ///
+ ///
+ /// The names of all objects defined in this factory, or an empty array if none
+ /// are defined.
+ ///
+ IList GetObjectNamesForType(Type type, bool includePrototypes, bool includeFactoryObjects);
- ///
- /// Return the names of objects matching the given
- /// (including subclasses), judging from the object definitions.
- ///
- ///
- ///
- /// Does consider objects created by s,
- /// or rather it considers the type of objects created by
- /// (which means that
- /// s will be instantiated).
- ///
- ///
- /// Does not consider any hierarchy this factory may participate in.
- /// Use
- /// to include beans in ancestor factories too.
- /// <p>Note: Does <i>not</i> ignore singleton objects that have been registered
- /// by other means than bean definitions.
- ///
- ///
- ///
- /// The (class or interface) to match, or
- /// for all object names.
- ///
- ///
- /// Whether to include prototype objects too or just singletons (also applies to
- /// s).
- ///
- ///
- /// Whether to include s too
- /// or just normal objects.
- ///
- ///
- /// The names of all objects defined in this factory, or an empty array if none
- /// are defined.
- ///
- string[] GetObjectNamesForType(bool includePrototypes, bool includeFactoryObjects);
+ ///
+ /// Return the names of objects matching the given
+ /// (including subclasses), judging from the object definitions.
+ ///
+ ///
+ ///
+ /// Does consider objects created by s,
+ /// or rather it considers the type of objects created by
+ /// (which means that
+ /// s will be instantiated).
+ ///
+ ///
+ /// Does not consider any hierarchy this factory may participate in.
+ /// Use
+ /// to include beans in ancestor factories too.
+ /// <p>Note: Does <i>not</i> ignore singleton objects that have been registered
+ /// by other means than bean definitions.
+ ///
+ ///
+ ///
+ /// The (class or interface) to match, or
+ /// for all object names.
+ ///
+ ///
+ /// Whether to include prototype objects too or just singletons (also applies to
+ /// s).
+ ///
+ ///
+ /// Whether to include s too
+ /// or just normal objects.
+ ///
+ ///
+ /// The names of all objects defined in this factory, or an empty array if none
+ /// are defined.
+ ///
+ IList GetObjectNames(bool includePrototypes, bool includeFactoryObjects);
///
/// Return the object instances that match the given object
@@ -278,7 +278,7 @@ namespace Spring.Objects.Factory
///
/// If the objects could not be created.
///
- IDictionary GetObjectsOfType();
+ IDictionary GetObjects();
///
/// Return the object instances that match the given object
@@ -334,7 +334,7 @@ namespace Spring.Objects.Factory
///
/// If the objects could not be created.
///
- IDictionary GetObjectsOfType(bool includePrototypes, bool includeFactoryObjects);
+ IDictionary GetObjects(bool includePrototypes, bool includeFactoryObjects);
///
/// Return an instance (possibly shared or independent) of the given object name.
diff --git a/src/Spring/Spring.Core/Objects/Factory/IObjectFactory.cs b/src/Spring/Spring.Core/Objects/Factory/IObjectFactory.cs
index dbfaadae..aff582d0 100644
--- a/src/Spring/Spring.Core/Objects/Factory/IObjectFactory.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/IObjectFactory.cs
@@ -21,6 +21,7 @@
#region Imports
using System;
+using System.Collections.Generic;
#endregion
@@ -209,21 +210,21 @@ namespace Spring.Objects.Factory
/// True if an object with the given name is defined.
bool ContainsObject(string name);
- ///
- /// Return the aliases for the given object name, if defined.
- ///
- ///
- ///
- /// Will ask the parent factory if the object cannot be found in this factory
- /// instance.
- ///
- ///
- /// The object name to check for aliases.
- /// The aliases, or an empty array if none.
- ///
- /// If there's no such object definition.
- ///
- string[] GetAliases(string name);
+ ///
+ /// Return the aliases for the given object name, if defined.
+ ///
+ ///
+ ///
+ /// Will ask the parent factory if the object cannot be found in this factory
+ /// instance.
+ ///
+ ///
+ /// The object name to check for aliases.
+ /// The aliases, or an empty array if none.
+ ///
+ /// If there's no such object definition.
+ ///
+ IList GetAliases(string name);
#if !MONO
///
diff --git a/src/Spring/Spring.Core/Objects/Factory/ObjectFactoryUtils.cs b/src/Spring/Spring.Core/Objects/Factory/ObjectFactoryUtils.cs
index c94455d9..eee5e85b 100644
--- a/src/Spring/Spring.Core/Objects/Factory/ObjectFactoryUtils.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/ObjectFactoryUtils.cs
@@ -111,7 +111,7 @@ namespace Spring.Objects.Factory
///
public static int CountObjectsIncludingAncestors(IListableObjectFactory factory)
{
- return ObjectNamesIncludingAncestors(factory).Length;
+ return ObjectNamesIncludingAncestors(factory).Count;
}
///
@@ -119,7 +119,7 @@ namespace Spring.Objects.Factory
///
/// The object factory.
/// The array of object names, or an empty array if none.
- public static string[] ObjectNamesIncludingAncestors(IListableObjectFactory factory)
+ public static IList ObjectNamesIncludingAncestors(IListableObjectFactory factory)
{
return ObjectNamesForTypeIncludingAncestors(factory, typeof(object));
}
@@ -159,7 +159,7 @@ namespace Spring.Objects.Factory
///
/// The array of object names, or an empty array if none.
///
- public static string[] ObjectNamesForTypeIncludingAncestors(
+ public static IList ObjectNamesForTypeIncludingAncestors(
IListableObjectFactory factory, Type type,
bool includePrototypes, bool includeFactoryObjects)
{
@@ -169,7 +169,7 @@ namespace Spring.Objects.Factory
if (pof != null)
{
IHierarchicalObjectFactory hof = (IHierarchicalObjectFactory)factory;
- string[] parentsResult = ObjectNamesForTypeIncludingAncestors(pof, type, includePrototypes, includeFactoryObjects);
+ IList parentsResult = ObjectNamesForTypeIncludingAncestors(pof, type, includePrototypes, includeFactoryObjects);
foreach (string objectName in parentsResult)
{
if (!result.Contains(objectName) && !hof.ContainsLocalObject(objectName))
@@ -178,7 +178,7 @@ namespace Spring.Objects.Factory
}
}
}
- return result.ToArray();
+ return result;
}
///
@@ -209,7 +209,7 @@ namespace Spring.Objects.Factory
///
/// The array of object names, or an empty array if none.
///
- public static string[] ObjectNamesForTypeIncludingAncestors(
+ public static IList ObjectNamesForTypeIncludingAncestors(
IListableObjectFactory factory, Type type)
{
List result = new List();
@@ -218,7 +218,7 @@ namespace Spring.Objects.Factory
if (pof != null)
{
IHierarchicalObjectFactory hof = (IHierarchicalObjectFactory)factory;
- string[] parentsResult = ObjectNamesForTypeIncludingAncestors(pof, type);
+ IList parentsResult = ObjectNamesForTypeIncludingAncestors(pof, type);
foreach (string objectName in parentsResult)
{
if (!result.Contains(objectName) && !hof.ContainsLocalObject(objectName))
@@ -227,7 +227,7 @@ namespace Spring.Objects.Factory
}
}
}
- return result.ToArray();
+ return result;
}
///
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/AbstractAutowireCapableObjectFactory.cs b/src/Spring/Spring.Core/Objects/Factory/Support/AbstractAutowireCapableObjectFactory.cs
index 25803c29..e7af9d00 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/AbstractAutowireCapableObjectFactory.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/AbstractAutowireCapableObjectFactory.cs
@@ -349,15 +349,15 @@ namespace Spring.Objects.Factory.Support
///
protected void ApplyPropertyValues(string name, RootObjectDefinition definition, IObjectWrapper wrapper, IPropertyValues properties)
{
- if (properties == null || properties.PropertyValues.Length == 0)
+ if (properties == null || properties.PropertyValues.Count == 0)
{
return;
}
ObjectDefinitionValueResolver valueResolver = CreateValueResolver();
MutablePropertyValues deepCopy = new MutablePropertyValues(properties);
- PropertyValue[] copiedProperties = deepCopy.PropertyValues;
- for (int i = 0; i < copiedProperties.Length; ++i)
+ IList copiedProperties = deepCopy.PropertyValues;
+ for (int i = 0; i < copiedProperties.Count; ++i)
{
PropertyValue copiedProperty = copiedProperties[i];
//(string name, RootObjectDefinition definition, string argumentName, object argumentValue)
@@ -500,7 +500,7 @@ namespace Spring.Objects.Factory.Support
if (wrapper == null)
{
- if (properties.PropertyValues.Length > 0)
+ if (properties.PropertyValues.Count > 0)
{
throw new ObjectCreationException(definition.ResourceDescription,
name, "Cannot apply property values to null instance.");
@@ -534,7 +534,7 @@ namespace Spring.Objects.Factory.Support
if (hasInstAwareOpps || needsDepCheck)
{
- PropertyInfo[] filteredPropInfo = FilterPropertyInfoForDependencyCheck(wrapper);
+ IList filteredPropInfo = FilterPropertyInfoForDependencyCheck(wrapper);
if (hasInstAwareOpps)
{
foreach (IObjectPostProcessor processor in ObjectPostProcessors)
@@ -834,7 +834,7 @@ namespace Spring.Objects.Factory.Support
protected internal override object InstantiateObject(string name, RootObjectDefinition definition, object[] arguments, bool allowEagerCaching, bool suppressConfigure)
{
// guarantee the initialization of objects that the current one depends on..
- if (definition.DependsOn != null && definition.DependsOn.Length > 0)
+ if (definition.DependsOn != null && definition.DependsOn.Count > 0)
{
foreach (string dependant in definition.DependsOn)
{
@@ -1155,7 +1155,7 @@ namespace Spring.Objects.Factory.Support
return;
}
- PropertyInfo[] filteredPropInfo = FilterPropertyInfoForDependencyCheck(wrapper);
+ IList filteredPropInfo = FilterPropertyInfoForDependencyCheck(wrapper);
if (HasInstantiationAwareBeanPostProcessors)
{
foreach (IObjectPostProcessor processor in ObjectPostProcessors)
@@ -1177,12 +1177,12 @@ namespace Spring.Objects.Factory.Support
CheckDependencies(name, definition, filteredPropInfo, properties);
}
- private void CheckDependencies(string name, IConfigurableObjectDefinition definition, PropertyInfo[] filteredPropInfo, IPropertyValues properties)
+ private void CheckDependencies(string name, IConfigurableObjectDefinition definition, IList filteredPropInfo, IPropertyValues properties)
{
DependencyCheckingMode dependencyCheck = definition.DependencyCheck;
- PropertyInfo[] unsatisfiedDependencies = AutowireUtils.GetUnsatisfiedDependencies(filteredPropInfo, properties, dependencyCheck);
+ IList unsatisfiedDependencies = AutowireUtils.GetUnsatisfiedDependencies(filteredPropInfo, properties, dependencyCheck);
- if (unsatisfiedDependencies.Length > 0)
+ if (unsatisfiedDependencies.Count > 0)
{
throw new UnsatisfiedDependencyException(definition.ResourceDescription, name, unsatisfiedDependencies[0].Name,
"Set this property value or disable dependency checking for this object.");
@@ -1195,11 +1195,11 @@ namespace Spring.Objects.Factory.Support
///
/// The object wrapper the object was created with.
/// The filtered PropertyInfos
- private PropertyInfo[] FilterPropertyInfoForDependencyCheck(IObjectWrapper wrapper)
+ private IList FilterPropertyInfoForDependencyCheck(IObjectWrapper wrapper)
{
lock (filteredPropertyDescriptorsCache)
{
- PropertyInfo[] filtered;
+ IList filtered;
if (!filteredPropertyDescriptorsCache.TryGetValue(wrapper.WrappedType, out filtered))
{
@@ -1213,7 +1213,7 @@ namespace Spring.Objects.Factory.Support
}
}
- filtered = list.ToArray();
+ filtered = list;
filteredPropertyDescriptorsCache.Add(wrapper.WrappedType, filtered);
}
return filtered;
@@ -1461,7 +1461,7 @@ namespace Spring.Objects.Factory.Support
///
private void DestroyDependantObjects(string name)
{
- string[] dependingObjects = GetDependingObjectNames(name);
+ IList dependingObjects = GetDependingObjectNames(name);
foreach (string doName in dependingObjects)
{
DestroySingleton(doName);
@@ -1769,7 +1769,7 @@ namespace Spring.Objects.Factory.Support
///
/// In case of errors.
///
- protected abstract string[] GetDependingObjectNames(string name);
+ protected abstract IList GetDependingObjectNames(string name);
///
/// Injects dependencies into the supplied instance
@@ -2080,7 +2080,7 @@ namespace Spring.Objects.Factory.Support
///
/// Cache of filtered PropertyInfos: object Type -> PropertyInfo array
///
- private IDictionary filteredPropertyDescriptorsCache = new Dictionary();
+ private IDictionary> filteredPropertyDescriptorsCache = new Dictionary>();
///
/// Dependency interfaces to ignore on dependency check and autowire, as Set of
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectDefinition.cs b/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectDefinition.cs
index 6defe1cd..e12ba0ae 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectDefinition.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectDefinition.cs
@@ -21,12 +21,11 @@
#region Imports
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Reflection;
using System.Text;
-using Spring.Core;
+
using Spring.Core.TypeResolution;
using Spring.Objects.Factory.Config;
using Spring.Util;
@@ -135,9 +134,8 @@ namespace Spring.Objects.Factory.Support
InitMethodName = other.InitMethodName;
DestroyMethodName = other.DestroyMethodName;
- DependsOn = new string[other.DependsOn.Length];
IsAutowireCandidate = other.IsAutowireCandidate;
- Array.Copy(other.DependsOn, DependsOn, other.DependsOn.Length);
+ DependsOn = new List(other.DependsOn);
FactoryMethodName = other.FactoryMethodName;
FactoryObjectName = other.FactoryObjectName;
AutowireMode = other.AutowireMode;
@@ -524,10 +522,10 @@ namespace Spring.Objects.Factory.Support
/// preparation on startup.
///
///
- public string[] DependsOn
+ public IList DependsOn
{
get { return dependsOn; }
- set { dependsOn = value == null ? StringUtils.EmptyStrings : value; }
+ set { dependsOn = value ?? StringUtils.EmptyStrings; }
}
///
@@ -739,14 +737,14 @@ namespace Spring.Objects.Factory.Support
{
FactoryMethodName = other.FactoryMethodName;
}
- if (ArrayUtils.HasLength(other.DependsOn))
+ if (other.DependsOn != null && other.DependsOn.Count > 0)
{
List deps = new List(other.DependsOn);
- if (ArrayUtils.HasLength(DependsOn))
+ if (DependsOn != null && DependsOn.Count > 0)
{
deps.AddRange(DependsOn);
}
- DependsOn = deps.ToArray();
+ DependsOn = deps;
}
AutowireMode = other.AutowireMode;
ResourceDescription = other.ResourceDescription;
@@ -811,7 +809,7 @@ namespace Spring.Objects.Factory.Support
private object objectType;
private AutoWiringMode autowireMode = AutoWiringMode.No;
private DependencyCheckingMode dependencyCheck = DependencyCheckingMode.None;
- private string[] dependsOn;
+ private IList dependsOn;
private bool autowireCandidate = true;
private string initMethodName = null;
private string destroyMethodName = null;
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectFactory.cs b/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectFactory.cs
index 7cd5c38b..446336bd 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectFactory.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectFactory.cs
@@ -29,7 +29,6 @@ using System.ComponentModel;
using Common.Logging;
using Spring.Collections;
-using Spring.Collections.Generic;
using Spring.Core;
using Spring.Core.TypeConversion;
using Spring.Objects.Factory.Config;
@@ -1211,7 +1210,7 @@ namespace Spring.Objects.Factory.Support
/// The names of objects in the singleton cache that match the given
/// object type (including subclasses), or an empty array if none.
///
- public virtual string[] GetSingletonNames(Type type)
+ public virtual IList GetSingletonNames(Type type)
{
lock (singletonCache)
{
@@ -1225,7 +1224,7 @@ namespace Spring.Objects.Factory.Support
matches.Add(name);
}
}
- return matches.ToArray();
+ return matches;
}
}
@@ -1448,12 +1447,12 @@ namespace Spring.Objects.Factory.Support
///
///
/// The names of the objects in the singleton cache.
- public virtual string[] GetSingletonNames()
+ public virtual IList GetSingletonNames()
{
lock (singletonCache)
{
IEnumerable keys = singletonCache.Keys.Cast();
- return new List(keys).ToArray();
+ return new List(keys);
}
}
@@ -1622,7 +1621,7 @@ namespace Spring.Objects.Factory.Support
///
/// Set of registered singletons, containing the bean names in registration order
///
- private ISet registeredSingletons = new HashedSet();
+ private HashSet registeredSingletons = new HashSet();
private readonly IDictionary singletonsInCreation;
@@ -1815,7 +1814,7 @@ namespace Spring.Objects.Factory.Support
/// Return the aliases for the given object name, if defined.
///
/// .
- public string[] GetAliases(string name)
+ public IList GetAliases(string name)
{
string objectName = TransformedObjectName(name);
// check if object actually exists in this object factory...
@@ -1834,7 +1833,7 @@ namespace Spring.Objects.Factory.Support
}
}
}
- return matches.ToArray();
+ return matches;
}
// not found, so check parent...
@@ -2534,7 +2533,7 @@ namespace Spring.Objects.Factory.Support
///
///
///
- public string[] SingletonNames
+ public IList SingletonNames
{
get
{
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/AutowireUtils.cs b/src/Spring/Spring.Core/Objects/Factory/Support/AutowireUtils.cs
index 9f8d4634..b68e6747 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/AutowireUtils.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/AutowireUtils.cs
@@ -24,10 +24,10 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
+
using Spring.Collections;
using Spring.Core;
using Spring.Objects.Factory.Config;
-using Spring.Objects.Support;
using Spring.Util;
#endregion
@@ -355,7 +355,7 @@ namespace Spring.Objects.Factory.Support
/// Returns the list of that are not satisfied by .
///
/// the filtered list. Is never null
- public static PropertyInfo[] GetUnsatisfiedDependencies(PropertyInfo[] propertyInfos, IPropertyValues properties, DependencyCheckingMode dependencyCheck)
+ public static IList GetUnsatisfiedDependencies(IList propertyInfos, IPropertyValues properties, DependencyCheckingMode dependencyCheck)
{
List unsatisfiedDependenciesList = new List();
foreach (PropertyInfo property in propertyInfos)
@@ -371,7 +371,7 @@ namespace Spring.Objects.Factory.Support
}
}
}
- return unsatisfiedDependenciesList.ToArray();
+ return unsatisfiedDependenciesList;
}
}
}
\ No newline at end of file
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/ConstructorResolver.cs b/src/Spring/Spring.Core/Objects/Factory/Support/ConstructorResolver.cs
index c862ce91..979f966e 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/ConstructorResolver.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/ConstructorResolver.cs
@@ -31,6 +31,8 @@ using Spring.Core.TypeResolution;
using Spring.Objects.Factory.Config;
using Spring.Util;
+using System.Linq;
+
namespace Spring.Objects.Factory.Support
{
///
@@ -307,12 +309,12 @@ namespace Spring.Objects.Factory.Support
}
GenericArgumentsHolder genericArgsInfo = new GenericArgumentsHolder(definition.FactoryMethodName);
- MethodInfo[] factoryMethodCandidates = FindMethods(genericArgsInfo.GenericMethodName, expectedArgCount, isStatic, factoryClass);
+ IList factoryMethodCandidates = FindMethods(genericArgsInfo.GenericMethodName, expectedArgCount, isStatic, factoryClass);
bool autowiring = (definition.AutowireMode == AutoWiringMode.Constructor);
// try all matching methods to see if they match the constructor arguments...
- for (int i = 0; i < factoryMethodCandidates.Length; i++)
+ for (int i = 0; i < factoryMethodCandidates.Count; i++)
{
MethodInfo factoryMethodCandidate = factoryMethodCandidates[i];
if (genericArgsInfo.ContainsGenericArguments)
@@ -610,16 +612,14 @@ namespace Spring.Objects.Factory.Support
/// methods exposed on the
/// that match the supplied criteria.
///
- private static MethodInfo[] FindMethods(string methodName, int expectedArgumentCount, bool isStatic, Type searchType)
+ private static IList FindMethods(string methodName, int expectedArgumentCount, bool isStatic, Type searchType)
{
ComposedCriteria methodCriteria = new ComposedCriteria();
methodCriteria.Add(new MethodNameMatchCriteria(methodName));
methodCriteria.Add(new MethodParametersCountCriteria(expectedArgumentCount));
BindingFlags methodFlags = BindingFlags.Public | BindingFlags.IgnoreCase | (isStatic ? BindingFlags.Static : BindingFlags.Instance);
- MemberInfo[] methods =
- searchType.FindMembers(MemberTypes.Method, methodFlags, new MemberFilter(new CriteriaMemberFilter().FilterMemberByCriteria),
- methodCriteria);
- return (MethodInfo[])ArrayList.Adapter(methods).ToArray(typeof(MethodInfo));
+ MemberInfo[] methods = searchType.FindMembers(MemberTypes.Method, methodFlags, new CriteriaMemberFilter().FilterMemberByCriteria, methodCriteria);
+ return methods.Cast().ToArray();
}
internal class ArgumentsHolder
{
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/DefaultListableObjectFactory.cs b/src/Spring/Spring.Core/Objects/Factory/Support/DefaultListableObjectFactory.cs
index b30915d7..8092101f 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/DefaultListableObjectFactory.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/DefaultListableObjectFactory.cs
@@ -217,16 +217,15 @@ namespace Spring.Objects.Factory.Support
///
/// In case of errors.
///
- protected override string[] GetDependingObjectNames(string objectName)
+ protected override IList GetDependingObjectNames(string objectName)
{
List dependingObjectNames = new List();
- string[] allObjectDefinitionNames = GetObjectDefinitionNames();
+ IList allObjectDefinitionNames = GetObjectDefinitionNames();
foreach (string name in allObjectDefinitionNames)
{
if (ContainsObjectDefinition(name))
{
- RootObjectDefinition rod
- = GetMergedObjectDefinition(name, false);
+ RootObjectDefinition rod = GetMergedObjectDefinition(name, false);
if (rod.DependsOn != null)
{
HashSet dependsOn = new HashSet(rod.DependsOn);
@@ -249,7 +248,7 @@ namespace Spring.Objects.Factory.Support
}
}
}
- return dependingObjectNames.ToArray();
+ return dependingObjectNames;
}
///
@@ -604,9 +603,9 @@ namespace Spring.Objects.Factory.Support
/// are defined.
///
///
- public string[] GetObjectDefinitionNames()
+ public IList GetObjectDefinitionNames()
{
- return objectDefinitionNames.ToArray();
+ return objectDefinitionNames;
}
///
@@ -622,7 +621,7 @@ namespace Spring.Objects.Factory.Support
/// are defined.
///
///
- public string[] GetObjectDefinitionNames(Type type)
+ public IList GetObjectDefinitionNames(Type type)
{
List matches = new List();
foreach (string name in objectDefinitionNames)
@@ -632,7 +631,7 @@ namespace Spring.Objects.Factory.Support
matches.Add(name);
}
}
- return matches.ToArray();
+ return matches;
}
///
@@ -648,7 +647,7 @@ namespace Spring.Objects.Factory.Support
/// are defined.
///
///
- public string[] GetObjectNamesForType(Type type)
+ public IList GetObjectNamesForType(Type type)
{
return GetObjectNamesForType(type, true, true);
}
@@ -676,7 +675,7 @@ namespace Spring.Objects.Factory.Support
/// The names of all objects defined in this factory, or an empty array if none
/// are defined.
///
- public string[] GetObjectNamesForType()
+ public IList GetObjectNames()
{
return GetObjectNamesForType(typeof (T));
}
@@ -702,10 +701,10 @@ namespace Spring.Objects.Factory.Support
/// are defined.
///
///
- public string[] GetObjectNamesForType(Type type, bool includePrototypes, bool includeFactoryObjects)
+ public IList GetObjectNamesForType(Type type, bool includePrototypes, bool includeFactoryObjects)
{
List objectNames = DoGetObjectNamesForType(type, includePrototypes, includeFactoryObjects);
- return objectNames.ToArray();
+ return objectNames;
}
///
@@ -743,7 +742,7 @@ namespace Spring.Objects.Factory.Support
/// The names of all objects defined in this factory, or an empty array if none
/// are defined.
///
- public string[] GetObjectNamesForType(bool includePrototypes, bool includeFactoryObjects)
+ public IList GetObjectNames(bool includePrototypes, bool includeFactoryObjects)
{
return GetObjectNamesForType(typeof (T), includePrototypes, includeFactoryObjects);
}
@@ -799,7 +798,7 @@ namespace Spring.Objects.Factory.Support
///
/// If the objects could not be created.
///
- public IDictionary GetObjectsOfType()
+ public IDictionary GetObjects()
{
Dictionary result = new Dictionary();
DoGetObjectsOfType(typeof (T), true, true, result);
@@ -896,7 +895,7 @@ namespace Spring.Objects.Factory.Support
///
/// If the objects could not be created.
///
- public IDictionary GetObjectsOfType(bool includePrototypes, bool includeFactoryObjects)
+ public IDictionary GetObjects(bool includePrototypes, bool includeFactoryObjects)
{
Dictionary result = new Dictionary();
DoGetObjectsOfType(typeof (T), includePrototypes, includeFactoryObjects, result);
@@ -934,13 +933,13 @@ namespace Spring.Objects.Factory.Support
///
public T GetObject()
{
- string[] objectNamesForType = GetObjectNamesForType(typeof(T));
- if ((objectNamesForType == null) || (objectNamesForType.Length == 0))
+ IList objectNamesForType = GetObjectNamesForType(typeof(T));
+ if ((objectNamesForType == null) || (objectNamesForType.Count == 0))
{
throw new NoSuchObjectDefinitionException(typeof(T).FullName, "Requested Type not Defined in the Context.");
}
- if (objectNamesForType.Length > 1)
+ if (objectNamesForType.Count > 1)
{
throw new ObjectDefinitionStoreException(string.Format("More than one definition for {0} found in the Context.", typeof(T).FullName));
}
@@ -975,7 +974,7 @@ namespace Spring.Objects.Factory.Support
protected List DoGetObjectNamesForType(Type type, bool includeNonSingletons, bool allowEagerInit)
{
List result = new List();
- string[] objectNames = GetObjectDefinitionNames();
+ IList objectNames = GetObjectDefinitionNames();
foreach (string s in objectNames)
{
string objectName = s;
@@ -1033,7 +1032,7 @@ namespace Spring.Objects.Factory.Support
}
// check singletons too, to catch manually registered singletons...
- string[] singletonNames = GetSingletonNames();
+ IList singletonNames = GetSingletonNames();
foreach (string s in singletonNames)
{
string objectName = s;
@@ -1170,9 +1169,9 @@ namespace Spring.Objects.Factory.Support
private IDictionary FindAutowireCandidates(string objectName, Type requiredType, DependencyDescriptor descriptor)
{
- string[] candidateNames =
+ IList candidateNames =
ObjectFactoryUtils.ObjectNamesForTypeIncludingAncestors(this, requiredType, true, descriptor.Eager);
- IDictionary result = new OrderedDictionary(candidateNames.Length);
+ IDictionary result = new OrderedDictionary(candidateNames.Count);
foreach (DictionaryEntry entry in resolvableDependencies)
{
@@ -1187,7 +1186,7 @@ namespace Spring.Objects.Factory.Support
}
}
}
- for (int i = 0; i < candidateNames.Length; i++)
+ for (int i = 0; i < candidateNames.Count; i++)
{
string candidateName = candidateNames[i];
if (!candidateName.Equals(objectName) && IsAutowireCandidate(candidateName, descriptor))
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/IConfigurableObjectDefinition.cs b/src/Spring/Spring.Core/Objects/Factory/Support/IConfigurableObjectDefinition.cs
index 008684c2..35429241 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/IConfigurableObjectDefinition.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/IConfigurableObjectDefinition.cs
@@ -21,6 +21,8 @@
#region Imports
using System;
+using System.Collections.Generic;
+
using Spring.Objects.Factory.Config;
#endregion
@@ -159,7 +161,7 @@ namespace Spring.Objects.Factory.Support
/// preparation on startup.
///
///
- new string[] DependsOn { get; set; }
+ new IList DependsOn { get; set; }
///
/// The name of the initializer method.
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/IObjectDefinitionRegistry.cs b/src/Spring/Spring.Core/Objects/Factory/Support/IObjectDefinitionRegistry.cs
index e80a6de7..25ca92cc 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/IObjectDefinitionRegistry.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/IObjectDefinitionRegistry.cs
@@ -20,6 +20,8 @@
#region Imports
+using System.Collections.Generic;
+
using Spring.Objects.Factory;
using Spring.Objects.Factory.Config;
@@ -69,7 +71,7 @@ namespace Spring.Objects.Factory.Support
/// The names of all objects defined in this registry, or an empty array
/// if none defined
///
- string [] GetObjectDefinitionNames ();
+ IList GetObjectDefinitionNames ();
///
/// Check if this registry contains a object definition with the given name.
@@ -126,25 +128,25 @@ namespace Spring.Objects.Factory.Support
/// If the object definition is invalid.
///
void RegisterObjectDefinition (string name, IObjectDefinition definition);
-
- ///
- /// Return the aliases for the given object name, if defined.
- ///
- /// the object name to check for aliases
- ///
- ///
- ///
- /// Will ask the parent factory if the object cannot be found in this
- /// factory instance.
- ///
- ///
- ///
- /// The aliases, or an empty array if none.
- ///
- ///
- /// If there's no such object definition.
- ///
- string [] GetAliases (string name);
+
+ ///
+ /// Return the aliases for the given object name, if defined.
+ ///
+ /// the object name to check for aliases
+ ///
+ ///
+ ///
+ /// Will ask the parent factory if the object cannot be found in this
+ /// factory instance.
+ ///
+ ///
+ ///
+ /// The aliases, or an empty array if none.
+ ///
+ ///
+ /// If there's no such object definition.
+ ///
+ IList GetAliases (string name);
///
/// Given a object name, create an alias. We typically use this method to
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/ObjectDefinitionBuilder.cs b/src/Spring/Spring.Core/Objects/Factory/Support/ObjectDefinitionBuilder.cs
index e3a9a068..49e80bae 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/ObjectDefinitionBuilder.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/ObjectDefinitionBuilder.cs
@@ -397,7 +397,7 @@ namespace Spring.Objects.Factory.Support
List arrayList = new List();
arrayList.AddRange(objectDefinition.DependsOn);
arrayList.AddRange(new string[]{ objectName});
- objectDefinition.DependsOn = arrayList.ToArray();
+ objectDefinition.DependsOn = arrayList;
}
return this;
}
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/ObjectDefinitionReaderUtils.cs b/src/Spring/Spring.Core/Objects/Factory/Support/ObjectDefinitionReaderUtils.cs
index 878cb901..613e33b4 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/ObjectDefinitionReaderUtils.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/ObjectDefinitionReaderUtils.cs
@@ -21,9 +21,9 @@
#region Imports
using System;
-using System.Text;
+using System.Collections.Generic;
using System.Text.RegularExpressions;
-using Spring.Objects.Factory;
+
using Spring.Objects.Factory.Config;
using Spring.Objects.Factory.Xml;
using Spring.Objects.Support;
@@ -96,8 +96,8 @@ namespace Spring.Objects.Factory.Support
AssertUtils.ArgumentNotNull(registry, "registry");
registry.RegisterObjectDefinition(objectDefinition.ObjectName, objectDefinition.ObjectDefinition);
- string[] aliases = objectDefinition.Aliases;
- for (int i = 0; i < aliases.Length; ++i)
+ IList aliases = objectDefinition.Aliases;
+ for (int i = 0; i < aliases.Count; ++i)
{
string alias = aliases[i];
registry.RegisterAlias(objectDefinition.ObjectName, alias);
diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/StaticListableObjectFactory.cs b/src/Spring/Spring.Core/Objects/Factory/Support/StaticListableObjectFactory.cs
index 03244397..445fbd52 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Support/StaticListableObjectFactory.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Support/StaticListableObjectFactory.cs
@@ -498,7 +498,7 @@ namespace Spring.Objects.Factory.Support
///
/// If there's no such object definition.
///
- public string[] GetAliases(string name)
+ public IList GetAliases(string name)
{
return StringUtils.EmptyStrings;
}
@@ -551,10 +551,10 @@ namespace Spring.Objects.Factory.Support
/// The names of all objects defined in this factory, or an empty array if none
/// are defined.
///
- public string[] GetObjectDefinitionNames()
+ public IList GetObjectDefinitionNames()
{
List names = new List(objects.Keys);
- return names.ToArray();
+ return names;
}
///
@@ -575,7 +575,7 @@ namespace Spring.Objects.Factory.Support
/// The names of all objects defined in this factory, or an empty array if none
/// are defined.
///
- public string[] GetObjectDefinitionNames(Type type)
+ public IList GetObjectDefinitionNames(Type type)
{
List matches = new List();
foreach (string name in objects.Keys)
@@ -586,7 +586,7 @@ namespace Spring.Objects.Factory.Support
matches.Add(name);
}
}
- return matches.ToArray();
+ return matches;
}
///
@@ -612,7 +612,7 @@ namespace Spring.Objects.Factory.Support
/// The names of all objects defined in this factory, or an empty array if none
/// are defined.
///
- public string[] GetObjectNamesForType(Type type)
+ public IList GetObjectNamesForType(Type type)
{
return GetObjectNamesForType(type, true, true);
}
@@ -640,7 +640,7 @@ namespace Spring.Objects.Factory.Support
/// The names of all objects defined in this factory, or an empty array if none
/// are defined.
///
- public string[] GetObjectNamesForType()
+ public IList GetObjectNames()
{
return GetObjectNamesForType(typeof(T));
}
@@ -674,8 +674,7 @@ namespace Spring.Objects.Factory.Support
/// are defined.
///
///
- public string[] GetObjectNamesForType(
- Type type, bool includePrototypes, bool includeFactoryObjects)
+ public IList GetObjectNamesForType(Type type, bool includePrototypes, bool includeFactoryObjects)
{
bool isFactoryType = (type != null && typeof(IFactoryObject).IsAssignableFrom(type));
List matches = new List();
@@ -701,7 +700,7 @@ namespace Spring.Objects.Factory.Support
}
}
}
- return matches.ToArray();
+ return matches;
}
///
@@ -739,7 +738,7 @@ namespace Spring.Objects.Factory.Support
/// The names of all objects defined in this factory, or an empty array if none
/// are defined.
///
- public string[] GetObjectNamesForType(bool includePrototypes, bool includeFactoryObjects)
+ public IList GetObjectNames(bool includePrototypes, bool includeFactoryObjects)
{
return GetObjectNamesForType(typeof(T), includePrototypes, includeFactoryObjects);
}
@@ -816,7 +815,7 @@ namespace Spring.Objects.Factory.Support
///
/// If the objects could not be created.
///
- public IDictionary GetObjectsOfType()
+ public IDictionary GetObjects()
{
Dictionary collector = new Dictionary();
DoGetObjectsOfType(typeof(T), true, true, collector);
@@ -917,7 +916,7 @@ namespace Spring.Objects.Factory.Support
///
/// If the objects could not be created.
///
- public IDictionary GetObjectsOfType(bool includePrototypes, bool includeFactoryObjects)
+ public IDictionary GetObjects(bool includePrototypes, bool includeFactoryObjects)
{
Dictionary collector = new Dictionary();
DoGetObjectsOfType(typeof(T), includeFactoryObjects, includePrototypes, collector);
@@ -955,13 +954,13 @@ namespace Spring.Objects.Factory.Support
///
public T GetObject()
{
- string[] objectNamesForType = GetObjectNamesForType(typeof(T));
- if ((objectNamesForType == null) || (objectNamesForType.Length == 0))
+ IList objectNamesForType = GetObjectNamesForType(typeof(T));
+ if ((objectNamesForType == null) || (objectNamesForType.Count == 0))
{
throw new NoSuchObjectDefinitionException(typeof(T).FullName, "Requested Type not Defined in the Context.");
}
- if (objectNamesForType.Length > 1)
+ if (objectNamesForType.Count > 1)
{
throw new ObjectDefinitionStoreException(string.Format("More than one definition for {0} found in the Context.", typeof(T).FullName));
}
diff --git a/src/Spring/Spring.Core/Objects/Factory/Xml/ObjectDefinitionParserHelper.cs b/src/Spring/Spring.Core/Objects/Factory/Xml/ObjectDefinitionParserHelper.cs
index b8fb31bc..d4a64c38 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Xml/ObjectDefinitionParserHelper.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Xml/ObjectDefinitionParserHelper.cs
@@ -322,8 +322,8 @@ namespace Spring.Objects.Factory.Xml
#endregion
}
- string[] aliasesArray = aliases.ToArray();
- return CreateObjectDefinitionHolder(element, definition, objectName, aliasesArray);
+
+ return CreateObjectDefinitionHolder(element, definition, objectName, aliases);
}
return null;
}
@@ -334,9 +334,9 @@ namespace Spring.Objects.Factory.Xml
///
/// This method may be used as a last resort to post-process an object definition before it gets added to the registry.
///
- protected virtual ObjectDefinitionHolder CreateObjectDefinitionHolder(XmlElement element, IConfigurableObjectDefinition definition, string objectName, string[] aliasesArray)
+ protected virtual ObjectDefinitionHolder CreateObjectDefinitionHolder(XmlElement element, IConfigurableObjectDefinition definition, string objectName, IList aliases)
{
- return new ObjectDefinitionHolder(definition, objectName, aliasesArray);
+ return new ObjectDefinitionHolder(definition, objectName, aliases);
}
///
diff --git a/src/Spring/Spring.Core/Objects/Factory/Xml/ObjectsNamespaceParser.cs b/src/Spring/Spring.Core/Objects/Factory/Xml/ObjectsNamespaceParser.cs
index f4644ebd..4f2a34a8 100644
--- a/src/Spring/Spring.Core/Objects/Factory/Xml/ObjectsNamespaceParser.cs
+++ b/src/Spring/Spring.Core/Objects/Factory/Xml/ObjectsNamespaceParser.cs
@@ -26,13 +26,11 @@ using System.Collections.Generic;
using System.Collections.Specialized;
using System.Globalization;
using System.IO;
-using System.Text;
using System.Xml;
-using System.Xml.Schema;
+
using Common.Logging;
using Spring.Collections;
-using Spring.Core;
using Spring.Core.IO;
using Spring.Core.TypeResolution;
using Spring.Objects.Factory.Config;
diff --git a/src/Spring/Spring.Core/Objects/IPropertyValues.cs b/src/Spring/Spring.Core/Objects/IPropertyValues.cs
index 34416d06..f9876ac3 100644
--- a/src/Spring/Spring.Core/Objects/IPropertyValues.cs
+++ b/src/Spring/Spring.Core/Objects/IPropertyValues.cs
@@ -21,6 +21,7 @@
#region Imports
using System.Collections;
+using System.Collections.Generic;
#endregion
@@ -41,7 +42,7 @@ namespace Spring.Objects
/// An array of the objects held
/// in this object.
///
- PropertyValue [] PropertyValues
+ IList PropertyValues
{
get;
}
diff --git a/src/Spring/Spring.Core/Objects/MutablePropertyValues.cs b/src/Spring/Spring.Core/Objects/MutablePropertyValues.cs
index e8833b7d..4583bd74 100644
--- a/src/Spring/Spring.Core/Objects/MutablePropertyValues.cs
+++ b/src/Spring/Spring.Core/Objects/MutablePropertyValues.cs
@@ -70,8 +70,8 @@ namespace Spring.Objects
/// s can be added with the various
/// overloaded ,
/// ,
- /// ,
- /// and
+ /// ,
+ /// and
/// methods.
///
///
@@ -96,7 +96,7 @@ namespace Spring.Objects
{
if (other != null)
{
- AddAll (other.PropertyValues);
+ AddAll(other.PropertyValues);
}
}
@@ -108,7 +108,7 @@ namespace Spring.Objects
/// The with property values
/// keyed by property name, which must be a .
///
- public MutablePropertyValues (IDictionary map)
+ public MutablePropertyValues (IDictionary map)
{
AddAll (map);
}
@@ -120,9 +120,9 @@ namespace Spring.Objects
///
/// Property to retrieve the array of property values.
///
- public PropertyValue[] PropertyValues
+ public IList PropertyValues
{
- get { return propertyValuesList.ToArray(); }
+ get { return propertyValuesList; }
}
#endregion
@@ -154,7 +154,7 @@ namespace Spring.Objects
{
for (int i = 0; i < propertyValuesList.Count; ++i)
{
- PropertyValue currentPv = (PropertyValue) propertyValuesList [i];
+ PropertyValue currentPv = propertyValuesList [i];
if (currentPv.Name.Equals (pv.Name))
{
pv = MergeIfRequired(pv, currentPv);
@@ -196,13 +196,13 @@ namespace Spring.Objects
/// The map of property values, the keys of which must be
/// s.
///
- public void AddAll (IDictionary map)
+ public void AddAll (IDictionary map)
{
if (map != null)
{
- foreach (string key in map.Keys)
+ foreach (KeyValuePair pair in map)
{
- Add (new PropertyValue (key, map [key]));
+ Add (new PropertyValue (pair.Key, pair.Value));
}
}
}
@@ -214,7 +214,7 @@ namespace Spring.Objects
///
/// The list of s to be added.
///
- public void AddAll (IList values)
+ public void AddAll(IList values)
{
if (values != null)
{
@@ -357,10 +357,10 @@ namespace Spring.Objects
///
public override string ToString ()
{
- PropertyValue[] pvs = PropertyValues;
+ IList pvs = PropertyValues;
StringBuilder sb
= new StringBuilder (
- "MutablePropertyValues: length=").Append (pvs.Length).Append ("; ");
+ "MutablePropertyValues: length=").Append (pvs.Count).Append ("; ");
sb.Append (StringUtils.ArrayToDelimitedString (pvs, ","));
return sb.ToString ();
}
diff --git a/src/Spring/Spring.Core/Objects/PropertyAccessExceptionsException.cs b/src/Spring/Spring.Core/Objects/PropertyAccessExceptionsException.cs
index 817e6d28..3a167f59 100644
--- a/src/Spring/Spring.Core/Objects/PropertyAccessExceptionsException.cs
+++ b/src/Spring/Spring.Core/Objects/PropertyAccessExceptionsException.cs
@@ -102,10 +102,7 @@ namespace Spring.Objects
: base(string.Empty)
{
_objectWrapper = objectWrapper;
- _propertyAccessExceptions
- = propertyAccessExceptions == null ?
- EmptyPropertyAccessExceptions :
- propertyAccessExceptions;
+ _propertyAccessExceptions = propertyAccessExceptions ?? EmptyPropertyAccessExceptions;
}
///
diff --git a/src/Spring/Spring.Core/Proxy/AbstractProxyTypeBuilder.cs b/src/Spring/Spring.Core/Proxy/AbstractProxyTypeBuilder.cs
index 93f8b50d..ea861e29 100644
--- a/src/Spring/Spring.Core/Proxy/AbstractProxyTypeBuilder.cs
+++ b/src/Spring/Spring.Core/Proxy/AbstractProxyTypeBuilder.cs
@@ -62,7 +62,7 @@ namespace Spring.Proxy
private string _name;
private Type _targetType;
private Type _baseType = typeof (object);
- private Type[] _interfaces;
+ private IList _interfaces;
private bool _proxyTargetAttributes = true;
private IList _typeAttributes = new ArrayList();
private IDictionary _memberAttributes = new Hashtable();
@@ -126,7 +126,7 @@ namespace Spring.Proxy
/// The default value of this property is all the interfaces
/// implemented or inherited by the target type.
///
- public Type[] Interfaces
+ public IList Interfaces
{
get
{
@@ -873,22 +873,22 @@ namespace Spring.Proxy
#endregion
- ///
- /// Returns an array of s that represent
- /// the proxiable interfaces.
- ///
- ///
- /// An interface is proxiable if it's not marked with the
- /// .
- ///
- ///
- /// The array of interfaces from which
- /// we want to get the proxiable interfaces.
- ///
- ///
- /// An array containing the interface s.
- ///
- protected virtual Type[] GetProxiableInterfaces(Type[] interfaces)
+ ///
+ /// Returns an array of s that represent
+ /// the proxiable interfaces.
+ ///
+ ///
+ /// An interface is proxiable if it's not marked with the
+ /// .
+ ///
+ ///
+ /// The array of interfaces from which
+ /// we want to get the proxiable interfaces.
+ ///
+ ///
+ /// An array containing the interface s.
+ ///
+ protected virtual IList GetProxiableInterfaces(IList interfaces)
{
List proxiableInterfaces = new List();
@@ -914,7 +914,7 @@ namespace Spring.Proxy
}
}
- return proxiableInterfaces.ToArray();
+ return proxiableInterfaces;
}
///
diff --git a/src/Spring/Spring.Core/Proxy/CompositionProxyTypeBuilder.cs b/src/Spring/Spring.Core/Proxy/CompositionProxyTypeBuilder.cs
index 9a0059ff..8e9ad773 100644
--- a/src/Spring/Spring.Core/Proxy/CompositionProxyTypeBuilder.cs
+++ b/src/Spring/Spring.Core/Proxy/CompositionProxyTypeBuilder.cs
@@ -102,7 +102,7 @@ namespace Spring.Proxy
///
public override Type BuildProxyType()
{
- if (Interfaces == null || Interfaces.Length == 0)
+ if (Interfaces == null || Interfaces.Count == 0)
{
throw new ArgumentException(
"Composition proxy target must implement at least one interface.");
diff --git a/src/Spring/Spring.Core/Proxy/IProxyTypeBuilder.cs b/src/Spring/Spring.Core/Proxy/IProxyTypeBuilder.cs
index f2cf8e2b..a88e8e6e 100644
--- a/src/Spring/Spring.Core/Proxy/IProxyTypeBuilder.cs
+++ b/src/Spring/Spring.Core/Proxy/IProxyTypeBuilder.cs
@@ -22,6 +22,7 @@
using System;
using System.Collections;
+using System.Collections.Generic;
#endregion
@@ -60,7 +61,7 @@ namespace Spring.Proxy
///
/// Gets or sets the list of interfaces proxy should implement.
///
- Type[] Interfaces { get; set; }
+ IList Interfaces { get; set; }
///
/// Should we proxy target attributes?
diff --git a/src/Spring/Spring.Core/Util/EventUtils.cs b/src/Spring/Spring.Core/Util/EventUtils.cs
index a3a71d6c..6d897724 100644
--- a/src/Spring/Spring.Core/Util/EventUtils.cs
+++ b/src/Spring/Spring.Core/Util/EventUtils.cs
@@ -47,14 +47,14 @@ namespace Spring.Util
get { return _eventExceptions.Count > 0; }
}
- public Delegate[] Sources
+ public IList Sources
{
- get { return new List(_eventExceptions.Keys).ToArray(); }
+ get { return new List(_eventExceptions.Keys); }
}
- public Exception[] Exceptions
+ public IList Exceptions
{
- get { return new List(_eventExceptions.Values).ToArray(); }
+ get { return new List(_eventExceptions.Values); }
}
public Exception this[Delegate source]
diff --git a/src/Spring/Spring.Core/Util/IEventExceptionsCollector.cs b/src/Spring/Spring.Core/Util/IEventExceptionsCollector.cs
index bf6cc365..710f1cf6 100644
--- a/src/Spring/Spring.Core/Util/IEventExceptionsCollector.cs
+++ b/src/Spring/Spring.Core/Util/IEventExceptionsCollector.cs
@@ -1,12 +1,13 @@
using System;
+using System.Collections.Generic;
namespace Spring.Util
{
public interface IEventExceptionsCollector
{
bool HasExceptions { get; }
- Delegate[] Sources { get;}
- Exception[] Exceptions { get; }
+ IList Sources { get;}
+ IList Exceptions { get; }
Exception this[Delegate source] { get; }
}
}
\ No newline at end of file
diff --git a/src/Spring/Spring.Core/Util/ReflectionUtils.cs b/src/Spring/Spring.Core/Util/ReflectionUtils.cs
index 625b59a3..a10f64bd 100644
--- a/src/Spring/Spring.Core/Util/ReflectionUtils.cs
+++ b/src/Spring/Spring.Core/Util/ReflectionUtils.cs
@@ -386,7 +386,7 @@ namespace Spring.Util
///
/// If more than 1 matching methods are found in the list.
///
- public static MethodInfo GetMethodByArgumentValues(MethodInfo[] methods, object[] argValues)
+ public static MethodInfo GetMethodByArgumentValues(IEnumerable methods, object[] argValues) where T : MethodBase
{
return (MethodInfo)GetMethodBaseByArgumentValues("method", methods, argValues);
}
@@ -401,8 +401,7 @@ namespace Spring.Util
///
/// If more than 1 matching methods are found in the list.
///
- private static MethodBase GetMethodBaseByArgumentValues(string methodTypeName, MethodBase[] methods,
- object[] argValues)
+ private static MethodBase GetMethodBaseByArgumentValues(string methodTypeName, IEnumerable methods, object[] argValues) where T : MethodBase
{
MethodBase match = null;
int matchCount = 0;
@@ -490,7 +489,7 @@ namespace Spring.Util
///
/// If more than 1 matching methods are found in the list.
///
- public static ConstructorInfo GetConstructorByArgumentValues(ConstructorInfo[] methods, object[] argValues)
+ public static ConstructorInfo GetConstructorByArgumentValues(IList methods, object[] argValues) where T : MethodBase
{
return (ConstructorInfo)GetMethodBaseByArgumentValues("constructor", methods, argValues);
}
@@ -540,7 +539,7 @@ namespace Spring.Util
///
/// If is .
///
- public static Type[] ToInterfaceArray(Type intf)
+ public static IList ToInterfaceArray(Type intf)
{
AssertUtils.ArgumentNotNull(intf, "intf");
@@ -555,7 +554,7 @@ namespace Spring.Util
List interfaces = new List(intf.GetInterfaces());
interfaces.Add(intf);
- return interfaces.ToArray();
+ return interfaces;
}
///
diff --git a/src/Spring/Spring.Core/Util/StringUtils.cs b/src/Spring/Spring.Core/Util/StringUtils.cs
index a0791ec4..a37c72a9 100644
--- a/src/Spring/Spring.Core/Util/StringUtils.cs
+++ b/src/Spring/Spring.Core/Util/StringUtils.cs
@@ -325,8 +325,8 @@ namespace Spring.Util
/// The delimiter to use (probably a ',').
///
/// The delimited string representation.
- public static string CollectionToDelimitedString(
- ICollection c, string delimiter)
+ public static string CollectionToDelimitedString(
+ IEnumerable c, string delimiter)
{
if (c == null)
{
@@ -354,8 +354,7 @@ namespace Spring.Util
/// The to display.
///
/// The delimited string representation.
- public static string CollectionToCommaDelimitedString(
- ICollection collection)
+ public static string CollectionToCommaDelimitedString(IEnumerable collection)
{
return CollectionToDelimitedString(collection, ",");
}
@@ -369,7 +368,7 @@ namespace Spring.Util
/// will be called on each
/// element).
///
- public static string ArrayToCommaDelimitedString(object[] source)
+ public static string ArrayToCommaDelimitedString(IEnumerable source)
{
return ArrayToDelimitedString(source, ",");
}
@@ -386,8 +385,7 @@ namespace Spring.Util
///
/// The delimiter to use (probably a ',').
///
- public static string ArrayToDelimitedString(
- object[] source, string delimiter)
+ public static string ArrayToDelimitedString(IEnumerable source, string delimiter)
{
if (source == null)
{
diff --git a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/Bytecode/ObjectsFactory.cs b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/Bytecode/ObjectsFactory.cs
index 209a8a95..21c44914 100644
--- a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/Bytecode/ObjectsFactory.cs
+++ b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/Bytecode/ObjectsFactory.cs
@@ -21,6 +21,7 @@
#region Imports
using System;
+using System.Collections.Generic;
using NHibernate.Bytecode;
@@ -53,8 +54,8 @@ namespace Spring.Data.NHibernate.Bytecode
/// A reference to the created object.
public object CreateInstance(Type type)
{
- string[] namesForType = listableObjectFactory.GetObjectNamesForType(type);
- return namesForType.Length > 0 ? listableObjectFactory.GetObject(namesForType[0], type) : Activator.CreateInstance(type);
+ IList namesForType = listableObjectFactory.GetObjectNamesForType(type);
+ return namesForType.Count > 0 ? listableObjectFactory.GetObject(namesForType[0], type) : Activator.CreateInstance(type);
}
///
@@ -64,8 +65,8 @@ namespace Spring.Data.NHibernate.Bytecode
/// A reference to the created object
public object CreateInstance(Type type, bool nonPublic)
{
- string[] namesForType = listableObjectFactory.GetObjectNamesForType(type);
- return namesForType.Length > 0 ? listableObjectFactory.GetObject(namesForType[0], type) : Activator.CreateInstance(type);
+ IList namesForType = listableObjectFactory.GetObjectNamesForType(type);
+ return namesForType.Count > 0 ? listableObjectFactory.GetObject(namesForType[0], type) : Activator.CreateInstance(type);
}
///
diff --git a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/Bytecode/ReflectionOptimizer.cs b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/Bytecode/ReflectionOptimizer.cs
index eb4c93e3..e8f48e86 100644
--- a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/Bytecode/ReflectionOptimizer.cs
+++ b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/Bytecode/ReflectionOptimizer.cs
@@ -21,6 +21,7 @@
#region Imports
using System;
+using System.Collections.Generic;
using NHibernate.Properties;
@@ -57,8 +58,8 @@ namespace Spring.Data.NHibernate.Bytecode
/// The new instance.
public override object CreateInstance()
{
- string[] namesForType = listableObjectFactory.GetObjectNamesForType(mappedType);
- if (namesForType.Length > 0)
+ IList namesForType = listableObjectFactory.GetObjectNamesForType(mappedType);
+ if (namesForType.Count > 0)
{
return listableObjectFactory.GetObject(namesForType[0], mappedType);
}
diff --git a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/LocalSessionFactoryObject.cs b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/LocalSessionFactoryObject.cs
index 00db9298..c87dfa35 100644
--- a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/LocalSessionFactoryObject.cs
+++ b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/LocalSessionFactoryObject.cs
@@ -610,7 +610,7 @@ namespace Spring.Data.NHibernate
// Register cache strategies for mapped entities.
foreach (string className in this.entityCacheStrategies.Keys)
{
- String[] strategyAndRegion = StringUtils.CommaDelimitedListToStringArray(this.entityCacheStrategies.GetProperty(className));
+ string[] strategyAndRegion = StringUtils.CommaDelimitedListToStringArray(this.entityCacheStrategies.GetProperty(className));
if (strategyAndRegion.Length > 1)
{
config.SetCacheConcurrencyStrategy(className, strategyAndRegion[0], strategyAndRegion[1]);
diff --git a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/SessionFactoryUtils.cs b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/SessionFactoryUtils.cs
index f160a3b5..0b8b1dcd 100644
--- a/src/Spring/Spring.Data.NHibernate/Data/NHibernate/SessionFactoryUtils.cs
+++ b/src/Spring/Spring.Data.NHibernate/Data/NHibernate/SessionFactoryUtils.cs
@@ -22,6 +22,8 @@
using System;
using System.Collections;
+using System.Collections.Generic;
+
using Common.Logging;
using NHibernate;
using NHibernate.Connection;
@@ -695,7 +697,7 @@ namespace Spring.Data.NHibernate
{
Type hibCommandType = db.CreateCommand().GetType();
- string[] providerNames = ctx.GetObjectNamesForType(typeof(DbProvider), true, false);
+ IList providerNames = ctx.GetObjectNamesForType(typeof(DbProvider), true, false);
string hibCommandAQN = hibCommandType.AssemblyQualifiedName;
foreach (string providerName in providerNames)
{
diff --git a/src/Spring/Spring.Data/Data/Common/DbProviderFactory.cs b/src/Spring/Spring.Data/Data/Common/DbProviderFactory.cs
index 699599ef..cf94a94f 100644
--- a/src/Spring/Spring.Data/Data/Common/DbProviderFactory.cs
+++ b/src/Spring/Spring.Data/Data/Common/DbProviderFactory.cs
@@ -19,6 +19,8 @@
#endregion
using System;
+using System.Collections.Generic;
+
using Common.Logging;
using Spring.Context;
using Spring.Context.Support;
@@ -143,10 +145,10 @@ namespace Spring.Data.Common
ctx = new XmlApplicationContext(DBPROVIDER_CONTEXTNAME, true, new string[] { DBPROVIDER_DEFAULT_RESOURCE_NAME });
}
- string[] dbProviderNames = ctx.GetObjectNamesForType(typeof(IDbProvider));
+ IList dbProviderNames = ctx.GetObjectNames();
if (log.IsInfoEnabled)
{
- log.Info(String.Format("{0} DbProviders Available. [{1}]", dbProviderNames.Length, StringUtils.ArrayToCommaDelimitedString(dbProviderNames)));
+ log.Info(String.Format("{0} DbProviders Available. [{1}]", dbProviderNames.Count, StringUtils.CollectionToCommaDelimitedString(dbProviderNames)));
}
}
catch (Exception e)
diff --git a/src/Spring/Spring.Data/Data/Core/AdoTemplate.cs b/src/Spring/Spring.Data/Data/Core/AdoTemplate.cs
index 8f1f81be..41433802 100644
--- a/src/Spring/Spring.Data/Data/Core/AdoTemplate.cs
+++ b/src/Spring/Spring.Data/Data/Core/AdoTemplate.cs
@@ -167,8 +167,7 @@ namespace Spring.Data.Core
{
throw new ArgumentException("DataReaderWrapper type must implement IDataReaderWrapper. Implemented interfaces on "
+ value.GetType().Name + "are [" +
- StringUtils.ArrayToCommaDelimitedString(
- ReflectionUtils.ToInterfaceArray(value)) + "]");
+ StringUtils.CollectionToCommaDelimitedString(ReflectionUtils.ToInterfaceArray(value)) + "]");
}
}
diff --git a/src/Spring/Spring.Data/Transaction/Interceptor/TransactionProxyFactoryObject.cs b/src/Spring/Spring.Data/Transaction/Interceptor/TransactionProxyFactoryObject.cs
index 703e893c..c4eaafab 100644
--- a/src/Spring/Spring.Data/Transaction/Interceptor/TransactionProxyFactoryObject.cs
+++ b/src/Spring/Spring.Data/Transaction/Interceptor/TransactionProxyFactoryObject.cs
@@ -21,6 +21,7 @@
#region Imports
using System;
+using System.Collections.Generic;
using System.Collections.Specialized;
using Spring.Aop;
@@ -71,7 +72,7 @@ namespace Spring.Transaction.Interceptor
{
private TransactionInterceptor _transactionInterceptor;
private object _target;
- private Type[] _proxyInterfaces;
+ private IList _proxyInterfaces;
private TruePointcut _pointcut;
private object[] _preInterceptors;
private object[] _postInterceptors;
diff --git a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/ChainedExceptionListener.cs b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/ChainedExceptionListener.cs
index 52229572..99a8ce2a 100644
--- a/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/ChainedExceptionListener.cs
+++ b/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Connections/ChainedExceptionListener.cs
@@ -63,9 +63,9 @@ namespace Spring.Messaging.Nms.Connections
/// Gets the exception listeners as an array.
///
/// The exception listeners.
- public IExceptionListener[] Listeners
+ public IList Listeners
{
- get { return listeners.ToArray(); }
+ get { return listeners; }
}
}
}
\ No newline at end of file
diff --git a/src/Spring/Spring.Messaging/Messaging/Core/DefaultMessageQueueFactory.cs b/src/Spring/Spring.Messaging/Messaging/Core/DefaultMessageQueueFactory.cs
index ed2edf31..a7bae9d9 100644
--- a/src/Spring/Spring.Messaging/Messaging/Core/DefaultMessageQueueFactory.cs
+++ b/src/Spring/Spring.Messaging/Messaging/Core/DefaultMessageQueueFactory.cs
@@ -67,7 +67,7 @@ namespace Spring.Messaging.Core
MessageQueueFactoryObject mqfo = new MessageQueueFactoryObject();
mqfo.MessageCreatorDelegate = messageQueueCreatorDelegate;
applicationContext.ObjectFactory.RegisterSingleton(messageQueueObjectName, mqfo);
- IDictionary caches = applicationContext.GetObjectsOfType();
+ IDictionary caches = applicationContext.GetObjects();
foreach (KeyValuePair entry in caches)
{
entry.Value.Insert(mqfo.Path, new MessageQueueMetadata(mqfo.RemoteQueue, mqfo.RemoteQueueIsTransactional));
diff --git a/src/Spring/Spring.Messaging/Messaging/Core/MessageQueueMetadataCache.cs b/src/Spring/Spring.Messaging/Messaging/Core/MessageQueueMetadataCache.cs
index 9b24f450..86799a2b 100644
--- a/src/Spring/Spring.Messaging/Messaging/Core/MessageQueueMetadataCache.cs
+++ b/src/Spring/Spring.Messaging/Messaging/Core/MessageQueueMetadataCache.cs
@@ -40,7 +40,7 @@ namespace Spring.Messaging.Core
public void Initialize()
{
- IDictionary messageQueueDictionary = configurableApplicationContext.GetObjectsOfType();
+ IDictionary messageQueueDictionary = configurableApplicationContext.GetObjects();
lock (itemStore.SyncRoot)
{
foreach (KeyValuePair entry in messageQueueDictionary)
diff --git a/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/QuartzJobObject.cs b/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/QuartzJobObject.cs
index 54b6753f..e6dd48a3 100644
--- a/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/QuartzJobObject.cs
+++ b/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/QuartzJobObject.cs
@@ -13,6 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+using System.Collections;
+
using Quartz;
using Spring.Objects;
@@ -68,8 +71,14 @@ namespace Spring.Scheduling.Quartz
{
ObjectWrapper bw = new ObjectWrapper(this);
MutablePropertyValues pvs = new MutablePropertyValues();
- pvs.AddAll(context.Scheduler.Context);
- pvs.AddAll(context.MergedJobDataMap);
+ foreach (DictionaryEntry entry in context.Scheduler.Context)
+ {
+ pvs.Add(entry.Key.ToString(), entry.Value);
+ }
+ foreach (DictionaryEntry entry in context.MergedJobDataMap)
+ {
+ pvs.Add(entry.Key.ToString(), entry.Value);
+ }
bw.SetPropertyValues(pvs, true);
}
catch (SchedulerException ex)
diff --git a/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SchedulerAccessorObject.cs b/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SchedulerAccessorObject.cs
index eff543f7..b30be10e 100644
--- a/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SchedulerAccessorObject.cs
+++ b/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SchedulerAccessorObject.cs
@@ -15,6 +15,7 @@
*/
using System;
+using System.Collections.Generic;
using Quartz;
using Quartz.Impl;
@@ -132,8 +133,8 @@ namespace Spring.Scheduling.Quartz
if (objectFactory is IListableObjectFactory)
{
IListableObjectFactory lbf = (IListableObjectFactory) objectFactory;
- string[] objectNames = lbf.GetObjectNamesForType(typeof(IScheduler));
- for (int i = 0; i < objectNames.Length; i++)
+ IList objectNames = lbf.GetObjectNamesForType(typeof(IScheduler));
+ for (int i = 0; i < objectNames.Count; i++)
{
IScheduler schedulerObject = (IScheduler)lbf.GetObject(objectNames[i]);
if (schedulerName.Equals(schedulerObject.SchedulerName))
diff --git a/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SpringObjectJobFactory.cs b/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SpringObjectJobFactory.cs
index a213566b..40e27460 100644
--- a/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SpringObjectJobFactory.cs
+++ b/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SpringObjectJobFactory.cs
@@ -13,6 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+using System.Collections;
+
using Quartz;
using Quartz.Spi;
using Spring.Objects;
@@ -76,10 +79,19 @@ namespace Spring.Scheduling.Quartz
MutablePropertyValues pvs = new MutablePropertyValues();
if (schedulerContext != null)
{
- pvs.AddAll(schedulerContext);
+ foreach (DictionaryEntry entry in schedulerContext)
+ {
+ pvs.Add(entry.Key.ToString(), entry.Value);
+ }
+ }
+ foreach (DictionaryEntry entry in bundle.JobDetail.JobDataMap)
+ {
+ pvs.Add(entry.Key.ToString(), entry.Value);
+ }
+ foreach (DictionaryEntry entry in bundle.Trigger.JobDataMap)
+ {
+ pvs.Add(entry.Key.ToString(), entry.Value);
}
- pvs.AddAll(bundle.JobDetail.JobDataMap);
- pvs.AddAll(bundle.Trigger.JobDataMap);
if (ignoredUnknownProperties != null)
{
for (int i = 0; i < ignoredUnknownProperties.Length; i++)
diff --git a/src/Spring/Spring.Services/ServiceModel/ServiceExporter.cs b/src/Spring/Spring.Services/ServiceModel/ServiceExporter.cs
index b9e83ff5..e6ebc108 100644
--- a/src/Spring/Spring.Services/ServiceModel/ServiceExporter.cs
+++ b/src/Spring/Spring.Services/ServiceModel/ServiceExporter.cs
@@ -22,6 +22,7 @@
using System;
using System.Collections;
+using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
using System.ServiceModel;
@@ -491,12 +492,12 @@ namespace Spring.ServiceModel
return attrs;
}
- protected override Type[] GetProxiableInterfaces(Type[] interfaces)
+ protected override IList GetProxiableInterfaces(IList interfaces)
{
if (contractInterface == null)
{
- Type[] proxiableInterfaces = base.GetProxiableInterfaces(interfaces);
- if (proxiableInterfaces.Length > 1)
+ IList proxiableInterfaces = base.GetProxiableInterfaces(interfaces);
+ if (proxiableInterfaces.Count > 1)
{
throw new ArgumentException(String.Format(
"ServiceExporter cannot export service type '{0}' as a WCF service because it implements multiple interfaces. Specify the contract interface to expose via the ContractInterface property.",
@@ -558,7 +559,7 @@ namespace Spring.ServiceModel
objectDefinition,
null, null);
- if (objectDefinition.PropertyValues.PropertyValues.Length == 0)
+ if (objectDefinition.PropertyValues.PropertyValues.Count == 0)
{
CustomAttributeBuilder cab = new CustomAttributeBuilder(ci.ConstructorInfo,
ci.ArgInstances);
diff --git a/src/Spring/Spring.Services/Web/Services/WebServiceProxyFactory.cs b/src/Spring/Spring.Services/Web/Services/WebServiceProxyFactory.cs
index 2bebfbef..6ad87df6 100644
--- a/src/Spring/Spring.Services/Web/Services/WebServiceProxyFactory.cs
+++ b/src/Spring/Spring.Services/Web/Services/WebServiceProxyFactory.cs
@@ -487,7 +487,7 @@ namespace Spring.Web.Services
/// The generated proxy class.
public override Type BuildProxyType()
{
- if (Interfaces == null || Interfaces.Length == 0)
+ if (Interfaces == null || Interfaces.Count == 0)
{
throw new ArgumentException(
"Web service client proxy must implement at least one interface.");
diff --git a/src/Spring/Spring.Template.Velocity/Template/Velocity/Config/TemplateNamespaceParser.cs b/src/Spring/Spring.Template.Velocity/Template/Velocity/Config/TemplateNamespaceParser.cs
index 8ecb2d52..0333de52 100644
--- a/src/Spring/Spring.Template.Velocity/Template/Velocity/Config/TemplateNamespaceParser.cs
+++ b/src/Spring/Spring.Template.Velocity/Template/Velocity/Config/TemplateNamespaceParser.cs
@@ -24,15 +24,14 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Xml;
+
using NVelocity.Runtime;
-using NVelocity.Runtime.Resource.Loader;
+
using Spring.Core.TypeResolution;
using Spring.Objects;
-using Spring.Objects.Factory;
using Spring.Objects.Factory.Config;
using Spring.Objects.Factory.Support;
using Spring.Objects.Factory.Xml;
-using Spring.Template.Velocity;
using Spring.Util;
#endregion
@@ -226,8 +225,9 @@ namespace Spring.Template.Velocity.Config {
/// a list of nv:file elements defining the paths to template files
/// the properties used to initialize the velocity engine
private void AppendFileLoaderProperties(XmlNodeList elements, IDictionary properties) {
- IList paths = new List(elements.Count);
- foreach (XmlElement element in elements) {
+ IList paths = new List(elements.Count);
+ foreach (XmlElement element in elements)
+ {
paths.Add(GetAttributeValue(element, VelocityConstants.Path));
}
properties.Add(RuntimeConstants.RESOURCE_LOADER, VelocityConstants.File);
@@ -241,7 +241,7 @@ namespace Spring.Template.Velocity.Config {
/// a list of nv:assembly elements defining the assemblies
/// the properties used to initialize the velocity engine
private void AppendAssemblyLoaderProperties(XmlNodeList elements, IDictionary properties) {
- IList assemblies = new List(elements.Count);
+ IList assemblies = new List(elements.Count);
foreach (XmlElement element in elements) {
assemblies.Add(GetAttributeValue(element, VelocityConstants.Name));
}
diff --git a/src/Spring/Spring.Template.Velocity/Template/Velocity/VelocityEngineFactory.cs b/src/Spring/Spring.Template.Velocity/Template/Velocity/VelocityEngineFactory.cs
index 1e19b372..71a53144 100644
--- a/src/Spring/Spring.Template.Velocity/Template/Velocity/VelocityEngineFactory.cs
+++ b/src/Spring/Spring.Template.Velocity/Template/Velocity/VelocityEngineFactory.cs
@@ -76,7 +76,7 @@ namespace Spring.Template.Velocity {
private IDictionary velocityProperties = new Dictionary();
- private IList resourceLoaderPaths = new ArrayList();
+ private IList resourceLoaderPaths = new List();
private IResourceLoader resourceLoader = new ConfigurableResourceLoader();
@@ -141,7 +141,8 @@ namespace Spring.Template.Velocity {
///
///
///
- public IList ResourceLoaderPaths {
+ public IList ResourceLoaderPaths
+ {
set { resourceLoaderPaths = value; }
}
@@ -287,12 +288,12 @@ namespace Spring.Template.Velocity {
///
///
///
- protected void InitVelocityResourceLoader(VelocityEngine velocityEngine, ExtendedProperties extendedProperties, IList paths) {
+ protected void InitVelocityResourceLoader(VelocityEngine velocityEngine, ExtendedProperties extendedProperties, IList paths) {
if (PreferFileSystemAccess) {
// Try to load via the file system, fall back to SpringResourceLoader
// (for hot detection of template changes, if possible).
- IList resolvedPaths = new ArrayList();
+ IList resolvedPaths = new List();
try {
foreach (string path in paths) {
IResource resource = ResourceLoader.GetResource(path);
diff --git a/src/Spring/Spring.Testing.Microsoft/Testing/Microsoft/AbstractSpringContextTests.cs b/src/Spring/Spring.Testing.Microsoft/Testing/Microsoft/AbstractSpringContextTests.cs
index ed1d3c36..dcffac9b 100644
--- a/src/Spring/Spring.Testing.Microsoft/Testing/Microsoft/AbstractSpringContextTests.cs
+++ b/src/Spring/Spring.Testing.Microsoft/Testing/Microsoft/AbstractSpringContextTests.cs
@@ -156,7 +156,7 @@ namespace Spring.Testing.Microsoft
}
if (contextKey is string[])
{
- return StringUtils.ArrayToCommaDelimitedString((string[]) contextKey);
+ return StringUtils.CollectionToCommaDelimitedString((string[])contextKey);
}
else
{
@@ -216,7 +216,7 @@ namespace Spring.Testing.Microsoft
{
if (logger.IsInfoEnabled)
{
- logger.Info("Loading config for: " + StringUtils.ArrayToCommaDelimitedString(locations));
+ logger.Info("Loading config for: " + StringUtils.CollectionToCommaDelimitedString(locations));
}
return new XmlApplicationContext(locations);
}
diff --git a/src/Spring/Spring.Testing.NUnit/Testing/NUnit/AbstractDependencyInjectionSpringContextTests.cs b/src/Spring/Spring.Testing.NUnit/Testing/NUnit/AbstractDependencyInjectionSpringContextTests.cs
index d5171402..e2eaa67b 100644
--- a/src/Spring/Spring.Testing.NUnit/Testing/NUnit/AbstractDependencyInjectionSpringContextTests.cs
+++ b/src/Spring/Spring.Testing.NUnit/Testing/NUnit/AbstractDependencyInjectionSpringContextTests.cs
@@ -19,13 +19,12 @@
#endregion
using System;
-using System.Collections;
+using System.Collections.Generic;
using System.Reflection;
using NUnit.Framework;
using Spring.Context;
-using Spring.Context.Support;
using Spring.Objects.Factory;
using Spring.Objects.Factory.Config;
using Spring.Objects.Factory.Support;
@@ -90,7 +89,7 @@ namespace Spring.Testing.NUnit
///
/// Holds names of the fields that should be used for field injection.
///
- protected string[] managedVariableNames;
+ protected IList managedVariableNames;
private int loadCount = 0;
///
@@ -231,7 +230,7 @@ namespace Spring.Testing.NUnit
///
protected virtual void InitManagedVariableNames()
{
- ArrayList managedVarNames = new ArrayList();
+ List managedVarNames = new List();
Type type = GetType();
do
@@ -273,7 +272,7 @@ namespace Spring.Testing.NUnit
type = type.BaseType;
} while (type != typeof (AbstractDependencyInjectionSpringContextTests));
- this.managedVariableNames = (string[]) managedVarNames.ToArray(typeof (string));
+ this.managedVariableNames = managedVarNames;
}
private static bool IsProtectedInstanceField(FieldInfo field)
@@ -286,7 +285,7 @@ namespace Spring.Testing.NUnit
///
protected virtual void InjectProtectedVariables()
{
- for (int i = 0; i < this.managedVariableNames.Length; i++)
+ for (int i = 0; i < this.managedVariableNames.Count; i++)
{
string fieldName = this.managedVariableNames[i];
Object obj = null;
diff --git a/src/Spring/Spring.Testing.NUnit/Testing/NUnit/AbstractSpringContextTests.cs b/src/Spring/Spring.Testing.NUnit/Testing/NUnit/AbstractSpringContextTests.cs
index 8cbde4e1..b0e6f1e4 100644
--- a/src/Spring/Spring.Testing.NUnit/Testing/NUnit/AbstractSpringContextTests.cs
+++ b/src/Spring/Spring.Testing.NUnit/Testing/NUnit/AbstractSpringContextTests.cs
@@ -166,7 +166,7 @@ namespace Spring.Testing.NUnit
}
if (contextKey is string[])
{
- return StringUtils.ArrayToCommaDelimitedString((string[]) contextKey);
+ return StringUtils.CollectionToCommaDelimitedString((string[])contextKey);
}
else
{
@@ -228,7 +228,7 @@ namespace Spring.Testing.NUnit
{
if (logger.IsInfoEnabled)
{
- logger.Info("Loading config for: " + StringUtils.ArrayToCommaDelimitedString(locations));
+ logger.Info("Loading config for: " + StringUtils.CollectionToCommaDelimitedString(locations));
}
return new XmlApplicationContext(locations);
}
diff --git a/src/Spring/Spring.Web/Context/Support/WebContextHandler.cs b/src/Spring/Spring.Web/Context/Support/WebContextHandler.cs
index 535a11d7..e6d05617 100644
--- a/src/Spring/Spring.Web/Context/Support/WebContextHandler.cs
+++ b/src/Spring/Spring.Web/Context/Support/WebContextHandler.cs
@@ -21,13 +21,12 @@
#region Imports
using System;
-using System.IO;
-using System.Reflection;
-using System.Web;
+using System.Collections.Generic;
using System.Web.Configuration;
-using System.Web.Hosting;
using System.Xml;
+
using Common.Logging;
+
using Spring.Util;
#endregion
@@ -86,11 +85,10 @@ namespace Spring.Context.Support
/// Nesting contexts in webapplications is done by explicitly declaring
/// spring context sections for each directory.
///
- protected override void CreateChildContexts(IApplicationContext parentContext, object configContext,
- XmlNode[] childContexts)
+ protected override void CreateChildContexts(IApplicationContext parentContext, object configContext, IList childContexts)
{
// disable child contexts in webapps
- if (childContexts.Length > 0)
+ if (childContexts.Count > 0)
{
throw ConfigurationUtils.CreateConfigurationException(
String.Format("Nested Child Contexts are not allowed in Web Applications. Use Web.config hierarchy instead."), childContexts[0]);
@@ -100,9 +98,7 @@ namespace Spring.Context.Support
///
/// Handles web specific details of context instantiation.
///
- protected override IApplicationContext InstantiateContext(IApplicationContext parent, object configContext,
- string contextName, Type contextType,
- bool caseSensitive, string[] resources)
+ protected override IApplicationContext InstantiateContext(IApplicationContext parent, object configContext, string contextName, Type contextType, bool caseSensitive, IList resources)
{
// ASP.NET may scavenge it's configuration section cache if memory usage is too high.
// Thus a handler may be called more than once for the same context.
@@ -124,8 +120,7 @@ namespace Spring.Context.Support
if (!vpath.EndsWith("/")) vpath = vpath + "/";
using (new HttpContextSwitch(vpath))
{
- return
- base.InstantiateContext(parent, configContext, contextName, contextType, caseSensitive, resources);
+ return base.InstantiateContext(parent, configContext, contextName, contextType, caseSensitive, resources);
}
}
diff --git a/src/Spring/Spring.Web/Objects/Factory/Xml/WebObjectDefinitionParserHelper.cs b/src/Spring/Spring.Web/Objects/Factory/Xml/WebObjectDefinitionParserHelper.cs
index 1ad9317a..7d24d72d 100644
--- a/src/Spring/Spring.Web/Objects/Factory/Xml/WebObjectDefinitionParserHelper.cs
+++ b/src/Spring/Spring.Web/Objects/Factory/Xml/WebObjectDefinitionParserHelper.cs
@@ -85,7 +85,7 @@ namespace Spring.Objects.Factory.Xml
return objectName;
}
- protected override ObjectDefinitionHolder CreateObjectDefinitionHolder(XmlElement element, IConfigurableObjectDefinition definition, string objectName, string[] aliasesArray)
+ protected override ObjectDefinitionHolder CreateObjectDefinitionHolder(XmlElement element, IConfigurableObjectDefinition definition, string objectName, IList aliasesArray)
{
IWebObjectDefinition webDefinition = definition as IWebObjectDefinition;
diff --git a/src/Spring/Spring.Web/Web/Support/ContextMonitor.cs b/src/Spring/Spring.Web/Web/Support/ContextMonitor.cs
index f1a55b80..1f2fc0c0 100644
--- a/src/Spring/Spring.Web/Web/Support/ContextMonitor.cs
+++ b/src/Spring/Spring.Web/Web/Support/ContextMonitor.cs
@@ -19,6 +19,7 @@
#endregion
using System;
+using System.Collections.Generic;
using System.IO;
using System.Web;
@@ -67,7 +68,7 @@ namespace Spring.Web.Support
"Implementations of IApplicationContext must also implement IConfigurableApplicationContext");
}
- string[] names = appContext.GetObjectDefinitionNames();
+ IList names = appContext.GetObjectDefinitionNames();
foreach (string name in names)
{
RenderObjectDefinition(res.Output, name, appContext.ObjectFactory.GetObjectDefinition(name));
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Config/AopNamespaceParserTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Config/AopNamespaceParserTests.cs
index 82e9ae41..69867053 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Config/AopNamespaceParserTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Config/AopNamespaceParserTests.cs
@@ -20,6 +20,8 @@
#region Imports
+using System.Collections.Generic;
+
using NUnit.Framework;
using Spring.Aop.Framework;
@@ -70,8 +72,8 @@ namespace Spring.Aop.Config
IAdvised advised = testObject as IAdvised;
Assert.IsNotNull(advised);
- IAdvisor[] advisors = advised.Advisors;
- Assert.IsTrue(advisors.Length > 0, "Advisors should not be empty");
+ IList advisors = advised.Advisors;
+ Assert.IsTrue(advisors.Count > 0, "Advisors should not be empty");
}
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/AbstractAdvisorAutoProxyCreatorTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/AbstractAdvisorAutoProxyCreatorTests.cs
index 0f9c5b22..fd412d51 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/AbstractAdvisorAutoProxyCreatorTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/AbstractAdvisorAutoProxyCreatorTests.cs
@@ -1,25 +1,26 @@
#region License
-/*
- * Copyright 2002-2010 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+/*
+ * Copyright 2002-2010 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
#endregion
using System;
using System.Collections;
+using System.Collections.Generic;
using AopAlliance.Aop;
using NUnit.Framework;
using Spring.Objects.Factory.Config;
@@ -37,7 +38,7 @@ namespace Spring.Aop.Framework.AutoProxy
{
public ArrayList CheckedAdvisors = new ArrayList();
- public object[] GetAdvicesAndAdvisorsForObject(Type targetType, string targetName)
+ public IList GetAdvicesAndAdvisorsForObject(Type targetType, string targetName)
{
return base.GetAdvicesAndAdvisorsForObject(targetType, targetName, null);
}
@@ -87,8 +88,8 @@ namespace Spring.Aop.Framework.AutoProxy
TestAdvisorAutoProxyCreator apc = new TestAdvisorAutoProxyCreator();
apc.ObjectFactory = of;
- object[] advisors = apc.GetAdvicesAndAdvisorsForObject(typeof (object), "dummyTarget");
- Assert.AreEqual(1, advisors.Length);
+ IList advisors = apc.GetAdvicesAndAdvisorsForObject(typeof (object), "dummyTarget");
+ Assert.AreEqual(1, advisors.Count);
Assert.AreEqual( "RegularAdvisor", ((TestAdvisor)advisors[0]).Name );
Assert.AreEqual(1, apc.CheckedAdvisors.Count);
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/AbstractAutoProxyCreatorTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/AbstractAutoProxyCreatorTests.cs
index 0730c08d..318a1928 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/AbstractAutoProxyCreatorTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/AbstractAutoProxyCreatorTests.cs
@@ -1,24 +1,25 @@
#region License
-/*
- * Copyright 2002-2010 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+/*
+ * Copyright 2002-2010 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
#endregion
using System;
+using System.Collections.Generic;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Proxies;
@@ -120,13 +121,13 @@ namespace Spring.Aop.Framework.AutoProxy
this.ObjectFactory = objectFactory;
}
- protected override object[] GetAdvicesAndAdvisorsForObject(Type targetType, string targetName, ITargetSource customTargetSource)
+ protected override IList GetAdvicesAndAdvisorsForObject(Type targetType, string targetName, ITargetSource customTargetSource)
{
if (typeof(IFactoryObject).IsAssignableFrom(targetType))
{
return DO_NOT_PROXY;
}
- return new object[] { NopInterceptor };
+ return new List { NopInterceptor };
}
}
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/AdvisorAutoProxyCreatorCircularReferencesTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/AdvisorAutoProxyCreatorCircularReferencesTests.cs
index 194208e5..6598d9ef 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/AdvisorAutoProxyCreatorCircularReferencesTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/AdvisorAutoProxyCreatorCircularReferencesTests.cs
@@ -21,6 +21,7 @@
#region Imports
using System;
+using System.Collections.Generic;
using System.Reflection;
using Common.Logging;
@@ -93,10 +94,10 @@ namespace Spring.Aop.Framework.AutoProxy
_logger.Trace("Created instance");
}
- protected override object[] GetAdvicesAndAdvisorsForObject(Type targetType, string targetName, ITargetSource customTargetSource)
+ protected override IList GetAdvicesAndAdvisorsForObject(Type targetType, string targetName, ITargetSource customTargetSource)
{
_logger.Trace("GetAdvicesAndAdvisorsForObject begin");
- object[] advices = base.GetAdvicesAndAdvisorsForObject(targetType, targetName, customTargetSource);
+ IList advices = base.GetAdvicesAndAdvisorsForObject(targetType, targetName, customTargetSource);
_logger.Trace("GetAdvicesAndAdvisorsForObject end");
return advices;
}
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/InfrastructureAdvisorAutoProxyCreator.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/InfrastructureAdvisorAutoProxyCreator.cs
index 4fa6fe12..0617325a 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/InfrastructureAdvisorAutoProxyCreator.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/AutoProxy/InfrastructureAdvisorAutoProxyCreator.cs
@@ -1,24 +1,25 @@
#region License
-/*
- * Copyright 2002-2010 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+/*
+ * Copyright 2002-2010 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
#endregion
using System;
+using System.Collections.Generic;
using AopAlliance.Aop;
using NUnit.Framework;
using Spring.Objects.Factory.Config;
@@ -34,7 +35,7 @@ namespace Spring.Aop.Framework.AutoProxy
{
public class TestAdvisorAutoProxyCreator : InfrastructureAdvisorAutoProxyCreator
{
- public object[] GetAdvicesAndAdvisorsForObject(Type targetType, string targetName)
+ public IList GetAdvicesAndAdvisorsForObject(Type targetType, string targetName)
{
return base.GetAdvicesAndAdvisorsForObject(targetType, targetName, null);
}
@@ -78,8 +79,8 @@ namespace Spring.Aop.Framework.AutoProxy
TestAdvisorAutoProxyCreator apc = new TestAdvisorAutoProxyCreator();
apc.ObjectFactory = of;
- object[] advisors = apc.GetAdvicesAndAdvisorsForObject(typeof(object), "dummyTarget");
- Assert.AreEqual(1, advisors.Length);
+ IList advisors = apc.GetAdvicesAndAdvisorsForObject(typeof(object), "dummyTarget");
+ Assert.AreEqual(1, advisors.Count);
Assert.AreEqual("InfrastructureAdvisor", ((TestAdvisor)advisors[0]).Name);
}
}
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/AbstractAopProxyTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/AbstractAopProxyTests.cs
index fd2f7138..0d5c0b55 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/AbstractAopProxyTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/DynamicProxy/AbstractAopProxyTests.cs
@@ -1222,7 +1222,7 @@ namespace Spring.Aop.Framework.DynamicProxy
IAdvised a1 = (IAdvised)p;
IAdvised a2 = (IAdvised)p2;
// Check we can manipulate state of p2
- Assert.AreEqual(a1.Advisors.Length, a2.Advisors.Length);
+ Assert.AreEqual(a1.Advisors.Count, a2.Advisors.Count);
// This should work as SerializablePerson is equal
Assert.AreEqual(p, p2, "Proxies should be equal, even after one was serialized");
@@ -1706,7 +1706,7 @@ namespace Spring.Aop.Framework.DynamicProxy
Assert.AreEqual(2, ni.Count);
IAdvised advised = (IAdvised)ito;
- Assert.AreEqual(1, advised.Advisors.Length, "Have 1 advisor");
+ Assert.AreEqual(1, advised.Advisors.Count, "Have 1 advisor");
Assert.AreEqual(ni, advised.Advisors[0].Advice);
NopInterceptor ni2 = new NopInterceptor();
advised.AddAdvice(1, ni2);
@@ -1750,7 +1750,7 @@ namespace Spring.Aop.Framework.DynamicProxy
// Check it still works: proxy factory state shouldn't have been corrupted
Assert.AreEqual(target.Age, proxied.Age);
- Assert.AreEqual(1, ((IAdvised)proxied).Advisors.Length);
+ Assert.AreEqual(1, ((IAdvised)proxied).Advisors.Count);
}
[Test(Description = "Check that casting to Advised can't get around advice freeze.")]
@@ -1778,7 +1778,7 @@ namespace Spring.Aop.Framework.DynamicProxy
// Check it still works: proxy factory state shouldn't have been corrupted
Assert.AreEqual(target.Age, proxied.Age);
- Assert.AreEqual(1, advised.Advisors.Length);
+ Assert.AreEqual(1, advised.Advisors.Count);
}
[Test]
@@ -1805,13 +1805,13 @@ namespace Spring.Aop.Framework.DynamicProxy
}
// Didn't get removed
- Assert.AreEqual(1, advised.Advisors.Length);
+ Assert.AreEqual(1, advised.Advisors.Count);
pf.IsFrozen = false;
// Can now remove it
advised.RemoveAdvisor(0);
// Check it still works: proxy factory state shouldn't have been corrupted
Assert.AreEqual(target.Age, proxied.Age);
- Assert.AreEqual(0, advised.Advisors.Length);
+ Assert.AreEqual(0, advised.Advisors.Count);
}
[Test(Description = "Check that the string is informative.")]
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryObjectTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryObjectTests.cs
index 31cb7b55..de3b5d0d 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryObjectTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryObjectTests.cs
@@ -154,11 +154,11 @@ namespace Spring.Aop.Framework
IAdvised pc1 = (IAdvised)test1;
IAdvised pc2 = (IAdvised)test1_1;
Assert.AreEqual(pc1.Advisors, pc2.Advisors);
- int oldLength = pc1.Advisors.Length;
+ int oldLength = pc1.Advisors.Count;
NopInterceptor di = new NopInterceptor();
pc1.AddAdvice(1, di);
Assert.AreEqual(pc1.Advisors, pc2.Advisors);
- Assert.AreEqual(oldLength + 1, pc2.Advisors.Length, "Now have one more advisor");
+ Assert.AreEqual(oldLength + 1, pc2.Advisors.Count, "Now have one more advisor");
Assert.AreEqual(di.Count, 0);
test1.Age = (5);
Assert.AreEqual(test1_1.Age, test1.Age);
@@ -224,12 +224,12 @@ namespace Spring.Aop.Framework
string dummy = to.Name;
IAdvised config = (IAdvised)to;
- Assert.AreEqual(1, config.Advisors.Length, "Object should have only one advisors");
+ Assert.AreEqual(1, config.Advisors.Count, "Object should have only one advisors");
Exception ex = new NotSupportedException("Invoke");
// Add evil interceptor to head of list
config.AddAdvice(0, new EvilMethodInterceptor(ex));
- Assert.AreEqual(2, config.Advisors.Length, "The advisor count is wrong after adding an advisor programmatically.");
+ Assert.AreEqual(2, config.Advisors.Count, "The advisor count is wrong after adding an advisor programmatically.");
try
{
@@ -266,16 +266,16 @@ namespace Spring.Aop.Framework
IIntroductionAdvisor advisor = new DefaultIntroductionAdvisor(ti, typeof(ITimeStamped));
// add to front of introduction chain
- int oldCount = config.Introductions.Length;
+ int oldCount = config.Introductions.Count;
config.AddIntroduction(0, advisor);
- Assert.IsTrue(config.Introductions.Length == oldCount + 1);
+ Assert.IsTrue(config.Introductions.Count == oldCount + 1);
ITimeStamped ts2 = (ITimeStamped)factory.GetObject("test1");
Assert.IsTrue(ts2.TimeStamp == new DateTime(time));
// Can remove
config.RemoveIntroduction(advisor);
- Assert.IsTrue(config.Introductions.Length == oldCount);
+ Assert.IsTrue(config.Introductions.Count == oldCount);
// Existing reference will still work
object o = ts2.TimeStamp;
@@ -292,9 +292,9 @@ namespace Spring.Aop.Framework
}
// Now check non-effect of removing interceptor that isn't there
- oldCount = config.Advisors.Length;
+ oldCount = config.Advisors.Count;
config.RemoveAdvice(new DebugAdvice());
- Assert.IsTrue(config.Advisors.Length == oldCount);
+ Assert.IsTrue(config.Advisors.Count == oldCount);
ITestObject it = (ITestObject)ts2;
DebugAdvice debugInterceptor = new DebugAdvice();
@@ -330,16 +330,16 @@ namespace Spring.Aop.Framework
IIntroductionAdvisor advisor = new DefaultIntroductionAdvisor(ti, typeof(ITimeStamped));
// add to front of introduction chain
- int oldCount = config.Introductions.Length;
+ int oldCount = config.Introductions.Count;
config.AddIntroduction(0, advisor);
- Assert.IsTrue(config.Introductions.Length == oldCount + 1);
+ Assert.IsTrue(config.Introductions.Count == oldCount + 1);
ITimeStamped ts2 = (ITimeStamped)factory.GetObject("test2");
Assert.IsTrue(ts2.TimeStamp == new DateTime(time));
// Can remove
config.RemoveIntroduction(advisor);
- Assert.IsTrue(config.Introductions.Length == oldCount);
+ Assert.IsTrue(config.Introductions.Count == oldCount);
// Existing reference will still work
object o = ts2.TimeStamp;
@@ -358,9 +358,9 @@ namespace Spring.Aop.Framework
ITestObject it = (ITestObject)factory.GetObject("test2");
config = (IAdvised)it;
- oldCount = config.Advisors.Length;
+ oldCount = config.Advisors.Count;
config.RemoveAdvice(new DebugAdvice());
- Assert.IsTrue(config.Advisors.Length == oldCount);
+ Assert.IsTrue(config.Advisors.Count == oldCount);
DebugAdvice debugInterceptor = new DebugAdvice();
config.AddAdvice(0, debugInterceptor);
@@ -462,10 +462,10 @@ namespace Spring.Aop.Framework
ProxyFactoryObject pfb = (ProxyFactoryObject)factory.GetObject("&validGlobals");
pfb.GetObject(); // for creation
- Assert.AreEqual(2, pfb.Advisors.Length, "Proxy should have 1 global and 1 explicit advisor");
- Assert.AreEqual(1, pfb.Introductions.Length, "Proxy should have 1 global introduction");
+ Assert.AreEqual(2, pfb.Advisors.Count, "Proxy should have 1 global and 1 explicit advisor");
+ Assert.AreEqual(1, pfb.Introductions.Count, "Proxy should have 1 global introduction");
- agi.GlobalsAdded = ((IAdvised)agi).Introductions.Length;
+ agi.GlobalsAdded = ((IAdvised)agi).Introductions.Count;
Assert.IsTrue(agi.GlobalsAdded == 1);
IApplicationEventListener l = (IApplicationEventListener)factory.GetObject("validGlobals");
diff --git a/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryTests.cs b/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryTests.cs
index e4333a08..a2b2b673 100644
--- a/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryTests.cs
+++ b/test/Spring/Spring.Aop.Tests/Aop/Framework/ProxyFactoryTests.cs
@@ -399,7 +399,7 @@ namespace Spring.Aop.Framework
advSup.AddAdvisor(advisor1);
advSup.AddAdvisor(advisor1);
- Assert.AreEqual(1, advSup.Advisors.Length);
+ Assert.AreEqual(1, advSup.Advisors.Count);
}
private class AnonymousClassTimeStamped : ITimeStamped
@@ -454,7 +454,7 @@ namespace Spring.Aop.Framework
// Extend to get new interface
TestObjectSubclass raw = new TestObjectSubclass();
ProxyFactory factory = new ProxyFactory(raw);
- Assert.AreEqual(8, factory.Interfaces.Length, "Found correct number of interfaces");
+ Assert.AreEqual(8, factory.Interfaces.Count, "Found correct number of interfaces");
//System.out.println("Proxied interfaces are " + StringUtils.arrayToDelimitedString(factory.getProxiedInterfaces(), ","));
ITestObject tb = (ITestObject)factory.GetProxy();
Assert.IsTrue(tb is IOther, "Picked up secondary interface");
@@ -465,14 +465,14 @@ namespace Spring.Aop.Framework
DateTime t = new DateTime(2004, 8, 1);
TimestampIntroductionInterceptor ti = new TimestampIntroductionInterceptor(t);
- Console.WriteLine(StringUtils.ArrayToDelimitedString(factory.Interfaces, "/"));
+ Console.WriteLine(StringUtils.CollectionToDelimitedString(factory.Interfaces, "/"));
//factory.addAdvisor(0, new DefaultIntroductionAdvisor(ti, typeof(ITimeStamped)));
factory.AddIntroduction(
new DefaultIntroductionAdvisor(ti, typeof(ITimeStamped))
);
- Console.WriteLine(StringUtils.ArrayToDelimitedString(factory.Interfaces, "/"));
+ Console.WriteLine(StringUtils.CollectionToDelimitedString(factory.Interfaces, "/"));
ITimeStamped ts = (ITimeStamped)factory.GetProxy();
Assert.IsTrue(ts.TimeStamp == t);
diff --git a/test/Spring/Spring.Aop.Tests/Aspects/Exception/CaptureOutputLoggerFactoryAdapter.cs b/test/Spring/Spring.Aop.Tests/Aspects/Exception/CaptureOutputLoggerFactoryAdapter.cs
index a3e999af..47544653 100644
--- a/test/Spring/Spring.Aop.Tests/Aspects/Exception/CaptureOutputLoggerFactoryAdapter.cs
+++ b/test/Spring/Spring.Aop.Tests/Aspects/Exception/CaptureOutputLoggerFactoryAdapter.cs
@@ -1,9 +1,9 @@
using System;
-using System.Collections;
-using System.Collections.Specialized;
+using System.Collections.Generic;
using System.Diagnostics;
+
using Common.Logging;
using Common.Logging.Simple;
@@ -44,9 +44,9 @@ namespace Spring.Aspects.Exceptions
System.Diagnostics.Trace.Listeners.Remove(listener);
}
- private IList logMessages = new ArrayList();
+ private IList logMessages = new List();
- public IList LogMessages
+ public IList LogMessages
{
get { return logMessages; }
set { logMessages = value; }
diff --git a/test/Spring/Spring.Core.Tests/Context/Support/ApplicationObjectSupportTests.cs b/test/Spring/Spring.Core.Tests/Context/Support/ApplicationObjectSupportTests.cs
index fbac52d7..b2141921 100644
--- a/test/Spring/Spring.Core.Tests/Context/Support/ApplicationObjectSupportTests.cs
+++ b/test/Spring/Spring.Core.Tests/Context/Support/ApplicationObjectSupportTests.cs
@@ -119,28 +119,27 @@ namespace Spring.Context.Support
return null;
}
- public string[] GetObjectNamesForType(Type type)
+ public IList GetObjectNamesForType(Type type)
{
return null;
}
- public string[] GetObjectNamesForType()
+ public IList GetObjectNames()
{
return null;
}
- public string[] GetObjectNamesForType(
- Type type, bool includePrototypes, bool includeFactoryObjects)
+ public IList GetObjectNamesForType(Type type, bool includePrototypes, bool includeFactoryObjects)
{
return null;
}
- public string[] GetObjectNamesForType(bool includePrototypes, bool includeFactoryObjects)
+ public IList GetObjectNames(bool includePrototypes, bool includeFactoryObjects)
{
return null;
}
- string[] IListableObjectFactory.GetObjectDefinitionNames()
+ IList IListableObjectFactory.GetObjectDefinitionNames()
{
return null;
}
@@ -150,7 +149,7 @@ namespace Spring.Context.Support
return null;
}
- public IDictionary GetObjectsOfType()
+ public IDictionary GetObjects()
{
return null;
}
@@ -160,7 +159,7 @@ namespace Spring.Context.Support
return null;
}
- public IDictionary GetObjectsOfType(bool includePrototypes, bool includeFactoryObjects)
+ public IDictionary GetObjects(bool includePrototypes, bool includeFactoryObjects)
{
return null;
}
@@ -199,7 +198,7 @@ namespace Spring.Context.Support
return false;
}
- public string[] GetAliases(string name)
+ public IList GetAliases(string name)
{
return null;
}
diff --git a/test/Spring/Spring.Core.Tests/Core/TypeResolution/TypeResolutionUtilsTests.cs b/test/Spring/Spring.Core.Tests/Core/TypeResolution/TypeResolutionUtilsTests.cs
index 8d3bda36..c5f6ff5b 100644
--- a/test/Spring/Spring.Core.Tests/Core/TypeResolution/TypeResolutionUtilsTests.cs
+++ b/test/Spring/Spring.Core.Tests/Core/TypeResolution/TypeResolutionUtilsTests.cs
@@ -21,6 +21,7 @@
#region Imports
using System;
+using System.Collections.Generic;
using System.Reflection;
using NUnit.Framework;
@@ -75,9 +76,9 @@ namespace Spring.Core.TypeResolution
{
Type[] expected = new Type[] { typeof(IFoo) };
string[] input = new string[] { typeof(IFoo).AssemblyQualifiedName };
- Type[] actual = TypeResolutionUtils.ResolveInterfaceArray(input);
+ IList actual = TypeResolutionUtils.ResolveInterfaceArray(input);
Assert.IsNotNull(actual);
- Assert.AreEqual(expected.Length, actual.Length);
+ Assert.AreEqual(expected.Length, actual.Count);
Assert.AreEqual(expected[0], actual[0]);
}
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/AbstractListableObjectFactoryTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/AbstractListableObjectFactoryTests.cs
index 8e084fff..7868fb2f 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/AbstractListableObjectFactoryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/AbstractListableObjectFactoryTests.cs
@@ -21,6 +21,7 @@
#region Imports
using System;
+using System.Collections.Generic;
using NUnit.Framework;
@@ -62,10 +63,10 @@ namespace Spring.Objects.Factory {
protected internal void AssertCount (int count)
{
- string [] defnames = ListableObjectFactory.GetObjectDefinitionNames ();
+ IList defnames = ListableObjectFactory.GetObjectDefinitionNames ();
Assert.IsTrue (
- defnames.Length == count,
- string.Format ("We should have {0} objects, not {1}.", count, defnames.Length));
+ defnames.Count == count,
+ string.Format ("We should have {0} objects, not {1}.", count, defnames.Count));
}
[Test]
@@ -76,19 +77,19 @@ namespace Spring.Objects.Factory {
public virtual void AssertTestObjectCount (int count)
{
- string [] defnames =
+ IList defnames =
ListableObjectFactory.GetObjectNamesForType (typeof (TestObject));
Assert.IsTrue (
- defnames.Length == count,
- string.Format ("We should have {0} objects for class {1}, not {2}.", count, typeof (TestObject).FullName, defnames.Length));
+ defnames.Count == count,
+ string.Format ("We should have {0} objects for class {1}, not {2}.", count, typeof (TestObject).FullName, defnames.Count));
}
[Test]
public virtual void GetDefinitionsForNoSuchClass ()
{
- string[] defnames =
+ IList defnames =
ListableObjectFactory.GetObjectNamesForType (typeof (string));
- Assert.IsTrue (defnames.Length == 0, "No string definitions");
+ Assert.IsTrue (defnames.Count == 0, "No string definitions");
}
///
@@ -101,7 +102,7 @@ namespace Spring.Objects.Factory {
{
int count =
ListableObjectFactory.GetObjectNamesForType (
- typeof (IFactoryObject)).Length;
+ typeof (IFactoryObject)).Count;
Assert.IsTrue (
count == 2,
string.Format ("Should have 2 factories, not {0}.", count));
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/AbstractObjectFactoryTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/AbstractObjectFactoryTests.cs
index 3d0e8830..61b69a01 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/AbstractObjectFactoryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/AbstractObjectFactoryTests.cs
@@ -80,7 +80,7 @@ namespace Spring.Objects.Factory
Assert.IsTrue(-1 < ex.Message.IndexOf("already registered"));
}
- Assert.AreEqual(1, of.GetAliases("nAmE").Length);
+ Assert.AreEqual(1, of.GetAliases("nAmE").Count);
Assert.AreEqual(testObject, of.GetObject("nAmE"));
Assert.AreEqual(testObject, of.GetObject("ALIAS"));
}
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/DefaultListableObjectFactoryTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/DefaultListableObjectFactoryTests.cs
index 6457253e..c9b66d4f 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/DefaultListableObjectFactoryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/DefaultListableObjectFactoryTests.cs
@@ -146,7 +146,7 @@ namespace Spring.Objects.Factory
def.FactoryMethodName = "CreateTestObject";
DefaultListableObjectFactory lof = new DefaultListableObjectFactory();
lof.RegisterObjectDefinition("factoryObject", def);
- IDictionary objs = lof.GetObjectsOfType();
+ IDictionary objs = lof.GetObjects();
Assert.AreEqual(1, objs.Count);
}
@@ -160,7 +160,7 @@ namespace Spring.Objects.Factory
DefaultListableObjectFactory lof = new DefaultListableObjectFactory();
lof.RegisterObjectDefinition("factoryObject", def);
lof.RegisterObjectDefinition("target", new RootObjectDefinition(typeof(TestObjectCreator)));
- IDictionary objs = lof.GetObjectsOfType();
+ IDictionary objs = lof.GetObjects();
Assert.AreEqual(1, objs.Count);
}
@@ -404,8 +404,7 @@ namespace Spring.Objects.Factory
#region IInstantiationAwareObjectPostProcessor Members
- public IPropertyValues PostProcessPropertyValues(IPropertyValues pvs, PropertyInfo[] pis, object objectInstance,
- string objectName)
+ public IPropertyValues PostProcessPropertyValues(IPropertyValues pvs, IList pis, object objectInstance, string objectName)
{
return pvs;
}
@@ -455,8 +454,7 @@ namespace Spring.Objects.Factory
#region IInstantiationAwareObjectPostProcessor Members
- public IPropertyValues PostProcessPropertyValues(IPropertyValues pvs, PropertyInfo[] pis, object objectInstance,
- string objectName)
+ public IPropertyValues PostProcessPropertyValues(IPropertyValues pvs, IList pis, object objectInstance, string objectName)
{
return pvs;
}
@@ -532,7 +530,7 @@ namespace Spring.Objects.Factory
{
IListableObjectFactory lof = new DefaultListableObjectFactory();
Assert.IsTrue(lof.GetObjectDefinitionNames() != null, "No objects defined --> array != null");
- Assert.IsTrue(lof.GetObjectDefinitionNames().Length == 0, "No objects defined after no arg constructor");
+ Assert.IsTrue(lof.GetObjectDefinitionNames().Count == 0, "No objects defined after no arg constructor");
Assert.IsTrue(lof.ObjectDefinitionCount == 0, "No objects defined after no arg constructor");
}
@@ -640,7 +638,7 @@ namespace Spring.Objects.Factory
lof.RegisterSingleton("singletonObject", singletonObject);
Assert.IsTrue(lof.ContainsObject("singletonObject"));
Assert.IsTrue(lof.IsSingleton("singletonObject"));
- Assert.AreEqual(0, lof.GetAliases("singletonObject").Length);
+ Assert.AreEqual(0, lof.GetAliases("singletonObject").Count);
DependenciesObject test = (DependenciesObject)lof.GetObject("test");
Assert.AreEqual(singletonObject, lof.GetObject("singletonObject"));
Assert.AreEqual(singletonObject, test.Spouse);
@@ -1751,8 +1749,8 @@ namespace Spring.Objects.Factory
DefaultListableObjectFactory of = new DefaultListableObjectFactory();
of.RegisterObjectDefinition("mod", new RootObjectDefinition(typeof(A)));
- string[] names = of.GetObjectNamesForType(typeof (ISerializable), false, false);
- Assert.IsNotEmpty(names);
+ IList names = of.GetObjectNamesForType(typeof (ISerializable), false, false);
+ Assert.IsNotEmpty((ICollection) names);
Assert.AreEqual("&mod", names[0]);
}
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/ObjectFactoryUtilsTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/ObjectFactoryUtilsTests.cs
index c3471d00..1b138e43 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/ObjectFactoryUtilsTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/ObjectFactoryUtilsTests.cs
@@ -72,7 +72,7 @@ namespace Spring.Objects.Factory
[Test]
public void ObjectNamesIncludingAncestors()
{
- IList names = ObjectFactoryUtils.ObjectNamesIncludingAncestors(_factory);
+ IList names = ObjectFactoryUtils.ObjectNamesIncludingAncestors(_factory);
Assert.AreEqual(6, names.Count);
}
@@ -89,8 +89,8 @@ namespace Spring.Objects.Factory
mocks.ReplayAll();
- string[] names = ObjectFactoryUtils.ObjectNamesIncludingAncestors(of);
- Assert.AreEqual(5, names.Length);
+ IList names = ObjectFactoryUtils.ObjectNamesIncludingAncestors(of);
+ Assert.AreEqual(5, names.Count);
Assert.AreEqual(new string[] { "objA","objB","objC","obj2A","obj2C" }, names);
mocks.VerifyAll();
@@ -99,7 +99,7 @@ namespace Spring.Objects.Factory
[Test]
public void ObjectNamesForTypeIncludingAncestors()
{
- IList names = ObjectFactoryUtils.ObjectNamesForTypeIncludingAncestors(_factory, typeof (ITestObject));
+ IList names = ObjectFactoryUtils.ObjectNamesForTypeIncludingAncestors(_factory, typeof (ITestObject));
// includes 2 TestObjects from IFactoryObjects (DummyFactory definitions)
Assert.AreEqual(4, names.Count);
Assert.IsTrue(names.Contains("test"));
@@ -116,7 +116,7 @@ namespace Spring.Objects.Factory
DefaultListableObjectFactory child = new DefaultListableObjectFactory(root);
child.RegisterObjectDefinition("excludeLocalObject", new RootObjectDefinition(typeof(Hashtable)));
- IList names = ObjectFactoryUtils.ObjectNamesForTypeIncludingAncestors(child, typeof (ArrayList));
+ IList names = ObjectFactoryUtils.ObjectNamesForTypeIncludingAncestors(child, typeof (ArrayList));
// "excludeLocalObject" matches on the parent, but not the local object definition
Assert.AreEqual(0, names.Count);
@@ -139,8 +139,8 @@ namespace Spring.Objects.Factory
mocks.ReplayAll();
- string[] names = ObjectFactoryUtils.ObjectNamesForTypeIncludingAncestors(of, EXPECTEDTYPE);
- Assert.AreEqual(5, names.Length);
+ IList names = ObjectFactoryUtils.ObjectNamesForTypeIncludingAncestors(of, EXPECTEDTYPE);
+ Assert.AreEqual(5, names.Count);
Assert.AreEqual(new string[] { "objA", "objB", "objC", "obj2A", "obj2C" }, names);
mocks.VerifyAll();
@@ -160,8 +160,8 @@ namespace Spring.Objects.Factory
mocks.ReplayAll();
- string[] names = ObjectFactoryUtils.ObjectNamesForTypeIncludingAncestors(of, EXPECTEDTYPE, false, false);
- Assert.AreEqual(5, names.Length);
+ IList names = ObjectFactoryUtils.ObjectNamesForTypeIncludingAncestors(of, EXPECTEDTYPE, false, false);
+ Assert.AreEqual(5, names.Count);
Assert.AreEqual(new string[] { "objA", "objB", "objC", "obj2A", "obj2C" }, names);
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ChildObjectDefinitionTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ChildObjectDefinitionTests.cs
index b90a3c58..5cd5d457 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ChildObjectDefinitionTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/ChildObjectDefinitionTests.cs
@@ -65,7 +65,7 @@ namespace Spring.Objects.Factory.Support
"ParentName property not initialized correctly by ctor.");
Assert.IsNotNull(def.PropertyValues,
"PropertyValues must be init'd to a non-null collection if not explicitly supplied.");
- Assert.AreEqual(0, def.PropertyValues.PropertyValues.Length,
+ Assert.AreEqual(0, def.PropertyValues.PropertyValues.Count,
"PropertyValues must be init'd to an empty collection if not explicitly supplied.");
}
}
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/DefaultObjectDefinitionFactoryTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/DefaultObjectDefinitionFactoryTests.cs
index ecb3e754..7666373d 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/DefaultObjectDefinitionFactoryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/DefaultObjectDefinitionFactoryTests.cs
@@ -44,7 +44,7 @@ namespace Spring.Objects.Factory.Support
typeof (TestObject).FullName, null, AppDomain.CurrentDomain);
Assert.IsNotNull(definition, "CreateObjectDefinition with no parent is returning null (it must never do so).");
Assert.AreEqual(typeof (TestObject), definition.ObjectType);
- Assert.AreEqual(0, definition.PropertyValues.PropertyValues.Length,
+ Assert.AreEqual(0, definition.PropertyValues.PropertyValues.Count,
"Must not have any property values as none were passed in.");
Assert.AreEqual(0, definition.ConstructorArgumentValues.ArgumentCount,
"Must not have any ctor args as none were passed in.");
@@ -59,7 +59,7 @@ namespace Spring.Objects.Factory.Support
typeof (TestObject).FullName, "Aimee Mann", AppDomain.CurrentDomain);
Assert.IsNotNull(definition, "CreateObjectDefinition with no parent is returning null (it must never do so).");
Assert.AreEqual(typeof (TestObject), definition.ObjectType);
- Assert.AreEqual(0, definition.PropertyValues.PropertyValues.Length,
+ Assert.AreEqual(0, definition.PropertyValues.PropertyValues.Count,
"Must not have any property values as none were passed in.");
Assert.AreEqual(0, definition.ConstructorArgumentValues.ArgumentCount,
"Must not have any ctor args as none were passed in.");
@@ -74,7 +74,7 @@ namespace Spring.Objects.Factory.Support
typeof (TestObject).FullName, null, null);
Assert.IsNotNull(definition, "CreateObjectDefinition with no parent is returning null (it must never do so).");
Assert.AreEqual(typeof (TestObject).FullName, definition.ObjectTypeName);
- Assert.AreEqual(0, definition.PropertyValues.PropertyValues.Length,
+ Assert.AreEqual(0, definition.PropertyValues.PropertyValues.Count,
"Must not have any property values as none were passed in.");
Assert.AreEqual(0, definition.ConstructorArgumentValues.ArgumentCount,
"Must not have any ctor args as none were passed in.");
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/RootObjectDefinitionTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/RootObjectDefinitionTests.cs
index 8b113d9e..a84d9f4e 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Support/RootObjectDefinitionTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Support/RootObjectDefinitionTests.cs
@@ -89,7 +89,7 @@ namespace Spring.Objects.Factory.Support
Assert.AreEqual( "Ohhh", def.ResourceDescription );
Assert.IsTrue( def.HasConstructorArgumentValues );
Assert.AreEqual( other.ConstructorArgumentValues.ArgumentCount, def.ConstructorArgumentValues.ArgumentCount );
- Assert.AreEqual( other.PropertyValues.PropertyValues.Length, def.PropertyValues.PropertyValues.Length );
+ Assert.AreEqual( other.PropertyValues.PropertyValues.Count, def.PropertyValues.PropertyValues.Count );
Assert.AreEqual( other.EventHandlerValues.Events.Count, def.EventHandlerValues.Events.Count );
}
@@ -148,14 +148,14 @@ namespace Spring.Objects.Factory.Support
Assert.AreEqual( "InitChild", rod.InitMethodName );
Assert.AreEqual( "DestroyChild", rod.DestroyMethodName );
Assert.AreEqual( DependencyCheckingMode.None, rod.DependencyCheck );
- Assert.AreEqual( 4, rod.DependsOn.Length);
+ Assert.AreEqual( 4, rod.DependsOn.Count);
Assert.AreEqual( false, rod.IsAbstract );
Assert.AreEqual( false, rod.IsLazyInit );
Assert.AreEqual( "ChildFactoryMethodName", rod.FactoryMethodName );
Assert.AreEqual( "ChildFactoryObjectName", rod.FactoryObjectName );
Assert.AreEqual( "ChildResourceDescription", rod.ResourceDescription );
Assert.AreEqual( 2, rod.ConstructorArgumentValues.ArgumentCount );
- Assert.AreEqual( 2, rod.PropertyValues.PropertyValues.Length );
+ Assert.AreEqual( 2, rod.PropertyValues.PropertyValues.Count );
Assert.AreEqual( "Val1", rod.PropertyValues.GetPropertyValue("Prop1").Value);
Assert.AreEqual( 50, rod.PropertyValues.GetPropertyValue("Age").Value);
Assert.AreEqual( 2, rod.EventHandlerValues.Events.Count );
@@ -183,7 +183,7 @@ namespace Spring.Objects.Factory.Support
"Must be empty if null was passed to the ctor." );
Assert.IsNotNull( def.PropertyValues,
"Must never be null, but rather just empty." );
- Assert.AreEqual( 0, def.PropertyValues.PropertyValues.Length,
+ Assert.AreEqual( 0, def.PropertyValues.PropertyValues.Count,
"Must be empty if null was passed to the ctor." );
}
}
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/UnsupportedObjectDefinitionImplementation.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/UnsupportedObjectDefinitionImplementation.cs
index 7a9272a8..6e45ad54 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/UnsupportedObjectDefinitionImplementation.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/UnsupportedObjectDefinitionImplementation.cs
@@ -19,6 +19,8 @@
#endregion
using System;
+using System.Collections.Generic;
+
using Spring.Objects.Factory.Config;
using Spring.Objects.Factory.Support;
@@ -109,7 +111,7 @@ namespace Spring.Objects.Factory
get { throw new NotImplementedException(); }
}
- public string[] DependsOn
+ public IList DependsOn
{
get { throw new NotImplementedException(); }
}
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlListableObjectFactoryTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlListableObjectFactoryTests.cs
index 44abdc76..c2b1987d 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlListableObjectFactoryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlListableObjectFactoryTests.cs
@@ -22,6 +22,8 @@
using System;
using System.Collections;
+using System.Collections.Generic;
+
using NUnit.Framework;
using Spring.Objects.Factory.Config;
using Spring.Objects.Factory.Support;
@@ -83,11 +85,11 @@ namespace Spring.Objects.Factory.Xml
protected void SetUp()
{
parent = new DefaultListableObjectFactory();
- IDictionary m = new Hashtable();
+ IDictionary m = new Dictionary();
m["name"] = "Albert";
parent.RegisterObjectDefinition("father", new RootObjectDefinition(typeof (TestObject), new MutablePropertyValues(m)));
- m = new Hashtable();
- m["name"] = "Roderick";
+ m = new Dictionary();
+ m["name"] = "Roderick";
parent.RegisterObjectDefinition("rod", new RootObjectDefinition(typeof (TestObject), new MutablePropertyValues(m)));
// for testing dynamic ctor arguments + parent.GetObject() call propagation
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectCollectionTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectCollectionTests.cs
index e2088741..fa683b02 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectCollectionTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectCollectionTests.cs
@@ -22,6 +22,7 @@
using System;
using System.Collections;
+using System.Collections.Generic;
using System.IO;
using System.Text;
using Common.Logging;
@@ -198,12 +199,12 @@ namespace Spring.Objects.Factory.Xml
{
IResource resource = new ReadOnlyXmlTestResource("collections.xml", GetType());
XmlObjectFactory xof = new XmlObjectFactory(resource);
- IList objectNames = xof.GetObjectDefinitionNames();
+ IList objectNames = xof.GetObjectDefinitionNames();
TestObject tb1 = (TestObject) xof.GetObject("aliased");
TestObject alias1 = (TestObject) xof.GetObject("myalias");
Assert.IsTrue(tb1 == alias1);
- IList tb1Aliases = xof.GetAliases("aliased");
+ IList tb1Aliases = xof.GetAliases("aliased");
Assert.AreEqual(1, tb1Aliases.Count);
Assert.IsTrue(tb1Aliases.Contains("myalias"));
Assert.IsTrue(objectNames.Contains("aliased"));
@@ -214,7 +215,7 @@ namespace Spring.Objects.Factory.Xml
TestObject alias3 = (TestObject) xof.GetObject("alias2");
Assert.IsTrue(tb2 == alias2);
Assert.IsTrue(tb2 == alias3);
- IList tb2Aliases = xof.GetAliases("multiAliased");
+ IList tb2Aliases = xof.GetAliases("multiAliased");
Assert.AreEqual(2, tb2Aliases.Count);
Assert.IsTrue(tb2Aliases.Contains("alias1"));
Assert.IsTrue(tb2Aliases.Contains("alias2"));
@@ -228,7 +229,7 @@ namespace Spring.Objects.Factory.Xml
Assert.IsTrue(tb3 == alias4);
Assert.IsTrue(tb3 == alias5);
- IList tb3Aliases = xof.GetAliases("aliasWithoutId1");
+ IList tb3Aliases = xof.GetAliases("aliasWithoutId1");
Assert.AreEqual(2, tb2Aliases.Count);
Assert.IsTrue(tb3Aliases.Contains("aliasWithoutId2"));
Assert.IsTrue(tb3Aliases.Contains("aliasWithoutId3"));
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectDefinitionReaderTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectDefinitionReaderTests.cs
index d3f14717..45aabde2 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectDefinitionReaderTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectDefinitionReaderTests.cs
@@ -350,7 +350,7 @@ namespace Spring.Objects.Factory.Xml
Assert.AreEqual(AutoWiringMode.No, od2.AutowireMode);
Assert.AreEqual("init", od2.InitMethodName);
Assert.AreEqual("destroy", od2.DestroyMethodName);
- Assert.AreEqual(1, od2.DependsOn.Length);
+ Assert.AreEqual(1, od2.DependsOn.Count);
Assert.AreEqual("test1", od2.DependsOn[0]);
Assert.AreEqual(DependencyCheckingMode.Simple, od2.DependencyCheck);
}
diff --git a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectFactoryTests.cs b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectFactoryTests.cs
index 65674bee..a4b772bd 100644
--- a/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectFactoryTests.cs
+++ b/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectFactoryTests.cs
@@ -459,9 +459,9 @@ namespace Spring.Objects.Factory.Xml
";
stream = new MemoryStream(Encoding.UTF8.GetBytes(xml));
XmlObjectFactory factory = new XmlObjectFactory(new InputStreamResource(stream, string.Empty));
- string[] names = factory.GetObjectDefinitionNames();
+ IList names = factory.GetObjectDefinitionNames();
// mmm, how is one to test this? I have no idea what the generated name is...
- Assert.AreEqual(2, names.Length, "Should have got two object names, one of which is autogenerated.");
+ Assert.AreEqual(2, names.Count, "Should have got two object names, one of which is autogenerated.");
}
///