auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.common.businessentities.aaa.DbUser getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser entity = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setLoginName ( NAMES [ index ] ) ; entity.setGroupNames ( new java.util.LinkedList < java.lang.String > ( java.util.Arrays.asList ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.GROUPS.split ( "," ) ) ) ) ; entity.setNamespace ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.NAMESPACE ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.aaa.DOMAIN ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.aaa.DbUser getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser entity = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( getDirectoryUser ( index ) ) ; entity.setGroupNames ( new java.util.LinkedList < java.lang.String > ( java.util.Arrays.asList ( org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResourceTest.GROUPS.split ( "," ) ) ) ) ; entity.setId ( GUIDS [ index ] ) ; return entity ; }
Source:
public void endTime ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBaseTest.TestTimeoutBase t = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBaseTest.TestTimeoutBase ( ) ; final java.util.Date d = java.util.Calendar.getInstance ( ) . getTime ( ) ; t.setEndTime ( d ) ; org.junit.Assert.assertEquals ( d , t.getEndTime ( ) ) ; }

Target:
public void endTime ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBaseTest.TestTimeoutBase t = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.TimeoutBaseTest.TestTimeoutBase ( ) ; final long c = java.util.Calendar.getInstance ( ) . getTime ( ) . getTime ( ) ; t.setEndTime ( c ) ; org.junit.Assert.assertEquals ( c , t.getEndTime ( ) ) ; }
Source:
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 ) ; }

Target:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public void testVmPayloadMapToPaylod ( ) { org.ovirt.engine.core.common.businessentities.VmPayload vmPayload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; vmPayload.setDeviceType ( org.ovirt.engine.core.common.utils.VmDeviceType.CDROM ) ; vmPayload.setVolumeId ( "CD-VOL" ) ; org.ovirt.engine.api.model.Payload payload = org.ovirt.engine.api.restapi.types.VmMapper.map ( vmPayload , null ) ; assertEquals ( vmPayload.getDeviceType ( ) . name ( ) , payload.getType ( ) . name ( ) ) ; assertEquals ( vmPayload.getVolumeId ( ) , payload.getVolumeId ( ) ) ; }

Target:
public void testVmPayloadMapToPaylod ( ) { org.ovirt.engine.core.common.businessentities.VmPayload vmPayload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; vmPayload.setDeviceType ( org.ovirt.engine.core.common.utils.VmDeviceType.CDROM ) ; vmPayload.setVolumeId ( "CD-VOL" ) ; org.ovirt.engine.api.model.Payload payload = org.ovirt.engine.api.restapi.types.VmMapper.map ( vmPayload , null ) ; org.junit.Assert.assertEquals ( vmPayload.getDeviceType ( ) . name ( ) , payload.getType ( ) . name ( ) ) ; org.junit.Assert.assertEquals ( vmPayload.getVolumeId ( ) , payload.getVolumeId ( ) ) ; }
Source:
public static void GetHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.GetAllVdsByStoragePoolParameters ( spId ) , aQuery ) ; }

Target:
public static void GetHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
protected void endWithFailure ( ) { if ( ( org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getCommandExecutionStatus ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCommandId ( ) ) ) != ( org.ovirt.engine.core.compat.backendcompat.CommandExecutionStatus.EXECUTED ) ) { changeStorageDomainStatusInTransaction ( loadStoragePoolIsoMap ( ) , StorageDomainStatus.Unknown ) ; auditLogDirector.log ( this , AuditLogType.USER_DEACTIVATE_STORAGE_DOMAIN_OVF_UPDATE_INCOMPLETE ) ; } else { executeDeactivateCommand ( ) ; } org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.setSucceeded ( true ) ; }

