auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void validateFailsForDeviceAlreadyInUse ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = getStorageDevice ( "sda" , null ) ; storageDevice.setCanCreateBrick ( false ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.singletonList ( storageDevice ) ) , null ) ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsForDeviceAlreadyInUse ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = getStorageDevice ( "sda" ) ; storageDevice.setCanCreateBrick ( false ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.singletonList ( storageDevice ) ) , null ) ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getCurrentUser ( ) . getId ( ) ) ) ) ) { return false ; } return true ; }

Target:
protected boolean updateVnicForBackwardCompatibility ( ) { if ( ! ( validate ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.updateNicForBackwardCompatibility ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getInterface ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getNetworkName ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . isPortMirroring ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getCurrentUser ( ) ) ) ) ) { return false ; } return true ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel bookmarkListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.bookmarks.BookmarkListModel ) ( model ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Bookmark > resultList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Bookmark > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; if ( resultList != null ) { java.util.Collections.sort ( resultList , org.ovirt.engine.ui.uicommonweb.models.bookmarks.BookmarkListModel.COMPARATOR ) ; } setIsBookmarkInitiated ( true ) ; bookmarkListModel.setItems ( resultList ) ; setIsBookmarkInitiated ( false ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel bookmarkListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.bookmarks.BookmarkListModel ) ( model ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Bookmark > resultList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Bookmark > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; if ( resultList != null ) { java.util.Collections.sort ( resultList , org.ovirt.engine.ui.uicommonweb.models.bookmarks.BookmarkListModel.COMPARATOR ) ; } setIsBookmarkInitiated ( true ) ; bookmarkListModel.setItems ( resultList ) ; setIsBookmarkInitiated ( false ) ; }
Source:
public void testExecuteQueryWithDirectOnly ( ) { org.ovirt.engine.core.dao.PermissionDao permissionDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.PermissionDao.class ) ; org.mockito.Mockito.when ( permissionDaoMock.getAllForEntity ( objectID , org.ovirt.engine.core.bll.UNPRIVILEGED_USER_SESSION_ID , getQueryParameters ( ) . isFiltered ( ) , false ) ) . thenReturn ( mockedPermissions ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getPermissionDao ( ) ) . thenReturn ( permissionDaoMock ) ; assertQueryDaoCall ( true ) ; }

Target:
public void testExecuteQueryWithDirectOnly ( ) { org.mockito.Mockito.when ( permissionDaoMock.getAllForEntity ( objectID , org.ovirt.engine.core.bll.UNPRIVILEGED_USER_SESSION_ID , getQueryParameters ( ) . isFiltered ( ) , false ) ) . thenReturn ( mockedPermissions ) ; assertQueryDaoCall ( true ) ; }
Source:
public void testCompareToVmIdsAreNotEqual ( ) { org.ovirt.engine.core.compat.Guid vmId1 = org.ovirt.engine.core.compat.Guid.createGuidFromString ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2463" ) ; org.ovirt.engine.core.compat.Guid vmId2 = org.ovirt.engine.core.compat.Guid.createGuidFromString ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2464" ) ; org.ovirt.engine.core.compat.Guid deviceId1 = org.ovirt.engine.core.compat.Guid.createGuidFromString ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2465" ) ; org.ovirt.engine.core.compat.Guid deviceId2 = org.ovirt.engine.core.compat.Guid.createGuidFromString ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2466" ) ; org.ovirt.engine.core.common.businessentities.VmDevice device1 = createVmDevice ( deviceId1 , vmId1 ) ; org.ovirt.engine.core.common.businessentities.VmDevice device2 = createVmDevice ( deviceId2 , vmId2 ) ; assertCompareTo ( device1 , device2 ) ; device1 = createVmDevice ( deviceId1 , vmId1 ) ; device2 = createVmDevice ( deviceId1 , vmId2 ) ; assertCompareTo ( device1 , device2 ) ; }

