auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testSaveOrUpdateNew ( ) { int sizeBeforeSave = dao.getAll ( ) . size ( ) ; dao.saveOrUpdate ( newUser ) ; org.ovirt.engine.core.common.businessentities.DbUser result = dao.getByUsername ( newUser.getLoginName ( ) ) ; int sizeAfterSave = dao.getAll ( ) . size ( ) ; org.junit.Assert.assertEquals ( newUser , result ) ; org.junit.Assert.assertEquals ( 1 , ( sizeAfterSave - sizeBeforeSave ) ) ; }

Target:
public void testSaveOrUpdateNew ( ) { int sizeBeforeSave = dao.getAll ( ) . size ( ) ; dao.saveOrUpdate ( newUser ) ; org.ovirt.engine.core.common.businessentities.DbUser result = dao.getByUsernameAndDomain ( newUser.getLoginName ( ) , newUser.getDomain ( ) ) ; int sizeAfterSave = dao.getAll ( ) . size ( ) ; org.junit.Assert.assertEquals ( newUser , result ) ; org.junit.Assert.assertEquals ( 1 , ( sizeAfterSave - sizeBeforeSave ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isCinderHasNoImages ( org.ovirt.engine.core.compat.Guid storageDomainId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > cinderDisks = diskImageDao.getAllForStorageDomain ( storageDomainId ) ; if ( ! ( cinderDisks.isEmpty ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ERROR_CANNOT_DETACH_CINDER_PROVIDER_WITH_IMAGES ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isCinderHasNoImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > cinderDisks = diskImageDao.getAllForStorageDomain ( getStorageDomain ( ) . getId ( ) ) ; if ( ! ( cinderDisks.isEmpty ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ERROR_CANNOT_DETACH_CINDER_PROVIDER_WITH_IMAGES ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected void performLogin ( T loginModel ) { org.ovirt.engine.core.common.businessentities.DbUser loggedUser = loginModel.getLoggedUser ( ) ; java.lang.String loginPassword = loginModel.getPassword ( ) . getEntity ( ) ; frontend.initLoggedInUser ( loggedUser , loginPassword ) ; beforeUiCommonInitEvent ( loginModel ) ; org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent.fire ( eventBus ) ; user.onUserLogin ( loggedUser ) ; loginModel.getPassword ( ) . setEntity ( null ) ; }

Target:
protected void performLogin ( T loginModel ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser loggedUser = loginModel.getLoggedUser ( ) ; java.lang.String loginPassword = loginModel.getPassword ( ) . getEntity ( ) ; beforeLogin ( loginModel ) ; frontend.initLoggedInUser ( loggedUser , loginPassword ) ; user.onUserLogin ( loggedUser ) ; loginModel.getPassword ( ) . setEntity ( null ) ; }
Source:
protected java.util.List < org.ovirt.engine.api.model.Network > getClusterNetworks ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( org.ovirt.engine.core.common.businessentities.VDS.class , VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( getHostId ( ) ) ) , "Host" ) ; return getEntity ( java.util.List.class , VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vds.getvds_group_id ( ) ) , "Networks" ) ; }

Target:
protected java.util.List < org.ovirt.engine.api.model.Network > getClusterNetworks ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( org.ovirt.engine.core.common.businessentities.VDS.class , VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( getHostId ( ) ) ) , "Host" ) ; return getEntity ( java.util.List.class , VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vds.getVdsGroupId ( ) ) , "Networks" ) ; }
Source:
public void fetchEngineSshPublicKey ( ) { org.ovirt.engine.ui.frontend.AsyncQuery aQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; aQuery.setModel ( this ) ; aQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String pk = ( ( java.lang.String ) ( result ) ) ; if ( ( pk != null ) && ( ( pk.length ( ) ) > 0 ) ) { getPublicKey ( ) . setEntity ( pk ) ; } } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getEngineSshPublicKey ( aQuery ) ; }

Target:
public void fetchEngineSshPublicKey ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getEngineSshPublicKey ( new org.ovirt.engine.ui.uicommonweb.models.hosts.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.lang.String > ( ) { @ java.lang.Override public void onSuccess ( java.lang.String pk ) { if ( ( pk != null ) && ( ( pk.length ( ) ) > 0 ) ) { getPublicKey ( ) . setEntity ( pk ) ; } } } ) ) ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.ImageActionsVDSCommandParameters getImageActionsParameters ( org.ovirt.engine.core.compat.Guid vdsId ) { return new org.ovirt.engine.core.common.vdscommands.ImageActionsVDSCommandParameters ( vdsId , org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getImage ( ) . getImage ( ) . getDiskId ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getImage ( ) . getImageId ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.ImageActionsVDSCommandParameters getImageActionsParameters ( org.ovirt.engine.core.compat.Guid vdsId ) { return new org.ovirt.engine.core.common.vdscommands.ImageActionsVDSCommandParameters ( vdsId , org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getImage ( ) . getImage ( ) . getDiskId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getImage ( ) . getImageId ( ) ) ; }
Source:
protected java.util.List < java.lang.String > listFiles ( ) { org.ovirt.engine.core.common.queries.GetImagesListParameters queryParams = new org.ovirt.engine.core.common.queries.GetImagesListParameters ( asGuid ( storageDomainId ) , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All ) ; queryParams.setForceRefresh ( true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > files = getBackendCollection ( org.ovirt.engine.core.common.businessentities.storage.RepoImage.class , QueryType.GetImagesList , queryParams ) ; return files.stream ( ) . map ( RepoImage :: getRepoImageId ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }

Target:
protected java.util.List < java.lang.String > listFiles ( ) { org.ovirt.engine.core.common.queries.GetImagesListParameters queryParams = new org.ovirt.engine.core.common.queries.GetImagesListParameters ( asGuid ( storageDomainId ) , org.ovirt.engine.core.common.businessentities.storage.ImageFileType.All ) ; java.lang.Boolean forceRefresh = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendFilesResource.FORCE_REFRESH , null , null ) ; queryParams.setForceRefresh ( forceRefresh ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > files = getBackendCollection ( org.ovirt.engine.core.common.businessentities.storage.RepoImage.class , QueryType.GetImagesList , queryParams ) ; return files.stream ( ) . map ( RepoImage :: getRepoImageId ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
private void handleDomainAlreadyExists ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storages ) { java.lang.String storageName = storages.get ( 0 ) . getStorageName ( ) ; onFinish ( storageListModel.context , false , storageListModel.storageModel , org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . createFailedDomainAlreadyExistStorageMsg ( storageName ) ) ; }

Target:
private void setUpdateOvfsCommand ( org.ovirt.engine.ui.uicommonweb.UICommand value ) { updateOvfsCommand = value ; }
Source:
public static void GetHighUtilizationForEvenDistribution ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.HighUtilizationForEvenlyDistribute , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static 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.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
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.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
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 ) ; }
Source:
public static void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
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.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
protected static org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode createGlusterRoleTree ( ) { return new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . glusterRoleTree ( ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . configureVolumesRoleTree ( ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode [ ] { new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToCreateGlusterVolumesRoleTree ( ) ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.core.common.businessentities.ActionGroup.DELETE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToDeleteGlusterVolumesRoleTree ( ) ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.core.common.businessentities.ActionGroup.MANIPULATE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToManipulateGlusterVolumesRoleTree ( ) ) } ) ) ; }

Target:
protected static org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode createGlusterRoleTree ( ) { return new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . volumeRoleTree ( ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . configureVolumesRoleTree ( ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode [ ] { new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToCreateGlusterVolumesRoleTree ( ) ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.core.common.businessentities.ActionGroup.DELETE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToDeleteGlusterVolumesRoleTree ( ) ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.core.common.businessentities.ActionGroup.MANIPULATE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToManipulateGlusterVolumesRoleTree ( ) ) } ) ) ; }
Source:
private org.ovirt.engine.core.bll.network.macpool.MacPool createPoolWithoutLocking ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { if ( macPools.containsKey ( macPool.getId ( ) ) ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerDc.UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST ) ; } org.ovirt.engine.core.bll.network.macpool.MacPool poolForScope = new org.ovirt.engine.core.bll.network.macpool.MacPoolUsingRanges ( macPoolToRanges ( macPool ) , macPool.isAllowDuplicateMacAddresses ( ) ) ; macPools.put ( macPool.getId ( ) , poolForScope ) ; return poolForScope ; }

