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:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user