Program: 63428
Project: 63428
Buggy source:
public Session create(SessionID sessionID,SessionSettings settings) throws ConfigError {
  try {
    String connectionType=null;
    boolean rejectInvalideMessage=getSetting(settings,sessionID,Session.REJECT_INVALID_MESSAGE,true);
    if (settings.isSetting(sessionID,SessionFactory.SETTING_CONNECTION_TYPE)) {
      connectionType=settings.getString(sessionID,SessionFactory.SETTING_CONNECTION_TYPE);
    }
    if (connectionType == null) {
      throw new ConfigError("String_Node_Str");
    }
    if (!connectionType.equals(SessionFactory.ACCEPTOR_CONNECTION_TYPE) && !connectionType.equals(SessionFactory.INITIATOR_CONNECTION_TYPE)) {
      throw new ConfigError("String_Node_Str");
    }
    if (connectionType.equals(SessionFactory.ACCEPTOR_CONNECTION_TYPE) && settings.isSetting(sessionID,SessionSettings.SESSION_QUALIFIER)) {
      throw new ConfigError("String_Node_Str");
    }
    DefaultApplVerID senderDefaultApplVerID=null;
    if (sessionID.isFIXT()) {
      if (!settings.isSetting(sessionID,Session.SETTING_DEFAULT_APPL_VER_ID)) {
        throw new ConfigError(Session.SETTING_DEFAULT_APPL_VER_ID + "String_Node_Str");
      }
      senderDefaultApplVerID=new DefaultApplVerID(toApplVerID(settings.getString(sessionID,Session.SETTING_DEFAULT_APPL_VER_ID)).getValue());
    }
    boolean useDataDictionary=true;
    if (settings.isSetting(sessionID,Session.SETTING_USE_DATA_DICTIONARY)) {
      useDataDictionary=settings.getBool(sessionID,Session.SETTING_USE_DATA_DICTIONARY);
    }
    DefaultDataDictionaryProvider dataDictionaryProvider=null;
    if (useDataDictionary) {
      dataDictionaryProvider=new DefaultDataDictionaryProvider();
      if (sessionID.isFIXT()) {
        processFixtDataDictionaries(sessionID,settings,dataDictionaryProvider);
      }
 else {
        processPreFixtDataDictionary(sessionID,settings,dataDictionaryProvider);
      }
    }
    int heartbeatInterval=0;
    if (connectionType.equals(SessionFactory.INITIATOR_CONNECTION_TYPE)) {
      rejectInvalideMessage=false;
      heartbeatInterval=(int)settings.getLong(sessionID,Session.SETTING_HEARTBTINT);
      if (heartbeatInterval <= 0) {
        throw new ConfigError("String_Node_Str");
      }
    }
    boolean checkLatency=getSetting(settings,sessionID,Session.SETTING_CHECK_LATENCY,true);
    int maxLatency=getSetting(settings,sessionID,Session.SETTING_MAX_LATENCY,Session.DEFAULT_MAX_LATENCY);
    double testRequestDelayMultiplier=getSetting(settings,sessionID,Session.SETTING_TEST_REQUEST_DELAY_MULTIPLIER,Session.DEFAULT_TEST_REQUEST_DELAY_MULTIPLIER);
    boolean millisInTimestamp=getSetting(settings,sessionID,Session.SETTING_MILLISECONDS_IN_TIMESTAMP,true);
    boolean resetOnLogout=getSetting(settings,sessionID,Session.SETTING_RESET_ON_LOGOUT,false);
    boolean resetOnDisconnect=getSetting(settings,sessionID,Session.SETTING_RESET_ON_DISCONNECT,false);
    boolean resetOnLogon=getSetting(settings,sessionID,Session.SETTING_RESET_ON_LOGON,false);
    boolean refreshAtLogon=getSetting(settings,sessionID,Session.SETTING_REFRESH_ON_LOGON,false);
    boolean checkCompID=getSetting(settings,sessionID,Session.SETTING_CHECK_COMP_ID,true);
    boolean redundantResentRequestAllowed=getSetting(settings,sessionID,Session.SETTING_SEND_REDUNDANT_RESEND_REQUEST,false);
    boolean persistMessages=getSetting(settings,sessionID,Session.SETTING_PERSIST_MESSAGES,true);
    boolean useClosedIntervalForResend=getSetting(settings,sessionID,Session.USE_CLOSED_RESEND_INTERVAL,false);
    int logonTimeout=getSetting(settings,sessionID,Session.SETTING_LOGON_TIMEOUT,10);
    int logoutTimeout=getSetting(settings,sessionID,Session.SETTING_LOGOUT_TIMEOUT,2);
    boolean forceResync=getSetting(settings,sessionID,Session.SETTING_FORCE_RESYNC,false);
    final boolean resetOnError=getSetting(settings,sessionID,Session.SETTING_RESET_ON_ERROR,false);
    final boolean disconnectOnError=getSetting(settings,sessionID,Session.SETTING_DISCONNECT_ON_ERROR,false);
    final boolean disableHeartBeatCheck=getSetting(settings,sessionID,Session.SETTING_DISABLE_HEART_BEAT_CHECK,false);
    final boolean checkGapFieldOnAdminMessage=getSetting(settings,sessionID,Session.SETTING_CHECK_GAP_FIELD_ON_ADMIN_MESSAGE,true);
    final boolean forceResendWhenCorruptedStore=getSetting(settings,sessionID,Session.SETTING_FORCE_RESEND_WHEN_CORRUPTED_STORE,false);
    int[] logonIntervals=getLogonIntervalsInSeconds(settings,sessionID);
    Session session=new Session(application,messageStoreFactory,sessionID,dataDictionaryProvider,new SessionSchedule(settings,sessionID),logFactory,messageFactory,heartbeatInterval,checkLatency,maxLatency,millisInTimestamp,resetOnLogon,resetOnLogout,resetOnDisconnect,refreshAtLogon,checkCompID,redundantResentRequestAllowed,persistMessages,useClosedIntervalForResend,testRequestDelayMultiplier,senderDefaultApplVerID,forceResync,logonIntervals,resetOnError,disconnectOnError,disableHeartBeatCheck,rejectInvalideMessage,checkGapFieldOnAdminMessage,forceResendWhenCorruptedStore);
    session.setLogonTimeout(logonTimeout);
    session.setLogoutTimeout(logoutTimeout);
    application.onCreate(sessionID);
    return session;
  }
 catch (  FieldConvertError e) {
    throw new ConfigError(e.getMessage());
  }
}

