auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel getModel ( ) { return getCommonModel ( ) . getClusterList ( ) . getCpuProfileListModel ( ) . getPermissionListModel ( ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand.equals ( getModel ( ) . getAddCommand ( ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc prepareMerge ( java.lang.String spUUID , java.lang.String jobUUID , java.util.Map < java.lang.String , java.lang.String > subchainInfo ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.prepare_merge" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "job_id" , jobUUID ) . withParameter ( "subchain_info" , subchainInfo ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn prepareMerge ( java.lang.String spUUID , java.util.Map < java.lang.String , java.lang.String > subchainInfo ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StoragePool.prepareMerge" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "subchainInfo" , subchainInfo ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturn ( response ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue currentVmsInPoolQuery = runInternalQuery ( VdcQueryType.GetAllPoolVms , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getVmPool ( ) . getVmPoolId ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > poolVmsBeforeAdd = ( currentVmsInPoolQuery.getSucceeded ( ) ) ? currentVmsInPoolQuery.< java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) : null ; super . executeCommand ( ) ; org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getCompensationContext ( ) . cleanupCompensationDataAfterSuccessfulCommand ( ) ; if ( org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getSucceeded ( ) ) { updatePoolVms ( poolVmsBeforeAdd ) ; } vmPoolMonitor.triggerPoolMonitoringJob ( ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue currentVmsInPoolQuery = runInternalQuery ( VdcQueryType.GetAllPoolVms , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.bll.UpdateVmPoolCommand.getVmPool ( ) . getVmPoolId ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > poolVmsBeforeAdd = ( currentVmsInPoolQuery.getSucceeded ( ) ) ? currentVmsInPoolQuery.< java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) : null ; super . executeCommand ( ) ; org.ovirt.engine.core.bll.UpdateVmPoolCommand.getCompensationContext ( ) . cleanupCompensationDataAfterSuccessfulCommand ( ) ; if ( org.ovirt.engine.core.bll.UpdateVmPoolCommand.getSucceeded ( ) ) { updatePoolVms ( poolVmsBeforeAdd ) ; } vmPoolMonitor.triggerPoolMonitoringJob ( ) ; }
Source:
private void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpGetEntityExpectations ( QueryType.GetImageById , org.ovirt.engine.core.common.queries.GetImageByIdParameters.class , new java.lang.String [ ] { "RepoImageId" } , new java.lang.Object [ ] { GUIDS [ 1 ] . toString ( ) } , ( notFound ? null : getEntity ( 1 ) ) ) ; }

Target:
private void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpGetEntityExpectations ( QueryType.GetImageById , org.ovirt.engine.core.common.queries.GetImageByIdParameters.class , new java.lang.String [ ] { "RepoImageId" } , new java.lang.Object [ ] { GUIDS [ 1 ] . toString ( ) } , ( notFound ? null : getEntity ( 1 ) ) ) ; }
Source:
public boolean isManagementNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > networkClusters = networkClusterDao.getAllForNetwork ( networkId ) ; final org.ovirt.engine.core.common.businessentities.network.NetworkCluster managementNetworkCluster = org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( networkClusters , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster ) { return networkCluster.isManagement ( ) ; } } ) ; return managementNetworkCluster != null ; }

Target:
public boolean isManagementNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > networkClusters = networkClusterDao.getAllForNetwork ( networkId ) ; return networkClusters.stream ( ) . anyMatch ( NetworkCluster :: isManagement ) ; }
Source:
private org.ovirt.engine.core.compat.Guid createMemoryDumpDisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage image = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; image.setDiskAlias ( java.lang.String.format ( "%s_hibernation_dump" , org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getName ( ) ) ) ; image.setDescription ( "memory dump for hibernated VM" ) ; image.setSize ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getTotalMemorySizeInBytes ( ) ) ; image.setVolumeType ( getMemoryVolumeType ( ) ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; image.setDiskInterface ( DiskInterface.VirtIO ) ; return addDisk ( image ) ; }

