auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.bll.CpuFlagsManagerHandler getCpuFlagsManagerHandler ( ) { return cpuFlagsManagerHandler ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = vdsDao.get ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . getId ( ) ) ; if ( vds != null ) { vds.setCpuName ( cpuFlagsManagerHandler.findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getClusterCompatibilityVersion ( ) ) ) ; } org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getQueryReturnValue ( ) . setReturnValue ( vds ) ; }
Source:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.action.RemoveVmParameters buildRemoveVmParameters ( ) { org.ovirt.engine.core.common.action.RemoveVmParameters parameters = new org.ovirt.engine.core.common.action.RemoveVmParameters ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmId ( ) , false ) ; parameters.setParentCommand ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getActionType ( ) ) ; parameters.setParentParameters ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getParameters ( ) ) ; parameters.setEntityInfo ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getParameters ( ) . getEntityInfo ( ) ) ; return parameters ; }

Target:
private org.ovirt.engine.core.common.action.RemoveVmParameters buildRemoveVmParameters ( ) { org.ovirt.engine.core.common.action.RemoveVmParameters parameters = new org.ovirt.engine.core.common.action.RemoveVmParameters ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmId ( ) , false ) ; parameters.setParentCommand ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getActionType ( ) ) ; parameters.setParentParameters ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getParameters ( ) ) ; parameters.setEntityInfo ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getParameters ( ) . getEntityInfo ( ) ) ; parameters.setRemovePermissions ( false ) ; return parameters ; }
Source:
protected void executeCommand ( ) { if ( org.ovirt.engine.core.bll.VmTemplateHandler.isTemplateStatusIsNotLocked ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ) { org.ovirt.engine.core.bll.VmTemplateHandler.lockVmTemplateInTransaction ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) , org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getCompensationContext ( ) ) ; if ( ! ( getTemplateDisks ( ) . isEmpty ( ) ) ) { MoveOrCopyAllImageGroups ( ) ; } else { endVmTemplateRelatedOps ( ) ; } org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.VmTemplateHandler.lockVmTemplateInTransaction ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) , org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getCompensationContext ( ) ) ; org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.freeLock ( ) ; if ( ! ( getTemplateDisks ( ) . isEmpty ( ) ) ) { moveOrCopyAllImageGroups ( ) ; } else { endVmTemplateRelatedOps ( ) ; } org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setSucceeded ( true ) ; }
Source:
public void shouldDetectInvalidVMOnClusterUpgradeCheck ( ) { invalidVM.setCpuPinning ( "i am pinned" ) ; org.hamcrest.MatcherAssert.assertThat ( validator.isUpgradePossible ( java.util.Arrays.asList ( newHost1 , newHost2 ) , java.util.Arrays.asList ( validVM , invalidVM ) ) , org.hamcrest.Matchers.not ( org.hamcrest.CoreMatchers.equalTo ( ValidationResult.VALID ) ) ) ; }

Target:
public void shouldDetectInvalidVMOnClusterUpgradeCheck ( ) { invalidVM.setCpuPinning ( "i am pinned" ) ; org.assertj.core.api.Assertions.assertThat ( validator.isUpgradePossible ( java.util.Arrays.asList ( newHost1 , newHost2 ) , java.util.Arrays.asList ( validVM , invalidVM ) ) ) . isNotEqualTo ( ValidationResult.VALID ) ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel model ) { driver.edit ( model ) ; publicInfo.setVisible ( model.getPublicUse ( ) . getIsAvailable ( ) ) ; }

Target:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( nameEditor.asValueBox ( ) , nameEditor.asValueBox ( ) . getValue ( ) ) ; } } ) ; }
Source:
protected java.lang.Object getContentSlot ( ) { return org.ovirt.engine.ui.webadmin.section.main.presenter.HeaderPresenterWidget.TYPE_SetSearchPanel ; }

