auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void updateConfigValues ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = ( ( vm.getVdsGroupCompatibilityVersion ( ) ) != null ) ? vm.getVdsGroupCompatibilityVersion ( ) : new org.ovirt.engine.core.compat.Version ( ) ; isHotPlugSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.HotPlugEnabled , clusterCompatibilityVersion.toString ( ) ) ) ) ; }

Target:
protected void updateConfigValues ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = ( ( vm.getVdsGroupCompatibilityVersion ( ) ) != null ) ? vm.getVdsGroupCompatibilityVersion ( ) : new org.ovirt.engine.core.compat.Version ( ) ; isHotPlugSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.HotPlugEnabled , clusterCompatibilityVersion.toString ( ) ) ) ) ; }
Source:
private void DescendantsInternal ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.SpiceMenuItem > list , org.ovirt.engine.ui.uicommonweb.models.vms.SpiceMenuItem root ) { list.add ( root ) ; if ( root instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceMenuContainerItem ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceMenuItem item : ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceMenuContainerItem ) ( root ) ) . getItems ( ) ) { DescendantsInternal ( list , item ) ; } } }

Target:
private void descendantsInternal ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.SpiceMenuItem > list , org.ovirt.engine.ui.uicommonweb.models.vms.SpiceMenuItem root ) { list.add ( root ) ; if ( root instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceMenuContainerItem ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceMenuItem item : ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceMenuContainerItem ) ( root ) ) . getItems ( ) ) { descendantsInternal ( list , item ) ; } } }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.storage.DiskImage x , org.ovirt.engine.core.common.businessentities.storage.DiskImage y ) { return ( x.getActualSize ( ) ) < ( y.getActualSize ( ) ) ? - 1 : ( x.getActualSize ( ) ) < ( y.getActualSize ( ) ) ? 1 : 0 ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.storage.DiskImage x , org.ovirt.engine.core.common.businessentities.storage.DiskImage y ) { return java.lang.Double.compare ( x.getActualSize ( ) , y.getActualSize ( ) ) ; }
Source:
private void setSelectedNetworkQoSId ( org.ovirt.engine.core.compat.Guid networkQoSId ) { for ( java.lang.Object item : getNetworkQoS ( ) . getItems ( ) ) { if ( ( ( org.ovirt.engine.core.common.businessentities.network.NetworkQoS ) ( item ) ) . getId ( ) . equals ( networkQoSId ) ) { getNetworkQoS ( ) . setSelectedItem ( item ) ; return ; } } setSelectedNetworkQoSId ( Guid.Empty ) ; }

Target:
private void setSelectedNetworkQoSId ( org.ovirt.engine.core.compat.Guid networkQoSId ) { for ( java.lang.Object item : getNetworkQoS ( ) . getItems ( ) ) { if ( ( ( org.ovirt.engine.core.common.businessentities.network.NetworkQoS ) ( item ) ) . getId ( ) . equals ( networkQoSId ) ) { getNetworkQoS ( ) . setSelectedItem ( item ) ; return ; } } getNetworkQoS ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.getEmptyQos ( ) ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile ) { return getCustomMapSqlParameterSource ( ) . addValue ( "id" , profile.getId ( ) ) . addValue ( "name" , profile.getName ( ) ) . addValue ( "network_id" , profile.getNetworkId ( ) ) . addValue ( "port_mirroring" , profile.isPortMirroring ( ) ) . addValue ( "custom_properties" , profile.getCustomProperties ( ) ) ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile ) { return createIdParameterMapper ( profile.getId ( ) ) . addValue ( "name" , profile.getName ( ) ) . addValue ( "network_id" , profile.getNetworkId ( ) ) . addValue ( "port_mirroring" , profile.isPortMirroring ( ) ) . addValue ( "description" , profile.getDescription ( ) ) . addValue ( "custom_properties" , org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) . serialize ( profile.getCustomProperties ( ) ) ) ; }
Source:
public void freeMac ( java.lang.String mac ) { org.ovirt.engine.core.bll.MacPoolManager.log.infoFormat ( "MacPoolManager::freeMac(mac = '{0}') - entered" , mac ) ; synchronized ( mLocObj ) { if ( ! ( mInitialized ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.MAC_POOL_NOT_INITIALIZED ) ; } if ( mAllocatedCustomMacs.contains ( mac ) ) { mAllocatedCustomMacs.remove ( mac ) ; } else if ( mAllocatedMacs.contains ( mac ) ) { mAllocatedMacs.remove ( mac ) ; mAvailableMacs.add ( mac ) ; } } }