Target:
private void addMemoryDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage memoryDisk = org.ovirt.engine.core.bll.memory.MemoryUtils.createMemoryDiskForVm ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) , org.ovirt.engine.core.bll.HibernateVmCommand.getStorageDomain ( ) . getStorageType ( ) ) ; addDisk ( memoryDisk ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult hotUpdatePossible ( ) { if ( ( getRequiredAction ( ) ) == ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UPDATE_VM_DEVICE ) ) { if ( ! ( org.ovirt.engine.core.bll.validator.FeatureSupported.networkLinking ( version ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.HOT_VM_INTERFACE_UPDATE_IS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.clusterVersion ( ) ) ; } else if ( nic.isPortMirroring ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.CANNOT_PERFOM_HOT_UPDATE_WITH_PORT_MIRRORING ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult hotUpdatePossible ( ) { if ( ( getRequiredAction ( ) ) == ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UPDATE_VM_DEVICE ) ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.networkLinking ( version ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.HOT_VM_INTERFACE_UPDATE_IS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.clusterVersion ( ) ) ; } else if ( nic.isPortMirroring ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.CANNOT_PERFOM_HOT_UPDATE_WITH_PORT_MIRRORING ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getDriveSpecs ( ) { java.util.Map < java.lang.String , java.lang.String > driveSpecs = new java.util.HashMap < > ( ) ; driveSpecs.put ( "poolID" , getStoragePoolId ( ) . toString ( ) ) ; driveSpecs.put ( "domainID" , getStorageDomainId ( ) . toString ( ) ) ; driveSpecs.put ( "imageID" , getImageGroupId ( ) . toString ( ) ) ; driveSpecs.put ( "volumeID" , getImageId ( ) . toString ( ) ) ; return driveSpecs ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getDriveSpecs ( ) { return org.ovirt.engine.core.common.utils.PDIVMapBuilder.create ( ) . setPoolId ( getStoragePoolId ( ) ) . setDomainId ( getStorageDomainId ( ) ) . setImageGroupId ( getImageGroupId ( ) ) . setVolumeId ( getImageId ( ) ) . build ( ) ; }
Source:
public void guestLogoutTimeTreatmentAfterDestroy ( ) { if ( ( ( getguest_last_login_time ( ) ) != null ) && ( ( ( getguest_last_logout_time ( ) ) == null ) || ( ( getguest_last_login_time ( ) . compareTo ( getguest_last_logout_time ( ) ) ) > 0 ) ) ) { setguest_last_logout_time ( new java.util.Date ( ) ) ; } }

Target:
public double getDiskSize ( ) { if ( ( diskSize ) == 0 ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : getDiskMap ( ) . values ( ) ) { if ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) == ( disk.getDiskStorageType ( ) ) ) { diskSize += ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) . getsize ( ) ) / ( java.lang.Double.valueOf ( ( ( 1024 * 1024 ) * 1024 ) ) ) ; } } } return diskSize ; }
Source:
private org.ovirt.engine.core.bll.AddVmFromTemplateCommand < org.ovirt.engine.core.common.action.AddVmFromTemplateParameters > setupCanAddVmFromTemplateTests ( final int domainSizeGB , final int sizeRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; org.ovirt.engine.core.bll.AddVmFromTemplateCommand < org.ovirt.engine.core.common.action.AddVmFromTemplateParameters > cmd = createVmFromTemplateCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; return cmd ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > generateDisksList ( int size ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < size ; ++ i ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disksList.add ( diskImage ) ; } return disksList ; }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue restartGlusterd ( org.ovirt.engine.core.compat.Guid serverId ) { getCustomValues ( ) . put ( GlusterConstants.VDS_NAME , getVdsDAO ( ) . get ( serverId ) . getName ( ) ) ; org.ovirt.engine.core.common.vdscommands.gluster.GlusterServiceVDSParameters params = new org.ovirt.engine.core.common.vdscommands.gluster.GlusterServiceVDSParameters ( serverId , java.util.Collections.singletonList ( "glusterd" ) , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_RESTART ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue restartGlusterdReturnValue = runVdsCommand ( VDSCommandType.ManageGlusterService , params ) ; return restartGlusterdReturnValue ; }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue restartGlusterd ( org.ovirt.engine.core.compat.Guid serverId ) { getCustomValues ( ) . put ( GlusterConstants.VDS_NAME , getVdsDao ( ) . get ( serverId ) . getName ( ) ) ; org.ovirt.engine.core.common.vdscommands.gluster.GlusterServiceVDSParameters params = new org.ovirt.engine.core.common.vdscommands.gluster.GlusterServiceVDSParameters ( serverId , java.util.Collections.singletonList ( "glusterd" ) , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_RESTART ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue restartGlusterdReturnValue = runVdsCommand ( VDSCommandType.ManageGlusterService , params ) ; return restartGlusterdReturnValue ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( ) ; cancel ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ! ( newModel.getName ( ) . getEntity ( ) . equals ( getName ( ) . getEntity ( ) ) ) ) { getName ( ) . getEntityChangedEvent ( ) . removeListener ( networkNameListener ) ; newModel.getName ( ) . getEntityChangedEvent ( ) . removeListener ( this ) ; } }
Source:
public void testSetStatusForNonRequiredNetworkAlreadyOperational ( ) { networkCluster.setRequired ( false ) ; networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; underTest.setStatus ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID , createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME ) ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . updateStatus ( org.mockito.Matchers.same ( networkCluster ) ) ; }

Target:
public void testSetStatusForNonRequiredNetworkUpdated ( ) { networkCluster.setRequired ( false ) ; networkCluster.setStatus ( NetworkStatus.NON_OPERATIONAL ) ; underTest.setStatus ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID , createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID1 , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME1 ) ) ; org.mockito.Mockito.verify ( networkClusterDao ) . updateStatus ( org.mockito.Matchers.same ( networkCluster ) ) ; org.junit.Assert.assertThat ( networkCluster.getStatus ( ) , org.hamcrest.Matchers.is ( NetworkStatus.OPERATIONAL ) ) ; }
Source:
protected void expectGetLunsMap ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDAO dao , java.lang.String lunId , java.lang.String cnxId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUN_storage_server_connection_map > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUN_storage_server_connection_map > ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUN_storage_server_connection_map map = new org.ovirt.engine.core.common.businessentities.storage.LUN_storage_server_connection_map ( ) ; map.setLunId ( lunId ) ; map.setstorage_server_connection ( cnxId ) ; ret.add ( map ) ; org.mockito.Mockito.when ( dao.getAll ( lunId ) ) . thenReturn ( ret ) ; }

