Program: 28541
Project: 28541
Buggy source:
/** 
 * Entry point from the framework into the command execution
 * @param context context for the command.
 */
public void execute(AdminCommandContext context){
  deployment.validateSpecifiedTarget(target);
  if (!deployment.isRegistered(name())) {
    report.setMessage(localStrings.getLocalString("String_Node_Str","String_Node_Str",name()));
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    return;
  }
  if (!DeploymentUtils.isDomainTarget(target)) {
    ApplicationRef applicationRef=domain.getApplicationRefInTarget(name(),target);
    if (applicationRef == null) {
      report.setMessage(localStrings.getLocalString("String_Node_Str","String_Node_Str",name(),target));
      report.setActionExitCode(ActionReport.ExitCode.FAILURE);
      return;
    }
  }
  if (domain.isAppEnabledInTarget(name(),target)) {
    logger.fine("String_Node_Str");
    return;
  }
  InterceptorNotifier notifier=new InterceptorNotifier(habitat,null);
  DeployCommandSupplementalInfo suppInfo=new DeployCommandSupplementalInfo();
  suppInfo.setDeploymentContext(notifier.dc());
  suppInfo.setAccessChecks(accessChecks);
  report.setResultType(DeployCommandSupplementalInfo.class,suppInfo);
  if (env.isDas()) {
    try {
      versioningService.handleDisable(name(),target,report,context.getSubject());
    }
 catch (    VersioningSyntaxException e) {
      report.failure(logger,e.getMessage());
      return;
    }
    if (DeploymentUtils.isDomainTarget(target)) {
      List<String> targets=domain.getAllReferencedTargetsForApplication(name());
      try {
        ParameterMapExtractor extractor=new ParameterMapExtractor(this);
        ParameterMap paramMap=extractor.extract(Collections.EMPTY_LIST);
        paramMap.set("String_Node_Str",name());
        notifier.ensureBeforeReported(Phase.REPLICATION);
        ClusterOperationUtil.replicateCommand("String_Node_Str",FailurePolicy.Error,FailurePolicy.Warn,FailurePolicy.Ignore,targets,context,paramMap,habitat);
      }
 catch (      Exception e) {
        report.failure(logger,e.getMessage());
        return;
      }
    }
    try {
      notifier.ensureBeforeReported(Phase.REPLICATION);
      DeploymentCommandUtils.replicateEnableDisableToContainingCluster("String_Node_Str",domain,target,name(),habitat,context,this);
    }
 catch (    Exception e) {
      report.failure(logger,e.getMessage());
      return;
    }
  }
  try {
    Application app=applications.getApplication(name());
    ApplicationRef appRef=domain.getApplicationRefInServer(server.getName(),name());
    DeploymentContext dc=deployment.enable(target,app,appRef,report,logger);
    suppInfo.setDeploymentContext((ExtendedDeploymentContext)dc);
    if (!report.getActionExitCode().equals(ActionReport.ExitCode.FAILURE)) {
      try {
        deployment.updateAppEnabledAttributeInDomainXML(name(),target,true);
      }
 catch (      TransactionFailure e) {
        logger.log(Level.WARNING,"String_Node_Str" + name(),e);
      }
    }
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setMessage(e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Entry point from the framework into the command execution
 * @param context context for the command.
 */
public void execute(AdminCommandContext context){
  deployment.validateSpecifiedTarget(target);
  InterceptorNotifier notifier=new InterceptorNotifier(habitat,null);
  DeployCommandSupplementalInfo suppInfo=new DeployCommandSupplementalInfo();
  suppInfo.setDeploymentContext(notifier.dc());
  suppInfo.setAccessChecks(accessChecks);
  report.setResultType(DeployCommandSupplementalInfo.class,suppInfo);
  if (!deployment.isRegistered(name())) {
    report.setMessage(localStrings.getLocalString("String_Node_Str","String_Node_Str",name()));
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    return;
  }
  if (!DeploymentUtils.isDomainTarget(target)) {
    ApplicationRef applicationRef=domain.getApplicationRefInTarget(name(),target);
    if (applicationRef == null) {
      report.setMessage(localStrings.getLocalString("String_Node_Str","String_Node_Str",name(),target));
      report.setActionExitCode(ActionReport.ExitCode.FAILURE);
      return;
    }
  }
  if (domain.isAppEnabledInTarget(name(),target)) {
    logger.fine("String_Node_Str");
    return;
  }
  if (env.isDas()) {
    try {
      versioningService.handleDisable(name(),target,report,context.getSubject());
    }
 catch (    VersioningSyntaxException e) {
      report.failure(logger,e.getMessage());
      return;
    }
    if (DeploymentUtils.isDomainTarget(target)) {
      List<String> targets=domain.getAllReferencedTargetsForApplication(name());
      try {
        ParameterMapExtractor extractor=new ParameterMapExtractor(this);
        ParameterMap paramMap=extractor.extract(Collections.EMPTY_LIST);
        paramMap.set("String_Node_Str",name());
        notifier.ensureBeforeReported(Phase.REPLICATION);
        ClusterOperationUtil.replicateCommand("String_Node_Str",FailurePolicy.Error,FailurePolicy.Warn,FailurePolicy.Ignore,targets,context,paramMap,habitat);
      }
 catch (      Exception e) {
        report.failure(logger,e.getMessage());
        return;
      }
    }
    try {
      notifier.ensureBeforeReported(Phase.REPLICATION);
      DeploymentCommandUtils.replicateEnableDisableToContainingCluster("String_Node_Str",domain,target,name(),habitat,context,this);
    }
 catch (    Exception e) {
      report.failure(logger,e.getMessage());
      return;
    }
  }
  try {
    Application app=applications.getApplication(name());
    ApplicationRef appRef=domain.getApplicationRefInServer(server.getName(),name());
    DeploymentContext dc=deployment.enable(target,app,appRef,report,logger);
    suppInfo.setDeploymentContext((ExtendedDeploymentContext)dc);
    if (!report.getActionExitCode().equals(ActionReport.ExitCode.FAILURE)) {
      try {
        deployment.updateAppEnabledAttributeInDomainXML(name(),target,true);
      }
 catch (      TransactionFailure e) {
        logger.log(Level.WARNING,"String_Node_Str" + name(),e);
      }
    }
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,"String_Node_Str",e);
    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
    report.setMessage(e.getMessage());
  }
}