auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean isCopyCollapseDisabledWithSnapshots ( ) { return ( ( getParameters ( ) . getVm ( ) . getSnapshots ( ) . size ( ) ) > 1 ) && ( ! ( getParameters ( ) . getCopyCollapse ( ) ) ) ; }

Target:
private boolean isCopyCollapseDisabledWithSnapshotsOrWithTemplate ( ) { return ( ( ( getParameters ( ) . getVm ( ) . getSnapshots ( ) . size ( ) ) > 1 ) || ( ( ! ( VmTemplateHandler.BLANK_VM_TEMPLATE_ID.equals ( getVm ( ) . getVmtGuid ( ) ) ) ) && ( ( org.ovirt.engine.core.bll.ImportVmCommand.getVmTemplate ( ) ) != null ) ) ) && ( ! ( getParameters ( ) . getCopyCollapse ( ) ) ) ; }
Source:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }
Source:
protected void init ( ) { org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setSupportedVnicTypes ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ) ( returnValue ) ) ) ; postNicInit ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getNicTypeList ( getVm ( ) . getOsId ( ) , getClusterCompatibilityVersion ( ) , asyncQuery ) ; }

Target:
protected void init ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getNicTypeList ( getVm ( ) . getOsId ( ) , getClusterCompatibilityVersion ( ) , new org.ovirt.engine.ui.uicommonweb.models.vms.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > returnValue ) { setSupportedVnicTypes ( returnValue ) ; postNicInit ( ) ; } } ) ) ; }
Source:
public void getIsGlusterVolumeSnapshotCliScheduleEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotCliScheduleFlag , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getIsGlusterVolumeSnapshotCliScheduleEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Boolean > aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotCliScheduleFlag , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
protected void setUpEntityQueryExpectations ( int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.LdapUser user = org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.setUpEntityExpectations ( control.createMock ( org.ovirt.engine.core.common.businessentities.LdapUser.class ) , index ) ; setUpGetEntityExpectations ( ( ( "ADUSER@" + ( DOMAIN ) ) + ": allnames=*" ) , SearchType.AdUser , user ) ; }

Target:
private void setUpEntityQueryExpectations ( int index , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetDirectoryUserById , org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters.class , new java.lang.String [ ] { "Domain" , "Id" } , new java.lang.Object [ ] { DOMAIN , GUIDS [ index ] } , ( notFound ? null : getEntity ( index ) ) ) ; }
Source:
protected org.ovirt.engine.api.model.Network getEntity ( int index ) { org.ovirt.engine.api.model.Network entity = org.mockito.Mockito.mock ( org.ovirt.engine.api.model.Network.class ) ; org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( entity.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( entity.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; org.mockito.Mockito.when ( entity.getDataCenterId ( ) ) . thenReturn ( GUIDS [ 1 ] ) ; return entity ; }

Target:
public void testRemoveNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public boolean matches ( java.lang.Object argument ) { if ( ! ( argument instanceof java.util.ArrayList ) ) { return false ; } @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.ArrayList < org.ovirt.engine.core.compat.Guid > optionsToRemove = ( ( java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ) ( argument ) ) ; return ( ( optionsToRemove.size ( ) ) == 1 ) && ( optionsToRemove.get ( 0 ) . equals ( existingReplVol.getOption ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.OPTION_AUTH_ALLOW ) . getId ( ) ) ) ; }

Target:
public boolean matches ( java.lang.Object argument ) { if ( ! ( argument instanceof java.util.Collection ) ) { return false ; } @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Collection < org.ovirt.engine.core.compat.Guid > optionsToRemove = ( ( java.util.Collection < org.ovirt.engine.core.compat.Guid > ) ( argument ) ) ; return ( ( optionsToRemove.size ( ) ) == 1 ) && ( optionsToRemove.contains ( existingReplVol.getOption ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.OPTION_AUTH_ALLOW ) . getId ( ) ) ) ; }
Source:
public void testDedicatedHostNotExist ( ) { prepareVmToPassCanDoAction ( ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; vmStatic.setdedicated_vm_for_vds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.VM_CANNOT_UPDATE_DEFAULT_VDS_NOT_VALID ) ; }