Target:
public void testCompareToVmIdsAreNotEqual ( ) { org.ovirt.engine.core.compat.Guid vmId1 = new org.ovirt.engine.core.compat.Guid ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2463" ) ; org.ovirt.engine.core.compat.Guid vmId2 = new org.ovirt.engine.core.compat.Guid ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2464" ) ; org.ovirt.engine.core.compat.Guid deviceId1 = new org.ovirt.engine.core.compat.Guid ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2465" ) ; org.ovirt.engine.core.compat.Guid deviceId2 = new org.ovirt.engine.core.compat.Guid ( "b23ad6d7-0df8-4d69-b4e5-d5b5e90c2466" ) ; org.ovirt.engine.core.common.businessentities.VmDevice device1 = createVmDevice ( deviceId1 , vmId1 ) ; org.ovirt.engine.core.common.businessentities.VmDevice device2 = createVmDevice ( deviceId2 , vmId2 ) ; assertCompareTo ( device1 , device2 ) ; device1 = createVmDevice ( deviceId1 , vmId1 ) ; device2 = createVmDevice ( deviceId1 , vmId2 ) ; assertCompareTo ( device1 , device2 ) ; }
Source:
public org.ovirt.engine.core.compat.Guid getQuotaId ( ) { if ( ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) != null ) && ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) == ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) ) ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) ) . getQuotaId ( ) ; } return null ; }

Target:
private org.ovirt.engine.core.compat.Guid getQuotaId ( ) { if ( ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) != null ) && ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) == ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) ) ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) ) . getQuotaId ( ) ; } return null ; }
Source:
public void hostProviderExists ( ) { org.mockito.Mockito.when ( host.getHostProviderId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( providerDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Provider.class ) ) ; org.junit.Assert.assertThat ( validator.hostProviderExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void hostProviderExists ( ) { org.mockito.Mockito.when ( host.getHostProviderId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( providerDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Provider.class ) ) ; org.junit.Assert.assertThat ( validator.hostProviderExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private 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 ( org.ovirt.engine.core.compat.Guid.Empty , vm.getId ( ) ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , "device" , "address" , 1 , new java.util.HashMap < > ( ) , true , true , true , "alias" , new java.util.HashMap < > ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , "logical" , true ) ; }

Target:
private 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 ( org.ovirt.engine.core.compat.Guid.Empty , vm.getId ( ) ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , "device" , "address" , 1 , new java.util.HashMap < > ( ) , true , true , true , "alias" , new java.util.HashMap < > ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , "logical" ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StoragePool mockStoragePool ( org.ovirt.engine.core.compat.Version compatibilityVersion ) { org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( storagePoolId ) ; storagePool.setCompatibilityVersion ( compatibilityVersion ) ; storagePool.setStatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePoolId ) ) . thenReturn ( storagePool ) ; return storagePool ; }

Target:
private org.ovirt.engine.core.common.businessentities.StoragePool mockStoragePool ( ) { org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( storagePoolId ) ; storagePool.setStatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePoolId ) ) . thenReturn ( storagePool ) ; return storagePool ; }
Source:
public void migrationSupported ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . migrationSupportedForArch ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void migrationSupported ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . migrationSupportedForArch ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( array [ 0 ] ) ) ; behavior.maxNumOfSockets = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.UpdataMaxVmsInPool ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( array [ 0 ] ) ) ; behavior.maxNumOfSockets = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.UpdataMaxVmsInPool ( ) ; }
Source:
protected void removeSnapshot ( org.ovirt.engine.core.common.businessentities.storage.DiskImage snapshot ) { org.ovirt.engine.core.bll.BaseImagesCommand.getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesForDisk = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { getBaseDiskDao ( ) . remove ( snapshot.getId ( ) ) ; } }

