auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void GetAllowClusterWithVirtGlusterEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : java.lang.Boolean.TRUE ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.AllowClusterWithVirtGlusterEnabled , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getAllowClusterWithVirtGlusterEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : java.lang.Boolean.TRUE ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.AllowClusterWithVirtGlusterEnabled , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.AsyncTasks getByVdsmTaskId ( org.ovirt.engine.core.compat.Guid vdsmTaskId ) { org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . getByVdsmTaskId ( vdsmTaskId ) ; if ( asyncTask != null ) { copyFromCommandEntity ( asyncTask , commandsCache.get ( asyncTask.getCommandId ( ) ) ) ; } return asyncTask ; }

Target:
private void updateCmdHierarchy ( org.ovirt.engine.core.compat.Guid cmdId ) { for ( java.util.List < org.ovirt.engine.core.compat.Guid > childIds : childHierarchy.values ( ) ) { if ( childIds.contains ( cmdId ) ) { childIds.remove ( cmdId ) ; break ; } } if ( ( childHierarchy.containsKey ( cmdId ) ) && ( ( childHierarchy.get ( cmdId ) . size ( ) ) == 0 ) ) { childHierarchy.remove ( cmdId ) ; } }
Source:
public void testDedicatedHostNotInSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }

Target:
public void testDedicatedHostNotExist ( ) { prepareVmToPassCanDoAction ( ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }
Source:
private void loadVncData ( org.ovirt.engine.ui.uicommonweb.models.VmConsoles vmConsoles , org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.KeyMaker keyMaker ) { vmConsoles.selectProtocol ( ConsoleProtocol.VNC ) ; try { vmConsoles.getConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel.class ) . setVncImplementation ( VncConsoleModel.ClientConsoleMode.valueOf ( clientStorage.getLocalItem ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.VNC_CLIENT_MODE ) ) ) ) ; asVnc ( vmConsoles ) . setRemapCtrlAltDelete ( readBool ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.REMAP_CAD_VNC ) ) ) ; } catch ( java.lang.Exception e ) { logger.log ( java.util.logging.Level.WARNING , ( "Failed loading VNC data. Exception message: " + ( e.getMessage ( ) ) ) ) ; } }

Target:
private void loadVncData ( org.ovirt.engine.ui.uicommonweb.models.VmConsoles vmConsoles , org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.KeyMaker keyMaker ) { vmConsoles.selectProtocol ( ConsoleProtocol.VNC ) ; try { vmConsoles.getConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel.class ) . setVncImplementation ( VncConsoleModel.ClientConsoleMode.valueOf ( clientStorage.getLocalItem ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.VNC_CLIENT_MODE ) ) ) ) ; asVnc ( vmConsoles ) . getOptions ( ) . setRemapCtrlAltDelete ( readBool ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.REMAP_CAD_VNC ) ) ) ; } catch ( java.lang.Exception e ) { logger.log ( java.util.logging.Level.WARNING , ( "Failed loading VNC data. Exception message: " + ( e.getMessage ( ) ) ) ) ; } }
Source:
public void testIsNetworkInSyncWhenBootProtocolDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testIsNetworkInSyncWhenBootProtocolDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase removeVmImages ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RemoveAllVmImages , buildRemoveAllVmImagesParameters ( images ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( getExecutionContext ( ) ) ) ; if ( vdcRetValue.getSucceeded ( ) ) { getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return vdcRetValue ; }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase removeVmImages ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalAction ( VdcActionType.RemoveAllVmImages , buildRemoveAllVmImagesParameters ( images ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.RemoveVmCommand.getExecutionContext ( ) ) ) ; if ( vdcRetValue.getSucceeded ( ) ) { getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return vdcRetValue ; }
Source:
protected void initSoundCard ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isSoundcardEnabled ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( returnValue ) ; } } ) , id ) ; }

Target:
protected void updateOSValues ( ) { java.util.List < java.lang.Integer > vmOsValues ; org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; if ( cluster != null ) { vmOsValues = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getOsIds ( cluster.getArchitecture ( ) ) ; getModel ( ) . getOSType ( ) . setItems ( vmOsValues ) ; postOsItemChanged ( ) ; } }
Source:
public void testGetByIdReturnsNullIfNotExist ( ) { org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem testItem = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , null ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.singletonList ( testItem ) ) ; org.junit.Assert.assertThat ( map.get ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , org.hamcrest.CoreMatchers.nullValue ( ) ) ; }

