Program: 121263
Project: 121263
Buggy source:
/** 
 * DOC root Comment method "setMetadataConnectionParameter".
 * @param dbConn
 * @param metaConn
 * @param contextProperties
 * @return
 */
public static void setMetadataConnectionParameter(DatabaseConnection conn,IMetadataConnection metadataConnection,Properties contextProperties){
  if (conn == null || metadataConnection == null) {
    return;
  }
  ContextType contextType=getContextTypeForContextMode(conn,conn.getContextName());
  if (contextType == null) {
    return;
  }
  metadataConnection.setDriverJarPath(getOriginalValue(contextProperties,conn.getDriverJarPath()));
  metadataConnection.setDbType(getOriginalValue(contextProperties,conn.getDatabaseType()));
  EDatabaseTypeName edatabasetypeInstance=EDatabaseTypeName.getTypeFromDisplayName(getOriginalValue(contextProperties,conn.getDatabaseType()));
  String product=edatabasetypeInstance.getProduct();
  metadataConnection.setProduct(product);
  if (!ReponsitoryContextBridge.isDefautProject()) {
    Dbms defaultDbmsFromProduct=MetadataTalendType.getDefaultDbmsFromProduct(product);
    if (defaultDbmsFromProduct != null) {
      String mapping=defaultDbmsFromProduct.getId();
      metadataConnection.setMapping(mapping);
    }
  }
  metadataConnection.setDbVersionString(getOriginalValue(contextProperties,conn.getDbVersionString()));
  metadataConnection.setFileFieldName(getOriginalValue(contextProperties,conn.getFileFieldName()));
  metadataConnection.setUrl(getOriginalValue(contextProperties,conn.getURL()));
  metadataConnection.setAdditionalParams(getOriginalValue(contextProperties,conn.getAdditionalParams()));
  metadataConnection.setDriverClass(getOriginalValue(contextProperties,conn.getDriverClass()));
  metadataConnection.setServerName(getOriginalValue(contextProperties,conn.getServerName()));
  metadataConnection.setPort(getOriginalValue(contextProperties,conn.getPort()));
  metadataConnection.setDatabase(getOriginalValue(contextProperties,conn.getSID()));
  metadataConnection.setOtherParameter(getOriginalValue(contextProperties,ConnectionHelper.getOtherParameter(conn)));
  metadataConnection.setPassword(getOriginalValue(contextProperties,ConnectionHelper.getPassword(conn)));
  metadataConnection.setUsername(getOriginalValue(contextProperties,conn.getUsername()));
  metadataConnection.setDataSourceName(getOriginalValue(contextProperties,conn.getDatasourceName()));
  metadataConnection.setSchema(conn.getUiSchema());
  if (metadataConnection.getMapping() == null) {
    metadataConnection.setMapping(getOriginalValue(contextProperties,conn.getDbmsId()));
  }
}

Fixed version (ground truth):
/** 
 * DOC sizhaoliu Comment method "setMetadataConnectionParameter".
 * @param dbConn
 * @param metaConn
 * @param contextProperties
 * @return
 */
public static void setMetadataConnectionParameter(DatabaseConnection conn,IMetadataConnection metadataConnection,Properties contextProperties){
  if (conn == null || metadataConnection == null) {
    return;
  }
  ContextType contextType=getContextTypeForContextMode(conn,conn.getContextName());
  if (contextType == null) {
    return;
  }
  metadataConnection.setDriverJarPath(getOriginalValue(contextProperties,conn.getDriverJarPath()));
  metadataConnection.setDbType(getOriginalValue(contextProperties,conn.getDatabaseType()));
  EDatabaseTypeName edatabasetypeInstance=EDatabaseTypeName.getTypeFromDisplayName(getOriginalValue(contextProperties,conn.getDatabaseType()));
  String product=edatabasetypeInstance.getProduct();
  metadataConnection.setProduct(product);
  if (!ReponsitoryContextBridge.isDefautProject()) {
    Dbms defaultDbmsFromProduct=MetadataTalendType.getDefaultDbmsFromProduct(product);
    if (defaultDbmsFromProduct != null) {
      String mapping=defaultDbmsFromProduct.getId();
      metadataConnection.setMapping(mapping);
    }
  }
  metadataConnection.setDbVersionString(getOriginalValue(contextProperties,conn.getDbVersionString()));
  metadataConnection.setFileFieldName(getOriginalValue(contextProperties,conn.getFileFieldName()));
  metadataConnection.setUrl(getOriginalValue(contextProperties,conn.getURL()));
  metadataConnection.setAdditionalParams(getOriginalValue(contextProperties,conn.getAdditionalParams()));
  metadataConnection.setDriverClass(getOriginalValue(contextProperties,conn.getDriverClass()));
  metadataConnection.setServerName(getOriginalValue(contextProperties,conn.getServerName()));
  metadataConnection.setPort(getOriginalValue(contextProperties,conn.getPort()));
  metadataConnection.setDatabase(getOriginalValue(contextProperties,conn.getSID()));
  metadataConnection.setOtherParameter(getOriginalValue(contextProperties,ConnectionHelper.getOtherParameter(conn)));
  metadataConnection.setPassword(getOriginalValue(contextProperties,ConnectionHelper.getPassword(conn)));
  metadataConnection.setUsername(getOriginalValue(contextProperties,conn.getUsername()));
  metadataConnection.setDataSourceName(getOriginalValue(contextProperties,conn.getDatasourceName()));
  metadataConnection.setSchema(conn.getUiSchema());
  if (metadataConnection.getMapping() == null) {
    metadataConnection.setMapping(getOriginalValue(contextProperties,conn.getDbmsId()));
  }
}