changed ConfigureObject(target, name) to return original target if no definition is found
This commit is contained in:
@@ -2104,7 +2104,7 @@ namespace Spring.Objects.Factory.Support
|
||||
return ConfigureObject(name, definition, new ObjectWrapper(target));
|
||||
}
|
||||
|
||||
return null;
|
||||
return target;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1337,6 +1337,15 @@ namespace Spring.Objects.Factory
|
||||
Assert.AreEqual(1, lof.ObjectPostProcessorCount, errMsg);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ConfigureObjectReturnsOriginalInstanceIfNoDefinitionFound()
|
||||
{
|
||||
IConfigurableObjectFactory of = new DefaultListableObjectFactory();
|
||||
object testObject = new object();
|
||||
object resultObject = of.ConfigureObject(testObject, "non-existing object definition name");
|
||||
Assert.AreSame(testObject, resultObject);
|
||||
}
|
||||
|
||||
#region Helper Classes
|
||||
|
||||
public class GoodDisposable : IDisposable
|
||||
|
||||
Reference in New Issue
Block a user