Target:
public void freeMac ( java.lang.String mac ) { org.ovirt.engine.core.bll.MacPoolManager.log.infoFormat ( "MacPoolManager::freeMac(mac = '{0}') - entered" , mac ) ; mLocObj.writeLock ( ) . lock ( ) ; try { if ( ! ( mInitialized ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.MAC_POOL_NOT_INITIALIZED ) ; } internalFreeMac ( mac ) ; } finally { mLocObj.writeLock ( ) . unlock ( ) ; } }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetPermissionsByAdElementId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , setUpPermissions ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetPermissionsOnBehalfByAdElementId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , setUpPermissions ( ) , failure ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.WatchDog model , org.ovirt.engine.core.common.businessentities.VmWatchdog entity ) { org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setModel ( org.ovirt.engine.core.common.businessentities.VmWatchdogType.getByName ( model.getModel ( ) ) ) ; params.setAction ( org.ovirt.engine.core.common.businessentities.VmWatchdogAction.getByName ( model.getAction ( ) ) ) ; params.setId ( parentId ) ; params.setVm ( isVm ( parentId ) ) ; return params ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.WatchDog model , org.ovirt.engine.core.common.businessentities.VmWatchdog entity ) { validateEnums ( org.ovirt.engine.api.model.WatchDog.class , model ) ; org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setModel ( org.ovirt.engine.core.common.businessentities.VmWatchdogType.getByName ( model.getModel ( ) ) ) ; params.setAction ( org.ovirt.engine.core.common.businessentities.VmWatchdogAction.getByName ( model.getAction ( ) ) ) ; params.setId ( parentId ) ; params.setVm ( isVm ( parentId ) ) ; return params ; }
Source:
public void testSaveInterfaceForVds ( ) { newVdsInterface.setVdsId ( org.ovirt.engine.core.dao.network.InterfaceDaoTest.VDS_ID ) ; dao.saveInterfaceForVds ( newVdsInterface ) ; dao.saveStatisticsForVds ( newVdsStatistics ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > result = dao.getAllInterfacesForVds ( org.ovirt.engine.core.dao.network.InterfaceDaoTest.VDS_ID ) ; boolean found = false ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : result ) { found |= ( iface.getName ( ) . equals ( newVdsInterface.getName ( ) ) ) && ( iface.getQos ( ) . equals ( newVdsInterface.getQos ( ) ) ) ; } org.junit.Assert.assertTrue ( found ) ; }

