auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testSaveAndGetById ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brickToAdd = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brickToAdd.setVolumeId ( FixturesTool.GLUSTER_VOLUME_UUID1 ) ; brickToAdd.setServerId ( FixturesTool.GLUSTER_SERVER_UUID3 ) ; brickToAdd.setServerName ( FixturesTool.GLUSTER_SERVER_NAME3 ) ; brickToAdd.setBrickDirectory ( org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.BRICK_EXPORT_DIR ) ; brickToAdd.setStatus ( GlusterStatus.UP ) ; brickToAdd.setBrickOrder ( 0 ) ; dao.save ( brickToAdd ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity retrievedBrick = dao.getById ( brickToAdd.getId ( ) ) ; org.junit.Assert.assertNotNull ( retrievedBrick ) ; org.junit.Assert.assertEquals ( brickToAdd , retrievedBrick ) ; }

Target:
public void testSaveAndGetById ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brickToAdd = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( ) ; brickToAdd.setVolumeId ( FixturesTool.GLUSTER_VOLUME_UUID1 ) ; brickToAdd.setServerId ( FixturesTool.GLUSTER_SERVER_UUID3 ) ; brickToAdd.setServerName ( FixturesTool.GLUSTER_SERVER_NAME3 ) ; brickToAdd.setBrickDirectory ( org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.BRICK_EXPORT_DIR ) ; brickToAdd.setStatus ( GlusterStatus.UP ) ; brickToAdd.setBrickOrder ( 0 ) ; dao.save ( brickToAdd ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity retrievedBrick = dao.getById ( brickToAdd.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( retrievedBrick ) ; org.junit.jupiter.api.Assertions.assertEquals ( brickToAdd , retrievedBrick ) ; }
Source:
private static int setCDBootOrder ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isCD ( device ) ) && ( device.getIsPlugged ( ) ) ) { device.setBootOrder ( ( ++ bootOrder ) ) ; } } return bootOrder ; }

Target:
private static int setCDBootOrder ( java.util.Collection < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isCD ( device ) ) && ( device.isPlugged ( ) ) ) { device.setBootOrder ( ( ++ bootOrder ) ) ; } } return bootOrder ; }
Source:
public static void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.disk.GetDiskByDiskIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.storage.disk.GetDiskByDiskIdQuery.getDbFacade ( ) . getDiskDao ( ) . get ( org.ovirt.engine.core.bll.storage.disk.GetDiskByDiskIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.GetDiskByDiskIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.disk.GetDiskByDiskIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.disk.GetDiskByDiskIdQuery.getQueryReturnValue ( ) . setReturnValue ( diskDao.get ( org.ovirt.engine.core.bll.storage.disk.GetDiskByDiskIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.GetDiskByDiskIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.storage.disk.GetDiskByDiskIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public void invokeClient ( ) { org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker invoker = new org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker ( org.ovirt.engine.ui.common.uicommon.NoVncImpl.CLIENT_PAGE , config , getVncHost ( ) , getVncPort ( ) , getTicket ( ) , false ) ; invoker.invokeClient ( ) ; }

Target:
public void invokeClient ( ) { org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker invoker = new org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker ( org.ovirt.engine.ui.common.uicommon.NoVncImpl.CLIENT_PAGE , getConfig ( ) , getOptions ( ) . getHost ( ) , getOptions ( ) . getPort ( ) , getOptions ( ) . getTicket ( ) , false ) ; invoker.invokeClient ( ) ; }
Source:
public void testGetVolumesByOption ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getVolumesByOption ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID , GlusterStatus.UP , org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.OPTION_KEY_NFS_DISABLE , org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.OPTION_VALUE_OFF ) ; org.junit.Assert.assertTrue ( ( volumes != null ) ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingReplVol ) ) ; org.junit.Assert.assertTrue ( volumes.get ( 0 ) . isNfsEnabled ( ) ) ; }

