auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected static org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode createGlusterRoleTree ( ) { return new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . volumeRoleTree ( ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . configureVolumesRoleTree ( ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode [ ] { new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToCreateGlusterVolumesRoleTree ( ) ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.core.common.businessentities.ActionGroup.DELETE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToDeleteGlusterVolumesRoleTree ( ) ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.core.common.businessentities.ActionGroup.MANIPULATE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToManipulateGlusterVolumesRoleTree ( ) ) } ) ) ; }

Target:
protected static org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode createGlusterRoleTree ( ) { return org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.categoryNode ( org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . volumeRoleTree ( ) , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.categoryNode ( org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . configureVolumesRoleTree ( ) , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.roleNode ( ActionGroup.CREATE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToCreateGlusterVolumesRoleTree ( ) ) , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.roleNode ( ActionGroup.DELETE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToDeleteGlusterVolumesRoleTree ( ) ) , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.roleNode ( ActionGroup.MANIPULATE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToManipulateGlusterVolumesRoleTree ( ) ) ) ) ; }
Source:
private void attachDiskToTemplate ( org.ovirt.engine.core.compat.Guid templateId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage templateDiskImage = org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getDiskImage ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( templateDiskImage.getId ( ) , templateId ) ; dve.setDiskInterface ( DiskInterface.VirtIO ) ; org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getDiskVmElementDao ( ) . save ( dve ) ; vmDeviceUtils.addDiskDevice ( templateId , templateDiskImage.getId ( ) ) ; }

Target:
private void attachDiskToTemplate ( org.ovirt.engine.core.compat.Guid templateId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage templateDiskImage = org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getDiskImage ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( templateDiskImage.getId ( ) , templateId ) ; dve.setDiskInterface ( DiskInterface.VirtIO ) ; diskVmElementDao.save ( dve ) ; vmDeviceUtils.addDiskDevice ( templateId , templateDiskImage.getId ( ) ) ; }
Source:
public void testGetAllForNetworkHasPermission ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > result = dao.getAllForNetwork ( FixturesTool.NETWORK_ENGINE , org.ovirt.engine.core.dao.network.VnicProfileDaoTest.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 2 , result.size ( ) ) ; }

