auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void rescheduleAJob ( java.lang.String oldTriggerName , java.lang.String oldTriggerGroup , org.quartz.Trigger newTrigger ) { try { sched.rescheduleJob ( org.quartz.TriggerKey.triggerKey ( oldTriggerName , oldTriggerGroup ) , newTrigger ) ; } catch ( org.quartz.SchedulerException se ) { log.error ( "failed to reschedule the job" , se ) ; } }

Target:
public void rescheduleAJob ( java.lang.String oldTriggerName , java.lang.String oldTriggerGroup , org.quartz.Trigger newTrigger ) { try { if ( ! ( sched.isShutdown ( ) ) ) { sched.rescheduleJob ( org.quartz.TriggerKey.triggerKey ( oldTriggerName , oldTriggerGroup ) , newTrigger ) ; } } catch ( org.quartz.SchedulerException se ) { log.error ( "failed to reschedule the job" , se ) ; } }
Source:
protected org.ovirt.engine.core.common.queries.VdcQueryParametersBase getQueryParameters ( ) { return new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.Empty ) ; }

Target:
public org.ovirt.engine.api.model.Networks list ( ) { java.util.List < org.ovirt.engine.api.model.Network > entities ; if ( isFiltered ( ) ) { org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.Empty ) ; entities = getBackendCollection ( VdcQueryType.GetAllNetworks , parameters , SearchType.Network ) ; } else { entities = getBackendCollection ( SearchType.Network ) ; } org.ovirt.engine.api.model.Networks networks = mapCollection ( entities ) ; for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc prepareImage ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID , boolean allowIllegal ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Image.prepare" ) . withParameter ( "storagepoolID" , spID ) . withParameter ( "storagedomainID" , sdID ) . withParameter ( "imageID" , imageID ) . withParameter ( "volumeID" , volumeID ) . withParameter ( "allowIllegal" , allowIllegal ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturn prepareImage ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID , boolean allowIllegal ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Image.prepare" ) . withParameter ( "storagepoolID" , spID ) . withParameter ( "storagedomainID" , sdID ) . withParameter ( "imageID" , imageID ) . withParameter ( "volumeID" , volumeID ) . withParameter ( "allowIllegal" , allowIllegal ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturn ( response ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.VnicProfileView get ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userId , boolean filtered ) { return getCallsHandler ( ) . executeRead ( getProcedureNameForGet ( ) , org.ovirt.engine.core.dao.network.VnicProfileViewDaoDbFacadeImpl.VnicProfileViewRowMapper.INSTANCE , getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) . addValue ( "user_id" , userId ) . addValue ( "is_filtered" , filtered ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.VnicProfileView get ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userId , boolean filtered ) { return getCallsHandler ( ) . executeRead ( getProcedureNameForGet ( ) , org.ovirt.engine.core.dao.network.VnicProfileViewDaoDbFacadeImpl.VnicProfileViewRowMapper.INSTANCE , createIdParameterMapper ( id ) . addValue ( "user_id" , userId ) . addValue ( "is_filtered" , filtered ) ) ; }
Source:
public void testRemoveHost ( ) { java.lang.String plugin = "OVS" ; java.lang.String hostId = "bee5-1590d-bee5-15g00d" ; java.util.Map < java.lang.String , java.lang.Object > values = new java.util.HashMap ( ) ; values.put ( plugin , hostId ) ; dao.update ( FixturesTool.PROVIDER_BINDING_HOST_ID_HOST_ID2 , values ) ; java.lang.String result = dao.get ( FixturesTool.PROVIDER_BINDING_HOST_ID_HOST_ID2 , plugin ) ; org.junit.Assert.assertEquals ( hostId , result ) ; vdsStaticDao.remove ( FixturesTool.PROVIDER_BINDING_HOST_ID_HOST_ID2 ) ; java.lang.String result2 = dao.get ( FixturesTool.PROVIDER_BINDING_HOST_ID_HOST_ID2 , plugin ) ; org.junit.Assert.assertNull ( result2 ) ; }

Target:
public void testRemoveHost ( ) { java.lang.String plugin = "OVS" ; java.lang.String hostId = "bee5-1590d-bee5-15g00d" ; java.util.Map < java.lang.String , java.lang.Object > values = new java.util.HashMap ( ) ; values.put ( plugin , hostId ) ; dao.update ( FixturesTool.PROVIDER_BINDING_HOST_ID_HOST_ID2 , values ) ; java.lang.String result = dao.get ( FixturesTool.PROVIDER_BINDING_HOST_ID_HOST_ID2 , plugin ) ; org.junit.jupiter.api.Assertions.assertEquals ( hostId , result ) ; vdsStaticDao.remove ( FixturesTool.PROVIDER_BINDING_HOST_ID_HOST_ID2 ) ; java.lang.String result2 = dao.get ( FixturesTool.PROVIDER_BINDING_HOST_ID_HOST_ID2 , plugin ) ; org.junit.jupiter.api.Assertions.assertNull ( result2 ) ; }
Source:
private boolean isDiskOnBlockDevice ( org.ovirt.engine.core.common.businessentities.Disk disk ) { if ( disk instanceof org.ovirt.engine.core.common.businessentities.DiskImage ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageType > diskStorageTypes = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) . getStorageTypes ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageType type : diskStorageTypes ) { if ( ! ( type.isBlockDomain ( ) ) ) { return false ; } } return true ; } return false ; }

