auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { return org.ovirt.engine.core.bll.network.host.PersistentHostSetupNetworksCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.PERSIST_NETWORK_ON_HOST_FINISHED : org.ovirt.engine.core.common.AuditLogType.PERSIST_NETWORK_ON_HOST_FAILED ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.network.host.PersistentHostSetupNetworksCommand.getParameters ( ) . getNetworkNames ( ) ) ) { return org.ovirt.engine.core.bll.network.host.PersistentHostSetupNetworksCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.PERSIST_SETUP_NETWORK_ON_HOST_FINISHED : org.ovirt.engine.core.common.AuditLogType.PERSIST_SETUP_NETWORK_ON_HOST_FAILED ; } else { return org.ovirt.engine.core.bll.network.host.PersistentHostSetupNetworksCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.PERSIST_NETWORK_ON_HOST_FINISHED : org.ovirt.engine.core.common.AuditLogType.PERSIST_NETWORK_ON_HOST_FAILED ; } }
Source:
public void canDoActionSucceeds ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , false ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( false ) ; mockHasVolumeOnServer ( false ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void canDoActionSucceeds ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( false ) ; mockHasVolumeOnServer ( false ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public double getfreeDiskPercent ( ) { int usedDiskSize = ( ( getused_disk_size ( ) ) == null ) ? 0 : getused_disk_size ( ) ; int availableDiskSize = ( ( getavailable_disk_size ( ) ) == null ) ? 0 : getavailable_disk_size ( ) ; double totalSize = usedDiskSize + availableDiskSize ; return totalSize != 0 ? ( availableDiskSize / totalSize ) * 100 : 0.0 ; }

Target:
public double getfreeDiskPercent ( ) { int usedDiskSize = ( ( getUsedDiskSize ( ) ) == null ) ? 0 : getUsedDiskSize ( ) ; int availableDiskSize = ( ( getAvailableDiskSize ( ) ) == null ) ? 0 : getAvailableDiskSize ( ) ; double totalSize = usedDiskSize + availableDiskSize ; return totalSize != 0 ? ( availableDiskSize / totalSize ) * 100 : 0.0 ; }
Source:
void initMemorySizeLabels ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { this . physicalMemory = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Integer > ( constants ) ; this . usedMemory = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Integer > ( constants ) ; this . freeMemory = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Integer > ( constants ) ; this . swapTotal = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Long > ( constants ) ; this . usedSwap = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Long > ( constants ) ; this . swapFree = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Long > ( constants ) ; }

Target:
void initMemorySizeLabels ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { this . physicalMemory = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Integer > ( constants ) ; this . usedMemory = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Integer > ( constants ) ; this . freeMemory = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Integer > ( constants ) ; this . swapTotal = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Long > ( constants ) ; this . usedSwap = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Long > ( constants ) ; this . swapFree = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Long > ( constants ) ; this . maxSchedulingMemory = new org.ovirt.engine.ui.common.widget.label.MemorySizeLabel < java.lang.Float > ( constants ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , org.ovirt.engine.core.bll.AttachDiskToVmCommand.getVmId ( ) ) , VmDeviceType.DISK.getName ( ) , VmDeviceType.DISK.getName ( ) , "" , 0 , null , true , org.ovirt.engine.core.bll.AttachDiskToVmCommand.getParameters ( ) . isPlugUnPlug ( ) , false , "" ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , org.ovirt.engine.core.bll.AttachDiskToVmCommand.getVmId ( ) ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) , "" , 0 , null , true , org.ovirt.engine.core.bll.AttachDiskToVmCommand.getParameters ( ) . isPlugUnPlug ( ) , false , "" ) ; }
Source:
private void dontSendTicket ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.SetVmTicketCommand.getVm ( ) ; final org.ovirt.engine.core.common.businessentities.DbUser user = org.ovirt.engine.core.bll.SetVmTicketCommand.getCurrentUser ( ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.log.warnFormat ( "Can\'t give console of virtual machine \"{0}\" to user \"{1}\", it has probably been taken by another user." , vm.getId ( ) , user.getId ( ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_USE_BY_OTHER_USER ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.setSucceeded ( false ) ; }

Target:
private void dontSendTicket ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.SetVmTicketCommand.getVm ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.bll.SetVmTicketCommand.getCurrentUser ( ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.log.warn ( "Can't give console of virtual machine '{}' to user '{}', it has probably been taken by another user." , vm.getId ( ) , user.getId ( ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_USE_BY_OTHER_USER ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.setSucceeded ( false ) ; }
Source:
public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { sharedMacPoolModelProvider.setSelectedItems ( macPoolTable.getSelectedItems ( ) ) ; }

Target:
public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { final java.util.List < org.ovirt.engine.core.common.businessentities.MacPool > selectedItems = macPoolTable.getSelectedItems ( ) ; sharedMacPoolModelProvider.setSelectedItems ( selectedItems ) ; final org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel model = permissionModelProvider.getModel ( ) ; if ( ( selectedItems.size ( ) ) == 1 ) { model.setEntity ( selectedItems.get ( 0 ) ) ; setupAuthorizationTableVisibility ( true ) ; } else { model.setEntity ( null ) ; setupAuthorizationTableVisibility ( false ) ; } }
Source:
private static java.util.Map < java.lang.String , java.lang.Object > getVideoDeviceSpecParams ( int numOfMonitors , boolean singleQxlPci ) { int heads = ( singleQxlPci ) ? numOfMonitors : 1 ; java.util.Map < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < > ( ) ; specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.HEADS , java.lang.String.valueOf ( heads ) ) ; specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.VRAM , org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.singlePciVRamByHeads ( heads ) ) ; if ( singleQxlPci ) { specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.RAM , org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.singlePciRamByHeads ( heads ) ) ; } return specParams ; }

Target:
public static < E extends org.ovirt.engine.core.common.businessentities.VmDevice > java.util.Map < java.lang.String , E > vmDevicesByDevice ( java.util.Collection < E > deviceList ) { return deviceList == null ? java.util.Collections.emptyMap ( ) : deviceList.stream ( ) . filter ( ( dev ) -> ( dev.getDevice ( ) ) != null ) . collect ( java.util.stream.Collectors.toMap ( VmDevice :: getDevice , java.util.function.Function.< E > identity ( ) ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { sourceListModel.getSearchCommand ( ) . execute ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( ( ( result.getReturnValue ( ) ) == null ) || ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) ) { return ; } sourceListModel.getSearchCommand ( ) . execute ( ) ; cancel ( ) ; }
Source:
public void updateJobStepsCompleted ( org.ovirt.engine.core.compat.Guid jobId , org.ovirt.engine.core.common.job.JobExecutionStatus status , java.util.Date endTime ) { if ( status != ( org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ) ) { updateQuery ( entityManager.createNamedQuery ( "Step.updateJobStepsCompleted" ) . setParameter ( "jobId" , jobId ) . setParameter ( "status" , status ) . setParameter ( "endTime" , endTime ) . setParameter ( "startedStatus" , JobExecutionStatus.STARTED ) ) ; } }

Target:
public void updateJobStepsCompleted ( org.ovirt.engine.core.compat.Guid jobId , org.ovirt.engine.core.common.job.JobExecutionStatus status , java.util.Date endTime ) { if ( status != ( org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ) ) { updateQuery ( getEntityManager ( ) . createNamedQuery ( "Step.updateJobStepsCompleted" ) . setParameter ( "jobId" , jobId ) . setParameter ( "status" , status ) . setParameter ( "endTime" , endTime ) . setParameter ( "startedStatus" , JobExecutionStatus.STARTED ) ) ; } }
Source:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
public org.ovirt.engine.api.v3.types.V3Disk get ( ) { return adaptGet ( getDelegate ( ) :: get ) ; }

Target:
public org.ovirt.engine.api.v3.types.V3Disk get ( ) { org.ovirt.engine.api.v3.types.V3Disk disk = adaptGet ( getDelegate ( ) :: get ) ; org.ovirt.engine.api.model.DiskAttachment diskAttachment = org.ovirt.engine.api.restapi.resource.BackendApiResource.getInstance ( ) . getVmsResource ( ) . getVmResource ( vmId ) . getDiskAttachmentsResource ( ) . getAttachmentResource ( diskId ) . get ( ) ; disk.setBootable ( diskAttachment.isBootable ( ) ) ; disk.setInterface ( diskAttachment.getInterface ( ) . toString ( ) . toLowerCase ( ) ) ; return disk ; }
Source:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public void testGetEntityNameByIdAndTypeForHost ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic vds = vdsStaticDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.VDS_ID ) ; org.junit.Assert.assertNotNull ( vds ) ; java.lang.String name = vds.getName ( ) ; org.junit.Assert.assertEquals ( name , underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.VDS_ID , VdcObjectType.VDS ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForHost ( ) { org.ovirt.engine.core.common.businessentities.VdsStatic vds = vdsStaticDao.get ( FixturesTool.VDS_RHEL6_NFS_SPM ) ; org.junit.Assert.assertNotNull ( vds ) ; java.lang.String name = vds.getName ( ) ; org.junit.Assert.assertEquals ( name , underTest.getEntityNameByIdAndType ( FixturesTool.VDS_RHEL6_NFS_SPM , VdcObjectType.VDS ) ) ; }
Source:
public void getExternalProviderComputeResourceList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalComputeResource > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetComputeResourceFromExternalProvider , params , aQuery ) ; }

Target:
public void getAAANamespaces ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.Map < java.lang.String , java.util.List < java.lang.String > > > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.MapConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected org.ovirt.engine.ui.uicommonweb.models.vms.ISpice extractSpice ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalConsolePopupModel model ) { org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel consoleModel = asUserPortalItem ( model ) . getDefaultConsole ( ) ; if ( ! ( consoleModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ) { return null ; } org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ( consoleModel ) ) . getspice ( ) ; return spice ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.models.vms.ISpice extractSpice ( org.ovirt.engine.ui.uicommonweb.models.ConsolePopupModel model ) { org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel consoleModel = model.getModel ( ) . getDefaultConsoleModel ( ) ; if ( ! ( consoleModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ) { return null ; } org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ( consoleModel ) ) . getspice ( ) ; return spice ; }
Source:
protected java.lang.String getKey ( ) { return getAuditLogTypeValue ( ) . toString ( ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.AuditLog createAuditLog ( org.ovirt.engine.core.common.AuditLogType logType , org.ovirt.engine.core.common.AuditLogSeverity severity , java.lang.String message ) { return new org.ovirt.engine.core.common.businessentities.AuditLog ( logType , severity , message , getUserId ( ) , getUserName ( ) , getVmIdRef ( ) , getVmName ( ) , getVdsIdRef ( ) , getVdsName ( ) , getVmTemplateIdRef ( ) , getVmTemplateName ( ) , getOrigin ( ) , getCustomEventId ( ) , getEventFloodInSec ( ) , getCustomData ( ) ) ; }
Source:
public void reportCompleted ( ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) ; if ( ( ( executionContext != null ) && ( executionContext.isMonitored ( ) ) ) && ( ! ( executionContext.isCompleted ( ) ) ) ) { switch ( executionContext.getExecutionMethod ( ) ) { case AsJob : org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , false ) ; break ; case AsStep : org.ovirt.engine.core.bll.job.ExecutionHandler.endStep ( executionContext , executionContext.getStep ( ) , false ) ; break ; default : } } }

Target:
public void reportCompleted ( ) { try { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) ; if ( ( ( executionContext != null ) && ( executionContext.isMonitored ( ) ) ) && ( ! ( executionContext.isCompleted ( ) ) ) ) { endExecutionMonitoring ( ) ; } } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.RemoveDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ) { return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK_NO_DOMAIN : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK_NO_DOMAIN ; } return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ; default : return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.RemoveDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK_NO_DOMAIN : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK_NO_DOMAIN ; } else if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.CINDER ) ) { return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_DISK_INITIATED : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ; } return org.ovirt.engine.core.bll.RemoveDiskCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_REMOVE_DISK : org.ovirt.engine.core.common.AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ; default : return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; } }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getDiskImageDao ( ) . get ( parameters.getImageId ( ) ) ; if ( diskImage != null ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( diskImage.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.DISK_LIVE_STORAGE_MIGRATION ) ) ; } } return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = diskImageDao.get ( parameters.getImageId ( ) ) ; if ( diskImage != null ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( diskImage.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.DISK_LIVE_STORAGE_MIGRATION ) ) ; } } return permissionList ; }
Source:
public void moveShareableDiskToGlusterDomain ( ) { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; initVmDiskImage ( true ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS.toString ( ) ) ) ; }

