Program: 30083
Project: 30083
Buggy source:
/** 
 * Reconfigure the Pool's properties. The reconfigConnectorConnectionPool method in the ConnectorRuntime will use this method (through PoolManager) if it needs to just change pool properties and not recreate the pool
 * @param poolResource - the ConnectorConnectionPool JavaBean that holdsthe new pool properties
 * @throws PoolingException if the pool resizing fails
 */
public synchronized void reconfigurePool(ConnectorConnectionPool poolResource) throws PoolingException {
  int _idleTime=Integer.parseInt(poolResource.getIdleTimeoutInSeconds()) * 1000;
  if (poolInitialized) {
    if (_idleTime != idletime && _idleTime != 0) {
      scheduleResizerTask();
    }
    if (_idleTime == 0) {
      cancelResizerTask();
    }
  }
  idletime=_idleTime;
  resizeQuantity=Integer.parseInt(poolResource.getPoolResizeQuantity());
  maxWaitTime=Integer.parseInt(poolResource.getMaxWaitTimeInMillis());
  if (maxWaitTime < 0) {
    maxWaitTime=0;
  }
  validation=poolResource.isIsConnectionValidationRequired();
  failAllConnections=poolResource.isFailAllConnections();
  setAdvancedPoolConfiguration(poolResource);
  if (!isSelfManaged()) {
    int _maxPoolSize=Integer.parseInt(poolResource.getMaxPoolSize());
    int oldMaxPoolSize=maxPoolSize;
    if (_maxPoolSize < steadyPoolSize) {
      maxPoolSize=steadyPoolSize;
    }
 else {
      maxPoolSize=_maxPoolSize;
    }
    if (oldMaxPoolSize != maxPoolSize) {
      ds.setMaxSize(maxPoolSize);
    }
    int _steadyPoolSize=Integer.parseInt(poolResource.getSteadyPoolSize());
    int oldSteadyPoolSize=steadyPoolSize;
    if (_steadyPoolSize > maxPoolSize) {
      steadyPoolSize=maxPoolSize;
    }
 else {
      steadyPoolSize=_steadyPoolSize;
    }
    if (poolInitialized) {
      int toKill=ds.getResourcesSize() - maxPoolSize;
      if (toKill > 0)       killExtraResources(toKill);
    }
    if (oldSteadyPoolSize != steadyPoolSize) {
      if (poolInitialized) {
        if (oldSteadyPoolSize < steadyPoolSize) {
          increaseSteadyPoolSize(_steadyPoolSize);
          if (poolLifeCycleListener != null) {
            poolLifeCycleListener.connectionsFreed(steadyPoolSize);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Reconfigure the Pool's properties. The reconfigConnectorConnectionPool method in the ConnectorRuntime will use this method (through PoolManager) if it needs to just change pool properties and not recreate the pool
 * @param poolResource - the ConnectorConnectionPool JavaBean that holdsthe new pool properties
 * @throws PoolingException if the pool resizing fails
 */
public synchronized void reconfigurePool(ConnectorConnectionPool poolResource) throws PoolingException {
  int _idleTime=Integer.parseInt(poolResource.getIdleTimeoutInSeconds()) * 1000;
  if (poolInitialized) {
    if (_idleTime != idletime && _idleTime != 0) {
      idletime=_idleTime;
      scheduleResizerTask();
    }
    if (_idleTime == 0) {
      cancelResizerTask();
    }
  }
  idletime=_idleTime;
  resizeQuantity=Integer.parseInt(poolResource.getPoolResizeQuantity());
  maxWaitTime=Integer.parseInt(poolResource.getMaxWaitTimeInMillis());
  if (maxWaitTime < 0) {
    maxWaitTime=0;
  }
  validation=poolResource.isIsConnectionValidationRequired();
  failAllConnections=poolResource.isFailAllConnections();
  setAdvancedPoolConfiguration(poolResource);
  if (!isSelfManaged()) {
    int _maxPoolSize=Integer.parseInt(poolResource.getMaxPoolSize());
    int oldMaxPoolSize=maxPoolSize;
    if (_maxPoolSize < steadyPoolSize) {
      maxPoolSize=steadyPoolSize;
    }
 else {
      maxPoolSize=_maxPoolSize;
    }
    if (oldMaxPoolSize != maxPoolSize) {
      ds.setMaxSize(maxPoolSize);
    }
    int _steadyPoolSize=Integer.parseInt(poolResource.getSteadyPoolSize());
    int oldSteadyPoolSize=steadyPoolSize;
    if (_steadyPoolSize > maxPoolSize) {
      steadyPoolSize=maxPoolSize;
    }
 else {
      steadyPoolSize=_steadyPoolSize;
    }
    if (poolInitialized) {
      int toKill=ds.getResourcesSize() - maxPoolSize;
      if (toKill > 0)       killExtraResources(toKill);
    }
    reconfigureSteadyPoolSize(oldSteadyPoolSize,_steadyPoolSize);
  }
}