SPRNET-986 - Constructor autowiring for array types not working

Notes:
This was a simple fix (see DefaultListableObjectFactory.ResolveDependency) but took the opportunity to sync more with Java 2.5.3 implementation for parsing object definitions and autowiring algorithm.
There maybe some extraneous commits due to spurious changes in line feed/CR while viewing some files.
This commit is contained in:
markpollack
2008-08-01 05:13:41 +00:00
parent c071d6a942
commit fbbac69edb
2 changed files with 7 additions and 1 deletions

View File

@@ -308,6 +308,7 @@ namespace Spring.Objects.Factory.Support
// try all matching methods to see if they match the constructor arguments...
foreach(MethodInfo factoryMethod in factoryMethods)
{
Type[] paramTypes = new Type[] { };
#endif
if (arguments == null || arguments.Length == 0)
{

View File

@@ -1111,9 +1111,14 @@ namespace Spring.Objects.Factory.Xml
ITestObject kerry = (ITestObject) xof.GetObject("spouse");
ITestObject kerry2 = (ITestObject)xof.GetObject("spouse2");
ArrayCtorDependencyObject rod7 = (ArrayCtorDependencyObject) xof.GetObject("rod7");
#if NET_1_0 || NET_1_1
// Lack of OrderedDictionary means we can't predict the ordering of the autowiring.
Assert.IsNotNull(rod7.Spouse1);
Assert.IsNotNull(rod7.Spouse2);
#else
Assert.AreEqual(kerry, rod7.Spouse1);
Assert.AreEqual(kerry2, rod7.Spouse2);
#endif
}
public void AutowireWithParent()