Target:
public void testGetVolumesByOption ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getVolumesByOption ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID , GlusterStatus.UP , org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.OPTION_KEY_NFS_DISABLE , org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.OPTION_VALUE_OFF ) ; org.junit.Assert.assertNotNull ( volumes ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingReplVol ) ) ; org.junit.Assert.assertTrue ( volumes.get ( 0 ) . isNfsEnabled ( ) ) ; }
Source:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM getVmFromConfiguration ( ) { org.ovirt.engine.core.common.businessentities.VM result = null ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = runInternalQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshot.getId ( ) ) ) ; if ( queryReturnValue.getSucceeded ( ) ) { result = queryReturnValue.getReturnValue ( ) ; } return result ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM getVmFromConfiguration ( ) { if ( ( vmFromConfiguration ) == null ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = runInternalQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshot.getId ( ) ) ) ; if ( queryReturnValue.getSucceeded ( ) ) { vmFromConfiguration = queryReturnValue.getReturnValue ( ) ; } } return vmFromConfiguration ; }
Source:
public static final java.lang.Iterable < org.ovirt.engine.core.common.businessentities.Provider > filterNetworkProviders ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.Provider > source ) { return org.ovirt.engine.ui.uicommonweb.Linq.filterProvidersByProvidedType ( source , VdcObjectType.Network ) ; }

Target:
public int compare ( org.ovirt.engine.core.common.scheduling.ClusterPolicy cp1 , org.ovirt.engine.core.common.scheduling.ClusterPolicy cp2 ) { if ( ( cp1.isLocked ( ) ) != ( cp2.isLocked ( ) ) ) { return cp1.isLocked ( ) ? - 1 : 1 ; } return lexoNumeric.compare ( cp1.getName ( ) , cp2.getName ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc forcedDetachStorageDomain ( java.lang.String sdUUID , java.lang.String spUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StorageDomain.detach" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "force" , true ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn forcedDetachStorageDomain ( java.lang.String sdUUID , java.lang.String spUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StorageDomain.detach" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "force" , true ) . 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 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.RepoImage > repoList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > ) ( source ) ) ; java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.RepoImage repoImage : repoList ) { fileNameList.add ( repoImage.getRepoImageId ( ) ) ; } java.util.Collections.sort ( fileNameList , java.lang.String.CASE_INSENSITIVE_ORDER ) ; return fileNameList ; } return new java.util.ArrayList < java.lang.String > ( ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }
Source:
private static boolean isVnicProfilePermitted ( org.ovirt.engine.core.common.businessentities.DbUser user , org.ovirt.engine.core.common.businessentities.network.VnicProfile profile , boolean portMirroringRequired ) { return ( portMirroringRequired == ( profile.isPortMirroring ( ) ) ) && ( ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.getPermissionDAO ( ) . getEntityPermissions ( user.getId ( ) , ActionGroup.CONFIGURE_VM_NETWORK , profile.getId ( ) , VdcObjectType.VnicProfile ) ) != null ) ; }

Target:
private static boolean isVnicProfilePermitted ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user , org.ovirt.engine.core.common.businessentities.network.VnicProfile profile , boolean portMirroringRequired ) { return ( portMirroringRequired == ( profile.isPortMirroring ( ) ) ) && ( ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.getPermissionDAO ( ) . getEntityPermissions ( user.getId ( ) , ActionGroup.CONFIGURE_VM_NETWORK , profile.getId ( ) , VdcObjectType.VnicProfile ) ) != null ) ; }
Source:
public org.ovirt.engine.api.model.VMs list ( ) { return mapCollection ( getBackendCollection ( SearchType.VM ) ) ; }