Target:
protected void expectGetLunsMap ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDAO dao , java.lang.String lunId , java.lang.String cnxId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap > ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap map = new org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap ( ) ; map.setLunId ( lunId ) ; map.setstorage_server_connection ( cnxId ) ; ret.add ( map ) ; org.mockito.Mockito.when ( dao.getAll ( lunId ) ) . thenReturn ( ret ) ; }
Source:
protected void createQuota ( ) { super . createQuota ( false ) ; org.ovirt.engine.ui.uicommonweb.models.quota.QuotaModel quotaModel = ( ( org.ovirt.engine.ui.uicommonweb.models.quota.QuotaModel ) ( getWindow ( ) ) ) ; quotaModel.getDataCenter ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) ) ; quotaModel.getDataCenter ( ) . setSelectedItem ( getEntity ( ) ) ; quotaModel.getDataCenter ( ) . setIsChangable ( false ) ; }

Target:
protected void createQuota ( ) { super . createQuota ( false ) ; org.ovirt.engine.ui.uicommonweb.models.quota.QuotaModel quotaModel = ( ( org.ovirt.engine.ui.uicommonweb.models.quota.QuotaModel ) ( getWindow ( ) ) ) ; quotaModel.getDataCenter ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) ) ; quotaModel.getDataCenter ( ) . setSelectedItem ( getEntity ( ) ) ; quotaModel.getDataCenter ( ) . setIsChangeable ( false ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateNetworkExclusiveOnNics ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure ) { return new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( attachmentsToConfigure , networkBusinessEntityMap ) . validateNetworkExclusiveOnNics ( ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateQos ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure ) { org.ovirt.engine.core.bll.ValidationResult vr = org.ovirt.engine.core.bll.ValidationResult.VALID ; vr = ( skipValidation ( vr ) ) ? vr : validateQosOverriddenInterfaces ( ) ; vr = ( skipValidation ( vr ) ) ? vr : validateQosNotPartiallyConfigured ( attachmentsToConfigure ) ; return vr ; }
Source:
protected java.lang.String getProgressText ( T object ) { java.lang.Integer progressValue = org.ovirt.engine.ui.webadmin.widget.table.column.AbstractQuotaPercentColumn.getProgressValue ( object ) ; if ( ( progressValue != null ) && ( progressValue > 100 ) ) { return getaApplicationConstants ( ) . exceeded ( ) ; } if ( ( progressValue != null ) && ( progressValue < 0 ) ) { return getaApplicationConstants ( ) . unlimited ( ) ; } return progressValue != null ? progressValue + "%" : "0%" ; }

Target:
protected java.lang.String getProgressText ( T object ) { java.lang.Integer progressValue = org.ovirt.engine.ui.webadmin.widget.table.column.AbstractQuotaPercentColumn.getProgressValue ( object ) ; if ( ( progressValue != null ) && ( progressValue > 100 ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.AbstractQuotaPercentColumn.constants.exceeded ( ) ; } if ( ( progressValue != null ) && ( progressValue < 0 ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.AbstractQuotaPercentColumn.constants.unlimited ( ) ; } return progressValue != null ? progressValue + "%" : "0%" ; }
Source:
private static void doTestLocaleOverride ( java.lang.String name ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( name ) ; java.util.List < java.lang.String > errors = et.TranslateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT ) , java.util.Locale.ITALIAN ) ; org.junit.Assert.assertEquals ( "Unexpected Size" , 1 , errors.size ( ) ) ; org.junit.Assert.assertEquals ( "String should equal" , "Impossibile trovare il desktop" , errors.get ( 0 ) ) ; java.lang.String error = et.TranslateErrorTextSingle ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT , java.util.Locale.ITALIAN ) ; org.junit.Assert.assertEquals ( "String should equal" , "Impossibile trovare il desktop" , error ) ; }