Target:
public void testUpdate ( ) { dao.save ( vnicProfile ) ; vnicProfile.setPortMirroring ( true ) ; dao.update ( vnicProfile ) ; org.ovirt.engine.core.common.businessentities.network.VnicProfile result = dao.get ( vnicProfile.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( vnicProfile.getId ( ) , result.getId ( ) ) ; org.junit.Assert.assertEquals ( true , result.isPortMirroring ( ) ) ; }
Source:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( this . getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ; status = org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getIrsProxy ( ) . destroyStoragePool ( org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , vds.getVdsSpmId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.removeIrsProxy ( ) ; }

Target:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( this . getCurrentIrsProxy ( ) . getCurrentVdsId ( ) ) ; status = org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getIrsProxy ( ) . destroyStoragePool ( org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , vds.getVdsSpmId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; removeIrsProxy ( ) ; }
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 ( ) ) ) . 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.hamcrest.MatcherAssert.assertThat ( validator.hostProviderExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private static void mockStorageDomainStatic ( org.ovirt.engine.core.bll.ImportVmTemplateCommand command , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { final org.ovirt.engine.core.dao.StorageDomainStaticDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainStaticDAO.class ) ; final org.ovirt.engine.core.common.businessentities.storage_domain_static domain = new org.ovirt.engine.core.common.businessentities.storage_domain_static ( ) ; domain.setstorage_type ( storageType ) ; org.mockito.Mockito.when ( dao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( domain ) ; org.mockito.Mockito.doReturn ( dao ) . when ( command ) . getStorageDomainStaticDAO ( ) ; }

Target:
private static void mockStorageDomainStatic ( org.ovirt.engine.core.bll.ImportVmTemplateCommand command , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { final org.ovirt.engine.core.dao.StorageDomainStaticDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainStaticDAO.class ) ; final org.ovirt.engine.core.common.businessentities.StorageDomainStatic domain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; domain.setstorage_type ( storageType ) ; org.mockito.Mockito.when ( dao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( domain ) ; org.mockito.Mockito.doReturn ( dao ) . when ( command ) . getStorageDomainStaticDAO ( ) ; }
Source:
public void refreshLightWeightData ( ) { org.ovirt.engine.core.bll.gluster.GlusterManager.log.debug ( "Refreshing Gluster Data [lightweight]" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = getClusterDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( cluster.supportsGlusterService ( ) ) { try { refreshClusterData ( cluster ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.gluster.GlusterManager.log.errorFormat ( "Error while refreshing Gluster lightweight data of cluster {0}!" , cluster.getname ( ) , e ) ; } } } }

Target:
private void refreshServerData ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.businessentities.VDS upServer , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > existingServers ) { if ( cluster.supportsVirtService ( ) ) { log.debugFormat ( "As cluster {0} supports virt service as well, it's servers will not be synced with glusterfs" , cluster.getname ( ) ) ; return ; } acquireLock ( cluster.getId ( ) ) ; try { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > fetchedServers = fetchServers ( cluster , upServer , existingServers ) ; if ( fetchedServers != null ) { removeDetachedServers ( existingServers , fetchedServers ) ; } } finally { releaseLock ( cluster.getId ( ) ) ; } }
Source:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpActionExpectations ( ActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private void mockDaos ( org.ovirt.engine.core.bll.AddVmCommand < ? > cmd ) { org.mockito.Mockito.doReturn ( vmDao ) . when ( cmd ) . getVmDao ( ) ; org.mockito.Mockito.doReturn ( sdDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( vmTemplateDao ) . when ( cmd ) . getVmTemplateDao ( ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( cmd ) . getVdsGroupDao ( ) ; org.mockito.Mockito.doReturn ( deviceDao ) . when ( cmd ) . getVmDeviceDao ( ) ; }

Target:
private void mockDaos ( org.ovirt.engine.core.bll.AddVmCommand < ? > cmd ) { org.mockito.Mockito.doReturn ( vmDao ) . when ( cmd ) . getVmDao ( ) ; org.mockito.Mockito.doReturn ( sdDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( vmTemplateDao ) . when ( cmd ) . getVmTemplateDao ( ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( cmd ) . getVdsGroupDao ( ) ; org.mockito.Mockito.doReturn ( deviceDao ) . when ( cmd ) . getVmDeviceDao ( ) ; org.mockito.Mockito.doReturn ( vmStaticDao ) . when ( cmd ) . getVmStaticDao ( ) ; }
Source:
protected void updateStatus ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map , org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { log.infoFormat ( "Setting domain %s to status $s" , map.getId ( ) , status.name ( ) ) ; map.setStatus ( status ) ; getStoragePoolIsoMapDao ( ) . updateStatus ( map.getId ( ) , map.getStatus ( ) ) ; }

Target:
protected void updateStatus ( org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map , org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { log.info ( "Setting domain '{}' to status '{}'" , map.getId ( ) , status.name ( ) ) ; map.setStatus ( status ) ; getStoragePoolIsoMapDao ( ) . updateStatus ( map.getId ( ) , map.getStatus ( ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createDefaultVdsGroup ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setname ( "Default" ) ; group.setId ( VDSGroup.DEFAULT_VDS_GROUP_ID ) ; group.setcpu_name ( "Intel Conroe" ) ; group.setcompatibility_version ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.STORAGE_POOL_ID ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createDefaultVdsGroup ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( VDSGroup.DEFAULT_VDS_GROUP_ID ) ; group.setcpu_name ( "Intel Conroe" ) ; group.setcompatibility_version ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.STORAGE_POOL_ID ) ; return group ; }
Source:
private void initTestForPool ( org.ovirt.engine.core.compat.Guid poolId , java.util.List < org.ovirt.engine.core.compat.Guid > vmGuids , java.util.List < org.ovirt.engine.core.compat.Guid > templatesGuids , java.util.List < org.ovirt.engine.core.compat.Guid > removedGuids ) { org.mockito.Mockito.doReturn ( vmGuids ) . when ( vmAndTemplatesGenerationsDAO ) . getVmsIdsForOvfUpdate ( poolId ) ; org.mockito.Mockito.doReturn ( templatesGuids ) . when ( vmAndTemplatesGenerationsDAO ) . getVmTemplatesIdsForOvfUpdate ( poolId ) ; org.mockito.Mockito.doReturn ( removedGuids ) . when ( vmAndTemplatesGenerationsDAO ) . getIdsForOvfDeletion ( poolId ) ; }

Target:
private void initTestForPool ( org.ovirt.engine.core.common.businessentities.StoragePool pool , java.util.List < org.ovirt.engine.core.compat.Guid > vmGuids , java.util.List < org.ovirt.engine.core.compat.Guid > templatesGuids , java.util.List < org.ovirt.engine.core.compat.Guid > removedGuids ) { org.ovirt.engine.core.compat.Guid poolId = pool.getId ( ) ; org.mockito.Mockito.doReturn ( vmGuids ) . when ( vmAndTemplatesGenerationsDAO ) . getVmsIdsForOvfUpdate ( poolId ) ; org.mockito.Mockito.doReturn ( templatesGuids ) . when ( vmAndTemplatesGenerationsDAO ) . getVmTemplatesIdsForOvfUpdate ( poolId ) ; org.mockito.Mockito.doReturn ( removedGuids ) . when ( vmAndTemplatesGenerationsDAO ) . getIdsForOvfDeletion ( poolId ) ; pool.setStatus ( StoragePoolStatus.Up ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType > getFenceProxySources ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType > fenceProxySources = fencedHost.getFenceProxySources ( ) ; if ( ( fenceProxySources == null ) || ( fenceProxySources.isEmpty ( ) ) ) { fenceProxySources = org.ovirt.engine.core.common.utils.pm.FenceProxySourceTypeHelper.parseFromString ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.FenceProxyDefaultPreferences ) ) ; } return fenceProxySources ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.pm.FenceProxySourceType > getDefaultFenceProxySources ( ) { return org.ovirt.engine.core.common.utils.pm.FenceProxySourceTypeHelper.parseFromString ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.FenceProxyDefaultPreferences ) ) ; }
Source:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . putOne ( isSoundcardEnabledEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.hiddenField ( ) ) . update ( highAvailabilityTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.hiddenField ( ) ) . putOne ( isStatelessEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.hiddenField ( ) ) . putOne ( isRunAndPauseEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.hiddenField ( ) ) . putOne ( editPoolEditVmsPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.hiddenField ( ) ) . putOne ( editPoolIncraseNumOfVmsPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.hiddenField ( ) ) . putOne ( editPoolEditMaxAssignedVmsPerUserPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.hiddenField ( ) ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . update ( highAvailabilityTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( isStatelessEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( isRunAndPauseEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( editPoolEditVmsPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( editPoolIncraseNumOfVmsPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( logicalNetworksEditorPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( editPoolEditMaxAssignedVmsPerUserPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void glusterServiceSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . glusterFeatureEnabled ( ) ; org.junit.Assert.assertThat ( validator.glusterServiceSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void qosBaloonNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.isEnableBallooning ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.qosBaloonSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.QOS_BALLOON_NOT_SUPPORTED ) ) ; }
Source:
private java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > getTemplateDisks ( org.ovirt.engine.core.compat.Guid templateId ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > templatesDisksMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage di : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( getEntity ( java.util.List.class , VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , "Disks" ) ) ) ) { templatesDisksMap.put ( di.getId ( ) , di ) ; } return templatesDisksMap ; }

Target:
private java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > getTemplateDisks ( org.ovirt.engine.core.compat.Guid templateId ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > templatesDisksMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage di : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( getEntity ( java.util.List.class , QueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , "Disks" ) ) ) ) { templatesDisksMap.put ( di.getId ( ) , di ) ; } return templatesDisksMap ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; newImage = new org.ovirt.engine.core.common.businessentities.Image ( ) ; newImage.setActive ( true ) ; newImage.setTemplateImageId ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_IMAGE_DISK_TEMPLATE_ID ) ; newImage.setSnapshotId ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_SNAPSHOT_ID ) ; newImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newImage.setVolumeFormat ( VolumeFormat.COW ) ; newImage.setVolumeType ( VolumeType.Sparse ) ; newImage.setDiskId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newImage.setQuotaId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; newImage = new org.ovirt.engine.core.common.businessentities.Image ( ) ; newImage.setActive ( true ) ; newImage.setTemplateImageId ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_IMAGE_DISK_TEMPLATE_ID ) ; newImage.setSnapshotId ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_SNAPSHOT_ID ) ; newImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newImage.setVolumeFormat ( VolumeFormat.COW ) ; newImage.setVolumeType ( VolumeType.Sparse ) ; newImage.setDiskId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newImage.setQuotaId ( org.ovirt.engine.core.dao.ImageDaoTest.QUOTA_ID ) ; }
Source:
public void testGetEntityNameByIdAndTypeForVmInterface ( ) { org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmInterface = dbFacade.getVmNetworkInterfaceDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_INTERFACE_ID ) ; org.junit.Assert.assertNotNull ( vmInterface ) ; java.lang.String name = vmInterface.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_INTERFACE_ID , VdcObjectType.VmInterface ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForNetwork ( ) { org.ovirt.engine.core.common.businessentities.Network network = dbFacade.getNetworkDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.NETWORK_ID ) ; org.junit.Assert.assertNotNull ( network ) ; java.lang.String name = network.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.NETWORK_ID , VdcObjectType.Network ) ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc getOvaInfo ( java.lang.String ovaPath ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getOvaInfo" ) . withParameter ( "ova_path" , ovaPath ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc getExternalVmFromOva ( java.lang.String ovaPath ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getExternalVmFromOva" ) . withParameter ( "ova_path" , ovaPath ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( response ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isConnectionExtensionExists ( org.ovirt.engine.core.compat.Guid connExtId ) { org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension connExt = getDbFacade ( ) . getStorageServerConnectionExtensionDao ( ) . get ( connExtId ) ; if ( connExt == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_EXTENSION_DOES_NOT_EXIST , java.lang.String.format ( "$%1$s %2$s" , "connExtId" , connExtId.toString ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isConnectionExtensionExists ( org.ovirt.engine.core.compat.Guid connExtId ) { org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension connExt = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.dao.StorageServerConnectionExtensionDao.class ) . get ( connExtId ) ; if ( connExt == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_EXTENSION_DOES_NOT_EXIST , java.lang.String.format ( "$%1$s %2$s" , "connExtId" , connExtId.toString ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void replaceProductKeyEmptyKeyShouldRemoveTheWholeSection ( ) { java.lang.String res = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.replaceProductKey ( sysprepFile , "" , false ) ; org.junit.Assert.assertThat ( res , org.hamcrest.core.IsNot.not ( org.hamcrest.core.StringContains.containsString ( "<ProductKey>" ) ) ) ; org.junit.Assert.assertThat ( res , org.hamcrest.core.IsNot.not ( org.hamcrest.core.StringContains.containsString ( "</ProductKey>" ) ) ) ; }

Target:
public void replaceProductKeyEmptyKeyShouldRemoveTheWholeSection ( ) { java.lang.String res = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.replaceProductKey ( sysprepFile , "" , false ) ; org.hamcrest.MatcherAssert.assertThat ( res , org.hamcrest.core.IsNot.not ( org.hamcrest.core.StringContains.containsString ( "<ProductKey>" ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( res , org.hamcrest.core.IsNot.not ( org.hamcrest.core.StringContains.containsString ( "</ProductKey>" ) ) ) ; }
Source:
protected void setUpGetHostIdExpectations ( int idx ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.setUpEntityExpectations ( control.createMock ( org.ovirt.engine.core.common.businessentities.VDS.class ) , idx ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsByName , org.ovirt.engine.core.common.queries.GetVdsByNameParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ idx ] } , host ) ; }

Target:
protected void setUpGetHostIdExpectations ( int idx ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.setUpEntityExpectations ( control.createMock ( org.ovirt.engine.core.common.businessentities.VDS.class ) , idx ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ idx ] } , host ) ; }
Source:
public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( returnValue ) ) ; }

Target:
public void getAncestorImagesByImagesIds ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > > aQuery , java.util.List < org.ovirt.engine.core.compat.Guid > imagesIds ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.core.common.queries.IdsQueryParameters params = new org.ovirt.engine.core.common.queries.IdsQueryParameters ( imagesIds ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAncestorImagesByImagesIds , params , aQuery ) ; }
Source:
void stubGetUserBySessionIdQuery ( ) { org.mockito.Mockito.when ( mockBackend.runQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetUserBySessionId ) , org.ovirt.engine.ui.frontend.server.gwt.AbstractGwtDynamicHostPageServletTest.isA ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ) . thenReturn ( new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) { { setSucceeded ( true ) ; setReturnValue ( mockUser ) ; } } ) ; }

Target:
void stubGetUserBySessionIdQuery ( ) { org.mockito.Mockito.when ( mockBackend.runQuery ( org.mockito.ArgumentMatchers.eq ( VdcQueryType.GetUserBySessionId ) , org.ovirt.engine.ui.frontend.server.gwt.AbstractGwtDynamicHostPageServletTest.isA ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ) . thenReturn ( new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) { { setSucceeded ( true ) ; setReturnValue ( mockUser ) ; } } ) ; }
Source:
private void readCpuItem ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node ) { vmBase.setNumOfSockets ( java.lang.Integer.parseInt ( node.SelectSingleNode ( "rasd:num_of_sockets" , _xmlNS ) . innerText ) ) ; vmBase.setCpuPerSocket ( java.lang.Integer.parseInt ( node.SelectSingleNode ( "rasd:cpu_per_socket" , _xmlNS ) . innerText ) ) ; }

Target:
private void readUsbItem ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node ) { vmBase.setUsbPolicy ( org.ovirt.engine.core.common.businessentities.UsbPolicy.forStringValue ( selectSingleNode ( node , "rasd:UsbPolicy" , _xmlNS ) . innerText ) ) ; }
Source:
protected boolean validateQuota ( ) { getParameters ( ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVm ( ) . getStaticData ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Disk dit : getVm ( ) . getDiskMap ( ) . values ( ) ) { ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( dit ) ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVm ( ) . getStaticData ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; } return true ; }

Target:
public void rollbackQuota ( ) { getQuotaManager ( ) . rollbackQuota ( getStoragePool ( ) , getQuotaManager ( ) . getQuotaListFromParameters ( getStorageQuotaListParameters ( ) ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Provider > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( returnValue == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = org.ovirt.engine.ui.uicommonweb.Linq.toList ( org.ovirt.engine.ui.uicommonweb.Linq.filterProvidersByProvidedType ( ( ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) , providedEntity ) ) ; java.util.Collections.sort ( providers , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return providers ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Provider > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( returnValue == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = org.ovirt.engine.ui.uicommonweb.Linq.toList ( org.ovirt.engine.ui.uicommonweb.Linq.filterProvidersByProvidedType ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) , providedEntity ) ) ; java.util.Collections.sort ( providers , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return providers ; }
Source:
protected void startSubStep ( ) { asyncTaskStep = org.ovirt.engine.core.bll.job.ExecutionHandler.addSubStep ( this . getExecutionContext ( ) , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getExecutionContext ( ) . getJob ( ) . getStep ( StepEnum.EXECUTING ) , getStepType ( ) , org.ovirt.engine.core.dal.job.ExecutionMessageDirector.resolveStepMessage ( getStepType ( ) , getStepMessageMap ( JobExecutionStatus.STARTED ) ) ) ; }

Target:
protected void endStepJobAborted ( java.lang.String jobInfo ) { endStepJob ( JobExecutionStatus.ABORTED , getStepMessageMap ( JobExecutionStatus.ABORTED , jobInfo ) , false ) ; }
Source:
public org.ovirt.engine.api.model.StorageDomains list ( ) { org.ovirt.engine.api.model.StorageDomains storageDomains = new org.ovirt.engine.api.model.StorageDomains ( ) ; for ( org.ovirt.engine.api.model.StorageDomain entity : getBackendCollection ( org.ovirt.engine.api.model.StorageDomain.class , VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ) ) { storageDomains.getStorageDomains ( ) . add ( addLinks ( map ( entity ) , getLinksToExclude ( entity ) ) ) ; } return storageDomains ; }

Target:
public org.ovirt.engine.api.model.StorageDomains list ( ) { org.ovirt.engine.api.model.StorageDomains storageDomains = new org.ovirt.engine.api.model.StorageDomains ( ) ; for ( org.ovirt.engine.api.model.StorageDomain entity : getBackendCollection ( org.ovirt.engine.api.model.StorageDomain.class , QueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ) ) { storageDomains.getStorageDomains ( ) . add ( addLinks ( map ( entity ) , getLinksToExclude ( entity ) ) ) ; } return storageDomains ; }
Source:
private void IncrementVdsPendingVmsCount ( ) { synchronized ( _vds_pending_vm_count ) { if ( ! ( _vds_pending_vm_count.containsKey ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) ) ) ) { _vds_pending_vm_count.put ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) , 1 ) ; } else { int i = _vds_pending_vm_count.get ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) ) ; _vds_pending_vm_count.put ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) , ( i + 1 ) ) ; } } }

