m_included.add( da );
}
}
// now start matching all drivers
final DriverMatcher mi = new DriverMatcher( DeviceManager.this );
for ( DriverAttributes driver : m_included )
{
try
{
int match = driver.match( m_ref );
if ( match <= Device.MATCH_NONE )
{
continue;
}
mi.add( match, driver );
}
catch ( Throwable t )
{
error( "match threw an exception", new Exception( t ) );
}
}
// get the best match
Match bestMatch = null;
// local copy
final DriverSelector selector = m_selector;
if ( selector != null )
{
bestMatch = mi.selectBestMatch( m_ref, selector );
if (bestMatch != null) {
debug(String.format("DriverSelector (%s) found best match: %s", selector.getClass().getName(), Util.showDriver(bestMatch.getDriver())));
}
}
if (bestMatch == null)
{
bestMatch = mi.getBestMatch();
}
if ( bestMatch == null )
{
noDriverFound();