Target:
public void testDedicatedHostNotExist ( ) { prepareVmToPassCanDoAction ( ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; vmStatic.setdedicated_vm_for_vds ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; junit.framework.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }
Source:
public void setMessage ( java.lang.String message ) { super . setMessage ( message ) ; if ( ( message != null ) && ( ! ( message.isEmpty ( ) ) ) ) { disksAllocationView.setVisible ( false ) ; } messageLabel.setText ( message ) ; }

Target:
public void setMessage ( java.lang.String message ) { super . setMessage ( message ) ; boolean isMessageEmpty = ( message == null ) || ( message.isEmpty ( ) ) ; disksAllocationView.setVisible ( ( isMessageEmpty || ( disksAllocationModel.isWarningAvailable ( ) ) ) ) ; messageLabel.setVisible ( ( ! isMessageEmpty ) ) ; messageLabel.setText ( message ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface entity ) { return getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , entity.getVmId ( ) ) . addValue ( "interface_name" , entity.getInterfaceName ( ) ) . addValue ( "mac_address" , entity.getMacAddress ( ) ) . addValue ( "ipv4_addresses" , getIpAddressesAsString ( entity.getIpv4Addresses ( ) ) ) . addValue ( "ipv6_addresses" , getIpAddressesAsString ( entity.getIpv6Addresses ( ) ) ) ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface entity ) { return getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , entity.getVmId ( ) ) . addValue ( "interface_name" , entity.getInterfaceName ( ) ) . addValue ( "mac_address" , entity.getMacAddress ( ) ) . addValue ( "ipv4_addresses" , org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoDbFacadeImpl.getIpAddressesAsString ( entity.getIpv4Addresses ( ) ) ) . addValue ( "ipv6_addresses" , org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoDbFacadeImpl.getIpAddressesAsString ( entity.getIpv6Addresses ( ) ) ) ; }
Source:
public void poolHasDefaultCluster ( ) { org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.mcr.mockConfigValue ( ConfigValues.AutoRegistrationDefaultVdsGroupID , org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.DEFAULT_VDS_GROUP_ID ) ; addDefaultClusterToPool ( ) ; storagePoolWithLocalFS ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_WITH_DEFAULT_VDS_GROUP_CANNOT_BE_LOCALFS ) ) . when ( poolValidator ) . isNotLocalfsWithDefaultCluster ( ) ; canDoActionFailed ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_WITH_DEFAULT_VDS_GROUP_CANNOT_BE_LOCALFS ) ; }

Target:
public void poolHasDefaultCluster ( ) { org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.mcr.mockConfigValue ( ConfigValues.AutoRegistrationDefaultVdsGroupID , org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.DEFAULT_VDS_GROUP_ID ) ; addDefaultClusterToPool ( ) ; storagePoolWithLocalFS ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_WITH_DEFAULT_VDS_GROUP_CANNOT_BE_LOCALFS ) ) . when ( poolValidator ) . isNotLocalfsWithDefaultCluster ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_WITH_DEFAULT_VDS_GROUP_CANNOT_BE_LOCALFS ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( id ) == null ? 0 : id.hashCode ( ) ) ; result = ( prime * result ) + ( ( quotaId ) == null ? 0 : quotaId.hashCode ( ) ) ; result = ( prime * result ) + ( ( diskProfileId ) == null ? 0 : diskProfileId.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( id , quotaId , diskProfileId ) ; }
Source:
public java.lang.Boolean getValue ( ) { for ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel : getNetworksTableItems ( ) ) { if ( canEditRequired ( clusterNetworkModel ) ) { if ( ! ( clusterNetworkModel.isRequired ( ) ) ) { return false ; } } } return true ; }

