Program: 149506
Project: 149506
Buggy source:
public static LoginResult login(final String ssid,final String user,final String password){
  int rc=Constants.WISPR_RESPONSE_CODE_ACCESS_GATEWAY_INTERNAL_ERROR;
  String rm=null;
  String lu=null;
  if ((user.length() != 0) && (password.length() != 0)) {
    String c=LoginManager.getTestUrlContent();
    if (c != null) {
      if (!LoginManager.isConnected(c)) {
        if (LoginManager.isFon(ssid)) {
          c=LoginManager.getXml(c);
          if (c != null) {
            final FonInfoHandler wih=new FonInfoHandler();
            if (LoginManager.parseXml(c,wih) && (wih.getMessageType() == Constants.WISPR_MESSAGE_TYPE_INITIAL_REDIRECT) && (wih.getResponseCode() == Constants.WISPR_RESPONSE_CODE_NO_ERROR)) {
              c=wih.getLoginURL();
            }
          }
        }
 else         if (LoginManager.isSfr(ssid)) {
          c=LoginManager.getSfrUrl(c);
        }
        if (c != null) {
          c=LoginManager.doLogin(c,user,password);
          if (c != null) {
            FonResponseHandler wrh=new FonResponseHandler();
            if (LoginManager.parseXml(c,wrh)) {
              rc=wrh.getResponseCode();
              if (wrh.getResponseCode() == Constants.WISPR_RESPONSE_CODE_AUTH_PENDING) {
                c=HttpUtils.get(wrh.getLoginResultsURL(),Constants.HTTP_TIMEOUT);
                if (c != null) {
                  wrh=new FonResponseHandler();
                  if (LoginManager.parseXml(c,wrh)) {
                    rc=wrh.getResponseCode();
                    lu=wrh.getLogoffURL();
                  }
                }
              }
 else               if (rc == Constants.WISPR_RESPONSE_CODE_LOGIN_SUCCEEDED) {
                lu=wrh.getLogoffURL();
              }
 else               if (rc == Constants.WISPR_RESPONSE_CODE_LOGIN_FAILED) {
                rc=wrh.getFonResponseCode();
                rm=wrh.getReplyMessage();
              }
            }
          }
 else           if (LoginManager.isConnected(LoginManager.getTestUrlContent())) {
            rc=Constants.WISPR_RESPONSE_CODE_LOGIN_SUCCEEDED;
          }
        }
 else {
          rc=Constants.CUST_WISPR_NOT_PRESENT;
        }
      }
 else {
        rc=Constants.CUST_ALREADY_CONNECTED;
      }
    }
  }
 else {
    rc=Constants.CUST_CREDENTIALS_ERROR;
  }
  return new LoginResult(rc,rm,lu);
}

Fixed version (ground truth):
public static LoginResult login(final String ssid,final String user,final String password){
  int rc=Constants.WISPR_RESPONSE_CODE_ACCESS_GATEWAY_INTERNAL_ERROR;
  String rm=null;
  String lu=null;
  if ((user.length() != 0) && (password.length() != 0)) {
    String c=LoginManager.getTestUrlContent();
    if (c != null) {
      if (!LoginManager.isConnected(c)) {
        if (LoginManager.isFon(ssid)) {
          c=LoginManager.getXml(c);
          if (c != null) {
            final FonInfoHandler wih=new FonInfoHandler();
            if (LoginManager.parseXml(c,wih) && (wih.getMessageType() == Constants.WISPR_MESSAGE_TYPE_INITIAL_REDIRECT) && (wih.getResponseCode() == Constants.WISPR_RESPONSE_CODE_NO_ERROR)) {
              c=wih.getLoginURL();
            }
          }
        }
 else         if (LoginManager.isSfr(ssid)) {
          c=LoginManager.getSfrUrl(c);
        }
        if (c != null) {
          c=LoginManager.doLogin(c,user,password);
          if (c != null) {
            FonResponseHandler wrh=new FonResponseHandler();
            if (LoginManager.parseXml(c,wrh)) {
              rc=wrh.getResponseCode();
              if (rc == Constants.WISPR_RESPONSE_CODE_AUTH_PENDING) {
                c=HttpUtils.get(wrh.getLoginResultsURL(),Constants.HTTP_TIMEOUT);
                if (c != null) {
                  wrh=new FonResponseHandler();
                  if (LoginManager.parseXml(c,wrh)) {
                    rc=wrh.getResponseCode();
                    lu=wrh.getLogoffURL();
                  }
                }
              }
 else               if (rc == Constants.WISPR_RESPONSE_CODE_LOGIN_SUCCEEDED) {
                lu=wrh.getLogoffURL();
              }
 else               if (rc == Constants.WISPR_RESPONSE_CODE_LOGIN_FAILED) {
                rc=wrh.getFonResponseCode();
                rm=wrh.getReplyMessage();
              }
 else {
                rc=Constants.FON_UNKNOWN_ERROR;
              }
            }
          }
 else           if (LoginManager.isConnected(LoginManager.getTestUrlContent())) {
            rc=Constants.WISPR_RESPONSE_CODE_LOGIN_SUCCEEDED;
          }
        }
 else {
          rc=Constants.CUST_WISPR_NOT_PRESENT;
        }
      }
 else {
        rc=Constants.CUST_ALREADY_CONNECTED;
      }
    }
  }
 else {
    rc=Constants.CUST_CREDENTIALS_ERROR;
  }
  return new LoginResult(rc,rm,lu);
}