Program: 126009
Project: 126009
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())) {
      String template=null;
      if (HiveServerVersionInfo.HIVE_SERVER_2.getDisplayName().equals(hiveServerVersionCombo.getText())) {
        template=DbConnStrForHive.URL_HIVE_2_TEMPLATE;
      }
 else {
        template=DbConnStrForHive.URL_HIVE_1_TEMPLATE;
      }
      if (!isEmbeddedMode()) {
        s=DatabaseConnStrUtil.getHiveURLString(getConnection(),getConnection().getServerName(),getConnection().getPort(),getConnection().getSID(),template);
      }
 else {
        s=template;
      }
    }
 else     if (EDatabaseTypeName.IMPALA.getDisplayName().equals(dbTypeCombo.getText())) {
      String template=DbConnStrForHive.URL_HIVE_2_TEMPLATE;
      s=DatabaseConnStrUtil.getImpalaString(getConnection(),getConnection().getServerName(),getConnection().getPort(),getConnection().getSID(),template);
      getConnection().setUiSchema(getConnection().getSID());
    }
 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;
}

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())) {
      String template=null;
      if (HiveServerVersionInfo.HIVE_SERVER_2.getDisplayName().equals(hiveServerVersionCombo.getText())) {
        template=DbConnStrForHive.URL_HIVE_2_TEMPLATE;
      }
 else {
        template=DbConnStrForHive.URL_HIVE_1_TEMPLATE;
      }
      if (!isEmbeddedMode()) {
        s=DatabaseConnStrUtil.getHiveURLStringForStandardalone(template,getConnection(),getConnection().getServerName(),getConnection().getPort(),getConnection().getSID());
      }
 else {
        s=template;
      }
    }
 else     if (EDatabaseTypeName.IMPALA.getDisplayName().equals(dbTypeCombo.getText())) {
      String template=DbConnStrForHive.URL_HIVE_2_TEMPLATE;
      s=DatabaseConnStrUtil.getImpalaString(getConnection(),getConnection().getServerName(),getConnection().getPort(),getConnection().getSID(),template);
      getConnection().setUiSchema(getConnection().getSID());
    }
 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;
}