Target:
public void testGetByIdReturnsNullIfNotExist ( ) { org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem testItem = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , null ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.singletonList ( testItem ) ) ; org.hamcrest.MatcherAssert.assertThat ( map.get ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , org.hamcrest.CoreMatchers.nullValue ( ) ) ; }
Source:
public void testRemoveById ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map_id ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.image_storage_domain_map > entries = dao.getAllByStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) ; for ( org.ovirt.engine.core.common.businessentities.image_storage_domain_map entry : entries ) { org.junit.Assert.assertFalse ( entry.getstorage_domain_id ( ) . equals ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID ) ) ; } org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertTrue ( entries.isEmpty ( ) ) ; }

Target:
public void testRemoveById ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.image_storage_domain_map > entries = dao.getAllByStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) ; for ( org.ovirt.engine.core.common.businessentities.image_storage_domain_map entry : entries ) { org.junit.Assert.assertFalse ( entry.getstorage_domain_id ( ) . equals ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID ) ) ; } org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertTrue ( entries.isEmpty ( ) ) ; }
Source:
public void newProfile ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.profiles.NewDiskProfileModel model = new org.ovirt.engine.ui.uicommonweb.models.profiles.NewDiskProfileModel ( this , getCompatibilityVersion ( ) , getEntity ( ) . getStoragePoolId ( ) ) ; setWindow ( model ) ; initProfileStorageDomains ( model ) ; }

Target:
protected void initDetailModels ( ) { super . initDetailModels ( ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; permissionListModel = new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ; list.add ( permissionListModel ) ; setDetailModels ( list ) ; }
Source:
public void getVmNicList ( 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 ? new java.util.ArrayList < > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.DbUser addUserToThreadContext ( java.lang.String sessionId , boolean refresh ) { org.ovirt.engine.core.common.businessentities.DbUser dbUser = org.ovirt.engine.core.utils.ThreadLocalParamsContainer.getUser ( ) ; if ( dbUser == null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( sessionId ) ) ) { dbUser = getUser ( sessionId , refresh ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setHttpSessionId ( sessionId ) ; } else { dbUser = getUser ( refresh ) ; } org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setUser ( dbUser ) ; } return dbUser ; }

Target:
public org.ovirt.engine.core.extensions.mgr.ExtensionProxy getAuthn ( java.lang.String sessionId ) { return ( ( org.ovirt.engine.core.extensions.mgr.ExtensionProxy ) ( getData ( sessionId , org.ovirt.engine.core.bll.session.SessionDataContainer.AUTHN_PARAMETER_NAME , false ) ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.cancel ( ) ; vmListModel.setGuideContext ( returnValueBase.getActionReturnValue ( ) ) ; vmListModel.UpdateActionAvailability ( ) ; vmListModel.getGuideCommand ( ) . Execute ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.cancel ( ) ; vmListModel.setGuideContext ( returnValueBase.getActionReturnValue ( ) ) ; vmListModel.updateActionAvailability ( ) ; vmListModel.getGuideCommand ( ) . execute ( ) ; } }
Source:
public static void endTaskStep ( org.ovirt.engine.core.compat.Guid stepId , org.ovirt.engine.core.common.job.JobExecutionStatus exitStatus ) { try { if ( stepId != null ) { org.ovirt.engine.core.common.job.Step step = org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . getStep ( stepId ) ; if ( step != null ) { step.markStepEnded ( exitStatus ) ; org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . updateStep ( step ) ; } } } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.job.ExecutionHandler.log.errorFormat ( "Failed to terminate step {0} with status {1}" , stepId , exitStatus , e ) ; } }

Target:
public static void endTaskStep ( org.ovirt.engine.core.compat.Guid stepId , org.ovirt.engine.core.common.job.JobExecutionStatus exitStatus ) { try { if ( stepId != null ) { org.ovirt.engine.core.common.job.Step step = org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . getStep ( stepId ) ; if ( step != null ) { step.markStepEnded ( exitStatus ) ; org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . updateStep ( step ) ; } } } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.job.ExecutionHandler.log.error ( "Failed to terminate step '{}' with status '{}': {}" , stepId , exitStatus , e.getMessage ( ) ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.log.debug ( "Exception" , e ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeReplaceBrickStart ( java.lang.String volumeName , java.lang.String existingBrickDir , java.lang.String newBrickDir ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.replaceBrickStart" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "existingBrick" , existingBrickDir ) . withParameter ( "newBrick" , newBrickDir ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc remove_image_ticket ( java.lang.String ticketId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.remove_image_ticket" ) . withParameter ( "uuid" , ticketId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareSharedStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( status , name , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( sharedDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return sharedDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareSharedStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { final org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( status , "shared domain name" , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( sharedDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return sharedDomain ; }
Source:
protected UnitVmModel.GraphicsTypes getRawValue ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) ) { return null ; } java.util.Map < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > graphicsInfos = vm.getGraphicsInfos ( ) ; return UnitVmModel.GraphicsTypes.fromGraphicsTypes ( graphicsInfos.keySet ( ) ) ; }

Target:
protected UnitVmModel.GraphicsTypes getRawValue ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) ) { return UnitVmModel.GraphicsTypes.NONE ; } java.util.Map < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > graphicsInfos = vm.getGraphicsInfos ( ) ; return UnitVmModel.GraphicsTypes.fromGraphicsTypes ( graphicsInfos.keySet ( ) ) ; }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { if ( ( ! ( vds.getvds_group_id ( ) . equals ( getVm ( ) . getvds_group_id ( ) ) ) ) || ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { sb.append ( "is not in up status or belongs to the VM's cluster" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CLUSTER ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ! ( vds.getvds_group_id ( ) . equals ( getVm ( ) . getvds_group_id ( ) ) ) ) || ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { sb.append ( "is not in up status or belongs to the VM's cluster" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CLUSTER ; } return null ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.isInternalExecution ( ) ) ) { return java.util.Collections.singletonMap ( getGeoRepSession ( ) . getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.GLUSTER_GEOREP , VdcBllMessages.ACTION_TYPE_FAILED_GEOREP_SESSION_LOCKED ) ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.isInternalExecution ( ) ) ) { return java.util.Collections.singletonMap ( getGeoRepSession ( ) . getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.GLUSTER_GEOREP , EngineMessage.ACTION_TYPE_FAILED_GEOREP_SESSION_LOCKED ) ) ; } return null ; }
Source:
public static void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getAAAProfilesListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static void GetDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static void GetVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( vmId ) , aQuery ) ; }
Source:
protected void onSelectedItemChanged ( ) { super . onSelectedItemChanged ( ) ; updateActionAvailability ( ) ; getBrickListModel ( ) . setVolumeEntity ( ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( provideDetailModelEntity ( getSelectedItem ( ) ) ) ) ) ; }

