Program: 127938
Project: 127938
Buggy source:
/** 
 * Set up the URL by checking the current hive mode. Added by Marvin Wang on Sep 4, 2012.
 * @return
 */
private String getStringConnection(){
  String s=null;
  String versionStr=dbVersionCombo.getText();
  if (isContextMode()) {
    s=DBConnectionContextUtils.getUrlConnectionString(connectionItem,true);
  }
 else {
    if (EDatabaseTypeName.HIVE.getDisplayName().equals(dbTypeCombo.getText())) {
      int distributionIndex=distributionCombo.getSelectionIndex();
      int hiveVersionIndex=hiveVersionCombo.getSelectionIndex();
      int hiveModeIndex=hiveModeCombo.getSelectionIndex();
      versionStr=HiveConnUtils.getHiveModeObj(distributionIndex,hiveVersionIndex,hiveModeIndex).getKey();
      if (HiveConnUtils.isSupportHiveServer2(distributionIndex,hiveVersionIndex)) {
        if (HiveServerVersionInfo.HIVE_SERVER_2.getDisplayName().equals(hiveServerVersionCombo.getText())) {
          if (HiveConnUtils.isEmbeddedMode(distributionIndex,hiveVersionIndex,hiveModeIndex)) {
            s=DatabaseConnStrUtil.getHive2EmbeddedURLString(getConnection(),false);
          }
 else {
            s=DatabaseConnStrUtil.getHive2StandaloneURLString(getConnection(),false);
          }
        }
 else         if (HiveServerVersionInfo.HIVE_SERVER_1.getDisplayName().equals(hiveServerVersionCombo.getText())) {
          if (HiveConnUtils.isEmbeddedMode(distributionIndex,hiveVersionIndex,hiveModeIndex)) {
            s=DatabaseConnStrUtil.getHive1EmbeddedURLString(getConnection(),false);
          }
 else {
            s=DatabaseConnStrUtil.getHive1StandaloneURLString(getConnection(),false);
          }
        }
      }
 else {
        if (HiveConnUtils.isEmbeddedMode(distributionIndex,hiveVersionIndex,hiveModeIndex)) {
          s=DatabaseConnStrUtil.getHive1EmbeddedURLString(getConnection(),false);
        }
 else {
          s=DatabaseConnStrUtil.getHive1StandaloneURLString(getConnection(),false);
        }
      }
    }
 else {
      EDatabaseVersion4Drivers version=EDatabaseVersion4Drivers.indexOfByVersionDisplay(versionStr);
      if (version != null) {
        versionStr=version.getVersionValue();
      }
      s=DatabaseConnStrUtil.getURLString(dbTypeCombo.getText(),versionStr,serverText.getText(),usernameText.getText(),passwordText.getText(),portText.getText(),sidOrDatabaseText.getText(),fileField.getText().toLowerCase(),datasourceText.getText(),directoryField.getText(),additionParamText.getText());
    }
  }
  return s;
}

Fixed version (ground truth):
/** 
 * Set up the URL by checking the current hive mode. Added by Marvin Wang on Sep 4, 2012.
 * @return
 */
private String getStringConnection(){
  String s=null;
  String versionStr=dbVersionCombo.getText();
  if (isContextMode()) {
    s=DBConnectionContextUtils.getUrlConnectionString(connectionItem,true);
  }
 else {
    if (EDatabaseTypeName.HIVE.getDisplayName().equals(dbTypeCombo.getText())) {
      int distributionIndex=distributionCombo.getSelectionIndex();
      int hiveVersionIndex=hiveVersionCombo.getSelectionIndex();
      int hiveModeIndex=hiveModeCombo.getSelectionIndex();
      versionStr=HiveConnUtils.getHiveModeObj(distributionIndex,hiveVersionIndex,hiveModeIndex).getKey();
      if (HiveConnUtils.isSupportHiveServer2(distributionIndex,hiveVersionIndex)) {
        if (HiveServerVersionInfo.HIVE_SERVER_2.getDisplayName().equals(hiveServerVersionCombo.getText())) {
          if (HiveConnUtils.isEmbeddedMode(distributionIndex,hiveVersionIndex,hiveModeIndex)) {
            s=DatabaseConnStrUtil.getHive2EmbeddedURLString(getConnection(),false);
          }
 else {
            s=DatabaseConnStrUtil.getHive2StandaloneURLString(getConnection(),false);
          }
        }
 else         if (HiveServerVersionInfo.HIVE_SERVER_1.getDisplayName().equals(hiveServerVersionCombo.getText())) {
          if (HiveConnUtils.isEmbeddedMode(distributionIndex,hiveVersionIndex,hiveModeIndex)) {
            s=DatabaseConnStrUtil.getHive1EmbeddedURLString(getConnection(),false);
          }
 else {
            s=DatabaseConnStrUtil.getHive1StandaloneURLString(getConnection(),false);
          }
        }
      }
 else {
        if (HiveConnUtils.isEmbeddedMode(distributionIndex,hiveVersionIndex,hiveModeIndex)) {
          s=DatabaseConnStrUtil.getHive1EmbeddedURLString(getConnection(),false);
        }
 else {
          s=DatabaseConnStrUtil.getHive1StandaloneURLString(getConnection(),false);
        }
      }
    }
 else {
      EDatabaseVersion4Drivers version=EDatabaseVersion4Drivers.indexOfByVersionDisplay(versionStr);
      if (version != null) {
        versionStr=version.getVersionValue();
      }
      s=DatabaseConnStrUtil.getURLString(dbTypeCombo.getText(),versionStr,serverText.getText(),usernameText.getText(),passwordText.getText(),portText.getText(),sidOrDatabaseText.getText(),fileField.getText(),datasourceText.getText(),directoryField.getText(),additionParamText.getText());
    }
  }
  return s;
}