Target:
protected void endWithFailure ( ) { if ( ( commandCoordinatorUtil.getCommandExecutionStatus ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCommandId ( ) ) ) != ( org.ovirt.engine.core.compat.backendcompat.CommandExecutionStatus.EXECUTED ) ) { changeStorageDomainStatusInTransaction ( loadStoragePoolIsoMap ( ) , StorageDomainStatus.Unknown ) ; auditLogDirector.log ( this , AuditLogType.USER_DEACTIVATE_STORAGE_DOMAIN_OVF_UPDATE_INCOMPLETE ) ; } else { executeDeactivateCommand ( ) ; } org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.setSucceeded ( true ) ; }
Source:
private void initSpiceProxy ( ) { java.lang.String proxy = getEntity ( ) . getSpiceProxy ( ) ; boolean isProxyAvailable = ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( proxy ) ) ; getSpiceProxyEnabled ( ) . setEntity ( isProxyAvailable ) ; getSpiceProxy ( ) . setIsChangable ( isProxyAvailable ) ; getSpiceProxy ( ) . setEntity ( proxy ) ; }

Target:
private void initSpiceProxy ( ) { java.lang.String proxy = getEntity ( ) . getSpiceProxy ( ) ; boolean isProxyAvailable = ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( proxy ) ) ; getSpiceProxyEnabled ( ) . setEntity ( isProxyAvailable ) ; getSpiceProxy ( ) . setIsChangeable ( isProxyAvailable ) ; getSpiceProxy ( ) . setEntity ( proxy ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { buildVmData ( ) ; logCommandInfo ( ) ; mVmReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.getBroker ( ) . create ( createInfo ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vm.getDynamicData ( ) , mVmReturn.mVm ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { buildVmData ( ) ; logCommandInfo ( ) ; vmReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.getBroker ( ) . create ( createInfo ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vm.getDynamicData ( ) , vmReturn.vm , org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.getVds ( ) ) ; }
Source:
private com.google.gwt.user.client.ui.IsWidget createCheckBoxPanel ( ) { com.google.gwt.user.client.ui.FlowPanel checkBoxPanel = new com.google.gwt.user.client.ui.FlowPanel ( ) ; checkBoxPanel.addStyleName ( PatternflyConstants.PF_LIST_VIEW_CHECKBOX ) ; return checkBoxPanel ; }

Target:
protected void addReverseDetailItem ( com.google.gwt.safehtml.shared.SafeHtml label , java.lang.String value , com.google.gwt.dom.client.DListElement parent ) { com.google.gwt.dom.client.Element dt = com.google.gwt.dom.client.Document.get ( ) . createElement ( "dt" ) ; dt.setInnerText ( value ) ; parent.appendChild ( dt ) ; com.google.gwt.dom.client.Element dd = com.google.gwt.dom.client.Document.get ( ) . createElement ( "dd" ) ; dd.setInnerSafeHtml ( label ) ; parent.appendChild ( dd ) ; }
Source:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDAO ( ) . get ( getVds ( ) . getId ( ) ) ; vdsDynamic.setnet_config_dirty ( getVds ( ) . getnet_config_dirty ( ) ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.UpdateVdsDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVdsDynamicDataVDSCommandParameters ( vdsDynamic ) ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . get ( getVds ( ) . getId ( ) ) ; vdsDynamic.setnet_config_dirty ( getVds ( ) . getnet_config_dirty ( ) ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.UpdateVdsDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVdsDynamicDataVDSCommandParameters ( vdsDynamic ) ) ; return null ; }
Source:
protected org.springframework.jdbc.core.simple.ParameterizedRowMapper < org.ovirt.engine.core.common.businessentities.Disk > createEntityRowMapper ( ) { return org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.DiskRowMapper.instance ; }

Target:
public org.ovirt.engine.core.common.businessentities.Disk get ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { return getCallsHandler ( ) . executeRead ( "GetDiskByDiskId" , org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.DiskRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "disk_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ) ; }
Source:
public void canDoActionSameSourceAndDest ( ) throws java.lang.Exception { destStorageId = srcStorageId ; initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( ) ; initVm ( ) ; initSrcStorageDomain ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.toString ( ) ) ) ; }

Target:
public void canDoActionSameSourceAndDest ( ) throws java.lang.Exception { destStorageId = srcStorageId ; initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( ) ; initVmForFail ( ) ; initSrcStorageDomain ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.toString ( ) ) ) ; }
Source:
protected boolean addStorageDomainInIrs ( ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CreateStorageDomain , new org.ovirt.engine.core.common.vdscommands.CreateStorageDomainVDSCommandParameters ( org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getVds ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) , getStorageArgs ( ) ) ) . getSucceeded ( ) ; }