Target:
protected void onSelectedItemChanged ( ) { super . onSelectedItemChanged ( ) ; updateActionAvailability ( ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity selectedVolume = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( provideDetailModelEntity ( getSelectedItem ( ) ) ) ) ; getBrickListModel ( ) . setVolumeEntity ( selectedVolume ) ; getGeoRepListModel ( ) . setEntity ( selectedVolume ) ; }
Source:
public void moveShareableDiskToGlusterDomain ( ) { initializeCommand ( ImageOperation.Move ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; initVmDiskImage ( true ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS.toString ( ) ) ) ; }

Target:
public void moveShareableDiskToGlusterDomain ( ) { initializeCommand ( ImageOperation.Move ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; initVmDiskImage ( true ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS.toString ( ) ) ) ; }
Source:
public void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.List < ? > ) ( source ) ) ) ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }

Target:
public void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > aQuery , org.ovirt.engine.core.compat.Guid spId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }
Source:
private java.lang.String GetLocalStoragesFormattedString ( ) { java.lang.String localStorages = "" ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > Cast ( getSelectedItems ( ) ) ) { if ( ( a.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { localStorages += ( a.getStorageName ( ) ) + ", " ; } } return localStorages.substring ( 0 , ( ( localStorages.length ( ) ) - 2 ) ) ; }

Target:
private java.lang.String GetLocalStoragesFormattedString ( ) { java.lang.String localStorages = "" ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { if ( ( a.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { localStorages += ( a.getStorageName ( ) ) + ", " ; } } return localStorages.substring ( 0 , ( ( localStorages.length ( ) ) - 2 ) ) ; }
Source:
public < P extends org.ovirt.engine.core.common.vdscommands.VDSParametersBase > org.ovirt.engine.core.common.vdscommands.VDSReturnValue runVdsCommand ( org.ovirt.engine.core.common.vdscommands.VDSCommandType commandType , P parameters ) { org.ovirt.engine.core.vdsbroker.VDSCommandBase < P > command = CreateCommand ( commandType , parameters ) ; if ( command != null ) { command.execute ( ) ; return command.getVDSReturnValue ( ) ; } return null ; }

Target:
public < P extends org.ovirt.engine.core.common.vdscommands.VDSParametersBase > org.ovirt.engine.core.common.vdscommands.VDSReturnValue runVdsCommand ( org.ovirt.engine.core.common.vdscommands.VDSCommandType commandType , P parameters ) { org.ovirt.engine.core.vdsbroker.VDSCommandBase < P > command = createCommand ( commandType , parameters ) ; if ( command != null ) { command.execute ( ) ; return command.getVDSReturnValue ( ) ; } return null ; }
Source:
public void invalidPropertyValue1 ( ) { org.ovirt.engine.core.utils.customprop.DevicePropertiesUtils utils = mockDevicePropertiesUtils ( ) ; java.util.Map < java.lang.String , java.lang.String > map = new java.util.HashMap < > ( ) ; map.put ( "bootable" , null ) ; java.util.List < org.ovirt.engine.core.common.utils.customprop.ValidationError > errors = utils.validateProperties ( Version.v3_3 , VmDeviceGeneralType.DISK , map ) ; org.ovirt.engine.core.common.utils.customprop.PropertiesUtilsTestHelper.validateFailure ( errors , ValidationFailureReason.INCORRECT_VALUE ) ; }

Target:
public void invalidPropertyValue1 ( ) { org.ovirt.engine.core.utils.customprop.DevicePropertiesUtils utils = mockDevicePropertiesUtils ( ) ; java.util.Map < java.lang.String , java.lang.String > map = new java.util.HashMap < > ( ) ; map.put ( "bootable" , null ) ; java.util.List < org.ovirt.engine.core.common.utils.customprop.ValidationError > errors = utils.validateProperties ( Version.v4_0 , VmDeviceGeneralType.DISK , map ) ; org.ovirt.engine.core.common.utils.customprop.PropertiesUtilsTestHelper.validateFailure ( errors , ValidationFailureReason.INCORRECT_VALUE ) ; }
Source:
public void serializeAndDeserializeExtMapList ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.api.extensions.ExtMap > users = new java.util.ArrayList < > ( ) ; users.add ( new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authn.AuthRecord.PRINCIPAL , "user1@BRQ-OPENLDAP.RHEV.LAB.ENG.BRQ.REDHAT.COM" ) ) ; users.add ( new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authn.AuthRecord.PRINCIPAL , "user2@BRQ-OPENLDAP.RHEV.LAB.ENG.BRQ.REDHAT.COM" ) ) ; java.lang.String json = serialize ( users ) ; org.junit.Assert.assertTrue ( ( ( json.length ( ) ) > 0 ) ) ; java.util.List < org.ovirt.engine.api.extensions.ExtMap > deserializedUsers = deserialize ( json , java.util.ArrayList.class ) ; org.junit.Assert.assertNotNull ( deserializedUsers ) ; org.junit.Assert.assertEquals ( users , deserializedUsers ) ; }

