auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetVmNumaNodeInfoByVdsGroupId ( ) { org.ovirt.engine.core.compat.Guid vdsGroupId = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VmNumaNode > > result = vmNumaNodeDao.getVmNumaNodeInfoByVdsGroupId ( vdsGroupId ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 2 , result.size ( ) ) ; }

Target:
public void testGetVmNumaNodeInfoByBdsGroupIdAsMap ( ) { org.ovirt.engine.core.compat.Guid vdsGroupId = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.compat.Guid.createGuidFromString ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > > result = vmNumaNodeDao.getVmNumaNodeInfoByClusterIdAsMap ( vdsGroupId ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( 2 , result.get ( vmId ) . size ( ) ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUriInfo ( setUpActionExpectations ( ActionType.UnlabelNic , org.ovirt.engine.core.common.action.LabelNicParameters.class , new java.lang.String [ ] { "NicId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.NIC_ID , org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.LABELS [ 0 ] } , 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 ) { setUriInfo ( setUpActionExpectations ( ActionType.UnlabelNic , org.ovirt.engine.core.common.action.LabelNicParameters.class , new java.lang.String [ ] { "NicId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.NIC_ID , org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.LABELS [ 0 ] } , valid , success ) ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: remove ) , detail ) ; }
Source:
public org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider < org.ovirt.engine.core.common.businessentities.RepoImage , org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel , org.ovirt.engine.ui.uicommonweb.models.storage.StorageIsoListModel > getStorageIsoListProvider ( org.ovirt.engine.ui.webadmin.gin.ClientGinjector ginjector ) { return new org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider < org.ovirt.engine.core.common.businessentities.RepoImage , org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel , org.ovirt.engine.ui.uicommonweb.models.storage.StorageIsoListModel > ( ginjector , org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel.class , org.ovirt.engine.ui.uicommonweb.models.storage.StorageIsoListModel.class ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageIsoListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getImportImagesCommand ( ) ) ) { return importExportPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
public org.ovirt.engine.core.common.action.VdcActionType deserialize ( org.codehaus.jackson.JsonParser jsonParser , org.codehaus.jackson.map.DeserializationContext deserializationContext ) throws java.io.IOException { java.lang.String jsonValue = jsonParser.getText ( ) ; org.ovirt.engine.core.common.action.VdcActionType actionType = org.ovirt.engine.core.utils.serialization.json.VdcActionTypeDeserializer.mappings.get ( jsonValue ) ; if ( actionType == null ) { actionType = org.ovirt.engine.core.common.action.VdcActionType.Unknown ; } return actionType ; }

Target:
public org.ovirt.engine.core.common.action.ActionType deserialize ( org.codehaus.jackson.JsonParser jsonParser , org.codehaus.jackson.map.DeserializationContext deserializationContext ) throws java.io.IOException { java.lang.String jsonValue = jsonParser.getText ( ) ; org.ovirt.engine.core.common.action.ActionType actionType = org.ovirt.engine.core.utils.serialization.json.VdcActionTypeDeserializer.mappings.get ( jsonValue ) ; if ( actionType == null ) { actionType = org.ovirt.engine.core.common.action.ActionType.Unknown ; } return actionType ; }
Source:
public static void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
private void listenOnDiskModelChangeEvent ( final org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { modelProvider.getModel ( ) . getvmBasicDiskListModel ( ) . getItemsChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } @ java.lang.SuppressWarnings ( value = "unchecked" ) java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = modelProvider.getModel ( ) . getvmBasicDiskListModel ( ) . getItems ( ) ; getView ( ) . editDistItems ( diskImages ) ; } } ) ; }

Target:
private void listenOnDiskModelChangeEvent ( final org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { modelProvider.getModel ( ) . getvmBasicDiskListModel ( ) . getItemsChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } setupDisks ( modelProvider ) ; } } ) ; }
Source:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.VM before = dao.get ( existingVm.getId ( ) ) ; org.junit.Assert.assertNotNull ( before ) ; dao.remove ( existingVm.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VM after = dao.get ( existingVm.getId ( ) ) ; org.junit.Assert.assertNull ( after ) ; }

