Program: 30057
Project: 30057
Buggy source:
public void execute(AdminCommandContext context){
  final ActionReport report=context.getActionReport();
  Resources resources=domain.getResources();
  String scope="String_Node_Str";
  if (moduleName != null) {
    if (!poolUtil.isValidModule(applicationName,moduleName,poolName,report)) {
      return;
    }
    Application application=applications.getApplication(applicationName);
    Module module=application.getModule(moduleName);
    resources=module.getResources();
    scope=ConnectorConstants.JAVA_MODULE_SCOPE_PREFIX;
  }
 else   if (applicationName != null) {
    if (!poolUtil.isValidApplication(applicationName,poolName,report)) {
      return;
    }
    Application application=applications.getApplication(applicationName);
    resources=application.getResources();
    scope=ConnectorConstants.JAVA_APP_SCOPE_PREFIX;
  }
  if (!poolUtil.isValidPool(resources,poolName,scope,report)) {
    return;
  }
  boolean poolingEnabled=false;
  ResourcePool pool=(ResourcePool)ConnectorsUtil.getResourceByName(resources,ResourcePool.class,poolName);
  if (pool instanceof ConnectorConnectionPool) {
    ConnectorConnectionPool ccp=(ConnectorConnectionPool)pool;
    poolingEnabled=Boolean.valueOf(ccp.getPooling());
  }
 else {
    JdbcConnectionPool ccp=(JdbcConnectionPool)pool;
    poolingEnabled=Boolean.valueOf(ccp.getPooling());
  }
  if (!poolingEnabled) {
    String i18nMsg=localStrings.getLocalString("String_Node_Str","String_Node_Str",poolName);
    report.setMessage(i18nMsg);
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    return;
  }
  try {
    PoolInfo poolInfo=new PoolInfo(poolName,applicationName,moduleName);
    _runtime.flushConnectionPool(poolInfo);
    report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
  }
 catch (  ConnectorRuntimeException e) {
    report.setMessage(localStrings.getLocalString("String_Node_Str","String_Node_Str",poolName,e.getMessage()));
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setFailureCause(e);
  }
}

Fixed version (ground truth):
public void execute(AdminCommandContext context){
  final ActionReport report=context.getActionReport();
  Resources resources=domain.getResources();
  String scope="String_Node_Str";
  if (moduleName != null) {
    if (!poolUtil.isValidModule(applicationName,moduleName,poolName,report)) {
      return;
    }
    Application application=applications.getApplication(applicationName);
    Module module=application.getModule(moduleName);
    resources=module.getResources();
    scope=ConnectorConstants.JAVA_MODULE_SCOPE_PREFIX;
  }
 else   if (applicationName != null) {
    if (!poolUtil.isValidApplication(applicationName,poolName,report)) {
      return;
    }
    Application application=applications.getApplication(applicationName);
    resources=application.getResources();
    scope=ConnectorConstants.JAVA_APP_SCOPE_PREFIX;
  }
  if (!poolUtil.isValidPool(resources,poolName,scope,report)) {
    return;
  }
  boolean poolingEnabled=false;
  ResourcePool pool=(ResourcePool)ConnectorsUtil.getResourceByName(resources,ResourcePool.class,poolName);
  if (pool instanceof ConnectorConnectionPool) {
    ConnectorConnectionPool ccp=(ConnectorConnectionPool)pool;
    poolingEnabled=Boolean.valueOf(ccp.getPooling());
  }
 else {
    JdbcConnectionPool ccp=(JdbcConnectionPool)pool;
    poolingEnabled=Boolean.valueOf(ccp.getPooling());
  }
  if (!poolingEnabled) {
    String i18nMsg=localStrings.getLocalString("String_Node_Str","String_Node_Str",poolName);
    report.setMessage(i18nMsg);
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    return;
  }
  try {
    PoolInfo poolInfo=new PoolInfo(poolName,applicationName,moduleName);
    _runtime.flushConnectionPool(poolInfo);
    report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
  }
 catch (  ConnectorRuntimeException e) {
    report.setMessage(localStrings.getLocalString("String_Node_Str","String_Node_Str",poolName));
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setFailureCause(e);
  }
}