Program: 137018
Project: 137018
Buggy source:
public Driver getDriver(String driverClassName,String jarsPath) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
  Driver driver=null;
  if (StringUtils.isNotEmpty(jarsPath)) {
    try {
      driver=this.createGenericJDBC(jarsPath,driverClassName);
    }
 catch (    Exception e) {
      log.error(e,e);
    }
    return driver;
  }
  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 {
            MyURLClassLoader cl;
            cl=new MyURLClassLoader(urls.toArray(new URL[0]));
            Class<?> clazz=cl.findClass(driverClassName);
            if (clazz != null) {
              driver=(Driver)clazz.newInstance();
              if (driver != null) {
                return driver;
              }
            }
          }
 catch (          ClassNotFoundException e) {
          }
        }
      }
    }
 catch (    MalformedURLException e) {
    }
  }
  if (driver == null) {
    driver=(Driver)Class.forName(driverClassName).newInstance();
  }
  return driver;
}

Fixed version (ground truth):
@Override public Driver getDriver(String driverClassName,String jarsPath) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
  Driver driver=null;
  if (StringUtils.isNotEmpty(jarsPath)) {
    try {
      driver=this.createGenericJDBC(jarsPath,driverClassName);
    }
 catch (    Exception e) {
      log.error(e,e);
    }
    return driver;
  }
  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 {
            MyURLClassLoader cl;
            cl=new MyURLClassLoader(urls.toArray(new URL[0]));
            Class<?> clazz=cl.findClass(driverClassName);
            if (clazz != null) {
              driver=(Driver)clazz.newInstance();
              if (driver != null) {
                return driver;
              }
            }
          }
 catch (          ClassNotFoundException e) {
          }
        }
      }
    }
 catch (    MalformedURLException e) {
    }
  }
  if (driver == null) {
    driver=(Driver)Class.forName(driverClassName).newInstance();
  }
  return driver;
}