Program: 125871
Project: 125871
Buggy source:
/** 
 * <pre> Updates the parameter of Hive mode in connection. Put the following parameters in <code>DatabaseConnection</code> . <li>Hive distribution, the key is   {@link ConnParameterKeys#CONN_PARA_KEY_HIVE_DISTRIBUTION}</li> <li>Distro version, the key is   {@link ConnParameterKeys#CONN_PARA_KEY_HIVE_VERSION}</li> <li>Hive mode, the key is   {@link ConnParameterKeys#CONN_PARA_KEY_HIVE_MODE}</li> <li>Name node URL, the key is   {@link ConnParameterKeys#CONN_PARA_KEY_NAME_NODE_URL}</li> <li>Job Tracker URL, the key is   {@link ConnParameterKeys#CONN_PARA_KEY_JOB_TRACKER_URL}</li> <li>Hive Server version, the key is   {@link ConnParameterKeys#HIVE_SERVER_VERSION}</li>
 */
protected void doUpdateConnection(){
  if (!isContextMode()) {
    IHDistribution hiveDistribution=getCurrentHiveDistribution(true);
    IHDistributionVersion hiveVersion=hiveDistribution.getHDVersion(hiveVersionCombo.getText(),true);
    HiveModeInfo hiveMode=HiveModeInfo.getByDisplay(hiveModeCombo.getText());
    HiveServerVersionInfo serverVersion=HiveServerVersionInfo.getByDisplay(hiveServerVersionCombo.getText());
    DatabaseConnection conn=getConnection();
    if (hiveMode != null) {
      conn.setDbVersionString(hiveMode.getName());
    }
    conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_DB_TYPE,EDatabaseConnTemplate.HIVE.getDBTypeName());
    conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_DISTRIBUTION,hiveDistribution.getName());
    conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_VERSION,hiveVersion.getVersion());
    if (hiveMode != null) {
      conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_MODE,hiveMode.getName());
    }
    if (serverVersion != null) {
      conn.getParameters().put(ConnParameterKeys.HIVE_SERVER_VERSION,serverVersion.getKey());
    }
  }
}

Fixed version (ground truth):
/** 
 * <pre> Updates the parameter of Hive mode in connection. Put the following parameters in <code>DatabaseConnection</code> . <li>Hive distribution, the key is   {@link ConnParameterKeys#CONN_PARA_KEY_HIVE_DISTRIBUTION}</li> <li>Distro version, the key is   {@link ConnParameterKeys#CONN_PARA_KEY_HIVE_VERSION}</li> <li>Hive mode, the key is   {@link ConnParameterKeys#CONN_PARA_KEY_HIVE_MODE}</li> <li>Name node URL, the key is   {@link ConnParameterKeys#CONN_PARA_KEY_NAME_NODE_URL}</li> <li>Job Tracker URL, the key is   {@link ConnParameterKeys#CONN_PARA_KEY_JOB_TRACKER_URL}</li> <li>Hive Server version, the key is   {@link ConnParameterKeys#HIVE_SERVER_VERSION}</li>
 */
protected void doUpdateConnection(){
  if (!isContextMode()) {
    IHDistribution hiveDistribution=getCurrentHiveDistribution(true);
    if (hiveDistribution == null) {
      return;
    }
    IHDistributionVersion hiveVersion=hiveDistribution.getHDVersion(hiveVersionCombo.getText(),true);
    HiveModeInfo hiveMode=HiveModeInfo.getByDisplay(hiveModeCombo.getText());
    HiveServerVersionInfo serverVersion=HiveServerVersionInfo.getByDisplay(hiveServerVersionCombo.getText());
    DatabaseConnection conn=getConnection();
    if (hiveMode != null) {
      conn.setDbVersionString(hiveMode.getName());
    }
    conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_DB_TYPE,EDatabaseConnTemplate.HIVE.getDBTypeName());
    conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_DISTRIBUTION,hiveDistribution.getName());
    if (hiveVersion != null) {
      conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_VERSION,hiveVersion.getVersion());
    }
    if (hiveMode != null) {
      conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_MODE,hiveMode.getName());
    }
    if (serverVersion != null) {
      conn.getParameters().put(ConnParameterKeys.HIVE_SERVER_VERSION,serverVersion.getKey());
    }
  }
}