Program: 137258
Project: 137258
Buggy source:
/** 
 * DOC xqliu Comment method "createConnectionParam".
 * @param conn
 * @return
 */
public static DBConnectionParameter createConnectionParam(Connection conn){
  DBConnectionParameter connectionParam=new DBConnectionParameter();
  Properties properties=new Properties();
  properties.setProperty(TaggedValueHelper.USER,JavaSqlFactory.getUsername(conn));
  properties.setProperty(TaggedValueHelper.PASSWORD,JavaSqlFactory.getPassword(conn));
  connectionParam.setParameters(properties);
  connectionParam.setName(conn.getName());
  connectionParam.setAuthor(MetadataHelper.getAuthor(conn));
  connectionParam.setDescription(MetadataHelper.getDescription(conn));
  connectionParam.setPurpose(MetadataHelper.getPurpose(conn));
  connectionParam.setStatus(MetadataHelper.getDevStatus(conn));
  connectionParam.setDriverPath(((DatabaseConnection)conn).getDriverJarPath());
  connectionParam.setDriverClassName(JavaSqlFactory.getDriverClass(conn));
  connectionParam.setJdbcUrl(JavaSqlFactory.getURL(conn));
  connectionParam.setHost(ConnectionUtils.getServerName(conn));
  connectionParam.setPort(ConnectionUtils.getPort(conn));
  if (conn instanceof DatabaseConnection) {
    connectionParam.setSqlTypeName(((DatabaseConnection)conn).getDatabaseType());
    String dbmsId=((DatabaseConnection)conn).getDbmsId();
    connectionParam.setDbmsId(dbmsId);
    connectionParam.setFilterCatalog(dbmsId);
  }
  if (conn instanceof DatabaseConnection) {
    DatabaseConnection dbConnection=(DatabaseConnection)conn;
    connectionParam.setOtherParameter(dbConnection.getUiSchema());
    connectionParam.setFilterSchema(dbConnection.getUiSchema());
  }
  connectionParam.setDbName(ConnectionUtils.getSID(conn));
  String retrieveAllMetadata=MetadataHelper.getRetrieveAllMetadata(conn);
  connectionParam.setRetrieveAllMetadata(retrieveAllMetadata == null ? true : new Boolean(retrieveAllMetadata).booleanValue());
  return connectionParam;
}

Fixed version (ground truth):
/** 
 * DOC xqliu Comment method "createConnectionParam".
 * @param conn
 * @return
 */
public static DBConnectionParameter createConnectionParam(Connection conn){
  DBConnectionParameter connectionParam=new DBConnectionParameter();
  Properties properties=new Properties();
  properties.setProperty(TaggedValueHelper.USER,JavaSqlFactory.getUsername(conn));
  properties.setProperty(TaggedValueHelper.PASSWORD,JavaSqlFactory.getPassword(conn));
  connectionParam.setParameters(properties);
  connectionParam.setName(conn.getName());
  connectionParam.setAuthor(MetadataHelper.getAuthor(conn));
  connectionParam.setDescription(MetadataHelper.getDescription(conn));
  connectionParam.setPurpose(MetadataHelper.getPurpose(conn));
  connectionParam.setStatus(MetadataHelper.getDevStatus(conn));
  connectionParam.setDriverPath(((DatabaseConnection)conn).getDriverJarPath());
  connectionParam.setDriverClassName(JavaSqlFactory.getDriverClass(conn));
  connectionParam.setJdbcUrl(JavaSqlFactory.getURL(conn));
  connectionParam.setHost(JavaSqlFactory.getServerName(conn));
  connectionParam.setPort(JavaSqlFactory.getPort(conn));
  if (conn instanceof DatabaseConnection) {
    connectionParam.setSqlTypeName(((DatabaseConnection)conn).getDatabaseType());
    String dbmsId=((DatabaseConnection)conn).getDbmsId();
    connectionParam.setDbmsId(dbmsId);
    connectionParam.setFilterCatalog(dbmsId);
  }
  if (conn instanceof DatabaseConnection) {
    DatabaseConnection dbConnection=(DatabaseConnection)conn;
    connectionParam.setOtherParameter(dbConnection.getUiSchema());
    connectionParam.setFilterSchema(dbConnection.getUiSchema());
  }
  connectionParam.setDbName(JavaSqlFactory.getSID(conn));
  String retrieveAllMetadata=MetadataHelper.getRetrieveAllMetadata(conn);
  connectionParam.setRetrieveAllMetadata(retrieveAllMetadata == null ? true : new Boolean(retrieveAllMetadata).booleanValue());
  return connectionParam;
}