auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void rerun ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.IVdsAsyncCommand command = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . GetAsyncCommandForVm ( vmId ) ; if ( command != null ) { command.rerun ( ) ; } }

Target:
public void rerun ( org.ovirt.engine.core.compat.Guid vmId ) { final org.ovirt.engine.core.common.businessentities.IVdsAsyncCommand command = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . GetAsyncCommandForVm ( vmId ) ; if ( command != null ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { command.rerun ( ) ; } } ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain mockStorageDomain ( org.ovirt.engine.core.compat.Guid storageId , int availableSize , int usedSize ) { return mockStorageDomain ( storageId , availableSize , usedSize , StorageType.UNKNOWN , new org.ovirt.engine.core.compat.Version ( ) ) ; }

Target:
public void testCanDoFailOnAddFloatingDiskWithPlugSet ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createDiskImage ( 1 ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; parameters.setVmId ( Guid.Empty ) ; parameters.setPlugDiskToVm ( true ) ; initializeCommand ( null , parameters ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.CANNOT_ADD_FLOATING_DISK_WITH_PLUG_VM_SET ) ; }
Source:
private void setupMock ( ) throws java.lang.Exception , javax.naming.AuthenticationException { org.mockito.Mockito.doReturn ( client ) . when ( glusterUtil ) . getSSHClient ( ) ; org.mockito.Mockito.doNothing ( ) . when ( glusterUtil ) . connect ( client , org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.USER , org.ovirt.engine.core.bll.utils.GlusterUtilTest.WRONG_PASSWORD ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) . when ( client ) . getHostFingerprint ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.OUTPUT_XML ) . when ( glusterUtil ) . executePeerStatusCommand ( client ) ; org.mockito.Mockito.doThrow ( javax.naming.AuthenticationException.class ) . when ( glusterUtil ) . authenticate ( client ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { org.mockito.Mockito.doReturn ( client ) . when ( glusterUtil ) . getSSHClient ( ) ; org.mockito.Mockito.doNothing ( ) . when ( glusterUtil ) . connect ( client , org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.USER , org.ovirt.engine.core.bll.utils.GlusterUtilTest.WRONG_PASSWORD ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) . when ( client ) . getHostFingerprint ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.OUTPUT_XML ) . when ( glusterUtil ) . executePeerStatusCommand ( client ) ; org.mockito.Mockito.doThrow ( javax.naming.AuthenticationException.class ) . when ( glusterUtil ) . authenticate ( client ) ; }
Source:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
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.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public void testRemoveActionVersionMap ( ) { dao.removeActionVersionMap ( existingActionMap.getaction_type ( ) ) ; org.ovirt.engine.core.common.businessentities.ActionVersionMap result = dao.getActionVersionMapByActionType ( existingActionMap.getaction_type ( ) ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void testRemoveActionVersionMap ( ) { org.ovirt.engine.core.common.businessentities.ActionVersionMap dummy = new org.ovirt.engine.core.common.businessentities.ActionVersionMap ( ) ; dummy.setaction_type ( VdcActionType.RebootVm ) ; dummy.setcluster_minimal_version ( "3.0" ) ; dummy.setstorage_pool_minimal_version ( "3.0" ) ; dao.addActionVersionMap ( dummy ) ; org.ovirt.engine.core.common.businessentities.ActionVersionMap result = dao.getActionVersionMapByActionType ( dummy.getaction_type ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; dao.removeActionVersionMap ( dummy.getaction_type ( ) ) ; result = dao.getActionVersionMapByActionType ( dummy.getaction_type ( ) ) ; org.junit.Assert.assertNull ( result ) ; }
Source:
public void testFetchVdsGroupWithUnlimitedGlobalLimitation ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaVdsGroup > quotaVdsGroupList = dao.getQuotaVdsGroupByVdsGroupGuid ( FixturesTool.VDS_GROUP_RHEL6_ISCSI , FixturesTool.QUOTA_SPECIFIC ) ; org.junit.Assert.assertEquals ( true , ( ( quotaVdsGroupList.size ( ) ) == 1 ) ) ; org.ovirt.engine.core.common.businessentities.QuotaVdsGroup quotaVdsGroup = quotaVdsGroupList.get ( 0 ) ; org.junit.Assert.assertNotNull ( quotaVdsGroup ) ; org.junit.Assert.assertEquals ( quotaVdsGroup.getMemSizeMB ( ) , org.ovirt.engine.core.dao.QuotaDaoTest.unlimited ) ; org.junit.Assert.assertEquals ( true , quotaVdsGroup.getVirtualCpu ( ) . equals ( 10 ) ) ; }

Target:
public void testFetchClusterWithUnlimitedGlobalLimitation ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByClusterGuid ( FixturesTool.CLUSTER_RHEL6_ISCSI , FixturesTool.QUOTA_SPECIFIC ) ; org.junit.Assert.assertEquals ( true , ( ( quotaClusterList.size ( ) ) == 1 ) ) ; org.ovirt.engine.core.common.businessentities.QuotaCluster quotaCluster = quotaClusterList.get ( 0 ) ; org.junit.Assert.assertNotNull ( quotaCluster ) ; org.junit.Assert.assertEquals ( quotaCluster.getMemSizeMB ( ) , org.ovirt.engine.core.dao.QuotaDaoTest.unlimited ) ; org.junit.Assert.assertEquals ( true , quotaCluster.getVirtualCpu ( ) . equals ( 10 ) ) ; }
Source:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public boolean validate ( java.lang.String text ) { return true ; }

Target:
public boolean validate ( java.lang.String text ) { text = text.trim ( ) . toLowerCase ( ) ; for ( java.lang.String os : map.values ( ) ) { if ( os.equals ( text ) ) { return true ; } } return false ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc glusterVolumeSnapshotConfigGet ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.configGet" ) . withOptionalParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc ( clusterId , response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionList" ) . withParameter ( "volName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }
Source:
private void prepareVmToPassCanDoAction ( ) { vmStatic.setName ( "vm1" ) ; vmStatic.setMemSizeMb ( 256 ) ; vmStatic.setSingleQxlPci ( false ) ; mockVmDaoGetVm ( ) ; mockSameNameQuery ( false ) ; mockValidateCustomProperties ( ) ; mockValidatePciAndIdeLimit ( ) ; mockGraphicsDevice ( ) ; }

Target:
private void prepareVmToPassCanDoAction ( ) { vmStatic.setName ( "vm1" ) ; vmStatic.setMemSizeMb ( 256 ) ; vmStatic.setSingleQxlPci ( false ) ; mockVmDaoGetVm ( ) ; mockSameNameQuery ( false ) ; mockValidateCustomProperties ( ) ; mockValidatePciAndIdeLimit ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateCpuProfile ( ) ; mockGraphicsDevice ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage_domains createStorageDomain ( int availableSpace ) { org.ovirt.engine.core.common.businessentities.storage_domains sd = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; sd.setstorage_domain_type ( StorageDomainType.Master ) ; sd.setstatus ( StorageDomainStatus.Active ) ; sd.setavailable_disk_size ( availableSpace ) ; sd.setused_disk_size ( USED_SPACE_GB ) ; sd.setId ( STORAGE_DOMAIN_ID ) ; return sd ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage_domains createStorageDomain ( int availableSpace ) { org.ovirt.engine.core.common.businessentities.storage_domains sd = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; sd.setstorage_domain_type ( StorageDomainType.Master ) ; sd.setstatus ( StorageDomainStatus.Active ) ; sd.setavailable_disk_size ( availableSpace ) ; sd.setused_disk_size ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) ; sd.setId ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ; return sd ; }
Source:
protected org.ovirt.engine.core.common.businessentities.ad_groups getAdGroupWithDomain ( int index ) { org.ovirt.engine.core.common.businessentities.ad_groups adGroup = new org.ovirt.engine.core.common.businessentities.ad_groups ( ) ; adGroup.setid ( GUIDS [ index ] ) ; adGroup.setname ( ( ( ( DOMAIN ) + "/" ) + ( NAMES [ index ] ) ) ) ; adGroup.setdomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; return adGroup ; }

Target:
protected org.ovirt.engine.core.common.businessentities.LdapGroup getAdGroupWithDomain ( int index ) { org.ovirt.engine.core.common.businessentities.LdapGroup adGroup = new org.ovirt.engine.core.common.businessentities.LdapGroup ( ) ; adGroup.setid ( GUIDS [ index ] ) ; adGroup.setname ( ( ( ( DOMAIN ) + "/" ) + ( NAMES [ index ] ) ) ) ; adGroup.setdomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; return adGroup ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc extendVolumeSize ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imageUUID , java.lang.String volumeUUID , java.lang.String newSize ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Volume.extendSize" ) . withParameter ( "spUUID" , spUUID ) . withParameter ( "sdUUID" , sdUUID ) . withParameter ( "imgUUID" , imageUUID ) . withParameter ( "volUUID" , volumeUUID ) . withParameter ( "newSize" , newSize ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc extendVolumeSize ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imageUUID , java.lang.String volumeUUID , java.lang.String newSize ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Volume.extendSize" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imageUUID ) . withParameter ( "volumeID" , volumeUUID ) . withParameter ( "newSize" , newSize ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( response ) ; }
Source:
public static void GetClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , "" , "" , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void isAnyHostUpInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( ( source != null ) && ( ( ( ( java.util.List ) ( source ) ) . size ( ) ) > 0 ) ) { return true ; } return false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetUpHostListByCluster ( aQuery , clusterName , 1 ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void thpDefaultTrueTest ( ) { org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setVersion ( new org.ovirt.engine.api.restapi.types.Version ( ) { { setMajor ( 3 ) ; setMinor ( 0 ) ; } } ) ; org.ovirt.engine.core.common.businessentities.VDSGroup transform = getMapper ( ) . map ( cluster , null ) ; assertEquals ( transform.getTransparentHugepages ( ) , true ) ; }

Target:
public void thpDefaultTrueTest ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setVersion ( new org.ovirt.engine.api.restapi.types.Version ( ) { { setMajor ( 3 ) ; setMinor ( 0 ) ; } } ) ; org.ovirt.engine.core.common.businessentities.Cluster transform = getMapper ( ) . map ( cluster , null ) ; assertEquals ( transform.getTransparentHugepages ( ) , true ) ; }
Source:
protected java.util.Map < java.lang.String , java.lang.Object > initDeviceStructure ( ) { java.util.Map < java.lang.String , java.lang.Object > deviceStruct = new java.util.HashMap < > ( ) ; deviceStruct.put ( VdsProperties.balloonEnabled , getParameters ( ) . isEnableBalloon ( ) ) ; return deviceStruct ; }

Target:
protected java.util.Map < java.lang.String , java.lang.Object > initDeviceStructure ( ) { java.util.Map < java.lang.String , java.lang.Object > deviceStruct = new java.util.HashMap < > ( ) ; deviceStruct.put ( VdsProperties.balloonEnabled , getParameters ( ) . isEnableBalloon ( ) ) ; deviceStruct.put ( VdsProperties.ksmEnabled , getParameters ( ) . isEnableKsm ( ) ) ; return deviceStruct ; }
Source:
private void memSize_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.updateMinAllocatedMemory ( ) ; if ( ( getMemSize ( ) . getEntity ( ) ) != null ) { maxMemorySize.setEntity ( org.ovirt.engine.core.common.utils.VmCommonUtils.getMaxMemorySizeDefault ( getMemSize ( ) . getEntity ( ) ) ) ; } }

Target:
private void memSize_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.updateMinAllocatedMemory ( ) ; behavior.updateMaxMemory ( ) ; }
Source:
private void configureManagementNetwork ( ) { final org.ovirt.engine.core.bll.network.NetworkConfigurator networkConfigurator = new org.ovirt.engine.core.bll.network.NetworkConfigurator ( org.ovirt.engine.core.bll.InstallVdsInternalCommand.getVds ( ) ) ; if ( ! ( networkConfigurator.awaitVdsmResponse ( ) ) ) { throw new org.ovirt.engine.core.bll.VdsInstallException ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive , "Network error during communication with the host" ) ; } try { networkConfigurator.refreshNetworkConfiguration ( ) ; networkConfigurator.createManagementNetworkIfRequired ( ) ; } catch ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { throw new org.ovirt.engine.core.bll.VdsInstallException ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive , "Network error during communication with the host" , e ) ; } catch ( java.lang.Exception e ) { throw new org.ovirt.engine.core.bll.VdsInstallException ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational , "Failed to configure management network on the host" , e ) ; } }