Target:
public java.lang.Boolean getValue ( ) { boolean allEntriesDisabled = ! ( isEnabled ( ) ) ; for ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel : getNetworksTableItems ( ) ) { if ( allEntriesDisabled || ( canEditRequired ( clusterNetworkModel ) ) ) { if ( ! ( clusterNetworkModel.isRequired ( ) ) ) { return false ; } } } return true ; }
Source:
public java.lang.String toString ( ) { return java.lang.String.format ( ( "%s, imageSizeInBytes = %s, volumeFormat = %s, newImageId = %s, " + "newImageDescription = %s" ) , super . toString ( ) , getImageSizeInBytes ( ) , getVolumeFormat ( ) , getNewImageID ( ) , getNewImageDescription ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "imageSizeInBytes" , getImageSizeInBytes ( ) ) . append ( "volumeFormat" , getVolumeFormat ( ) ) . append ( "newImageId" , getNewImageID ( ) ) . append ( "newImageDescription" , getNewImageDescription ( ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.NetworkQoS flush ( ) { super . flush ( ) ; networkQoS.setName ( getName ( ) . getEntity ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > selectedDataCenters = getDataCenters ( ) . getSelectedObjects ( ) ; if ( ! ( selectedDataCenters.isEmpty ( ) ) ) { networkQoS.setStoragePoolId ( selectedDataCenters.get ( 0 ) . getId ( ) ) ; } return networkQoS ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.NetworkQoS flush ( ) { super . flush ( ) ; networkQoS.setName ( getName ( ) . getEntity ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > selectedDataCenters = getDataCenters ( ) . getSelectionModel ( ) . getSelectedObjects ( ) ; if ( ! ( selectedDataCenters.isEmpty ( ) ) ) { networkQoS.setStoragePoolId ( selectedDataCenters.get ( 0 ) . getId ( ) ) ; } return networkQoS ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getUserProfileDao ( ) ; existingProfile = dao.get ( new org.ovirt.engine.core.compat.Guid ( "38cb5663-96bc-485c-834a-cbbc03acc820" ) ) ; deletableProfile = dao.get ( new org.ovirt.engine.core.compat.Guid ( "38cb5663-96bc-485c-834a-cbbc03acc821" ) ) ; newProfile = new org.ovirt.engine.core.common.businessentities.UserProfile ( ) ; newProfile.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newProfile.setUserId ( new org.ovirt.engine.core.compat.Guid ( "81940459-2ec4-4afa-bbaa-22549555293c" ) ) ; newProfile.setSshPublicKey ( "key3" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getUserProfileDao ( ) ; existingProfile = dao.get ( new org.ovirt.engine.core.compat.Guid ( "38cb5663-96bc-485c-834a-cbbc03acc820" ) ) ; deletableProfile = dao.get ( new org.ovirt.engine.core.compat.Guid ( "38cb5663-96bc-485c-834a-cbbc03acc821" ) ) ; newProfile = new org.ovirt.engine.core.common.businessentities.UserProfile ( ) ; newProfile.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newProfile.setUserId ( new org.ovirt.engine.core.compat.Guid ( "81940459-2ec4-4afa-bbaa-22549555293c" ) ) ; newProfile.setSshPublicKey ( "key3" ) ; newProfile.setLoginName ( "userportal4" ) ; }
Source:
public void canDoActionVmRunningStateless ( ) { createParameters ( ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS ) ) . when ( vmValidator ) . vmNotRunningStateless ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS.name ( ) ) ) ; }

Target:
public void canDoActionVmRunningStateless ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS ) ) . when ( vmValidator ) . vmNotRunningStateless ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS.name ( ) ) ) ; }
Source:
private static void updateTimeoutLogableObject ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { int duplicateEventsIntrvalValue = ( auditLogable.isExternal ( ) ) ? java.lang.Math.max ( auditLogable.getEventFloodInSec ( ) , 30 ) : logType.getEventFloodRate ( ) ; if ( duplicateEventsIntrvalValue > 0 ) { auditLogable.setEndTime ( java.util.concurrent.TimeUnit.SECONDS.toMillis ( duplicateEventsIntrvalValue ) ) ; auditLogable.setTimeoutObjectId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.composeObjectId ( auditLogable , logType ) ) ; } }

