Program: 30287
Project: 30287
Buggy source:
public void dissociateServices(ProvisionedService serviceConsumer,ServiceReference svcRef,ProvisionedService serviceProvider,boolean beforeUndeploy,DeploymentContext dc){
  if (beforeUndeploy) {
    GlassFishProvisionedService gfps=(GlassFishProvisionedService)serviceConsumer;
    String serviceName=gfps.getServiceDescription().getName();
    String clusterName=gfServiceUtil.getClusterName(serviceName,gfps.getServiceDescription().getAppName());
    if (dc != null) {
      UndeployCommandParameters ucp=dc.getCommandParameters(UndeployCommandParameters.class);
      ucp.target=clusterName;
    }
  }
 else {
    if (svcRef.getServiceRefType().equals("String_Node_Str")) {
      GlassFishProvisionedService glassfishProvisionedService=(GlassFishProvisionedService)serviceConsumer;
      String serviceName=glassfishProvisionedService.getServiceDescription().getName();
      String clusterName=gfServiceUtil.getClusterName(serviceName,glassfishProvisionedService.getServiceDescription().getAppName());
      String poolName=svcRef.getServiceRefName();
      String resourceName=svcRef.getServiceRefName();
      String dasIPAddress=gfServiceUtil.getDASIPAddress(glassfishProvisionedService.getServiceDescription().getName());
      GlassFishProvisioner glassFishProvisioner=(GlassFishProvisioner)provisionerUtil.getAppServerProvisioner(dasIPAddress);
      glassFishProvisioner.deleteJdbcResource(dasIPAddress,clusterName,resourceName);
      glassFishProvisioner.deleteJdbcConnectionPool(dasIPAddress,poolName);
    }
  }
}

Fixed version (ground truth):
public void dissociateServices(ProvisionedService serviceConsumer,ServiceReference svcRef,ProvisionedService serviceProvider,boolean beforeUndeploy,DeploymentContext dc){
  if (beforeUndeploy) {
    GlassFishProvisionedService gfps=(GlassFishProvisionedService)serviceConsumer;
    String serviceName=gfps.getServiceDescription().getName();
    String clusterName=gfServiceUtil.getClusterName(serviceName,gfps.getServiceDescription().getAppName());
    if (dc != null) {
      UndeployCommandParameters ucp=dc.getCommandParameters(UndeployCommandParameters.class);
      ucp.target=clusterName;
    }
  }
 else {
    if (svcRef.getServiceRefType().equals("String_Node_Str") && serviceProvider.getServiceType().toString().equals("String_Node_Str") && serviceConsumer.getServiceType().toString().equals("String_Node_Str")) {
      GlassFishProvisionedService glassfishProvisionedService=(GlassFishProvisionedService)serviceConsumer;
      String serviceName=glassfishProvisionedService.getServiceDescription().getName();
      String clusterName=gfServiceUtil.getClusterName(serviceName,glassfishProvisionedService.getServiceDescription().getAppName());
      String poolName=svcRef.getServiceRefName();
      String resourceName=svcRef.getServiceRefName();
      String dasIPAddress=gfServiceUtil.getDASIPAddress(glassfishProvisionedService.getServiceDescription().getName());
      GlassFishProvisioner glassFishProvisioner=(GlassFishProvisioner)provisionerUtil.getAppServerProvisioner(dasIPAddress);
      glassFishProvisioner.deleteJdbcResource(dasIPAddress,clusterName,resourceName);
      glassFishProvisioner.deleteJdbcConnectionPool(dasIPAddress,poolName);
    }
  }
}