Target:
private static void doTestLocaleOverride ( java.lang.String name ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( name ) ; java.util.List < java.lang.String > errors = et.translateErrorText ( java.util.Arrays.asList ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT ) , java.util.Locale.ITALIAN ) ; org.junit.Assert.assertEquals ( "Unexpected Size" , 1 , errors.size ( ) ) ; org.junit.Assert.assertEquals ( "String should equal" , "Impossibile trovare il desktop" , errors.get ( 0 ) ) ; java.lang.String error = et.translateErrorTextSingle ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT , java.util.Locale.ITALIAN ) ; org.junit.Assert.assertEquals ( "String should equal" , "Impossibile trovare il desktop" , error ) ; }
Source:
private boolean propertiesRequiringVmUpdateDeviceWereUpdated ( ) { return ( ( ! ( org.apache.commons.lang.StringUtils.equals ( oldIface.getNetworkName ( ) , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getNetworkName ( ) ) ) ) || ( ( oldIface.isLinked ( ) ) != ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getInterface ( ) . isLinked ( ) ) ) ) || ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( oldIface.getCustomProperties ( ) , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getInterface ( ) . getCustomProperties ( ) ) ) ) ; }

Target:
private boolean propertiesRequiringVmUpdateDeviceWereUpdated ( ) { return ( ! ( org.apache.commons.lang.ObjectUtils.equals ( oldIface.getVnicProfileId ( ) , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getInterface ( ) . getVnicProfileId ( ) ) ) ) || ( ( oldIface.isLinked ( ) ) != ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getInterface ( ) . isLinked ( ) ) ) ; }
Source:
public static void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void removeLun ( org.ovirt.engine.core.common.businessentities.LUNs lun ) { if ( lun.getvolume_group_id ( ) . isEmpty ( ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getLunDao ( ) . remove ( lun.getLUN_id ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage_server_connections connection : filterConnectionsUsedByOthers ( lun.getLunConnections ( ) , "" , lun.getLUN_id ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getid ( ) ) ; } } }

Target:
public void removeLun ( org.ovirt.engine.core.common.businessentities.LUNs lun ) { if ( lun.getvolume_group_id ( ) . isEmpty ( ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getLunDao ( ) . remove ( lun.getLUN_id ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection : filterConnectionsUsedByOthers ( lun.getLunConnections ( ) , "" , lun.getLUN_id ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getid ( ) ) ; } } }
Source:
public java.lang.String getMessage ( ) { if ( ( getTaskIsRunning ( ) ) || ( getTaskEndedSuccessfully ( ) ) ) { return "" ; } return ! ( org.ovirt.engine.core.common.businessentities.StringHelper.isNullOrEmpty ( _message ) ) ? _message : ( ( getException ( ) ) != null ) && ( ! ( org.ovirt.engine.core.common.businessentities.StringHelper.isNullOrEmpty ( getException ( ) . getMessage ( ) ) ) ) ? getException ( ) . getMessage ( ) : "Asynchronous Task unknown error" ; }

Target:
public java.lang.String getMessage ( ) { if ( ( getTaskIsRunning ( ) ) || ( getTaskEndedSuccessfully ( ) ) ) { return "" ; } return ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( _message ) ) ? _message : ( ( getException ( ) ) != null ) && ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( getException ( ) . getMessage ( ) ) ) ) ? getException ( ) . getMessage ( ) : "Asynchronous Task unknown error" ; }
Source:
public void testMissingBothAlternatives ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Permission permission = new org.ovirt.engine.api.model.Permission ( ) ; permission.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( permission , "user|vm.name|id" ) ; fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Permission" , "user|vm.name|id" ) ; } }