Target:
public void moveShareableDiskToGlusterDomain ( ) { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; initVmDiskImage ( true ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS.toString ( ) ) ) ; }
Source:
private org.ovirt.engine.core.common.action.ImagesContainterParametersBase getCinderDiskSnapshotParameter ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { org.ovirt.engine.core.common.action.ImagesContainterParametersBase removeCinderSnapshotParams = new org.ovirt.engine.core.common.action.ImagesContainterParametersBase ( cinderDisk.getImageId ( ) ) ; removeCinderSnapshotParams.setDestinationImageId ( cinderDisk.getImageId ( ) ) ; removeCinderSnapshotParams.setStorageDomainId ( cinderDisk.getStorageIds ( ) . get ( 0 ) ) ; removeCinderSnapshotParams.setParentCommand ( org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllCinderSnapshotDisksCommand.getActionType ( ) ) ; removeCinderSnapshotParams.setParentParameters ( org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllCinderSnapshotDisksCommand.getParameters ( ) ) ; removeCinderSnapshotParams.setShouldBeEndedByParent ( false ) ; return removeCinderSnapshotParams ; }

Target:
private org.ovirt.engine.core.common.action.ImagesContainterParametersBase getCinderDiskSnapshotParameter ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { org.ovirt.engine.core.common.action.ImagesContainterParametersBase removeCinderSnapshotParams = new org.ovirt.engine.core.common.action.ImagesContainterParametersBase ( cinderDisk.getImageId ( ) ) ; removeCinderSnapshotParams.setDestinationImageId ( cinderDisk.getImageId ( ) ) ; removeCinderSnapshotParams.setStorageDomainId ( cinderDisk.getStorageIds ( ) . get ( 0 ) ) ; removeCinderSnapshotParams.setParentCommand ( org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllCinderSnapshotDisksCommand.getActionType ( ) ) ; removeCinderSnapshotParams.setParentParameters ( org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllCinderSnapshotDisksCommand.getParameters ( ) ) ; removeCinderSnapshotParams.setEndProcedure ( EndProcedure.COMMAND_MANAGED ) ; return removeCinderSnapshotParams ; }
Source:
public org.ovirt.engine.core.common.businessentities.UserProfile mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.UserProfile entity = new org.ovirt.engine.core.common.businessentities.UserProfile ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "profile_id" ) ) ; entity.setUserId ( getGuidDefaultEmpty ( rs , "user_id" ) ) ; entity.setSshPublicKey ( rs.getString ( "ssh_public_key" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.UserProfile mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.UserProfile entity = new org.ovirt.engine.core.common.businessentities.UserProfile ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "profile_id" ) ) ; entity.setUserId ( getGuidDefaultEmpty ( rs , "user_id" ) ) ; entity.setSshPublicKey ( rs.getString ( "ssh_public_key" ) ) ; entity.setLoginName ( rs.getString ( "login_name" ) ) ; return entity ; }
Source:
private void validate ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel mgmtNetwork = networkMap.get ( HostInterfaceListModel.ENGINE_NETWORK_NAME ) ; if ( ! ( mgmtNetwork.isAttached ( ) ) ) { okCommand.setIsExecutionAllowed ( false ) ; okCommand.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . mgmtNotAttachedToolTip ( ) ) ; } else { okCommand.setIsExecutionAllowed ( true ) ; okCommand.setTitle ( null ) ; } }