Target:
protected boolean addStorageDomainInIrs ( ) { return runVdsCommand ( VDSCommandType.CreateStorageDomain , new org.ovirt.engine.core.common.vdscommands.CreateStorageDomainVDSCommandParameters ( org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getVds ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageStaticData ( ) , getStorageArgs ( ) ) ) . getSucceeded ( ) ; }
Source:
private org.ovirt.engine.core.common.action.LiveMigrateDiskParameters createLiveMigrateDiskParameters ( org.ovirt.engine.core.common.action.MoveDiskParameters moveDiskParameters , org.ovirt.engine.core.compat.Guid vmId ) { return new org.ovirt.engine.core.common.action.LiveMigrateDiskParameters ( moveDiskParameters.getImageId ( ) , moveDiskParameters.getSourceDomainId ( ) , moveDiskParameters.getStorageDomainId ( ) , vmId , moveDiskParameters.getQuotaId ( ) ) ; }

Target:
private org.ovirt.engine.core.common.action.LiveMigrateDiskParameters createLiveMigrateDiskParameters ( org.ovirt.engine.core.common.action.MoveDiskParameters moveDiskParameters , org.ovirt.engine.core.compat.Guid vmId ) { return new org.ovirt.engine.core.common.action.LiveMigrateDiskParameters ( moveDiskParameters.getImageId ( ) , moveDiskParameters.getSourceDomainId ( ) , moveDiskParameters.getStorageDomainId ( ) , vmId , moveDiskParameters.getQuotaId ( ) , diskMap.get ( moveDiskParameters.getImageId ( ) ) . getId ( ) ) ; }
Source:
public java.lang.String GetVDSVerbDataByCpuName ( java.lang.String name ) { java.lang.String result = null ; org.ovirt.engine.core.common.businessentities.ServerCpu sc = null ; if ( name != null ) { if ( ( ( ( sc = _intelCpuByNameDictionary.get ( name ) ) != null ) || ( ( sc = _amdCpuByNameDictionary.get ( name ) ) != null ) ) || ( ( sc = _ibmCpuByNameDictionary.get ( name ) ) != null ) ) { result = sc.getVdsVerbData ( ) ; } } return result ; }

Target:
public java.lang.String getVDSVerbDataByCpuName ( java.lang.String name ) { java.lang.String result = null ; org.ovirt.engine.core.common.businessentities.ServerCpu sc = null ; if ( name != null ) { if ( ( ( ( sc = _intelCpuByNameDictionary.get ( name ) ) != null ) || ( ( sc = _amdCpuByNameDictionary.get ( name ) ) != null ) ) || ( ( sc = _ibmCpuByNameDictionary.get ( name ) ) != null ) ) { result = sc.getVdsVerbData ( ) ; } } return result ; }
Source:
void initTable ( ) { initTableOverhead ( ) ; handleRadioButtonClick ( null ) ; getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminButtonDefinition < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > > ( constants.setupHostNetworksInterface ( ) ) { @ java.lang.Override protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getDetailModel ( ) . getSetupNetworksCommand ( ) ; } } ) ; }

Target:
void initTable ( ) { getTable ( ) . enableColumnResizing ( ) ; initTableOverhead ( ) ; handleRadioButtonClick ( null ) ; getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminButtonDefinition < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > > ( constants.setupHostNetworksInterface ( ) ) { @ java.lang.Override protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getDetailModel ( ) . getSetupNetworksCommand ( ) ; } } ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VnicProfile findVnicProfileForUser ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > networkProfiles = getVnicProfileDao ( ) . getAllForNetwork ( network.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile : networkProfiles ) { if ( profile.isPortMirroring ( ) ) { if ( isVnicProfilePermitted ( userId , profile , ActionGroup.PORT_MIRRORING ) ) { return profile ; } } else { if ( isVnicProfilePermitted ( userId , profile , ActionGroup.CONFIGURE_VM_NETWORK ) ) { return profile ; } } } return null ; }