Target:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.VM before = dao.get ( existingVm.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( before ) ; dao.remove ( existingVm.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VM after = dao.get ( existingVm.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertNull ( after ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.DeleteGlusterVolume , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeVDSParameters ( getUpServer ( ) . getId ( ) , getGlusterVolumeName ( ) ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( getSucceeded ( ) ) { updateVolumeStatusInDb ( getParameters ( ) . getVolumeId ( ) ) ; } else { getReturnValue ( ) . getExecuteFailedMessages ( ) . add ( returnValue.getVdsError ( ) . getMessage ( ) ) ; return ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.DeleteGlusterVolume , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeVDSParameters ( getUpServer ( ) . getId ( ) , getGlusterVolumeName ( ) ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( getSucceeded ( ) ) { updateVolumeStatusInDb ( getParameters ( ) . getVolumeId ( ) ) ; } else { handleVdsError ( AuditLogType.GLUSTER_VOLUME_DELETE_FAILED , returnValue.getVdsError ( ) . getMessage ( ) ) ; return ; } }
Source:
public void shouldDetectSufficientMemory ( ) { vm.setNumaTuneMode ( NumaTuneMode.STRICT ) ; vmNumaNodes.get ( 0 ) . setMemTotal ( 1000 ) ; vdsNumaNodes.get ( 0 ) . setMemTotal ( 2000 ) ; assertTrue ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }

Target:
public void shouldDetectNonContinuousNodeIndices ( ) { vmNumaNodes.get ( 0 ) . setIndex ( 0 ) ; vmNumaNodes.get ( 1 ) . setIndex ( 2 ) ; assertValidationFailure ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) , EngineMessage.VM_NUMA_NODE_NON_CONTINUOUS_INDEX ) ; }
Source:
private java.util.Map < java.util.function.Consumer < java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > > , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > > getLunsToUpdateInDb ( org.ovirt.engine.core.compat.Guid lunFromVgLunId , org.ovirt.engine.core.compat.Guid lunFromDbLunId , org.ovirt.engine.core.compat.Guid lunFromVgPvId , org.ovirt.engine.core.compat.Guid lunFromDbPvId ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lunFromVG = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lunFromVG.setLUNId ( lunFromVgLunId.toString ( ) ) ; lunFromVG.setPhysicalVolumeId ( lunFromVgPvId.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lunFromDB = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lunFromDB.setLUNId ( lunFromDbLunId.toString ( ) ) ; lunFromDB.setPhysicalVolumeId ( lunFromDbPvId.toString ( ) ) ; return getLunsToUpdateInDb ( lunFromVG , lunFromDB ) ; }

Target:
private void setLunsIds ( org.ovirt.engine.core.compat.Guid lunFromVgLunId , org.ovirt.engine.core.compat.Guid lunFromDbLunId , org.ovirt.engine.core.compat.Guid lunFromVgPvId , org.ovirt.engine.core.compat.Guid lunFromDbPvId ) { lunFromVg.setLUNId ( lunFromVgLunId.toString ( ) ) ; lunFromVg.setPhysicalVolumeId ( lunFromVgPvId.toString ( ) ) ; lunFromDb.setLUNId ( lunFromDbLunId.toString ( ) ) ; lunFromDb.setPhysicalVolumeId ( lunFromDbPvId.toString ( ) ) ; }
Source:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( source != null ) && ( ! ( ( java.lang.Boolean ) ( source ) ) ) ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , params , aQuery ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , getEntity ( 0 ) ) ; setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , true , true ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.networkId } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.UserProfile other = ( ( org.ovirt.engine.core.common.businessentities.UserProfile ) ( obj ) ) ; return org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( sshPublicKey , other.sshPublicKey ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.UserProfile other = ( ( org.ovirt.engine.core.common.businessentities.UserProfile ) ( obj ) ) ; return ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( sshPublicKey , other.sshPublicKey ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( loginName , other.loginName ) ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { java.util.List < java.lang.String > bricks = org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.getQualifiedBrickList ( org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getParameters ( ) . getBricks ( ) ) ; status = org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getBroker ( ) . glusterVolumeBrickAdd ( org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getParameters ( ) . getVolumeName ( ) , bricks.toArray ( new java.lang.String [ 0 ] ) , org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getParameters ( ) . getReplicaCount ( ) , org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getParameters ( ) . getStripeCount ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.ProceedProxyReturnValue ( ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { java.util.List < java.lang.String > bricks = org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.getQualifiedBrickList ( org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getParameters ( ) . getBricks ( ) ) ; status = org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getBroker ( ) . glusterVolumeBrickAdd ( org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getParameters ( ) . getVolumeName ( ) , bricks.toArray ( new java.lang.String [ 0 ] ) , org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getParameters ( ) . getReplicaCount ( ) , org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.getParameters ( ) . getStripeCount ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.AddBricksToGlusterVolumeVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public static boolean canRemoveVmPool ( org.ovirt.engine.core.compat.Guid vmPoolId , java.util.ArrayList < java.lang.String > reasons ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmPoolsMapByVmPoolId ( vmPoolId ) . size ( ) ) != 0 ) { returnValue = false ; reasons.add ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_VM_POOL_WITH_VMS.toString ( ) ) ; } return returnValue ; }

Target:
private static boolean canRemoveVmPool ( org.ovirt.engine.core.compat.Guid vmPoolId ) { return ( getListOfVmsInPool ( vmPoolId ) . size ( ) ) == 0 ; }
Source:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }

Target:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc changeDisk ( java.lang.String vmId , java.lang.String imageLocation ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.changeCD" ) . withParameter ( "vmID" , vmId ) . withParameter ( "driveSpec" , imageLocation ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturn changeDisk ( java.lang.String vmId , java.lang.String imageLocation ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.changeCD" ) . withParameter ( "vmID" , vmId ) . withParameter ( "driveSpec" , imageLocation ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturn ( response ) ; }
Source:
public void testStoragePoolDoesntExist ( ) { final int domainSizeGB = 20 ; final int sizeRequired = 5 ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddVmTests ( domainSizeGB , sizeRequired ) ; org.mockito.Mockito.doReturn ( null ) . when ( cmd ) . getStoragePool ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void testStoragePoolDoesntExist ( ) { final int domainSizeGB = 20 ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddVmTests ( domainSizeGB ) ; org.mockito.Mockito.doReturn ( null ) . when ( cmd ) . getStoragePool ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST ) ; }
Source:
private static boolean isRunOnce ( org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > cdList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.DISK , VmDeviceType.CDROM.getName ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > floppyList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.DISK , VmDeviceType.FLOPPY.getName ( ) ) ; return ( ( cdList.size ( ) ) > 1 ) || ( ( floppyList.size ( ) ) > 1 ) ; }

Target:
public static boolean isUpdateValidForVmDevices ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.VMStatus vmStatus , java.lang.Object objectWithEditableDeviceFields ) { if ( objectWithEditableDeviceFields == null ) { return true ; } return org.ovirt.engine.core.bll.VmHandler.getVmDevicesFieldsToUpdateOnNextRun ( vmId , vmStatus , objectWithEditableDeviceFields ) . isEmpty ( ) ; }
Source:
public java.util.Map getAllVmStats ( ) { final org.ovirt.vdsmfake.domain.Host host = getActiveHost ( ) ; java.util.Map resultMap = getDoneStatus ( ) ; java.util.List statusList = new java.util.ArrayList ( ) ; for ( org.ovirt.vdsmfake.domain.VM vm : host.getRunningVMs ( ) . values ( ) ) { statusList.add ( fillVmStatsMap ( vm ) ) ; } resultMap.put ( "statsList" , statusList ) ; return resultMap ; }

Target:
public java.util.Map getVmStats ( java.lang.String uuid ) { final org.ovirt.vdsmfake.domain.Host host = getActiveHost ( ) ; java.util.Map resultMap = getDoneStatus ( ) ; java.util.List statusList = new java.util.ArrayList ( ) ; org.ovirt.vdsmfake.domain.VM vm = host.getRunningVMs ( ) . get ( uuid ) ; if ( vm != null ) { statusList.add ( fillVmStatsMap ( vm ) ) ; } resultMap.put ( "statsList" , statusList ) ; org.ovirt.vdsmfake.Utils.getLatency ( ) ; return resultMap ; }
Source:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
protected void addMoveOrCopyParameters ( java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , org.ovirt.engine.core.compat.Guid sourceStorageDomainGuid , org.ovirt.engine.core.compat.Guid destStorageDomainGuid , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters params = createParameters ( sourceStorageDomainGuid , destStorageDomainGuid , disk ) ; params.setQuotaId ( disk.getQuotaId ( ) ) ; parameters.add ( params ) ; }

Target:
protected void addMoveOrCopyParameters ( java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , org.ovirt.engine.core.compat.Guid sourceStorageDomainGuid , org.ovirt.engine.core.compat.Guid destStorageDomainGuid , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters params = createParameters ( sourceStorageDomainGuid , destStorageDomainGuid , disk ) ; params.setQuotaId ( disk.getQuotaId ( ) ) ; params.setDiskProfileId ( disk.getDiskProfileId ( ) ) ; parameters.add ( params ) ; }
Source:
public void testErrorHandling ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; value.setSucceeded ( false ) ; value.setExceptionObject ( new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ( "unknown host" ) ) ; org.mockito.Mockito.when ( resourceManager.runVdsCommand ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSCommandType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( value ) ; updater.refreshVdsStats ( ) ; }

Target:
public void testErrorHandling ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; value.setSucceeded ( false ) ; value.setExceptionObject ( new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ( "unknown host" ) ) ; org.mockito.Mockito.when ( resourceManager.runVdsCommand ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.VDSCommandType.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( value ) ; updater.refreshVdsStats ( ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > filter ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > data ) { for ( org.ovirt.engine.core.common.businessentities.VDS vds : data ) { vds.setCpuName ( cpuFlagsManagerHandler.findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getVdsGroupCompatibilityVersion ( ) ) ) ; } return data ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > filter ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > data ) { for ( org.ovirt.engine.core.common.businessentities.VDS vds : data ) { vds.setCpuName ( getCpuFlagsManagerHandler ( ) . findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getVdsGroupCompatibilityVersion ( ) ) ) ; } return data ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createNFSConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.storage.StorageType type , org.ovirt.engine.core.common.businessentities.NfsVersion version , int timeout , int retrans ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( id , connection , type ) ; connectionDetails.setNfsVersion ( version ) ; connectionDetails.setNfsTimeo ( ( ( short ) ( timeout ) ) ) ; connectionDetails.setNfsRetrans ( ( ( short ) ( retrans ) ) ) ; return connectionDetails ; }

Target:
private static org.ovirt.engine.core.common.businessentities.StorageServerConnections createNFSConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.storage.StorageType type , org.ovirt.engine.core.common.businessentities.NfsVersion version , int timeout , int retrans ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommandTest.populateBasicConnectionDetails ( id , connection , type ) ; connectionDetails.setNfsVersion ( version ) ; connectionDetails.setNfsTimeo ( ( ( short ) ( timeout ) ) ) ; connectionDetails.setNfsRetrans ( ( ( short ) ( retrans ) ) ) ; return connectionDetails ; }
Source:
public int hashCode ( ) { return map.hashCode ( ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.api.extensions.ExtMap ) ) { return false ; } org.ovirt.engine.api.extensions.ExtMap other = ( ( org.ovirt.engine.api.extensions.ExtMap ) ( obj ) ) ; return java.util.Objects.equals ( map , other.map ) ; }
Source:
public void setEnabled ( boolean enabled ) { contentWidget.setEnabled ( enabled ) ; if ( enabled ) { labelElement.replaceClassName ( style.labelDisabled ( ) , style.labelEnabled ( ) ) ; } else { labelElement.replaceClassName ( style.labelEnabled ( ) , style.labelDisabled ( ) ) ; } updateWidgetTitle ( null ) ; }

Target:
public void setEnabled ( boolean enabled ) { contentWidget.setEnabled ( enabled ) ; if ( enabled ) { labelElement.replaceClassName ( style.labelDisabled ( ) , style.labelEnabled ( ) ) ; } else { labelElement.replaceClassName ( style.labelEnabled ( ) , style.labelDisabled ( ) ) ; } if ( ! ( keepTitleOnSetEnabled ) ) { updateWidgetTitle ( null ) ; } }
Source:
public void initialize ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel systemTreeSelectedItem ) { super . initialize ( systemTreeSelectedItem ) ; getModel ( ) . getVmType ( ) . setIsChangeable ( true ) ; templateValidate ( ) ; instanceTypeManager = new org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.NewPoolInstanceTypeManager ( getModel ( ) ) ; }

