Program: 128490
Project: 128490
Buggy source:
/** 
 * DOC YeXiaowei Comment method "getConnection".
 * @param jarPath
 * @param driverClassName
 * @param url
 * @param username
 * @param password
 * @return
 */
public List getConnection(String[] jarPath,String driverClassName,String url,String username,String password,String dbType,String dbVersion,String additionalParams) throws Exception {
  List list=new ArrayList();
  HotClassLoader loader;
  boolean flog=EDatabaseVersion4Drivers.containTypeAndVersion(dbType,dbVersion);
  if (flog) {
    loader=(HotClassLoader)classLoadersMap.get(dbType,dbVersion);
    if (loader == null) {
      loader=new HotClassLoader();
      for (int i=0; i < jarPath.length; i++) {
        loader.addPath(jarPath[i]);
      }
      classLoadersMap.put(dbType,dbVersion,loader);
    }
 else {
      for (int i=0; i < jarPath.length; i++) {
        loader.addPath(jarPath[i]);
      }
    }
  }
 else {
    loader=HotClassLoader.getInstance();
    for (int i=0; i < jarPath.length; i++) {
      if (jarPath[i].contains("String_Node_Str")) {
        String[] splittedPath=jarPath[i].split("String_Node_Str");
        for (int j=0; j < splittedPath.length; j++) {
          loader.addPath(splittedPath[j]);
        }
      }
 else {
        loader.addPath(jarPath[i]);
      }
    }
  }
  DriverShim wapperDriver=null;
  Connection connection=null;
  try {
    Class<?> driver=Class.forName(driverClassName,true,loader);
    if (EDatabaseTypeName.MSSQL.getDisplayName().equals(dbType) && DRIVER_CACHE.containsKey(EDatabase4DriverClassName.MSSQL.getDriverClass()) && "String_Node_Str".equals(username)) {
      wapperDriver=DRIVER_CACHE.get(EDatabase4DriverClassName.MSSQL.getDriverClass());
    }
 else {
      wapperDriver=new DriverShim((Driver)(driver.newInstance()));
    }
    Properties info=new Properties();
    username=username != null ? username : "String_Node_Str";
    password=password != null ? password : "String_Node_Str";
    info.put("String_Node_Str",username);
    info.put("String_Node_Str",password);
    if (dbType.equals(EDatabaseTypeName.ACCESS.getXmlName()) || dbType.equals(EDatabaseTypeName.GODBC.getXmlName())) {
      Charset systemCharset=CharsetToolkit.getInternalSystemCharset();
      if (systemCharset != null && systemCharset.displayName() != null) {
        info.put("String_Node_Str",systemCharset.displayName());
      }
    }
    if (additionalParams != null && !"String_Node_Str".equals(additionalParams) && dbType.toUpperCase().contains("String_Node_Str")) {
      additionalParams=additionalParams.replaceAll("String_Node_Str","String_Node_Str");
      info.load(new java.io.ByteArrayInputStream(additionalParams.getBytes()));
      connection=wapperDriver.connect(url,info);
    }
 else {
      if (dbType.equals(EDatabaseTypeName.HSQLDB_IN_PROGRESS.getDisplayName()) && additionalParams.indexOf(SHUTDOWN_PARAM) == -1) {
        url=url + SHUTDOWN_PARAM;
      }
      if (EDatabaseTypeName.HIVE.getDisplayName().equals(dbType) && "String_Node_Str".equalsIgnoreCase(dbVersion)) {
        Thread.currentThread().setContextClassLoader(loader);
      }
      connection=wapperDriver.connect(url,info);
    }
    if (EDatabaseTypeName.MSSQL.getDisplayName().equals(dbType) && !DRIVER_CACHE.containsKey(EDatabase4DriverClassName.MSSQL.getDriverClass()) && "String_Node_Str".equals(username)) {
      DRIVER_CACHE.put(EDatabase4DriverClassName.MSSQL.getDriverClass(),wapperDriver);
    }
    list.add(connection);
    list.add(wapperDriver);
    return list;
  }
 catch (  Throwable e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * DOC YeXiaowei Comment method "getConnection".
 * @param jarPath
 * @param driverClassName
 * @param url
 * @param username
 * @param password
 * @return
 */
public List getConnection(String[] jarPath,String driverClassName,String url,String username,String password,String dbType,String dbVersion,String additionalParams) throws Exception {
  List list=new ArrayList();
  HotClassLoader loader;
  boolean flog=EDatabaseVersion4Drivers.containTypeAndVersion(dbType,dbVersion);
  if (flog) {
    loader=(HotClassLoader)classLoadersMap.get(dbType,dbVersion);
    if (loader == null) {
      loader=new HotClassLoader();
      for (int i=0; i < jarPath.length; i++) {
        loader.addPath(jarPath[i]);
      }
      classLoadersMap.put(dbType,dbVersion,loader);
    }
 else {
      for (int i=0; i < jarPath.length; i++) {
        loader.addPath(jarPath[i]);
      }
    }
  }
 else {
    loader=HotClassLoader.getInstance();
    for (int i=0; i < jarPath.length; i++) {
      if (jarPath[i].contains("String_Node_Str")) {
        String[] splittedPath=jarPath[i].split("String_Node_Str");
        for (int j=0; j < splittedPath.length; j++) {
          loader.addPath(splittedPath[j]);
        }
      }
 else {
        loader.addPath(jarPath[i]);
      }
    }
  }
  DriverShim wapperDriver=null;
  Connection connection=null;
  try {
    Class<?> driver=Class.forName(driverClassName,true,loader);
    wapperDriver=new DriverShim((Driver)(driver.newInstance()));
    Properties info=new Properties();
    username=username != null ? username : "String_Node_Str";
    password=password != null ? password : "String_Node_Str";
    info.put("String_Node_Str",username);
    info.put("String_Node_Str",password);
    if (dbType.equals(EDatabaseTypeName.ACCESS.getXmlName()) || dbType.equals(EDatabaseTypeName.GODBC.getXmlName())) {
      Charset systemCharset=CharsetToolkit.getInternalSystemCharset();
      if (systemCharset != null && systemCharset.displayName() != null) {
        info.put("String_Node_Str",systemCharset.displayName());
      }
    }
    if (additionalParams != null && !"String_Node_Str".equals(additionalParams) && dbType.toUpperCase().contains("String_Node_Str")) {
      additionalParams=additionalParams.replaceAll("String_Node_Str","String_Node_Str");
      info.load(new java.io.ByteArrayInputStream(additionalParams.getBytes()));
      connection=wapperDriver.connect(url,info);
    }
 else {
      if (dbType.equals(EDatabaseTypeName.HSQLDB_IN_PROGRESS.getDisplayName()) && additionalParams.indexOf(SHUTDOWN_PARAM) == -1) {
        url=url + SHUTDOWN_PARAM;
      }
      if (EDatabaseTypeName.HIVE.getDisplayName().equals(dbType) && "String_Node_Str".equalsIgnoreCase(dbVersion)) {
        Thread.currentThread().setContextClassLoader(loader);
      }
      connection=wapperDriver.connect(url,info);
    }
    list.add(connection);
    list.add(wapperDriver);
    return list;
  }
 catch (  Throwable e) {
    throw new RuntimeException(e);
  }
}