Target:
private static void updateTimeoutLogableObject ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { int eventFloodRate = ( auditLogable.isExternal ( ) ) ? java.lang.Math.max ( auditLogable.getEventFloodInSec ( ) , 30 ) : logType.getEventFloodRate ( ) ; if ( eventFloodRate > 0 ) { auditLogable.setEndTime ( java.util.concurrent.TimeUnit.SECONDS.toMillis ( eventFloodRate ) ) ; auditLogable.setTimeoutObjectId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.composeObjectId ( auditLogable , logType ) ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < > ( ) ; list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) . getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getDiskImage ( ) . getActualSize ( ) ) ) ; return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < > ( ) ; refreshDiskImageIfNecessery ( ) ; list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) . getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getDiskImage ( ) . getActualSize ( ) ) ) ; return list ; }
Source:
public void init ( javax.servlet.FilterConfig filterConfig ) throws javax.servlet.ServletException { try { userNameFormat = org.ovirt.engine.core.aaa.filters.BasicAuthenticationFilter.UserNameFormat.valueOf ( filterConfig.getInitParameter ( "user-name-format" ) ) ; } catch ( java.lang.Exception ex ) { org.ovirt.engine.core.aaa.filters.BasicAuthenticationFilter.log.error ( java.lang.String.format ( "The value %1$s is not a valid UserNameFormat. setting UPN as default" , filterConfig.getInitParameter ( "user-name-format" ) ) ) ; } }

Target:
public void init ( javax.servlet.FilterConfig filterConfig ) throws javax.servlet.ServletException { try { userNameFormat = org.ovirt.engine.core.aaa.filters.BasicAuthenticationFilter.UserNameFormat.valueOf ( filterConfig.getInitParameter ( "user-name-format" ) ) ; } catch ( java.lang.Exception ex ) { org.ovirt.engine.core.aaa.filters.BasicAuthenticationFilter.log.error ( "The value is not a valid UserNameFormat. setting UPN as default" , filterConfig.getInitParameter ( "user-name-format" ) ) ; } }
Source:
private void updateCachedIsoFileListFromVdsm ( org.ovirt.engine.core.common.businessentities.RepoImage repoImage ) { boolean isRefreshed = false ; try { java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > problematicRepoFileList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > ( ) ; isRefreshed = refreshIsoDomain ( repoImage.getRepoDomainId ( ) , problematicRepoFileList , repoImage.getFileType ( ) ) ; addRepoFileToProblematicList ( problematicRepoFileList ) ; } finally { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.infoFormat ( "Finished automatic refresh process for {0} file type with {1}, for storage domain id {2}." , repoImage.getFileType ( ) , ( isRefreshed ? "success" : "failure" ) , repoImage.getRepoDomainId ( ) ) ; } }

Target:
private void updateCachedIsoFileListFromVdsm ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage ) { boolean isRefreshed = false ; try { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > problematicRepoFileList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > ( ) ; isRefreshed = refreshIsoDomain ( repoImage.getRepoDomainId ( ) , problematicRepoFileList , repoImage.getFileType ( ) ) ; addRepoFileToProblematicList ( problematicRepoFileList ) ; } finally { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.info ( "Finished automatic refresh process for '{}' file type with {}, for storage domain id '{}'." , repoImage.getFileType ( ) , ( isRefreshed ? "success" : "failure" ) , repoImage.getRepoDomainId ( ) ) ; } }
Source:
public void testGetAllInterfacesForVmFilteredWithPermissions ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > result = dao.getAllForVm ( org.ovirt.engine.core.dao.VmNetworkInterfaceDAOTest.VM_ID , org.ovirt.engine.core.dao.VmNetworkInterfaceDAOTest.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmNetworkInterfaceDAOTest.VM_ID , iface.getVmId ( ) ) ; } }

Target:
public void testGetAllInterfacesForVmFilteredWithPermissions ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > result = dao.getAllForVm ( org.ovirt.engine.core.dao.VmNetworkInterfaceDAOTest.VM_ID , org.ovirt.engine.core.dao.VmNetworkInterfaceDAOTest.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmNetworkInterfaceDAOTest.VM_ID , iface.getVmId ( ) ) ; } }
Source:
public void appendCustomValueUsesNullSeparator ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String newVal = "bar" ; final java.lang.String sep = null ; b.AddCustomValue ( key , value ) ; b.AppendCustomValue ( key , newVal , sep ) ; final java.lang.String s = b.GetCustomValue ( key ) ; org.junit.Assert.assertEquals ( ( ( value + sep ) + newVal ) , s ) ; }

