auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public < T extends org.ovirt.engine.core.dao.GenericDao < ? , ? > > T getDaoForEntity ( java.lang.Class < ? extends org.ovirt.engine.core.common.businessentities.BusinessEntity < ? > > entityClass ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.lang.Class < T > daoType = ( ( java.lang.Class < T > ) ( org.ovirt.engine.core.dal.dbbroker.DbFacade.mapEntityToDao.get ( entityClass ) ) ) ; return getDAO ( daoType ) ; }

Target:
public < T extends org.ovirt.engine.core.dao.GenericDao < ? , ? > > T getDaoForEntity ( java.lang.Class < ? extends org.ovirt.engine.core.common.businessentities.BusinessEntity < ? > > entityClass ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.lang.Class < T > daoType = ( ( java.lang.Class < T > ) ( org.ovirt.engine.core.dal.dbbroker.DbFacade.mapEntityToDao.get ( entityClass ) ) ) ; return getDao ( daoType ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmTemplate getTemplateByName ( org.ovirt.engine.api.model.VM vm ) { return isFiltered ( ) ? lookupTemplateByName ( vm.getTemplate ( ) . getName ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.VmTemplate.class , SearchType.VmTemplate , ( "Template: name=" + ( vm.getTemplate ( ) . getName ( ) ) ) ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getTemplateId ( org.ovirt.engine.api.model.Template template ) { return template.isSetId ( ) ? asGuid ( template.getId ( ) ) : getTemplateByName ( template ) . getId ( ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; }

Target:
private static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > getClusterByServiceList ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list , boolean supportsVirtService , boolean supportsGlusterService ) { final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : list ) { if ( ( supportsVirtService && ( cluster.supportsVirtService ( ) ) ) || ( supportsGlusterService && ( cluster.supportsGlusterService ( ) ) ) ) { filteredList.add ( cluster ) ; } } java.util.Collections.sort ( filteredList , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return filteredList ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void countAllTemplates ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static void getVmById ( 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.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void canDoActionFailedUpdateReadOnly ( ) { org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.getDiskInfo ( ) . setReadOnly ( true ) ; initializeCommand ( parameters , java.util.Collections.singletonList ( createVm ( VMStatus.Up ) ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }

Target:
public void canDoActionFailedUpdateReadOnly ( ) { org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.getDiskInfo ( ) . setReadOnly ( true ) ; initializeCommand ( parameters , java.util.Collections.singletonList ( createVm ( VMStatus.Up ) ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }
Source:
public void initTable ( ) { org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . enableColumnResizing ( ) ; addTypeColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addUserColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addAuthzColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addNameSpaceColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addRoleColumn ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addCreationDateColum ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addAddPermissionsButton ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; addRemovePermissionsButton ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants ) ; }

Target:
private void addRemovePermissionsButton ( ) { org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . addActionButton ( new org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition < org.ovirt.engine.core.common.businessentities.Permission > ( org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getEventBus ( ) , org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants.removePermission ( ) ) { @ java.lang.Override protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getModel ( ) . getRemoveCommand ( ) ; } } ) ; }
Source:
public void testGetIdsForOvfDeletionTwoToDelete ( ) { vmDao.remove ( FixturesTool.VM_RHEL5_POOL_50 ) ; vmDao.remove ( FixturesTool.VM_RHEL5_POOL_51 ) ; java.util.List < org.ovirt.engine.core.compat.Guid > guidsToDelete = dao.getIdsForOvfDeletion ( FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER ) ; org.junit.Assert.assertEquals ( "there should be 2 ovfs for deletion" , 2 , guidsToDelete.size ( ) ) ; org.junit.Assert.assertTrue ( "the list of guids for deletion doesn't contain an expected guid" , guidsToDelete.contains ( FixturesTool.VM_RHEL5_POOL_50 ) ) ; org.junit.Assert.assertTrue ( "the list of guids for deletion doesn't contain an expected guid" , guidsToDelete.contains ( FixturesTool.VM_RHEL5_POOL_51 ) ) ; }

Target:
public void testGetIdsForOvfDeletionTwoToDelete ( ) { vmDao.remove ( FixturesTool.VM_RHEL5_POOL_50 ) ; vmDao.remove ( FixturesTool.VM_RHEL5_POOL_51 ) ; java.util.List < org.ovirt.engine.core.compat.Guid > guidsToDelete = dao.getIdsForOvfDeletion ( FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , guidsToDelete.size ( ) , "there should be 2 ovfs for deletion" ) ; org.junit.jupiter.api.Assertions.assertTrue ( guidsToDelete.contains ( FixturesTool.VM_RHEL5_POOL_50 ) , "the list of guids for deletion doesn't contain an expected guid" ) ; org.junit.jupiter.api.Assertions.assertTrue ( guidsToDelete.contains ( FixturesTool.VM_RHEL5_POOL_51 ) , "the list of guids for deletion doesn't contain an expected guid" ) ; }
Source:
public void isAnyHostUpInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) && ( ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ) ) { return true ; } return false ; } } ; getUpHostListByCluster ( aQuery , clusterName , 1 ) ; }

Target:
public void isAnyHostUpInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Boolean > aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.IsNonEmptyCollectionConverter ( ) ; getUpHostListByCluster ( aQuery , clusterName , 1 ) ; }
Source:
public java.util.Map shutdown ( java.lang.String vmId , java.lang.String timeout , java.lang.String message ) { final java.util.Map resultMap = getStatusMap ( "Machine shut down" , 0 ) ; final org.ovirt.vdsmfake.domain.VM vm = getActiveHost ( ) . getRunningVMs ( ) . get ( vmId ) ; if ( vm != null ) { vm.setStatus ( VM.VMStatus.PoweringDown ) ; } org.ovirt.vdsmfake.task.TaskProcessor.getInstance ( ) . addTask ( new org.ovirt.vdsmfake.task.TaskRequest ( org.ovirt.vdsmfake.task.TaskType.SHUTDOWN_VM , 5000L , vm ) ) ; return resultMap ; }

Target:
public java.util.Map shutdown ( java.lang.String vmId , java.lang.String timeout , java.lang.String message ) { final org.ovirt.vdsmfake.domain.VM vm = getActiveHost ( ) . getRunningVMs ( ) . get ( vmId ) ; if ( vm != null ) { vm.setStatus ( VM.VMStatus.PoweringDown ) ; } org.ovirt.vdsmfake.task.TaskProcessor.getInstance ( ) . addTask ( new org.ovirt.vdsmfake.task.TaskRequest ( org.ovirt.vdsmfake.task.TaskType.SHUTDOWN_VM , 5000L , vm ) ) ; return ResultCodes.MACHINE_SHUTDOWN.map ( ) ; }
Source:
public static boolean isAdminUser ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > userRoles = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getRoleDAO ( ) . getAllForUserAndGroups ( user.getId ( ) , org.apache.commons.lang.StringUtils.join ( user.getGroupIds ( ) , "," ) ) ; for ( org.ovirt.engine.core.common.businessentities.Role r : userRoles ) { if ( ( r.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.RoleType.ADMIN ) ) { if ( org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.isDebugEnabled ( ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.debugFormat ( "LoginAdminUser: User logged to admin using role {0}" , r.getname ( ) ) ; } return true ; } } return false ; }

Target:
public static boolean isAdminUser ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > userRoles = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getRoleDAO ( ) . getAnyAdminRoleForUserAndGroups ( user.getId ( ) , org.apache.commons.lang.StringUtils.join ( user.getGroupIds ( ) , "," ) ) ; if ( ! ( userRoles.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.debugFormat ( "LoginAdminUser: User logged to admin using role {0}" , userRoles.get ( 0 ) . getname ( ) ) ; return true ; } return false ; }
Source:
protected java.lang.String [ ] addSession ( java.lang.String ... names ) { java.lang.String [ ] ret = new java.lang.String [ ( names.length ) + 1 ] ; for ( int i = 0 ; i < ( names.length ) ; i ++ ) { ret [ i ] = names [ i ] ; } ret [ names.length ] = "SessionId" ; return ret ; }

Target:
protected java.lang.String [ ] addSession ( java.lang.String ... names ) { java.lang.String [ ] ret = new java.lang.String [ ( names.length ) + 1 ] ; java.lang.System.arraycopy ( names , 0 , ret , 0 , names.length ) ; ret [ names.length ] = "SessionId" ; return ret ; }
Source:
public void testUpdateSnapshotStatus ( ) { dao.updateSnapshotStatus ( existingSnapshot.getSnapshotId ( ) , GlusterSnapshotStatus.DEACTIVATED ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot = dao.getById ( existingSnapshot.getSnapshotId ( ) ) ; org.junit.Assert.assertNotNull ( snapshot ) ; org.junit.Assert.assertNotEquals ( snapshot , existingSnapshot ) ; existingSnapshot.setStatus ( GlusterSnapshotStatus.DEACTIVATED ) ; org.junit.Assert.assertEquals ( existingSnapshot , snapshot ) ; }

Target:
public void testUpdateSnapshotStatus ( ) { dao.updateSnapshotStatus ( existingSnapshot.getSnapshotId ( ) , GlusterSnapshotStatus.DEACTIVATED ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot = dao.getById ( existingSnapshot.getSnapshotId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( snapshot ) ; org.junit.jupiter.api.Assertions.assertNotEquals ( snapshot , existingSnapshot ) ; existingSnapshot.setStatus ( GlusterSnapshotStatus.DEACTIVATED ) ; org.junit.jupiter.api.Assertions.assertEquals ( existingSnapshot , snapshot ) ; }
Source:
public void testEmptyDiskStats ( ) { java.util.Map < java.lang.String , java.lang.Object > disksStats = new java.util.HashMap < > ( ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksStatsInXmlRpc ( disksStats ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.validateDisksStatsList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVds ( ) , xml , false ) ; }

Target:
public void testEmptyDiskStats ( ) { java.util.Map < java.lang.String , java.lang.Object > disksStats = new java.util.HashMap < > ( ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksStats ( disksStats ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.validateDisksStatsList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVds ( ) , xml , false ) ; }
Source:
public void canDoActionVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToVmsThatAreNotDown ( org.mockito.Matchers.anyBoolean ( ) , org.mockito.Matchers.anyList ( ) ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.name ( ) ) ) ; }

Target:
public void canDoActionVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToVmsThatAreNotDown ( org.mockito.Matchers.anyBoolean ( ) , org.mockito.Matchers.anyList ( ) ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.name ( ) ) ) ; }
Source:
public void shouldDetectSuspendedVM ( ) { invalidVM.setStatus ( VMStatus.Suspended ) ; org.hamcrest.MatcherAssert.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) , org.hamcrest.CoreMatchers.hasItem ( UPGRADE_ERROR.VM_SUSPENDED ) ) ; }

Target:
public void shouldDetectNumaPinning ( ) { invalidVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) , org.hamcrest.CoreMatchers.hasItem ( EngineMessage.CLUSTER_UPGRADE_DETAIL_VM_NUMA_PINNED.name ( ) ) ) ; }
Source:
protected void verify ( org.ovirt.engine.api.model.HostStorage model , org.ovirt.engine.api.model.HostStorage transform ) { assertNotNull ( transform ) ; assertEquals ( model.getId ( ) , transform.getId ( ) ) ; assertEquals ( model.getType ( ) , transform.getType ( ) ) ; assertNotNull ( model.getVolumeGroup ( ) ) ; assertEquals ( model.getVolumeGroup ( ) . getId ( ) , model.getVolumeGroup ( ) . getId ( ) ) ; }