Target:
private void validate ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel mgmtNetwork = networkMap.get ( HostInterfaceListModel.ENGINE_NETWORK_NAME ) ; if ( ! ( mgmtNetwork.isAttached ( ) ) ) { okCommand.getExecuteProhibitionReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . mgmtNotAttachedToolTip ( ) ) ; okCommand.setIsExecutionAllowed ( false ) ; } else { okCommand.setIsExecutionAllowed ( true ) ; } }
Source:
protected void executeVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getBroker ( ) . connectStorageServer ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , BuildStructFromConnectionListObject ( ) ) ; proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.String > returnValue = _result.convertToStatusList ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.setReturnValue ( returnValue ) ; logFailedStorageConnections ( returnValue ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getBroker ( ) . connectStorageServer ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , buildStructFromConnectionListObject ( ) ) ; proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.String > returnValue = _result.convertToStatusList ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.setReturnValue ( returnValue ) ; logFailedStorageConnections ( returnValue ) ; }
Source:
public void newProfile ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel model = new org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel ( this , getEntity ( ) . getDataCenterId ( ) ) ; setWindow ( model ) ; initProfileNetwork ( model ) ; }

Target:
public void newProfile ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel model = new org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel ( this , getEntity ( ) . getDataCenterId ( ) ) ; setWindow ( model ) ; org.ovirt.engine.core.common.businessentities.network.VnicProfile profile = new org.ovirt.engine.core.common.businessentities.network.VnicProfile ( ) ; profile.setNetworkId ( getEntity ( ) . getId ( ) ) ; model.setProfile ( profile ) ; }
Source:
protected boolean isFenceAgentValid ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent ) { if ( ( org.apache.commons.lang.StringUtils.isEmpty ( agent.getUser ( ) ) ) || ( org.apache.commons.lang.StringUtils.isEmpty ( agent.getPassword ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_PM_ENABLED_WITHOUT_AGENT_CREDENTIALS ) ; return false ; } else { return true ; } }

Target:
protected boolean isFenceAgentValid ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent ) { if ( ( org.apache.commons.lang.StringUtils.isEmpty ( agent.getUser ( ) ) ) || ( org.apache.commons.lang.StringUtils.isEmpty ( agent.getPassword ( ) ) ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_PM_ENABLED_WITHOUT_AGENT_CREDENTIALS ) ; return false ; } else { return true ; } }
Source:
private org.ovirt.engine.core.bll.AddVmFromTemplateCommand < org.ovirt.engine.core.common.action.AddVmFromTemplateParameters > setupCanAddVmFromTemplateTests ( final int domainSizeGB , final int sizeRequired , final int pctRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired , pctRequired ) ; org.ovirt.engine.core.bll.AddVmFromTemplateCommand < org.ovirt.engine.core.common.action.AddVmFromTemplateParameters > cmd = createVmFromTemplateCommand ( vm ) ; initCommandMethods ( cmd ) ; return cmd ; }