Target:
public void appendCustomValueUsesNullSeparator ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String newVal = "bar" ; final java.lang.String sep = null ; b.addCustomValue ( key , value ) ; b.appendCustomValue ( key , newVal , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( ( ( value + sep ) + newVal ) , s ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetCertuficateExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM response = resource.get ( ) ; verifyModel ( response , 0 ) ; verifyCertificate ( response ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetCertuficateExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.Vm response = resource.get ( ) ; verifyModel ( response , 0 ) ; verifyCertificate ( response ) ; }
Source:
protected void executeCommand ( ) { job = getJobDao ( ) . get ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.ovirt.engine.core.bll.ClearExternalJobCommand.getParameters ( ) . getJobId ( ) ) ) ) ; job.setAutoCleared ( true ) ; getJobDao ( ) . update ( job ) ; }

Target:
protected void executeCommand ( ) { job = getJobDao ( ) . get ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.ovirt.engine.core.bll.ClearExternalJobCommand.getParameters ( ) . getJobId ( ) ) ) ) ; job.setAutoCleared ( true ) ; getJobDao ( ) . update ( job ) ; org.ovirt.engine.core.bll.ClearExternalJobCommand.setSucceeded ( true ) ; }
Source:
public void canDoActionNoDisksSpecified ( ) { initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , null ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_NO_DISKS_SPECIFIED.toString ( ) ) ) ; }

Target:
public void canDoActionNoDisksSpecified ( ) { initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , null ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_NO_DISKS_SPECIFIED.toString ( ) ) ) ; }
Source:
protected javax.ws.rs.core.Response performCreation ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase taskParams , org.ovirt.engine.api.restapi.resource.EntityIdResolver entityResolver , boolean block ) { return performCreation ( task , taskParams , entityResolver , block , null ) ; }

Target:
protected final < T > javax.ws.rs.core.Response performCreate ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase taskParams , org.ovirt.engine.api.restapi.resource.IResolver < T , Q > entityResolver , boolean block , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { org.ovirt.engine.core.common.action.VdcReturnValueBase createResult = doCreateEntity ( task , taskParams ) ; return fetchCreatedEntity ( entityResolver , block , suggestedParentType , createResult ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterEventListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand.equals ( getModel ( ) . getDetailsCommand ( ) ) ) { return eventPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getAddCommand ( ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
protected void EndVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setstatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . sethibernation_vol_handle ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; } else { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "StopVmCommandBase::EndVmCommand: Vm is null - not performing full EndAction" ) ; } setSucceeded ( true ) ; }

Target:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setstatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . sethibernation_vol_handle ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; } else { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "StopVmCommandBase::EndVmCommand: Vm is null - not performing full EndAction" ) ; } setSucceeded ( true ) ; }
Source:
public void preventRollback ( ) { org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . setExecutionIndex ( 0 ) ; }

Target:
public boolean performNextOperation ( int completedChildCount ) { if ( ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getNextPhase ( ) ) == ( ImportRepoImageParameters.Phase.DOWNLOAD ) ) { org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . setNextPhase ( ImportRepoImageParameters.Phase.END ) ; persistCommand ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getParentCommand ( ) , true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.DownloadImage , createDownloadImageParameters ( ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getContext ( ) ) ) ; return true ; } return false ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnSave" ) ) { onSave ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnSave" ) ) { onSave ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } else if ( command == ( getAddQosCommand ( ) ) ) { addQos ( ) ; } }
Source:
static org.ovirt.engine.api.model.VM setUpStatisticalEntityExpectations ( org.ovirt.engine.api.model.VM entity , org.ovirt.engine.core.common.businessentities.VmStatistics statistics ) { entity.setVmMemSizeMb ( 10 ) ; entity.setStatisticsData ( statistics ) ; statistics.setusage_mem_percent ( 20 ) ; statistics.setcpu_user ( 30.0 ) ; statistics.setcpu_sys ( 40.0 ) ; statistics.setusage_cpu_percent ( 50 ) ; entity.setMigrationProgressPercent ( 50 ) ; entity.setGuestMemoryFree ( 5120L ) ; entity.setGuestMemoryBuffered ( 2048L ) ; entity.setGuestMemoryCached ( 1024L ) ; return entity ; }