Target:
protected void removeSnapshot ( org.ovirt.engine.core.common.businessentities.storage.DiskImage snapshot ) { org.ovirt.engine.core.bll.BaseImagesCommand.getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesForDisk = org.ovirt.engine.core.bll.BaseImagesCommand.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.BaseImagesCommand.getBaseDiskDao ( ) . remove ( snapshot.getId ( ) ) ; } }
Source:
public void testUpdate ( ) { existingGroup.setName ( existingGroup.getName ( ) . toUpperCase ( ) ) ; existingGroup.setDomain ( existingGroup.getDomain ( ) . toUpperCase ( ) ) ; existingGroup.setActive ( false ) ; dao.update ( existingGroup ) ; org.ovirt.engine.core.common.businessentities.aaa.DbGroup result = dao.get ( existingGroup.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingGroup , result ) ; }

Target:
public void testUpdate ( ) { existingGroup.setName ( existingGroup.getName ( ) . toUpperCase ( ) ) ; existingGroup.setDomain ( existingGroup.getDomain ( ) . toUpperCase ( ) ) ; dao.update ( existingGroup ) ; org.ovirt.engine.core.common.businessentities.aaa.DbGroup result = dao.get ( existingGroup.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingGroup , result ) ; }
Source:
private org.ovirt.engine.core.bll.gluster.ReplaceGlusterVolumeBrickCommand createTestCommand1 ( org.ovirt.engine.core.compat.Guid volumeId ) { return new org.ovirt.engine.core.bll.gluster.ReplaceGlusterVolumeBrickCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeReplaceBrickActionParameters ( volumeId , org.ovirt.engine.core.common.businessentities.gluster.GlusterTaskOperation.START , getBricks ( volumeId , "distrib" , 1 ) . get ( 0 ) , getBricks ( volumeId , "new" , 1 ) . get ( 0 ) , false ) ) ; }

Target:
private org.ovirt.engine.core.bll.gluster.ReplaceGlusterVolumeBrickCommand createTestCommand1 ( org.ovirt.engine.core.compat.Guid volumeId ) { return new org.ovirt.engine.core.bll.gluster.ReplaceGlusterVolumeBrickCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeReplaceBrickActionParameters ( volumeId , org.ovirt.engine.core.common.businessentities.gluster.GlusterTaskOperation.START , getBricks ( volumeId , "distrib" , 1 ) . get ( 0 ) , getBricks ( volumeId , "new" , 1 ) . get ( 0 ) , false ) , null ) ; }
Source:
public void validateVmShareableDisk ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED.toString ( ) ) ) ; }

Target:
public void validateVmShareableDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED.toString ( ) ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { initializeVds ( ) ; AlertIfPowerManagementNotConfigured ( getParameters ( ) . getVdsStaticData ( ) ) ; TestVdsPowerManagementStatus ( getParameters ( ) . getVdsStaticData ( ) ) ; setSucceeded ( true ) ; setActionReturnValue ( getVdsIdRef ( ) ) ; getCompensationContext ( ) . resetCompensation ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { initializeVds ( true ) ; AlertIfPowerManagementNotConfigured ( getParameters ( ) . getVdsStaticData ( ) ) ; TestVdsPowerManagementStatus ( getParameters ( ) . getVdsStaticData ( ) ) ; setSucceeded ( true ) ; setActionReturnValue ( getVdsIdRef ( ) ) ; getCompensationContext ( ) . resetCompensation ( ) ; return null ; }
Source:
private void loadIconsToDatabase ( ) { final java.util.HashMap < java.lang.Integer , java.lang.String > osIdToOsNameMap = org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) ; for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > entry : osIdToOsNameMap.entrySet ( ) ) { final org.ovirt.engine.core.common.queries.VmIconIdSizePair iconIdPair = org.ovirt.engine.core.bll.IconLoader.ensureIconsInDatabase ( entry.getValue ( ) ) ; if ( iconIdPair != null ) { osIdToIconIdMap.put ( entry.getKey ( ) , iconIdPair ) ; } } }