Target:
public void serializeAndDeserializeExtMapList ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.api.extensions.ExtMap > users = new java.util.ArrayList < > ( ) ; users.add ( new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authn.AuthRecord.PRINCIPAL , "user1@BRQ-OPENLDAP.RHEV.LAB.ENG.BRQ.REDHAT.COM" ) ) ; users.add ( new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authn.AuthRecord.PRINCIPAL , "user2@BRQ-OPENLDAP.RHEV.LAB.ENG.BRQ.REDHAT.COM" ) ) ; java.lang.String json = serialize ( users ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ( json.length ( ) ) > 0 ) ) ; java.util.List < org.ovirt.engine.api.extensions.ExtMap > deserializedUsers = deserialize ( json , java.util.ArrayList.class ) ; org.junit.jupiter.api.Assertions.assertNotNull ( deserializedUsers ) ; org.junit.jupiter.api.Assertions.assertEquals ( users , deserializedUsers ) ; }
Source:
protected void executeCommand ( ) { setQuotaParameter ( ) ; getQuotaDAO ( ) . save ( getQuota ( ) ) ; getReturnValue ( ) . setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { setQuotaParameter ( ) ; if ( getParameters ( ) . isCopyPermissions ( ) ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { return executeAddQutoa ( ) ; } } ) ; } else { executeAddQutoa ( ) ; } }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( asList ( getEntity ( 1 ) ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveSnapshot , org.ovirt.engine.core.common.action.RemoveSnapshotParameters.class , new java.lang.String [ ] { "SnapshotId" , "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.SNAPSHOT_ID , org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.VM_ID } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( asList ( getEntity ( 1 ) ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveSnapshot , org.ovirt.engine.core.common.action.RemoveSnapshotParameters.class , new java.lang.String [ ] { "SnapshotId" , "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.SNAPSHOT_ID , org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.VM_ID } , valid , success ) ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.resource.remove ( ) ) , detail ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getUpdateCommand ( ) ) ) { Update ( ) ; } else if ( command == ( getLoginAllCommand ( ) ) ) { LoginAll ( ) ; } else if ( command == ( getDiscoverTargetsCommand ( ) ) ) { DiscoverTargets ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getUpdateCommand ( ) ) ) { update ( ) ; } else if ( command == ( getLoginAllCommand ( ) ) ) { loginAll ( ) ; } else if ( command == ( getDiscoverTargetsCommand ( ) ) ) { discoverTargets ( ) ; } }
Source:
protected void updateDiskImageDynamic ( final org.ovirt.engine.core.common.businessentities.DiskImage targetImage ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue ret = runVdsCommand ( VDSCommandType.GetImageInfo , new org.ovirt.engine.core.common.vdscommands.GetImageInfoVDSCommandParameters ( targetImage.getStoragePoolId ( ) , targetImage.getStorageIds ( ) . get ( 0 ) , targetImage.getId ( ) , targetImage.getImageId ( ) ) ) ; org.ovirt.engine.core.common.businessentities.DiskImage imageFromIRS = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( ret.getReturnValue ( ) ) ) ; if ( imageFromIRS != null ) { completeImageData ( imageFromIRS ) ; } else { log.warnFormat ( "Could not update DiskImage's size with ID {0}" , targetImage.getImageId ( ) ) ; } }

Target:
protected void updateDiskImageDynamic ( final org.ovirt.engine.core.common.businessentities.DiskImage targetImage ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue ret = runVdsCommand ( VDSCommandType.GetImageInfo , new org.ovirt.engine.core.common.vdscommands.GetImageInfoVDSCommandParameters ( targetImage.getStoragePoolId ( ) , targetImage.getStorageIds ( ) . get ( 0 ) , targetImage.getId ( ) , targetImage.getImageId ( ) ) ) ; org.ovirt.engine.core.common.businessentities.DiskImage imageFromIRS = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( ret.getReturnValue ( ) ) ) ; if ( imageFromIRS != null ) { completeImageData ( imageFromIRS ) ; } else { log.warn ( "Could not update DiskImage's size with ID '{}'" , targetImage.getImageId ( ) ) ; } }
Source:
private java.lang.String GetRealKey ( java.lang.String agent , java.lang.String displayedKey ) { java.lang.String result = "" ; if ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( agent ) ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( displayedKey ) ) ) { if ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionMapping.containsKey ( agent ) ) { java.util.HashMap < java.lang.String , java.lang.String > agentOptions = org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionMapping.get ( agent ) ; result = ( agentOptions.containsKey ( displayedKey ) ) ? agentOptions.get ( displayedKey ) : displayedKey ; } else { org.ovirt.engine.core.utils.pm.VdsFenceOptions.log.errorFormat ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.AGENT_ERROR , agent ) ; } } return result ; }

