Program: 128005
Project: 128005
Buggy source:
/** 
 * Initializes hive info for Hive UI. If the distribution value from connection is <code>null</code>, the default selected indexs of hive combos like distribution, hive vesion and hive mode are 0. Added by Marvin Wang on Aug 10, 2012.
 */
protected void initHiveInfo(){
  DatabaseConnection connection=getConnection();
  String distributionObj=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_DISTRIBUTION);
  String hiveVersion=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_VERSION);
  String hiveMode=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_MODE);
  String hiveServerKey=connection.getParameters().get(ConnParameterKeys.HIVE_SERVER_VERSION);
  if (distributionObj != null) {
    currIndexofDistribution=HiveConnUtils.getIndexOfDistribution(distributionObj == null ? null : ((String)distributionObj));
    updateHiveDistributionAndMakeSelection(currIndexofDistribution);
    currIndexofHiveVersion=HiveConnUtils.getIndexOfHiveVersion(distributionObj == null ? null : ((String)distributionObj),hiveVersion == null ? null : ((String)hiveVersion));
    updateHiveVersionAndMakeSelection(currIndexofDistribution,currIndexofHiveVersion);
    currIndexofHiveMode=HiveConnUtils.getIndexOfHiveMode(distributionObj == null ? null : ((String)distributionObj),hiveVersion == null ? null : ((String)hiveVersion),hiveMode == null ? "String_Node_Str" : ((String)hiveMode));
    updateHiveModeAndMakeSelection(currIndexofDistribution,currIndexofHiveVersion,currIndexofHiveMode);
    if (EDatabaseTypeName.HIVE.getDisplayName().equals(connection.getDatabaseType())) {
      doHiveModeModify();
    }
  }
 else {
    updateHiveDistributionAndMakeSelection(0);
    updateHiveVersionAndMakeSelection(0,0);
    updateHiveModeAndMakeSelection(0,0,0);
    doHiveModeModify();
  }
  if (isHiveEmbeddedMode()) {
    String nameNodeURLstr=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_NAME_NODE_URL);
    String jobTrackerURLStr=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_JOB_TRACKER_URL);
    String metastoreConnURLStr=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_METASTORE_CONN_URL);
    String metastoreConnUserNameStr=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_METASTORE_CONN_USERNAME);
    String metastoreConnPasswordStr=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_METASTORE_CONN_PASSWORD);
    String metastoreConnDriverJarStr=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_METASTORE_CONN_DRIVER_JAR);
    String metastoreConnDriverNameStr=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_METASTORE_CONN_DRIVER_NAME);
    nameNodeURLTxt.setText(nameNodeURLstr == null ? "String_Node_Str" : nameNodeURLstr);
    jobTrackerURLTxt.setText(jobTrackerURLStr == null ? "String_Node_Str" : jobTrackerURLStr);
    metastoreConnURLTxt.setText(metastoreConnURLStr == null ? "String_Node_Str" : metastoreConnURLStr);
    metastoreConnUserName.setText(metastoreConnUserNameStr == null ? "String_Node_Str" : metastoreConnUserNameStr);
    metastoreConnPassword.setText(metastoreConnPasswordStr == null ? "String_Node_Str" : metastoreConnPasswordStr);
    metastoreConnDriverJar.setText(metastoreConnDriverJarStr == null ? "String_Node_Str" : metastoreConnDriverJarStr);
    metastoreConnDriverName.setText(metastoreConnDriverNameStr == null ? "String_Node_Str" : metastoreConnDriverNameStr);
  }
}

Fixed version (ground truth):
/** 
 * Initializes hive info for Hive UI. If the distribution value from connection is <code>null</code>, the default selected indexs of hive combos like distribution, hive vesion and hive mode are 0. Added by Marvin Wang on Aug 10, 2012.
 */
protected void initHiveInfo(){
  DatabaseConnection connection=getConnection();
  String distributionObj=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_DISTRIBUTION);
  String hiveVersion=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_VERSION);
  String hiveMode=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_MODE);
  String hiveServerKey=connection.getParameters().get(ConnParameterKeys.HIVE_SERVER_VERSION);
  if (distributionObj != null) {
    currIndexofDistribution=HiveConnUtils.getIndexOfDistribution(distributionObj == null ? null : ((String)distributionObj));
    updateHiveDistributionAndMakeSelection(currIndexofDistribution);
    currIndexofHiveVersion=HiveConnUtils.getIndexOfHiveVersion(distributionObj == null ? null : ((String)distributionObj),hiveVersion == null ? null : ((String)hiveVersion));
    updateHiveVersionAndMakeSelection(currIndexofDistribution,currIndexofHiveVersion);
    currIndexofHiveMode=HiveConnUtils.getIndexOfHiveMode(distributionObj == null ? null : ((String)distributionObj),hiveVersion == null ? null : ((String)hiveVersion),hiveMode == null ? null : ((String)hiveMode));
    updateHiveModeAndMakeSelection(currIndexofDistribution,currIndexofHiveVersion,currIndexofHiveMode);
    if (EDatabaseTypeName.HIVE.getDisplayName().equals(connection.getDatabaseType())) {
      doHiveModeModify();
    }
  }
 else {
    updateHiveDistributionAndMakeSelection(0);
    updateHiveVersionAndMakeSelection(0,0);
    updateHiveModeAndMakeSelection(0,0,0);
    doHiveModeModify();
  }
  if (isHiveEmbeddedMode()) {
    String nameNodeURLstr=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_NAME_NODE_URL);
    String jobTrackerURLStr=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_JOB_TRACKER_URL);
    String metastoreConnURLStr=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_METASTORE_CONN_URL);
    String metastoreConnUserNameStr=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_METASTORE_CONN_USERNAME);
    String metastoreConnPasswordStr=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_METASTORE_CONN_PASSWORD);
    String metastoreConnDriverJarStr=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_METASTORE_CONN_DRIVER_JAR);
    String metastoreConnDriverNameStr=connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_METASTORE_CONN_DRIVER_NAME);
    nameNodeURLTxt.setText(nameNodeURLstr == null ? "String_Node_Str" : nameNodeURLstr);
    jobTrackerURLTxt.setText(jobTrackerURLStr == null ? "String_Node_Str" : jobTrackerURLStr);
    metastoreConnURLTxt.setText(metastoreConnURLStr == null ? "String_Node_Str" : metastoreConnURLStr);
    metastoreConnUserName.setText(metastoreConnUserNameStr == null ? "String_Node_Str" : metastoreConnUserNameStr);
    metastoreConnPassword.setText(metastoreConnPasswordStr == null ? "String_Node_Str" : metastoreConnPasswordStr);
    metastoreConnDriverJar.setText(metastoreConnDriverJarStr == null ? "String_Node_Str" : metastoreConnDriverJarStr);
    metastoreConnDriverName.setText(metastoreConnDriverNameStr == null ? "String_Node_Str" : metastoreConnDriverNameStr);
  }
}