Target:
private boolean isVnicProfilePermitted ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.common.businessentities.network.VnicProfile profile , boolean portMirroring ) { return ( portMirroring == ( profile.isPortMirroring ( ) ) ) && ( ( getPermissionDAO ( ) . getEntityPermissions ( userId , ActionGroup.CONFIGURE_VM_NETWORK , profile.getId ( ) , VdcObjectType.VnicProfile ) ) != null ) ; }
Source:
public void testUpdateWhenNoCompletedTasks ( ) { org.mockito.Mockito.doReturn ( getTasks ( JobExecutionStatus.STARTED ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( jobRepository , org.mockito.Mockito.times ( 2 ) ) . updateStep ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; org.mockito.Mockito.verify ( tasksSyncJob , org.mockito.Mockito.times ( 0 ) ) . endStepJob ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; }

Target:
public void testUpdateWhenNoCompletedTasks ( ) { org.mockito.Mockito.doReturn ( getTasks ( JobExecutionStatus.STARTED ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( jobRepository , org.mockito.Mockito.times ( 2 ) ) . updateStep ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 0 ) ) . endStepJob ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; }
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 ) ) { if ( ( getConfigKey ( key ) ) == null ) { throw new java.lang.RuntimeException ( ( ( "Error fetching " + key ) + " value: no such entry. Please verify key name and property file support." ) ) ; } printAllValuesForKey ( key ) ; } 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 ) ; 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 vdspysGroupWithVirtGlusterNotSupported ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_1 , java.lang.Boolean.FALSE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.GLUSTER_NOT_SUPPORTED ) ; }

Target:
public void clusterWithVirtGlusterServicesNotAllowed ( ) { createCommandWithVirtGlusterEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseIface ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; networkAttachment.setNicId ( baseIface.getId ( ) ) ; networkAttachment.setNicName ( baseIface.getName ( ) ) ; networkAttachment.setHostNetworkQos ( qos ) ; return networkAttachment ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseIface ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; networkAttachment.setNicId ( baseIface.getId ( ) ) ; networkAttachment.setNicName ( baseIface.getName ( ) ) ; networkAttachment.setHostNetworkQos ( org.ovirt.engine.core.common.businessentities.network.AnonymousHostNetworkQos.fromHostNetworkQos ( qos ) ) ; return networkAttachment ; }
Source:
public void testValidRemovedBondsWhenReferencedInterfaceIsNotBond ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface notABond = createNic ( "nicName" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedBonds ( notABond.getId ( ) ) ) . addExistingInterfaces ( java.util.Collections.singletonList ( notABond ) ) . build ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , notABond.getName ( ) ) ) ) ; }

Target:
public void testValidRemovedBondsWhenReferencedInterfaceIsNotBond ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface notABond = createNic ( "nicName" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedBonds ( notABond.getId ( ) ) ) . addExistingInterfaces ( java.util.Collections.singletonList ( notABond ) ) . build ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.hamcrest.MatcherAssert.assertThat ( validator.validRemovedBonds ( java.util.Collections.emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , notABond.getName ( ) ) ) ) ; }
Source:
public void getAAAProfilesEntriesList ( 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.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { 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 org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.List < ? > ) ( source ) ) ) ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn allocateVolume ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imgGUID , java.lang.String volUUID , java.lang.String size ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Volume.allocate" ) . withParameter ( "volumeID" , volUUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imgGUID ) . withParameter ( "size" , size ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn glusterWebhookSync ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterEvent.webhookSync" ) . 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:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; updateTemplate ( ) ; }

