Program: 103512
Project: 103512
Buggy source:
/** 
 * Initializes the SipRegistrarConnection that this class will be using.
 * @param accountID the ID of the account that this registrar is associatedwith.
 * @throws java.lang.IllegalArgumentException if one or more accountproperties have invalid values.
 */
private void initRegistrarConnection(SipAccountID accountID) throws IllegalArgumentException {
  String registrarAddressStr=accountID.getAccountPropertyString(ProtocolProviderFactory.SERVER_ADDRESS);
  if (registrarAddressStr == null) {
    String userID=accountID.getAccountPropertyString(ProtocolProviderFactory.USER_ID);
    int index=userID.indexOf('@');
    if (index > -1)     registrarAddressStr=userID.substring(index + 1);
  }
  if (registrarAddressStr == null || registrarAddressStr.trim().length() == 0) {
    initRegistrarlessConnection(accountID);
    return;
  }
  InetSocketAddress[] registrarSocketAddresses=null;
  int registrarPort=ListeningPoint.PORT_5060;
  try {
    String registrarTransport=accountID.getAccountPropertyString(ProtocolProviderFactory.PREFERRED_TRANSPORT);
    if (registrarTransport == null)     registrarTransport=getDefaultTransport();
    registrarSocketAddresses=resolveSipAddress(registrarAddressStr,registrarTransport);
    accountID.putAccountProperty(ProtocolProviderFactory.SERVER_ADDRESS_VALIDATED,Boolean.toString(true));
  }
 catch (  UnknownHostException ex) {
    if (logger.isDebugEnabled())     logger.debug(registrarAddressStr + "String_Node_Str" + "String_Node_Str",ex);
    boolean isServerValidated=accountID.getAccountPropertyBoolean(ProtocolProviderFactory.SERVER_ADDRESS_VALIDATED,false);
    if (!isServerValidated) {
      throw new IllegalArgumentException(registrarAddressStr + "String_Node_Str" + "String_Node_Str",ex);
    }
  }
  if (registrarSocketAddresses == null || registrarSocketAddresses.length == 0) {
    fireRegistrationStateChanged(RegistrationState.UNREGISTERED,RegistrationState.CONNECTION_FAILED,RegistrationStateChangeEvent.REASON_SERVER_NOT_FOUND,"String_Node_Str");
    return;
  }
  registrarPort=accountID.getAccountPropertyInt(ProtocolProviderFactory.SERVER_PORT,registrarPort);
  if (registrarPort > NetworkUtils.MAX_PORT_NUMBER) {
    throw new IllegalArgumentException(registrarPort + "String_Node_Str" + NetworkUtils.MAX_PORT_NUMBER+ "String_Node_Str");
  }
  String registrarTransport=accountID.getAccountPropertyString(ProtocolProviderFactory.PREFERRED_TRANSPORT);
  if (registrarTransport != null && registrarTransport.length() > 0) {
    if (!registrarTransport.equals(ListeningPoint.UDP) && !registrarTransport.equals(ListeningPoint.TCP) && !registrarTransport.equals(ListeningPoint.TLS)) {
      throw new IllegalArgumentException(registrarTransport + "String_Node_Str" + "String_Node_Str");
    }
  }
 else {
    registrarTransport=ListeningPoint.UDP;
  }
  int expires=SipActivator.getConfigurationService().getInt(REGISTRATION_EXPIRATION,SipRegistrarConnection.DEFAULT_REGISTRATION_EXPIRATION);
  try {
    this.sipRegistrarConnection=new SipRegistrarConnection(registrarSocketAddresses,registrarTransport,expires,this);
  }
 catch (  ParseException ex) {
    logger.error("String_Node_Str" + registrarSocketAddresses[0].getAddress().getHostAddress(),ex);
    throw new IllegalArgumentException("String_Node_Str" + registrarSocketAddresses[0].getAddress().getHostAddress() + "String_Node_Str"+ ex.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Initializes the SipRegistrarConnection that this class will be using.
 * @param accountID the ID of the account that this registrar is associatedwith.
 * @throws java.lang.IllegalArgumentException if one or more accountproperties have invalid values.
 */
private void initRegistrarConnection(SipAccountID accountID) throws IllegalArgumentException {
  String registrarAddressStr=accountID.getAccountPropertyString(ProtocolProviderFactory.SERVER_ADDRESS);
  if (registrarAddressStr == null) {
    String userID=accountID.getAccountPropertyString(ProtocolProviderFactory.USER_ID);
    int index=userID.indexOf('@');
    if (index > -1)     registrarAddressStr=userID.substring(index + 1);
  }
  if (registrarAddressStr == null || registrarAddressStr.trim().length() == 0) {
    initRegistrarlessConnection(accountID);
    return;
  }
  InetSocketAddress[] registrarSocketAddresses=null;
  String registrarTransport=accountID.getAccountPropertyString(ProtocolProviderFactory.PREFERRED_TRANSPORT);
  if (registrarTransport != null && registrarTransport.length() > 0) {
    if (!registrarTransport.equals(ListeningPoint.UDP) && !registrarTransport.equals(ListeningPoint.TCP) && !registrarTransport.equals(ListeningPoint.TLS)) {
      throw new IllegalArgumentException(registrarTransport + "String_Node_Str" + "String_Node_Str");
    }
  }
 else {
    registrarTransport=getDefaultTransport();
  }
  int registrarPort=ListeningPoint.PORT_5060;
  try {
    if (accountID.getAccountProperty(ProtocolProviderFactory.SERVER_PORT) != null) {
      ArrayList<InetSocketAddress> registrarSocketAddressesList=new ArrayList<InetSocketAddress>();
      resolveAddresses(registrarAddressStr,registrarSocketAddressesList,Boolean.getBoolean("String_Node_Str"),registrarPort);
      registrarSocketAddresses=registrarSocketAddressesList.toArray(new InetSocketAddress[0]);
    }
 else {
      registrarSocketAddresses=resolveSipAddress(registrarAddressStr,registrarTransport);
    }
    if (registrarSocketAddresses != null && registrarSocketAddresses.length > 0)     accountID.putAccountProperty(ProtocolProviderFactory.SERVER_ADDRESS_VALIDATED,Boolean.toString(true));
  }
 catch (  UnknownHostException ex) {
    if (logger.isDebugEnabled())     logger.debug(registrarAddressStr + "String_Node_Str" + "String_Node_Str",ex);
    boolean isServerValidated=accountID.getAccountPropertyBoolean(ProtocolProviderFactory.SERVER_ADDRESS_VALIDATED,false);
    if (!isServerValidated) {
      throw new IllegalArgumentException(registrarAddressStr + "String_Node_Str" + "String_Node_Str",ex);
    }
  }
  if (registrarSocketAddresses == null || registrarSocketAddresses.length == 0) {
    fireRegistrationStateChanged(RegistrationState.UNREGISTERED,RegistrationState.CONNECTION_FAILED,RegistrationStateChangeEvent.REASON_SERVER_NOT_FOUND,"String_Node_Str");
    return;
  }
  registrarPort=accountID.getAccountPropertyInt(ProtocolProviderFactory.SERVER_PORT,registrarPort);
  if (registrarPort > NetworkUtils.MAX_PORT_NUMBER) {
    throw new IllegalArgumentException(registrarPort + "String_Node_Str" + NetworkUtils.MAX_PORT_NUMBER+ "String_Node_Str");
  }
  int expires=SipActivator.getConfigurationService().getInt(REGISTRATION_EXPIRATION,SipRegistrarConnection.DEFAULT_REGISTRATION_EXPIRATION);
  try {
    this.sipRegistrarConnection=new SipRegistrarConnection(registrarSocketAddresses,registrarTransport,expires,this);
  }
 catch (  ParseException ex) {
    logger.error("String_Node_Str" + registrarSocketAddresses[0].getAddress().getHostAddress(),ex);
    throw new IllegalArgumentException("String_Node_Str" + registrarSocketAddresses[0].getAddress().getHostAddress() + "String_Node_Str"+ ex.getMessage());
  }
}