auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void canDoActionFailedVirtIODisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; org.mockito.Mockito.when ( osRepository.hasSpiceSupport ( 0 , Version.v3_1 ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.getOsName ( 0 ) ) . thenReturn ( "RHEL6" ) ; createNotVirtIODisk ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.HOT_PLUG_DISK_IS_NOT_VIRTIO.toString ( ) ) ) ; }

Target:
public void canDoActionFailedVirtIODisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; org.mockito.Mockito.when ( osRepository.getOsName ( 0 ) ) . thenReturn ( "RHEL6" ) ; createNotVirtIODisk ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED.toString ( ) ) ) ; }
Source:
public void memoryOptimizationLowerThenZeroWithoutKsmOrBallooning ( ) { final org.ovirt.engine.core.common.businessentities.VDSGroup cluster = org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ; cluster.setMaxVdsMemoryOverCommit ( ( - 52 ) ) ; cluster.setEnableKsm ( false ) ; cluster.setEnableBallooning ( false ) ; createCommand ( cluster ) ; cpuExists ( ) ; canDoActionFailedWithReason ( EngineMessage.VDS_GROUP_TO_ALLOW_MEMORY_OPTIMIZATION_YOU_MUST_ALLOW_KSM_OR_BALLOONING ) ; }

Target:
public void memoryOptimizationLowerThenZeroWithoutKsmOrBallooning ( ) { final org.ovirt.engine.core.common.businessentities.VDSGroup cluster = org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ; cluster.setMaxVdsMemoryOverCommit ( ( - 52 ) ) ; cluster.setEnableKsm ( false ) ; cluster.setEnableBallooning ( false ) ; createCommand ( cluster ) ; cpuExists ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }
Source:
public static void GetRedirectServletReportsPage ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage ) , aQuery ) ; }

Target:
public static void GetStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.GetStorageDomainsByVmTemplateIdQueryParameters ( templateId ) , aQuery ) ; }
Source:
protected void endWithFailure ( ) { if ( ! ( org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . isParentHasTasks ( ) ) ) { org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getParentParameters ( ) . setTaskGroupSuccess ( false ) ; org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getBackend ( ) . endAction ( org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getParentCommand ( ) , org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getParentParameters ( ) , org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.cloneContextAndDetachFromParent ( ) ) ; } org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.setSucceeded ( true ) ; }

Target:
private void removeRedundantVolumesForOrphanedDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderVolumesToRemove = org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getCinderVolumesToRemove ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderVolume : cinderVolumesToRemove ) { org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getDbFacade ( ) . getImageStorageDomainMapDao ( ) . remove ( cinderVolume.getImageId ( ) ) ; org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getImageDao ( ) . remove ( cinderVolume.getImageId ( ) ) ; } }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }
Source:
private void endCommand ( ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { removeImageFromDB ( true ) ; } else { org.ovirt.engine.core.bll.RemoveImageCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map_id ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.RemoveImageCommand.unLockImage ( ) ; } org.ovirt.engine.core.bll.RemoveImageCommand.setSucceeded ( true ) ; }

Target:
private void endCommand ( ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { removeImageFromDB ( true ) ; } else { org.ovirt.engine.core.bll.RemoveImageCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.RemoveImageCommand.unLockImage ( ) ; } org.ovirt.engine.core.bll.RemoveImageCommand.setSucceeded ( true ) ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.network.Network before = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 ) ; before.setDescription ( "This is a completely changed description" ) ; before.getDnsResolverConfiguration ( ) . getNameServers ( ) . add ( new org.ovirt.engine.core.common.businessentities.network.NameServer ( "1.1.1.1" ) ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.network.Network after = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void testRemove ( ) { org.ovirt.engine.core.dao.network.DnsResolverConfigurationDao dnsResolverConfigurationDao = dbFacade.getDnsResolverConfigurationDao ( ) ; org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByNameAndDataCenter ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 , FixturesTool.DATA_CENTER ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( result.getDnsResolverConfiguration ( ) . getId ( ) , FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE ) ; dao.remove ( result.getId ( ) ) ; org.junit.Assert.assertNull ( dao.getByNameAndDataCenter ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 , FixturesTool.DATA_CENTER ) ) ; org.junit.Assert.assertNull ( dnsResolverConfigurationDao.get ( FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE ) ) ; }
Source:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue1 ) { org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel poolGeneralModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel ) ( model1 ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue1 ) ) . getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { if ( host.getId ( ) . equals ( poolGeneralModel1.getvm ( ) . getDedicatedVmForVds ( ) ) ) { poolGeneralModel1.setDefaultHost ( host.getName ( ) ) ; break ; } } }