Target:
public void testSaveInterfaceForVds ( ) { newVdsInterface.setVdsId ( org.ovirt.engine.core.dao.network.InterfaceDaoImplTest.VDS_ID ) ; dao.saveInterfaceForVds ( newVdsInterface ) ; dao.saveStatisticsForVds ( newVdsStatistics ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > result = dao.getAllInterfacesForVds ( org.ovirt.engine.core.dao.network.InterfaceDaoImplTest.VDS_ID ) ; boolean found = false ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : result ) { found |= ( iface.getName ( ) . equals ( newVdsInterface.getName ( ) ) ) && ( iface.getQos ( ) . equals ( newVdsInterface.getQos ( ) ) ) ; } org.junit.Assert.assertTrue ( found ) ; }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( masterDomain.getStoragePoolIsoMapData ( ) ) ; masterDomain.setStatus ( StorageDomainStatus.Locked ) ; getDbFacade ( ) . getStoragePoolIsoMapDao ( ) . update ( masterDomain.getStoragePoolIsoMapData ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { detachStorageDomainWithEntities ( masterDomain ) ; getCompensationContext ( ) . snapshotEntity ( masterDomain.getStorageStaticData ( ) ) ; masterDomain.setStorageDomainType ( StorageDomainType.Data ) ; getDbFacade ( ) . getStorageDomainStaticDao ( ) . update ( masterDomain.getStorageStaticData ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
protected org.ovirt.engine.api.model.Permissions mapCollection ( java.util.List < org.ovirt.engine.core.common.businessentities.permissions > entities ) { org.ovirt.engine.api.model.Permissions collection = new org.ovirt.engine.api.model.Permissions ( ) ; for ( org.ovirt.engine.core.common.businessentities.permissions entity : entities ) { if ( ( entity.getObjectType ( ) ) != ( org.ovirt.engine.core.common.VdcObjectType.System ) ) { org.ovirt.engine.api.model.Permission permission = map ( entity , getUserById ( entity.getad_element_id ( ) ) ) ; collection.getPermissions ( ) . add ( addLinks ( permission , ( ( permission.getUser ( ) ) != null ? suggestedParentType : org.ovirt.engine.api.model.Group.class ) ) ) ; } } return collection ; }

Target:
protected org.ovirt.engine.api.model.Permissions mapCollection ( java.util.Set < org.ovirt.engine.core.common.businessentities.permissions > entities ) { org.ovirt.engine.api.model.Permissions collection = new org.ovirt.engine.api.model.Permissions ( ) ; for ( org.ovirt.engine.core.common.businessentities.permissions entity : entities ) { org.ovirt.engine.api.model.Permission permission = map ( entity , getUserById ( entity.getad_element_id ( ) ) ) ; collection.getPermissions ( ) . add ( addLinks ( permission , ( ( permission.getUser ( ) ) != null ? suggestedParentType : org.ovirt.engine.api.model.Group.class ) ) ) ; } return collection ; }
Source:
private org.ovirt.engine.core.common.mode.ApplicationMode findApplicationMode ( java.lang.String sessionId ) { org.ovirt.engine.core.common.queries.GetConfigurationValueParameters parameters = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.config.ConfigValues.ApplicationMode , org.ovirt.engine.core.common.config.ConfigCommon.defaultConfigurationVersion ) ; parameters.setSessionId ( sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runPublicQuery ( QueryType.GetConfigurationValue , parameters ) ; return org.ovirt.engine.core.common.mode.ApplicationMode.from ( result.getReturnValue ( ) ) ; }

Target:
private org.ovirt.engine.core.common.mode.ApplicationMode findApplicationMode ( java.lang.String sessionId ) { org.ovirt.engine.core.common.queries.GetConfigurationValueParameters parameters = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.config.ConfigValues.ApplicationMode , org.ovirt.engine.core.common.config.ConfigCommon.defaultConfigurationVersion ) ; parameters.setSessionId ( sessionId ) ; org.ovirt.engine.core.common.queries.QueryReturnValue result = backend.runPublicQuery ( QueryType.GetConfigurationValue , parameters ) ; return org.ovirt.engine.core.common.mode.ApplicationMode.from ( result.getReturnValue ( ) ) ; }
Source:
private void InitSpmPriorities ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxSpmPriority ( 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.webadmin.section.main.view.tab.MainTabHostView view = ( ( org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabHostView ) ( target ) ) ; view.maxSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; InitSpmPriorities1 ( ) ; } } ) ) ; }

Target:
private void InitSpmPriorities ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.lang.Integer > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Integer returnValue ) { maxSpmPriority = returnValue ; InitSpmPriorities1 ( ) ; } } ) ) ; }
Source:
public void testVmInPreview ( ) { setUpGeneralValidations ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW.name ( ) ) ) ; }

Target:
public void testVmInPreview ( ) { setUpGeneralValidations ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW.name ( ) ) ) ; }
Source:
com.google.gwt.http.client.RequestBuilder createRequest ( ) { com.google.gwt.http.client.RequestBuilder builder = new com.google.gwt.http.client.RequestBuilder ( com.google.gwt.http.client.RequestBuilder.GET , restApiBaseUrl ) ; builder.setHeader ( "Session-TTL" , java.lang.String.valueOf ( restApiSessionTimeout ) ) ; builder.setHeader ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.PREFER_HEADER , "persistent-auth, csrf-protection" ) ; if ( ( restApiSessionId ) != null ) { builder.setHeader ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.CSRF_HEADER , restApiSessionId ) ; } return builder ; }