Target:
private org.ovirt.engine.core.bll.network.macpool.MacPool createPoolInternal ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { if ( macPools.containsKey ( macPool.getId ( ) ) ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerDc.UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST ) ; } org.ovirt.engine.core.bll.network.macpool.MacPool poolForScope = new org.ovirt.engine.core.bll.network.macpool.MacPoolUsingRanges ( macPoolToRanges ( macPool ) , macPool.isAllowDuplicateMacAddresses ( ) ) ; macPools.put ( macPool.getId ( ) , new org.ovirt.engine.core.bll.network.macpool.MacPoolLockingProxy ( poolForScope ) ) ; return poolForScope ; }
Source:
public static java.util.Date GetDefaultPoolLeaseStartTime ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.uicommonweb.DataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VmPoolLeaseStartTime ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { return new java.util.Date ( java.util.Date.parse ( ( ( java.lang.String ) ( returnValue.getReturnValue ( ) ) ) ) ) ; } return new java.util.Date ( ) ; }

Target:
public static java.util.Date GetDefaultPoolLeaseStartTime ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.uicommonweb.DataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VmPoolLeaseStartTime , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { return new java.util.Date ( java.util.Date.parse ( ( ( java.lang.String ) ( returnValue.getReturnValue ( ) ) ) ) ) ; } return new java.util.Date ( ) ; }
Source:
protected void loadPayload ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > disks = vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice disk : disks ) { if ( ( disk.isManaged ( ) ) && ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( disk.getSpecParams ( ) ) ) ) { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setVmPayload ( new org.ovirt.engine.core.common.businessentities.VmPayload ( disk ) ) ; break ; } } }

