Program: 121262
Project: 121262
Buggy source:
/** 
 * DOC root Comment method "cloneOriginalValueConnection".
 * @param dbConn
 * @param contextProperties
 * @return
 */
public static DatabaseConnection cloneOriginalValueConnection(DatabaseConnection dbConn,Properties contextProperties){
  if (dbConn == null) {
    return null;
  }
  ContextType contextType=null;
  DatabaseConnection cloneConn=ConnectionFactory.eINSTANCE.createDatabaseConnection();
  String server=getOriginalValue(contextProperties,dbConn.getServerName());
  String username=getOriginalValue(contextProperties,dbConn.getUsername());
  String password=getOriginalValue(contextProperties,dbConn.getRawPassword());
  String port=getOriginalValue(contextProperties,dbConn.getPort());
  String sidOrDatabase=getOriginalValue(contextProperties,dbConn.getSID());
  String datasource=getOriginalValue(contextProperties,dbConn.getDatasourceName());
  String filePath=getOriginalValue(contextProperties,dbConn.getFileFieldName());
  String schemaOracle=getOriginalValue(contextProperties,dbConn.getUiSchema());
  String dbRootPath=getOriginalValue(contextProperties,dbConn.getDBRootPath());
  String additionParam=getOriginalValue(contextProperties,dbConn.getAdditionalParams());
  String url=getOriginalValue(contextProperties,dbConn.getURL());
  String className=getOriginalValue(contextProperties,dbConn.getDriverClass());
  String jarPath=getOriginalValue(contextProperties,dbConn.getDriverJarPath());
  String dbmsID=getOriginalValue(contextProperties,dbConn.getDbmsId());
  filePath=TalendQuoteUtils.removeQuotes(filePath);
  dbRootPath=TalendQuoteUtils.removeQuotes(dbRootPath);
  cloneConn.setAdditionalParams(additionParam);
  cloneConn.setDatasourceName(datasource);
  cloneConn.setDBRootPath(dbRootPath);
  cloneConn.setFileFieldName(filePath);
  if (contextType != null) {
    String encryptedPassword=null;
    try {
      encryptedPassword=PasswordEncryptUtil.encryptPassword(password);
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
    cloneConn.setPassword(encryptedPassword);
  }
 else {
    cloneConn.setPassword(password);
  }
  cloneConn.setPort(port);
  cloneConn.setUiSchema(schemaOracle);
  cloneConn.setServerName(server);
  cloneConn.setSID(sidOrDatabase);
  cloneConn.setUsername(username);
  cloneConn.setDriverJarPath(jarPath);
  cloneConn.setComment(dbConn.getComment());
  cloneConn.setDatabaseType(dbConn.getDatabaseType());
  cloneConn.setDbmsId(dbmsID);
  cloneConn.setDivergency(dbConn.isDivergency());
  cloneConn.setDbVersionString(dbConn.getDbVersionString());
  cloneConn.setId(dbConn.getId());
  cloneConn.setLabel(dbConn.getLabel());
  cloneConn.setNullChar(dbConn.getNullChar());
  cloneConn.setProductId(dbConn.getProductId());
  cloneConn.setSqlSynthax(dbConn.getSqlSynthax());
  cloneConn.setStandardSQL(dbConn.isStandardSQL());
  cloneConn.setStringQuote(dbConn.getStringQuote());
  cloneConn.setSynchronised(dbConn.isSynchronised());
  cloneConn.setSystemSQL(dbConn.isSystemSQL());
  cloneConn.setVersion(dbConn.getVersion());
  cloneConn.setReadOnly(dbConn.isReadOnly());
  cloneConn.setDriverClass(className);
  cloneConn.setName(dbConn.getName());
  cloneOtherParameters(dbConn,cloneConn);
  if (dbConn.isSetSQLMode()) {
    cloneConn.setSQLMode(dbConn.isSQLMode());
  }
 else {
    cloneConn.setSQLMode(true);
  }
  if (contextType != null && !EDatabaseTypeName.GENERAL_JDBC.equals(EDatabaseTypeName.getTypeFromDbType(dbConn.getDatabaseType()))) {
    String newURL=DatabaseConnStrUtil.getURLString(cloneConn.getDatabaseType(),dbConn.getDbVersionString(),server,username,password,port,sidOrDatabase,filePath.toLowerCase(),datasource,dbRootPath,additionParam);
    cloneConn.setURL(newURL);
    return cloneConn;
  }
  if (dbConn.getURL() != null && !dbConn.getURL().equals("String_Node_Str")) {
    cloneConn.setURL(url);
  }
 else {
    String newURL=DatabaseConnStrUtil.getURLString(cloneConn.getDatabaseType(),dbConn.getDbVersionString(),server,username,password,port,sidOrDatabase,filePath.toLowerCase(),datasource,dbRootPath,additionParam);
    cloneConn.setURL(newURL);
  }
  return cloneConn;
}

Fixed version (ground truth):
/** 
 * DOC sizhaoliu Comment method "cloneOriginalValueConnection".
 * @param dbConn
 * @param contextProperties
 * @return
 */
public static DatabaseConnection cloneOriginalValueConnection(DatabaseConnection dbConn,Properties contextProperties){
  if (dbConn == null) {
    return null;
  }
  ContextType contextType=null;
  DatabaseConnection cloneConn=ConnectionFactory.eINSTANCE.createDatabaseConnection();
  String server=getOriginalValue(contextProperties,dbConn.getServerName());
  String username=getOriginalValue(contextProperties,dbConn.getUsername());
  String password=getOriginalValue(contextProperties,dbConn.getRawPassword());
  String port=getOriginalValue(contextProperties,dbConn.getPort());
  String sidOrDatabase=getOriginalValue(contextProperties,dbConn.getSID());
  String datasource=getOriginalValue(contextProperties,dbConn.getDatasourceName());
  String filePath=getOriginalValue(contextProperties,dbConn.getFileFieldName());
  String schemaOracle=getOriginalValue(contextProperties,dbConn.getUiSchema());
  String dbRootPath=getOriginalValue(contextProperties,dbConn.getDBRootPath());
  String additionParam=getOriginalValue(contextProperties,dbConn.getAdditionalParams());
  String url=getOriginalValue(contextProperties,dbConn.getURL());
  String className=getOriginalValue(contextProperties,dbConn.getDriverClass());
  String jarPath=getOriginalValue(contextProperties,dbConn.getDriverJarPath());
  String dbmsID=getOriginalValue(contextProperties,dbConn.getDbmsId());
  filePath=TalendQuoteUtils.removeQuotes(filePath);
  dbRootPath=TalendQuoteUtils.removeQuotes(dbRootPath);
  cloneConn.setAdditionalParams(additionParam);
  cloneConn.setDatasourceName(datasource);
  cloneConn.setDBRootPath(dbRootPath);
  cloneConn.setFileFieldName(filePath);
  if (contextType != null) {
    String encryptedPassword=null;
    try {
      encryptedPassword=PasswordEncryptUtil.encryptPassword(password);
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
    cloneConn.setPassword(encryptedPassword);
  }
 else {
    cloneConn.setPassword(password);
  }
  cloneConn.setPort(port);
  cloneConn.setUiSchema(schemaOracle);
  cloneConn.setServerName(server);
  cloneConn.setSID(sidOrDatabase);
  cloneConn.setUsername(username);
  cloneConn.setDriverJarPath(jarPath);
  cloneConn.setComment(dbConn.getComment());
  cloneConn.setDatabaseType(dbConn.getDatabaseType());
  cloneConn.setDbmsId(dbmsID);
  cloneConn.setDivergency(dbConn.isDivergency());
  cloneConn.setDbVersionString(dbConn.getDbVersionString());
  cloneConn.setId(dbConn.getId());
  cloneConn.setLabel(dbConn.getLabel());
  cloneConn.setNullChar(dbConn.getNullChar());
  cloneConn.setProductId(dbConn.getProductId());
  cloneConn.setSqlSynthax(dbConn.getSqlSynthax());
  cloneConn.setStandardSQL(dbConn.isStandardSQL());
  cloneConn.setStringQuote(dbConn.getStringQuote());
  cloneConn.setSynchronised(dbConn.isSynchronised());
  cloneConn.setSystemSQL(dbConn.isSystemSQL());
  cloneConn.setVersion(dbConn.getVersion());
  cloneConn.setReadOnly(dbConn.isReadOnly());
  cloneConn.setDriverClass(className);
  cloneConn.setName(dbConn.getName());
  cloneOtherParameters(dbConn,cloneConn);
  if (dbConn.isSetSQLMode()) {
    cloneConn.setSQLMode(dbConn.isSQLMode());
  }
 else {
    cloneConn.setSQLMode(true);
  }
  if (contextType != null && !EDatabaseTypeName.GENERAL_JDBC.equals(EDatabaseTypeName.getTypeFromDbType(dbConn.getDatabaseType()))) {
    String newURL=DatabaseConnStrUtil.getURLString(cloneConn.getDatabaseType(),dbConn.getDbVersionString(),server,username,password,port,sidOrDatabase,filePath.toLowerCase(),datasource,dbRootPath,additionParam);
    cloneConn.setURL(newURL);
    return cloneConn;
  }
  if (dbConn.getURL() != null && !dbConn.getURL().equals("String_Node_Str")) {
    cloneConn.setURL(url);
  }
 else {
    String newURL=DatabaseConnStrUtil.getURLString(cloneConn.getDatabaseType(),dbConn.getDbVersionString(),server,username,password,port,sidOrDatabase,filePath.toLowerCase(),datasource,dbRootPath,additionParam);
    cloneConn.setURL(newURL);
  }
  return cloneConn;
}