Program: 106368
Project: 106368
Buggy source:
public static void initDataSource(String propsFileName){
  try {
    File dbPropsFile=PropertiesUtil.findConfigFile(propsFileName);
    final Properties dbProps;
    if (EncryptionSecretKeyChecker.useEncryption()) {
      StandardPBEStringEncryptor encryptor=EncryptionSecretKeyChecker.getEncryptor();
      dbProps=new EncryptableProperties(encryptor);
    }
 else {
      dbProps=new Properties();
    }
    try {
      dbProps.load(new FileInputStream(dbPropsFile));
    }
 catch (    IOException e) {
      s_logger.fatal("String_Node_Str",e);
      return;
    }
catch (    NullPointerException e) {
      s_logger.fatal("String_Node_Str" + propsFileName + "String_Node_Str"+ e);
      return;
    }
    final int cloudMaxActive=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
    final int cloudMaxIdle=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
    final long cloudMaxWait=Long.parseLong(dbProps.getProperty("String_Node_Str"));
    final String cloudUsername=dbProps.getProperty("String_Node_Str");
    final String cloudPassword=dbProps.getProperty("String_Node_Str");
    final String cloudHost=dbProps.getProperty("String_Node_Str");
    final int cloudPort=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
    final String cloudDbName=dbProps.getProperty("String_Node_Str");
    final boolean cloudAutoReconnect=Boolean.parseBoolean(dbProps.getProperty("String_Node_Str"));
    final String cloudValidationQuery=dbProps.getProperty("String_Node_Str");
    final String cloudIsolationLevel=dbProps.getProperty("String_Node_Str");
    int isolationLevel=Connection.TRANSACTION_READ_COMMITTED;
    if (cloudIsolationLevel == null) {
      isolationLevel=Connection.TRANSACTION_READ_COMMITTED;
    }
 else     if (cloudIsolationLevel.equalsIgnoreCase("String_Node_Str")) {
      isolationLevel=Connection.TRANSACTION_READ_COMMITTED;
    }
 else     if (cloudIsolationLevel.equalsIgnoreCase("String_Node_Str")) {
      isolationLevel=Connection.TRANSACTION_REPEATABLE_READ;
    }
 else     if (cloudIsolationLevel.equalsIgnoreCase("String_Node_Str")) {
      isolationLevel=Connection.TRANSACTION_SERIALIZABLE;
    }
 else     if (cloudIsolationLevel.equalsIgnoreCase("String_Node_Str")) {
      isolationLevel=Connection.TRANSACTION_READ_UNCOMMITTED;
    }
 else {
      s_logger.warn("String_Node_Str" + cloudIsolationLevel + "String_Node_Str");
    }
    final boolean cloudTestOnBorrow=Boolean.parseBoolean(dbProps.getProperty("String_Node_Str"));
    final boolean cloudTestWhileIdle=Boolean.parseBoolean(dbProps.getProperty("String_Node_Str"));
    final long cloudTimeBtwEvictionRunsMillis=Long.parseLong(dbProps.getProperty("String_Node_Str"));
    final long cloudMinEvcitableIdleTimeMillis=Long.parseLong(dbProps.getProperty("String_Node_Str"));
    final boolean cloudPoolPreparedStatements=Boolean.parseBoolean(dbProps.getProperty("String_Node_Str"));
    final String url=dbProps.getProperty("String_Node_Str");
    final boolean useSSL=Boolean.parseBoolean(dbProps.getProperty("String_Node_Str"));
    if (useSSL) {
      System.setProperty("String_Node_Str",dbProps.getProperty("String_Node_Str"));
      System.setProperty("String_Node_Str",dbProps.getProperty("String_Node_Str"));
      System.setProperty("String_Node_Str",dbProps.getProperty("String_Node_Str"));
      System.setProperty("String_Node_Str",dbProps.getProperty("String_Node_Str"));
    }
    String regionId=dbProps.getProperty("String_Node_Str");
    if (regionId == null) {
      s_region_id=1;
    }
 else {
      s_region_id=Integer.parseInt(regionId);
    }
    final GenericObjectPool cloudConnectionPool=new GenericObjectPool(null,cloudMaxActive,GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION,cloudMaxWait,cloudMaxIdle,cloudTestOnBorrow,false,cloudTimeBtwEvictionRunsMillis,1,cloudMinEvcitableIdleTimeMillis,cloudTestWhileIdle);
    final ConnectionFactory cloudConnectionFactory=new DriverManagerConnectionFactory("String_Node_Str" + cloudHost + "String_Node_Str"+ cloudPort+ "String_Node_Str"+ cloudDbName+ "String_Node_Str"+ cloudAutoReconnect+ (url != null ? "String_Node_Str" + url : "String_Node_Str")+ (useSSL ? "String_Node_Str" : "String_Node_Str"),cloudUsername,cloudPassword);
    final KeyedObjectPoolFactory poolableObjFactory=(cloudPoolPreparedStatements ? new StackKeyedObjectPoolFactory() : null);
    final PoolableConnectionFactory cloudPoolableConnectionFactory=new PoolableConnectionFactory(cloudConnectionFactory,cloudConnectionPool,poolableObjFactory,cloudValidationQuery,false,false,isolationLevel);
    s_ds=new PoolingDataSource(cloudPoolableConnectionFactory.getPool());
    final int usageMaxActive=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
    final int usageMaxIdle=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
    final long usageMaxWait=Long.parseLong(dbProps.getProperty("String_Node_Str"));
    final String usageUsername=dbProps.getProperty("String_Node_Str");
    final String usagePassword=dbProps.getProperty("String_Node_Str");
    final String usageHost=dbProps.getProperty("String_Node_Str");
    final int usagePort=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
    final String usageDbName=dbProps.getProperty("String_Node_Str");
    final boolean usageAutoReconnect=Boolean.parseBoolean(dbProps.getProperty("String_Node_Str"));
    final GenericObjectPool usageConnectionPool=new GenericObjectPool(null,usageMaxActive,GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION,usageMaxWait,usageMaxIdle);
    final ConnectionFactory usageConnectionFactory=new DriverManagerConnectionFactory("String_Node_Str" + usageHost + "String_Node_Str"+ usagePort+ "String_Node_Str"+ usageDbName+ "String_Node_Str"+ usageAutoReconnect,usageUsername,usagePassword);
    final PoolableConnectionFactory usagePoolableConnectionFactory=new PoolableConnectionFactory(usageConnectionFactory,usageConnectionPool,new StackKeyedObjectPoolFactory(),null,false,false);
    s_usageDS=new PoolingDataSource(usagePoolableConnectionFactory.getPool());
    final String awsapiDbName=dbProps.getProperty("String_Node_Str");
    final GenericObjectPool awsapiConnectionPool=new GenericObjectPool(null,usageMaxActive,GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION,usageMaxWait,usageMaxIdle);
    final ConnectionFactory awsapiConnectionFactory=new DriverManagerConnectionFactory("String_Node_Str" + cloudHost + "String_Node_Str"+ cloudPort+ "String_Node_Str"+ awsapiDbName+ "String_Node_Str"+ usageAutoReconnect,cloudUsername,cloudPassword);
    final PoolableConnectionFactory awsapiPoolableConnectionFactory=new PoolableConnectionFactory(awsapiConnectionFactory,awsapiConnectionPool,new StackKeyedObjectPoolFactory(),null,false,false);
    s_awsapiDS=new PoolingDataSource(awsapiPoolableConnectionFactory.getPool());
    try {
      final int simulatorMaxActive=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
      final int simulatorMaxIdle=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
      final long simulatorMaxWait=Long.parseLong(dbProps.getProperty("String_Node_Str"));
      final String simulatorUsername=dbProps.getProperty("String_Node_Str");
      final String simulatorPassword=dbProps.getProperty("String_Node_Str");
      final String simulatorHost=dbProps.getProperty("String_Node_Str");
      final int simulatorPort=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
      final String simulatorDbName=dbProps.getProperty("String_Node_Str");
      final boolean simulatorAutoReconnect=Boolean.parseBoolean(dbProps.getProperty("String_Node_Str"));
      final GenericObjectPool simulatorConnectionPool=new GenericObjectPool(null,simulatorMaxActive,GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION,simulatorMaxWait,simulatorMaxIdle);
      final ConnectionFactory simulatorConnectionFactory=new DriverManagerConnectionFactory("String_Node_Str" + simulatorHost + "String_Node_Str"+ simulatorPort+ "String_Node_Str"+ simulatorDbName+ "String_Node_Str"+ simulatorAutoReconnect,simulatorUsername,simulatorPassword);
      final PoolableConnectionFactory simulatorPoolableConnectionFactory=new PoolableConnectionFactory(simulatorConnectionFactory,simulatorConnectionPool,new StackKeyedObjectPoolFactory(),null,false,false);
      s_simulatorDS=new PoolingDataSource(simulatorPoolableConnectionFactory.getPool());
    }
 catch (    Exception e) {
      s_logger.debug("String_Node_Str");
    }
  }
 catch (  final Exception e) {
    s_ds=getDefaultDataSource("String_Node_Str");
    s_usageDS=getDefaultDataSource("String_Node_Str");
    s_simulatorDS=getDefaultDataSource("String_Node_Str");
    s_logger.warn("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public static void initDataSource(String propsFileName){
  try {
    File dbPropsFile=PropertiesUtil.findConfigFile(propsFileName);
    final Properties dbProps;
    if (EncryptionSecretKeyChecker.useEncryption()) {
      StandardPBEStringEncryptor encryptor=EncryptionSecretKeyChecker.getEncryptor();
      dbProps=new EncryptableProperties(encryptor);
    }
 else {
      dbProps=new Properties();
    }
    try {
      dbProps.load(new FileInputStream(dbPropsFile));
    }
 catch (    IOException e) {
      s_logger.fatal("String_Node_Str",e);
      return;
    }
catch (    NullPointerException e) {
      s_logger.fatal("String_Node_Str" + propsFileName);
      return;
    }
    final int cloudMaxActive=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
    final int cloudMaxIdle=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
    final long cloudMaxWait=Long.parseLong(dbProps.getProperty("String_Node_Str"));
    final String cloudUsername=dbProps.getProperty("String_Node_Str");
    final String cloudPassword=dbProps.getProperty("String_Node_Str");
    final String cloudHost=dbProps.getProperty("String_Node_Str");
    final int cloudPort=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
    final String cloudDbName=dbProps.getProperty("String_Node_Str");
    final boolean cloudAutoReconnect=Boolean.parseBoolean(dbProps.getProperty("String_Node_Str"));
    final String cloudValidationQuery=dbProps.getProperty("String_Node_Str");
    final String cloudIsolationLevel=dbProps.getProperty("String_Node_Str");
    int isolationLevel=Connection.TRANSACTION_READ_COMMITTED;
    if (cloudIsolationLevel == null) {
      isolationLevel=Connection.TRANSACTION_READ_COMMITTED;
    }
 else     if (cloudIsolationLevel.equalsIgnoreCase("String_Node_Str")) {
      isolationLevel=Connection.TRANSACTION_READ_COMMITTED;
    }
 else     if (cloudIsolationLevel.equalsIgnoreCase("String_Node_Str")) {
      isolationLevel=Connection.TRANSACTION_REPEATABLE_READ;
    }
 else     if (cloudIsolationLevel.equalsIgnoreCase("String_Node_Str")) {
      isolationLevel=Connection.TRANSACTION_SERIALIZABLE;
    }
 else     if (cloudIsolationLevel.equalsIgnoreCase("String_Node_Str")) {
      isolationLevel=Connection.TRANSACTION_READ_UNCOMMITTED;
    }
 else {
      s_logger.warn("String_Node_Str" + cloudIsolationLevel + "String_Node_Str");
    }
    final boolean cloudTestOnBorrow=Boolean.parseBoolean(dbProps.getProperty("String_Node_Str"));
    final boolean cloudTestWhileIdle=Boolean.parseBoolean(dbProps.getProperty("String_Node_Str"));
    final long cloudTimeBtwEvictionRunsMillis=Long.parseLong(dbProps.getProperty("String_Node_Str"));
    final long cloudMinEvcitableIdleTimeMillis=Long.parseLong(dbProps.getProperty("String_Node_Str"));
    final boolean cloudPoolPreparedStatements=Boolean.parseBoolean(dbProps.getProperty("String_Node_Str"));
    final String url=dbProps.getProperty("String_Node_Str");
    final boolean useSSL=Boolean.parseBoolean(dbProps.getProperty("String_Node_Str"));
    if (useSSL) {
      System.setProperty("String_Node_Str",dbProps.getProperty("String_Node_Str"));
      System.setProperty("String_Node_Str",dbProps.getProperty("String_Node_Str"));
      System.setProperty("String_Node_Str",dbProps.getProperty("String_Node_Str"));
      System.setProperty("String_Node_Str",dbProps.getProperty("String_Node_Str"));
    }
    String regionId=dbProps.getProperty("String_Node_Str");
    if (regionId == null) {
      s_region_id=1;
    }
 else {
      s_region_id=Integer.parseInt(regionId);
    }
    final GenericObjectPool cloudConnectionPool=new GenericObjectPool(null,cloudMaxActive,GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION,cloudMaxWait,cloudMaxIdle,cloudTestOnBorrow,false,cloudTimeBtwEvictionRunsMillis,1,cloudMinEvcitableIdleTimeMillis,cloudTestWhileIdle);
    final ConnectionFactory cloudConnectionFactory=new DriverManagerConnectionFactory("String_Node_Str" + cloudHost + "String_Node_Str"+ cloudPort+ "String_Node_Str"+ cloudDbName+ "String_Node_Str"+ cloudAutoReconnect+ (url != null ? "String_Node_Str" + url : "String_Node_Str")+ (useSSL ? "String_Node_Str" : "String_Node_Str"),cloudUsername,cloudPassword);
    final KeyedObjectPoolFactory poolableObjFactory=(cloudPoolPreparedStatements ? new StackKeyedObjectPoolFactory() : null);
    final PoolableConnectionFactory cloudPoolableConnectionFactory=new PoolableConnectionFactory(cloudConnectionFactory,cloudConnectionPool,poolableObjFactory,cloudValidationQuery,false,false,isolationLevel);
    s_ds=new PoolingDataSource(cloudPoolableConnectionFactory.getPool());
    final int usageMaxActive=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
    final int usageMaxIdle=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
    final long usageMaxWait=Long.parseLong(dbProps.getProperty("String_Node_Str"));
    final String usageUsername=dbProps.getProperty("String_Node_Str");
    final String usagePassword=dbProps.getProperty("String_Node_Str");
    final String usageHost=dbProps.getProperty("String_Node_Str");
    final int usagePort=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
    final String usageDbName=dbProps.getProperty("String_Node_Str");
    final boolean usageAutoReconnect=Boolean.parseBoolean(dbProps.getProperty("String_Node_Str"));
    final GenericObjectPool usageConnectionPool=new GenericObjectPool(null,usageMaxActive,GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION,usageMaxWait,usageMaxIdle);
    final ConnectionFactory usageConnectionFactory=new DriverManagerConnectionFactory("String_Node_Str" + usageHost + "String_Node_Str"+ usagePort+ "String_Node_Str"+ usageDbName+ "String_Node_Str"+ usageAutoReconnect,usageUsername,usagePassword);
    final PoolableConnectionFactory usagePoolableConnectionFactory=new PoolableConnectionFactory(usageConnectionFactory,usageConnectionPool,new StackKeyedObjectPoolFactory(),null,false,false);
    s_usageDS=new PoolingDataSource(usagePoolableConnectionFactory.getPool());
    final String awsapiDbName=dbProps.getProperty("String_Node_Str");
    final GenericObjectPool awsapiConnectionPool=new GenericObjectPool(null,usageMaxActive,GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION,usageMaxWait,usageMaxIdle);
    final ConnectionFactory awsapiConnectionFactory=new DriverManagerConnectionFactory("String_Node_Str" + cloudHost + "String_Node_Str"+ cloudPort+ "String_Node_Str"+ awsapiDbName+ "String_Node_Str"+ usageAutoReconnect,cloudUsername,cloudPassword);
    final PoolableConnectionFactory awsapiPoolableConnectionFactory=new PoolableConnectionFactory(awsapiConnectionFactory,awsapiConnectionPool,new StackKeyedObjectPoolFactory(),null,false,false);
    s_awsapiDS=new PoolingDataSource(awsapiPoolableConnectionFactory.getPool());
    try {
      final int simulatorMaxActive=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
      final int simulatorMaxIdle=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
      final long simulatorMaxWait=Long.parseLong(dbProps.getProperty("String_Node_Str"));
      final String simulatorUsername=dbProps.getProperty("String_Node_Str");
      final String simulatorPassword=dbProps.getProperty("String_Node_Str");
      final String simulatorHost=dbProps.getProperty("String_Node_Str");
      final int simulatorPort=Integer.parseInt(dbProps.getProperty("String_Node_Str"));
      final String simulatorDbName=dbProps.getProperty("String_Node_Str");
      final boolean simulatorAutoReconnect=Boolean.parseBoolean(dbProps.getProperty("String_Node_Str"));
      final GenericObjectPool simulatorConnectionPool=new GenericObjectPool(null,simulatorMaxActive,GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION,simulatorMaxWait,simulatorMaxIdle);
      final ConnectionFactory simulatorConnectionFactory=new DriverManagerConnectionFactory("String_Node_Str" + simulatorHost + "String_Node_Str"+ simulatorPort+ "String_Node_Str"+ simulatorDbName+ "String_Node_Str"+ simulatorAutoReconnect,simulatorUsername,simulatorPassword);
      final PoolableConnectionFactory simulatorPoolableConnectionFactory=new PoolableConnectionFactory(simulatorConnectionFactory,simulatorConnectionPool,new StackKeyedObjectPoolFactory(),null,false,false);
      s_simulatorDS=new PoolingDataSource(simulatorPoolableConnectionFactory.getPool());
    }
 catch (    Exception e) {
      s_logger.debug("String_Node_Str");
    }
  }
 catch (  final Exception e) {
    s_ds=getDefaultDataSource("String_Node_Str");
    s_usageDS=getDefaultDataSource("String_Node_Str");
    s_simulatorDS=getDefaultDataSource("String_Node_Str");
    s_logger.warn("String_Node_Str",e);
  }
}