Target:
protected void loadPayload ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > disks = vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice disk : disks ) { if ( ( disk.isManaged ( ) ) && ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( disk.getSpecParams ( ) ) ) ) { vmPayload = new org.ovirt.engine.core.common.businessentities.VmPayload ( disk ) ; break ; } } }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase addVmFromScratch ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.AddVmFromScratchParameters parameters = new org.ovirt.engine.core.common.action.AddVmFromScratchParameters ( vmStatic , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getDiskInfoList ( ) , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getStorageDomainId ( ) ) ; parameters.setSessionId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getSessionId ( ) ) ; parameters.setDontAttachToDefaultTag ( true ) ; return runInternalActionWithTasksContext ( VdcActionType.AddVmFromScratch , parameters ) ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase addVmFromScratch ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.AddVmParameters parameters = new org.ovirt.engine.core.common.action.AddVmParameters ( vmStatic , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getDiskInfoList ( ) , org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getStorageDomainId ( ) ) ; parameters.setSessionId ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getSessionId ( ) ) ; parameters.setDontAttachToDefaultTag ( true ) ; return runInternalActionWithTasksContext ( VdcActionType.AddVmFromScratch , parameters ) ; }
Source:
public void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getRoleList ( 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.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getMigrationPolicies ( 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 returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( returnValue == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.migration.MigrationPolicy > ( ) ; } return returnValue ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllMigrationPolicies , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public int getavailableMacsCount ( ) { return availableMacs.size ( ) ; }

Target:
public int getAvailableMacsCount ( ) { lockObj.readLock ( ) . lock ( ) ; try { if ( ! ( initialized ) ) { logInitializationError ( "Failed to get available Macs count." ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.MAC_POOL_NOT_INITIALIZED ) ; } int availableMacsSize = availableMacs.size ( ) ; org.ovirt.engine.core.bll.network.MacPoolManager.log.debugFormat ( "Number of available Mac addresses = {0}" , availableMacsSize ) ; return availableMacsSize ; } finally { lockObj.readLock ( ) . unlock ( ) ; } }
Source:
public void testQueryFailsIfPeerExists ( ) { mockQueryParameters ( org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.NEW_SERVER , org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.PASSWORD ) ; org.mockito.Mockito.doReturn ( getVdsStatic ( ) ) . when ( vdsStaticDao ) . getByHostName ( org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.SERVER_NAME1 ) ; try { getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.fail ( "Query didn't fail when one or more peers already exist(s)!" ) ; } catch ( java.lang.RuntimeException e ) { org.junit.Assert.assertEquals ( EngineMessage.SERVER_ALREADY_EXISTS_IN_ANOTHER_CLUSTER.toString ( ) , e.getMessage ( ) ) ; } }

Target:
public void testQueryFailsIfPeerExists ( ) { mockQueryParameters ( org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.NEW_SERVER , org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.PASSWORD ) ; org.mockito.Mockito.doReturn ( getVdsStatic ( ) ) . when ( vdsStaticDao ) . getByHostName ( org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.SERVER_NAME1 ) ; expectedException.expectMessage ( EngineMessage.SERVER_ALREADY_EXISTS_IN_ANOTHER_CLUSTER.toString ( ) ) ; getQuery ( ) . executeQueryCommand ( ) ; }
Source:
public void onSuccess ( java.lang.Object model1 , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > vdsList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; if ( ( vdsList.size ( ) ) > 0 ) { clusterModel.getEnableTrustedService ( ) . setIsChangable ( false ) ; clusterModel.getEnableTrustedService ( ) . setInfo ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . trustedServiceDisabled ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model1 , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > vdsList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; if ( ( vdsList.size ( ) ) > 0 ) { clusterModel.getEnableTrustedService ( ) . setIsChangable ( false ) ; clusterModel.getEnableTrustedService ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . trustedServiceDisabled ( ) ) ; } }
Source:
private void removeVmImages ( ) { java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > imageParams = org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getParameters ( ) . getImagesParameters ( ) ; for ( org.ovirt.engine.core.common.action.VdcActionParametersBase param : imageParams ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageToRemoveByParam ( ( ( org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ) ( param ) ) ) ; if ( diskImage != null ) { org.ovirt.engine.core.bll.ImagesHandler.removeDiskImage ( diskImage , org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getVmId ( ) ) ; } } }

Target:
private void removeVmImages ( ) { java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > imageParams = org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getParameters ( ) . getImagesParameters ( ) ; for ( org.ovirt.engine.core.common.action.VdcActionParametersBase param : imageParams ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImageToRemoveByParam ( ( ( org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ) ( param ) ) ) ; if ( diskImage != null ) { org.ovirt.engine.core.bll.ImagesHandler.removeDiskImage ( diskImage , org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getVmId ( ) ) ; } } }
Source:
public static void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public static void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private void removeMemory ( final org.ovirt.engine.core.common.businessentities.Snapshot snapshot ) { boolean success = removeMemoryVolumes ( snapshot.getMemoryVolume ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getActionType ( ) , false ) ; if ( ! success ) { log.errorFormat ( "Cannot remove memory volumes for snapshot {0}" , snapshot.getId ( ) ) ; } }

Target:
private void removeMemory ( final org.ovirt.engine.core.common.businessentities.Snapshot snapshot , boolean useTaskManager ) { org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters parameters = new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( snapshot.getMemoryVolume ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) ; if ( useTaskManager ) { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.executeAsyncCommand ( VdcActionType.RemoveMemoryVolumes , parameters , org.ovirt.engine.core.bll.RemoveSnapshotCommand.cloneContextAndDetachFromParent ( ) ) ; } else { org.ovirt.engine.core.common.action.VdcReturnValueBase ret = runInternalAction ( VdcActionType.RemoveMemoryVolumes , parameters ) ; if ( ! ( ret.getSucceeded ( ) ) ) { log.errorFormat ( "Cannot remove memory volumes for snapshot {0}" , snapshot.getId ( ) ) ; } } }
Source:
public void testTicket ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.SetVmTicket , org.ovirt.engine.core.common.action.SetVmTicketParameters.class , new java.lang.String [ ] { "VmId" , "Ticket" } , new java.lang.Object [ ] { GUIDS [ 0 ] , NAMES [ 1 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setTicket ( new org.ovirt.engine.api.model.Ticket ( ) ) ; action.getTicket ( ) . setValue ( NAMES [ 1 ] ) ; verifyActionResponse ( resource.ticket ( action ) ) ; }

Target:
public void testTicket ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.SetVmTicket , org.ovirt.engine.core.common.action.SetVmTicketParameters.class , new java.lang.String [ ] { "VmId" , "Ticket" } , new java.lang.Object [ ] { GUIDS [ 0 ] , NAMES [ 1 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setTicket ( new org.ovirt.engine.api.model.Ticket ( ) ) ; action.getTicket ( ) . setValue ( NAMES [ 1 ] ) ; verifyActionResponse ( resource.ticket ( action ) ) ; }
Source:
protected void proccessDisksDomains ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks ) { if ( disks.isEmpty ( ) ) { proccessedDomains.addAll ( activeDataDomainsIds ) ; return ; } for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { proccessedDomains.addAll ( disk.getStorageIds ( ) ) ; } }

Target:
protected void proccessDisksDomains ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks ) { if ( disks.isEmpty ( ) ) { proccessedDomains.addAll ( activeDataDomainsIds ) ; return ; } for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { proccessedDomains.addAll ( disk.getStorageIds ( ) ) ; } }
Source:
public void update ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster cluster ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , cluster.getClusterId ( ) ) . addValue ( "network_id" , cluster.getNetworkId ( ) ) . addValue ( "status" , cluster.getStatus ( ) ) . addValue ( "is_display" , cluster.isDisplay ( ) ) . addValue ( "required" , cluster.isRequired ( ) ) . addValue ( "migration" , cluster.isMigration ( ) ) ; getCallsHandler ( ) . executeModification ( "Updatenetwork_cluster" , parameterSource ) ; }