Target:
public void setInSlot ( java.lang.Object slot , com.google.gwt.user.client.ui.IsWidget content ) { if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.HeaderPresenterWidget.TYPE_SetSearchPanel ) ) { setPanelContent ( searchPanelContainer , content ) ; } else if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.HeaderPresenterWidget.TYPE_SetTabBar ) ) { setPanelContent ( mainTabContainer , content ) ; content.asWidget ( ) . addStyleName ( style.mainTabBar ( ) ) ; } else { super . setInSlot ( slot , content ) ; } }
Source:
public boolean isRawBlock ( ) { return ( ( getVolumeFormat ( ) ) == ( VolumeFormat.RAW ) ) && ( getStorageTypes ( ) . get ( 0 ) . isBlockDomain ( ) ) ; }

Target:
public boolean hasRawBlock ( ) { if ( ( getVolumeFormat ( ) ) != ( VolumeFormat.RAW ) ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.storage.StorageType type : getStorageTypes ( ) ) { if ( type.isBlockDomain ( ) ) { return true ; } } return false ; }
Source:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc registerSecrets ( java.util.Map < java.lang.String , java.lang.String > [ ] libvirtSecrets ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.registerSecrets ( libvirtSecrets ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; } 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 convertVmFromExternalSystem ( java.lang.String url , java.lang.String user , java.lang.String password , java.util.Map < java.lang.String , java.lang.Object > vm , java.lang.String jobUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.convertExternalVm ( url , user , password , vm , jobUUID ) ; 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:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( propName.equals ( "IsValid" ) ) { if ( disk.getIsValid ( ) ) { innerAttachDiskPanel.markAsValid ( ) ; } else { innerAttachDiskPanel.markAsInvalid ( disk.getInvalidityReasons ( ) ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( propName.equals ( "IsValid" ) ) { if ( disk.getIsValid ( ) ) { innerAttachDiskPanel.markAsValid ( ) ; } else { innerAttachDiskPanel.markAsInvalid ( disk.getInvalidityReasons ( ) ) ; } } }
Source:
private boolean isNewerVersion ( org.ovirt.engine.core.compat.Version isoClusterVersion ) { org.ovirt.engine.core.common.businessentities.VDS vds = getVdsByVdsId ( org.ovirt.engine.core.bll.GetoVirtISOsQuery.getParameters ( ) . getVdsId ( ) ) ; org.ovirt.engine.core.compat.Version vdsClusterVersion = vds.getVdsGroupCompatibilityVersion ( ) ; log.debugFormat ( "vdsClusterVersion {0} isoClusterVersion {1}" , vdsClusterVersion , isoClusterVersion ) ; return ( ( vdsClusterVersion.getMajor ( ) ) == ( isoClusterVersion.getMajor ( ) ) ) && ( ( vdsClusterVersion.getMinor ( ) ) <= ( isoClusterVersion.getMinor ( ) ) ) ; }

Target:
private boolean isNewerVersion ( org.ovirt.engine.core.compat.Version isoClusterVersion ) { org.ovirt.engine.core.common.businessentities.VDS vds = getVdsByVdsId ( org.ovirt.engine.core.bll.GetoVirtISOsQuery.getParameters ( ) . getVdsId ( ) ) ; org.ovirt.engine.core.compat.Version vdsClusterVersion = vds.getVdsGroupCompatibilityVersion ( ) ; log.debug ( "vdsClusterVersion '{}' isoClusterVersion '{}'" , vdsClusterVersion , isoClusterVersion ) ; return ( ( vdsClusterVersion.getMajor ( ) ) == ( isoClusterVersion.getMajor ( ) ) ) && ( ( vdsClusterVersion.getMinor ( ) ) <= ( isoClusterVersion.getMinor ( ) ) ) ; }
Source:
private org.springframework.jdbc.core.namedparam.MapSqlParameterSource createStatisticsParametersMapper ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkStatistics stats ) { return getCustomMapSqlParameterSource ( ) . addValue ( "id" , stats.getId ( ) ) . addValue ( "rx_drop" , stats.getReceiveDropRate ( ) ) . addValue ( "rx_rate" , stats.getReceiveRate ( ) ) . addValue ( "tx_drop" , stats.getTransmitDropRate ( ) ) . addValue ( "tx_rate" , stats.getTransmitRate ( ) ) . addValue ( "iface_status" , stats.getStatus ( ) ) . addValue ( "vds_id" , stats.getVdsId ( ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.VdsNetworkStatistics mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.VdsNetworkStatistics entity = super . mapRow ( rs , rowNum ) ; entity.setVdsId ( getGuidDefaultEmpty ( rs , "vds_id" ) ) ; return entity ; }
Source:
public static org.ovirt.engine.api.model.Role map ( org.ovirt.engine.core.common.businessentities.Permissions entity , org.ovirt.engine.api.model.Role template ) { org.ovirt.engine.api.model.Role model = ( template != null ) ? template : new org.ovirt.engine.api.model.Role ( ) ; model.setName ( entity.getRoleName ( ) ) ; model.setId ( entity.getRoleId ( ) . toString ( ) ) ; return model ; }

Target:
public static org.ovirt.engine.api.model.Role map ( org.ovirt.engine.api.model.Permission entity , org.ovirt.engine.api.model.Role template ) { org.ovirt.engine.api.model.Role model = ( template != null ) ? template : new org.ovirt.engine.api.model.Role ( ) ; model.setName ( entity.getRoleName ( ) ) ; model.setId ( entity.getRoleId ( ) . toString ( ) ) ; return model ; }
Source:
protected void executeQuery ( org.ovirt.engine.core.bll.adbroker.DirectorySearcher directorySearcher ) { final java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > userList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LdapUser > ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > usersList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ) ( directorySearcher.FindAll ( getLdapQueryData ( ) ) ) ) ; for ( final org.ovirt.engine.core.common.businessentities.LdapUser searchResult : usersList ) { { org.ovirt.engine.core.common.businessentities.LdapUser user = populateUserData ( searchResult , getLdapQueryData ( ) . getDomain ( ) ) ; userList.add ( user ) ; } } setReturnValue ( userList ) ; setSucceeded ( true ) ; }

Target:
protected void executeQuery ( org.ovirt.engine.core.bll.adbroker.DirectorySearcher directorySearcher ) { final java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > userList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LdapUser > ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > usersList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LdapUser > ) ( directorySearcher.findAll ( getLdapQueryData ( ) ) ) ) ; for ( final org.ovirt.engine.core.common.businessentities.LdapUser searchResult : usersList ) { { org.ovirt.engine.core.common.businessentities.LdapUser user = populateUserData ( searchResult , getLdapQueryData ( ) . getDomain ( ) ) ; userList.add ( user ) ; } } setReturnValue ( userList ) ; setSucceeded ( true ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { return null ; }

Target:
public HostJobInfo.HostJobStatus poll ( ) { org.ovirt.engine.core.common.businessentities.SubchainInfo info = org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.getParameters ( ) . getSubchainInfo ( ) ; return poller.pollImage ( org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.getParameters ( ) . getStoragePoolId ( ) , info.getStorageDomainId ( ) , info.getImageGroupId ( ) , info.getBaseImageId ( ) , info.getBaseImageGeneration ( ) , org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.getCommandId ( ) , org.ovirt.engine.core.bll.storage.disk.image.ColdMergeCommand.getActionType ( ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.NetworkAttachment getNetworkAttachmentForNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { if ( networkId == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment updatedAttachment = new org.ovirt.engine.core.common.utils.MapNetworkAttachments ( hostSetupNetworksParametersData.newOrModifiedNetworkAttachments ) . byNetworkId ( ) . get ( networkId ) ; if ( updatedAttachment != null ) { return updatedAttachment ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment = getExistingAttachmentByNetworkId ( networkId ) ; if ( ( existingAttachment != null ) && ( ! ( shouldBeRemoved ( existingAttachment.getId ( ) ) ) ) ) { return existingAttachment ; } return null ; }

Target:
private void onNicsChanged ( ) { operationFactory = new org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperationFactory ( getNetworkModels ( ) , getNicModels ( ) ) ; validate ( ) ; }
Source:
private org.ovirt.engine.api.model.OpenStackVolumeProviders mapCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > entities ) { org.ovirt.engine.api.model.OpenStackVolumeProviders collection = new org.ovirt.engine.api.model.OpenStackVolumeProviders ( ) ; for ( org.ovirt.engine.core.common.businessentities.Provider entity : entities ) { collection.getOpenStackVolumeProviders ( ) . add ( addLinks ( map ( entity ) ) ) ; } return collection ; }

Target:
private org.ovirt.engine.api.model.OpenStackVolumeProviders mapCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > entities ) { org.ovirt.engine.api.model.OpenStackVolumeProviders collection = new org.ovirt.engine.api.model.OpenStackVolumeProviders ( ) ; for ( org.ovirt.engine.core.common.businessentities.Provider entity : entities ) { org.ovirt.engine.api.model.OpenStackVolumeProvider provider = map ( entity ) ; collection.getOpenStackVolumeProviders ( ) . add ( addLinks ( populate ( provider , entity ) ) ) ; } return collection ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateWatchdog , org.ovirt.engine.core.common.action.WatchdogParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendWatchdogResourceTest.VM_ID } , true , true ) ) ; org.ovirt.engine.api.model.WatchDog wd = resource.update ( getUpdate ( ) ) ; assertTrue ( wd.isSetAction ( ) ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateWatchdog , org.ovirt.engine.core.common.action.WatchdogParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendWatchdogResourceTest.VM_ID } , true , true ) ) ; org.ovirt.engine.api.model.Watchdog wd = resource.update ( getUpdate ( ) ) ; assertTrue ( wd.isSetAction ( ) ) ; }
Source:
public void testAdd ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpGetConsoleExpectations ( new int [ ] { 0 , 0 , 0 } ) ; setUpGetSoundcardExpectations ( new int [ ] { 0 } ) ; setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpVm ( GUIDS [ 1 ] ) ) ; super . testAdd ( ) ; }

