auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult result ) { java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > returnValueList = result.getReturnValues ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValueList.get ( 0 ) . getReturnValue ( ) ) ) ; initTemplateWithVersion ( templates ) ; initCdImage ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult result ) { java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > returnValueList = result.getReturnValues ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValueList.get ( 0 ) . getReturnValue ( ) ) ) ; initTemplateWithVersion ( templates , null , false ) ; initCdImage ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStoragePoolDao ( ) ; existingPool = dao.get ( new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ) ; existingPool.setstatus ( StoragePoolStatus.Up ) ; vds = new org.ovirt.engine.core.compat.Guid ( "afce7a39-8e8c-4819-ba9c-796d316592e6" ) ; vdsGroup = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; storageDomain = new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ; newPool = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; newPool.setname ( "newPoolDude" ) ; newPool.setcompatibility_version ( new org.ovirt.engine.core.compat.Version ( "3.0" ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStoragePoolDao ( ) ; existingPool = dao.get ( new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ) ; existingPool.setstatus ( StoragePoolStatus.Up ) ; vds = new org.ovirt.engine.core.compat.Guid ( "afce7a39-8e8c-4819-ba9c-796d316592e6" ) ; vdsGroup = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; storageDomain = new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ; newPool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; newPool.setname ( "newPoolDude" ) ; newPool.setcompatibility_version ( new org.ovirt.engine.core.compat.Version ( "3.0" ) ) ; }
Source:
private void buildVmGraphicsDevicesFromDb ( boolean usesGraphicsAsDevice , java.util.Map < java.lang.String , java.lang.Object > extraSpecParams ) { if ( usesGraphicsAsDevice ) { buildVmDevicesFromDb ( VmDeviceGeneralType.GRAPHICS , false , extraSpecParams ) ; } java.lang.String legacyDisplay = deriveDisplayTypeLegacy ( ) ; if ( legacyDisplay != null ) { createInfo.put ( VdsProperties.display , legacyDisplay ) ; } }

Target:
private void buildVmGraphicsDevicesFromDb ( java.util.Map < java.lang.String , java.lang.Object > extraSpecParams ) { buildVmDevicesFromDb ( VmDeviceGeneralType.GRAPHICS , false , extraSpecParams ) ; java.lang.String legacyDisplay = deriveDisplayTypeLegacy ( ) ; if ( legacyDisplay != null ) { createInfo.put ( VdsProperties.display , legacyDisplay ) ; } }
Source:
public void onSuccess ( java.lang.Object target2 , java.lang.Object returnValue2 ) { java.lang.Object [ ] array2 = ( ( java.lang.Object [ ] ) ( target2 ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.StorageDataCenterListModel listModel2 = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageDataCenterListModel ) ( array2 [ 0 ] ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter2 = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( array2 [ 1 ] ) ) ; boolean addDatacenter2 = ( ( dataCenter2.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) && ( returnValue2 == null ) ; listModel2.addToAttachCandidateDatacenters ( dataCenter2 , addDatacenter2 ) ; }

Target:
public void onSuccess ( java.lang.Object target2 , java.lang.Object returnValue2 ) { java.lang.Object [ ] array2 = ( ( java.lang.Object [ ] ) ( target2 ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.StorageDataCenterListModel listModel2 = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageDataCenterListModel ) ( array2 [ 0 ] ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter2 = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( array2 [ 1 ] ) ) ; boolean addDatacenter2 = ( ( dataCenter2.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) && ( returnValue2 == null ) ; listModel2.addToAttachCandidateDatacenters ( dataCenter2 , addDatacenter2 ) ; }
Source:
public org.ovirt.engine.core.bll.tasks.SPMAsyncTask concreteCreateTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.bll.CommandBase command , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , getAsyncTask ( taskId , command , asyncTaskCreationInfo , parentCommand ) ) ; p.setEntityInfo ( command.getParameters ( ) . getEntityInfo ( ) ) ; return createTask ( command.internalGetTaskType ( ) , p ) ; }

Target:
public org.ovirt.engine.core.bll.tasks.SPMAsyncTask concreteCreateTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.bll.CommandBase command , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , getAsyncTask ( taskId , command , asyncTaskCreationInfo , parentCommand ) ) ; p.setEntityInfo ( command.getParameters ( ) . getEntityInfo ( ) ) ; return createTask ( internalGetTaskType ( command ) , p ) ; }
Source:
public static void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void 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 void onRemove ( ) { org.ovirt.engine.core.common.businessentities.Bookmark selectedBookmark = ( ( org.ovirt.engine.core.common.businessentities.Bookmark ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.action.BookmarksParametersBase parameters = new org.ovirt.engine.core.common.action.BookmarksParametersBase ( selectedBookmark.getbookmark_id ( ) ) ; org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback async = new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { postOnSave ( result.getReturnValue ( ) ) ; } } ; getWindow ( ) . startProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveBookmark , parameters , async ) ; }

Target:
public void onRemove ( ) { org.ovirt.engine.core.common.businessentities.Bookmark selectedBookmark = ( ( org.ovirt.engine.core.common.businessentities.Bookmark ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.action.BookmarksParametersBase parameters = new org.ovirt.engine.core.common.action.BookmarksParametersBase ( selectedBookmark.getbookmark_id ( ) ) ; org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback async = new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { postOnSave ( result.getReturnValue ( ) ) ; } } ; getWindow ( ) . startProgress ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveBookmark , parameters , async ) ; }
Source:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.VmPool selectedItem ) { driver.edit ( getDetailModel ( ) ) ; monitorCount.setText ( java.lang.String.valueOf ( getDetailModel ( ) . getMonitorCount ( ) ) ) ; isStateless.setText ( java.lang.Boolean.toString ( getDetailModel ( ) . getIsStateless ( ) ) ) ; oS.setText ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getOsName ( getDetailModel ( ) . getOS ( ) ) ) ; formBuilder.update ( getDetailModel ( ) ) ; }