Target:
public void update ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster cluster ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = createAllFieldsParameterSource ( cluster ) ; getCallsHandler ( ) . executeModification ( "Updatenetwork_cluster" , parameterSource ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.ExternalNetworkProviderConfiguration model , int index ) { assertEquals ( org.ovirt.engine.api.restapi.utils.HexUtils.string2hex ( GUIDS [ index ] . toString ( ) ) , model.getId ( ) ) ; assertEquals ( GUIDS [ ( index + 1 ) ] . toString ( ) , model.getHost ( ) . getId ( ) ) ; assertEquals ( GUIDS [ index ] . toString ( ) , model.getExternalNetworkProvider ( ) . getId ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.ExternalNetworkProviderConfiguration model , int index ) { org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.utils.HexUtils.string2hex ( GUIDS [ index ] . toString ( ) ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( GUIDS [ ( index + 1 ) ] . toString ( ) , model.getHost ( ) . getId ( ) ) ; org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getExternalNetworkProvider ( ) . getId ( ) ) ; verifyLinks ( model ) ; }
Source:
public void appendCustomValueAppendsWithNull ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final java.lang.String key = "foo" ; final java.lang.String value = null ; final java.lang.String newVal = "bar" ; final java.lang.String sep = "_" ; b.addCustomValue ( key , value ) ; b.appendCustomValue ( key , newVal , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( ( ( value + sep ) + newVal ) , s ) ; }

Target:
public void appendCustomValue ( ) { final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String sep = "_" ; b.appendCustomValue ( key , value , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , s ) ; }
Source:
private void UpdateStorageDomainCells ( ) { java.lang.Boolean isSingleDestStorage = ( ( java.lang.Boolean ) ( object.getIsSingleDestStorage ( ) . getEntity ( ) ) ) ; java.lang.String toolTip = ( isSingleDestStorage ) ? "" : constants.importVmTemplateSingleStorageCheckedLabel ( ) ; if ( ( customSelectionCellStorageDomain ) != null ) { customSelectionCellStorageDomain.setEnabledWithToolTip ( ( ! isSingleDestStorage ) , toolTip ) ; } diskTable.edit ( object.getImportDiskListModel ( ) ) ; }

Target:
public void update ( int index , org.ovirt.engine.core.common.businessentities.DiskImage disk , java.lang.String value ) { object.getDiskImportData ( disk.getId ( ) ) . setSelectedQuotaString ( value ) ; }
Source:
private static void mockConfigVals ( ) { org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLocalDisksLowFreeSpace ) ) . thenReturn ( 0 ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLocalDisksCriticallyLowFreeSpace ) ) . thenReturn ( 0 ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsRefreshRate ) ) . thenReturn ( 3000 ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.TimeToReduceFailedRunOnVdsInMinutes ) ) . thenReturn ( 30 ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsRecoveryTimeoutInMintues ) ) . thenReturn ( 3 ) ; }

