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();
// really return
return null;
}
String driverId = String.class.cast( bestMatch.getDriver().getProperty( Constants.DRIVER_ID ) );
debug( "best match: " + driverId );
m_finalDriver = m_drivers.get( bestMatch.getDriver() );
if ( m_finalDriver == null )
{
error( "we found a driverId, but not the corresponding driver: " + driverId, null );
noDriverFound();