Target:
private void loadIconsToDatabase ( ) { final java.util.Map < java.lang.Integer , java.lang.String > osIdToOsNameMap = org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) ; for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > entry : osIdToOsNameMap.entrySet ( ) ) { final org.ovirt.engine.core.common.queries.VmIconIdSizePair iconIdPair = org.ovirt.engine.core.bll.IconLoader.ensureIconsInDatabase ( entry.getValue ( ) ) ; if ( iconIdPair != null ) { osIdToIconIdMap.put ( entry.getKey ( ) , iconIdPair ) ; } } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ) ) ; if ( vm == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.pools.PoolInterfaceListModel poolInterfaceListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolInterfaceListModel ) ( model ) ) ; poolInterfaceListModel.syncSearch ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vm.getId ( ) ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ; if ( vm == null ) { return ; } syncSearch ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vm.getId ( ) ) ) ; } }
Source:
protected org.ovirt.engine.core.bll.ValidationResult validateInterfacesConfigured ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic : vm.getInterfaces ( ) ) { if ( ( nic.getVnicProfileId ( ) ) == null ) { return ! ( org.ovirt.engine.core.common.FeatureSupported.networkLinking ( vm.getVdsGroupCompatibilityVersion ( ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult validateInterfacesConfigured ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic : vm.getInterfaces ( ) ) { if ( ( nic.getVnicProfileId ( ) ) == null ) { return org.ovirt.engine.core.common.FeatureSupported.networkLinking ( vm.getVdsGroupCompatibilityVersion ( ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected void selectionChanged ( java.lang.Boolean value ) { for ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model : getClustersTableItems ( ) ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel networkClusterModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel ) ( model ) ) ; if ( networkClusterModel.getIsChangable ( ) ) { networkClusterModel.setAttached ( value ) ; } } refreshClustersTable ( ) ; }

Target:
protected void selectionChanged ( java.lang.Boolean value ) { for ( org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel networkClusterModel : getClustersTableItems ( ) ) { if ( networkClusterModel.getIsChangable ( ) ) { networkClusterModel.setAttached ( value ) ; } } refreshClustersTable ( ) ; }
Source:
protected void setUserDomainCredentials ( java.lang.String domain ) { setLoginName ( configuration.getProperty ( "config.AdUserName" ) ) ; try { setPassword ( org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils.decrypt ( configuration.getProperty ( "config.AdUserPassword" ) ) ) ; } catch ( java.security.GeneralSecurityException e ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapBrokerCommandBase.log.error ( java.lang.String.format ( "Error decrypting password. Message is: %1$s" , e.getMessage ( ) ) ) ; throw new java.lang.RuntimeException ( e ) ; } if ( getLoginName ( ) . contains ( "@" ) ) { java.lang.String userDomain = getLoginName ( ) . split ( "@" ) [ 1 ] . toLowerCase ( ) ; setAuthenticationDomain ( userDomain ) ; } else { setAuthenticationDomain ( domain ) ; } }

Target:
protected void setUserDomainCredentials ( java.lang.String domain ) { setLoginName ( configuration.getProperty ( "config.AdUserName" ) ) ; setPassword ( configuration.getProperty ( "config.AdUserPassword" ) ) ; if ( getLoginName ( ) . contains ( "@" ) ) { java.lang.String userDomain = getLoginName ( ) . split ( "@" ) [ 1 ] . toLowerCase ( ) ; setAuthenticationDomain ( userDomain ) ; } else { setAuthenticationDomain ( domain ) ; } }
Source:
protected void initAppTable ( ) { appTable = new org.ovirt.engine.ui.common.widget.editor.ListModelObjectCellTable < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.vms.VmAppListModel > ( ) ; appTable.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String object ) { return object ; } } , constants.installedApp ( ) ) ; appTable.getElement ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; com.google.gwt.user.client.ui.ScrollPanel appPanel = new com.google.gwt.user.client.ui.ScrollPanel ( ) ; appPanel.add ( appTable ) ; subTabLayoutPanel.add ( appPanel , constants.importVmApplicationslSubTabLabel ( ) ) ; }

Target:
protected void initAppTable ( ) { appTable = new org.ovirt.engine.ui.common.widget.editor.ListModelObjectCellTable ( ) ; appTable.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String object ) { return object ; } } , constants.installedApp ( ) ) ; appTable.getElement ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; com.google.gwt.user.client.ui.ScrollPanel appPanel = new com.google.gwt.user.client.ui.ScrollPanel ( ) ; appPanel.add ( appTable ) ; subTabLayoutPanel.add ( appPanel , constants.importVmApplicationslSubTabLabel ( ) ) ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnitToUpdate = dao.get ( FixturesTool.POLICY_UNIT_MIGRATION ) ; java.util.Map < java.lang.String , java.lang.String > map = new java.util.LinkedHashMap < > ( ) ; map.put ( "A" , "B" ) ; policyUnitToUpdate.setParameterRegExMap ( map ) ; policyUnitToUpdate.setDescription ( "dummy description" ) ; dao.update ( policyUnitToUpdate ) ; org.ovirt.engine.core.common.scheduling.PolicyUnit result = dao.get ( policyUnitToUpdate.getId ( ) ) ; org.junit.Assert.assertTrue ( result.equals ( policyUnitToUpdate ) ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnitToUpdate = dao.get ( FixturesTool.POLICY_UNIT_MIGRATION ) ; java.util.Map < java.lang.String , java.lang.String > map = new java.util.LinkedHashMap < > ( ) ; map.put ( "A" , "B" ) ; policyUnitToUpdate.setParameterRegExMap ( map ) ; policyUnitToUpdate.setDescription ( "dummy description" ) ; dao.update ( policyUnitToUpdate ) ; org.ovirt.engine.core.common.scheduling.PolicyUnit result = dao.get ( policyUnitToUpdate.getId ( ) ) ; org.junit.Assert.assertEquals ( result , policyUnitToUpdate ) ; }
Source:
public void canSetNumaPinning ( ) { paramNumaNodes.clear ( ) ; paramNumaNodes.add ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ; mockCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massSaveNumaNode ( org.mockito.ArgumentMatchers.eq ( paramNumaNodes ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
public void canSetNumaPinning ( ) { paramNumaNodes.clear ( ) ; paramNumaNodes.add ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ; mockCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massSaveNumaNode ( org.mockito.ArgumentMatchers.eq ( paramNumaNodes ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
protected void setSelectedOSType ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.common.businessentities.ArchitectureType architectureType ) { if ( vmBase.getId ( ) . equals ( Guid.Empty ) ) { java.lang.Integer osId = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultOs ( architectureType ) ; if ( osId != null ) { setSelectedOSTypeById ( osId.intValue ( ) ) ; } } else { setSelectedOSTypeById ( vmBase.getOsId ( ) ) ; } }

Target:
protected void setSelectedOSType ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.core.common.businessentities.ArchitectureType architectureType ) { if ( vmBase.getId ( ) . equals ( Guid.Empty ) ) { java.lang.Integer osId = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDefaultOs ( architectureType ) ; if ( osId != null ) { setSelectedOSTypeById ( osId.intValue ( ) ) ; } } else { setSelectedOSTypeById ( vmBase.getOsId ( ) ) ; } }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > repoList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > ) ( source ) ) ; java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage : repoList ) { fileNameList.add ( repoImage.getRepoImageId ( ) ) ; } java.util.Collections.sort ( fileNameList , java.lang.String.CASE_INSENSITIVE_ORDER ) ; return fileNameList ; } return new java.util.ArrayList < java.lang.String > ( ) ; }