Target:
private void incrementVdsPendingVmsCount ( ) { synchronized ( _vds_pending_vm_count ) { if ( ! ( _vds_pending_vm_count.containsKey ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) ) ) ) { _vds_pending_vm_count.put ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) , 1 ) ; } else { int i = _vds_pending_vm_count.get ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) ) ; _vds_pending_vm_count.put ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) , ( i + 1 ) ) ; } } }
Source:
private void addRow ( java.lang.String label , java.lang.String value ) { int rowCount = contents.insertRow ( contents.getRowCount ( ) ) ; contents.setHTML ( rowCount , 0 , ( ( "<B>" + label ) + ":</B>" ) ) ; contents.setText ( rowCount , 1 , value ) ; }

Target:
private void addRow ( com.google.gwt.safehtml.shared.SafeHtml value ) { int rowCount = contents.insertRow ( contents.getRowCount ( ) ) ; contents.setHTML ( rowCount , 0 , value ) ; }
Source:
public void setInSlot ( java.lang.Object slot , com.google.gwt.user.client.ui.Widget content ) { if ( slot == ( org.ovirt.engine.ui.userportal.section.main.presenter.tab.basic.MainTabBasicListPresenterWidget.TYPE_VmListContent ) ) { vmPanel.clear ( ) ; if ( content != null ) { vmPanel.add ( content ) ; } } else { super . setInSlot ( slot , content ) ; } }