Target:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; updateOSValues ( ) ; if ( ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; updateVirtioScsiAvailability ( ) ; updateTemplate ( ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.IVdsEventListener getEventListener ( ) { return org.ovirt.engine.core.utils.ejb.EjbUtils.findBean ( BeanType.VDS_EVENT_LISTENER , BeanProxyType.LOCAL ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.IVdsEventListener getEventListener ( ) { if ( ( eventListener ) == null ) { javax.enterprise.inject.spi.Bean < ? > bean = beanManager.getBeans ( org.ovirt.engine.core.common.businessentities.IVdsEventListener.class ) . iterator ( ) . next ( ) ; eventListener = ( ( org.ovirt.engine.core.common.businessentities.IVdsEventListener ) ( beanManager.getReference ( bean , bean.getBeanClass ( ) , beanManager.createCreationalContext ( bean ) ) ) ) ; } return eventListener ; }
Source:
private void UpdateProperties ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( ) ; setHardwareManufacturer ( vds.getHardwareManufacturer ( ) ) ; setHardwareVersion ( vds.getHardwareVersion ( ) ) ; setHardwareProductName ( vds.getHardwareProductName ( ) ) ; setHardwareUUID ( vds.getHardwareUUID ( ) ) ; setHardwareSerialNumber ( vds.getHardwareSerialNumber ( ) ) ; setHardwareFamily ( vds.getHardwareFamily ( ) ) ; }

Target:
private void updateProperties ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( ) ; setHardwareManufacturer ( vds.getHardwareManufacturer ( ) ) ; setHardwareVersion ( vds.getHardwareVersion ( ) ) ; setHardwareProductName ( vds.getHardwareProductName ( ) ) ; setHardwareUUID ( vds.getHardwareUUID ( ) ) ; setHardwareSerialNumber ( vds.getHardwareSerialNumber ( ) ) ; setHardwareFamily ( vds.getHardwareFamily ( ) ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > findGroupsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.util.List < java.lang.String > ids , final boolean resolveGroups , final boolean resolveGroupsRecursive ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension.getContext ( ) , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryGroups ( extension , namespace , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , QueryEntity.GROUP ) , resolveGroups , resolveGroupsRecursive ) ) ; } return results ; }

Target:
public static java.util.List < org.ovirt.engine.api.extensions.ExtMap > queryGroupRecords ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { org.ovirt.engine.api.extensions.ExtMap inputMap = new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.InvokeKeys.QUERY_ENTITY , Authz.QueryEntity.GROUP ) . mput ( Authz.InvokeKeys.QUERY_FLAGS , org.ovirt.engine.core.aaa.AuthzUtils.queryFlagValue ( groupsResolving , groupsResolvingRecursive ) ) . mput ( Authz.InvokeKeys.QUERY_FILTER , filter ) . mput ( Authz.InvokeKeys.NAMESPACE , namespace ) ; return org.ovirt.engine.core.aaa.AuthzUtils.populateGroups ( extension , namespace , inputMap ) ; }
Source:
public org.ovirt.engine.core.authentication.Directory create ( org.ovirt.engine.core.authentication.Configuration config ) throws org.ovirt.engine.core.authentication.ConfigurationException { java.lang.String name = config.getInheritedString ( org.ovirt.engine.core.authentication.internal.InternalDirectoryFactory.NAME_PARAMETER ) ; if ( name == null ) { throw new org.ovirt.engine.core.authentication.ConfigurationException ( ( ( ( "The configuration file \"" + ( config.getFile ( ) . getAbsolutePath ( ) ) ) + "\" doesn\'t contain the name of " ) + "the directory." ) ) ; } return new org.ovirt.engine.core.authentication.internal.InternalDirectory ( name ) ; }

Target:
public org.ovirt.engine.core.authentication.Directory create ( org.ovirt.engine.core.extensions.mgr.Configuration config ) throws org.ovirt.engine.core.extensions.mgr.ConfigurationException { java.lang.String name = config.getInheritedString ( org.ovirt.engine.core.authentication.internal.InternalDirectoryFactory.NAME_PARAMETER ) ; if ( name == null ) { throw new org.ovirt.engine.core.extensions.mgr.ConfigurationException ( ( ( ( "The configuration file \"" + ( config.getFile ( ) . getAbsolutePath ( ) ) ) + "\" doesn\'t contain the name of " ) + "the directory." ) ) ; } return new org.ovirt.engine.core.authentication.internal.InternalDirectory ( name ) ; }
Source:
public void testUpdateAll ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics existingVm = dao.get ( FixturesTool.VM_RHEL5_POOL_57 ) ; org.ovirt.engine.core.common.businessentities.VmStatistics existingVm2 = dao.get ( FixturesTool.VM_RHEL5_POOL_51 ) ; existingVm.setCpuSys ( 50.0 ) ; existingVm2.setCpuUser ( 50.0 ) ; dao.updateAll ( java.util.Arrays.asList ( existingVm , existingVm2 ) ) ; org.junit.Assert.assertEquals ( existingVm , dao.get ( existingVm.getId ( ) ) ) ; org.junit.Assert.assertEquals ( existingVm2 , dao.get ( existingVm2.getId ( ) ) ) ; }