Target:
private java.lang.String GetRealKey ( java.lang.String agent , java.lang.String displayedKey ) { java.lang.String result = "" ; if ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( agent ) ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( displayedKey ) ) ) { if ( fencingOptionMapping.containsKey ( agent ) ) { java.util.HashMap < java.lang.String , java.lang.String > agentOptions = fencingOptionMapping.get ( agent ) ; result = ( agentOptions.containsKey ( displayedKey ) ) ? agentOptions.get ( displayedKey ) : displayedKey ; } else { org.ovirt.engine.core.utils.pm.VdsFenceOptions.log.errorFormat ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.AGENT_ERROR , agent ) ; } } return result ; }
Source:
public void getDbGroupsByUserId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.aaa.DbGroup > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.aaa.DbGroup > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.aaa.DbGroup > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDbGroupsByUserId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public void isClusterEmpty ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { runQueryByIdParameter ( VdcQueryType.IsClusterEmpty , aQuery , clusterId ) ; }
Source:
public void testUpdateStoragePoolIsoMap ( ) { existingStoragePoolIsoMap.setstatus ( StorageDomainStatus.Active ) ; dao.update ( existingStoragePoolIsoMap ) ; org.ovirt.engine.core.common.businessentities.storage_pool_iso_map result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , new org.ovirt.engine.core.compat.Guid ( existingStoragePoolIsoMap.getstorage_pool_id ( ) . toString ( ) ) ) ) ; assertNotNull ( result ) ; assertEquals ( existingStoragePoolIsoMap , result ) ; }

Target:
public void testUpdateStoragePoolIsoMap ( ) { existingStoragePoolIsoMap.setstatus ( StorageDomainStatus.Active ) ; dao.update ( existingStoragePoolIsoMap ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , new org.ovirt.engine.core.compat.Guid ( existingStoragePoolIsoMap.getstorage_pool_id ( ) . toString ( ) ) ) ) ; assertNotNull ( result ) ; assertEquals ( existingStoragePoolIsoMap , result ) ; }
Source:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public void getVolumeList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { getVolumeList ( aQuery , clusterName , true ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface vmGuestAgentInterface = new org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface ( ) ; vmGuestAgentInterface.setVmId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "vm_id" ) ) ) ; vmGuestAgentInterface.setInterfaceName ( rs.getString ( "interface_name" ) ) ; vmGuestAgentInterface.setMacAddress ( rs.getString ( "mac_address" ) ) ; vmGuestAgentInterface.setIpv4Addresses ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoDbFacadeImpl.VmGuestAgentInterfaceRowMapper.getListOfIpAddresses ( rs.getString ( "ipv4_addresses" ) ) ) ; vmGuestAgentInterface.setIpv6Addresses ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoDbFacadeImpl.VmGuestAgentInterfaceRowMapper.getListOfIpAddresses ( rs.getString ( "ipv6_addresses" ) ) ) ; return vmGuestAgentInterface ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface vmGuestAgentInterface = new org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface ( ) ; vmGuestAgentInterface.setVmId ( getGuidDefaultEmpty ( rs , "vm_id" ) ) ; vmGuestAgentInterface.setInterfaceName ( rs.getString ( "interface_name" ) ) ; vmGuestAgentInterface.setMacAddress ( rs.getString ( "mac_address" ) ) ; vmGuestAgentInterface.setIpv4Addresses ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoDbFacadeImpl.VmGuestAgentInterfaceRowMapper.getListOfIpAddresses ( rs.getString ( "ipv4_addresses" ) ) ) ; vmGuestAgentInterface.setIpv6Addresses ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoDbFacadeImpl.VmGuestAgentInterfaceRowMapper.getListOfIpAddresses ( rs.getString ( "ipv6_addresses" ) ) ) ; return vmGuestAgentInterface ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionStart ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.Boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionStart ( volumeName , remoteHost , remoteVolumeName , force ) ) ; } 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 glusterVolumeGeoRepSessionStart ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String userName , java.lang.Boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionStart ( volumeName , remoteHost , remoteVolumeName , userName , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void failsIfImported ( ) throws java.lang.Exception { org.mockito.Mockito.when ( hostedEngineHelper.getStorageDomain ( ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ) ; cmd.canDoAction ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.assertCanDoActionMessages ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST ) ; org.mockito.Mockito.verify ( backend , org.mockito.Mockito.times ( 0 ) ) . runInternalQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetExistingStorageDomainList ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 0 ) ) . executeCommand ( ) ; }

Target:
public void failsIfImported ( ) throws java.lang.Exception { org.mockito.Mockito.when ( hostedEngineHelper.getStorageDomain ( ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ) ; cmd.validate ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST ) ; org.mockito.Mockito.verify ( backend , org.mockito.Mockito.times ( 0 ) ) . runInternalQuery ( org.mockito.Matchers.eq ( VdcQueryType.GetExistingStorageDomainList ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 0 ) ) . executeCommand ( ) ; }