Target:
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 ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Disk disk ) { validateEnums ( org.ovirt.engine.api.model.Disk.class , disk ) ; if ( disk.isSetId ( ) ) { return javax.ws.rs.core.Response.fromResponse ( attachDiskToVm ( disk ) ) . entity ( lookupEntity ( asGuid ( disk.getId ( ) ) ) ) . build ( ) ; } else { validateDiskForCreation ( disk ) ; return performCreation ( addAction , getAddParameters ( map ( disk ) , disk ) , getEntityIdResolver ( disk.getName ( ) ) ) ; } }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Disk disk ) { validateEnums ( org.ovirt.engine.api.model.Disk.class , disk ) ; if ( disk.isSetId ( ) ) { return javax.ws.rs.core.Response.fromResponse ( attachDiskToVm ( disk ) ) . entity ( map ( lookupEntity ( asGuid ( disk.getId ( ) ) ) ) ) . build ( ) ; } else { validateDiskForCreation ( disk ) ; return performCreation ( addAction , getAddParameters ( map ( disk ) , disk ) , getEntityIdResolver ( disk.getName ( ) ) ) ; } }
Source:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getBroker ( ) . getStorageDomainInfo ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.ProceedProxyReturnValue ( ) ; org.ovirt.engine.core.utils.Pair < org.ovirt.engine.core.common.businessentities.storage_domain_static , org.ovirt.engine.core.common.businessentities.SANState > pairSdStatic = BuildStorageStaticFromXmlRpcStruct ( _result.mStorageInfo ) ; pairSdStatic.getFirst ( ) . setId ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( pairSdStatic ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getBroker ( ) . getStorageDomainInfo ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.ProceedProxyReturnValue ( ) ; org.ovirt.engine.core.utils.Pair < org.ovirt.engine.core.common.businessentities.storage_domain_static , org.ovirt.engine.core.common.businessentities.SANState > pairSdStatic = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.BuildStorageStaticFromXmlRpcStruct ( _result.mStorageInfo ) ; pairSdStatic.getFirst ( ) . setId ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( pairSdStatic ) ; }
Source:
public static java.lang.String firstMatch ( java.util.List < java.lang.String > src , java.lang.String ... lookup ) { java.util.Arrays.sort ( lookup ) ; for ( java.lang.String s : src ) { int matchedIndex = java.util.Arrays.binarySearch ( lookup , s ) ; if ( matchedIndex >= 0 ) { return lookup [ matchedIndex ] ; } } return null ; }