Target:
protected void auditLog ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { org.ovirt.engine.core.common.businessentities.AuditLog al = new org.ovirt.engine.core.common.businessentities.AuditLog ( ) ; al.setlog_type ( logType ) ; mockAuditLogDao.save ( al ) ; }
Source:
private void changeIsAttached ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkManageModel , java.lang.Boolean value ) { clusterNetworkManageModel.setAttached ( value ) ; if ( ( ! value ) && ( clusterNetworkManageModel.isDisplayNetwork ( ) ) ) { clusterNetworkManageModel.setDisplayNetwork ( false ) ; } if ( ( ! value ) && ( clusterNetworkManageModel.isRequired ( ) ) ) { clusterNetworkManageModel.setRequired ( false ) ; } }

Target:
private void changeIsAttached ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel , java.lang.Boolean value ) { clusterNetworkModel.setAttached ( value ) ; if ( ( ! value ) && ( clusterNetworkModel.isDisplayNetwork ( ) ) ) { clusterNetworkModel.setDisplayNetwork ( false ) ; } if ( ( ! value ) && ( clusterNetworkModel.isRequired ( ) ) ) { clusterNetworkModel.setRequired ( false ) ; } }
Source:
public void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getSpiceUsbAutoShare ( 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void extractBondIfModified ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.String bondName ) { if ( ! ( bonds.containsKey ( bondName ) ) ) { bonds.put ( bondName , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ) ) ; } if ( interfaceWasModified ( iface ) ) { modifiedBonds.put ( bondName , iface ) ; } }