Target:
static org.ovirt.engine.core.common.businessentities.VM setUpStatisticalEntityExpectations ( org.ovirt.engine.api.restapi.resource.VM entity , org.ovirt.engine.core.common.businessentities.VmStatistics statistics ) { entity.setVmMemSizeMb ( 10 ) ; entity.setStatisticsData ( statistics ) ; statistics.setusage_mem_percent ( 20 ) ; statistics.setcpu_user ( 30.0 ) ; statistics.setcpu_sys ( 40.0 ) ; statistics.setusage_cpu_percent ( 50 ) ; entity.setMigrationProgressPercent ( 50 ) ; entity.setGuestMemoryFree ( 5120L ) ; entity.setGuestMemoryBuffered ( 2048L ) ; entity.setGuestMemoryCached ( 1024L ) ; return entity ; }
Source:
private org.ovirt.engine.core.common.businessentities.qos.QosBase createNewQosEntityForQosType ( org.ovirt.engine.core.common.businessentities.qos.QosType qosType ) { switch ( qosType ) { case STORAGE : return new org.ovirt.engine.core.common.businessentities.qos.StorageQos ( ) ; case CPU : return new org.ovirt.engine.core.common.businessentities.qos.CpuQos ( ) ; case NETWORK : return new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; default : throw new java.lang.IllegalArgumentException ( ( ( "Unsupported QoS type \"" + qosType ) + "\"" ) ) ; } }

Target:
private org.ovirt.engine.core.common.businessentities.qos.QosBase createNewQosEntityForQosType ( org.ovirt.engine.api.model.QosType qosType ) { switch ( qosType ) { case STORAGE : return new org.ovirt.engine.core.common.businessentities.qos.StorageQos ( ) ; case CPU : return new org.ovirt.engine.core.common.businessentities.qos.CpuQos ( ) ; case NETWORK : return new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; case HOSTNETWORK : return new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; default : throw new java.lang.IllegalArgumentException ( ( ( "Unsupported QoS type \"" + qosType ) + "\"" ) ) ; } }
Source:
public void portMirroringChangeNotSupported ( ) { mockVnicProfilePortMirroringChange ( false ) ; mockVmsUsingVnicProfile ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.VM > singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ) ; org.junit.Assert.assertThat ( validator.portMirroringNotChangedIfUsedByVms ( ) , failsWithVnicProfileInUse ( ) ) ; }

Target:
public void portMirroringChangeNotSupported ( ) { mockVnicProfilePortMirroringChange ( false ) ; mockVmsUsingVnicProfile ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.VM > singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ) ; org.junit.Assert.assertThat ( validator.portMirroringNotChangedIfUsedByVms ( ) , org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.failsWithVnicProfileInUse ( ) ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.affinity_groups.list.VmAffinityGroupListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( ( lastExecutedCommand == ( getModel ( ) . getNewCommand ( ) ) ) || ( lastExecutedCommand == ( getModel ( ) . getEditCommand ( ) ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.vms.hostdev.VmHostDeviceListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getAddCommand ( ) ) ) { return addPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getRepinHostCommand ( ) ) ) { return repinPopupProvider.get ( ) ; } return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; }
Source:
public void calculateNetworkImplementationDetailsNetworkVmNetworkOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , ( ! ( iface.isBridged ( ) ) ) , iface.getMtu ( ) , iface.getVlanId ( ) , null ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkQosMissing ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , null ) ; }
Source:
public void diskImagesAlreadyExistOneExist ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ) . when ( validator ) . getExistingDisk ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( null ) . when ( validator ) . getExistingDisk ( disk2.getId ( ) ) ; org.junit.Assert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.junit.matchers.JUnitMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.junit.matchers.JUnitMatchers.hasItem ( org.ovirt.engine.core.bll.validator.DiskImagesValidatorTest.createAliasReplacements ( disk1 ) ) ) ) ) ; }

Target:
public void diskImagesAlreadyExistOneExist ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ) . when ( validator ) . getExistingDisk ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( null ) . when ( validator ) . getExistingDisk ( disk2.getId ( ) ) ; org.junit.Assert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.DiskImagesValidatorTest.createAliasReplacements ( disk1 ) ) ) ) ) ; }
Source:
public void testDeleteAllUnusedIcons ( ) { reinitializeDatabase ( ) ; dao.removeAllUnusedIcons ( ) ; final org.ovirt.engine.core.common.businessentities.VmIcon unusedIcon = dao.get ( org.ovirt.engine.core.dao.VmIconDaoTest.UNUSED_ICON_ID ) ; org.junit.Assert.assertNull ( unusedIcon ) ; final org.ovirt.engine.core.common.businessentities.VmIcon usedIcon = dao.get ( FixturesTool.SMALL_ICON_ID ) ; org.junit.Assert.assertNotNull ( usedIcon ) ; reinitializeDatabase ( ) ; }

