Program: 126162
Project: 126162
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()) {
    int distributionIndex=distributionCombo.getSelectionIndex();
    int hiveVersionIndex=hiveVersionCombo.getSelectionIndex();
    int hiveModeIndex=hiveModeCombo.getSelectionIndex();
    int hiveServerIndex=hiveServerVersionCombo.getSelectionIndex();
    String key=HiveConnUtils.getHiveModeObj(distributionIndex,hiveVersionIndex,hiveModeIndex,hiveServerIndex).getKey();
    EDatabaseVersion4Drivers version=EDatabaseVersion4Drivers.indexOfByVersion(key);
    DatabaseConnection conn=getConnection();
    if (version != null) {
      conn.setDbVersionString(version.getVersionDisplay());
    }
    conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_DB_TYPE,EDatabaseConnTemplate.HIVE.getDBTypeName());
    conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_DISTRIBUTION,HiveConnUtils.getDistributionObj(distributionIndex).getKey());
    conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_VERSION,HiveConnUtils.getHiveVersionObj(distributionIndex,hiveVersionIndex).getKey());
    conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_MODE,HiveConnUtils.getHiveModeObj(distributionIndex,hiveVersionIndex,hiveModeIndex,hiveServerIndex).getKey());
    conn.getParameters().put(ConnParameterKeys.HIVE_SERVER_VERSION,HiveServerVersionUtils.extractKey(hiveServerIndex));
  }
}

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()) {
    int distributionIndex=distributionCombo.getSelectionIndex();
    int hiveVersionIndex=hiveVersionCombo.getSelectionIndex();
    int hiveModeIndex=hiveModeCombo.getSelectionIndex();
    int hiveServerIndex=getRealHiveServerIndex(distributionIndex,hiveVersionIndex,hiveServerVersionCombo.getSelectionIndex());
    String key=HiveConnUtils.getHiveModeObj(distributionIndex,hiveVersionIndex,hiveModeIndex,hiveServerIndex).getKey();
    EDatabaseVersion4Drivers version=EDatabaseVersion4Drivers.indexOfByVersion(key);
    DatabaseConnection conn=getConnection();
    if (version != null) {
      conn.setDbVersionString(version.getVersionDisplay());
    }
    conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_DB_TYPE,EDatabaseConnTemplate.HIVE.getDBTypeName());
    conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_DISTRIBUTION,HiveConnUtils.getDistributionObj(distributionIndex).getKey());
    conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_VERSION,HiveConnUtils.getHiveVersionObj(distributionIndex,hiveVersionIndex).getKey());
    conn.getParameters().put(ConnParameterKeys.CONN_PARA_KEY_HIVE_MODE,HiveConnUtils.getHiveModeObj(distributionIndex,hiveVersionIndex,hiveModeIndex,hiveServerIndex).getKey());
    conn.getParameters().put(ConnParameterKeys.HIVE_SERVER_VERSION,HiveServerVersionUtils.extractKey(hiveServerIndex));
  }
}