Target:
public void testUpdateAll ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics existingVm = dao.get ( FixturesTool.VM_RHEL5_POOL_57 ) ; org.ovirt.engine.core.common.businessentities.VmStatistics existingVm2 = dao.get ( FixturesTool.VM_RHEL5_POOL_51 ) ; existingVm.setCpuSys ( 50.0 ) ; existingVm2.setCpuUser ( 50.0 ) ; dao.updateAll ( java.util.Arrays.asList ( existingVm , existingVm2 ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( existingVm , dao.get ( existingVm.getId ( ) ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( existingVm2 , dao.get ( existingVm2.getId ( ) ) ) ; }
Source:
private void verifyPermit ( org.ovirt.engine.api.model.Permit permit , org.ovirt.engine.core.common.businessentities.ActionGroup action ) { assertEquals ( java.lang.Integer.toString ( action.getId ( ) ) , permit.getId ( ) ) ; assertEquals ( action.name ( ) . toLowerCase ( ) , permit.getName ( ) ) ; assertNotNull ( permit.getRole ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendPermitResourceTest.ROLE_ID.toString ( ) , permit.getRole ( ) . getId ( ) ) ; }

Target:
private void verifyPermit ( org.ovirt.engine.api.model.Permit permit , org.ovirt.engine.core.common.businessentities.ActionGroup action ) { org.junit.Assert.assertEquals ( java.lang.Integer.toString ( action.getId ( ) ) , permit.getId ( ) ) ; org.junit.Assert.assertEquals ( action.name ( ) . toLowerCase ( ) , permit.getName ( ) ) ; org.junit.Assert.assertNotNull ( permit.getRole ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendPermitResourceTest.ROLE_ID.toString ( ) , permit.getRole ( ) . getId ( ) ) ; }
Source:
public void moveShareableDiskToGlusterDomain ( ) { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.GLUSTERFS ) ; initVmDiskImage ( true ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS.toString ( ) ) ) ; }

Target:
public void validateWrongDiskImageTypeTemplate ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initTemplateDiskImage ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_IS_NOT_VM_DISK.toString ( ) ) ) ; }
Source:
public void testGetAllForRoleAndAdElementAndObject ( ) { org.ovirt.engine.core.common.businessentities.Permissions result = dao.getForRoleAndAdElementAndObject ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , result.getrole_id ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , result.getad_element_id ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID , result.getObjectId ( ) ) ; }

Target:
public void testGetAllForRoleAndAdElementAndObject ( ) { org.ovirt.engine.core.common.businessentities.Permission result = dao.getForRoleAndAdElementAndObject ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , result.getRoleId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , result.getAdElementId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID , result.getObjectId ( ) ) ; }
Source:
public static void GetClusterById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters ( id ) , aQuery ) ; }

Target:
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 , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void testSkipMovesToMatchingCloseElement ( ) { org.ovirt.api.metamodel.runtime.xml.XmlReader reader = openReader ( "<first><second><third>fourth</third></second></first>" ) ; reader.skip ( ) ; org.junit.Assert.assertEquals ( javax.xml.stream.XMLStreamConstants.END_ELEMENT , reader.getEventType ( ) ) ; org.junit.Assert.assertEquals ( "first" , reader.getLocalName ( ) ) ; }

Target:
public void testSkipMovesToNextElement ( ) { org.ovirt.api.metamodel.runtime.xml.XmlReader reader = openReader ( "<root><current><inner>text</inner></current><next/></root>" ) ; reader.next ( ) ; reader.skip ( ) ; org.junit.Assert.assertEquals ( javax.xml.stream.XMLStreamConstants.START_ELEMENT , reader.getEventType ( ) ) ; org.junit.Assert.assertEquals ( "next" , reader.getLocalName ( ) ) ; }
Source:
protected R performUpdate ( R incoming , Q entity , R model , org.ovirt.engine.api.restapi.resource.EntityIdResolver entityResolver , org.ovirt.engine.core.common.action.VdcActionType update , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.ParametersProvider < R , Q > updateProvider ) { validateUpdate ( incoming , model ) ; performAction ( update , updateProvider.getParameters ( incoming , entity ) ) ; return addLinks ( populate ( map ( getEntity ( entityResolver , false ) ) , entity ) ) ; }