Target:
private org.ovirt.engine.core.bll.AddVmFromTemplateCommand < org.ovirt.engine.core.common.action.AddVmFromTemplateParameters > setupCanAddVmFromTemplateTests ( final int domainSizeGB , final int sizeRequired , final int pctRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired , pctRequired ) ; org.ovirt.engine.core.bll.AddVmFromTemplateCommand < org.ovirt.engine.core.common.action.AddVmFromTemplateParameters > cmd = createVmFromTemplateCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; return cmd ; }
Source:
public void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeReplaceBrickStart ( java.lang.String volumeName , java.lang.String existingBrickDir , java.lang.String newBrickDir ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.replaceBrickStart" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "existingBrick" , existingBrickDir ) . withParameter ( "newBrick" , newBrickDir ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc sparsifyVolume ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > volumeAddress ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.sparsify_volume" ) . withParameter ( "job_id" , jobId ) . withParameter ( "vol_info" , volumeAddress ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.Cancel ( ) ; vmListModel.setGuideContext ( returnValueBase.getActionReturnValue ( ) ) ; vmListModel.UpdateActionAvailability ( ) ; vmListModel.getGuideCommand ( ) . Execute ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.cancel ( ) ; } }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > setUpStoragePool ( ) { final org.ovirt.engine.core.common.businessentities.StoragePool entity = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; entity.setId ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplatesResourceTest.DATA_CENTER_ID ) ; return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) { private static final long serialVersionUID = 6544998068993726769L ; { add ( entity ) ; } } ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > setUpStoragePool ( ) { final org.ovirt.engine.core.common.businessentities.StoragePool entity = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; entity.setId ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplatesResourceTest.DATA_CENTER_ID ) ; return java.util.Collections.singletonList ( entity ) ; }
Source:
protected void executeQueryCommand ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allDcNetworks = getNetworkDao ( ) . getAllForDataCenter ( org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getUserID ( ) , org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getParameters ( ) . isFiltered ( ) ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > managementNetworkCandidates = org.ovirt.engine.core.utils.linq.LinqUtils.filter ( allDcNetworks , getManagementNetworkCandidatePredicate ( ) ) ; org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getQueryReturnValue ( ) . setReturnValue ( managementNetworkCandidates ) ; }

