Program: 29463
Project: 29463
Buggy source:
/** 
 * Gets the Pool name that this JDBC resource points to. In case of a PMF resource gets the pool name of the pool pointed to by jdbc resource being pointed to by the PMF resource
 * @param resourceInfo the jndi name of the resource being used to get Connection fromThis resource can either be a pmf resource or a jdbc resource
 * @return poolName of the pool that this resource directly/indirectly points to
 */
public PoolInfo getPoolNameFromResourceJndiName(ResourceInfo resourceInfo){
  PoolInfo poolInfo=null;
  JdbcResource jdbcResource=null;
  ResourceInfo actualResourceInfo=resourceInfo;
  String jndiName=resourceInfo.getName();
  actualResourceInfo=new ResourceInfo(jndiName,resourceInfo.getApplicationName(),resourceInfo.getModuleName());
  ConnectorRuntime runtime=ConnectorRuntime.getRuntime();
  jdbcResource=(JdbcResource)ConnectorsUtil.getResourceByName(runtime.getResources(actualResourceInfo),JdbcResource.class,actualResourceInfo.getName());
  if (jdbcResource == null) {
    String suffix=ConnectorsUtil.getValidSuffix(jndiName);
    if (suffix != null) {
      jndiName=jndiName.substring(0,jndiName.lastIndexOf(suffix));
      actualResourceInfo=new ResourceInfo(jndiName,resourceInfo.getApplicationName(),resourceInfo.getModuleName());
    }
  }
  jdbcResource=(JdbcResource)ConnectorsUtil.getResourceByName(runtime.getResources(actualResourceInfo),JdbcResource.class,actualResourceInfo.getName());
  if (jdbcResource != null) {
    if (logger.isLoggable(Level.FINE)) {
      logger.fine("String_Node_Str" + jdbcResource.getJndiName());
      logger.fine("String_Node_Str" + jdbcResource.getPoolName());
    }
  }
  if (jdbcResource != null) {
    poolInfo=new PoolInfo(jdbcResource.getPoolName(),actualResourceInfo.getApplicationName(),actualResourceInfo.getModuleName());
  }
  return poolInfo;
}

Fixed version (ground truth):
/** 
 * Gets the Pool name that this JDBC resource points to. In case of a PMF resource gets the pool name of the pool pointed to by jdbc resource being pointed to by the PMF resource
 * @param resourceInfo the jndi name of the resource being used to get Connection fromThis resource can either be a pmf resource or a jdbc resource
 * @return poolName of the pool that this resource directly/indirectly points to
 */
public PoolInfo getPoolNameFromResourceJndiName(ResourceInfo resourceInfo){
  PoolInfo poolInfo=null;
  JdbcResource jdbcResource=null;
  String jndiName=resourceInfo.getName();
  ResourceInfo actualResourceInfo=new ResourceInfo(jndiName,resourceInfo.getApplicationName(),resourceInfo.getModuleName());
  ConnectorRuntime runtime=ConnectorRuntime.getRuntime();
  jdbcResource=(JdbcResource)ConnectorsUtil.getResourceByName(runtime.getResources(actualResourceInfo),JdbcResource.class,actualResourceInfo.getName());
  if (jdbcResource == null) {
    String suffix=ConnectorsUtil.getValidSuffix(jndiName);
    if (suffix != null) {
      jndiName=jndiName.substring(0,jndiName.lastIndexOf(suffix));
      actualResourceInfo=new ResourceInfo(jndiName,resourceInfo.getApplicationName(),resourceInfo.getModuleName());
    }
  }
  jdbcResource=(JdbcResource)ConnectorsUtil.getResourceByName(runtime.getResources(actualResourceInfo),JdbcResource.class,actualResourceInfo.getName());
  if (jdbcResource != null) {
    if (logger.isLoggable(Level.FINE)) {
      logger.fine("String_Node_Str" + jdbcResource.getJndiName());
      logger.fine("String_Node_Str" + jdbcResource.getPoolName());
    }
  }
  if (jdbcResource != null) {
    poolInfo=new PoolInfo(jdbcResource.getPoolName(),actualResourceInfo.getApplicationName(),actualResourceInfo.getModuleName());
  }
  return poolInfo;
}