Target:
public void setInSlot ( java.lang.Object slot , com.google.gwt.user.client.ui.IsWidget content ) { if ( slot == ( org.ovirt.engine.ui.userportal.section.main.presenter.tab.basic.MainTabBasicListPresenterWidget.TYPE_VmListContent ) ) { vmPanel.clear ( ) ; if ( content != null ) { vmPanel.add ( content ) ; } } else { super . setInSlot ( slot , content ) ; } }
Source:
public org.ovirt.engine.core.aaa.DirectoryUser findUser ( org.ovirt.engine.core.common.utils.ExternalId id ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.GetAdUserByUserId , new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapSearchByIdParameters ( getName ( ) , id ) ) ; org.ovirt.engine.core.common.businessentities.LdapUser ldapUser = ( ( org.ovirt.engine.core.common.businessentities.LdapUser ) ( ldapResult.getReturnValue ( ) ) ) ; return mapUser ( ldapUser ) ; }

Target:
public org.ovirt.engine.core.aaa.DirectoryUser findUserById ( java.lang.String id ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapReturnValueBase ldapResult = broker.runAdAction ( AdActionType.GetAdUserByUserId , new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapSearchByIdParameters ( getName ( ) , org.ovirt.engine.core.compat.Guid.createGuidFromString ( id ) ) ) ; org.ovirt.engine.core.common.businessentities.LdapUser ldapUser = ( ( org.ovirt.engine.core.common.businessentities.LdapUser ) ( ldapResult.getReturnValue ( ) ) ) ; return mapUser ( ldapUser ) ; }
Source:
private void setLangPageShown ( javax.servlet.http.HttpServletResponse response , boolean value ) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie ( org.ovirt.engine.core.utils.servlet.DocsServlet.LANG_PAGE_SHOWN , java.lang.Boolean.toString ( value ) ) ; cookie.setPath ( getServletContext ( ) . getContextPath ( ) ) ; response.addCookie ( cookie ) ; }