Target:
public static java.lang.String firstMatch ( java.util.List < java.lang.String > src , java.lang.String ... lookup ) { if ( lookup == null ) { return null ; } java.util.Arrays.sort ( lookup ) ; for ( java.lang.String s : src ) { int matchedIndex = java.util.Arrays.binarySearch ( lookup , s ) ; if ( matchedIndex >= 0 ) { return lookup [ matchedIndex ] ; } } return null ; }
Source:
public java.lang.Void runInTransaction ( ) { getDbFacade ( ) . getIscsiBondDao ( ) . save ( iscsiBond ) ; for ( org.ovirt.engine.core.compat.Guid networkId : iscsiBond.getNetworkIds ( ) ) { getDbFacade ( ) . getIscsiBondDao ( ) . addNetworkToIscsiBond ( iscsiBond.getId ( ) , networkId ) ; } for ( java.lang.String connectionId : iscsiBond.getStorageConnectionIds ( ) ) { getDbFacade ( ) . getIscsiBondDao ( ) . addStorageConnectionToIscsiBond ( iscsiBond.getId ( ) , connectionId ) ; } getReturnValue ( ) . setActionReturnValue ( iscsiBond.getId ( ) ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getDbFacade ( ) . getIscsiBondDao ( ) . save ( iscsiBond ) ; for ( org.ovirt.engine.core.compat.Guid networkId : iscsiBond.getNetworkIds ( ) ) { getDbFacade ( ) . getIscsiBondDao ( ) . addNetworkToIscsiBond ( iscsiBond.getId ( ) , networkId ) ; } for ( java.lang.String connectionId : iscsiBond.getStorageConnectionIds ( ) ) { getDbFacade ( ) . getIscsiBondDao ( ) . addStorageConnectionToIscsiBond ( iscsiBond.getId ( ) , connectionId ) ; } return null ; }
Source:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findPrincipalsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.util.List < java.lang.String > ids ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.AuthzUtils.getIdsBatches ( extension , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipals ( extension , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.PRINCIPAL ) , true ) ) ; } return results ; }