Target:
public org.ovirt.engine.api.model.VMs list ( ) { if ( isFiltered ( ) ) return mapCollection ( getBackendCollection ( VdcQueryType.GetUserVmsByUserIdAndGroups , new org.ovirt.engine.core.common.queries.GetUserVmsByUserIdAndGroupsParameters ( getCurrent ( ) . get ( org.ovirt.engine.core.common.users.VdcUser.class ) . getUserId ( ) ) ) ) ; else return mapCollection ( getBackendCollection ( SearchType.VM ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StoragePool getPreviousDataCenter ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters ) { org.ovirt.engine.core.compat.Guid previousDataCenterId = getVmwarePropertiesModel ( ) . getLastStoragePoolId ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter : dataCenters ) { if ( dataCenter.getId ( ) . equals ( previousDataCenterId ) ) { return dataCenter ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.StoragePool getPreviousDataCenter ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters ) { org.ovirt.engine.core.compat.Guid previousDataCenterId = getProxyHostPropertiesModel ( ) . getLastStoragePoolId ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter : dataCenters ) { if ( dataCenter.getId ( ) . equals ( previousDataCenterId ) ) { return dataCenter ; } } return null ; }
Source:
public void testAllDomainsExistAndActive ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST.name ( ) ) ) ; }

Target:
public void testAllDomainsHaveSpaceForNewDisksFailure ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksListForChecks ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }
Source:
private boolean validateSourceStorageDomain ( org.ovirt.engine.core.compat.Guid imageId ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageById ( imageId ) ; org.ovirt.engine.core.compat.Guid domainId = diskImage.getStorageIds ( ) . get ( 0 ) ; org.ovirt.engine.core.bll.validator.StorageDomainValidator validator = getValidator ( domainId , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePoolId ( ) . getValue ( ) ) ; return validate ( validator.isDomainExistAndActive ( ) ) ; }