Target:
public void initialize ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel systemTreeSelectedItem ) { super . initialize ( systemTreeSelectedItem ) ; getModel ( ) . getVmType ( ) . setIsChangeable ( true ) ; templateValidate ( ) ; instanceTypeManager = new org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.NewPoolInstanceTypeManager ( getModel ( ) ) ; getModel ( ) . getVmInitModel ( ) . init ( null ) ; }
Source:
protected void Connect ( ) { if ( ( ( getEntity ( ) ) == null ) || ( ( getEntity ( ) . getRunOnVds ( ) ) == null ) ) { return ; } getLogger ( ) . Debug ( "VNC console info..." ) ; org.ovirt.engine.ui.uicommonweb.UICommand setVmTicketCommand = new org.ovirt.engine.ui.uicommonweb.UICommand ( "setVmCommand" , new org.ovirt.engine.ui.uicommonweb.BaseCommandTarget ( ) { @ java.lang.Override public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand uiCommand ) { setVmTicket ( ) ; } } ) ; executeCommandWithConsoleSafenessWarning ( setVmTicketCommand ) ; }

Target:
protected void connect ( ) { if ( ( ( getEntity ( ) ) == null ) || ( ( getEntity ( ) . getRunOnVds ( ) ) == null ) ) { return ; } getLogger ( ) . debug ( "VNC console info..." ) ; org.ovirt.engine.ui.uicommonweb.UICommand setVmTicketCommand = new org.ovirt.engine.ui.uicommonweb.UICommand ( "setVmCommand" , new org.ovirt.engine.ui.uicommonweb.BaseCommandTarget ( ) { @ java.lang.Override public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand uiCommand ) { setVmTicket ( ) ; } } ) ; executeCommandWithConsoleSafenessWarning ( setVmTicketCommand ) ; }
Source:
private void resetIrs ( ) { if ( ( org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getSpmVdsId ( ) ) != null ) { org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters tempVar = new org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters ( org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getSpmVdsId ( ) ) ; tempVar.setVdsAlreadyRebooted ( true ) ; runVdsCommand ( VDSCommandType.ResetIrs , tempVar ) ; } }