Target:
private boolean isDiskOnBlockDevice ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) { if ( disk instanceof org.ovirt.engine.core.common.businessentities.storage.DiskImage ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.StorageType > diskStorageTypes = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) . getStorageTypes ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.StorageType type : diskStorageTypes ) { if ( ! ( type.isBlockDomain ( ) ) ) { return false ; } } return true ; } return false ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageVmListModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageVmListModel ) ( model ) ) ; vmModel.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; vmModel.setIsEmpty ( ( ( ( ( java.util.List ) ( vmModel.getItems ( ) ) ) . size ( ) ) == 0 ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageVmListModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageVmListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( vms , new org.ovirt.engine.ui.uicommonweb.Linq.VmComparator ( ) ) ; vmModel.setItems ( vms ) ; vmModel.setIsEmpty ( ( ( vms.size ( ) ) == 0 ) ) ; }
Source:
public void testCompareFetchGlobalQuotaForSpecificAndForGlobalVdsGroup ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaVdsGroup > quotaVdsGroupGlobalList = dao.getQuotaVdsGroupByVdsGroupGuid ( null , FixturesTool.QUOTA_GENERAL ) ; java.util.List < org.ovirt.engine.core.common.businessentities.QuotaVdsGroup > quotaVdsGroupSpecificList = dao.getQuotaVdsGroupByVdsGroupGuid ( FixturesTool.VDS_GROUP_RHEL6_ISCSI , FixturesTool.QUOTA_GENERAL ) ; org.junit.Assert.assertEquals ( true , quotaVdsGroupGlobalList.equals ( quotaVdsGroupSpecificList ) ) ; }