Target:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findPrincipalsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.util.List < java.lang.String > ids ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipals ( extension , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.PRINCIPAL ) , true ) ) ; } return results ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; if ( ( pools == null ) || ( ( pools.size ( ) ) != 1 ) ) { return ; } org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = pools.get ( 0 ) ; setStoragePool ( dataCenter ) ; callback.onSuccess ( model , returnValue ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > pools ) { if ( ( pools == null ) || ( ( pools.size ( ) ) != 1 ) ) { return ; } org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = pools.get ( 0 ) ; setStoragePool ( dataCenter ) ; callback.onSuccess ( pools ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotPlugNic ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotplugNic ( info.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotPlugNic ( java.util.Map info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotplugNic ( info ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( object.getVersion ( ) . getSelectedItem ( ) ) != null ) { java.lang.String clusterVersion = object.getVersion ( ) . getSelectedItem ( ) . getValue ( ) ; serialNumberPolicyEditor.setVisible ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isSerialNumberPolicySupported ( clusterVersion ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( object.getVersion ( ) . getSelectedItem ( ) ) != null ) { java.lang.String clusterVersion = object.getVersion ( ) . getSelectedItem ( ) . getValue ( ) ; serialNumberPolicyEditor.setVisible ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isSerialNumberPolicySupported ( clusterVersion ) ) ; } }
Source:
public void setUp ( ) { role = new org.ovirt.engine.core.common.businessentities.Role ( ) ; role.setId ( params.getRoleId ( ) ) ; org.mockito.Mockito.when ( roleDaoMock.get ( params.getRoleId ( ) ) ) . thenReturn ( role ) ; org.mockito.Mockito.doReturn ( roleGroupMapDaoMock ) . when ( command ) . getRoleGroupMapDao ( ) ; }

Target:
public void setUp ( ) { role = new org.ovirt.engine.core.common.businessentities.Role ( ) ; role.setId ( params.getRoleId ( ) ) ; org.mockito.Mockito.when ( roleDaoMock.get ( params.getRoleId ( ) ) ) . thenReturn ( role ) ; }
Source:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status , boolean updateDB ) { this . commandStatus = status ; if ( updateDB ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.updateCommandStatus ( getCommandId ( ) , getTaskType ( ) , commandStatus ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }

Target:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status , boolean updateDB ) { this . commandStatus = status ; if ( updateDB ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.updateCommandStatus ( getCommandId ( ) , commandStatus ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } } }
Source:
public void doFilter ( final javax.servlet.ServletRequest request , final javax.servlet.ServletResponse response , final javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { java.util.Locale locale = determineLocale ( ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ) ; request.setAttribute ( org.ovirt.engine.core.utils.servlet.LocaleFilter.LOCALE , locale ) ; chain.doFilter ( request , response ) ; setCookie ( ( ( javax.servlet.http.HttpServletResponse ) ( response ) ) , request.getServletContext ( ) , locale ) ; }

Target:
public void doFilter ( final javax.servlet.ServletRequest request , final javax.servlet.ServletResponse response , final javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { java.util.Locale locale = determineLocale ( ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ) ; request.setAttribute ( org.ovirt.engine.core.utils.servlet.LocaleFilter.LOCALE , locale ) ; setCookie ( ( ( javax.servlet.http.HttpServletResponse ) ( response ) ) , request.getServletContext ( ) , locale ) ; chain.doFilter ( request , response ) ; }
Source:
protected void initFrontend ( ) { org.ovirt.engine.ui.frontend.Frontend.setEventsHandler ( frontendEventsHandler ) ; org.ovirt.engine.ui.frontend.Frontend.getFrontendFailureEvent ( ) . addListener ( frontendFailureEventListener ) ; org.ovirt.engine.ui.frontend.Frontend.getFrontendNotLoggedInEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { user.logout ( ) ; } } ) ; org.ovirt.engine.ui.frontend.Frontend.setFilterQueries ( filterFrontendQueries ( ) ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getOsUniqueOsNames ( ) ) ) ; }

Target:
protected void initFrontend ( ) { frontend.setEventsHandler ( frontendEventsHandler ) ; frontend.getFrontendFailureEvent ( ) . addListener ( frontendFailureEventListener ) ; frontend.getFrontendNotLoggedInEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { user.logout ( ) ; } } ) ; frontend.setFilterQueries ( filterFrontendQueries ( ) ) ; }
Source:
protected java.util.Map < java.lang.String , java.lang.Object > createClusterPolicyParameters ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Map < java.lang.String , java.lang.Object > parameters = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; parameters.put ( PolicyUnitImpl.VM , vm ) ; if ( ( cluster.getClusterPolicyProperties ( ) ) != null ) { parameters.putAll ( cluster.getClusterPolicyProperties ( ) ) ; } return parameters ; }