Target:
com.google.gwt.http.client.RequestBuilder createRequest ( ) { com.google.gwt.http.client.RequestBuilder builder = new com.google.gwt.http.client.RequestBuilder ( com.google.gwt.http.client.RequestBuilder.GET , restApiBaseUrl ) ; builder.setHeader ( "Session-TTL" , java.lang.String.valueOf ( restApiSessionTimeout ) ) ; builder.setHeader ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.PREFER_HEADER , "persistent-auth, csrf-protection" ) ; boolean isAdmin = org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getLoggedInUser ( ) . isAdmin ( ) ; builder.setHeader ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.FILTER_HEADER , java.lang.String.valueOf ( ( ! isAdmin ) ) ) ; if ( ( restApiSessionId ) != null ) { builder.setHeader ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.CSRF_HEADER , restApiSessionId ) ; } return builder ; }
Source:
protected void validateParameters ( org.ovirt.engine.api.model.VnicProfile vnicProfile ) { validateParameters ( vnicProfile , "name" , "network.id" ) ; }

Target:
protected void validateParameters ( org.ovirt.engine.api.model.VnicProfile vnicProfile ) { validateParameters ( vnicProfile , "name" , "network.id" ) ; java.lang.String networkId = vnicProfile.getNetwork ( ) . getId ( ) ; getEntity ( org.ovirt.engine.core.common.businessentities.network.Network.class , VdcQueryType.GetNetworkById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( networkId ) ) , ( "Network: id=" + networkId ) ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.FenceVdsVDSCommandParameters setupCommandParams ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType fenceAction ) { org.ovirt.engine.core.common.businessentities.FenceAgent agent = new org.ovirt.engine.core.common.businessentities.FenceAgent ( ) ; agent.setIp ( "1.2.3.4" ) ; agent.setPort ( 1234 ) ; agent.setType ( "ipmilan" ) ; agent.setUser ( "admin" ) ; agent.setPassword ( "admin" ) ; agent.setOptions ( "" ) ; return new org.ovirt.engine.core.common.vdscommands.FenceVdsVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommandTest.PROXY_HOST_ID , org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommandTest.TARGET_HOST_ID , agent , fenceAction , null ) ; }

Target:
private org.ovirt.engine.core.common.vdscommands.FenceVdsVDSCommandParameters setupCommandParams ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType fenceAction ) { org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent = new org.ovirt.engine.core.common.businessentities.pm.FenceAgent ( ) ; agent.setIp ( "1.2.3.4" ) ; agent.setPort ( 1234 ) ; agent.setType ( "ipmilan" ) ; agent.setUser ( "admin" ) ; agent.setPassword ( "admin" ) ; agent.setOptions ( "" ) ; return new org.ovirt.engine.core.common.vdscommands.FenceVdsVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommandTest.PROXY_HOST_ID , org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommandTest.TARGET_HOST_ID , agent , fenceAction , null ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getEditConsoleCommand ( ) ) ) { editConsole ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnEditConsoleSave" ) ) { onEditConsoleSave ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , Model.CANCEL_COMMAND ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getEditConsoleCommand ( ) ) ) { editConsole ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnEditConsoleSave" ) ) { onEditConsoleSave ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , Model.CANCEL_COMMAND ) ) { cancel ( ) ; } }
Source:
private boolean SelectedItemsContainBlankTemplate ( ) { if ( ( getSelectedItems ( ) ) != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VmTemplate > cast ( getSelectedItems ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : templates ) { if ( ( template != null ) && ( template.getId ( ) . equals ( NGuid.Empty ) ) ) { return true ; } } } return false ; }

Target:
private boolean selectedItemsContainBlankTemplate ( ) { if ( ( getSelectedItems ( ) ) != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VmTemplate > cast ( getSelectedItems ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : templates ) { if ( ( template != null ) && ( template.getId ( ) . equals ( NGuid.Empty ) ) ) { return true ; } } } return false ; }
Source:
public static org.ovirt.engine.core.common.businessentities.ArchitectureType map ( org.ovirt.engine.api.model.Architecture model , org.ovirt.engine.core.common.businessentities.ArchitectureType template ) { if ( model != null ) { switch ( model ) { case UNDEFINED : return org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ; case X86_64 : return org.ovirt.engine.core.common.businessentities.ArchitectureType.x86_64 ; default : return null ; } } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.ArchitectureType map ( org.ovirt.engine.api.model.Architecture model , org.ovirt.engine.core.common.businessentities.ArchitectureType template ) { if ( model != null ) { switch ( model ) { case UNDEFINED : return org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ; case X86_64 : return org.ovirt.engine.core.common.businessentities.ArchitectureType.x86_64 ; case PPC64 : return org.ovirt.engine.core.common.businessentities.ArchitectureType.ppc64 ; default : return null ; } } return null ; }
Source:
protected void removeNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > list = org.ovirt.engine.core.bll.VmTemplateCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : list ) { vmDeviceDao.remove ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( iface.getId ( ) , org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ) ; org.ovirt.engine.core.bll.VmTemplateCommand.getVmNicDao ( ) . remove ( iface.getId ( ) ) ; } }