Target:
public void testCompareFetchGlobalQuotaForSpecificAndForGlobalCluster ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterGlobalList = dao.getQuotaClusterByClusterGuid ( null , FixturesTool.QUOTA_GENERAL ) ; java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterSpecificList = dao.getQuotaClusterByClusterGuid ( FixturesTool.CLUSTER_RHEL6_ISCSI , FixturesTool.QUOTA_GENERAL ) ; org.junit.Assert.assertEquals ( true , quotaClusterGlobalList.equals ( quotaClusterSpecificList ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > executeGetDeviceList ( org.ovirt.engine.core.compat.Guid vdsId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String lunId ) { org.ovirt.engine.core.common.vdscommands.GetDeviceListVDSCommandParameters parameters = new org.ovirt.engine.core.common.vdscommands.GetDeviceListVDSCommandParameters ( vdsId , storageType , false , java.util.Arrays.asList ( lunId ) ) ; return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( getVdsBroker ( ) . RunVdsCommand ( VDSCommandType.GetDeviceList , parameters ) . getReturnValue ( ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validRemovableHostedEngineDisks ( org.ovirt.engine.core.common.businessentities.VM vm ) { return ( isHostedEngineDirectLunDisk ( ) ) || ( ! ( vm.isHostedEngine ( ) ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_HOSTED_ENGINE_DISK ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > getCinderDisksToBeRemoved ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > imageDisks = org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllVmCinderDisksCommand.getParameters ( ) . cinderDisks ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = new java.util.ArrayList < > ( ) ; if ( imageDisks == null ) { cinderDisks = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterDisksBasedOnCinder ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllVmCinderDisksCommand.getVmId ( ) ) ) ; } else { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : imageDisks ) { cinderDisks.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ( diskImage ) ) ) ; } } return cinderDisks ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > getCinderDisksToBeRemoved ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > imageDisks = org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllVmCinderDisksCommand.getParameters ( ) . cinderDisks ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = new java.util.ArrayList < > ( ) ; if ( imageDisks == null ) { cinderDisks = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterDisksBasedOnCinder ( diskDao.getAllForVm ( org.ovirt.engine.core.bll.storage.disk.cinder.RemoveAllVmCinderDisksCommand.getVmId ( ) ) ) ; } else { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : imageDisks ) { cinderDisks.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ( diskImage ) ) ) ; } } return cinderDisks ; }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean canDo , boolean success , boolean reply ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , null , reply , org.ovirt.engine.api.restapi.resource.AbstractBackendBaseTest.CANT_DO ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean valid , boolean success , boolean reply ) { return setUpActionExpectations ( task , clz , names , values , valid , success , null , reply , org.ovirt.engine.api.restapi.resource.AbstractBackendBaseTest.CANT_DO ) ; }
Source:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.hostconfigcheck_3_2.HostConfigCheck.update_lastSyncStruct.commonByteArrayLock ) { try { int length = 0 ; this . var_name = readString ( dis ) ; this . var_value = readString ( dis ) ; this . var_datetime = readDate ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }

Target:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.hostconfigcheck_3_2.HostConfigCheck.update_lastSyncStruct.commonByteArrayLock_OVIRT_ENGINE_DWH_HostConfigCheck ) { try { int length = 0 ; this . var_name = readString ( dis ) ; this . var_value = readString ( dis ) ; this . var_datetime = readDate ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }
Source:
protected void executeCommand ( ) { try { addVmToDb ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; if ( vm.getImages ( ) . isEmpty ( ) ) { endVmRelatedOps ( ) ; } else { processImages ( ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMacs ( macsAdded ) ; throw e ; } setSucceeded ( true ) ; }

Target:
private void endVmRelatedOps ( ) { org.ovirt.engine.core.bll.ImportVmCommand.setVm ( null ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.unLockVm ( getVm ( ) ) ; } else { org.ovirt.engine.core.bll.ImportVmCommand.setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } }
Source:
protected void mockBackendStatusChange ( T cmd , boolean succeeded ) { mockBackendStatusChange ( cmd , succeeded , EngineError.GlusterHookEnableFailed ) ; }

Target:
protected void mockBackendStatusChange ( boolean succeeded , org.ovirt.engine.core.common.errors.EngineError errorCode ) { org.mockito.Mockito.doReturn ( backend ) . when ( cmd ) . getBackend ( ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; vdsReturnValue.setReturnValue ( succeeded ) ; vdsReturnValue.setSucceeded ( succeeded ) ; if ( ! succeeded ) { vdsReturnValue.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( errorCode , "" ) ) ; } org.mockito.Mockito.when ( vdsBrokerFrontend.runVdsCommand ( org.ovirt.engine.core.bll.gluster.GlusterHookCommandTest.any ( org.ovirt.engine.core.common.vdscommands.VDSCommandType.class ) , org.ovirt.engine.core.bll.gluster.GlusterHookCommandTest.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( vdsReturnValue ) ; }
Source:
public void writeData ( java.io.ObjectOutputStream dos ) { try { writeString ( this . var_name , dos ) ; writeString ( this . var_value , dos ) ; writeDate ( this . var_datetime , dos ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public void writeData ( java.io.ObjectOutputStream dos ) { try { writeString ( this . key , dos ) ; writeString ( this . value , dos ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService entity ) { if ( ( ( entity.getPort ( ) ) != null ) && ( ( entity.getPort ( ) ) > 0 ) ) { return java.lang.String.valueOf ( entity.getPort ( ) ) ; } else { return constants.notAvailableLabel ( ) ; } }

Target:
public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService entity ) { if ( ( ( entity.getPort ( ) ) != null ) && ( ( entity.getPort ( ) ) > 0 ) ) { return java.lang.String.valueOf ( entity.getPort ( ) ) ; } else { return org.ovirt.engine.ui.webadmin.section.main.view.tab.cluster.SubTabClusterServiceView.constants.notAvailableLabel ( ) ; } }
Source:
public void moveItemDown ( ) { if ( ( getSelectedItemIndex ( ) ) < ( ( getItems ( ) . size ( ) ) - 1 ) ) { getItems ( ) . Move ( getSelectedItemIndex ( ) , ( ( getSelectedItemIndex ( ) ) + 1 ) ) ; } }

Target:
public void moveItemDown ( ) { if ( ( getSelectedItemIndex ( ) ) < ( ( getItems ( ) . size ( ) ) - 1 ) ) { getItems ( ) . move ( getSelectedItemIndex ( ) , ( ( getSelectedItemIndex ( ) ) + 1 ) ) ; } }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateQos ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure ) { org.ovirt.engine.core.bll.ValidationResult vr = org.ovirt.engine.core.bll.ValidationResult.VALID ; vr = ( skipValidation ( vr ) ) ? vr : validateQosOverriddenInterfaces ( ) ; vr = ( skipValidation ( vr ) ) ? vr : validateQosNotPartiallyConfigured ( attachmentsToConfigure ) ; vr = ( skipValidation ( vr ) ) ? vr : validateQosCommitment ( attachmentsToConfigure ) ; return vr ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateNetworkExclusiveOnNics ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure ) { org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator validator = new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( attachmentsToConfigure , networkBusinessEntityMap , networkExclusivenessValidator ) ; return validator.validateNetworkExclusiveOnNics ( ) ; }
Source:
public void setText ( java.lang.String text ) { super . setText ( new org.ovirt.engine.ui.common.widget.renderer.EmptyValueRenderer < java.lang.String > ( ) . render ( text ) ) ; if ( showBorder ) { getElement ( ) . getStyle ( ) . setBorderWidth ( 1 , Unit.PX ) ; } if ( disableResizing ) { getElement ( ) . getStyle ( ) . setProperty ( "resize" , "none" ) ; } }

Target:
public void setCustomStyle ( final java.lang.String customStyle ) { if ( customStyle != null ) { getElement ( ) . getElementsByTagName ( "textarea" ) . getItem ( 0 ) . addClassName ( customStyle ) ; } }
Source:
public void canDoActionEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) . when ( command ) . getAllImageSnapshots ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void canDoActionEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) . when ( command ) . getAllImageSnapshots ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public javax.ws.rs.core.Response head ( ) { org.ovirt.engine.api.model.API api = getApi ( ) ; return getResponseBuilder ( api ) . build ( ) ; }

Target:
public javax.ws.rs.core.Response head ( ) { appMode = getCurrent ( ) . get ( org.ovirt.engine.core.common.mode.ApplicationMode.class ) ; org.ovirt.engine.api.model.API api = null ; if ( ( appMode ) == ( org.ovirt.engine.core.common.mode.ApplicationMode.GlusterOnly ) ) { api = getGlusterApi ( ) ; } else { api = getApi ( ) ; } return getResponseBuilder ( api ) . build ( ) ; }
Source:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , t ) ; collection.setParent ( parentMock ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , t ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }
Source:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( vds.getStatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , vds.getId ( ) , vds.getName ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warnFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , vds.getId ( ) , vds.getName ( ) , e.getMessage ( ) ) ; } }

Target:
public void dispose ( ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.info ( "vdsManager::disposing" ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . deleteJob ( onTimerJobId ) ; vdsProxy.close ( ) ; }
Source:
public void convertValidPropertiesToString ( ) { org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils utils = new org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils ( ) ; java.util.Map < java.lang.String , java.lang.String > propMap = new java.util.LinkedHashMap < java.lang.String , java.lang.String > ( ) ; propMap.put ( "speed" , "1024" ) ; propMap.put ( "duplex" , "half" ) ; propMap.put ( "debug" , null ) ; propMap.put ( "verbose" , "" ) ; java.lang.String propStr = utils.convertProperties ( propMap ) ; org.junit.Assert.assertEquals ( "speed=1024;duplex=half;debug=;verbose=" , propStr ) ; }

Target:
public void convertValidPropertiesToString ( ) { org.ovirt.engine.core.common.utils.customprop.CustomPropertiesUtils utils = new org.ovirt.engine.core.common.utils.customprop.CustomPropertiesUtils ( ) ; java.util.Map < java.lang.String , java.lang.String > propMap = new java.util.LinkedHashMap < java.lang.String , java.lang.String > ( ) ; propMap.put ( "speed" , "1024" ) ; propMap.put ( "duplex" , "half" ) ; propMap.put ( "debug" , null ) ; propMap.put ( "verbose" , "" ) ; java.lang.String propStr = utils.convertProperties ( propMap ) ; org.junit.Assert.assertEquals ( "speed=1024;duplex=half;debug=;verbose=" , propStr ) ; }
Source:
public static java.util.List < org.ovirt.engine.api.extensions.ExtMap > findPrincipalsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.util.List < java.lang.String > ids , final boolean groupsResolving , final boolean groupsResolvingRecursive ) { java.util.List < org.ovirt.engine.api.extensions.ExtMap > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension.getContext ( ) , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipalRecords ( extension , namespace , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.PRINCIPAL ) , groupsResolving , groupsResolvingRecursive ) ) ; } return results ; }