Target:
public void testDeleteAllUnusedIcons ( ) { reinitializeDatabase ( ) ; dao.removeAllUnusedIcons ( ) ; final org.ovirt.engine.core.common.businessentities.VmIcon unusedIcon = dao.get ( org.ovirt.engine.core.dao.VmIconDaoTest.UNUSED_ICON_ID ) ; org.junit.jupiter.api.Assertions.assertNull ( unusedIcon ) ; final org.ovirt.engine.core.common.businessentities.VmIcon usedIcon = dao.get ( FixturesTool.SMALL_ICON_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( usedIcon ) ; reinitializeDatabase ( ) ; }
Source:
public void validateDisksPassDiscardFails ( ) { org.ovirt.engine.core.common.errors.EngineMessage failureEngineMessage = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ; mockPassDiscardSupport ( new org.ovirt.engine.core.bll.ValidationResult ( failureEngineMessage ) ) ; org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( runVmValidator.validateDisksPassDiscard ( vm ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( failureEngineMessage ) ) ; }

Target:
public void validateDisksPassDiscardFails ( ) { org.ovirt.engine.core.common.errors.EngineMessage failureEngineMessage = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ; mockPassDiscardSupport ( new org.ovirt.engine.core.bll.ValidationResult ( failureEngineMessage ) ) ; org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( runVmValidator.validateDisksPassDiscard ( vm ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( failureEngineMessage ) ) ; }
Source:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name , org.ovirt.engine.core.compat.Guid datacenterId ) { 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 ) ) ) ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , params , aQuery ) ; }

Target:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permission > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( _vds.getstatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "ResourceManager::refreshVdsRunTimeInfo::Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getvds_name ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warnFormat ( "ResourceManager::refreshVdsRunTimeInfo::Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getvds_name ( ) , e.getMessage ( ) ) ; } }

Target:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( _vds.getStatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getName ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warnFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getName ( ) , e.getMessage ( ) ) ; } }
Source:
private void setSpiceProxyAvailability ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel.ClientConsoleMode clientMode ) { boolean isHtml5 = clientMode == ( SpiceConsoleModel.ClientConsoleMode.Html5 ) ; getView ( ) . setSpiceProxyEnabled ( spiceProxyDefinedOnCluster , ( spiceProxyDefinedOnCluster ? "" : constants.spiceProxyCanBeEnabledOnlyWhenDefined ( ) ) ) ; if ( spiceProxyDefinedOnCluster ) { getView ( ) . setSpiceProxyEnabled ( ( ! isHtml5 ) , ( isHtml5 ? constants.spiceHtml5DoesntSupportSpiceProxy ( ) : "" ) ) ; } }

Target:
private void setSpiceProxyAvailability ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel.ClientConsoleMode clientMode ) { boolean isHtml5 = clientMode == ( SpiceConsoleModel.ClientConsoleMode.Html5 ) ; getView ( ) . setSpiceProxyEnabled ( spiceProxyDefinedOnCluster , ( spiceProxyDefinedOnCluster ? "" : org.ovirt.engine.ui.common.presenter.popup.ConsolePopupPresenterWidget.constants.spiceProxyCanBeEnabledOnlyWhenDefined ( ) ) ) ; if ( spiceProxyDefinedOnCluster ) { getView ( ) . setSpiceProxyEnabled ( ( ! isHtml5 ) , ( isHtml5 ? org.ovirt.engine.ui.common.presenter.popup.ConsolePopupPresenterWidget.constants.spiceHtml5DoesntSupportSpiceProxy ( ) : "" ) ) ; } }
Source:
public static void initCache ( org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cacheConfigValues ( new org.ovirt.engine.ui.frontend.AsyncQuery ( loginModel , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( target ) ; } } ) ) ; }

Target:
public static void initCache ( org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cacheConfigValues ( new org.ovirt.engine.ui.frontend.AsyncQuery ( loginModel , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( target ) ; } } ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initUniqueOsNames ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initLinuxOsTypes ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.initWindowsOsTypes ( ) ; }