if( usesObject == null && !dependency.optional() )
{
// No @Uses object provided
// Try instantiating a Transient or Object for the given type
ModuleInstance moduleInstance = context.module();
try
{
if( context.instance() != null )
{
uses = uses.use( context.instance() );
}
usesObject = moduleInstance.newTransient( injectionType, uses.toArray() );
}
catch( NoSuchTransientException e )
{
try
{
usesObject = moduleInstance.newObject( injectionType, uses.toArray() );
}
catch( NoSuchObjectException e1 )
{
// Could not instantiate an instance - to try instantiate as plain class
try