Target:
private void extractBondIfModified ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.String bondName ) { if ( ! ( bonds.containsKey ( bondName ) ) ) { bonds.put ( bondName , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ) ) ; } if ( bondWasModified ( iface ) ) { modifiedBonds.put ( bondName , iface ) ; } }
Source:
protected void executeCommand ( ) { try { addVmToDb ( ) ; processImages ( ) ; if ( getReturnValue ( ) . getVdsmTaskIdList ( ) . isEmpty ( ) ) { endVmRelatedOps ( ) ; } org.ovirt.engine.core.bll.VmHandler.addVmInitToDB ( getVm ( ) . getStaticData ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMacs ( macsAdded ) ; throw e ; } org.ovirt.engine.core.bll.ImportVmCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { try { addVmToDb ( ) ; processImages ( ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.isImagesAlreadyOnTarget ( ) ) ) ) ; if ( getReturnValue ( ) . getVdsmTaskIdList ( ) . isEmpty ( ) ) { endVmRelatedOps ( ) ; } org.ovirt.engine.core.bll.VmHandler.addVmInitToDB ( getVm ( ) . getStaticData ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.ImportVmCommand.getMacPool ( ) . freeMacs ( macsAdded ) ; throw e ; } org.ovirt.engine.core.bll.ImportVmCommand.setSucceeded ( true ) ; }
Source:
protected boolean checkSingleQxlDisplay ( ) { if ( ! ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getSingleQxlPci ( ) ) ) { return true ; } return org.ovirt.engine.core.bll.VmHandler.isSingleQxlDeviceLegal ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getDefaultDisplayType ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getOs ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; }