Target:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue1 ) { org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel poolGeneralModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel ) ( model1 ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue1 ) ) . getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { if ( poolGeneralModel1.getvm ( ) . getDedicatedVmForVdsList ( ) . contains ( host.getId ( ) ) ) { poolGeneralModel1.setDefaultHost ( host.getName ( ) ) ; break ; } } }
Source:
public void ImportTemplate ( java.lang.String ovfstring , org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > images , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces ) throws org.ovirt.engine.core.utils.ovf.OvfReaderException { org.ovirt.engine.core.utils.ovf.OvfReader ovf = null ; try { ovf = new org.ovirt.engine.core.utils.ovf.OvfTemplateReader ( new org.ovirt.engine.core.compat.backendcompat.XmlDocument ( ovfstring ) , vmTemplate , images , interfaces ) ; BuildOvf ( ovf ) ; } catch ( java.lang.Exception ex ) { logOvfLoadError ( ex.getMessage ( ) , ovfstring ) ; throw new org.ovirt.engine.core.utils.ovf.OvfReaderException ( ex , ( ovf != null ? ovf.getName ( ) : null ) ) ; } }

Target:
public void ImportTemplate ( java.lang.String ovfstring , org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > images , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces ) throws org.ovirt.engine.core.utils.ovf.OvfReaderException { org.ovirt.engine.core.utils.ovf.OvfReader ovf = null ; try { ovf = new org.ovirt.engine.core.utils.ovf.OvfTemplateReader ( new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( ovfstring ) , vmTemplate , images , interfaces ) ; BuildOvf ( ovf ) ; } catch ( java.lang.Exception ex ) { logOvfLoadError ( ex.getMessage ( ) , ovfstring ) ; throw new org.ovirt.engine.core.utils.ovf.OvfReaderException ( ex , ( ovf != null ? ovf.getName ( ) : null ) ) ; } }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public static void GetAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
private void listenOnDiskModelChangeEvent ( final org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { modelProvider.getModel ( ) . getvmBasicDiskListModel ( ) . getItemsChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override 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 ; } @ java.lang.SuppressWarnings ( value = "unchecked" ) java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = modelProvider.getModel ( ) . getvmBasicDiskListModel ( ) . getItems ( ) ; getView ( ) . editDistItems ( diskImages ) ; } } ) ; }