Target:
protected java.util.Map < java.lang.String , java.lang.Object > createClusterPolicyParameters ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Map < java.lang.String , java.lang.Object > parameters = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; if ( vm != null ) { parameters.put ( PolicyUnitImpl.VM , vm ) ; } if ( ( cluster.getClusterPolicyProperties ( ) ) != null ) { parameters.putAll ( cluster.getClusterPolicyProperties ( ) ) ; } return parameters ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupByVdsGroupId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 2 ] } , getVdsGroupEntity ( ) ) ; super . testUpdate ( ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 0 ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupByVdsGroupId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 2 ] } , getVdsGroupEntity ( ) ) ; super . testUpdate ( ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( 1 , true ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( 1 , true ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private org.ovirt.engine.core.common.asynctasks.AsyncTaskType internalGetTaskType ( ) { if ( hasTaskHandlers ( ) ) { if ( ( getParameters ( ) . getExecutionReason ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionParametersBase.CommandExecutionReason.REGULAR_FLOW ) ) { return getCurrentTaskHandler ( ) . getTaskType ( ) ; } return getCurrentTaskHandler ( ) . getRevertTaskType ( ) ; } return getTaskType ( ) ; }

Target:
public org.ovirt.engine.core.common.asynctasks.AsyncTaskType internalGetTaskType ( ) { if ( hasTaskHandlers ( ) ) { if ( ( getParameters ( ) . getExecutionReason ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionParametersBase.CommandExecutionReason.REGULAR_FLOW ) ) { return getCurrentTaskHandler ( ) . getTaskType ( ) ; } return getCurrentTaskHandler ( ) . getRevertTaskType ( ) ; } return getTaskType ( ) ; }
Source:
private void mockGraphicsDevice ( ) { org.ovirt.engine.core.common.businessentities.VmDevice graphicsDevice = new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ; graphicsDevice.setDeviceId ( Guid.Empty ) ; graphicsDevice.setVmId ( vm.getId ( ) ) ; org.mockito.Mockito.when ( vmDeviceDAO.getVmDeviceByVmIdAndType ( vm.getId ( ) , VmDeviceGeneralType.GRAPHICS ) ) . thenReturn ( java.util.Arrays.asList ( graphicsDevice ) ) ; org.mockito.Mockito.doReturn ( vmDeviceDAO ) . when ( dbFacade ) . getVmDeviceDao ( ) ; org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.setDbFacade ( dbFacade ) ; }

Target:
private void mockGraphicsDevice ( ) { org.ovirt.engine.core.common.businessentities.VmDevice graphicsDevice = new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ; graphicsDevice.setDeviceId ( Guid.Empty ) ; graphicsDevice.setVmId ( vm.getId ( ) ) ; org.mockito.Mockito.when ( vmDeviceDAO.getVmDeviceByVmIdAndType ( vm.getId ( ) , VmDeviceGeneralType.GRAPHICS ) ) . thenReturn ( java.util.Arrays.asList ( graphicsDevice ) ) ; org.mockito.Mockito.doReturn ( vmDeviceDAO ) . when ( dbFacade ) . getVmDeviceDao ( ) ; }