Target:
protected void removeNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > list = vmNicDao.getAllForTemplate ( org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : list ) { vmDeviceDao.remove ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( iface.getId ( ) , org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ) ; vmNicDao.remove ( iface.getId ( ) ) ; } }
Source:
public org.ovirt.engine.sdk.entities.Action setoption ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/setoption" ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class ) ; }

Target:
public org.ovirt.engine.sdk.entities.Action start ( org.ovirt.engine.sdk.entities.Action action , java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/start" ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . add ( "Correlation-Id" , correlationId ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }
Source:
public static void getDomainListViaPublic ( 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.RunPublicQuery ( VdcQueryType.GetDomainList , tempVar , 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 void updateChangeConnectionType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections iscsiConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( iscsiConnection ) ; org.mockito.Mockito.when ( storageConnDao.get ( iscsiConnection.getid ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_CHANGE_STORAGE_TYPE ) ; }

Target:
public void updateChangeConnectionType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections iscsiConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( iscsiConnection ) ; org.mockito.Mockito.when ( storageConnDao.get ( iscsiConnection.getid ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_CHANGE_STORAGE_TYPE ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel object ) { driver.edit ( object ) ; object.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel ) ( sender ) ) ; java.lang.String propertyName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( "SelectionNodeList" . equals ( propertyName ) ) { updateTree ( model ) ; } } } ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel object ) { driver.edit ( object ) ; object.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagListModel ) ( sender ) ) ; java.lang.String propertyName = args.propertyName ; if ( "SelectionNodeList" . equals ( propertyName ) ) { updateTree ( model ) ; } } } ) ; }
Source:
public static void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getMaxNumOfVmSockets ( 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.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
private void IsAutoAssign_EntityChanged ( java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( getIsAutoAssign ( ) . getEntity ( ) ) ) == true ) { getRunVMOnSpecificHost ( ) . setEntity ( false ) ; getRunVMOnSpecificHost ( ) . setIsChangable ( false ) ; } else { getRunVMOnSpecificHost ( ) . setIsChangable ( true ) ; } }

Target:
private void DontMigrateVM_EntityChanged ( java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( getDontMigrateVM ( ) . getEntity ( ) ) ) == true ) { clearAndDisable ( getRunVMOnSpecificHost ( ) ) ; getHostCpu ( ) . setIsChangable ( true ) ; } else { clearAndDisable ( getHostCpu ( ) ) ; getRunVMOnSpecificHost ( ) . setIsChangable ( true ) ; } }
Source:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc removeVM ( java.lang.String spUUID , java.lang.String vmGUID , java.lang.String storageDomainId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StoragePool.removeVM" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "vmUUID" , vmGUID ) . withOptionalParameter ( "storagedomainID" , storageDomainId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn removeVM ( java.lang.String spUUID , java.lang.String vmGUID , java.lang.String storageDomainId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StoragePool.removeVM" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "vmUUID" , vmGUID ) . withOptionalParameter ( "storagedomainID" , storageDomainId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDSGroup createCluster ( int index ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterHookSyncJobTest.CLUSTER_GUIDS [ index ] ) ; cluster.setName ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; cluster.setcompatibility_version ( Version.v3_2 ) ; return cluster ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDSGroup createCluster ( int index ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterHookSyncJobTest.CLUSTER_GUIDS [ index ] ) ; cluster.setName ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; cluster.setCompatibilityVersion ( Version.v3_2 ) ; return cluster ; }
Source:
private void UpdateCanSpecify ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( getNetwork ( ) . getSelectedItem ( ) ) ) ; boolean isChangeble = ( ( getIsStaticAddress ( ) ) && ( network != null ) ) && ( ! ( network.getId ( ) . equals ( NGuid.Empty ) ) ) ; getAddress ( ) . setIsChangable ( isChangeble ) ; getSubnet ( ) . setIsChangable ( isChangeble ) ; getGateway ( ) . setIsChangable ( isChangeble ) ; }