Target:
protected void executeQueryCommand ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allDcNetworks = getNetworkDao ( ) . getAllForDataCenter ( org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getUserID ( ) , org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getParameters ( ) . isFiltered ( ) ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > managementNetworkCandidates = allDcNetworks.stream ( ) . filter ( getManagementNetworkCandidatePredicate ( ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ; org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQuery.getQueryReturnValue ( ) . setReturnValue ( managementNetworkCandidates ) ; }
Source:
public void testHostsRuleStructure ( ) throws java.lang.Exception { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.model.AffinityRule rule = new org.ovirt.engine.api.model.AffinityRule ( ) ; rule.setEnabled ( true ) ; rule.setEnforcing ( true ) ; rule.setPositive ( false ) ; model.setHostsRule ( rule ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; assertEquals ( EntityAffinityRule.NEGATIVE , entity.getVdsAffinityRule ( ) ) ; assertEquals ( true , entity.isVdsEnforcing ( ) ) ; }

Target:
public void testHostsRuleStructureNeg ( ) throws java.lang.Exception { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.model.AffinityRule rule = new org.ovirt.engine.api.model.AffinityRule ( ) ; rule.setEnabled ( true ) ; rule.setEnforcing ( false ) ; rule.setPositive ( true ) ; model.setHostsRule ( rule ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; org.junit.Assert.assertEquals ( EntityAffinityRule.POSITIVE , entity.getVdsAffinityRule ( ) ) ; org.junit.Assert.assertEquals ( false , entity.isVdsEnforcing ( ) ) ; }
Source:
public void canDoActionFailsOnSnapshotNotExists ( ) { org.mockito.Mockito.when ( snapshotDao.exists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( spyCommand.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( spyCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnSnapshotNotExists ( ) { org.mockito.Mockito.when ( snapshotDao.exists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( spyCommand.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( spyCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_DOES_NOT_EXIST.toString ( ) ) ) ; }
Source:
private void refreshClusterData ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { org.ovirt.engine.core.bll.gluster.GlusterManager.log.debugFormat ( "Refreshing Gluster lightweight Data for cluster {0}" , cluster.getname ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > existingServers = getVdsDao ( ) . getAllForVdsGroup ( cluster.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS upServer = getClusterUtils ( ) . getUpServer ( cluster.getId ( ) ) ; if ( upServer == null ) { org.ovirt.engine.core.bll.gluster.GlusterManager.log.debugFormat ( "No server UP in cluster {0}. Can't refresh it's data at this point." , cluster.getname ( ) ) ; return ; } refreshServerData ( cluster , upServer , existingServers ) ; refreshVolumeData ( cluster , upServer , existingServers ) ; }

Target:
public void refreshLightWeightData ( ) { log.debug ( "Refreshing Gluster Data [lightweight]" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = getClusterDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( cluster.supportsGlusterService ( ) ) { try { refreshClusterData ( cluster ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Error while refreshing Gluster lightweight data of cluster {0}!" , cluster.getname ( ) , e ) ; } } } }
Source:
public static org.ovirt.engine.api.extensions.ExtMap fetchPrincipalRecord ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , org.ovirt.engine.api.extensions.ExtMap authRecord ) { org.ovirt.engine.api.extensions.ExtMap ret = null ; org.ovirt.engine.api.extensions.ExtMap output = extension.invoke ( new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Base.InvokeKeys.COMMAND , Authz.InvokeCommands.FETCH_PRINCIPAL_RECORD ) . mput ( Authn.InvokeKeys.AUTH_RECORD , authRecord ) ) ; if ( ( output.< java.lang.Integer > get ( Authz.InvokeKeys.STATUS ) ) == ( Authz.Status.SUCCESS ) ) { ret = output.< org.ovirt.engine.api.extensions.ExtMap > get ( Authz.InvokeKeys.PRINCIPAL_RECORD ) ; } return ret ; }

Target:
private static org.ovirt.engine.api.extensions.ExtMap fetchPrincipalRecordImpl ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , org.ovirt.engine.api.extensions.ExtKey key , java.lang.Object value ) { org.ovirt.engine.api.extensions.ExtMap ret = null ; org.ovirt.engine.api.extensions.ExtMap output = extension.invoke ( new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Base.InvokeKeys.COMMAND , Authz.InvokeCommands.FETCH_PRINCIPAL_RECORD ) . mput ( key , value ) ) ; if ( ( output.< java.lang.Integer > get ( Authz.InvokeKeys.STATUS ) ) == ( Authz.Status.SUCCESS ) ) { ret = output.< org.ovirt.engine.api.extensions.ExtMap > get ( Authz.InvokeKeys.PRINCIPAL_RECORD ) ; } return ret ; }