Target:
private boolean validateDestStorage ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid destDomainId ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator validator = getValidator ( destDomainId , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePoolId ( ) ) ; return ( validate ( validator.isDomainExistAndActive ( ) ) ) && ( validate ( validator.domainIsValidDestination ( ) ) ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.DeleteGlusterVolumeGeoRepSessionVDSCommand.getBroker ( ) . glusterVolumeGeoRepSessionDelete ( org.ovirt.engine.core.vdsbroker.gluster.DeleteGlusterVolumeGeoRepSessionVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.DeleteGlusterVolumeGeoRepSessionVDSCommand.getParameters ( ) . getSlaveHost ( ) , org.ovirt.engine.core.vdsbroker.gluster.DeleteGlusterVolumeGeoRepSessionVDSCommand.getParameters ( ) . getSlaveVolume ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.DeleteGlusterVolumeGeoRepSessionVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.DeleteGlusterVolumeGeoRepSessionVDSCommand.getBroker ( ) . glusterVolumeGeoRepSessionDelete ( org.ovirt.engine.core.vdsbroker.gluster.DeleteGlusterVolumeGeoRepSessionVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.DeleteGlusterVolumeGeoRepSessionVDSCommand.getParameters ( ) . getSlaveHost ( ) , org.ovirt.engine.core.vdsbroker.gluster.DeleteGlusterVolumeGeoRepSessionVDSCommand.getParameters ( ) . getSlaveVolume ( ) , org.ovirt.engine.core.vdsbroker.gluster.DeleteGlusterVolumeGeoRepSessionVDSCommand.getParameters ( ) . getUserName ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.DeleteGlusterVolumeGeoRepSessionVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public void testValidateImageNotActiveTrue ( ) { org.mockito.Mockito.when ( diskImageDAO.get ( mockSourceImage ( ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertTrue ( "validation should succeed" , cmd.validateImageNotActive ( ) ) ; }

Target:
private void mockSnapshot ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType snapshotType ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = new org.ovirt.engine.core.common.businessentities.Snapshot ( ) ; snapshot.setId ( cmd.getParameters ( ) . getSnapshotId ( ) ) ; snapshot.setType ( snapshotType ) ; org.mockito.Mockito.doReturn ( snapshot ) . when ( snapshotDao ) . get ( snapshot.getId ( ) ) ; }
Source:
public static java.lang.String generateVmName ( java.lang.String poolName , int number ) { java.util.regex.Matcher matcher = org.ovirt.engine.core.utils.NameForVmInPoolGenerator.PATTERNED_POOL_NAME_PATTERN.matcher ( poolName ) ; if ( matcher.find ( ) ) { java.lang.String numberPart = matcher.group ( 1 ) ; return java.lang.String.format ( poolName.replace ( numberPart , ( ( "%0" + ( numberPart.length ( ) ) ) + "d" ) ) , number ) ; } else { return java.lang.String.format ( "%1$s-%2$s" , poolName , number ) ; } }

Target:
public java.lang.String generateVmName ( ) { java.util.regex.Matcher matcher = org.ovirt.engine.core.utils.NameForVmInPoolGenerator.PATTERNED_POOL_NAME_PATTERN.matcher ( poolName ) ; if ( matcher.find ( ) ) { java.lang.String numberPart = matcher.group ( 1 ) ; return java.lang.String.format ( poolName.replace ( numberPart , ( ( "%0" + ( numberPart.length ( ) ) ) + "d" ) ) , ( ++ ( lastUsedIndex ) ) ) ; } else { return java.lang.String.format ( "%1$s-%2$s" , poolName , ( ++ ( lastUsedIndex ) ) ) ; } }
Source:
private void mockVdsBroker ( ) { org.mockito.Mockito.when ( org.ovirt.engine.core.bll.Backend.getInstance ( ) ) . thenReturn ( backend ) ; org.mockito.Mockito.when ( backend.getResourceManager ( ) ) . thenReturn ( vdsBrokerFrontend ) ; }

Target:
protected void setUpCommand ( ) { command = createCommand ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areTemplateImagesInStorageReady ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isMemorySizeLegal ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . verifyAddVM ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }
Source:
public void getUserIdVdcUserId ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.DbUser u = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; u.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setCurrentUser ( u ) ; final org.ovirt.engine.core.compat.Guid g = b.getUserId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; }

Target:
public void getUserIdVdcUserId ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbUser u = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; u.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setCurrentUser ( u ) ; final org.ovirt.engine.core.compat.Guid g = b.getUserId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g ) ; }
Source:
public void testListNonIso ( ) { try { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setupGetStorageDomainExpectations ( StorageDomainType.Data ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testListNonIso ( ) { try { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setupGetStorageDomainExpectations ( StorageDomainType.Data ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public org.ovirt.engine.api.model.Networks list ( ) { java.util.List < org.ovirt.engine.api.model.Network > entities ; if ( isFiltered ( ) ) { org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.Empty ) ; entities = getBackendCollection ( VdcQueryType.GetAllNetworks , parameters , SearchType.Network ) ; } else { entities = getBackendCollection ( SearchType.Network ) ; } org.ovirt.engine.api.model.Networks networks = mapCollection ( entities ) ; for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }

Target:
protected org.ovirt.engine.core.common.queries.VdcQueryParametersBase getQueryParameters ( ) { return new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.Empty ) ; }
Source:
private void removeMemoryFromActiveSnapshot ( ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( cachedMemoryVolumeFromSnapshot ) ) { return ; } if ( ( getSnapshotDao ( ) . getNumOfSnapshotsByMemory ( cachedMemoryVolumeFromSnapshot ) ) == 1 ) { removeMemoryVolumes ( cachedMemoryVolumeFromSnapshot , org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) , true ) ; } getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ; }

Target:
private void removeMemoryFromActiveSnapshot ( ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( cachedMemoryVolumeFromSnapshot ) ) { return ; } if ( ( org.ovirt.engine.core.bll.RunVmCommand.getSnapshotDAO ( ) . getNumOfSnapshotsByMemory ( cachedMemoryVolumeFromSnapshot ) ) == 1 ) { removeMemoryVolumes ( cachedMemoryVolumeFromSnapshot , org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) , true ) ; } org.ovirt.engine.core.bll.RunVmCommand.getSnapshotDAO ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ; }
Source:
private void doTestBadAddDataCenter ( boolean valid , boolean success , java.lang.String detail ) { setUriInfo ( setUpActionExpectations ( ActionType.AddEmptyStoragePool , org.ovirt.engine.core.common.action.StoragePoolManagementParameter.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; org.ovirt.engine.api.model.DataCenter model = org.ovirt.engine.api.restapi.resource.BackendDataCentersResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddDataCenter ( boolean valid , boolean success , java.lang.String detail ) { setUriInfo ( setUpActionExpectations ( ActionType.AddEmptyStoragePool , org.ovirt.engine.core.common.action.StoragePoolManagementParameter.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; org.ovirt.engine.api.model.DataCenter model = org.ovirt.engine.api.restapi.resource.BackendDataCentersResourceTest.getModel ( 0 ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( model ) ) , detail ) ; }
Source:
private void initSpyCommand ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand < org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters > ( new org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters ( new java.util.ArrayList < org.ovirt.engine.core.common.action.LiveMigrateDiskParameters > ( ) , vmId ) , null ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateSpaceRequirements ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . checkImagesStatus ( ) ; }

Target:
private void initSpyCommand ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand < org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters > ( new org.ovirt.engine.core.common.action.LiveMigrateVmDisksParameters ( new java.util.ArrayList < org.ovirt.engine.core.common.action.LiveMigrateDiskParameters > ( ) , vmId ) , null ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateSpaceRequirements ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . checkImagesStatus ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; }
Source:
private void updateShareable ( org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { getIsShareable ( ) . setEntity ( false ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . shareableDiskNotSupportedByConfiguration ( ) ) ; getIsShareable ( ) . setIsChangable ( ( ! ( ( storageType.isBlockDomain ( ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) ) ) ; }

Target:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.storage_pool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( isShareableDiskEnabled ) ; }
Source:
protected java.lang.String appendDetachNetworkSuggestion ( java.lang.String originalMessage , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel nic ) { return ( originalMessage + ' ' ) + ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . suggestDetachNetwork ( nic.getCulpritNetwork ( ) ) ) ; }

Target:
protected java.lang.String appendDetachNetworkSuggestion ( java.lang.String originalMessage , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > item ) { java.lang.String res = originalMessage ; java.lang.String culpritNetwork = item.getCulpritNetwork ( ) ; if ( culpritNetwork != null ) { res += ' ' + ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . suggestDetachNetwork ( item.getCulpritNetwork ( ) ) ) ; } return res ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsForDiskId ( ) { if ( ( listVms ) == null ) { listVms = org.ovirt.engine.core.bll.RemoveDiskCommand.getVmDAO ( ) . getVmsListForDisk ( disk.getId ( ) ) ; } return listVms ; }

Target:
private void setVmTemplateIdParameter ( ) { java.util.Map < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.VmTemplate > templateMap = org.ovirt.engine.core.bll.RemoveDiskCommand.getDbFacade ( ) . getVmTemplateDAO ( ) . getAllForImage ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) . getImageId ( ) ) ; if ( ! ( templateMap.isEmpty ( ) ) ) { setVmTemplateId ( templateMap.values ( ) . iterator ( ) . next ( ) . getId ( ) ) ; } }
Source:
public void testGetAllForStorageDomain ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllForStorageDomain ( org.ovirt.engine.core.dao.VmDAOTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }

Target:
public void testGetAllForStorageDomainWithVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllForStorageDomain ( FixturesTool.STORAGE_DOAMIN_SCALE_SD5 ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.VM_RHEL5_POOL_57 , result.get ( 0 ) . getId ( ) ) ; }
Source:
public void onSuccessDontTryNextAgent ( ) { mockExecutor ( agent1 , true ) ; mockCheckStatus ( "on" ) ; org.mockito.Mockito.when ( executor.fence ( org.mockito.Matchers.eq ( FenceActionType.Start ) , org.mockito.Matchers.eq ( agent2 ) ) ) . thenThrow ( new java.lang.IllegalStateException ( ) ) ; command.executeCommand ( ) ; }

Target:
public void onSuccessDontTryNextAgent ( ) { mockExecutor ( agent1 , true ) ; mockCheckStatus ( "on" ) ; org.mockito.Mockito.when ( executor.fence ( org.mockito.Matchers.eq ( FenceActionType.START ) , org.mockito.Matchers.eq ( agent2 ) ) ) . thenThrow ( new java.lang.IllegalStateException ( ) ) ; command.executeCommand ( ) ; }
Source:
public void testListFailure ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; assertEquals ( mockl10n ( org.ovirt.engine.api.restapi.resource.FAILURE ) , ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) . getDetail ( ) ) ; } }

Target:
public void testListFailure ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; try { getCollection ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; org.junit.Assert.assertEquals ( mockl10n ( org.ovirt.engine.api.restapi.resource.FAILURE ) , ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) . getDetail ( ) ) ; } }
Source:
private void cancelIncommingMigrations ( ) { for ( org.ovirt.engine.core.compat.Guid hostId : vdssToMaintenance.keySet ( ) ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getVmDAO ( ) . getAllMigratingToHost ( hostId ) ) { if ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) { log.infoFormat ( "Cancelling incoming migration of {0} id: {1}" , vm , vm.getId ( ) ) ; runVdsCommand ( VDSCommandType.CancelMigrate , new org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrationVDSParameters ( vm.getRunOnVds ( ) , vm.getId ( ) , true ) ) ; } } } }

