Program: 14664
Project: 14664
Buggy source:
public static VmTypeInfo asVmTypeInfo(VmType vmType,BootableImageInfo img) throws MetadataException {
  Long imgSize=img.getImageSizeBytes();
  if (imgSize > 1024l * 1024l * 1024l* vmType.getDisk()) {
    throw new InvalidMetadataException("String_Node_Str" + imgSize / (1024l * 1024l) + "String_Node_Str" + vmType.getName() + "String_Node_Str" + vmType.getDisk() * 1024l + "String_Node_Str");
  }
  VmTypeInfo vmTypeInfo=null;
  if (img instanceof StaticDiskImage) {
    if (ImageMetadata.Platform.windows.equals(img.getPlatform())) {
      vmTypeInfo=VmTypes.InstanceStoreWindowsVmTypeInfoMapper.INSTANCE.apply(vmType);
      vmTypeInfo.setEphemeral(0,"String_Node_Str",vmType.getDisk() * 1024l * 1024l* 1024l - imgSize,"String_Node_Str");
    }
 else {
      vmTypeInfo=VmTypes.InstanceStoreVmTypeInfoMapper.INSTANCE.apply(vmType);
      vmTypeInfo.setEphemeral(0,"String_Node_Str",vmType.getDisk() * 1024l * 1024l* 1024l - imgSize,"String_Node_Str");
    }
    vmTypeInfo.setRoot(img.getDisplayName(),((StaticDiskImage)img).getManifestLocation(),imgSize);
  }
 else   if (img instanceof BlockStorageImageInfo) {
    vmTypeInfo=VmTypes.BlockStorageVmTypeInfoMapper.INSTANCE.apply(vmType);
    vmTypeInfo.setEbsRoot(img.getDisplayName(),null,imgSize);
    vmTypeInfo.setEphemeral(0,"String_Node_Str",vmType.getDisk() * 1024l * 1024l* 1024l,"String_Node_Str");
  }
 else {
    throw new InvalidMetadataException("String_Node_Str" + img);
  }
  return vmTypeInfo;
}

Fixed version (ground truth):
public static VmTypeInfo asVmTypeInfo(VmType vmType,BootableImageInfo img) throws MetadataException {
  Long imgSize=img.getImageSizeBytes();
  Long diskSize=vmType.getDisk() * 1024l * 1024l* 1024l;
  if (imgSize > diskSize) {
    throw new InvalidMetadataException("String_Node_Str" + imgSize / (1024l * 1024l) + "String_Node_Str" + vmType.getName() + "String_Node_Str" + vmType.getDisk() * 1024l + "String_Node_Str");
  }
  VmTypeInfo vmTypeInfo=null;
  if (img instanceof StaticDiskImage) {
    if (ImageMetadata.Platform.windows.equals(img.getPlatform())) {
      vmTypeInfo=VmTypes.InstanceStoreWindowsVmTypeInfoMapper.INSTANCE.apply(vmType);
      vmTypeInfo.setEphemeral(0,"String_Node_Str",diskSize - imgSize,"String_Node_Str");
    }
 else {
      vmTypeInfo=VmTypes.InstanceStoreVmTypeInfoMapper.INSTANCE.apply(vmType);
      long ephemeralSize=diskSize - imgSize - SWAP_SIZE_BYTES;
      if (ephemeralSize < MIN_EPHEMERAL_SIZE_BYTES) {
        throw new InvalidMetadataException("String_Node_Str" + imgSize / (1024l * 1024l) + "String_Node_Str" + vmType.getName() + "String_Node_Str" + vmType.getDisk() * 1024l + "String_Node_Str");
      }
      vmTypeInfo.setEphemeral(0,"String_Node_Str",ephemeralSize,"String_Node_Str");
    }
    vmTypeInfo.setRoot(img.getDisplayName(),((StaticDiskImage)img).getManifestLocation(),imgSize);
  }
 else   if (img instanceof BlockStorageImageInfo) {
    vmTypeInfo=VmTypes.BlockStorageVmTypeInfoMapper.INSTANCE.apply(vmType);
    vmTypeInfo.setEbsRoot(img.getDisplayName(),null,imgSize);
    vmTypeInfo.setEphemeral(0,"String_Node_Str",diskSize,"String_Node_Str");
  }
 else {
    throw new InvalidMetadataException("String_Node_Str" + img);
  }
  return vmTypeInfo;
}