Target:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.VmPool selectedItem ) { driver.edit ( getDetailModel ( ) ) ; monitorCount.setText ( java.lang.String.valueOf ( getDetailModel ( ) . getMonitorCount ( ) ) ) ; isStateless.setText ( java.lang.Boolean.toString ( getDetailModel ( ) . getIsStateless ( ) ) ) ; oS.setText ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getOsName ( getDetailModel ( ) . getOS ( ) ) ) ; formBuilder.update ( getDetailModel ( ) ) ; }
Source:
private boolean consumeForVdsQuota ( org.ovirt.engine.core.compat.Guid quotaId ) { org.ovirt.engine.core.bll.quota.QuotaConsumptionParametersWrapper parameters = null ; try { parameters = parametersWrapper.clone ( ) ; parameters.getParameters ( ) . add ( new org.ovirt.engine.core.bll.quota.QuotaClusterConsumptionParameter ( quotaId , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.quota.QuotaManagerTest.DESTINATION_GUID , 1 , 1 ) ) ; } catch ( java.lang.CloneNotSupportedException e ) { } return quotaManager.consume ( parameters ) ; }

Target:
private boolean consumeForVdsQuota ( org.ovirt.engine.core.compat.Guid quotaId ) throws java.lang.CloneNotSupportedException { org.ovirt.engine.core.bll.quota.QuotaConsumptionParametersWrapper parameters = parametersWrapper.clone ( ) ; parameters.getParameters ( ) . add ( new org.ovirt.engine.core.bll.quota.QuotaClusterConsumptionParameter ( quotaId , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.quota.QuotaManagerTest.DESTINATION_GUID , 1 , 1 ) ) ; return quotaManager.consume ( parameters ) ; }
Source:
protected static java.util.Set < org.ovirt.engine.core.common.businessentities.storage.BaseDisk > getDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.BaseDisk > diskMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk diskImage : diskImages ) { diskMap.put ( diskImage.getId ( ) , diskImage ) ; } return new java.util.HashSet ( diskMap.values ( ) ) ; }

Target:
public static java.util.Set < org.ovirt.engine.core.common.businessentities.storage.BaseDisk > getDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.BaseDisk > diskMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk diskImage : diskImages ) { diskMap.put ( diskImage.getId ( ) , diskImage ) ; } return new java.util.HashSet ( diskMap.values ( ) ) ; }
Source:
public static boolean isValidVmNetwork ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface , org.ovirt.engine.core.compat.Guid clusterId ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.Network > networksByName = org.ovirt.engine.core.common.businessentities.Entities.entitiesByName ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDAO ( ) . getAllForCluster ( clusterId ) ) ; java.lang.String networkName = iface.getNetworkName ( ) ; return ( networksByName.containsKey ( networkName ) ) && ( networksByName.get ( networkName ) . isVmNetwork ( ) ) ; }

Target:
public boolean isValidVmNetwork ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.Network > networksByName ) { java.lang.String networkName = iface.getNetworkName ( ) ; return ( networksByName.containsKey ( networkName ) ) && ( networksByName.get ( networkName ) . isVmNetwork ( ) ) ; }
Source:
public static java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getFileDataStorageModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > models = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel nfsDataModel = new org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ( ) ; models.add ( nfsDataModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel posixDataModel = new org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ( ) ; models.add ( posixDataModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.GlusterStorageModel GlusterDataModel = new org.ovirt.engine.ui.uicommonweb.models.storage.GlusterStorageModel ( ) ; models.add ( GlusterDataModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel localDataModel = new org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ( ) ; models.add ( localDataModel ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.addTypeToStorageModels ( StorageDomainType.Data , models ) ; return models ; }

Target:
public java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getFileDataStorageModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > models = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel nfsDataModel = new org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ( ) ; models.add ( nfsDataModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel posixDataModel = new org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ( ) ; models.add ( posixDataModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.GlusterStorageModel GlusterDataModel = new org.ovirt.engine.ui.uicommonweb.models.storage.GlusterStorageModel ( ) ; models.add ( GlusterDataModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel localDataModel = new org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ( ) ; models.add ( localDataModel ) ; addTypeToStorageModels ( StorageDomainType.Data , models ) ; return models ; }
Source:
public void shutDown ( ) { try { if ( ( sched ) != null ) { sched.shutdown ( true ) ; } } catch ( org.quartz.SchedulerException se ) { log.error ( "failed to shut down the scheduler: {}" , se.getMessage ( ) ) ; log.debug ( "Exception" , se ) ; } }

Target:
public void shutDown ( ) { try { if ( ( sched ) != null ) { sched.shutdown ( false ) ; } } catch ( org.quartz.SchedulerException se ) { log.error ( "failed to shut down the scheduler: {}" , se.getMessage ( ) ) ; log.debug ( "Exception" , se ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.ExternalOperatingSystem > mapOperationSystem ( java.util.List < org.ovirt.engine.core.bll.host.provider.foreman.ForemanOperatingSystem > foremanOss ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalOperatingSystem > oss = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalOperatingSystem > ( foremanOss.size ( ) ) ; for ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanOperatingSystem os : foremanOss ) { org.ovirt.engine.core.common.businessentities.ExternalOperatingSystem eos = new org.ovirt.engine.core.common.businessentities.ExternalOperatingSystem ( ) ; eos.setName ( os.getName ( ) ) ; eos.setId ( os.getId ( ) ) ; oss.add ( eos ) ; } return oss ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.ExternalOperatingSystem > mapOperationSystem ( java.util.List < org.ovirt.engine.core.bll.host.provider.foreman.ForemanOperatingSystem > foremanOss ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalOperatingSystem > oss = new java.util.ArrayList ( foremanOss.size ( ) ) ; for ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanOperatingSystem os : foremanOss ) { org.ovirt.engine.core.common.businessentities.ExternalOperatingSystem eos = new org.ovirt.engine.core.common.businessentities.ExternalOperatingSystem ( ) ; eos.setName ( os.getName ( ) ) ; eos.setId ( os.getId ( ) ) ; oss.add ( eos ) ; } return oss ; }
Source:
public org.ovirt.engine.core.common.businessentities.storage_domains getStorageDomain ( ) { if ( ( super . getStorageDomain ( ) ) == null ) { super . setStorageDomain ( new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ) ; } super . getStorageDomain ( ) . setStorageStaticData ( org.ovirt.engine.core.bll.storage.StorageDomainManagementCommandBase.getParameters ( ) . getStorageDomain ( ) ) ; return super . getStorageDomain ( ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.StorageDomain getStorageDomain ( ) { if ( ( super . getStorageDomain ( ) ) == null ) { super . setStorageDomain ( new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ) ; } super . getStorageDomain ( ) . setStorageStaticData ( org.ovirt.engine.core.bll.storage.StorageDomainManagementCommandBase.getParameters ( ) . getStorageDomain ( ) ) ; return super . getStorageDomain ( ) ; }
Source:
private boolean hostChanged ( com.woorea.openstack.quantum.model.Port port , java.lang.String hostId ) { return ( ( port.getBinding ( ) ) == null ) || ( ! ( org.apache.commons.lang.StringUtils.equals ( port.getBinding ( ) . getHostId ( ) , hostId ) ) ) ; }

Target:
private boolean hostChanged ( com.woorea.openstack.quantum.model.Port port , java.lang.String hostId ) { return ( ( ( port.getBinding ( ) ) == null ) || ( hostId == null ) ) || ( ! ( org.apache.commons.lang.StringUtils.equals ( port.getBinding ( ) . getHostId ( ) , hostId ) ) ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getVmToAttach ( org.ovirt.engine.core.compat.NGuid poolId ) { if ( ( vmToAttach ) == null ) { org.ovirt.engine.core.compat.Guid vmGuid = getPrestartedVmToAttach ( poolId ) ; if ( ( vmGuid == null ) || ( Guid.Empty.equals ( vmGuid ) ) ) { vmGuid = getNonPrestartedVmToAttach ( poolId ) ; } vmToAttach = vmGuid ; } return vmToAttach ; }

Target:
private org.ovirt.engine.core.compat.Guid getVmToAttach ( org.ovirt.engine.core.compat.Guid poolId ) { if ( ( vmToAttach ) == null ) { org.ovirt.engine.core.compat.Guid vmGuid = getPrestartedVmToAttach ( poolId ) ; if ( ( vmGuid == null ) || ( Guid.Empty.equals ( vmGuid ) ) ) { vmGuid = getNonPrestartedVmToAttach ( poolId ) ; } vmToAttach = vmGuid ; } return vmToAttach ; }
Source:
private void setNonOperational ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( org.ovirt.engine.core.bll.InitVdsOnUpCommand.getVds ( ) . getId ( ) , reason , customLogValues ) ; tempVar.setSaveToDb ( true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
private void setNonOperational ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( getVds ( ) . getId ( ) , reason , customLogValues ) ; tempVar.setSaveToDb ( true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
private boolean IsLocalDataCenterEmpty ( org.ovirt.engine.core.common.businessentities.storage_pool dataCenter ) { if ( ( ( dataCenter != null ) && ( ( dataCenter.getstorage_pool_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) && ( ( dataCenter.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Uninitialized ) ) ) { return true ; } return false ; }

Target:
private boolean IsLocalDataCenterEmpty ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter ) { if ( ( ( dataCenter != null ) && ( ( dataCenter.getstorage_pool_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) && ( ( dataCenter.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Uninitialized ) ) ) { return true ; } return false ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > newItems = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.Collections.sort ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.NetworkComparator ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( newItems ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > newItems = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.Collections.sort ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.NetworkComparator ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( newItems ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > score ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > scores = new java.util.ArrayList < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hosts ) { scores.add ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > ( vds.getId ( ) , calcEvenGuestDistributionScore ( vds , parameters ) ) ) ; } return scores ; }

Target:
public java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > score ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > scores = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hosts ) { scores.add ( new org.ovirt.engine.core.common.utils.Pair ( vds.getId ( ) , calcEvenGuestDistributionScore ( vds , parameters ) ) ) ; } return scores ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM initializeMock ( final int domainSizeGB , final int sizeRequired , final int pctRequired ) { mockVmTemplateDAOReturnVmTemplate ( ) ; mockDiskImageDAOGetSnapshotById ( ) ; mockStorageDomainDAOGetForStoragePool ( domainSizeGB ) ; mockStorageDomainDAOGet ( domainSizeGB ) ; mockGetImageDomainsListVdsCommand ( ) ; mockConfig ( ) ; mockConfigSizeRequirements ( sizeRequired , pctRequired ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.AddVmCommandTest.createVm ( ) ; return vm ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM initializeMock ( final int domainSizeGB , final int sizeRequired ) { mockVmTemplateDAOReturnVmTemplate ( ) ; mockDiskImageDAOGetSnapshotById ( ) ; mockStorageDomainDAOGetForStoragePool ( domainSizeGB ) ; mockStorageDomainDAOGet ( domainSizeGB ) ; mockGetImageDomainsListVdsCommand ( ) ; mockConfig ( ) ; mockConfigSizeRequirements ( sizeRequired ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.AddVmCommandTest.createVm ( ) ; return vm ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { datacenterAlertIcon.setVisible ( storageModel.getDataCenterAlert ( ) . getIsAvailable ( ) ) ; datacenterAlertIcon.setTitle ( ( ( java.lang.String ) ( storageModel.getDataCenterAlert ( ) . getEntity ( ) ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { datacenterAlertIcon.setVisible ( storageModel.getDataCenterAlert ( ) . getIsAvailable ( ) ) ; datacenterAlertIcon.setTitle ( storageModel.getDataCenterAlert ( ) . getEntity ( ) ) ; }
Source:
private void unlinkingTest ( org.ovirt.engine.core.bll.ValidationResult expected , boolean networkLinkingSupported , boolean nicLinked ) { mockConfigRule.mockConfigValue ( ConfigValues.NetworkLinkingSupported , null , networkLinkingSupported ) ; org.mockito.Mockito.when ( nic.isLinked ( ) ) . thenReturn ( nicLinked ) ; org.junit.Assert.assertEquals ( expected , validator.linkedCorrectly ( ) ) ; }

Target:
private void unlinkingTest ( org.ovirt.engine.core.bll.ValidationResult expected , boolean networkLinkingSupported , boolean nicLinked ) { mockConfigRule.mockConfigValue ( ConfigValues.NetworkLinkingSupported , version , networkLinkingSupported ) ; org.mockito.Mockito.when ( nic.isLinked ( ) ) . thenReturn ( nicLinked ) ; org.junit.Assert.assertEquals ( expected , validator.linkedCorrectly ( ) ) ; }
Source:
public void testNullDisksUsages ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics vmStatistics = getVmStatistics ( ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksUsageInXmlRpc ( null ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMStatisticsData ( vmStatistics , xml ) ; org.junit.Assert.assertNull ( vmStatistics.getDisksUsage ( ) ) ; }

Target:
public void testNullDisksUsages ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics vmStatistics = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVmStatistics ( ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksUsageInXmlRpc ( null ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMStatisticsData ( vmStatistics , xml ) ; org.junit.Assert.assertNull ( vmStatistics.getDisksUsage ( ) ) ; }
Source:
public void canDoActionSucceedsWithForceOption ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , true ) ) ) ; prepareMocks ( command ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; runAndAssertCanDoActionSuccess ( ) ; }

Target:
public void canDoActionSucceedsWithForceOption ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , true ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; runAndAssertCanDoActionSuccess ( ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNetworkIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.compat.Guid networkId = attachment.getNetworkId ( ) ; java.lang.String networkName = attachment.getNetworkName ( ) ; org.ovirt.engine.core.compat.Guid violatingEntityId = attachment.getId ( ) ; return org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.validateCoherentIdentification ( ( violatingEntityId == null ? null : violatingEntityId.toString ( ) ) , networkId , networkName , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NETWORK_INCOHERENTLY , networkBusinessEntityMap ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNetworkIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.compat.Guid networkId = attachment.getNetworkId ( ) ; java.lang.String networkName = attachment.getNetworkName ( ) ; org.ovirt.engine.core.compat.Guid violatingEntityId = attachment.getId ( ) ; return validateCoherentIdentification ( java.lang.String.valueOf ( violatingEntityId ) , networkId , networkName , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NETWORK_INCOHERENTLY , networkBusinessEntityMap ) ; }
Source:
public void shouldHandleEmptyHostList ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VDS > filteredHost = policyUnit.filter ( new java.util.ArrayList < > ( ) , vm , null , org.mockito.Mockito.mock ( org.ovirt.engine.core.common.scheduling.PerHostMessages.class ) ) ; org.hamcrest.MatcherAssert.assertThat ( filteredHost , org.hamcrest.CoreMatchers.is ( org.hamcrest.Matchers.empty ( ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( messages ( ) , org.hamcrest.CoreMatchers.is ( org.hamcrest.Matchers.empty ( ) ) ) ; }

Target:
public void shouldHandleEmptyHostList ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VDS > filteredHost = policyUnit.filter ( cluster , new java.util.ArrayList < > ( ) , vm , null , org.mockito.Mockito.mock ( org.ovirt.engine.core.common.scheduling.PerHostMessages.class ) ) ; org.hamcrest.MatcherAssert.assertThat ( filteredHost , org.hamcrest.CoreMatchers.is ( org.hamcrest.Matchers.empty ( ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( messages ( ) , org.hamcrest.CoreMatchers.is ( org.hamcrest.Matchers.empty ( ) ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { java.lang.Object [ ] args = invocation.getArguments ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage arg = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( args [ 0 ] ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > list = createDiskSnapshot ( arg.getId ( ) , 3 ) ; return list ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { java.lang.Object [ ] args = invocation.getArguments ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage arg = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( args [ 0 ] ) ) ; return createDiskSnapshot ( arg.getId ( ) , 3 ) ; }
Source:
public static void UnLockVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( vm.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVmStatus , new org.ovirt.engine.core.common.vdscommands.SetVmStatusVDSCommandParameters ( vm.getId ( ) , org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ; vm.setstatus ( VMStatus.Down ) ; } else { org.ovirt.engine.core.bll.VmHandler.log.errorFormat ( "Trying to unlock vm {0} in status {1} - not moving to down!" , vm.getvm_name ( ) , vm.getstatus ( ) ) ; } }

Target:
public static void UnLockVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVmStatus , new org.ovirt.engine.core.common.vdscommands.SetVmStatusVDSCommandParameters ( vm.getId ( ) , org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ; vm.setstatus ( VMStatus.Down ) ; }
Source:
public java.lang.Void runInTransaction ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDAO ( ) . getAllForDataCenter ( getStoragePoolId ( ) . getValue ( ) ) ; for ( final org.ovirt.engine.core.common.businessentities.network net : networks ) { getCompensationContext ( ) . snapshotEntity ( net ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDAO ( ) . remove ( net.getId ( ) ) ; } getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDAO ( ) . getAllForDataCenter ( getStoragePoolId ( ) . getValue ( ) ) ; for ( final org.ovirt.engine.core.common.businessentities.Network net : networks ) { getCompensationContext ( ) . snapshotEntity ( net ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDAO ( ) . remove ( net.getId ( ) ) ; } getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public void testGetDataAndSetDataWithFullSession ( ) { org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setHttpSessionId ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID ) ; org.junit.Assert.assertTrue ( "Set should fail with an empty session" , container.setData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE ) ) ; org.junit.Assert.assertEquals ( "Get should return null with an empty session" , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; org.junit.Assert.assertEquals ( "Get should return the value with a given session" , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; }

Target:
public void testGetDataAndSetDataWithFullSession ( ) { container.setData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE ) ; org.junit.Assert.assertEquals ( "Get should return the value with a given session" , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; }
Source:
public void checkNoHost ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; parameters.setVdsId ( null ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getid ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void checkNoHost ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; parameters.setVdsId ( null ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getId ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
protected void updateDataCenterVersion ( ) { org.ovirt.engine.ui.frontend.AsyncQuery query = new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; model.setDataCenterVersion ( storagePool.getcompatibility_version ( ) ) ; } } ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDataCenterById ( query , getEntity ( ) . getStoragePoolId ( ) ) ; }

Target:
protected void updateDataCenterVersion ( ) { org.ovirt.engine.ui.frontend.AsyncQuery query = new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; model.setDataCenterVersion ( storagePool.getcompatibility_version ( ) ) ; } } ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDataCenterById ( query , getEntity ( ) . getStoragePoolId ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { boolean returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ; if ( returnValue ) { command.execute ( ) ; } else { org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.HasAdElementReconnectPermission , portalUserReconnectPermParams , portalUserReconnectPermissionQuery ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { boolean returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ; if ( returnValue ) { command.execute ( ) ; } else { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.HasAdElementReconnectPermission , portalUserReconnectPermParams , portalUserReconnectPermissionQuery ) ; } }
Source:
public static java.util.List < java.lang.String > mapRngSources ( java.util.Collection < org.ovirt.engine.core.common.businessentities.VmRngDevice.Source > entity ) { java.util.List < java.lang.String > result = new java.util.ArrayList ( ( entity != null ? entity.size ( ) : 0 ) ) ; if ( entity != null ) { for ( org.ovirt.engine.core.common.businessentities.VmRngDevice.Source source : entity ) { org.ovirt.engine.api.model.RngSource restSource = org.ovirt.engine.api.restapi.types.RngDeviceMapper.map ( source , null ) ; result.add ( restSource.name ( ) ) ; } } return result ; }

Target:
public static java.util.List < org.ovirt.engine.api.model.RngSource > mapRngSources ( java.util.Collection < org.ovirt.engine.core.common.businessentities.VmRngDevice.Source > entity ) { java.util.List < org.ovirt.engine.api.model.RngSource > result = new java.util.ArrayList ( ( entity != null ? entity.size ( ) : 0 ) ) ; if ( entity != null ) { for ( org.ovirt.engine.core.common.businessentities.VmRngDevice.Source source : entity ) { org.ovirt.engine.api.model.RngSource restSource = org.ovirt.engine.api.restapi.types.RngDeviceMapper.map ( source , null ) ; result.add ( restSource ) ; } } return result ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.CopyDiskModel copyDiskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.CopyDiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( returnValue ) ) ; copyDiskModel.onInitAllDisks ( disks ) ; copyDiskModel.onInitDisks ( ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks ) { onInitAllDisks ( ( ( java.util.List ) ( disks ) ) ) ; onInitDisks ( ) ; }
Source:
public void unmanagedNetworkAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; nic.setNetworkName ( "net" ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORKS_DONT_EXIST_IN_CLUSTER , nic.getNetworkName ( ) ) ; }

Target:
public void unmanagedNetworkAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; nic.setNetworkName ( "net" ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORKS_DONT_EXIST_IN_CLUSTER , nic.getNetworkName ( ) ) ; }
Source:
private void initSupportedArchitectures ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel clusterModel ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.ArchitectureType > archsWithSupportingCpus = new java.util.HashSet < > ( ) ; archsWithSupportingCpus.add ( ArchitectureType.undefined ) ; for ( org.ovirt.engine.core.common.businessentities.ServerCpu cpu : clusterModel.getCPU ( ) . getItems ( ) ) { archsWithSupportingCpus.add ( cpu.getArchitecture ( ) ) ; } clusterModel.getArchitecture ( ) . setItems ( archsWithSupportingCpus ) ; }

Target:
private void initSupportedArchitectures ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.ArchitectureType > archsWithSupportingCpus = new java.util.HashSet < > ( ) ; archsWithSupportingCpus.add ( ArchitectureType.undefined ) ; for ( org.ovirt.engine.core.common.businessentities.ServerCpu cpu : getCPU ( ) . getItems ( ) ) { archsWithSupportingCpus.add ( cpu.getArchitecture ( ) ) ; } getArchitecture ( ) . setItems ( archsWithSupportingCpus ) ; }
Source:
public void executeCommand ( ) { cmd.setGlusterVolumeId ( volumeId1 ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_DETAILS_REFRESH , cmd.getAuditLogTypeValue ( ) ) ; org.mockito.Mockito.verify ( syncJob , org.mockito.Mockito.times ( 1 ) ) . refreshVolumeDetails ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class ) ) ; }

Target:
public void executeCommand ( ) { cmd.setGlusterVolumeId ( volumeId1 ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_DETAILS_REFRESH , cmd.getAuditLogTypeValue ( ) ) ; org.mockito.Mockito.verify ( syncJob , org.mockito.Mockito.times ( 1 ) ) . refreshVolumeDetails ( org.mockito.Matchers.any ( ) , org.mockito.Matchers.any ( ) ) ; }