Program: 126864
Project: 126864
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=getHotClassLoaderFromCache(dbType,dbVersion);
    if (loader == null) {
      loader=new HotClassLoader();
      classLoadersMap.put(dbType,dbVersion,loader);
    }
  }
 else {
    loader=new HotClassLoader();
  }
  for (  String element : jarPath) {
    if (element.contains("String_Node_Str")) {
      String[] splittedPath=element.split("String_Node_Str");
      for (      String element2 : splittedPath) {
        loader.addPath(element2);
      }
    }
 else {
      loader.addPath(element);
    }
  }
  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 (driverClassName != null && driverClassName.equals(EDatabase4DriverClassName.HSQLDB.getDriverClass()) && additionalParams.indexOf(SHUTDOWN_PARAM) == -1) {
        url=url + SHUTDOWN_PARAM;
      }
      if (dbType != null && dbType.equalsIgnoreCase(EDatabaseTypeName.MSSQL.getDisplayName()) && "String_Node_Str".equals(username)) {
        ExtractMetaDataUtils.getInstance().setDriverCache(wapperDriver);
      }
      if (EDatabaseTypeName.HIVE.getDisplayName().equals(dbType)) {
        Thread.currentThread().setContextClassLoader(loader);
      }
      connection=wapperDriver.connect(url,info);
    }
    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=getHotClassLoaderFromCache(dbType,dbVersion);
    if (loader == null) {
      loader=new HotClassLoader();
      classLoadersMap.put(dbType,dbVersion,loader);
    }
  }
 else {
    loader=new HotClassLoader();
  }
  for (  String element : jarPath) {
    if (element.contains("String_Node_Str")) {
      String[] splittedPath=element.split("String_Node_Str");
      for (      String element2 : splittedPath) {
        loader.addPath(element2);
      }
    }
 else {
      loader.addPath(element);
    }
  }
  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 {
      url=ConnectionUtils.addShutDownForHSQLUrl(url,additionalParams);
      if (dbType != null && dbType.equalsIgnoreCase(EDatabaseTypeName.MSSQL.getDisplayName()) && "String_Node_Str".equals(username)) {
        ExtractMetaDataUtils.getInstance().setDriverCache(wapperDriver);
      }
      if (EDatabaseTypeName.HIVE.getDisplayName().equals(dbType)) {
        Thread.currentThread().setContextClassLoader(loader);
      }
      connection=wapperDriver.connect(url,info);
    }
    list.add(connection);
    list.add(wapperDriver);
    return list;
  }
 catch (  Throwable e) {
    throw new RuntimeException(e);
  }
}