Target:
public void testMissingBothAlternatives ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Permission permission = new org.ovirt.engine.api.model.Permission ( ) ; permission.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( permission , "user|vm.name|id" ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Permission" , "user|vm.name|id" ) ; } }
Source:
protected void setUpEntityQueryExpectations ( int times , boolean isDisplay , boolean isMigration , boolean isRequired ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , getEntityList ( isDisplay , isMigration , isRequired ) ) ; } }

Target:
protected void setUpEntityQueryExpectations ( int times , boolean isDisplay , boolean isMigration , boolean isRequired , boolean isDefaultRoute ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , getEntityList ( isDisplay , isMigration , isRequired , isDefaultRoute ) ) ; } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.AuditLog auditLog = auditLogDao.get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getParameters ( ) . getAuditLogId ( ) ) ; auditLogDao.remove ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getParameters ( ) . getAuditLogId ( ) ) ; setAuditLogDetails ( auditLog ) ; evict ( auditLogDirector.composeSystemObjectId ( this , auditLog.getLogType ( ) ) ) ; org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.setSucceeded ( true ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.AuditLog getAuditLog ( ) { if ( ( auditLog ) == null ) { auditLog = auditLogDao.get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getParameters ( ) . getAuditLogId ( ) ) ; } return auditLog ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) return false ; org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig other = ( ( org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ) ( obj ) ) ; return java.util.Objects.equals ( nicId , other.getNicId ( ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ) ) { return false ; } org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig other = ( ( org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ) ( obj ) ) ; return java.util.Objects.equals ( nicId , other.nicId ) ; }
Source:
public void OnRemove ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > pb = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Network a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.Network > Cast ( getSelectedItems ( ) ) ) { pb.add ( new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( getEntity ( ) . getId ( ) , a ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.RemoveNetwork , pb ) ; Cancel ( ) ; }

Target:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getNewCommand ( ) ) ) { newNetwork ( ) ; } else if ( command == ( getEditCommand ( ) ) ) { edit ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , EditNetworkModel.APPLY_COMMAND_NAME ) ) { apply ( ) ; } }
Source:
public static void GetStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
private void appendFunction ( org.ovirt.engine.sdk.generator.templates.AbstractTemplate template ) throws java.io.IOException { java.lang.String text = template.evaluate ( ) ; java.lang.String [ ] lines = text.split ( "\n" ) ; addLines ( source.size ( ) , 0 , lines ) ; }