Target:
private void cancelIncommingMigrations ( ) { for ( org.ovirt.engine.core.compat.Guid hostId : vdssToMaintenance.keySet ( ) ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getVmDAO ( ) . getAllMigratingToHost ( hostId ) ) { if ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) { log.info ( "Cancelling incoming migration of '{}' id '{}'" , vm , vm.getId ( ) ) ; runVdsCommand ( VDSCommandType.CancelMigrate , new org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrationVDSParameters ( vm.getRunOnVds ( ) , vm.getId ( ) , true ) ) ; } } } }
Source:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testRemove ( ) { dao.save ( dummyPolicy ) ; dao.remove ( dummyPolicy.getId ( ) ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy result = dao.get ( dummyPolicy.getId ( ) , java.util.Collections.emptyMap ( ) ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void testRemove ( ) { dao.save ( dummyPolicy ) ; dao.remove ( dummyPolicy.getId ( ) ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy result = dao.get ( dummyPolicy.getId ( ) , java.util.Collections.emptyMap ( ) ) ; org.junit.jupiter.api.Assertions.assertNull ( result ) ; }
Source:
public void testEmpty ( ) { java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "" ) ) ; org.junit.Assert.assertTrue ( "true" , comps.contains ( "true" ) ) ; org.junit.Assert.assertTrue ( "false" , comps.contains ( "false" ) ) ; org.junit.Assert.assertTrue ( "False" , ( ! ( comps.contains ( "False" ) ) ) ) ; }

Target:
public void testEmpty ( ) { java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "" ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( comps.contains ( "true" ) , "true" ) ; org.junit.jupiter.api.Assertions.assertTrue ( comps.contains ( "false" ) , "false" ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ! ( comps.contains ( "False" ) ) ) , "False" ) ; }
Source:
protected org.ovirt.engine.api.model.StorageDomain deprecatedPopulate ( org.ovirt.engine.api.model.StorageDomain model , org.ovirt.engine.api.model.StorageDomain entity ) { if ( StorageDomainSharedStatus.Unattached.equals ( entity.getstorage_domain_shared_status ( ) ) ) { model.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( StorageDomainStatus.UNATTACHED ) ) ; } else { model.setStatus ( null ) ; } return super . deprecatedPopulate ( model , entity ) ; }