Target:
private void resetSPM ( ) { log.info ( "Start reset of SPM. Spm vds id: '{}'" , org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getSpmVdsId ( ) ) ; if ( ( org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getSpmVdsId ( ) ) != null ) { org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters resetIrsParams = new org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters ( org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.FenceVdsManualyCommand.getStoragePool ( ) . getSpmVdsId ( ) ) ; resetIrsParams.setVdsAlreadyRebooted ( true ) ; runVdsCommand ( VDSCommandType.ResetIrs , resetIrsParams ) ; } }
Source:
protected void executeVmCommand ( ) { clearAddressAlreadyInUse ( ) ; if ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVm ( ) . getStatus ( ) . isUpOrPaused ( ) ) { org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.updateDisksFromDb ( ) ; performPlugCommand ( getPlugAction ( ) , getDisk ( ) , oldVmDevice ) ; } updateDeviceIsPluggedProperty ( ) ; if ( disk.isBoot ( ) ) { updateBootOrder ( ) ; } org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVmStaticDAO ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVm ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.setSucceeded ( true ) ; }

Target:
protected void executeVmCommand ( ) { if ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVm ( ) . getStatus ( ) . isUpOrPaused ( ) ) { org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.updateDisksFromDb ( ) ; performPlugCommand ( getPlugAction ( ) , getDisk ( ) , oldVmDevice ) ; } updateDeviceProperties ( ) ; if ( disk.isBoot ( ) ) { updateBootOrder ( ) ; } org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVmStaticDAO ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVm ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.setSucceeded ( true ) ; }
Source:
private java.util.List < java.lang.String > nicsToNetworksToSync ( java.util.List < org.ovirt.engine.api.model.HostNIC > hostNics ) { java.util.List < java.lang.String > networks = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.model.HostNIC nic : hostNics ) { if ( ( ( nic.isSetOverrideConfiguration ( ) ) && ( nic.isOverrideConfiguration ( ) ) ) && ( nic.isSetNetwork ( ) ) ) { org.ovirt.engine.api.model.Network net = lookupNetwork ( nic.getNetwork ( ) ) ; networks.add ( net.getName ( ) ) ; } } return networks ; }