Target:
public static java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > findPrincipalsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.util.Collection < java.lang.String > ids , final boolean groupsResolving , final boolean groupsResolvingRecursive ) { java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > results = new java.util.ArrayList < > ( ) ; for ( java.util.Collection < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension.getContext ( ) , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipalRecords ( extension , namespace , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.PRINCIPAL ) , groupsResolving , groupsResolvingRecursive ) ) ; } return results ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > allRunningOnOrMigratingToVds = org.ovirt.engine.core.bll.GetVmsRunningOnOrMigratingToVdsQuery.getDbFacade ( ) . getVmDao ( ) . getAllRunningOnOrMigratingToVds ( org.ovirt.engine.core.bll.GetVmsRunningOnOrMigratingToVdsQuery.getParameters ( ) . getId ( ) ) ; updateStatistics ( allRunningOnOrMigratingToVds ) ; org.ovirt.engine.core.bll.GetVmsRunningOnOrMigratingToVdsQuery.getQueryReturnValue ( ) . setReturnValue ( allRunningOnOrMigratingToVds ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > allRunningOnOrMigratingToVds = vmDao.getAllRunningOnOrMigratingToVds ( org.ovirt.engine.core.bll.GetVmsRunningOnOrMigratingToVdsQuery.getParameters ( ) . getId ( ) ) ; updateStatistics ( allRunningOnOrMigratingToVds ) ; org.ovirt.engine.core.bll.GetVmsRunningOnOrMigratingToVdsQuery.getQueryReturnValue ( ) . setReturnValue ( allRunningOnOrMigratingToVds ) ; }
Source:
public void onSucceeded ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onSucceeded ( cmdId , childCmdIds ) ; log.info ( "Volume/Snapshot has been successfully deleted from Cinder. ID: {}" , getDiskId ( ) ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }

Target:
public void onSucceeded ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onSucceeded ( cmdId , childCmdIds ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommandCallback.log.info ( "Volume/Snapshot has been successfully deleted from Cinder. ID: {}" , getDiskId ( ) ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommandCallback.getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }
Source:
public static 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.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.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public static void getStorageDomainMaxNameLength ( 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.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { getWindow ( ) . stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { setWindow ( null ) ; setGuideContext ( returnValue.getActionReturnValue ( ) ) ; updateActionAvailability ( ) ; getGuideCommand ( ) . execute ( ) ; } else { cancel ( ) ; } super . executed ( result ) ; }

Target:
protected void createUnitVmModelNetworkSucceeded ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { setGuideContext ( returnValue.getActionReturnValue ( ) ) ; updateActionsAvailability ( ) ; getGuideCommand ( ) . execute ( ) ; }
Source:
public void testDedicatedHostNotInSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setvds_group_id ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; vmStatic.setdedicated_vm_for_vds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }

Target:
public void testDedicatedHostNotInSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setvds_group_id ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }
Source:
public org.ovirt.engine.sdk.decorators.User add ( org.ovirt.engine.sdk.decorators.User user ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; return getProxy ( ) . add ( url , user , org.ovirt.engine.sdk.entities.User.class , org.ovirt.engine.sdk.decorators.User.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.User add ( org.ovirt.engine.sdk.decorators.User user ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , user , org.ovirt.engine.sdk.entities.User.class , org.ovirt.engine.sdk.decorators.User.class , headers ) ; }
Source:
public void testUpdateByVolumeIdAndName ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig config = dao.getConfigByVolumeIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.VOLUME_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_1 ) ; org.junit.Assert.assertNotNull ( config ) ; org.junit.Assert.assertEquals ( "value1" , config.getParamValue ( ) ) ; dao.updateConfigByVolumeIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.VOLUME_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_1 , "new_value" ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig modifiedConfig = dao.getConfigByVolumeIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.VOLUME_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_1 ) ; org.junit.Assert.assertNotNull ( modifiedConfig ) ; org.junit.Assert.assertEquals ( "new_value" , modifiedConfig.getParamValue ( ) ) ; }