Fixed version (ground truth):
public Session create(SessionID sessionID,SessionSettings settings) throws ConfigError {
  try {
    String connectionType=null;
    boolean rejectInvalideMessage=getSetting(settings,sessionID,Session.REJECT_INVALID_MESSAGE,true);
    if (settings.isSetting(sessionID,SessionFactory.SETTING_CONNECTION_TYPE)) {
      connectionType=settings.getString(sessionID,SessionFactory.SETTING_CONNECTION_TYPE);
    }
    if (connectionType == null) {
      throw new ConfigError("String_Node_Str");
    }
    if (!connectionType.equals(SessionFactory.ACCEPTOR_CONNECTION_TYPE) && !connectionType.equals(SessionFactory.INITIATOR_CONNECTION_TYPE)) {
      throw new ConfigError("String_Node_Str");
    }
    if (connectionType.equals(SessionFactory.ACCEPTOR_CONNECTION_TYPE) && settings.isSetting(sessionID,SessionSettings.SESSION_QUALIFIER)) {
      throw new ConfigError("String_Node_Str");
    }
    if (connectionType.equals(SessionFactory.INITIATOR_CONNECTION_TYPE) && settings.isSetting(sessionID,Session.SETTING_ALLOWED_REMOTE_ADDRESSES)) {
      throw new ConfigError("String_Node_Str");
    }
    DefaultApplVerID senderDefaultApplVerID=null;
    if (sessionID.isFIXT()) {
      if (!settings.isSetting(sessionID,Session.SETTING_DEFAULT_APPL_VER_ID)) {
        throw new ConfigError(Session.SETTING_DEFAULT_APPL_VER_ID + "String_Node_Str");
      }
      senderDefaultApplVerID=new DefaultApplVerID(toApplVerID(settings.getString(sessionID,Session.SETTING_DEFAULT_APPL_VER_ID)).getValue());
    }
    boolean useDataDictionary=true;
    if (settings.isSetting(sessionID,Session.SETTING_USE_DATA_DICTIONARY)) {
      useDataDictionary=settings.getBool(sessionID,Session.SETTING_USE_DATA_DICTIONARY);
    }
    DefaultDataDictionaryProvider dataDictionaryProvider=null;
    if (useDataDictionary) {
      dataDictionaryProvider=new DefaultDataDictionaryProvider();
      if (sessionID.isFIXT()) {
        processFixtDataDictionaries(sessionID,settings,dataDictionaryProvider);
      }
 else {
        processPreFixtDataDictionary(sessionID,settings,dataDictionaryProvider);
      }
    }
    int heartbeatInterval=0;
    if (connectionType.equals(SessionFactory.INITIATOR_CONNECTION_TYPE)) {
      heartbeatInterval=(int)settings.getLong(sessionID,Session.SETTING_HEARTBTINT);
      if (heartbeatInterval <= 0) {
        throw new ConfigError("String_Node_Str");
      }
    }
    boolean checkLatency=getSetting(settings,sessionID,Session.SETTING_CHECK_LATENCY,true);
    int maxLatency=getSetting(settings,sessionID,Session.SETTING_MAX_LATENCY,Session.DEFAULT_MAX_LATENCY);
    double testRequestDelayMultiplier=getSetting(settings,sessionID,Session.SETTING_TEST_REQUEST_DELAY_MULTIPLIER,Session.DEFAULT_TEST_REQUEST_DELAY_MULTIPLIER);
    boolean millisInTimestamp=getSetting(settings,sessionID,Session.SETTING_MILLISECONDS_IN_TIMESTAMP,true);
    boolean resetOnLogout=getSetting(settings,sessionID,Session.SETTING_RESET_ON_LOGOUT,false);
    boolean resetOnDisconnect=getSetting(settings,sessionID,Session.SETTING_RESET_ON_DISCONNECT,false);
    boolean resetOnLogon=getSetting(settings,sessionID,Session.SETTING_RESET_ON_LOGON,false);
    boolean refreshAtLogon=getSetting(settings,sessionID,Session.SETTING_REFRESH_ON_LOGON,false);
    boolean checkCompID=getSetting(settings,sessionID,Session.SETTING_CHECK_COMP_ID,true);
    boolean redundantResentRequestAllowed=getSetting(settings,sessionID,Session.SETTING_SEND_REDUNDANT_RESEND_REQUEST,false);
    boolean persistMessages=getSetting(settings,sessionID,Session.SETTING_PERSIST_MESSAGES,true);
    boolean useClosedIntervalForResend=getSetting(settings,sessionID,Session.USE_CLOSED_RESEND_INTERVAL,false);
    int logonTimeout=getSetting(settings,sessionID,Session.SETTING_LOGON_TIMEOUT,10);
    int logoutTimeout=getSetting(settings,sessionID,Session.SETTING_LOGOUT_TIMEOUT,2);
    boolean forceResync=getSetting(settings,sessionID,Session.SETTING_FORCE_RESYNC,false);
    final boolean resetOnError=getSetting(settings,sessionID,Session.SETTING_RESET_ON_ERROR,false);
    final boolean disconnectOnError=getSetting(settings,sessionID,Session.SETTING_DISCONNECT_ON_ERROR,false);
    final boolean disableHeartBeatCheck=getSetting(settings,sessionID,Session.SETTING_DISABLE_HEART_BEAT_CHECK,false);
    final boolean checkGapFieldOnAdminMessage=getSetting(settings,sessionID,Session.SETTING_CHECK_GAP_FIELD_ON_ADMIN_MESSAGE,true);
    final boolean forceResendWhenCorruptedStore=getSetting(settings,sessionID,Session.SETTING_FORCE_RESEND_WHEN_CORRUPTED_STORE,false);
    final int[] logonIntervals=getLogonIntervalsInSeconds(settings,sessionID);
    final Set<InetAddress> allowedRemoteAddresses=getInetAddresses(settings,sessionID);
    final Session session=new Session(application,messageStoreFactory,sessionID,dataDictionaryProvider,new SessionSchedule(settings,sessionID),logFactory,messageFactory,heartbeatInterval,checkLatency,maxLatency,millisInTimestamp,resetOnLogon,resetOnLogout,resetOnDisconnect,refreshAtLogon,checkCompID,redundantResentRequestAllowed,persistMessages,useClosedIntervalForResend,testRequestDelayMultiplier,senderDefaultApplVerID,forceResync,logonIntervals,resetOnError,disconnectOnError,disableHeartBeatCheck,rejectInvalideMessage,checkGapFieldOnAdminMessage,forceResendWhenCorruptedStore,allowedRemoteAddresses);
    session.setLogonTimeout(logonTimeout);
    session.setLogoutTimeout(logoutTimeout);
    application.onCreate(sessionID);
    return session;
  }
 catch (  FieldConvertError e) {
    throw new ConfigError(e.getMessage());
  }
}