auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onSucceeded ( ) { updateEntityPhase ( ImageTransferPhase.FINISHED_SUCCESS ) ; log.debug ( "Removing ImageUpload id {}" , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; getImageTransferDao ( ) . remove ( org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.endSuccessfully ( ) ; log.info ( "Successfully uploaded (command id '{}')" , getUploadDescription ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; }

Target:
public void onFailed ( ) { updateEntityPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; log.debug ( "Removing ImageUpload id {}" , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; imageTransferDao.remove ( org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.endWithFailure ( ) ; log.error ( "Failed to upload (command id '{}')" , getUploadDescription ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getCommandId ( ) ) ; }
Source:
public void persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { commandsCache.put ( cmdEntity ) ; if ( cmdEntity.isCallBackEnabled ( ) ) { buildCmdHierarchy ( cmdEntity ) ; } }

Target:
public void persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { commandsCache.put ( cmdEntity ) ; if ( cmdEntity.isCallBackEnabled ( ) ) { buildCmdHierarchy ( cmdEntity ) ; if ( ! ( cmdEntity.isCallBackNotified ( ) ) ) { cmdExecutor.addToCallBackMap ( cmdEntity ) ; } } }
Source:
protected void SetValue ( java.lang.String name , java.lang.String value , java.lang.String version ) { org.ovirt.engine.core.common.businessentities.VdcOption vdcOption = dbfacade.getVdcOptionDAO ( ) . getByNameAndVersion ( name , version ) ; vdcOption.setoption_value ( value ) ; dbfacade.getVdcOptionDAO ( ) . update ( vdcOption ) ; try { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils._vdcOptionCache.get ( vdcOption.getoption_name ( ) ) . put ( version , org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.GetValue ( vdcOption ) ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.log.errorFormat ( "Could not update option {0} in cache." , name ) ; } }

Target:
protected void SetValue ( java.lang.String name , java.lang.String value , java.lang.String version ) { org.ovirt.engine.core.common.businessentities.VdcOption vdcOption = dbfacade.getVdcOptionDao ( ) . getByNameAndVersion ( name , version ) ; vdcOption.setoption_value ( value ) ; dbfacade.getVdcOptionDao ( ) . update ( vdcOption ) ; try { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils._vdcOptionCache.get ( vdcOption.getoption_name ( ) ) . put ( version , org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.GetValue ( vdcOption ) ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.log.errorFormat ( "Could not update option {0} in cache." , name ) ; } }
Source:
protected org.ovirt.engine.core.compat.Guid removeImage ( java.lang.String taskKey , org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters parameters ) { org.ovirt.engine.core.compat.Guid taskId = enclosingCommand.persistAsyncTaskPlaceHolder ( taskKey ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsRetValue = removeImage ( parameters ) ; if ( vdsRetValue.getSucceeded ( ) ) { org.ovirt.engine.core.compat.Guid guid = enclosingCommand.createTask ( taskId , vdsRetValue.getCreationInfo ( ) , enclosingCommand.getActionType ( ) ) ; enclosingCommand.getTaskIdList ( ) . add ( guid ) ; return guid ; } return ( vdsRetValue.getVdsError ( ) . getCode ( ) ) == ( org.ovirt.engine.core.common.errors.VdcBllErrors.ImageDoesNotExistInDomainError ) ? org.ovirt.engine.core.compat.Guid.Empty : null ; }

Target:
protected org.ovirt.engine.core.compat.Guid removeImage ( java.lang.String taskKey , org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters parameters ) { org.ovirt.engine.core.compat.Guid taskId = enclosingCommand.persistAsyncTaskPlaceHolder ( taskKey ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsRetValue = removeImage ( parameters ) ; if ( vdsRetValue.getSucceeded ( ) ) { org.ovirt.engine.core.compat.Guid guid = createTask ( taskId , vdsRetValue ) ; enclosingCommand.getTaskIdList ( ) . add ( guid ) ; return guid ; } else { enclosingCommand.deleteAsyncTaskPlaceHolder ( taskKey ) ; return ( vdsRetValue.getVdsError ( ) . getCode ( ) ) == ( org.ovirt.engine.core.common.errors.VdcBllErrors.ImageDoesNotExistInDomainError ) ? org.ovirt.engine.core.compat.Guid.Empty : null ; } }
Source:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { 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.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters params = new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( ) ; params.setFilterOutExistingHosts ( filterOutExistingHosts ) ; params.setProviderId ( providerId ) ; params.setSearchFilter ( searchFilter ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , params , aQuery ) ; }

Target:
public static void isSupportBridgesReportByVDSM ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportBridgesReportByVDSM ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public static void getRpmVersion ( 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.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public static void getClusterGlusterServices ( 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 ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity masterVolume = org.ovirt.engine.core.bll.gluster.GetNonEligibilityReasonsOfVolumeForGeoRepSessionQuery.getGlusterVolumeDao ( ) . getById ( org.ovirt.engine.core.bll.gluster.GetNonEligibilityReasonsOfVolumeForGeoRepSessionQuery.getParameters ( ) . getId ( ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity slaveVolume = org.ovirt.engine.core.bll.gluster.GetNonEligibilityReasonsOfVolumeForGeoRepSessionQuery.getGlusterVolumeDao ( ) . getById ( org.ovirt.engine.core.bll.gluster.GetNonEligibilityReasonsOfVolumeForGeoRepSessionQuery.getParameters ( ) . getSlaveVolumeId ( ) ) ; org.ovirt.engine.core.bll.gluster.GetNonEligibilityReasonsOfVolumeForGeoRepSessionQuery.getQueryReturnValue ( ) . setReturnValue ( getNonEligibilityReasons ( masterVolume , slaveVolume ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity masterVolume = glusterVolumeDao.getById ( org.ovirt.engine.core.bll.gluster.GetNonEligibilityReasonsOfVolumeForGeoRepSessionQuery.getParameters ( ) . getId ( ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity slaveVolume = glusterVolumeDao.getById ( org.ovirt.engine.core.bll.gluster.GetNonEligibilityReasonsOfVolumeForGeoRepSessionQuery.getParameters ( ) . getSlaveVolumeId ( ) ) ; org.ovirt.engine.core.bll.gluster.GetNonEligibilityReasonsOfVolumeForGeoRepSessionQuery.getQueryReturnValue ( ) . setReturnValue ( getNonEligibilityReasons ( masterVolume , slaveVolume ) ) ; }
Source:
protected boolean isStorageDomainNotInPool ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain ) { boolean returnValue = false ; if ( storageDomain != null ) { returnValue = getDbFacade ( ) . getStoragePoolIsoMapDAO ( ) . getAllForStorage ( storageDomain.getId ( ) ) . isEmpty ( ) ; if ( ! returnValue ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ; } } return returnValue ; }

Target:
protected boolean isStorageDomainNotInPool ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain ) { boolean returnValue = false ; if ( storageDomain != null ) { returnValue = getDbFacade ( ) . getStoragePoolIsoMapDao ( ) . getAllForStorage ( storageDomain.getId ( ) ) . isEmpty ( ) ; if ( ! returnValue ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ; } } return returnValue ; }
Source:
private void persistTopology ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > reportedNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > userConfiguredNics ) { final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersister networkInterfacesPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersisterImpl ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getInterfaceDao ( ) , reportedNics , dbNics , userConfiguredNics ) ; networkInterfacesPersister.persistTopology ( ) ; }

Target:
private void persistTopology ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > reportedNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > userConfiguredNics ) { final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersister networkInterfacesPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersisterImpl ( interfaceDao , reportedNics , dbNics , userConfiguredNics ) ; networkInterfacesPersister.persistTopology ( ) ; }
Source:
private void fillEngineConfigMap ( ) { engineConfigMap.setVersion ( parseOptionKey ( OptionKey.OPTION_VERSION ) ) ; engineConfigMap.setAlternateConfigFile ( parseOptionKey ( OptionKey.OPTION_CONFIG ) ) ; engineConfigMap.setAlternatePropertiesFile ( parseOptionKey ( OptionKey.OPTION_PROPERTIES ) ) ; engineConfigMap.setUser ( parseOptionKey ( OptionKey.OPTION_USER ) ) ; engineConfigMap.setAdminPassFile ( parseOptionKey ( OptionKey.OPTION_ADMINPASSFILE ) ) ; engineConfigMap.setOnlyReloadable ( parseOptionKey ( OptionKey.OPTION_ONLY_RELOADABLE ) ) ; }

Target:
private void fillEngineConfigMap ( ) { engineConfigMap.setVersion ( parseOptionKey ( OptionKey.OPTION_VERSION ) ) ; engineConfigMap.setAlternateConfigFile ( parseOptionKey ( OptionKey.OPTION_CONFIG ) ) ; engineConfigMap.setAlternatePropertiesFile ( parseOptionKey ( OptionKey.OPTION_PROPERTIES ) ) ; engineConfigMap.setUser ( parseOptionKey ( OptionKey.OPTION_USER ) ) ; engineConfigMap.setAdminPassFile ( parseOptionKey ( OptionKey.OPTION_ADMINPASSFILE ) ) ; engineConfigMap.setOnlyReloadable ( parseOptionKey ( OptionKey.OPTION_ONLY_RELOADABLE ) ) ; engineConfigMap.setLogFile ( parseOptionKey ( OptionKey.OPTION_LOG_FILE ) ) ; engineConfigMap.setLogLevel ( parseOptionKey ( OptionKey.OPTION_LOG_LEVEL ) ) ; engineConfigMap.setLog4jConfig ( parseOptionKey ( OptionKey.OPTION_LOG4J_CONFIG ) ) ; }
Source:
private void addVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( getVmId ( ) ) ; tempVar.setStatus ( VMStatus.ImageLocked ) ; tempVar.setVmHost ( "" ) ; tempVar.setVmIp ( "" ) ; tempVar.setAppList ( getParameters ( ) . getVm ( ) . getDynamicData ( ) . getAppList ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getVmDynamicDAO ( ) . save ( tempVar ) ; org.ovirt.engine.core.bll.ImportVmCommand.getCompensationContext ( ) . snapshotNewEntity ( tempVar ) ; }

Target:
private void addVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( getVmId ( ) ) ; tempVar.setStatus ( VMStatus.ImageLocked ) ; tempVar.setVmHost ( "" ) ; tempVar.setVmIp ( "" ) ; tempVar.setVmFQDN ( "" ) ; tempVar.setAppList ( getParameters ( ) . getVm ( ) . getDynamicData ( ) . getAppList ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getVmDynamicDAO ( ) . save ( tempVar ) ; org.ovirt.engine.core.bll.ImportVmCommand.getCompensationContext ( ) . snapshotNewEntity ( tempVar ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc powerDown ( java.lang.String vmId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.shutdown ( vmId ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesReturnForXmlRpc glusterServicesList ( org.ovirt.engine.core.compat.Guid serverId , java.lang.String [ ] serviceNames ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterServicesGet ( serviceNames ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesReturnForXmlRpc ( serverId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } getView ( ) . edit ( modelProvider.getModel ( ) ) ; setupConsole ( modelProvider ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { getView ( ) . clear ( ) ; return ; } getView ( ) . edit ( modelProvider.getModel ( ) ) ; getView ( ) . displayVmOsImages ( true ) ; setupDisks ( modelProvider ) ; setupConsole ( modelProvider ) ; }
Source:
public void getIsGlusterVolumeSnapshotCliScheduleEnabled ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotCliScheduleFlag , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , 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:
public void testVdsGroupCorrectStoragePoolName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > result = dao.getAllForStoragePool ( storagePool.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup group : result ) { org.junit.Assert.assertEquals ( storagePool.getName ( ) , group.getStoragePoolName ( ) ) ; } }

Target:
public void testClusterCorrectStoragePoolName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > result = dao.getAllForStoragePool ( storagePool.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster group : result ) { org.junit.Assert.assertEquals ( storagePool.getName ( ) , group.getStoragePoolName ( ) ) ; } }
Source:
protected void endWithFailure ( ) { org.ovirt.engine.core.compat.Guid previouslyActiveSnapshotId = getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVmId ( ) , SnapshotType.PREVIEW , SnapshotStatus.LOCKED ) ; getSnapshotDao ( ) . remove ( previouslyActiveSnapshotId ) ; getSnapshotDao ( ) . remove ( getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVmId ( ) , SnapshotType.ACTIVE ) ) ; snapshotsManager.addActiveSnapshot ( previouslyActiveSnapshotId , org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) , org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getCompensationContext ( ) ) ; super . endWithFailure ( ) ; }

Target:
protected void endWithFailure ( ) { org.ovirt.engine.core.common.businessentities.Snapshot previouslyActiveSnapshot = getSnapshotDao ( ) . get ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVmId ( ) , SnapshotType.PREVIEW , SnapshotStatus.LOCKED ) ; getSnapshotDao ( ) . remove ( previouslyActiveSnapshot.getId ( ) ) ; getSnapshotDao ( ) . remove ( getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVmId ( ) , SnapshotType.ACTIVE ) ) ; snapshotsManager.addActiveSnapshot ( previouslyActiveSnapshot.getId ( ) , org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) , previouslyActiveSnapshot.getMemoryVolume ( ) , org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getCompensationContext ( ) ) ; super . endWithFailure ( ) ; }
Source:
public void setMigrationHandler ( org.ovirt.engine.core.bll.scheduling.MigrationHandler migrationHandler ) { if ( ( this . migrationHandler ) != null ) { throw new java.lang.RuntimeException ( "Load balance migration handler should be set only once" ) ; } this . migrationHandler = migrationHandler ; }

Target:
public void enableHaReservationCheck ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start HA Reservation check" ) ; java.lang.Integer interval = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsHaReservationIntervalInMinutes ) ; org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.class ) . scheduleAFixedDelayJob ( this , "performHaResevationCheck" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , interval , interval , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished HA Reservation check" ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionListReturnForXmlRpc getStorageConnectionsList ( java.lang.String spUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getStorageConnectionsList ( spUUID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.ServerConnectionListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc createVolumeContainer ( java.lang.String sdUUID , java.lang.String imgGUID , java.lang.String size , int volFormat , int diskType , java.lang.String volUUID , java.lang.String descr , java.lang.String srcImgGUID , java.lang.String srcVolUUID ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.createVolumeContainer ( sdUUID , imgGUID , size , volFormat , diskType , volUUID , descr , srcImgGUID , srcVolUUID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; }
Source:
private void addVideoCardByDisplayType ( org.ovirt.engine.core.common.businessentities.DisplayType displayType ) { java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; struct.put ( VdsProperties.Type , VmDeviceType.VIDEO.getName ( ) ) ; struct.put ( VdsProperties.Device , displayType.getVmDeviceType ( ) . getName ( ) ) ; struct.put ( VdsProperties.SpecParams , org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.getNewMonitorSpecParams ( ) ) ; struct.put ( VdsProperties.DeviceId , java.lang.String.valueOf ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ) ; devices.add ( struct ) ; }

Target:
private void addVideoCardByDisplayType ( org.ovirt.engine.core.common.businessentities.DisplayType displayType ) { java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; struct.put ( VdsProperties.Type , VmDeviceGeneralType.VIDEO.getValue ( ) ) ; struct.put ( VdsProperties.Device , displayType.getVmDeviceType ( ) . getName ( ) ) ; struct.put ( VdsProperties.SpecParams , org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.getNewMonitorSpecParams ( ) ) ; struct.put ( VdsProperties.DeviceId , java.lang.String.valueOf ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ; devices.add ( struct ) ; }
Source:
public void validateWrongDiskImageTypeTemplate ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initTemplateDiskImage ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_IS_NOT_VM_DISK.toString ( ) ) ) ; }

Target:
public void validateWrongDiskImageTypeTemplate ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.TEMPLATE ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_IS_NOT_VM_DISK.toString ( ) ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( "IsAvailable" . equals ( ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ) ) { getView ( ) . setHostProviderVisibility ( model.getProviderSearchFilter ( ) . getIsAvailable ( ) ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { getView ( ) . flush ( ) ; getView ( ) . getTestButton ( ) . getCommand ( ) . execute ( ) ; }
Source:
public void validateSucceeds ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.singletonList ( getStorageDevice ( "sda" ) ) , getStorageDevice ( "sdb" ) , org.ovirt.engine.core.common.businessentities.CacheModeType.writethrough , 10 ) ) . when ( cmd ) . getParameters ( ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void validateSucceeds ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.singletonList ( getStorageDevice ( "sda" ) ) , getStorageDevice ( "sdb" ) , org.ovirt.engine.core.common.businessentities.CacheModeType.writethrough , 10 ) ) . when ( cmd ) . getParameters ( ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.jupiter.api.Assertions.assertTrue ( cmd.validate ( ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetStorageDomainsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ ( ( NAMES.length ) - 1 ) ] } , setUpStorageDomains ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { org.junit.Assert.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetStorageDomainsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ ( ( NAMES.length ) - 1 ) ] } , setUpStorageDomains ( ) , failure ) ; }
Source:
public org.ovirt.engine.api.model.ReportedDevices list ( ) { org.ovirt.engine.api.model.ReportedDevices model = new org.ovirt.engine.api.model.ReportedDevices ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface device : getCollection ( ) ) { model.getReportedDevices ( ) . add ( addLinks ( org.ovirt.engine.api.restapi.types.ReportedDeviceMapper.map ( device , new org.ovirt.engine.api.model.Device ( ) ) ) ) ; } return model ; }

Target:
public org.ovirt.engine.api.model.ReportedDevices list ( ) { org.ovirt.engine.api.model.ReportedDevices model = new org.ovirt.engine.api.model.ReportedDevices ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface device : getCollection ( ) ) { model.getReportedDevices ( ) . add ( addLinks ( org.ovirt.engine.api.restapi.types.ReportedDeviceMapper.map ( device , new org.ovirt.engine.api.model.ReportedDevice ( ) ) ) ) ; } return model ; }
Source:
public javax.ws.rs.core.Response performRemove ( java.lang.String id ) { getEntity ( id ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( org.ovirt.engine.api.restapi.types.DiskMapper.map ( getDiskSubResource ( id ) . get ( ) , null ) ) ) ; return performAction ( VdcActionType.RemoveDiskSnapshots , new org.ovirt.engine.core.common.action.RemoveDiskSnapshotsParameters ( diskImage.getImageId ( ) ) ) ; }

Target:
public org.ovirt.engine.api.resource.SnapshotDiskResource getDiskSubResource ( java.lang.String id ) { return inject ( new org.ovirt.engine.api.restapi.resource.BackendSnapshotDiskResource ( id , this ) ) ; }
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 getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( p.getvds_group_id ( ) . equals ( vm.getvds_group_id ( ) ) ) && ( org.ovirt.engine.core.bll.RunVmCommandBase.hasMemoryToRunVM ( p , vm ) ) ) && ( org.ovirt.engine.core.bll.RunVmCommandBase.hasCpuToRunVM ( p , vm ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( p.getvds_group_id ( ) . equals ( vm.getVdsGroupId ( ) ) ) && ( org.ovirt.engine.core.bll.RunVmCommandBase.hasMemoryToRunVM ( p , vm ) ) ) && ( org.ovirt.engine.core.bll.RunVmCommandBase.hasCpuToRunVM ( p , vm ) ) ; }
Source:
private org.ovirt.engine.core.bll.context.CompensationContext createCompensationContext ( org.ovirt.engine.core.compat.TransactionScopeOption transactionScopeOption , boolean forceCompensation ) { if ( ( transactionScopeOption == ( org.ovirt.engine.core.compat.TransactionScopeOption.Suppress ) ) && ( ! forceCompensation ) ) { return org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) ; } org.ovirt.engine.core.bll.context.DefaultCompensationContext defaultContext = new org.ovirt.engine.core.bll.context.DefaultCompensationContext ( ) ; defaultContext.setCommandId ( commandId ) ; defaultContext.setCommandType ( getClass ( ) . getName ( ) ) ; defaultContext.setBusinessEntitySnapshotDAO ( getBusinessEntitySnapshotDAO ( ) ) ; defaultContext.setSnapshotSerializer ( org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) ) ; return defaultContext ; }

Target:
protected org.ovirt.engine.core.bll.context.DefaultCompensationContext createDefaultCompensationContext ( org.ovirt.engine.core.compat.Guid commandId ) { org.ovirt.engine.core.bll.context.DefaultCompensationContext defaultContext = new org.ovirt.engine.core.bll.context.DefaultCompensationContext ( ) ; defaultContext.setCommandId ( commandId ) ; defaultContext.setCommandType ( getClass ( ) . getName ( ) ) ; defaultContext.setBusinessEntitySnapshotDAO ( getBusinessEntitySnapshotDAO ( ) ) ; defaultContext.setSnapshotSerializer ( org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) ) ; return defaultContext ; }
Source:
public static void getDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
protected java.util.Map < java.lang.String , java.lang.String > getExclusiveLocks ( ) { if ( ( getSourceVmFromDb ( ) ) == null ) { return null ; } return java.util.Collections.singletonMap ( getSourceVmFromDb ( ) . getId ( ) . toString ( ) , LockingGroup.VM.name ( ) ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ( getSourceVmFromDb ( ) ) == null ) { return null ; } return java.util.Collections.singletonMap ( getSourceVmFromDb ( ) . getId ( ) . toString ( ) , LockMessagesMatchUtil.VM ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.Cancel ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.cancel ( ) ; } }
Source:
protected void addStoragePermissionByQuotaMode ( java.util.List < org.ovirt.engine.core.common.PermissionSubject > permsList , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid StorageDomainId ) { org.ovirt.engine.core.common.businessentities.storage_pool storagePool = null ; if ( storagePoolId != null ) { storagePool = org.ovirt.engine.core.bll.CommandBase.getStoragePoolDAO ( ) . get ( storagePoolId ) ; if ( storagePool != null ) { if ( ( storagePool.getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) { permsList.add ( new org.ovirt.engine.core.common.PermissionSubject ( StorageDomainId , org.ovirt.engine.core.common.VdcObjectType.Storage , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_DISK ) ) ; } } } }

Target:
protected void addStoragePermissionByQuotaMode ( java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permsList , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid StorageDomainId ) { org.ovirt.engine.core.common.businessentities.storage_pool storagePool = null ; if ( storagePoolId != null ) { storagePool = org.ovirt.engine.core.bll.CommandBase.getStoragePoolDAO ( ) . get ( storagePoolId ) ; if ( storagePool != null ) { if ( ( storagePool.getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) { permsList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( StorageDomainId , org.ovirt.engine.core.common.VdcObjectType.Storage , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_DISK ) ) ; } } } }
Source:
private boolean vmDeviceChanged ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType deviceType , java.lang.String device , boolean deviceEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.bll.UpdateVmCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmId ( ) , deviceType , device ) ; return deviceEnabled == ( vmDevices.isEmpty ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.GraphicsDevice getGraphicsDevOfType ( org.ovirt.engine.core.common.businessentities.GraphicsType type ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = getGraphicsDevices ( ) ; for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice dev : graphicsDevices ) { if ( ( dev.getGraphicsType ( ) ) == type ) { return dev ; } } return null ; }
Source:
protected void setImagesToModel ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , java.util.List < java.lang.String > images ) { java.lang.String oldCdImage = model.getCdImage ( ) . getSelectedItem ( ) ; model.getCdImage ( ) . setItems ( images ) ; model.getCdImage ( ) . setSelectedItem ( ( oldCdImage != null ? oldCdImage : org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( images ) ) ) ; }