Target:
public void testUpdateByVolumeIdAndName ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig config = dao.getConfigByVolumeIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.VOLUME_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_1 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( config ) ; org.junit.jupiter.api.Assertions.assertEquals ( "value1" , config.getParamValue ( ) ) ; dao.updateConfigByVolumeIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.VOLUME_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_1 , "new_value" ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig modifiedConfig = dao.getConfigByVolumeIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.VOLUME_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_1 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( modifiedConfig ) ; org.junit.jupiter.api.Assertions.assertEquals ( "new_value" , modifiedConfig.getParamValue ( ) ) ; }
Source:
private org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters buildCreateSnapshotParametersForEndAction ( ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters parameters = buildCreateSnapshotParameters ( ) ; parameters.setImagesParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) ) ; if ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . isUseCinderCommandCallback ( ) ) { parameters.setShouldBeEndedByParent ( false ) ; parameters.setCommandId ( org.ovirt.engine.core.bll.RunVmCommand.getParametersForChildCommand ( ) . get ( 0 ) . getCommandId ( ) ) ; } return parameters ; }

Target:
private org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters buildCreateSnapshotParametersForEndAction ( ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters parameters = buildCreateSnapshotParameters ( ) ; parameters.setImagesParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) ) ; if ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . isUseCinderCommandCallback ( ) ) { parameters.setEndProcedure ( EndProcedure.COMMAND_MANAGED ) ; parameters.setCommandId ( org.ovirt.engine.core.bll.RunVmCommand.getParametersForChildCommand ( ) . get ( 0 ) . getCommandId ( ) ) ; } return parameters ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain currDomain : domainsInPool ) { updateDisksStorage ( currDomain , disksList ) ; if ( ( ( currDomain.getStorageDomainType ( ) . isDataDomain ( ) ) && ( ( currDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) && ( validateSpaceRequirements ( currDomain , disksList ) ) ) { return currDomain ; } } return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { domainsInPool = filterStorageDomains ( domainsInPool , disksList ) ; return domainsInPool.isEmpty ( ) ? null : domainsInPool.get ( 0 ) ; }
Source:
public static org.ovirt.engine.core.bll.SPMAsyncTask Construct ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType taskType , org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters asyncTaskParams ) { try { org.ovirt.engine.core.bll.SPMAsyncTask result = null ; if ( taskType == ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.unknown ) ) { result = new org.ovirt.engine.core.bll.SPMAsyncTask ( asyncTaskParams ) ; } else { result = new org.ovirt.engine.core.bll.EntityAsyncTask ( asyncTaskParams ) ; } return result ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.AsyncTaskFactory.log.error ( java.lang.String.format ( "AsyncTaskFactory: Failed to get type information using reflection for AsyncTask type: %1$s." , taskType ) , e ) ; return null ; } }

Target:
public static org.ovirt.engine.core.bll.SPMAsyncTask Construct ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType taskType , org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters asyncTaskParams , boolean duringInit ) { try { org.ovirt.engine.core.bll.SPMAsyncTask result = null ; if ( taskType == ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.unknown ) ) { result = new org.ovirt.engine.core.bll.SPMAsyncTask ( asyncTaskParams ) ; } else { result = new org.ovirt.engine.core.bll.EntityAsyncTask ( asyncTaskParams , duringInit ) ; } return result ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.AsyncTaskFactory.log.error ( java.lang.String.format ( "AsyncTaskFactory: Failed to get type information using reflection for AsyncTask type: %1$s." , taskType ) , e ) ; return null ; } }
Source:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public static void GetAllNetworkProviders ( org.ovirt.engine.ui.frontend.AsyncQuery query ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetAllProvidersByProvidedEntity ( query , VdcObjectType.Network ) ; }
Source:
public void testZeroLatency ( ) { java.lang.String doubleValue = "0" ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVmDynamic ( ) ; java.util.Map < java.lang.String , java.lang.Object > diskData = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_write_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setMockForTesting ( diskData ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xml , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVds ( ) ) ; org.junit.Assert.assertEquals ( vmDynamic.getDisks ( ) . get ( 0 ) . getWriteLatency ( ) , new java.lang.Double ( "0" ) ) ; }