Target:
public void testAdd ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpGetConsoleExpectations ( new int [ ] { 0 , 0 , 0 } ) ; setUpGetSoundcardExpectations ( new int [ ] { 0 } ) ; setUpGetBallooningExpectations ( new java.lang.Integer [ ] { 0 , 0 } ) ; setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpVm ( GUIDS [ 1 ] ) ) ; super . testAdd ( ) ; }
Source:
public static void GetClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters ( id ) , aQuery ) ; }

Target:
public static boolean IsWindowsOsType ( org.ovirt.engine.core.common.businessentities.VmOsType osType ) { if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetWindowsOsTypes ( ) . contains ( osType ) ) { return true ; } return false ; }
Source:
private Q createQuery ( ) { try { java.lang.reflect.Constructor < ? extends Q > con = getQueryType ( ) . getConstructor ( getParameterType ( ) ) ; return con.newInstance ( getQueryParameters ( ) ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
private Q createQuery ( ) { try { java.lang.reflect.Constructor < ? extends Q > con = getQueryType ( ) . getConstructor ( getParameterType ( ) , org.ovirt.engine.core.bll.context.EngineContext.class ) ; return con.newInstance ( getQueryParameters ( ) , null ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { if ( failure == null ) { setUpEntityQueryExpectations ( VdcQueryType.GetVmsInit , org.ovirt.engine.core.common.queries.IdsQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpVmInit ( ) ) ; } super . setUpQueryExpectations ( query , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { if ( failure == null ) { setUpEntityQueryExpectations ( QueryType.GetVmsInit , org.ovirt.engine.core.common.queries.IdsQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpVmInit ( ) ) ; } super . setUpQueryExpectations ( query , failure ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure , org.ovirt.engine.core.compat.Guid adElementId ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( queryType , queryParams.getClass ( ) , new java.lang.String [ ] { queryParameterName } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpPermissionsWithAdElementId ( adElementId ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure , org.ovirt.engine.core.compat.Guid adElementId ) throws java.lang.Exception { org.junit.Assert.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( queryType , queryParams.getClass ( ) , new java.lang.String [ ] { queryParameterName } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpPermissionsWithAdElementId ( adElementId ) , failure ) ; }
Source:
private void mockStorageDomainDao ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomains.setstatus ( StorageDomainStatus.Active ) ; storageDomains.setavailable_disk_size ( 10000000 ) ; storageDomains.setused_disk_size ( 10 ) ; org.mockito.Mockito.doReturn ( storageDomainDAO ) . when ( spyCommand ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.when ( storageDomainDAO.getForStoragePool ( storageDomainId , Guid.Empty ) ) . thenReturn ( storageDomains ) ; org.mockito.Mockito.when ( storageDomainDAO.get ( storageDomainId ) ) . thenReturn ( storageDomains ) ; }

Target:
private void mockStorageDomainDao ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomains.setStatus ( StorageDomainStatus.Active ) ; storageDomains.setAvailableDiskSize ( 10000000 ) ; storageDomains.setUsedDiskSize ( 10 ) ; org.mockito.Mockito.doReturn ( storageDomainDAO ) . when ( spyCommand ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.when ( storageDomainDAO.getForStoragePool ( storageDomainId , Guid.Empty ) ) . thenReturn ( storageDomains ) ; org.mockito.Mockito.when ( storageDomainDAO.get ( storageDomainId ) ) . thenReturn ( storageDomains ) ; }
Source:
public void testIncludeExcludeOrder ( ) { java.lang.String expected = "alonbl@redhat.com" ; filter.clearFilterEntries ( ) ; filter.addFilterEntries ( org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.parse ( ( ( ( ( ( ( ( ( ( ( ( ( ( "" + "include:message1(smtp:" ) + expected ) + ") " ) + "include:message2(smtp:" ) + expected ) + ") " ) + "exclude:message3(smtp:" ) + expected ) + ") " ) + "exclude:message1(smtp:" ) + expected ) + ") " ) + "include:*" ) ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message1" ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message2" ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message3" ) ) ; org.ovirt.engine.core.notifier.filter.AuditLogEvent event = smtp.getEvents ( ) . get ( 0 ) ; java.lang.String name = smtp.getNames ( ) . get ( 0 ) ; org.junit.Assert.assertEquals ( "message1" , event.getName ( ) ) ; org.junit.Assert.assertEquals ( expected , name ) ; event = smtp.getEvents ( ) . get ( 1 ) ; name = smtp.getNames ( ) . get ( 1 ) ; org.junit.Assert.assertEquals ( "message2" , event.getName ( ) ) ; org.junit.Assert.assertEquals ( expected , name ) ; org.junit.Assert.assertEquals ( 2 , smtp.getEvents ( ) . size ( ) ) ; }

Target:
public void testIncludeExcludeOrder ( ) { java.lang.String expected = "alonbl@redhat.com" ; filter.clearFilterEntries ( ) ; filter.addFilterEntries ( org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.parse ( ( ( ( ( ( ( ( ( ( ( ( ( ( "" + "include:message1(smtp:" ) + expected ) + ") " ) + "include:message2(smtp:" ) + expected ) + ") " ) + "exclude:message3(smtp:" ) + expected ) + ") " ) + "exclude:message1(smtp:" ) + expected ) + ") " ) + "include:*" ) ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message1" ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message2" ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message3" ) ) ; org.junit.Assert.assertTrue ( smtp.getEvents ( ) . contains ( ( "message1-->" + expected ) ) ) ; org.junit.Assert.assertTrue ( smtp.getEvents ( ) . contains ( ( "message2-->" + expected ) ) ) ; org.junit.Assert.assertEquals ( 2 , smtp.getEvents ( ) . size ( ) ) ; }
Source:
private void assertEqualsTagsVdsMap ( org.ovirt.engine.core.common.businessentities.TagsVdsMap existing , org.ovirt.engine.core.common.businessentities.TagsVdsMap result ) { org.junit.Assert.assertEquals ( "Tag ID is not equal" , existing.gettag_id ( ) , result.gettag_id ( ) ) ; org.junit.Assert.assertEquals ( "VDS ID is not equal" , existing.getvds_id ( ) , result.getvds_id ( ) ) ; org.junit.Assert.assertEquals ( "Object equation" , existing , result ) ; }

Target:
private void assertEqualsTagsVdsMap ( org.ovirt.engine.core.common.businessentities.TagsVdsMap existing , org.ovirt.engine.core.common.businessentities.TagsVdsMap result ) { org.junit.Assert.assertEquals ( "Tag ID is not equal" , existing.getTagId ( ) , result.getTagId ( ) ) ; org.junit.Assert.assertEquals ( "VDS ID is not equal" , existing.getVdsId ( ) , result.getVdsId ( ) ) ; org.junit.Assert.assertEquals ( "Object equation" , existing , result ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( result.getState ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel ) ( array [ 0 ] ) ) ; boolean localApproveInitiated = ( ( java.lang.Boolean ) ( array [ 1 ] ) ) ; localModel.PostOnSaveInternal ( result.getReturnValue ( ) , localApproveInitiated ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( result.getState ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel ) ( array [ 0 ] ) ) ; boolean localApproveInitiated = ( ( java.lang.Boolean ) ( array [ 1 ] ) ) ; localModel.PostOnSaveInternal ( result.getReturnValue ( ) , localApproveInitiated ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { resource.getParent ( ) . setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.ReportedDevice device = resource.get ( ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDeviceResourceTest.DEVICE_ID.toString ( ) , device.getId ( ) ) ; verifyLinks ( device ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { resource.getParent ( ) . setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.ReportedDevice device = resource.get ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDeviceResourceTest.DEVICE_ID.toString ( ) , device.getId ( ) ) ; verifyLinks ( device ) ; }
Source:
public static void IsLiveStorageMigrationEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters params = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.LiveStorageMigrationEnabled ) ; params.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( params , aQuery ) ; }

Target:
public static void GetVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters ( id ) , aQuery ) ; }
Source:
private void Alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String operation ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.bll.VdsCommand.getVds ( ) . getId ( ) ) ; java.lang.String op = ( operation == null ) ? org.ovirt.engine.core.bll.VdsCommand.getActionType ( ) . name ( ) : operation ; alert.addCustomValue ( "Operation" , op ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.Alert ( alert , logType ) ; }

Target:
private void Alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String operation ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.bll.VdsCommand.getVds ( ) . getId ( ) ) ; java.lang.String op = ( operation == null ) ? org.ovirt.engine.core.bll.VdsCommand.getActionType ( ) . name ( ) : operation ; alert.addCustomValue ( "Operation" , op ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.Alert ( alert , logType , auditLogDirector ) ; }
Source:
private java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActionsImpl ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isInternal , boolean isRunOnlyIfAllValidationPass , boolean isWaitForResult , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { org.ovirt.engine.core.bll.MultipleActionsRunner runner = org.ovirt.engine.core.bll.MultipleActionsRunnersFactory.createMultipleActionsRunner ( actionType , parameters , isInternal , commandContext ) ; runner.setIsRunOnlyIfAllValidatePass ( isRunOnlyIfAllValidationPass ) ; runner.setIsWaitForResult ( isWaitForResult ) ; return runner.execute ( ) ; }

Target:
private java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActionsImpl ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isInternal , boolean isRunOnlyIfAllValidationPass , boolean isWaitForResult , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { org.ovirt.engine.core.bll.MultipleActionsRunner runner = multipleActionsRunnersFactory.createMultipleActionsRunner ( actionType , parameters , isInternal , commandContext ) ; runner.setIsRunOnlyIfAllValidatePass ( isRunOnlyIfAllValidationPass ) ; runner.setIsWaitForResult ( isWaitForResult ) ; return runner.execute ( ) ; }
Source:
private void dontSendTicket ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.SetVmTicketCommand.getVm ( ) ; final org.ovirt.engine.core.common.businessentities.DbUser user = org.ovirt.engine.core.bll.SetVmTicketCommand.getCurrentUser ( ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.log.warnFormat ( "Can\'t give console of virtual machine \"{0}\" to user \"{1}\", it has probably been taken by another user." , vm.getId ( ) , user.getId ( ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_USE_BY_OTHER_USER ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.setSucceeded ( false ) ; }

Target:
private void dontSendTicket ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.SetVmTicketCommand.getVm ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.bll.SetVmTicketCommand.getCurrentUser ( ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.log.warnFormat ( "Can\'t give console of virtual machine \"{0}\" to user \"{1}\", it has probably been taken by another user." , vm.getId ( ) , user.getId ( ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_USE_BY_OTHER_USER ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.setSucceeded ( false ) ; }
Source:
protected org.ovirt.engine.api.model.VM setUpStatisticalExpectations ( ) throws java.lang.Exception { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.setUpStatisticalEntityExpectations ( entity , entity.getStatisticsData ( ) ) ; setUpGetEntityExpectations ( 1 , false , entity ) ; control.replay ( ) ; return entity ; }

Target:
protected void setUpGetEntityExpectations ( int times , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( times , notFound , getEntity ( 0 ) ) ; }
Source:
protected void syncSearch ( ) { org.ovirt.engine.core.common.queries.SearchParameters tempVar = new org.ovirt.engine.core.common.queries.SearchParameters ( "Events: severity=alert" , org.ovirt.engine.core.common.interfaces.SearchType.AuditLog ) ; tempVar.setMaxCount ( getSearchPageSize ( ) ) ; tempVar.setRefresh ( false ) ; org.ovirt.engine.core.common.queries.SearchParameters searchParameters = tempVar ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParameters , new org.ovirt.engine.ui.uicommonweb.models.events.SetItemsAsyncQuery ( ) ) ; }

Target:
protected void syncSearch ( ) { org.ovirt.engine.core.common.queries.SearchParameters tempVar = new org.ovirt.engine.core.common.queries.SearchParameters ( "Events: severity=alert" , org.ovirt.engine.core.common.interfaces.SearchType.AuditLog ) ; tempVar.setMaxCount ( getSearchPageSize ( ) ) ; tempVar.setRefresh ( false ) ; org.ovirt.engine.core.common.queries.SearchParameters searchParameters = tempVar ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( QueryType.Search , searchParameters , new org.ovirt.engine.ui.uicommonweb.models.events.SetItemsAsyncQuery ( ) ) ; }
Source:
public void OnRemove ( ) { for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.Role role = ( ( org.ovirt.engine.core.common.businessentities.Role ) ( item ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveRole , new org.ovirt.engine.core.common.action.RolesParameterBase ( role.getId ( ) ) ) ; } Cancel ( ) ; getSearchCommand ( ) . Execute ( ) ; }

Target:
public void onRemove ( ) { for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.Role role = ( ( org.ovirt.engine.core.common.businessentities.Role ) ( item ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveRole , new org.ovirt.engine.core.common.action.RolesParameterBase ( role.getId ( ) ) ) ; } cancel ( ) ; getSearchCommand ( ) . execute ( ) ; }
Source:
protected void migrateVM ( final org.ovirt.engine.core.common.businessentities.VM vmToMigrate ) { org.ovirt.engine.core.common.action.MigrateVmParameters parameters = new org.ovirt.engine.core.common.action.MigrateVmParameters ( false , vmToMigrate.getId ( ) ) ; parameters.setReason ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessage ( AuditLogType.MIGRATION_REASON_AFFINITY_ENFORCEMENT ) ) ; backend.runInternalAction ( VdcActionType.MigrateVm , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
protected void migrateVM ( final org.ovirt.engine.core.common.businessentities.VM vmToMigrate ) { org.ovirt.engine.core.common.action.MigrateVmParameters parameters = new org.ovirt.engine.core.common.action.MigrateVmParameters ( false , vmToMigrate.getId ( ) ) ; parameters.setReason ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessage ( AuditLogType.MIGRATION_REASON_AFFINITY_ENFORCEMENT ) ) ; backend.runInternalAction ( VdcActionType.BalanceVm , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageDomainStaticDao ( ) ; dynamicDao = dbFacade.getStorageDomainDynamicDao ( ) ; diskImageDao = dbFacade.getDiskImageDao ( ) ; imageDao = dbFacade.getImageDao ( ) ; existingDomain = dao.get ( new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; newStaticDomain.setStorageName ( "NewStorageDomain" ) ; newStaticDomain.setStorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newStaticDomain.setStorageFormat ( StorageFormatType.V1 ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageDomainStaticDao ( ) ; dynamicDao = dbFacade.getStorageDomainDynamicDao ( ) ; diskImageDao = dbFacade.getDiskImageDao ( ) ; imageDao = dbFacade.getImageDao ( ) ; existingDomain = dao.get ( new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; newStaticDomain.setStorageName ( "NewStorageDomain" ) ; newStaticDomain.setStorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; newStaticDomain.setStorageFormat ( StorageFormatType.V1 ) ; newStaticDomain.setWipeAfterDelete ( true ) ; }
Source:
public void run ( ) { try { backend.RunAction ( task , sp ) ; } finally { if ( ( user ) != null ) { backend.Logoff ( sh.sessionize ( new org.ovirt.engine.core.common.action.LogoutUserParameters ( user.getId ( ) ) ) ) ; } sh.clean ( ) ; } }

Target:
public void run ( ) { try { backend.RunAction ( task , sp ) ; } finally { if ( ( user ) != null ) { backend.logoff ( sh.sessionize ( new org.ovirt.engine.core.common.action.LogoutUserParameters ( user.getId ( ) ) ) ) ; } sh.clean ( ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.NetworkView mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.NetworkView entity = super . mapRow ( rs , rowNum ) ; entity.setStoragePoolName ( rs.getString ( "storage_pool_name" ) ) ; entity.setCompatabilityVersion ( new org.ovirt.engine.core.compat.Version ( rs.getString ( "compatibility_version" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.NetworkView mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.NetworkView entity = super . mapRow ( rs , rowNum ) ; entity.setStoragePoolName ( rs.getString ( "storage_pool_name" ) ) ; entity.setCompatabilityVersion ( new org.ovirt.engine.core.compat.Version ( rs.getString ( "compatibility_version" ) ) ) ; return entity ; }
Source:
public static void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void isAnyHostUpInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( ( source != null ) && ( ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ) ) { return true ; } return false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , 1 ) ; }
Source:
private void cancel ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel windowModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel > currentModels = windowModel.getCurrentProxies ( ) ; java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel > items = currentModels.getItems ( ) ; currentModels.setItems ( null ) ; items.remove ( this ) ; currentModels.setItems ( items ) ; setWindow ( null ) ; }

Target:
private void cancel ( ) { setWindow ( null ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.FenceProxyModel > currentModels = currentProxies.getItemsAsList ( ) ; currentModels.remove ( this ) ; currentProxies.setItems ( java.util.Collections.emptyList ( ) ) ; currentProxies.setItems ( currentModels ) ; }
Source:
protected void setUpGetEntityExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllVmSnapshotsByVmId , org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendSnapshotsResourceTest.VM_ID } , getEntities ( ) ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllVmSnapshotsByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendSnapshotsResourceTest.VM_ID } , getEntities ( ) ) ; } }
Source:
protected void setBallooning ( org.ovirt.engine.api.model.VM vm ) { java.lang.Boolean balloonEnabled = getEntity ( java.lang.Boolean.class , VdcQueryType.IsBalloonEnabled , new org.ovirt.engine.core.common.queries.IdQueryParameters ( new org.ovirt.engine.core.compat.Guid ( vm.getId ( ) ) ) , null , true ) ; if ( ! ( vm.isSetMemoryPolicy ( ) ) ) { vm.setMemoryPolicy ( new org.ovirt.engine.api.model.MemoryPolicy ( ) ) ; } vm.getMemoryPolicy ( ) . setBallooning ( balloonEnabled ) ; }

Target:
protected void setBallooning ( org.ovirt.engine.api.model.Vm vm ) { java.lang.Boolean balloonEnabled = getEntity ( java.lang.Boolean.class , VdcQueryType.IsBalloonEnabled , new org.ovirt.engine.core.common.queries.IdQueryParameters ( new org.ovirt.engine.core.compat.Guid ( vm.getId ( ) ) ) , null , true ) ; if ( ! ( vm.isSetMemoryPolicy ( ) ) ) { vm.setMemoryPolicy ( new org.ovirt.engine.api.model.MemoryPolicy ( ) ) ; } vm.getMemoryPolicy ( ) . setBallooning ( balloonEnabled ) ; }