Target:
protected void verify ( org.ovirt.engine.api.model.HostStorage model , org.ovirt.engine.api.model.HostStorage transform ) { org.junit.Assert.assertNotNull ( transform ) ; org.junit.Assert.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.Assert.assertEquals ( model.getType ( ) , transform.getType ( ) ) ; org.junit.Assert.assertNotNull ( model.getVolumeGroup ( ) ) ; org.junit.Assert.assertEquals ( model.getVolumeGroup ( ) . getId ( ) , model.getVolumeGroup ( ) . getId ( ) ) ; }
Source:
public void canDoActionMaxBlockDiskSizeCheckSucceeds ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createDiskImage ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.MAX_BLOCK_SIZE ) ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId , StorageType.ISCSI ) ; mockStoragePoolIsoMap ( ) ; runAndAssertCanDoActionSuccess ( ) ; }

Target:
public void canDoActionMaxBlockDiskSizeCheckSucceeds ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createDiskImage ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.MAX_BLOCK_SIZE ) ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId , StorageType.ISCSI ) ; mockStoragePoolIsoMap ( ) ; runAndAssertCanDoActionSuccess ( ) ; }
Source:
public static void GetAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }

Target:
public static void isMTUOverrideSupported ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String 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.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MTUOverrideSupported ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.scheduling.PolicyUnit > getBalancePolicyUnits ( ) { java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > list = new java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > ( ) ; for ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit : getPolicyUnits ( ) ) { if ( policyUnit.isBalanceImplemeted ( ) ) { list.add ( policyUnit ) ; } } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.common.scheduling.PolicyUnit > getBalancePolicyUnits ( ) { java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > list = new java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > ( ) ; for ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit : getPolicyUnits ( ) ) { if ( ( policyUnit.getPolicyUnitType ( ) ) == ( org.ovirt.engine.core.common.scheduling.PolicyUnitType.LoadBalancing ) ) { list.add ( policyUnit ) ; } } return list ; }
Source:
public static void GetDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static void GetClusterServerMemoryOverCommit ( 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.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static java.lang.String resolveStepMessage ( org.ovirt.engine.core.common.job.StepEnum stepName , java.util.Map < java.lang.String , java.lang.String > values ) { java.lang.String stepMessage = org.ovirt.engine.core.dal.job.ExecutionMessageDirector.getInstance ( ) . getStepMessage ( stepName ) ; if ( stepMessage != null ) { return org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resolveMessage ( stepMessage , values ) ; } else { return stepName.name ( ) ; } }

Target:
public static java.lang.String resolveStepMessage ( org.ovirt.engine.core.common.job.StepEnum stepName , java.util.Map < java.lang.String , java.lang.String > values ) { java.lang.String stepMessage = org.ovirt.engine.core.dal.job.ExecutionMessageDirector.getInstance ( ) . getStepMessage ( stepName ) ; if ( stepMessage != null ) { return org.ovirt.engine.core.dal.job.ExecutionMessageDirector.auditLogDirector.resolveMessage ( stepMessage , values ) ; } else { return stepName.name ( ) ; } }
Source:
public void testCombine ( ) { org.junit.Assert.assertEquals ( "/foo/bar" , org.ovirt.engine.api.utils.LinkCreator.combine ( "/foo" , "bar" ) ) ; org.junit.Assert.assertEquals ( "/foo/bar" , org.ovirt.engine.api.utils.LinkCreator.combine ( "/foo/" , "bar" ) ) ; org.junit.Assert.assertEquals ( "/foo/bar" , org.ovirt.engine.api.utils.LinkCreator.combine ( "/foo/" , "/bar" ) ) ; org.junit.Assert.assertEquals ( "/foo/bar" , org.ovirt.engine.api.utils.LinkCreator.combine ( "/foo" , "/bar" ) ) ; }

Target:
public void testCombine ( ) { org.junit.jupiter.api.Assertions.assertEquals ( "/foo/bar" , org.ovirt.engine.api.utils.LinkCreator.combine ( "/foo" , "bar" ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "/foo/bar" , org.ovirt.engine.api.utils.LinkCreator.combine ( "/foo/" , "bar" ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "/foo/bar" , org.ovirt.engine.api.utils.LinkCreator.combine ( "/foo/" , "/bar" ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "/foo/bar" , org.ovirt.engine.api.utils.LinkCreator.combine ( "/foo" , "/bar" ) ) ; }
Source:
public void testValidateEmptyAllowed ( ) { final org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidation underTest = new org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidationTest.MyIpAddressValidation ( true ) ; final org.ovirt.engine.ui.uicommonweb.validation.ValidationResult actual = underTest.validate ( org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidationTest.EMPTY ) ; org.junit.Assert.assertTrue ( actual.getSuccess ( ) ) ; org.junit.Assert.assertThat ( actual.getReasons ( ) , org.hamcrest.Matchers.emptyCollectionOf ( java.lang.String.class ) ) ; }

Target:
public void testValidateEmptyAllowed ( ) { final org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidation underTest = new org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidationTest.MyIpAddressValidation ( true ) ; final org.ovirt.engine.ui.uicommonweb.validation.ValidationResult actual = underTest.validate ( org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidationTest.EMPTY ) ; org.junit.jupiter.api.Assertions.assertTrue ( actual.getSuccess ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( actual.getReasons ( ) , org.hamcrest.Matchers.emptyCollectionOf ( java.lang.String.class ) ) ; }
Source:
private boolean stopVms ( ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : getCachedVmsInPool ( ) ) { if ( ! ( vm.isDown ( ) ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( VdcActionType.StopVm , withRootCommandInfo ( new org.ovirt.engine.core.common.action.StopVmParameters ( vm.getId ( ) , org.ovirt.engine.core.common.action.StopVmTypeEnum.NORMAL ) , org.ovirt.engine.core.bll.RemoveVmPoolCommand.getActionType ( ) ) , org.ovirt.engine.core.bll.RemoveVmPoolCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { return false ; } } } return true ; }

Target:
private void stopVms ( ) { allVmsDown = true ; for ( org.ovirt.engine.core.common.businessentities.VM vm : getCachedVmsInPool ( ) ) { if ( ! ( vm.isDown ( ) ) ) { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( VdcActionType.StopVm , org.ovirt.engine.core.bll.RemoveVmPoolCommand.withRootCommandInfo ( new org.ovirt.engine.core.common.action.StopVmParameters ( vm.getId ( ) , org.ovirt.engine.core.common.action.StopVmTypeEnum.NORMAL ) ) , org.ovirt.engine.core.bll.RemoveVmPoolCommand.cloneContextAndDetachFromParent ( ) ) ; allVmsDown = false ; } else { removeVm ( vm ) ; } } }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getNetworkDao ( ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; datacenter = new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ; new_net = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; new_net.setName ( "newnet1" ) ; new_net.setVdsmName ( "newnet1" ) ; new_net.setDescription ( "New network" ) ; new_net.setDataCenterId ( datacenter ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getNetworkDao ( ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; datacenter = org.ovirt.engine.core.dao.FixturesTool.DATA_CENTER ; new_net = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; new_net.setName ( "newnet1" ) ; new_net.setVdsmName ( "newnet1" ) ; new_net.setDescription ( "New network" ) ; new_net.setDataCenterId ( datacenter ) ; }
Source:
public static void GetAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) , aQuery ) ; }

Target:
public static void GetRedirectServletReportsPage ( 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.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage ) , aQuery ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunAction: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null , state ) ; callback.Executed ( f ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunAction: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null , state ) ; callback.Executed ( f ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = ( ( org.ovirt.engine.core.common.businessentities.LunDisk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return disk.isShareable ( ) ? resources.shareableDiskIcon ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.core.common.businessentities.Disk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; setTitle ( ( disk.isBoot ( ) ? constants.bootableDisk ( ) : null ) ) ; return disk.isBoot ( ) ? resources.bootableDiskIcon ( ) : null ; }
Source:
protected boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( org.ovirt.engine.core.bll.pm.RestartVdsCommand.isInternalExecution ( ) ) ? 0 : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.pm.RestartVdsCommand.getVds ( ) . getName ( ) , AuditLogType.USER_VDS_RESTART.name ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addCanDoActionMessage ( EngineMessage.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.pm.RestartVdsCommand.addCanDoActionMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }

Target:
protected boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( org.ovirt.engine.core.bll.pm.RestartVdsCommand.isInternalExecution ( ) ) ? 0 : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.pm.RestartVdsCommand.getVds ( ) . getName ( ) , AuditLogType.USER_VDS_RESTART.name ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addValidationMessage ( EngineMessage.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.pm.RestartVdsCommand.addValidationMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }
Source:
private long findUnusedMac ( ) { int index = usedMacs.nextClearBit ( 0 ) ; return ( rangeStart ) + index ; }

Target:
private long findUnusedMac ( ) { int index = usedMacs.nextClearBit ( startingLocationWhenSearchingForUnusedMac ) ; boolean notFound = index == ( numberOfMacsInRange ) ; if ( notFound ) { index = usedMacs.nextClearBit ( 0 ) ; } startingLocationWhenSearchingForUnusedMac = ( index + 1 ) % ( numberOfMacsInRange ) ; return ( rangeStart ) + index ; }
Source:
private void updateShareable ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( ( storageType.isBlockDomain ( ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupportedByConfiguration ( ) ) ; getIsShareable ( ) . setIsChangable ( false ) ; getIsShareable ( ) . setEntity ( false ) ; } else { getIsShareable ( ) . setIsChangable ( true ) ; } }

Target:
private void updateShareable ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( ( storageType.isBlockDomain ( ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupportedByConfiguration ( ) ) ; getIsShareable ( ) . setIsChangable ( false ) ; getIsShareable ( ) . setEntity ( false ) ; } else { getIsShareable ( ) . setIsChangable ( ( ( ( getVm ( ) ) != null ) && ( getVm ( ) . isDown ( ) ) ) ) ; } }
Source:
public void setup ( ) throws java.lang.Exception { validator = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) ; org.ovirt.engine.core.common.config.IConfigUtilsInterface confUtils = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ; org.mockito.Mockito.when ( confUtils.GetValue ( ConfigValues.MaxMTU , Config.DefaultConfigurationVersion ) ) . thenReturn ( org.ovirt.engine.core.common.utils.MTUValidatorTest.TEST_MAX_MTU ) ; org.mockito.Mockito.when ( confUtils.GetValue ( ConfigValues.ManagementNetwork , Config.DefaultConfigurationVersion ) ) . thenReturn ( org.ovirt.engine.core.common.utils.MTUValidatorTest.TEST_MANAGEMENT_NETWORK ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( confUtils ) ; }

Target:
public void setup ( ) throws java.lang.Exception { validator = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) ; org.ovirt.engine.core.common.config.IConfigUtilsInterface confUtils = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ; org.mockito.Mockito.when ( confUtils.GetValue ( ConfigValues.MaxMTU , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( org.ovirt.engine.core.common.utils.MTUValidatorTest.TEST_MAX_MTU ) ; org.mockito.Mockito.when ( confUtils.GetValue ( ConfigValues.ManagementNetwork , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( org.ovirt.engine.core.common.utils.MTUValidatorTest.TEST_MANAGEMENT_NETWORK ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( confUtils ) ; }
Source:
public static org.ovirt.engine.core.aaa.DirectoryGroup findGroupById ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , java.lang.String namespace , final java.lang.String id ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > groups = org.ovirt.engine.core.aaa.AuthzUtils.findGroupsByIds ( extension , namespace , java.util.Arrays.asList ( id ) ) ; if ( groups.isEmpty ( ) ) { return null ; } return groups.get ( 0 ) ; }

Target:
public static org.ovirt.engine.core.aaa.DirectoryGroup findGroupById ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , java.lang.String namespace , final java.lang.String id , final boolean resolveGroups , final boolean resolveGroupsRecursive ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > groups = org.ovirt.engine.core.aaa.AuthzUtils.findGroupsByIds ( extension , namespace , java.util.Arrays.asList ( id ) , resolveGroups , resolveGroupsRecursive ) ; if ( groups.isEmpty ( ) ) { return null ; } return groups.get ( 0 ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getTemplateDisks ( ) { if ( ( ( templateDisks ) == null ) && ( ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) ) { org.ovirt.engine.core.bll.VmTemplateHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; templateDisks = org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) . getDiskList ( ) ; } return templateDisks ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getTemplateDisks ( ) { if ( ( ( templateDisks ) == null ) && ( ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) ) { vmTemplateHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; templateDisks = org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getVmTemplate ( ) . getDiskList ( ) ; } return templateDisks ; }
Source:
private void removeVmHibernationVolumes ( ) { org.ovirt.engine.core.common.action.RemoveVmHibernationVolumesParameters removeVmHibernationVolumesParameters = new org.ovirt.engine.core.common.action.RemoveVmHibernationVolumesParameters ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; removeVmHibernationVolumesParameters.setParentCommand ( org.ovirt.engine.core.bll.RunVmCommandBase.getActionType ( ) ) ; removeVmHibernationVolumesParameters.setEntityInfo ( org.ovirt.engine.core.bll.RunVmCommandBase.getParameters ( ) . getEntityInfo ( ) ) ; removeVmHibernationVolumesParameters.setParentParameters ( org.ovirt.engine.core.bll.RunVmCommandBase.getParameters ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( VdcActionType.RemoveVmHibernationVolumes , removeVmHibernationVolumesParameters ) ; for ( org.ovirt.engine.core.compat.Guid taskId : vdcRetValue.getInternalVdsmTaskIdList ( ) ) { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.startPollingTask ( taskId ) ; } }

Target:
private void removeVmHibernationVolumes ( ) { org.ovirt.engine.core.common.action.RemoveVmHibernationVolumesParameters removeVmHibernationVolumesParameters = new org.ovirt.engine.core.common.action.RemoveVmHibernationVolumesParameters ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; removeVmHibernationVolumesParameters.setParentCommand ( org.ovirt.engine.core.bll.RunVmCommandBase.getActionType ( ) ) ; removeVmHibernationVolumesParameters.setEntityInfo ( org.ovirt.engine.core.bll.RunVmCommandBase.getParameters ( ) . getEntityInfo ( ) ) ; removeVmHibernationVolumesParameters.setParentParameters ( org.ovirt.engine.core.bll.RunVmCommandBase.getParameters ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( VdcActionType.RemoveVmHibernationVolumes , removeVmHibernationVolumesParameters ) ; for ( org.ovirt.engine.core.compat.Guid taskId : vdcRetValue.getInternalVdsmTaskIdList ( ) ) { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.startPollingTask ( taskId ) ; } }
Source:
protected boolean validateUsbPolicy ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getParameters ( ) . getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.updateImportedVmUsbPolicy ( vm.getStaticData ( ) ) ; return org.ovirt.engine.core.bll.VmHandler.isUsbPolicyLegal ( vm.getUsbPolicy ( ) , vm.getOs ( ) , getVdsGroup ( ) , getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( getVdsGroup ( ) . getcompatibility_version ( ) ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; return false ; } } return true ; }
Source:
public static void GetVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.GetVmConfigurationBySnapshotQueryParams ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void GetVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getStatusImage ( org.ovirt.engine.core.common.job.JobExecutionStatus jobExecutionStatus ) { if ( jobExecutionStatus == null ) { return resources.questionMarkImage ( ) ; } switch ( jobExecutionStatus ) { case STARTED : return resources.waitImage ( ) ; case FINISHED : return resources.logNormalImage ( ) ; case FAILED : return resources.logErrorImage ( ) ; case ABORTED : return resources.logWarningImage ( ) ; case UNKNOWN : return resources.questionMarkImage ( ) ; default : return null ; } }

Target:
public com.google.gwt.resources.client.ImageResource getStatusImage ( org.ovirt.engine.core.common.job.JobExecutionStatus jobExecutionStatus ) { if ( jobExecutionStatus == null ) { return org.ovirt.engine.ui.webadmin.widget.footer.TasksTree.resources.questionMarkImage ( ) ; } switch ( jobExecutionStatus ) { case STARTED : return org.ovirt.engine.ui.webadmin.widget.footer.TasksTree.resources.waitImage ( ) ; case FINISHED : return org.ovirt.engine.ui.webadmin.widget.footer.TasksTree.resources.logNormalImage ( ) ; case FAILED : return org.ovirt.engine.ui.webadmin.widget.footer.TasksTree.resources.logErrorImage ( ) ; case ABORTED : return org.ovirt.engine.ui.webadmin.widget.footer.TasksTree.resources.logWarningImage ( ) ; case UNKNOWN : return org.ovirt.engine.ui.webadmin.widget.footer.TasksTree.resources.questionMarkImage ( ) ; default : return null ; } }
Source:
public void testListCrash ( ) { java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpDiskProfilesQueryExpectations ( t ) ; javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; try { org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.getCollection ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrashClientLocale ( ) { javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpDiskProfilesQueryExpectations ( t ) ; collection.setUriInfo ( uriInfo ) ; verifyFault ( org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; }