Program: 126772
Project: 126772
Buggy source:
/** 
 * ggu Comment method "getUrlConnectionString". if display is false, the string connection will be returned by default context.
 */
public static String getUrlConnectionString(ConnectionItem connectionItem,boolean defaultContext){
  if (connectionItem == null) {
    return null;
  }
  DatabaseConnection dbConn=(DatabaseConnection)connectionItem.getConnection();
  ContextType contextType=ConnectionContextHelper.getContextTypeForContextMode(dbConn,defaultContext);
  String server=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getServerName());
  String username=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getUsername());
  String password=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getPassword());
  String port=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getPort());
  String sidOrDatabase=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getSID());
  String datasource=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getDatasourceName());
  String filePath=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getFileFieldName());
  String schemaOracle=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getUiSchema());
  String dbRootPath=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getDBRootPath());
  String additionParam=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getAdditionalParams());
  String jdbcUrl=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getURL());
  String driverJar=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getDriverJarPath());
  String className=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getDbmsId());
  String mappingFile=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getFileFieldName());
  filePath=TalendQuoteUtils.removeQuotes(filePath);
  dbRootPath=TalendQuoteUtils.removeQuotes(dbRootPath);
  if (EDatabaseTypeName.HIVE.equals(EDatabaseTypeName.getTypeFromDbType(dbConn.getDatabaseType()))) {
    String template=null;
    if (dbConn.getURL() != null && dbConn.getURL().startsWith(DbConnStrForHive.URL_HIVE_2_TEMPLATE)) {
      template=DbConnStrForHive.URL_HIVE_2_TEMPLATE;
    }
 else {
      template=DbConnStrForHive.URL_HIVE_1_TEMPLATE;
    }
    return DatabaseConnStrUtil.getHiveURLString(dbConn,server,port,sidOrDatabase,template);
  }
  String newUrl=DatabaseConnStrUtil.getURLString(dbConn.getDatabaseType(),dbConn.getDbVersionString(),server,username,password,port,sidOrDatabase,filePath.toLowerCase(),datasource,dbRootPath,additionParam,jdbcUrl,driverJar,className,mappingFile);
  return newUrl;
}

Fixed version (ground truth):
/** 
 * ggu Comment method "getUrlConnectionString". if display is false, the string connection will be returned by default context.
 */
public static String getUrlConnectionString(ConnectionItem connectionItem,boolean defaultContext){
  if (connectionItem == null) {
    return null;
  }
  DatabaseConnection dbConn=(DatabaseConnection)connectionItem.getConnection();
  ContextType contextType=ConnectionContextHelper.getContextTypeForContextMode(dbConn,defaultContext);
  String server=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getServerName());
  String username=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getUsername());
  String password=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getPassword());
  String port=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getPort());
  String sidOrDatabase=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getSID());
  String datasource=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getDatasourceName());
  String filePath=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getFileFieldName());
  String schemaOracle=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getUiSchema());
  String dbRootPath=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getDBRootPath());
  String additionParam=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getAdditionalParams());
  String jdbcUrl=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getURL());
  String driverJar=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getDriverJarPath());
  String className=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getDbmsId());
  String mappingFile=ConnectionContextHelper.getOriginalValue(contextType,dbConn.getFileFieldName());
  filePath=TalendQuoteUtils.removeQuotes(filePath);
  dbRootPath=TalendQuoteUtils.removeQuotes(dbRootPath);
  if (EDatabaseTypeName.HIVE.equals(EDatabaseTypeName.getTypeFromDbType(dbConn.getDatabaseType()))) {
    String template=null;
    if (dbConn.getURL() != null && dbConn.getURL().startsWith(DbConnStrForHive.URL_HIVE_2_TEMPLATE)) {
      template=DbConnStrForHive.URL_HIVE_2_TEMPLATE;
    }
 else {
      template=DbConnStrForHive.URL_HIVE_1_TEMPLATE;
    }
    return DatabaseConnStrUtil.getHiveURLString(dbConn,server,port,sidOrDatabase,template);
  }
  String newUrl=DatabaseConnStrUtil.getURLString(dbConn.getDatabaseType(),dbConn.getDbVersionString(),server,username,password,port,sidOrDatabase,filePath,datasource,dbRootPath,additionParam,jdbcUrl,driverJar,className,mappingFile);
  return newUrl;
}