Target:
protected boolean checkSingleQxlDisplay ( ) { if ( ! ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getSingleQxlPci ( ) ) ) { return true ; } return org.ovirt.engine.core.bll.VmHandler.isSingleQxlDeviceLegal ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getDefaultDisplayType ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getOs ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getValidationMessages ( ) , org.ovirt.engine.core.bll.AddVmCommand.getEffectiveCompatibilityVersion ( ) ) ; }
Source:
private com.google.gwt.user.client.ui.HorizontalPanel createSyncPanel ( final org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails networkImplementationDetails ) { com.google.gwt.user.client.ui.HorizontalPanel output = new com.google.gwt.user.client.ui.HorizontalPanel ( ) ; boolean sync = ( networkImplementationDetails == null ) ? true : networkImplementationDetails.isInSync ( ) ; if ( ! sync ) { output.add ( new com.google.gwt.user.client.ui.Image ( org.ovirt.engine.ui.webadmin.widget.host.VLanElementPanel.resources.networkNotSyncImage ( ) ) ) ; } return output ; }

Target:
private com.google.gwt.user.client.ui.HorizontalPanel createSyncPanel ( final org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails networkImplementationDetails ) { com.google.gwt.user.client.ui.HorizontalPanel output = new com.google.gwt.user.client.ui.HorizontalPanel ( ) ; boolean managed = false ; boolean sync = false ; if ( networkImplementationDetails != null ) { managed = networkImplementationDetails.isManaged ( ) ; sync = networkImplementationDetails.isInSync ( ) ; } if ( managed && ( ! sync ) ) { output.add ( new com.google.gwt.user.client.ui.Image ( org.ovirt.engine.ui.webadmin.widget.host.VLanElementPanel.resources.networkNotSyncImage ( ) ) ) ; } return output ; }
Source:
private void assertCorrectResultForTemplate ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.TEMPLATE_ID , iface.getVmTemplateId ( ) ) ; } }

Target:
private void assertCorrectResultForTemplate ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > result ) { org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : result ) { org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.TEMPLATE_ID , iface.getVmTemplateId ( ) ) ; } }
Source:
public void lunDiskInvalid ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createVds ( ) ; setupForLun ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( luns ) . when ( lunValidator ) . executeGetDeviceList ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.StorageType.class ) ) ; org.junit.Assert.assertThat ( lunValidator.isLunDiskVisible ( lunDisk.getLun ( ) , vds ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISK_LUN_INVALID ) ) ; }

Target:
public void lunDiskInvalid ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createVds ( ) ; setupForLun ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( luns ) . when ( lunValidator ) . executeGetDeviceList ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.StorageType.class ) , org.mockito.Matchers.any ( java.lang.String.class ) ) ; org.junit.Assert.assertThat ( lunValidator.isLunDiskVisible ( lunDisk.getLun ( ) , vds ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISK_LUN_INVALID ) ) ; }