Target:
private void configureManagementNetwork ( ) { final org.ovirt.engine.core.bll.network.NetworkConfigurator networkConfigurator = new org.ovirt.engine.core.bll.network.NetworkConfigurator ( org.ovirt.engine.core.bll.InstallVdsInternalCommand.getVds ( ) , org.ovirt.engine.core.bll.InstallVdsInternalCommand.getContext ( ) ) ; if ( ! ( networkConfigurator.awaitVdsmResponse ( ) ) ) { throw new org.ovirt.engine.core.bll.VdsInstallException ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive , "Network error during communication with the host" ) ; } try { networkConfigurator.refreshNetworkConfiguration ( ) ; networkConfigurator.createManagementNetworkIfRequired ( ) ; } catch ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { throw new org.ovirt.engine.core.bll.VdsInstallException ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive , "Network error during communication with the host" , e ) ; } catch ( java.lang.Exception e ) { throw new org.ovirt.engine.core.bll.VdsInstallException ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational , "Failed to configure management network on the host" , e ) ; } }
Source:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void testRemoveForcedIncomplete ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpVersionExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveStoragePool , org.ovirt.engine.core.common.action.StoragePoolParametersBase.class , new java.lang.String [ ] { "StoragePoolId" , "ForceDelete" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendDataCenterResource.FORCE , java.lang.Boolean.FALSE.toString ( ) ) ; setUriInfo ( uriInfo ) ; resource.remove ( ) ; }

Target:
public void testRemoveForcedIncomplete ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpVersionExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( ActionType.RemoveStoragePool , org.ovirt.engine.core.common.action.StoragePoolParametersBase.class , new java.lang.String [ ] { "StoragePoolId" , "ForceDelete" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendDataCenterResource.FORCE , java.lang.Boolean.FALSE.toString ( ) ) ; setUriInfo ( uriInfo ) ; resource.remove ( ) ; }
Source:
protected boolean shouldCheckSpaceInStorageDomains ( ) { return ! ( getImagesToCheckDestinationStorageDomains ( ) . stream ( ) . map ( DiskImage :: getImageId ) . findFirst ( ) . orElse ( VmTemplateHandler.BLANK_VM_TEMPLATE_ID ) . equals ( VmTemplateHandler.BLANK_VM_TEMPLATE_ID ) ) ; }

Target:
protected boolean shouldCheckSpaceInStorageDomains ( ) { return ( ! ( getImagesToCheckDestinationStorageDomains ( ) . isEmpty ( ) ) ) && ( ! ( org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( getImagesToCheckDestinationStorageDomains ( ) , new org.ovirt.engine.core.utils.linq.All < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) . getImageId ( ) . equals ( VmTemplateHandler.BLANK_VM_TEMPLATE_ID ) ) ) ; }
Source:
public void canRemoveNonExistentBrick ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getDistributedVolume ( volumeId1 , 4 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricksToRemove = new java.util.ArrayList < > ( ) ; bricksToRemove.addAll ( getBricks ( volumeEntity.getId ( ) , 1 ) ) ; bricksToRemove.get ( 0 ) . setBrickDirectory ( "NewServer:/NewExport" ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( bricksToRemove , volumeEntity , 1 , false ) ; org.junit.Assert.assertThat ( validationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_BRICK_INVALID ) ) ; }

