Program: 137607
Project: 137607
Buggy source:
/** 
 * abstract this function from getClassDriver(String driverClassName, String url, Properties props).
 * @param driverClassName
 * @return
 * @throws InstantiationException
 * @throws IllegalAccessException
 */
private static Driver getClassDriverFromSQLExplorer(String driverClassName) throws InstantiationException, IllegalAccessException {
  Driver driver=null;
  if (Platform.isRunning()) {
    SQLExplorerPlugin sqlExplorerPlugin=SQLExplorerPlugin.getDefault();
    if (sqlExplorerPlugin != null) {
      net.sourceforge.sqlexplorer.dbproduct.DriverManager driverModel=sqlExplorerPlugin.getDriverModel();
      try {
        Collection<ManagedDriver> drivers=driverModel.getDrivers();
        for (        ManagedDriver managedDriver : drivers) {
          LinkedList<String> jars=managedDriver.getJars();
          List<URL> urls=new ArrayList<URL>();
          for (int i=0; i < jars.size(); i++) {
            File file=new File(jars.get(i));
            if (file.exists()) {
              urls.add(file.toURI().toURL());
            }
          }
          if (!urls.isEmpty()) {
            try {
              Class<?> clazz=null;
              MyURLClassLoader cl;
              cl=new MyURLClassLoader(urls.toArray(new URL[0]));
              clazz=cl.findClass(driverClassName);
              if (clazz != null) {
                driver=(Driver)clazz.newInstance();
                MetadataConnectionUtils.getDriverCache().put(driverClassName,driver);
                ExtractMetaDataUtils.getDriverCache().put(driverClassName,new DriverShim(driver));
                return driver;
              }
            }
 catch (            ClassNotFoundException e) {
            }
          }
        }
      }
 catch (      MalformedURLException e) {
      }
    }
  }
  return driver;
}

Fixed version (ground truth):
/** 
 * abstract this function from getClassDriver(String driverClassName, String url, Properties props).
 * @param driverClassName
 * @return
 * @throws InstantiationException
 * @throws IllegalAccessException
 */
private static Driver getClassDriverFromSQLExplorer(String driverClassName) throws InstantiationException, IllegalAccessException {
  Driver driver=null;
  if (Platform.isRunning()) {
    SQLExplorerPlugin sqlExplorerPlugin=SQLExplorerPlugin.getDefault();
    if (sqlExplorerPlugin != null) {
      net.sourceforge.sqlexplorer.dbproduct.DriverManager driverModel=sqlExplorerPlugin.getDriverModel();
      try {
        Collection<ManagedDriver> drivers=driverModel.getDrivers();
        for (        ManagedDriver managedDriver : drivers) {
          LinkedList<String> jars=managedDriver.getJars();
          List<URL> urls=new ArrayList<URL>();
          for (int i=0; i < jars.size(); i++) {
            File file=new File(jars.get(i));
            if (file.exists()) {
              urls.add(file.toURI().toURL());
            }
          }
          if (!urls.isEmpty()) {
            try {
              Class<?> clazz=null;
              MyURLClassLoader cl;
              cl=new MyURLClassLoader(urls.toArray(new URL[0]));
              clazz=cl.findClass(driverClassName);
              if (clazz != null) {
                driver=(Driver)clazz.newInstance();
                MetadataConnectionUtils.getDriverCache().put(driverClassName,driver);
                ExtractMetaDataUtils.getInstance().getDriverCache().put(driverClassName,new DriverShim(driver));
                return driver;
              }
            }
 catch (            ClassNotFoundException e) {
            }
          }
        }
      }
 catch (      MalformedURLException e) {
      }
    }
  }
  return driver;
}