Target:
protected org.ovirt.engine.api.model.StorageDomain deprecatedPopulate ( org.ovirt.engine.api.model.StorageDomain model , org.ovirt.engine.api.model.StorageDomain entity ) { if ( StorageDomainSharedStatus.Unattached.equals ( entity.getStorageDomainSharedStatus ( ) ) ) { model.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( StorageDomainStatus.UNATTACHED ) ) ; } else { model.setStatus ( null ) ; } return super . deprecatedPopulate ( model , entity ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult diskImagesBelongToSameImageGroup ( ) { org.ovirt.engine.core.compat.Guid imageGroupId = null ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : images ) { if ( ( imageGroupId == null ) || ( diskImage.getId ( ) . equals ( imageGroupId ) ) ) { imageGroupId = diskImage.getId ( ) ; continue ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISKS_SNAPSHOTS_DONT_BELONG_TO_SAME_DISK ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult diskImagesBelongToSameImageGroup ( ) { org.ovirt.engine.core.compat.Guid imageGroupId = null ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : images ) { if ( ( imageGroupId == null ) || ( diskImage.getId ( ) . equals ( imageGroupId ) ) ) { imageGroupId = diskImage.getId ( ) ; continue ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISKS_SNAPSHOTS_DONT_BELONG_TO_SAME_DISK ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public java.lang.Boolean getValue ( ) { boolean allEntriesDisabled = ! ( isEnabled ( ) ) ; for ( org.ovirt.engine.ui.uicommonweb.models.hosts.VfsConfigNetwork vfsConfigNetwork : getNetworksTableItems ( ) ) { if ( allEntriesDisabled || ( canEditAssign ( vfsConfigNetwork ) ) ) { if ( ! ( vfsConfigNetwork.isAttached ( ) ) ) { return false ; } } } return true ; }

Target:
public java.lang.Boolean getValue ( ) { for ( org.ovirt.engine.ui.uicommonweb.models.hosts.VfsConfigNetwork vfsConfigNetwork : getNetworksTableItems ( ) ) { if ( ! ( shouldNetworkBeDisplayedAsAttached ( vfsConfigNetwork ) ) ) { return false ; } } return true ; }
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 modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { if ( isNewAttachment ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.VAR_NETWORK_ATTACHMENT_NOT_EXISTS_ENTITY , networkAttachmentId.toString ( ) ) ) ; }
Source:
public static void GetStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.storage_server_connections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public static void IsUSBEnabledByDefault ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public void testGetAllVMTemplatesSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Template" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.VmTemplate ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( vmTemplateResultList , searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testGetAllVMTemplatesSearch ( ) throws java.lang.Exception { org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchPattern ( ) ) . thenReturn ( ( "Template" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchTypeValue ( ) ) . thenReturn ( SearchType.VmTemplate ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( vmTemplateResultList , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
public void getHostById ( 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.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
public void setInSlot ( java.lang.Object slot , com.google.gwt.user.client.ui.IsWidget content ) { if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.TYPE_SetSearchPanel ) ) { if ( content != null ) { actionPanel.setSearchPanel ( content ) ; actionPanel.setVisible ( true ) ; } } else { super . setInSlot ( slot , content ) ; } }

Target:
public void setInSlot ( java.lang.Object slot , com.google.gwt.user.client.ui.IsWidget content ) { if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.TYPE_SetSearchPanel ) ) { if ( content != null ) { actionPanel.setSearchPanel ( content ) ; actionPanel.setVisible ( true ) ; } else { actionPanel.setVisible ( false ) ; } } else if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.TYPE_SetBreadCrumbs ) ) { breadCrumbsColumn.clear ( ) ; if ( content != null ) { breadCrumbsColumn.add ( content ) ; } } else { super . setInSlot ( slot , content ) ; } }