Target:
public void testZeroLatency ( ) { java.lang.String doubleValue = "0" ; java.util.Map < java.lang.String , java.lang.Object > diskData = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_write_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setMockForTesting ( diskData ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > disks = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmDiskStatistics ( xml ) ; org.junit.Assert.assertEquals ( new java.lang.Double ( "0" ) , disks.get ( 0 ) . getWriteLatency ( ) ) ; }
Source:
public java.lang.String getIsoDirectory ( ) { java.lang.String tempVar = getmCurrentIrsHost ( ) ; return java.lang.String.format ( "\\\\%1$s\\CD" , ( tempVar != null ? tempVar : gethostFromVds ( ) ) ) ; }

Target:
public void ResetIrs ( ) { nullifyInternalProxies ( ) ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( _storagePoolId ) ; if ( storagePool != null ) { storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; } }
Source:
protected org.ovirt.engine.core.compat.Guid getClusterId ( org.ovirt.engine.api.model.Template template ) { return getEntity ( org.ovirt.engine.core.common.businessentities.Cluster.class , VdcQueryType.GetClusterByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( template.getCluster ( ) . getName ( ) ) , ( "Cluster: name=" + ( template.getCluster ( ) . getName ( ) ) ) ) . getId ( ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getClusterId ( org.ovirt.engine.api.model.Template template ) { return getEntity ( org.ovirt.engine.core.common.businessentities.Cluster.class , QueryType.GetClusterByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( template.getCluster ( ) . getName ( ) ) , ( "Cluster: name=" + ( template.getCluster ( ) . getName ( ) ) ) ) . getId ( ) ; }
Source:
private org.springframework.jdbc.core.namedparam.MapSqlParameterSource getQuotaStorageParameterMap ( org.ovirt.engine.core.compat.Guid quotaId , org.ovirt.engine.core.common.businessentities.QuotaStorage quotaStorage ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource storageQuotaParameterMap = createQuotaIdParameterMapper ( quotaStorage.getQuotaStorageId ( ) ) . addValue ( "quota_id" , quotaId ) . addValue ( "storage_id" , quotaStorage.getStorageId ( ) ) . addValue ( "vds_group_id" , null ) . addValue ( "storage_size_gb" , quotaStorage.getStorageSizeGB ( ) ) . addValue ( "virtual_cpu" , null ) . addValue ( "mem_size_mb" , null ) ; return storageQuotaParameterMap ; }

Target:
private org.springframework.jdbc.core.namedparam.MapSqlParameterSource getQuotaStorageParameterMap ( org.ovirt.engine.core.compat.Guid quotaId , org.ovirt.engine.core.common.businessentities.QuotaStorage quotaStorage ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource storageQuotaParameterMap = createQuotaIdParameterMapper ( quotaStorage.getQuotaStorageId ( ) ) . addValue ( "quota_id" , quotaId ) . addValue ( "storage_id" , quotaStorage.getStorageId ( ) ) . addValue ( "cluster_id" , null ) . addValue ( "storage_size_gb" , quotaStorage.getStorageSizeGB ( ) ) . addValue ( "virtual_cpu" , null ) . addValue ( "mem_size_mb" , null ) ; return storageQuotaParameterMap ; }
Source:
protected boolean areTemplateImagesInStorageReady ( org.ovirt.engine.core.compat.Guid storageId ) { return org.ovirt.engine.core.bll.VmTemplateCommand.isVmTemplateImagesReady ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplate ( ) , storageId , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , false , true , true , destStorages.isEmpty ( ) , storageToDisksMap.get ( storageId ) ) ; }

Target:
protected boolean verifyAddVM ( ) { final java.util.List < java.lang.String > reasons = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getValidationMessages ( ) ; final int nicsCount = ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ; final int priority = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getPriority ( ) ; return org.ovirt.engine.core.bll.VmHandler.verifyAddVm ( reasons , nicsCount , priority , getMacPool ( ) ) ; }
Source:
public static void GetStorageDomainById ( 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 ? ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static void GetClusterNetworkList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.VdsGroupQueryParamenters ( clusterId ) , aQuery ) ; }