Target:
private void updateCanSpecify ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( getNetwork ( ) . getSelectedItem ( ) ) ) ; boolean isChangeble = ( ( getIsStaticAddress ( ) ) && ( network != null ) ) && ( ! ( network.getId ( ) . equals ( NGuid.Empty ) ) ) ; getAddress ( ) . setIsChangable ( isChangeble ) ; getSubnet ( ) . setIsChangable ( isChangeble ) ; getGateway ( ) . setIsChangable ( isChangeble ) ; }
Source:
public void hasMultipleHostsForLocalDC ( ) { org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VDS ( ) , new org.ovirt.engine.core.common.businessentities.VDS ( ) ) ; org.mockito.Mockito.when ( vdsDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( hosts ) ; cmd.getStoragePool ( ) . setIsLocal ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.VDS_CANNOT_ADD_MORE_THEN_ONE_HOST_TO_LOCAL_STORAGE ) ; }

Target:
public void hasMultipleHostsForLocalDC ( ) { org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VDS ( ) , new org.ovirt.engine.core.common.businessentities.VDS ( ) ) ; org.mockito.Mockito.when ( vdsDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( hosts ) ; cmd.getStoragePool ( ) . setIsLocal ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.VDS_CANNOT_ADD_MORE_THEN_ONE_HOST_TO_LOCAL_STORAGE ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpVersionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveStoragePool , org.ovirt.engine.core.common.action.StoragePoolParametersBase.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpVersionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveStoragePool , org.ovirt.engine.core.common.action.StoragePoolParametersBase.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public static boolean CanRemoveVmFromPool ( org.ovirt.engine.core.compat.Guid vmId , java.util.ArrayList < java.lang.String > messages ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDAO ( ) . getVmPoolMapByVmGuid ( vmId ) ) == null ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_DETACH_VM_NOT_ATTACHED_TO_POOL.toString ( ) ) ; returnValue = false ; } if ( returnValue ) { if ( org.ovirt.engine.core.bll.RemoveVmCommand.IsVmRunning ( vmId ) ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_RUNNING_VM_FROM_POOL.toString ( ) ) ; returnValue = false ; } } return returnValue ; }

Target:
public static boolean canRemoveVmFromPool ( org.ovirt.engine.core.compat.Guid vmId , java.util.ArrayList < java.lang.String > messages ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmPoolMapByVmGuid ( vmId ) ) == null ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_DETACH_VM_NOT_ATTACHED_TO_POOL.toString ( ) ) ; returnValue = false ; } if ( returnValue ) { if ( org.ovirt.engine.core.bll.RemoveVmCommand.IsVmRunning ( vmId ) ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_RUNNING_VM_FROM_POOL.toString ( ) ) ; returnValue = false ; } } return returnValue ; }
Source:
public java.util.Map spmStop ( java.lang.String spUUID ) { final org.ovirt.vdsmfake.domain.Host host = getActiveHost ( ) ; host.setSpmId ( ( - 1 ) ) ; host.setSpmStatus ( Host.SpmStatus.FREE ) ; host.setSpmLver ( ( - 1 ) ) ; updateHost ( host ) ; java.util.Map resultMap = getOKStatus ( ) ; org.ovirt.vdsmfake.domain.VdsmManager.getInstance ( ) . removeSpmFromMap ( spUUID ) ; return resultMap ; }

Target:
public java.util.Map spmStop ( java.lang.String spUUID ) { final org.ovirt.vdsmfake.domain.Host host = getActiveHost ( ) ; host.setSpmId ( ( - 1 ) ) ; host.setSpmStatus ( Host.SpmStatus.FREE ) ; host.setSpmLver ( ( - 1 ) ) ; updateHost ( host ) ; java.util.Map resultMap = getOKStatus ( ) ; vdsmManager.removeSpmFromMap ( spUUID ) ; return resultMap ; }
Source:
public void testGetTagVmMapByTagName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsVmMap > result = dao.getTagVmMapByTagName ( existingTag.gettag_name ( ) ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsVmMap mapping : result ) { assertEquals ( existingTag.gettag_id ( ) , mapping.gettag_id ( ) ) ; } }