Target:
private void appendFunction ( org.ovirt.engine.sdk.generator.templates.AbstractTemplate template ) throws java.io.IOException { java.lang.String text = template.evaluate ( ) ; java.lang.String [ ] lines = text.split ( "\n" ) ; addLines ( source.size ( ) , 0 , lines ) ; source.add ( "" ) ; }
Source:
public static void getDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getUserMessageOfTheDayViaPublic ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public 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 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 ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM createVM ( java.lang.String vmName , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; vm.setvm_name ( vmName ) ; org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmIface = createNewInterface ( ) ; vmIface.setVmId ( vm.getId ( ) ) ; vmIface.setNetworkName ( networkName ) ; vm.getInterfaces ( ) . add ( vmIface ) ; return vm ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM createVM ( java.lang.String vmName , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; vm.setVmName ( vmName ) ; org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmIface = createNewInterface ( ) ; vmIface.setVmId ( vm.getId ( ) ) ; vmIface.setNetworkName ( networkName ) ; vm.getInterfaces ( ) . add ( vmIface ) ; return vm ; }
Source:
public void stringToCpuTune ( ) { org.ovirt.engine.api.model.CpuTune cpuTune = org.ovirt.engine.api.restapi.types.VmMapper.stringToCpuTune ( "0#0" ) ; assertNotNull ( cpuTune ) ; assertNotNull ( cpuTune.getVCpuPin ( ) ) ; assertEquals ( 1 , cpuTune.getVCpuPin ( ) . size ( ) ) ; assertEquals ( 0 , ( ( int ) ( cpuTune.getVCpuPin ( ) . get ( 0 ) . getVcpu ( ) ) ) ) ; assertEquals ( "0" , cpuTune.getVCpuPin ( ) . get ( 0 ) . getCpuSet ( ) ) ; }

Target:
public void stringToCpuTune ( ) { org.ovirt.engine.api.model.CpuTune cpuTune = org.ovirt.engine.api.restapi.types.VmMapper.stringToCpuTune ( "0#0" ) ; assertNotNull ( cpuTune ) ; assertNotNull ( cpuTune.getVcpuPin ( ) ) ; assertEquals ( 1 , cpuTune.getVcpuPin ( ) . size ( ) ) ; assertEquals ( 0 , ( ( int ) ( cpuTune.getVcpuPin ( ) . get ( 0 ) . getVcpu ( ) ) ) ) ; assertEquals ( "0" , cpuTune.getVcpuPin ( ) . get ( 0 ) . getCpuSet ( ) ) ; }
Source:
protected void alertActionSkippedAlreadyInStatus ( ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; auditLogable.addCustomValue ( "HostName" , getTargetVds ( ) . getName ( ) ) ; auditLogable.addCustomValue ( "AgentStatus" , org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getAction ( ) . getValue ( ) ) ; auditLogable.addCustomValue ( "Operation" , org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getAction ( ) . toString ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( auditLogable , AuditLogType.VDS_ALREADY_IN_REQUESTED_STATUS ) ; }

Target:
protected void alertActionSkippedAlreadyInStatus ( ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; auditLogable.addCustomValue ( "HostName" , getTargetVds ( ) . getName ( ) ) ; auditLogable.addCustomValue ( "AgentStatus" , org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getAction ( ) . getValue ( ) ) ; auditLogable.addCustomValue ( "Operation" , org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getAction ( ) . toString ( ) ) ; auditLogDirector.log ( auditLogable , AuditLogType.VDS_ALREADY_IN_REQUESTED_STATUS ) ; }
Source:
public void testRemoveByRemoveIsoDomain ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.SHARED_ISO_STORAGE_DOAMIN_FOR_SP2_AND_SP3 , ImageFileType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertNotSame ( true , listOfRepoFiles.isEmpty ( ) ) ; org.ovirt.engine.core.dao.StorageDomainDAO storageDomainDao = dbFacade.getStorageDomainDao ( ) ; storageDomainDao.remove ( FixturesTool.SHARED_ISO_STORAGE_DOAMIN_FOR_SP2_AND_SP3 ) ; listOfRepoFiles = getActiveIsoDomain ( ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertSame ( true , listOfRepoFiles.isEmpty ( ) ) ; }

Target:
public void testRemoveByRemoveIsoDomain ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.SHARED_ISO_STORAGE_DOAMIN_FOR_SP2_AND_SP3 , ImageFileType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertFalse ( listOfRepoFiles.isEmpty ( ) ) ; org.ovirt.engine.core.dao.StorageDomainDAO storageDomainDao = dbFacade.getStorageDomainDao ( ) ; storageDomainDao.remove ( FixturesTool.SHARED_ISO_STORAGE_DOAMIN_FOR_SP2_AND_SP3 ) ; listOfRepoFiles = getActiveIsoDomain ( ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertTrue ( listOfRepoFiles.isEmpty ( ) ) ; }
Source:
protected org.ovirt.engine.api.model.Cluster postPopulate ( org.ovirt.engine.api.model.Cluster model ) { org.ovirt.engine.api.model.ErrorHandling errorHandling = new org.ovirt.engine.api.model.ErrorHandling ( ) ; errorHandling.setOnError ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.MigrateOnError.class ) . value ( ) ) ; model.setErrorHandling ( errorHandling ) ; model.getSerialNumber ( ) . setPolicy ( SerialNumberPolicy.CUSTOM.value ( ) ) ; model.getRequiredRngSources ( ) . getRequiredRngSources ( ) . clear ( ) ; model.getRequiredRngSources ( ) . getRequiredRngSources ( ) . add ( RngSource.RANDOM.name ( ) ) ; return model ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Cluster postPopulate ( org.ovirt.engine.core.common.businessentities.Cluster model ) { org.ovirt.engine.api.model.ErrorHandling errorHandling = new org.ovirt.engine.api.model.ErrorHandling ( ) ; errorHandling.setOnError ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.MigrateOnError.class ) ) ; model.setErrorHandling ( errorHandling ) ; model.getSerialNumber ( ) . setPolicy ( SerialNumberPolicy.CUSTOM ) ; model.getRequiredRngSources ( ) . getRequiredRngSources ( ) . clear ( ) ; model.getRequiredRngSources ( ) . getRequiredRngSources ( ) . add ( RngSource.RANDOM ) ; return model ; }
Source:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData createVmInternalData ( java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.vdsbroker.vdsbroker.ExtendedVmDynamic ( org.ovirt.engine.core.vdsbroker.vdsbroker.VmStatsVdsBrokerCommand.getVds ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xmlRpcStruct ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData ( vmDynamic , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVMStatisticsData ( xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmGuestAgentInterfacesData ( vmDynamic.getId ( ) , xmlRpcStruct ) , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.buildVmLunDisksData ( xmlRpcStruct ) ) ; }

Target:
private void adjustDisplayIp ( java.util.Map < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > graphicsInfos ) { org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.core.vdsbroker.vdsbroker.VmStatsVdsBrokerCommand.getVds ( ) ; for ( org.ovirt.engine.core.common.businessentities.GraphicsInfo graphicsInfo : graphicsInfos.values ( ) ) { if ( graphicsInfo == null ) { continue ; } if ( ( host.getConsoleAddress ( ) ) != null ) { graphicsInfo.setIp ( host.getConsoleAddress ( ) ) ; } else if ( graphicsInfo.getIp ( ) . startsWith ( "0" ) ) { graphicsInfo.setIp ( host.getHostName ( ) ) ; } } }
Source:
private void executeQueryCommandChecked ( ) throws java.io.IOException { final org.ovirt.engine.core.common.businessentities.GraphicsInfo graphicsInfo = getGraphicsInfo ( ) ; final java.util.Map < java.lang.String , java.lang.Object > ticketModel = createTicket ( graphicsInfo ) ; final java.lang.String jsonTicket = new org.codehaus.jackson.map.ObjectMapper ( ) . writeValueAsString ( ticketModel ) ; final java.lang.String encodedTicket = java.net.URLEncoder.encode ( jsonTicket , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; final java.lang.String signedTicket = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalQuery ( VdcQueryType.SignString , new org.ovirt.engine.core.common.queries.SignStringParameters ( encodedTicket ) ) . getReturnValue ( ) ; org.ovirt.engine.core.bll.GetSignedWebsocketProxyTicketQuery.setReturnValue ( signedTicket ) ; }

Target:
private void executeQueryCommandChecked ( ) throws java.io.IOException { final org.ovirt.engine.core.common.businessentities.GraphicsInfo graphicsInfo = getGraphicsInfo ( ) ; final java.util.Map < java.lang.String , java.lang.Object > ticketModel = createTicket ( graphicsInfo ) ; final java.lang.String jsonTicket = new org.codehaus.jackson.map.ObjectMapper ( ) . writeValueAsString ( ticketModel ) ; final java.lang.String encodedTicket = java.net.URLEncoder.encode ( jsonTicket , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; final java.lang.String signedTicket = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalQuery ( QueryType.SignString , new org.ovirt.engine.core.common.queries.SignStringParameters ( encodedTicket ) ) . getReturnValue ( ) ; org.ovirt.engine.core.bll.GetSignedWebsocketProxyTicketQuery.setReturnValue ( signedTicket ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeParameterListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getAddParameterCommand ( ) ) ) { return addParameterPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getEditParameterCommand ( ) ) ) { return editParameterPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getAddCommand ( ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
protected java.util.Collection < org.ovirt.engine.ui.uicommonweb.validation.IValidation > getOutLinkshareValidations ( ) { java.util.Collection < org.ovirt.engine.ui.uicommonweb.validation.IValidation > validations = new java.util.ArrayList < > ( ) ; validations.add ( new org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation ( 1 , ( ( java.lang.Integer ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.MaxHostNetworkQosShares ) ) ) ) ) ; return validations ; }

Target:
protected java.util.Collection < org.ovirt.engine.ui.uicommonweb.validation.IValidation > getOutLinkshareValidations ( ) { java.util.Collection < org.ovirt.engine.ui.uicommonweb.validation.IValidation > validations = new java.util.ArrayList < > ( ) ; validations.add ( new org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation ( 1 , ( ( java.lang.Integer ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigValues.MaxHostNetworkQosShares ) ) ) ) ) ; return validations ; }