final DependencyDirective role = roles[ i ];
final Object dependency = m_application.getBlock(
role.getProviderName() );
final String key = role.getKey();
final DependencyDescriptor candidate =
info.getDependency( key );
if( candidate.isArray() )
{
ArrayList list = (ArrayList)sets.get( key );
if( null == list )
{
list = new ArrayList();
sets.put( key, list );
}
list.add( dependency );
}
else if( candidate.isMap() )
{
HashMap smap = (HashMap)sets.get( key );
if( null == smap )
{
smap = new HashMap();
sets.put( key, smap );
}
smap.put( role.getAlias(), dependency );
}
else
{
map.put( key, dependency );
}
}
final Iterator iterator = sets.keySet().iterator();
while( iterator.hasNext() )
{
final String key = (String)iterator.next();
final Object value = sets.get( key );
if( value instanceof List )
{
final List list = (List)value;
final DependencyDescriptor dependency = info.getDependency(
key );
final Object[] result = toArray( list,
dependency.getComponentType() );
map.put( key, result );
if( key.equals( dependency.getType() ) )
{
final String classname =
"[L" + dependency.getComponentType() + ";";
map.put( classname, result );
}
}
else
{