Target:
private void setupDisks ( final org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = modelProvider.getModel ( ) . getvmBasicDiskListModel ( ) . getItems ( ) ; if ( diskImages != null ) { getView ( ) . editDistItems ( diskImages ) ; } }
Source:
public static void IsUSBEnabledByDefault ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void GetStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , 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 ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( ( ( getParameters ( ) . getProfile ( ) ) != null ? getParameters ( ) . getProfile ( ) . getClusterId ( ) : null ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , getActionType ( ) . getActionGroup ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( ( ( getParameters ( ) . getProfile ( ) ) != null ? getParameters ( ) . getProfile ( ) . getClusterId ( ) : null ) , org.ovirt.engine.core.common.VdcObjectType.Cluster , getActionType ( ) . getActionGroup ( ) ) ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.action.StoragePoolParametersBase params = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( asGuid ( id ) ) ; boolean force = org.ovirt.engine.api.common.util.QueryHelper.getBooleanMatrixParameter ( uriInfo , org.ovirt.engine.api.restapi.resource.BackendDataCenterResource.FORCE , true , false ) ; if ( force ) { params.setForceDelete ( force ) ; } return performAction ( VdcActionType.RemoveStoragePool , params ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.action.StoragePoolParametersBase params = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( asGuid ( id ) ) ; boolean force = org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendDataCenterResource.FORCE , true , false ) ; if ( force ) { params.setForceDelete ( force ) ; } return performAction ( VdcActionType.RemoveStoragePool , params ) ; }
Source:
protected void executeCommand ( ) { getMacPoolEntity ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getMacPoolDao ( ) . save ( getMacPoolEntity ( ) ) ; addPermission ( getCurrentUser ( ) . getId ( ) , getMacPoolEntity ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDcSingleton.getInstance ( ) . createPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }

Target:
protected void executeCommand ( ) { registerRollbackHandler ( new org.ovirt.engine.core.bll.AddMacPoolCommand.CustomTransactionCompletionListener ( ) ) ; getMacPoolEntity ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getMacPoolDao ( ) . save ( getMacPoolEntity ( ) ) ; addPermission ( getCurrentUser ( ) . getId ( ) , getMacPoolEntity ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDcSingleton.getInstance ( ) . createPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }
Source:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
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 ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getBroker ( ) . getStorageDomainInfo ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.ProceedProxyReturnValue ( ) ; org.ovirt.engine.core.utils.Pair < org.ovirt.engine.core.common.businessentities.storage_domain_static , org.ovirt.engine.core.common.businessentities.SANState > pairSdStatic = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.BuildStorageStaticFromXmlRpcStruct ( _result.mStorageInfo ) ; pairSdStatic.getFirst ( ) . setId ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( pairSdStatic ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getBroker ( ) . getStorageDomainInfo ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.ProceedProxyReturnValue ( ) ; org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.storage_domain_static , org.ovirt.engine.core.common.businessentities.SANState > pairSdStatic = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.BuildStorageStaticFromXmlRpcStruct ( _result.mStorageInfo ) ; pairSdStatic.getFirst ( ) . setId ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( pairSdStatic ) ; }
Source:
public void getoVirtISOsList ( 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.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { testFilter = new org.ovirt.engine.core.branding.BrandingFilter ( ) ; testFilter.init ( mockFilterConfig , mockBrandingManager ) ; mockBrandingThemes = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( mockRequest.getAttribute ( LocaleFilter.LOCALE ) ) . thenReturn ( java.util.Locale.US ) ; org.mockito.Mockito.when ( mockRequest.getServletContext ( ) ) . thenReturn ( mockServletContext ) ; org.mockito.Mockito.when ( mockServletContext.getInitParameter ( "obrandApplicationName" ) ) . thenReturn ( "test" ) ; org.mockito.Mockito.when ( mockBrandingManager.getBrandingThemes ( ) ) . thenReturn ( mockBrandingThemes ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { testFilter = new org.ovirt.engine.core.branding.BrandingFilter ( ) ; testFilter.init ( mockFilterConfig , mockBrandingManager ) ; mockBrandingThemes = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( mockRequest.getAttribute ( LocaleFilter.LOCALE ) ) . thenReturn ( java.util.Locale.US ) ; org.mockito.Mockito.when ( mockRequest.getServletContext ( ) ) . thenReturn ( mockServletContext ) ; org.mockito.Mockito.when ( mockServletContext.getInitParameter ( "applicationName" ) ) . thenReturn ( "test" ) ; org.mockito.Mockito.when ( mockBrandingManager.getBrandingThemes ( ) ) . thenReturn ( mockBrandingThemes ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.isInternalExecution ( ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getGlusterVolumeId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.GLUSTER_SNAPSHOT , VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_LOCKED ) ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ! ( org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.isInternalExecution ( ) ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getGlusterVolumeId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.GLUSTER_SNAPSHOT , EngineMessage.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_LOCKED ) ) ; } return null ; }
Source:
public void testForceSelect ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.ForceSelectSPM , org.ovirt.engine.core.common.action.ForceSelectSPMParameters.class , new java.lang.String [ ] { "PreferredSPMId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; verifyActionResponse ( resource.forceSelectSPM ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testForceSelect ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.ForceSelectSPM , org.ovirt.engine.core.common.action.ForceSelectSPMParameters.class , new java.lang.String [ ] { "PreferredSPMId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; verifyActionResponse ( resource.forceSelectSpm ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
public static void decreasePendingVm ( org.ovirt.engine.core.common.businessentities.VmStatic vm , org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.bll.VmHandler.decreasePendingResources ( vdsId , vm.getNumOfCpus ( ) , vm.getMinAllocatedMem ( ) , vm.getName ( ) ) ; }

Target:
private static boolean addDeviceUpdateOnNextRun ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.EditableDeviceOnVmStatusField annotation , java.lang.Object key , java.lang.Object value , java.util.List < org.ovirt.engine.core.common.utils.VmDeviceUpdate > updates ) { return org.ovirt.engine.core.bll.VmHandler.addDeviceUpdateOnNextRun ( vmId , annotation.generalType ( ) , annotation.type ( ) , annotation.isReadOnly ( ) , key , value , updates ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepConfigSet ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey , java.lang.String configValue ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepConfigSet ( volumeName , slaveHost , slaveVolumeName , configKey , configValue ) ) ; } 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 glusterVolumeGeoRepSessionStop ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String userName , java.lang.Boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionStop ( volumeName , remoteHost , remoteVolumeName , userName , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testAddVersionNoBaseTemplateId ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Template t = org.ovirt.engine.api.restapi.resource.BackendTemplatesResourceTest.getModel ( 2 ) ; t.getVersion ( ) . setBaseTemplate ( null ) ; try { collection.add ( t ) ; org.junit.Assert.fail ( "Should have failed with 400 error due to a missing base template" ) ; } catch ( javax.ws.rs.WebApplicationException e ) { org.junit.Assert.assertNotNull ( e.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 400 , e.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testAddVersionNoBaseTemplateId ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Template t = org.ovirt.engine.api.restapi.resource.BackendTemplatesResourceTest.getModel ( 2 ) ; t.getVersion ( ) . setBaseTemplate ( null ) ; try { collection.add ( t ) ; org.junit.jupiter.api.Assertions.fail ( "Should have failed with 400 error due to a missing base template" ) ; } catch ( javax.ws.rs.WebApplicationException e ) { org.junit.jupiter.api.Assertions.assertNotNull ( e.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 400 , e.getResponse ( ) . getStatus ( ) ) ; } }
Source:
protected void EndWithFailure ( ) { super . EndActionOnDisks ( ) ; if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) ) != null ) { RemoveVmInSpm ( org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) . getstorage_pool_id ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; } removeVmRelatedEntitiesFromDb ( ) ; org.ovirt.engine.core.bll.AddVmCommand.setSucceeded ( true ) ; }

Target:
protected void endWithFailure ( ) { super . endActionOnDisks ( ) ; if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) ) != null ) { removeVmInSpm ( org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; } removeVmRelatedEntitiesFromDb ( ) ; org.ovirt.engine.core.bll.AddVmCommand.setSucceeded ( true ) ; }
Source:
public final void removeSession ( java.lang.String sessionId ) { sessionInfoMap.remove ( sessionId ) ; }

Target:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , getPrincipalName ( sessionId ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.session.SessionDataContainer.AUTH_RECORD_PARAMETER_NAME , false ) ) ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.session.SessionDataContainer.PRINCIPAL_RECORD_PARAMETER_NAME , false ) ) ) , message , msgArgs ) ; sessionInfoMap.remove ( sessionId ) ; }
Source:
public void testGetAllAfterDate ( ) throws java.lang.Exception { java.util.Date cutoff = EXPECTED_DATE_FORMAT.parse ( "2010-12-20 13:00:00" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > result = dao.getAllAfterDate ( cutoff ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.AuditLogDaoTest.FILTERED_COUNT , result.size ( ) ) ; cutoff = EXPECTED_DATE_FORMAT.parse ( "2010-12-20 14:00:00" ) ; result = dao.getAllAfterDate ( cutoff ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 0 , result.size ( ) ) ; }

Target:
public void testGetAllAfterDate ( ) throws java.lang.Exception { java.util.Date cutoff = EXPECTED_DATE_FORMAT.parse ( "2010-12-20 13:00:00" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.AuditLog > result = dao.getAllAfterDate ( cutoff ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.AuditLogDaoTest.AFTER_DATE_COUNT , result.size ( ) ) ; cutoff = EXPECTED_DATE_FORMAT.parse ( "2010-12-20 14:00:00" ) ; result = dao.getAllAfterDate ( cutoff ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 0 , result.size ( ) ) ; }
Source:
private void writeStructType ( org.ovirt.api.metamodel.concepts.StructType type ) { writeStartElement ( "struct" ) ; writeCommon ( type ) ; type.attributes ( ) . forEach ( this :: writeAttribute ) ; type.links ( ) . forEach ( this :: writeStructLink ) ; writeEndElement ( ) ; }

Target:
private void writeStructType ( org.ovirt.api.metamodel.concepts.StructType type ) { writer.writeStartElement ( "struct" ) ; writeCommon ( type ) ; type.attributes ( ) . forEach ( this :: writeAttribute ) ; type.links ( ) . forEach ( this :: writeStructLink ) ; writer.writeEndElement ( ) ; }
Source:
private void verifyBuiltPoolVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { verifyBuiltCoreVm ( vm.getStaticData ( ) ) ; verifyBuiltKernelOptions ( vm.getStaticData ( ) ) ; verifyBuiltMigrationOptions ( vm.getStaticData ( ) ) ; verifyBuiltVmSpecific ( vm ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.pools.VM_NAME , vm.getName ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.pools.USB_POLICY , vm.getUsbPolicy ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.pools.HOST_ID , vm.getDedicatedVmForVds ( ) ) ; }

Target:
private void verifyBuiltPoolVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { verifyBuiltCoreVm ( vm.getStaticData ( ) ) ; verifyBuiltKernelOptions ( vm.getStaticData ( ) ) ; verifyBuiltMigrationOptions ( vm.getStaticData ( ) ) ; verifyBuiltVmSpecific ( vm ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.pools.VM_NAME , vm.getName ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.pools.USB_POLICY , vm.getUsbPolicy ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.ui.uicommonweb.models.pools.HOST_ID , vm.getDedicatedVmForVdsList ( ) . get ( 0 ) ) ; }
Source:
public void shouldDetectSameOs ( ) { org.assertj.core.api.Assertions.assertThat ( new org.ovirt.engine.core.utils.OS ( "os1" , new org.ovirt.engine.core.compat.Version ( "6.3" ) ) . isSameOsFamily ( new org.ovirt.engine.core.utils.OS ( "os1" , new org.ovirt.engine.core.compat.Version ( "6.3" ) ) ) ) . isTrue ( ) ; }

Target:
public void shouldDetectSameOs ( ) { org.assertj.core.api.Assertions.assertThat ( new org.ovirt.engine.core.utils.OS ( "os1" , new org.ovirt.engine.core.compat.Version ( "6.3" ) , "" ) . isSameOsFamily ( new org.ovirt.engine.core.utils.OS ( "os1" , new org.ovirt.engine.core.compat.Version ( "6.3" ) , "" ) ) ) . isTrue ( ) ; }
Source:
public static void getVmSnapshotList ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , 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:
private org.apache.http.impl.client.DefaultHttpClient createDefaultHttpClient ( java.lang.String url , java.lang.String username , java.lang.String password , java.lang.String key_file , java.lang.String cert_file , java.lang.String ca_file , java.lang.Integer port , java.lang.Integer timeout ) { int port_ = getPort ( url , port ) ; org.apache.http.impl.client.DefaultHttpClient client = new org.apache.http.impl.client.DefaultHttpClient ( createPoolingClientConnectionManager ( url , port_ ) ) ; client.getCredentialsProvider ( ) . setCredentials ( new org.apache.http.auth.AuthScope ( getHost ( url ) , port_ ) , new org.apache.http.auth.UsernamePasswordCredentials ( username , password ) ) ; return client ; }

Target:
private org.apache.http.impl.client.DefaultHttpClient createDefaultHttpClient ( java.lang.String url , java.lang.String username , java.lang.String password , java.lang.String key_file , java.lang.String cert_file , java.lang.String ca_file , java.lang.Integer port , java.lang.Integer timeout ) { int port_ = getPort ( url , port ) ; org.apache.http.impl.client.DefaultHttpClient client = new org.apache.http.impl.client.DefaultHttpClient ( createPoolingClientConnectionManager ( url , port_ ) ) ; if ( ! ( org.ovirt.engine.sdk.utils.StringUtils.isNulOrEmpty ( username ) ) ) client.getCredentialsProvider ( ) . setCredentials ( new org.apache.http.auth.AuthScope ( getHost ( url ) , port_ ) , new org.apache.http.auth.UsernamePasswordCredentials ( username , password ) ) ; return client ; }
Source:
public void setItems ( java.util.Collection value ) { if ( ( items ) != value ) { itemsChanging ( value , items ) ; items = value ; itemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }

Target:
public void setItems ( java.util.Collection < java.lang.String > value ) { if ( ( items ) != value ) { itemsChanging ( value , items ) ; items = value ; org.ovirt.engine.ui.uicommonweb.models.vms.VmAppListModel.itemsChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmAppListModel.getItemsChangedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }
Source:
private void printKey ( ) throws java.lang.Exception { java.lang.String key = parser.getKey ( ) ; java.lang.String version = parser.getVersion ( ) ; if ( org.apache.commons.lang.StringUtils.isBlank ( version ) ) { org.ovirt.engine.core.config.entity.ConfigKey configKey = getConfigKey ( key ) ; if ( configKey == null ) { throw new java.lang.RuntimeException ( ( ( "Error fetching " + key ) + " value: no such entry. Please verify key name and property file support." ) ) ; } printAllValuesForKey ( configKey.getKey ( ) ) ; } else { printKeyWithSpecifiedVersion ( key , version ) ; } }

Target:
private void printKey ( ) throws java.lang.Exception { java.lang.String key = parser.getKey ( ) ; java.lang.String version = parser.getVersion ( ) ; if ( org.apache.commons.lang.StringUtils.isBlank ( version ) ) { org.ovirt.engine.core.config.entity.ConfigKey configKey = getConfigKey ( key ) ; testIfConfigKeyCanBeFetchedOrPrinted ( configKey ) ; if ( configKey == null ) { throw new java.lang.RuntimeException ( ( ( "Error fetching " + key ) + " value: no such entry. Please verify key name and property file support." ) ) ; } printAllValuesForKey ( configKey.getKey ( ) ) ; } else { printKeyWithSpecifiedVersion ( key , version ) ; } }
Source:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > > aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
void mockSessionDataContainer ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery query ) { org.mockito.Mockito.doReturn ( sessionDataContainer ) . when ( query ) . getSessionDataContainer ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQueryTest.SSO_TOKEN ) . when ( sessionDataContainer ) . getSsoAccessToken ( org.mockito.Matchers.anyString ( ) ) ; }

Target:
private void testFillRemoteViewerUrl ( java.lang.String toRepalce , java.lang.String baseUrl , java.lang.String resourceUrl , java.lang.String expected ) { org.ovirt.engine.core.common.console.ConsoleOptions options = new org.ovirt.engine.core.common.console.ConsoleOptions ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getOptions ( ) ) . thenReturn ( getValidOptions ( GraphicsType.SPICE ) ) ; getQuery ( ) . fillRemoteViewerUrl ( options , toRepalce , baseUrl , resourceUrl ) ; org.junit.Assert.assertEquals ( expected , options.getRemoteViewerNewerVersionUrl ( ) ) ; }
Source:
private javax.ws.rs.core.Response cloneVmFromSnapshot ( org.ovirt.engine.core.common.businessentities.VmStatic staticVm , java.lang.String snapshotId , java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > images ) { org.ovirt.engine.core.compat.Guid sourceSnapshotId = asGuid ( snapshotId ) ; org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters params = new org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters ( staticVm , sourceSnapshotId ) ; params.setDiskInfoDestinationMap ( images ) ; return performCreation ( VdcActionType.AddVmFromSnapshot , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class ) ) ; }

Target:
private javax.ws.rs.core.Response cloneVmFromSnapshot ( org.ovirt.engine.core.common.businessentities.VmStatic staticVm , java.lang.String snapshotId , java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > images ) { org.ovirt.engine.core.compat.Guid sourceSnapshotId = asGuid ( snapshotId ) ; org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters params = new org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters ( staticVm , sourceSnapshotId ) ; params.setDiskInfoDestinationMap ( images ) ; params.setMakeCreatorExplicitOwner ( shouldMakeCreatorExplicitOwner ( ) ) ; return performCreation ( VdcActionType.AddVmFromSnapshot , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.common.businessentities.network.Network networkA , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachment ( networkA , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; attachment.setNicId ( nic.getId ( ) ) ; attachment.setNicName ( nic.getName ( ) ) ; return attachment ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network addNewNetworkToDaoMock ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetworkWithName ( HostSetupNetworksValidator.VAR_NETWORK_NAME ) ; addNetworkIdToNetworkDaoMock ( network ) ; addNetworkToClusterDaoMock ( network.getId ( ) ) ; return network ; }