Target:
private void setLangPageShown ( javax.servlet.http.HttpServletResponse response , boolean value ) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie ( org.ovirt.engine.core.utils.servlet.DocsServlet.LANG_PAGE_SHOWN , java.lang.Boolean.toString ( value ) ) ; cookie.setPath ( getServletContext ( ) . getContextPath ( ) ) ; cookie.setHttpOnly ( true ) ; response.addCookie ( cookie ) ; }
Source:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 != 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.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.VDS getByName ( java.lang.String name ) { return getCallsHandler ( ) . executeRead ( "GetVdsByName" , org.ovirt.engine.core.dao.VdsDAODbFacadeImpl.VdsRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "vds_name" , name ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.VDS getByName ( java.lang.String name ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = getCallsHandler ( ) . executeReadList ( "GetVdsByName" , org.ovirt.engine.core.dao.VdsDAODbFacadeImpl.VdsRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "vds_name" , name ) ) ; return ( vdsList.size ( ) ) == 0 ? null : uniteAgentsSingleVds ( vdsList ) ; }
Source:
protected void EndWithFailure ( ) { super . EndActionOnDisks ( ) ; rollbackQuota ( ) ; if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) ) != null ) { RemoveVmInSpm ( org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) . getstorage_pool_id ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; } removeVmRelatedEntitiesFromDb ( ) ; org.ovirt.engine.core.bll.AddVmCommand.setSucceeded ( true ) ; }