Target:
public void canRemoveNonExistentBrick ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getDistributedVolume ( volumeId1 , 4 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricksToRemove = new java.util.ArrayList < > ( ) ; bricksToRemove.addAll ( getBricks ( volumeEntity.getId ( ) , 1 ) ) ; bricksToRemove.get ( 0 ) . setBrickDirectory ( "NewServer:/NewExport" ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( bricksToRemove , volumeEntity , 1 , false ) ; org.hamcrest.MatcherAssert.assertThat ( validationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_BRICK_INVALID ) ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
protected java.lang.String renderNullSafe ( java.lang.Object object ) { org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel > pair = ( ( org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel > ) ( object ) ) ; java.lang.String key = pair.getKey ( ) ; java.lang.String value = ( ( java.lang.String ) ( pair.getValue ( ) . getEntity ( ) ) ) ; if ( "custom" . equals ( key ) ) { return ( ( constants.customHostPopup ( ) ) + ": " ) + value ; } return value ; }

Target:
protected java.lang.String renderNullSafe ( java.util.Map.Entry < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > pair ) { java.lang.String key = pair.getKey ( ) ; java.lang.String value = pair.getValue ( ) . getEntity ( ) ; if ( "custom" . equals ( key ) ) { return ( ( constants.customHostPopup ( ) ) + ": " ) + value ; } return value ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession session : georepSessions ) { if ( ( ( session.getSlaveVolumeId ( ) ) == null ) || ( ( session.getSlaveNodeUuid ( ) ) == null ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_REMOTE_CLUSTER_NOT_MAINTAINED_BY_ENGINE ) ; } } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession session : georepSessions ) { if ( ( ( session.getSlaveVolumeId ( ) ) == null ) || ( ( session.getSlaveNodeUuid ( ) ) == null ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_REMOTE_CLUSTER_NOT_MAINTAINED_BY_ENGINE ) ; } } return true ; }
Source:
private org.ovirt.engine.api.model.API addSystemVersion ( org.ovirt.engine.api.model.API api ) { api.setProductInfo ( new org.ovirt.engine.api.model.ProductInfo ( ) ) ; api.getProductInfo ( ) . setName ( "oVirt Engine" ) ; api.getProductInfo ( ) . setVendor ( "ovirt.org" ) ; api.getProductInfo ( ) . setVersion ( org.ovirt.engine.api.restapi.util.VersionHelper.parseVersion ( getConfigurationValue ( java.lang.String.class , ConfigurationValues.VdcVersion , null ) ) ) ; return api ; }

Target:
private org.ovirt.engine.api.model.API addSystemVersion ( org.ovirt.engine.api.model.API api ) { api.setProductInfo ( new org.ovirt.engine.api.model.ProductInfo ( ) ) ; api.getProductInfo ( ) . setName ( "oVirt Engine" ) ; api.getProductInfo ( ) . setVendor ( "ovirt.org" ) ; api.getProductInfo ( ) . setVersion ( org.ovirt.engine.api.restapi.util.VersionHelper.parseVersion ( getConfigurationValueDefault ( java.lang.String.class , ConfigurationValues.VdcVersion ) ) ) ; return api ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult validateDisplayType ( ) { if ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isGraphicsAndDisplaySupported ( vm.getOs ( ) , vm.getVdsGroupCompatibilityVersion ( ) , getVmActiveGraphics ( ) , vm.getDefaultDisplayType ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_VM_DISPLAY_TYPE_IS_NOT_SUPPORTED_BY_OS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult validateDisplayType ( ) { if ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isGraphicsAndDisplaySupported ( vm.getOs ( ) , vm.getCompatibilityVersion ( ) , getVmActiveGraphics ( ) , vm.getDefaultDisplayType ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_VM_DISPLAY_TYPE_IS_NOT_SUPPORTED_BY_OS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { org.ovirt.engine.core.common.businessentities.AuditLog event = org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getAuditLogDao ( ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getParameters ( ) . getAuditLogId ( ) ) ; if ( AuditLogSeverity.ALERT.equals ( event.getSeverity ( ) ) ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.compat.Guid.SYSTEM , org.ovirt.engine.core.common.VdcObjectType.System , org.ovirt.engine.core.common.businessentities.ActionGroup.AUDIT_LOG_MANAGEMENT ) ) ; } return getPermissionList ( event ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { org.ovirt.engine.core.common.businessentities.AuditLog event = auditLogDao.get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getParameters ( ) . getAuditLogId ( ) ) ; if ( AuditLogSeverity.ALERT.equals ( event.getSeverity ( ) ) ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.compat.Guid.SYSTEM , org.ovirt.engine.core.common.VdcObjectType.System , org.ovirt.engine.core.common.businessentities.ActionGroup.AUDIT_LOG_MANAGEMENT ) ) ; } return getPermissionList ( event ) ; }
Source:
public void getJobByEntityIdAndActionType ( ) { job.setActionType ( ActionType.UpdateVm ) ; java.util.List < org.ovirt.engine.core.common.job.Job > searchedJob = jobRepository.getJobsByEntityAndAction ( Guid.Empty , job.getActionType ( ) ) ; org.junit.Assert.assertNotNull ( searchedJob ) ; org.junit.Assert.assertTrue ( searchedJob.contains ( job ) ) ; }

Target:
public void getJobByEntityIdAndActionType ( ) { job.setActionType ( ActionType.UpdateVm ) ; java.util.List < org.ovirt.engine.core.common.job.Job > searchedJob = jobRepository.getJobsByEntityAndAction ( Guid.Empty , job.getActionType ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( searchedJob ) ; org.junit.jupiter.api.Assertions.assertTrue ( searchedJob.contains ( job ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setIsFingerprintVerified ( false ) ; if ( ( ( getGlusterHostAddress ( ) . getEntity ( ) ) == null ) || ( ( getGlusterHostAddress ( ) . getEntity ( ) . trim ( ) . length ( ) ) == 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( "" ) ; return ; } fetchFingerprint ( getGlusterHostAddress ( ) . getEntity ( ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) != null ) && ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) ) { getGlusterHostAddress ( ) . setIsChangable ( true ) ; getGlusterHostPassword ( ) . setIsChangable ( true ) ; } else { getGlusterHostAddress ( ) . setIsChangable ( false ) ; getGlusterHostPassword ( ) . setIsChangable ( false ) ; } }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getGlusterRebalanceStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity ) ( source ) ) ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters ( clusterId , volumeId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRebalanceStatus , parameters , aQuery ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.network > getEntities ( boolean isDisplay ) { java.util.List < org.ovirt.engine.core.common.businessentities.network > entities = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { if ( isDisplay ) { entities.add ( getEntity ( i , isDisplay ) ) ; } else { entities.add ( getEntity ( i ) ) ; } } return entities ; }

Target:
private java.util.List < org.ovirt.engine.api.model.Network > getEntities ( boolean isDisplay ) { java.util.List < org.ovirt.engine.api.model.Network > entities = new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { if ( isDisplay ) { entities.add ( getEntity ( i , isDisplay ) ) ; } else { entities.add ( getEntity ( i ) ) ; } } return entities ; }
Source:
private void pause ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VM a = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VmOperationParameterBase ( a.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.HibernateVm , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
private void run ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VM a = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.RunVmParams ( a.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RunVm , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
protected org.ovirt.engine.api.model.ExternalDiscoveredHost getEntity ( int index ) { org.ovirt.engine.api.model.ExternalDiscoveredHost host = control.createMock ( org.ovirt.engine.api.model.ExternalDiscoveredHost.class ) ; org.easymock.EasyMock.expect ( host.getIp ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( host.getName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; return host ; }

Target:
protected org.ovirt.engine.api.model.ExternalDiscoveredHost getEntity ( int index ) { org.ovirt.engine.api.model.ExternalDiscoveredHost host = org.mockito.Mockito.mock ( org.ovirt.engine.api.model.ExternalDiscoveredHost.class ) ; org.mockito.Mockito.when ( host.getIp ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; return host ; }
Source:
private void endCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms = getVmsForDiskId ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { org.ovirt.engine.core.bll.RemoveDiskCommand.getVmStaticDAO ( ) . incrementDbGeneration ( vm.getId ( ) ) ; } org.ovirt.engine.core.bll.Backend.getInstance ( ) . EndAction ( VdcActionType.RemoveImage , org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) ) ; org.ovirt.engine.core.bll.RemoveDiskCommand.setSucceeded ( true ) ; }

Target:
private void endCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms = getVmsForDiskId ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { org.ovirt.engine.core.bll.RemoveDiskCommand.getVmStaticDAO ( ) . incrementDbGeneration ( vm.getId ( ) ) ; } getDisk ( ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . EndAction ( VdcActionType.RemoveImage , org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) ) ; org.ovirt.engine.core.bll.RemoveDiskCommand.setSucceeded ( true ) ; }
Source:
public void testReapingOnPutWithGC ( ) throws java.lang.Exception { setUpGCExpectations ( 5 ) ; populate ( 1 , 2 , 3 ) ; map.reapable ( "one" ) ; map.reapable ( "three" ) ; assertSizes ( 1 , 2 ) ; populate ( 4 ) ; assertSizes ( 2 , 1 ) ; assertNull ( map.get ( "three" ) ) ; }

Target:
public void testReapingOnPutWithGC ( ) throws java.lang.Exception { setUpGCExpectations ( 5 ) ; populate ( 1 , 2 , 3 ) ; map.reapable ( "one" ) ; map.reapable ( "three" ) ; assertSizes ( 1 , 2 ) ; populate ( 4 ) ; assertSizes ( 2 , 1 ) ; org.junit.Assert.assertNull ( map.get ( "three" ) ) ; }
Source:
private void addInterfaceToDb ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmNetworkInterface ) { org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getVmNetworkInterfaceDao ( ) . save ( vmNetworkInterface ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getDbFacade ( ) . getVmNetworkStatisticsDao ( ) . save ( vmNetworkInterface.getStatistics ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface.getStatistics ( ) ) ; }

Target:
private void addInterfaceToDb ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmNetworkInterface ) { org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getVmNicDao ( ) . save ( vmNetworkInterface ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getDbFacade ( ) . getVmNetworkStatisticsDao ( ) . save ( vmNetworkInterface.getStatistics ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface.getStatistics ( ) ) ; }
Source:
public void isVirtioScsiEnabledForVm ( 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 ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getMaxNumOfThreadsPerCpu ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfThreadsPerCpu ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
private void executeFenceVdsManulalyAction ( final org.ovirt.engine.core.compat.Guid vdsId , java.lang.String sessionId ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.RestartVdsCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( vdsId ) ; fenceVdsManuallyParams.setSessionId ( sessionId ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams ) ; }

Target:
private void executeFenceVdsManuallyAction ( final org.ovirt.engine.core.compat.Guid vdsId , java.lang.String sessionId ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.RestartVdsCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( vdsId ) ; fenceVdsManuallyParams.setSessionId ( sessionId ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams ) ; }
Source:
protected void initCommands ( ) { org.ovirt.engine.ui.uicommonweb.UICommand okCommand = new org.ovirt.engine.ui.uicommonweb.UICommand ( "OnSave" , this ) ; okCommand.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . ok ( ) ) ; okCommand.setIsDefault ( true ) ; org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileBaseModel.getCommands ( ) . add ( okCommand ) ; org.ovirt.engine.ui.uicommonweb.UICommand cancelCommand = new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , this ) ; cancelCommand.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) ; cancelCommand.setIsCancel ( true ) ; org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileBaseModel.getCommands ( ) . add ( cancelCommand ) ; }

Target:
protected void initCommands ( ) { org.ovirt.engine.ui.uicommonweb.UICommand okCommand = org.ovirt.engine.ui.uicommonweb.UICommand.createDefaultOkUiCommand ( "OnSave" , this ) ; org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileBaseModel.getCommands ( ) . add ( okCommand ) ; org.ovirt.engine.ui.uicommonweb.UICommand cancelCommand = org.ovirt.engine.ui.uicommonweb.UICommand.createCancelUiCommand ( "Cancel" , this ) ; org.ovirt.engine.ui.uicommonweb.models.profiles.ProfileBaseModel.getCommands ( ) . add ( cancelCommand ) ; }
Source:
private static java.util.Set < org.ovirt.engine.core.compat.Version > createVersionSet ( ) { java.util.Set < org.ovirt.engine.core.compat.Version > versions = new java.util.HashSet < > ( ) ; versions.add ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.VERSION_1_0 ) ; versions.add ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.VERSION_1_1 ) ; versions.add ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.VERSION_1_2 ) ; return versions ; }

Target:
public void lowerVersionMgmtNetworkNonSupportedFeatures ( ) { cmd.getStoragePool ( ) . setCompatibilityVersion ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.VERSION_1_0 ) ; addNonDefaultClusterToPool ( ) ; addManagementNetworksToPool ( 2 ) ; setupNetworkValidator ( false ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CANNOT_DECREASE_DATA_CENTER_COMPATIBILITY_VERSION ) ; }