Target:
protected < T > Q doUpdate ( R incoming , Q entity , R model , org.ovirt.engine.api.restapi.resource.EntityIdResolver < T > entityResolver , org.ovirt.engine.core.common.action.VdcActionType update , org.ovirt.engine.api.restapi.resource.AbstractBackendSubResource.ParametersProvider < R , Q > updateProvider ) { validateUpdate ( incoming , model ) ; performAction ( update , updateProvider.getParameters ( incoming , entity ) ) ; entity = getEntity ( entityResolver , false ) ; return entity ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult nicActuallyExistsOrReferencesNewBond ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { java.lang.String targetNicName = attachment.getNicName ( ) ; boolean attachmentReferencesExistingNic = ( existingInterfacesMap.get ( attachment.getNicId ( ) , targetNicName ) ) != null ; if ( attachmentReferencesExistingNic ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } boolean attachmentReferencesNewlyCreatedBond = ( targetNicName != null ) && ( ( bondsMap.get ( targetNicName ) ) != null ) ; if ( attachmentReferencesNewlyCreatedBond ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult nicActuallyExistsOrReferencesNewBond ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { boolean nicActuallyExistsOrReferencesNewBond = isNicActuallyExistsOrReferencesNewBond ( attachment.getNicName ( ) , attachment.getNicId ( ) ) ; if ( nicActuallyExistsOrReferencesNewBond ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; }
Source:
protected void auditInvalidInterfaces ( java.util.List < java.lang.String > invalidNetworkNames , java.util.List < java.lang.String > invalidIfaceNames ) { if ( ( invalidNetworkNames.size ( ) ) > 0 ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.AddCustomValue ( "Networks" , org.apache.commons.lang.StringUtils.join ( invalidNetworkNames , ',' ) ) ; logable.AddCustomValue ( "Interfaces" , org.apache.commons.lang.StringUtils.join ( invalidIfaceNames , ',' ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_IMPORT_VM_INTERFACES_ON_NON_VM_NETWORKS ) ; } }

Target:
protected void auditInvalidInterfaces ( java.util.List < java.lang.String > invalidNetworkNames , java.util.List < java.lang.String > invalidIfaceNames ) { if ( ( invalidNetworkNames.size ( ) ) > 0 ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.AddCustomValue ( "Networks" , org.apache.commons.lang.StringUtils.join ( invalidNetworkNames , ',' ) ) ; logable.AddCustomValue ( "Interfaces" , org.apache.commons.lang.StringUtils.join ( invalidIfaceNames , ',' ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , getAuditLogTypeForInvalidInterfaces ( ) ) ; } }
Source:
public void failsInNotImportedAndNotExists ( ) throws java.lang.Exception { mockGetExistingDomain ( false ) ; cmd.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; org.mockito.Mockito.verify ( backend , org.mockito.Mockito.times ( 1 ) ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 0 ) ) . executeCommand ( ) ; }

Target:
public void failsInNotImportedAndNotExists ( ) throws java.lang.Exception { mockGetExistingDomain ( false ) ; cmd.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; org.mockito.Mockito.verify ( backend , org.mockito.Mockito.times ( 1 ) ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.QueryParametersBase.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 0 ) ) . executeCommand ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.GraphicsDevice getGraphicsDevOfType ( org.ovirt.engine.core.common.businessentities.GraphicsType type ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue query = org.ovirt.engine.core.bll.UpdateVmCommand.getBackend ( ) . runInternalQuery ( VdcQueryType.GetGraphicsDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmId ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = query.getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice dev : graphicsDevices ) { if ( ( dev.getGraphicsType ( ) ) == type ) { return dev ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.GraphicsDevice getGraphicsDevOfType ( org.ovirt.engine.core.common.businessentities.GraphicsType type ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = getGraphicsDevices ( ) ; for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice dev : graphicsDevices ) { if ( ( dev.getGraphicsType ( ) ) == type ) { return dev ; } } return null ; }