Target:
private java.util.List < java.lang.String > nicsToNetworksToSync ( java.util.List < org.ovirt.engine.api.model.HostNic > hostNics ) { java.util.List < java.lang.String > networks = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.model.HostNic nic : hostNics ) { if ( ( ( nic.isSetOverrideConfiguration ( ) ) && ( nic.isOverrideConfiguration ( ) ) ) && ( nic.isSetNetwork ( ) ) ) { org.ovirt.engine.api.model.Network net = lookupNetwork ( nic.getNetwork ( ) ) ; networks.add ( net.getName ( ) ) ; } } return networks ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepMountBrokerSetup ( java.lang.String remoteVolumeName , java.lang.String remoteUserName , java.lang.String remoteGroupName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterGeoRepMountBrokerSetup ( remoteUserName , remoteGroupName , remoteVolumeName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepMountBrokerSetup ( java.lang.String remoteVolumeName , java.lang.String userName , java.lang.String remoteGroupName , java.lang.Boolean partial ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterGeoRepMountBrokerSetup ( userName , remoteGroupName , remoteVolumeName , partial ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected void addMoveOrCopyParameters ( java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , org.ovirt.engine.core.compat.Guid sourceStorageDomainGuid , org.ovirt.engine.core.compat.Guid destStorageDomainGuid , org.ovirt.engine.core.common.businessentities.DiskImage disk , org.ovirt.engine.core.common.businessentities.ImageOperation imageOperation ) { org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters diskParameters = new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( disk.getImageId ( ) , sourceStorageDomainGuid , destStorageDomainGuid , imageOperation ) ; diskParameters.setQuotaId ( disk.getQuotaId ( ) ) ; parameters.add ( diskParameters ) ; }

Target:
protected void addMoveOrCopyParameters ( java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , org.ovirt.engine.core.compat.Guid sourceStorageDomainGuid , org.ovirt.engine.core.compat.Guid destStorageDomainGuid , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters params = createParameters ( sourceStorageDomainGuid , destStorageDomainGuid , disk ) ; params.setQuotaId ( disk.getQuotaId ( ) ) ; parameters.add ( params ) ; }
Source:
public void hostHasNoProvider ( ) { org.mockito.Mockito.when ( vdsStaticDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( host ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertFalse ( getQuery ( ) . getQueryReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertNull ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; org.junit.Assert.assertEquals ( VdcBllMessages.NO_HOST_PROVIDER_FOR_SYSTEM.name ( ) , getQuery ( ) . getQueryReturnValue ( ) . getExceptionString ( ) ) ; }

Target:
public void hostHasNoProvider ( ) { org.mockito.Mockito.when ( vdsStaticDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( host ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertFalse ( getQuery ( ) . getQueryReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertNull ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; org.junit.Assert.assertEquals ( EngineMessage.NO_HOST_PROVIDER_FOR_SYSTEM.name ( ) , getQuery ( ) . getQueryReturnValue ( ) . getExceptionString ( ) ) ; }
Source:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { 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.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Erratum > ( ) ; } return source ; }
Source:
public void validateFailsUnSupportedVersionForDiscardAfterDelete ( ) { org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISCARD_AFTER_DELETE_NOT_SUPPORTED_BY_DC_VERSION ; org.mockito.Mockito.when ( storageDomainValidator.isDiscardAfterDeleteSupportedByDcVersion ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( message ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , message ) ; }

Target:
public void validateFailsUnSupportedVersionForDiscardAfterDelete ( ) { org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISCARD_AFTER_DELETE_NOT_SUPPORTED_BY_DC_VERSION ; org.mockito.Mockito.when ( storageDomainValidator.isDiscardAfterDeleteSupportedByDcVersion ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( message ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , message ) ; }
Source:
public void testResolveCombinedMessage ( ) { final java.lang.String message = "${first} equals one, ${second} equals two, '${blank}' equals blank and ${nonExist} is unknown" ; final java.lang.String expectedResolved = java.lang.String.format ( "one equals one, two equals two, ' ' equals blank and %1s is unknown" , MessageResolver.UNKNOWN_VARIABLE_VALUE ) ; java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < > ( ) ; values.put ( "first" , "one" ) ; values.put ( "second" , "two" ) ; values.put ( "blank" , " " ) ; java.lang.String resolvedMessage = org.ovirt.engine.core.dal.dbbroker.auditloghandling.MessageResolver.resolveMessage ( message , values ) ; org.junit.Assert.assertEquals ( expectedResolved , resolvedMessage ) ; }

Target:
public void testResolveCombinedMessage ( ) { final java.lang.String message = "${first} equals one, ${second} equals two, '${blank}' equals blank and ${nonExist} is unknown" ; final java.lang.String expectedResolved = java.lang.String.format ( "one equals one, two equals two, ' ' equals blank and %1s is unknown" , MessageResolver.UNKNOWN_VARIABLE_VALUE ) ; java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < > ( ) ; values.put ( "first" , "one" ) ; values.put ( "second" , "two" ) ; values.put ( "blank" , " " ) ; java.lang.String resolvedMessage = org.ovirt.engine.core.dal.dbbroker.auditloghandling.MessageResolver.resolveMessage ( message , values ) ; org.junit.jupiter.api.Assertions.assertEquals ( expectedResolved , resolvedMessage ) ; }
Source:
protected java.lang.String createRequestToken ( ) { java.lang.String requestToken = super . createRequestToken ( ) ; org.ovirt.engine.ui.uicommonweb.models.EntityModel model = modelProvider.getModel ( ) . getActiveDetailModel ( ) ; if ( ( ( model instanceof org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel ) || ( model instanceof org.ovirt.engine.ui.uicommonweb.models.pools.PoolInterfaceListModel ) ) || ( model instanceof org.ovirt.engine.ui.uicommonweb.models.pools.PoolDiskListModel ) ) { requestToken += org.ovirt.engine.ui.userportal.place.ApplicationPlaces.POOL_SUFFIX ; } return requestToken ; }

Target:
protected java.lang.String createRequestToken ( ) { java.lang.String requestToken = super . createRequestToken ( ) ; org.ovirt.engine.ui.uicommonweb.models.HasEntity < ? > model = modelProvider.getModel ( ) . getActiveDetailModel ( ) ; if ( ( ( model instanceof org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel ) || ( model instanceof org.ovirt.engine.ui.uicommonweb.models.pools.PoolInterfaceListModel ) ) || ( model instanceof org.ovirt.engine.ui.uicommonweb.models.pools.PoolDiskListModel ) ) { requestToken += org.ovirt.engine.ui.uicommonweb.place.UserPortalApplicationPlaces.POOL_SUFFIX ; } return requestToken ; }
Source:
public static void getDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan hostVlanFromNic ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan hv = new org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan ( ) ; hv.setInterface ( nic ) ; hv.setName ( nic.getName ( ) ) ; hv.setNetworkName ( nic.getNetworkName ( ) ) ; hv.setAddress ( nic.getAddress ( ) ) ; hv.getPropertyChangedEvent ( ) . addListener ( this ) ; return hv ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan hostVlanFromNic ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan hv = new org.ovirt.engine.ui.uicommonweb.models.hosts.HostVLan ( ) ; hv.setInterface ( nic ) ; hv.setName ( nic.getName ( ) ) ; hv.setNetworkName ( nic.getNetworkName ( ) ) ; hv.setAddress ( nic.getIpv4Address ( ) ) ; hv.getPropertyChangedEvent ( ) . addListener ( this ) ; return hv ; }