Program: 107309
Project: 107309
Buggy source:
@Override public VirtualMachineTemplate registerIso(RegisterIsoCmd cmd) throws ResourceAllocationException {
  Account ctxAccount=UserContext.current().getAccount();
  Long userId=UserContext.current().getUserId();
  String name=cmd.getIsoName();
  String displayText=cmd.getDisplayText();
  String url=cmd.getUrl();
  Boolean isPublic=cmd.isPublic();
  Boolean featured=cmd.isFeatured();
  Long guestOSId=cmd.getOsTypeId();
  Boolean bootable=cmd.isBootable();
  Long zoneId=cmd.getZoneId();
  String accountName=cmd.getAccountName();
  Long domainId=cmd.getDomainId();
  Account resourceAccount=null;
  Long accountId=null;
  if (isPublic == null) {
    isPublic=Boolean.FALSE;
  }
  if (zoneId.longValue() == -1) {
    zoneId=null;
  }
  if ((accountName == null) ^ (domainId == null)) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  if ((ctxAccount == null) || isAdmin(ctxAccount.getType())) {
    if (domainId != null) {
      if ((ctxAccount != null) && !_domainDao.isChildDomain(ctxAccount.getDomainId(),domainId)) {
        throw new PermissionDeniedException("String_Node_Str" + domainId + "String_Node_Str");
      }
      if (accountName != null) {
        resourceAccount=_accountDao.findActiveAccount(accountName,domainId);
        if (resourceAccount == null) {
          throw new InvalidParameterValueException("String_Node_Str" + accountName + "String_Node_Str"+ domainId);
        }
        accountId=resourceAccount.getId();
      }
    }
 else {
      accountId=((ctxAccount != null) ? ctxAccount.getId() : null);
    }
  }
 else {
    accountId=ctxAccount.getId();
  }
  if (null == accountId && null == accountName && null == domainId && null == ctxAccount) {
    accountId=1L;
  }
  if (accountId == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  boolean isAdmin=_accountDao.findById(accountId).getType() == Account.ACCOUNT_TYPE_ADMIN;
  if (!isAdmin && zoneId == null) {
    throw new ServerApiException(BaseCmd.PARAM_ERROR,"String_Node_Str");
  }
  if ((!url.toLowerCase().endsWith("String_Node_Str")) && (!url.toLowerCase().endsWith("String_Node_Str")) && (!url.toLowerCase().endsWith("String_Node_Str"))&& (!url.toLowerCase().endsWith("String_Node_Str"))) {
    throw new ServerApiException(BaseCmd.PARAM_ERROR,"String_Node_Str");
  }
  boolean allowPublicUserTemplates=Boolean.parseBoolean(_configDao.getValue("String_Node_Str"));
  if (!isAdmin && !allowPublicUserTemplates && isPublic) {
    throw new ServerApiException(BaseCmd.PARAM_ERROR,"String_Node_Str");
  }
  if (!isAdmin || featured == null) {
    featured=Boolean.FALSE;
  }
  if (userId == null) {
    userId=Long.valueOf(1);
  }
  if (bootable == null) {
    bootable=Boolean.TRUE;
  }
  if (url.toLowerCase().contains("String_Node_Str")) {
    throw new ServerApiException(BaseCmd.PARAM_ERROR,"String_Node_Str");
  }
  return createTemplateOrIso(userId,accountId,zoneId,name,displayText,isPublic.booleanValue(),featured.booleanValue(),true,ImageFormat.ISO.toString(),null,url,null,true,64,false,guestOSId,bootable,HypervisorType.None);
}

Fixed version (ground truth):
@Override public VirtualMachineTemplate registerIso(RegisterIsoCmd cmd) throws ResourceAllocationException {
  Account ctxAccount=UserContext.current().getAccount();
  Long userId=UserContext.current().getUserId();
  String name=cmd.getIsoName();
  String displayText=cmd.getDisplayText();
  String url=cmd.getUrl();
  Boolean isPublic=cmd.isPublic();
  Boolean featured=cmd.isFeatured();
  Long guestOSId=cmd.getOsTypeId();
  Boolean bootable=cmd.isBootable();
  Long zoneId=cmd.getZoneId();
  String accountName=cmd.getAccountName();
  Long domainId=cmd.getDomainId();
  Account resourceAccount=null;
  Long accountId=null;
  if (isPublic == null) {
    isPublic=Boolean.FALSE;
  }
  if (zoneId.longValue() == -1) {
    zoneId=null;
  }
  if ((accountName == null) ^ (domainId == null)) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  if ((ctxAccount == null) || isAdmin(ctxAccount.getType())) {
    if (domainId != null) {
      if ((ctxAccount != null) && !_domainDao.isChildDomain(ctxAccount.getDomainId(),domainId)) {
        throw new PermissionDeniedException("String_Node_Str" + domainId + "String_Node_Str");
      }
      if (accountName != null) {
        resourceAccount=_accountDao.findActiveAccount(accountName,domainId);
        if (resourceAccount == null) {
          throw new InvalidParameterValueException("String_Node_Str" + accountName + "String_Node_Str"+ domainId);
        }
        accountId=resourceAccount.getId();
      }
    }
 else {
      accountId=((ctxAccount != null) ? ctxAccount.getId() : null);
    }
  }
 else {
    accountId=ctxAccount.getId();
  }
  if (null == accountId && null == accountName && null == domainId && null == ctxAccount) {
    accountId=1L;
  }
  if (accountId == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  boolean isAdmin=_accountDao.findById(accountId).getType() == Account.ACCOUNT_TYPE_ADMIN;
  if (!isAdmin && zoneId == null) {
    throw new ServerApiException(BaseCmd.PARAM_ERROR,"String_Node_Str");
  }
  if ((!url.toLowerCase().endsWith("String_Node_Str")) && (!url.toLowerCase().endsWith("String_Node_Str")) && (!url.toLowerCase().endsWith("String_Node_Str"))&& (!url.toLowerCase().endsWith("String_Node_Str"))) {
    throw new ServerApiException(BaseCmd.PARAM_ERROR,"String_Node_Str");
  }
  boolean allowPublicUserTemplates=Boolean.parseBoolean(_configDao.getValue("String_Node_Str"));
  if (!isAdmin && !allowPublicUserTemplates && isPublic) {
    throw new ServerApiException(BaseCmd.PARAM_ERROR,"String_Node_Str");
  }
  if (!isAdmin || featured == null) {
    featured=Boolean.FALSE;
  }
  if (userId == null) {
    userId=Long.valueOf(1);
  }
  if (bootable == null) {
    bootable=Boolean.TRUE;
  }
  if (url.toLowerCase().contains("String_Node_Str")) {
    throw new ServerApiException(BaseCmd.PARAM_ERROR,"String_Node_Str");
  }
  return createTemplateOrIso(userId,accountId,zoneId,name,displayText,isPublic.booleanValue(),featured.booleanValue(),true,ImageFormat.ISO.toString(),TemplateType.USER,url,null,true,64,false,guestOSId,bootable,HypervisorType.None);
}