Program: 89934
Project: 89934
Buggy source:
private VMTemplateVO createTemplateOrIso(long userId,Long accountId,Long zoneId,String name,String displayText,boolean isPublic,boolean featured,boolean isExtractable,String format,String diskType,String url,String chksum,boolean requiresHvm,int bits,boolean enablePassword,long guestOSId,boolean bootable,HypervisorType hypervisorType) throws IllegalArgumentException, ResourceAllocationException {
  try {
    if (name.length() > 32) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    ImageFormat imgfmt=ImageFormat.valueOf(format.toUpperCase());
    if (imgfmt == null) {
      throw new IllegalArgumentException("String_Node_Str" + format + "String_Node_Str"+ EnumUtils.listValues(ImageFormat.values()));
    }
    URI uri=new URI(url);
    if ((uri.getScheme() == null) || (!uri.getScheme().equalsIgnoreCase("String_Node_Str") && !uri.getScheme().equalsIgnoreCase("String_Node_Str") && !uri.getScheme().equalsIgnoreCase("String_Node_Str"))) {
      throw new IllegalArgumentException("String_Node_Str" + url);
    }
    int port=uri.getPort();
    if (!(port == 80 || port == 443 || port == -1)) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    String host=uri.getHost();
    try {
      InetAddress hostAddr=InetAddress.getByName(host);
      if (hostAddr.isAnyLocalAddress() || hostAddr.isLinkLocalAddress() || hostAddr.isLoopbackAddress()|| hostAddr.isMulticastAddress()) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      if (hostAddr instanceof Inet6Address) {
        throw new IllegalArgumentException("String_Node_Str" + hostAddr.getHostAddress() + "String_Node_Str");
      }
    }
 catch (    UnknownHostException uhe) {
      throw new IllegalArgumentException("String_Node_Str" + host);
    }
    UserVO user=_userDao.findById(userId);
    if (user == null) {
      throw new IllegalArgumentException("String_Node_Str" + userId);
    }
    AccountVO account=_accountDao.findById(accountId);
    if (_accountMgr.resourceLimitExceeded(account,ResourceType.template)) {
      ResourceAllocationException rae=new ResourceAllocationException("String_Node_Str" + account.getAccountName() + "String_Node_Str");
      rae.setResourceType("String_Node_Str");
      throw rae;
    }
    if (zoneId != null) {
      if (_dcDao.findById(zoneId) == null) {
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
    VMTemplateVO systemvmTmplt=_tmpltDao.findRoutingTemplate();
    if (systemvmTmplt.getName().equalsIgnoreCase(name) || systemvmTmplt.getDisplayText().equalsIgnoreCase(displayText)) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    return create(userId,accountId,zoneId,name,displayText,isPublic,featured,isExtractable,imgfmt,null,uri,chksum,requiresHvm,bits,enablePassword,guestOSId,bootable,hypervisorType);
  }
 catch (  URISyntaxException e) {
    throw new IllegalArgumentException("String_Node_Str" + url);
  }
}

Fixed version (ground truth):
private VMTemplateVO createTemplateOrIso(long userId,Long accountId,Long zoneId,String name,String displayText,boolean isPublic,boolean featured,boolean isExtractable,String format,TemplateType diskType,String url,String chksum,boolean requiresHvm,int bits,boolean enablePassword,long guestOSId,boolean bootable,HypervisorType hypervisorType) throws IllegalArgumentException, ResourceAllocationException {
  try {
    if (name.length() > 32) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    ImageFormat imgfmt=ImageFormat.valueOf(format.toUpperCase());
    if (imgfmt == null) {
      throw new IllegalArgumentException("String_Node_Str" + format + "String_Node_Str"+ EnumUtils.listValues(ImageFormat.values()));
    }
    URI uri=new URI(url);
    if ((uri.getScheme() == null) || (!uri.getScheme().equalsIgnoreCase("String_Node_Str") && !uri.getScheme().equalsIgnoreCase("String_Node_Str") && !uri.getScheme().equalsIgnoreCase("String_Node_Str"))) {
      throw new IllegalArgumentException("String_Node_Str" + url);
    }
    int port=uri.getPort();
    if (!(port == 80 || port == 443 || port == -1)) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    String host=uri.getHost();
    try {
      InetAddress hostAddr=InetAddress.getByName(host);
      if (hostAddr.isAnyLocalAddress() || hostAddr.isLinkLocalAddress() || hostAddr.isLoopbackAddress()|| hostAddr.isMulticastAddress()) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      if (hostAddr instanceof Inet6Address) {
        throw new IllegalArgumentException("String_Node_Str" + hostAddr.getHostAddress() + "String_Node_Str");
      }
    }
 catch (    UnknownHostException uhe) {
      throw new IllegalArgumentException("String_Node_Str" + host);
    }
    UserVO user=_userDao.findById(userId);
    if (user == null) {
      throw new IllegalArgumentException("String_Node_Str" + userId);
    }
    AccountVO account=_accountDao.findById(accountId);
    if (_accountMgr.resourceLimitExceeded(account,ResourceType.template)) {
      ResourceAllocationException rae=new ResourceAllocationException("String_Node_Str" + account.getAccountName() + "String_Node_Str");
      rae.setResourceType("String_Node_Str");
      throw rae;
    }
    if (zoneId != null) {
      if (_dcDao.findById(zoneId) == null) {
        throw new IllegalArgumentException("String_Node_Str");
      }
    }
    VMTemplateVO systemvmTmplt=_tmpltDao.findRoutingTemplate();
    if (systemvmTmplt.getName().equalsIgnoreCase(name) || systemvmTmplt.getDisplayText().equalsIgnoreCase(displayText)) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    return create(userId,accountId,zoneId,name,displayText,isPublic,featured,isExtractable,imgfmt,diskType,uri,chksum,requiresHvm,bits,enablePassword,guestOSId,bootable,hypervisorType);
  }
 catch (  URISyntaxException e) {
    throw new IllegalArgumentException("String_Node_Str" + url);
  }
}