Target:
protected void setImagesToModel ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , java.util.List < java.lang.String > images ) { java.lang.String oldCdImage = model.getCdImage ( ) . getSelectedItem ( ) ; model.getCdImage ( ) . setItems ( images ) ; model.getCdImage ( ) . setSelectedItem ( ( oldCdImage != null ? oldCdImage : org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( images ) ) ) ; }
Source:
public void getUsbPolicyUsbTypeNative ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; usb.setType ( "native" ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; assert org.ovirt.engine.api.restapi.resource.utils.UsbResourceUtils.getUsbPolicy ( usb , vdsGroup ) . equals ( UsbPolicy.ENABLED_NATIVE ) ; }

Target:
public void getUsbPolicyUsbTypeNative ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; usb.setType ( "native" ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.utils.UsbResourceUtils.getUsbPolicy ( usb , vdsGroup ) , UsbPolicy.ENABLED_NATIVE ) ; }
Source:
protected org.ovirt.engine.core.bll.CommandBase < ? > constructCommand ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , boolean runAsInternal , org.ovirt.engine.core.bll.context.CommandContext context ) { org.ovirt.engine.core.bll.job.ExecutionHandler.evaluateCorrelationId ( parameters ) ; org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.CreateCommand ( actionType , parameters ) ; command.setInternalExecution ( runAsInternal ) ; command.setContext ( context ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , actionType , runAsInternal ) ; return command ; }

