Program: 176004
Project: 176004
Buggy source:
/** 
 * Retrieving connection from connection pool.
 * @return returns jedis instance.
 */
Jedis getConnection(){
  if (logger.isDebugEnabled())   logger.info("String_Node_Str");
  Object poolOrConnection=getConnectionPoolOrConnection();
  if (poolOrConnection != null && poolOrConnection instanceof JedisPool) {
    Jedis connection=((JedisPool)getConnectionPoolOrConnection()).getResource();
    Map props=RedisPropertyReader.rsmd.getProperties();
    if (props != null) {
      for (      Object key : props.keySet()) {
        connection.configSet(key.toString(),props.get(key).toString());
      }
    }
    return connection;
  }
 else {
    PersistenceUnitMetadata puMetadata=kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(getPersistenceUnit());
    Properties props=puMetadata.getProperties();
    String contactNode=RedisPropertyReader.rsmd.getHost() != null ? RedisPropertyReader.rsmd.getHost() : (String)props.get(PersistenceProperties.KUNDERA_NODES);
    String defaultPort=RedisPropertyReader.rsmd.getPort() != null ? RedisPropertyReader.rsmd.getPort() : (String)props.get(PersistenceProperties.KUNDERA_PORT);
    String password=RedisPropertyReader.rsmd.getPassword() != null ? RedisPropertyReader.rsmd.getPassword() : (String)props.get(PersistenceProperties.KUNDERA_PASSWORD);
    if (defaultPort == null || !StringUtils.isNumeric(defaultPort)) {
      throw new RuntimeException("String_Node_Str" + defaultPort);
    }
    Jedis connection=new Jedis(contactNode,Integer.parseInt(defaultPort));
    if (password != null) {
      connection.auth(password);
    }
    connection.connect();
    return connection;
  }
}

Fixed version (ground truth):
/** 
 * Retrieving connection from connection pool.
 * @return returns jedis instance.
 */
Jedis getConnection(){
  if (logger.isDebugEnabled())   logger.info("String_Node_Str");
  Object poolOrConnection=getConnectionPoolOrConnection();
  if (poolOrConnection != null && poolOrConnection instanceof JedisPool) {
    Jedis connection=((JedisPool)getConnectionPoolOrConnection()).getResource();
    connection.getClient().setTimeoutInfinite();
    Map props=RedisPropertyReader.rsmd.getProperties();
    if (props != null) {
      for (      Object key : props.keySet()) {
        connection.configSet(key.toString(),props.get(key).toString());
      }
    }
    return connection;
  }
 else {
    PersistenceUnitMetadata puMetadata=kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(getPersistenceUnit());
    Properties props=puMetadata.getProperties();
    String contactNode=RedisPropertyReader.rsmd.getHost() != null ? RedisPropertyReader.rsmd.getHost() : (String)props.get(PersistenceProperties.KUNDERA_NODES);
    String defaultPort=RedisPropertyReader.rsmd.getPort() != null ? RedisPropertyReader.rsmd.getPort() : (String)props.get(PersistenceProperties.KUNDERA_PORT);
    String password=RedisPropertyReader.rsmd.getPassword() != null ? RedisPropertyReader.rsmd.getPassword() : (String)props.get(PersistenceProperties.KUNDERA_PASSWORD);
    if (defaultPort == null || !StringUtils.isNumeric(defaultPort)) {
      throw new RuntimeException("String_Node_Str" + defaultPort);
    }
    Jedis connection=new Jedis(contactNode,Integer.parseInt(defaultPort));
    if (password != null) {
      connection.auth(password);
    }
    connection.connect();
    return connection;
  }
}