Target:
public void testGetTagVmMapByByVmIdAndDefaultTag ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsVmMap > result = dao.getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.dao.TagDAOTest.EXISTING_VM_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsVmMap mapping : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.TagDAOTest.EXISTING_VM_ID , mapping.getvm_id ( ) ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { testServlet = new org.ovirt.engine.core.WelcomeServlet ( ) ; testServlet.setBackend ( mockBackend ) ; testServlet.init ( mockBrandingManager ) ; mockBackendQuery ( VdcQueryType.GetConfigurationValue , "oVirtVersion" ) ; org.mockito.Mockito.when ( mockBrandingManager.getBrandingThemes ( ) ) . thenReturn ( new java.util.ArrayList < org.ovirt.engine.core.branding.BrandingTheme > ( ) ) ; org.mockito.Mockito.when ( mockBrandingManager.getWelcomeSections ( org.mockito.Matchers.any ( java.util.Locale.class ) ) ) . thenReturn ( "Welcome Section HTML" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { testServlet = new org.ovirt.engine.core.WelcomeServlet ( ) { private static final long serialVersionUID = 1446616158991683162L ; @ java.lang.Override public java.lang.String getCurrentSsoSessionUser ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.lang.String token ) { return "admin@internal" ; } @ java.lang.Override public boolean isSessionValid ( javax.servlet.http.HttpServletRequest request , java.lang.String token ) { return true ; } @ java.lang.Override public java.util.Map < java.lang.String , java.lang.Object > isSsoWebappDeployed ( ) { return java.util.Collections.emptyMap ( ) ; } } ; testServlet.setBackend ( mockBackend ) ; testServlet.init ( mockBrandingManager , "/ovirt-engine" ) ; mockBackendQuery ( VdcQueryType.GetConfigurationValue , "oVirtVersion" ) ; org.mockito.Mockito.when ( mockBrandingManager.getBrandingThemes ( ) ) . thenReturn ( new java.util.ArrayList < org.ovirt.engine.core.branding.BrandingTheme > ( ) ) ; org.mockito.Mockito.when ( mockBrandingManager.getWelcomeSections ( org.mockito.Matchers.any ( java.util.Locale.class ) ) ) . thenReturn ( "Welcome Section HTML" ) ; }
Source:
protected void executeCommand ( ) { if ( org.ovirt.engine.core.bll.VmTemplateHandler.isTemplateStatusIsNotLocked ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ) { org.ovirt.engine.core.bll.VmTemplateHandler.lockVmTemplateInTransaction ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) , org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getCompensationContext ( ) ) ; MoveOrCopyAllImageGroups ( ) ; org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { if ( org.ovirt.engine.core.bll.VmTemplateHandler.isTemplateStatusIsNotLocked ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ) { org.ovirt.engine.core.bll.VmTemplateHandler.lockVmTemplateInTransaction ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) , org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getCompensationContext ( ) ) ; if ( ! ( getTemplateDisks ( ) . isEmpty ( ) ) ) { MoveOrCopyAllImageGroups ( ) ; } else { endVmTemplateRelatedOps ( ) ; } org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setSucceeded ( true ) ; } }
Source:
public void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.storage.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult disksInStatus ( org.ovirt.engine.core.common.businessentities.ImageStatus applicableStatus , org.ovirt.engine.core.common.errors.VdcBllMessages message ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskImages ) { if ( ( diskImage.getImageStatus ( ) ) != applicableStatus ) { return new org.ovirt.engine.core.bll.ValidationResult ( message , java.lang.String.format ( "$status %s" , applicableStatus.name ( ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult disksInStatus ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus applicableStatus , org.ovirt.engine.core.common.errors.VdcBllMessages message ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskImages ) { if ( ( diskImage.getImageStatus ( ) ) != applicableStatus ) { return new org.ovirt.engine.core.bll.ValidationResult ( message , java.lang.String.format ( "$status %s" , applicableStatus.name ( ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice > devs = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsRngEnabled ( ) . setEntity ( ( ! ( devs.isEmpty ( ) ) ) ) ; getModel ( ) . setRngDevice ( ( devs.isEmpty ( ) ? new org.ovirt.engine.core.common.businessentities.VmRngDevice ( ) : devs.get ( 0 ) ) ) ; }

Target:
public void afterUpdates ( ) { getInstanceTypeManager ( ) . activate ( ) ; }