Target:
public void deleteAsyncTaskPlaceHolder ( java.lang.String taskKey ) { org.ovirt.engine.core.compat.Guid taskId = taskKeyToTaskIdMap.remove ( taskKey ) ; if ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( taskId ) ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.removeTaskFromDbByTaskId ( taskId ) ; } }
Source:
public boolean validate ( ) { org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation valueValidation = new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) ; getSelectedKey ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { valueValidation } ) ; getValue ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { valueValidation } ) ; return ( getSelectedKey ( ) . getIsValid ( ) ) && ( getValue ( ) . getIsValid ( ) ) ; }

Target:
public void setOptionsMap ( java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > optionsMap ) { this . optionsMap = optionsMap ; getKeyList ( ) . setItems ( new java.util.ArrayList < java.lang.String > ( getOptionsMap ( ) . keySet ( ) ) , getKeyList ( ) . getSelectedItem ( ) ) ; }
Source:
public void starting ( org.junit.runner.Description description ) { origConfUtils = org.ovirt.engine.core.common.config.Config.getConfigUtils ( ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ) ; for ( org.ovirt.engine.core.utils.MockConfigRule.MockConfigDescriptor < ? > config : configs ) { mockConfigValue ( config.getValue ( ) , config.getVersion ( ) , config.getReturnValue ( ) ) ; } }

Target:
public < T > void mockConfigValue ( org.ovirt.engine.core.common.config.ConfigValues value , org.ovirt.engine.core.compat.Version version , T returnValue ) { mockConfigValue ( value , version.getValue ( ) , returnValue ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotUnplugNic ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotunplugNic ( info.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotPlugNic ( java.util.Map info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotplugNic ( info ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected void executeQueryCommand ( ) { java.lang.String domain = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getDomain ( ) ; org.ovirt.engine.core.common.utils.ExternalId id = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.bll.adbroker.LdapBroker broker = org.ovirt.engine.core.bll.adbroker.LdapFactory.getInstance ( domain ) ; org.ovirt.engine.core.common.businessentities.LdapUser user = ( ( org.ovirt.engine.core.common.businessentities.LdapUser ) ( broker.RunAdAction ( AdActionType.GetAdUserByUserId , new org.ovirt.engine.core.bll.adbroker.LdapSearchByIdParameters ( domain , id ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getQueryReturnValue ( ) . setReturnValue ( user ) ; }

Target:
protected void executeQueryCommand ( ) { java.lang.String directoryName = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getDomain ( ) ; org.ovirt.engine.core.common.utils.ExternalId id = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.authentication.Directory directory = org.ovirt.engine.core.authentication.DirectoryManager.getInstance ( ) . getDirectory ( directoryName ) ; org.ovirt.engine.core.authentication.DirectoryUser user = directory.findUser ( id ) ; org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getQueryReturnValue ( ) . setReturnValue ( user ) ; }