Program: 30051
Project: 30051
Buggy source:
public void execute(AdminCommandContext context){
  ActionReport report=context.getActionReport();
  boolean sharedServiceFound=false;
  Services services=domain.getExtensionByType(Services.class);
  if (services != null) {
    for (    org.glassfish.paas.orchestrator.config.Service service : services.getServices()) {
      if (service instanceof SharedService) {
        SharedService sharedService=(SharedService)service;
        String serviceType=sharedService.getType();
        if (sharedService.getServiceName().equalsIgnoreCase(serviceName)) {
          sharedServiceFound=true;
          if (sharedService.getState().equalsIgnoreCase(ServiceStatus.RUNNING.toString())) {
            report.setMessage("String_Node_Str" + sharedService.getServiceName() + "String_Node_Str");
            report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
            return;
          }
 else {
            ServiceInfo serviceInfo=serviceUtil.getServiceInfo(serviceName,null,null);
            ServiceDescription serviceDescription=orchestrator.getSharedServiceDescription(serviceName);
            ServicePlugin plugin=serviceDescription.getPlugin();
            ProvisionedService provisionedService=plugin.startService(serviceDescription,serviceInfo);
            if (provisionedService != null) {
              orchestrator.addSharedService(serviceName,provisionedService);
              try {
                if (ConfigSupport.apply(new SingleConfigCode<Services>(){
                  public Object run(                  Services param) throws PropertyVetoException, TransactionFailure {
                    for (                    org.glassfish.paas.orchestrator.config.Service service : param.getServices()) {
                      if (service instanceof SharedService) {
                        SharedService sharedSvc=(SharedService)service;
                        if (sharedSvc.getServiceName().equalsIgnoreCase(serviceName)) {
                          Transaction t=Transaction.getTransaction(param);
                          SharedService sharedService_w=t.enroll(sharedSvc);
                          sharedService_w.setState(ServiceStatus.RUNNING.toString());
                        }
                      }
                    }
                    return param;
                  }
                }
,services) == null) {
                  report.setActionExitCode(ActionReport.ExitCode.FAILURE);
                  report.setMessage("String_Node_Str" + serviceName + "String_Node_Str");
                }
 else {
                  report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
                  return;
                }
              }
 catch (              TransactionFailure transactionFailure) {
                report.setActionExitCode(ActionReport.ExitCode.FAILURE);
                report.setFailureCause(transactionFailure);
                return;
              }
            }
 else {
              report.setActionExitCode(ActionReport.ExitCode.FAILURE);
              report.setMessage("String_Node_Str" + serviceName + "String_Node_Str");
              return;
            }
          }
        }
      }
    }
    if (!sharedServiceFound) {
      report.setActionExitCode(ActionReport.ExitCode.FAILURE);
      report.setMessage("String_Node_Str" + serviceName + "String_Node_Str");
      return;
    }
  }
 else {
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setMessage("String_Node_Str" + serviceName + "String_Node_Str");
    return;
  }
}

Fixed version (ground truth):
public void execute(AdminCommandContext context){
  ActionReport report=context.getActionReport();
  boolean sharedServiceFound=false;
  Services services=domain.getExtensionByType(Services.class);
  if (services != null) {
    for (    org.glassfish.paas.orchestrator.config.Service service : services.getServices()) {
      if (service instanceof SharedService) {
        SharedService sharedService=(SharedService)service;
        if (sharedService.getServiceName().equalsIgnoreCase(serviceName)) {
          sharedServiceFound=true;
          if (sharedService.getState().equalsIgnoreCase(ServiceStatus.RUNNING.toString())) {
            report.setMessage("String_Node_Str" + sharedService.getServiceName() + "String_Node_Str");
            report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
            return;
          }
 else {
            ServiceInfo serviceInfo=serviceUtil.getServiceInfo(serviceName,null,null);
            ServiceDescription serviceDescription=orchestrator.getSharedServiceDescription(serviceName);
            ServicePlugin plugin=serviceDescription.getPlugin();
            ProvisionedService provisionedService=plugin.startService(serviceDescription,serviceInfo);
            if (provisionedService != null) {
              orchestrator.addSharedService(serviceName,provisionedService);
              try {
                if (ConfigSupport.apply(new SingleConfigCode<Services>(){
                  public Object run(                  Services param) throws PropertyVetoException, TransactionFailure {
                    for (                    org.glassfish.paas.orchestrator.config.Service service : param.getServices()) {
                      if (service instanceof SharedService) {
                        SharedService sharedSvc=(SharedService)service;
                        if (sharedSvc.getServiceName().equalsIgnoreCase(serviceName)) {
                          Transaction t=Transaction.getTransaction(param);
                          SharedService sharedService_w=t.enroll(sharedSvc);
                          sharedService_w.setState(ServiceStatus.RUNNING.toString());
                        }
                      }
                    }
                    return param;
                  }
                }
,services) == null) {
                  report.setActionExitCode(ActionReport.ExitCode.FAILURE);
                  report.setMessage("String_Node_Str" + serviceName + "String_Node_Str");
                }
 else {
                  report.setActionExitCode(ActionReport.ExitCode.SUCCESS);
                  return;
                }
              }
 catch (              TransactionFailure transactionFailure) {
                report.setActionExitCode(ActionReport.ExitCode.FAILURE);
                report.setFailureCause(transactionFailure);
                return;
              }
            }
 else {
              report.setActionExitCode(ActionReport.ExitCode.FAILURE);
              report.setMessage("String_Node_Str" + serviceName + "String_Node_Str");
              return;
            }
          }
        }
      }
    }
    if (!sharedServiceFound) {
      report.setActionExitCode(ActionReport.ExitCode.FAILURE);
      report.setMessage("String_Node_Str" + serviceName + "String_Node_Str");
      return;
    }
  }
 else {
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setMessage("String_Node_Str" + serviceName + "String_Node_Str");
    return;
  }
}