Target:
protected void endWithFailure ( ) { super . EndActionOnDisks ( ) ; rollbackQuota ( ) ; if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) ) != null ) { RemoveVmInSpm ( org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) . getstorage_pool_id ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; } removeVmRelatedEntitiesFromDb ( ) ; org.ovirt.engine.core.bll.AddVmCommand.setSucceeded ( true ) ; }
Source:
private org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel lineModelFromInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel model = new org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel ( ) ; model.setInterfaces ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterface > ( ) ) ; model.setVLans ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan > ( ) ) ; model.setNetworkName ( nic.getNetworkName ( ) ) ; model.setIsManagement ( nic.getIsManagement ( ) ) ; return model ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel lineModelFromInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel model = new org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel ( ) ; model.setInterfaces ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterface > ( ) ) ; model.setVLans ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan > ( ) ) ; model.setNetworkName ( nic.getNetworkName ( ) ) ; model.setIsManagement ( nic.getIsManagement ( ) ) ; model.setAddress ( nic.getAddress ( ) ) ; return model ; }
Source:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.compat.Guid asyncTaskId : getReturnValue ( ) . getTaskPlaceHolderIdList ( ) ) { org.ovirt.engine.core.common.businessentities.AsyncTasks task = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getAsyncTaskFromDb ( asyncTaskId ) ; if ( ( task != null ) && ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( task.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeTaskFromDbByTaskId ( task.getTaskId ( ) ) ; } } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.compat.Guid asyncTaskId : getReturnValue ( ) . getTaskPlaceHolderIdList ( ) ) { org.ovirt.engine.core.common.businessentities.AsyncTask task = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getAsyncTaskFromDb ( asyncTaskId ) ; if ( ( task != null ) && ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( task.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeTaskFromDbByTaskId ( task.getTaskId ( ) ) ; } } return null ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else if ( "OnSave" . equals ( lastExecutedCommand.getName ( ) ) ) { return defaultConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }