auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetVolumesByStatusTypesAndOption ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getVolumesByStatusTypesAndOption ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID , GlusterStatus.UP , java.util.Collections.singletonList ( GlusterVolumeType.DISTRIBUTED_REPLICATE ) , 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 ) ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume : volumes ) { org.junit.Assert.assertTrue ( ( ( volume.isNfsEnabled ( ) ) && ( ( volume.getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.DISTRIBUTED_REPLICATE ) ) ) ) ; } }

Target:
public void testGetVolumesByStatusTypesAndOption ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getVolumesByStatusTypesAndOption ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID , GlusterStatus.UP , java.util.Collections.singletonList ( GlusterVolumeType.DISTRIBUTED_REPLICATE ) , 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 ) ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume : volumes ) { org.junit.Assert.assertTrue ( ( ( volume.isNfsEnabled ( ) ) && ( ( volume.getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.DISTRIBUTED_REPLICATE ) ) ) ) ; } }
Source:
public void testGetStoragePoolIsoMap ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , new org.ovirt.engine.core.compat.Guid ( existingStoragePoolIsoMap.getstorage_pool_id ( ) . toString ( ) ) ) ) ; assertNotNull ( result ) ; assertEquals ( existingStoragePoolIsoMap , result ) ; }

Target:
public void testGetStoragePoolIsoMap ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , new org.ovirt.engine.core.compat.Guid ( existingStoragePoolIsoMap.getstorage_pool_id ( ) . toString ( ) ) ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingStoragePoolIsoMap , result ) ; }
Source:
protected void RemoveTaskFromDB ( ) { try { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . remove ( getTaskID ( ) ) ) != 0 ) { org.ovirt.engine.core.bll.SPMAsyncTask.log.infoFormat ( "BaseAsyncTask::RemoveTaskFromDB: Removed task {0} from DataBase" , getTaskID ( ) ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.SPMAsyncTask.log.error ( java.lang.String.format ( "BaseAsyncTask::RemoveTaskFromDB: Removing task %1$s from DataBase threw an exception." , getTaskID ( ) ) , e ) ; } }

Target:
protected void RemoveTaskFromDB ( ) { try { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . removeByVdsmTaskId ( getVdsmTaskId ( ) ) ) != 0 ) { org.ovirt.engine.core.bll.SPMAsyncTask.log.infoFormat ( "BaseAsyncTask::RemoveTaskFromDB: Removed task {0} from DataBase" , getVdsmTaskId ( ) ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.SPMAsyncTask.log.error ( java.lang.String.format ( "BaseAsyncTask::RemoveTaskFromDB: Removing task %1$s from DataBase threw an exception." , getVdsmTaskId ( ) ) , e ) ; } }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( "OnRemove" . equals ( command.getName ( ) ) ) { onRemove ( ) ; } else if ( "OnRestore" . equals ( command.getName ( ) ) ) { onRestore ( ) ; } else { super . executeCommand ( command ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( "OnRemove" . equals ( command.getName ( ) ) ) { onRemove ( ) ; } else if ( "OnRestore" . equals ( command.getName ( ) ) ) { onRestore ( ) ; } else if ( "CancelConfirmation" . equals ( command.getName ( ) ) ) { cancelConfirmation ( ) ; } else if ( "RemoveVmTemplates" . equals ( command.getName ( ) ) ) { removeTemplateBackup ( ) ; } else { super . executeCommand ( command ) ; } }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > createDiskDummiesForSpaceValidations ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > dummies = new java.util.ArrayList ( disksList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : disksList ) { org.ovirt.engine.core.compat.Guid targetSdId = diskInfoDestinationMap.get ( image.getId ( ) ) . getStorageIds ( ) . get ( 0 ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage dummy = org.ovirt.engine.core.bll.ImagesHandler.createDiskImageWithExcessData ( image , targetSdId ) ; dummies.add ( dummy ) ; } return dummies ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > createDiskDummiesForSpaceValidations ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > dummies = new java.util.ArrayList ( disksList.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : disksList ) { org.ovirt.engine.core.compat.Guid targetSdId = diskInfoDestinationMap.get ( image.getId ( ) ) . getStorageIds ( ) . get ( 0 ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage dummy = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.createDiskImageWithExcessData ( image , targetSdId ) ; dummies.add ( dummy ) ; } return dummies ; }
Source:
protected void executeQuery ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.DirectorySearcher directorySearcher ) { final java.util.List < org.ovirt.engine.core.common.businessentities.aaa.LdapUser > userList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.aaa.LdapUser > ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.List < org.ovirt.engine.core.common.businessentities.aaa.LdapUser > usersList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.aaa.LdapUser > ) ( directorySearcher.findAll ( getLdapQueryData ( ) ) ) ) ; for ( final org.ovirt.engine.core.common.businessentities.aaa.LdapUser searchResult : usersList ) { { org.ovirt.engine.core.common.businessentities.aaa.LdapUser user = populateUserData ( searchResult , getLdapQueryData ( ) . getDomain ( ) , populateGroups , populateGroupsRecursively ) ; userList.add ( user ) ; } } setReturnValue ( userList ) ; setSucceeded ( true ) ; }

Target:
protected void executeQuery ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.DirectorySearcher directorySearcher ) { final java.util.List < org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapUser > userList = new java.util.ArrayList < org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapUser > ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.List < org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapUser > usersList = ( ( java.util.List < org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapUser > ) ( directorySearcher.findAll ( getLdapQueryData ( ) ) ) ) ; for ( final org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapUser searchResult : usersList ) { { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapUser user = populateUserData ( searchResult , getLdapQueryData ( ) . getDomain ( ) , populateGroups , populateGroupsRecursively ) ; userList.add ( user ) ; } } setReturnValue ( userList ) ; setSucceeded ( true ) ; }
Source:
public static void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private void setupVmDao ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > expectedVms ) { org.ovirt.engine.core.dao.VmDAO vmDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDAO.class ) ; org.mockito.Mockito.when ( vmDaoMock.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVms ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmDao ( ) ) . thenReturn ( vmDaoMock ) ; }

Target:
private void setupVmDao ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > expectedVms ) { org.ovirt.engine.core.dao.VmDao vmDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDao.class ) ; org.mockito.Mockito.when ( vmDaoMock.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVms ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmDao ( ) ) . thenReturn ( vmDaoMock ) ; }
Source:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( domain.getstorage_type ( ) ) . StorageDomainRemoved ( domain.getStorageStaticData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDAO ( ) . remove ( domain.getId ( ) ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( domain.getstorage_type ( ) ) . StorageDomainRemoved ( domain.getStorageStaticData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . remove ( domain.getId ( ) ) ; return null ; }
Source:
public static void GetSANWipeAfterDelete ( 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.SANWipeAfterDelete ) , aQuery ) ; }

Target:
public static 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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByAdElementIdParameters ( userId ) , aQuery ) ; }
Source:
protected void endSuccessfully ( ) { org.ovirt.engine.core.bll.ExportVmCommand.EndActionOnAllImageGroups ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.UnLockVm ( vm ) ; endDiskRelatedActions ( vm ) ; if ( org.ovirt.engine.core.bll.ExportVmCommand.getParameters ( ) . getCopyCollapse ( ) ) { endCopyCollapseOperations ( vm ) ; } else { updateSnapshotOvf ( vm ) ; } org.ovirt.engine.core.bll.ExportVmCommand.setSucceeded ( true ) ; }

Target:
protected void endSuccessfully ( ) { org.ovirt.engine.core.bll.ExportVmCommand.endActionOnAllImageGroups ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.UnLockVm ( vm ) ; endDiskRelatedActions ( vm ) ; if ( org.ovirt.engine.core.bll.ExportVmCommand.getParameters ( ) . getCopyCollapse ( ) ) { endCopyCollapseOperations ( vm ) ; } else { updateSnapshotOvf ( vm ) ; } org.ovirt.engine.core.bll.ExportVmCommand.setSucceeded ( true ) ; }
Source:
private void UpdateIsSysprepEnabled ( ) { boolean isFloppyAttached = ( ( java.lang.Boolean ) ( getAttachFloppy ( ) . getEntity ( ) ) ) ; boolean isVmFirstRun = ( ( java.lang.Boolean ) ( getIsVmFirstRun ( ) . getEntity ( ) ) ) ; getIsSysprepEnabled ( ) . setEntity ( ( ( getIsWindowsOS ( ) ) && ( getReinitialize ( ) ) ) ) ; }

Target:
private void updateIsSysprepEnabled ( ) { boolean isFloppyAttached = ( ( java.lang.Boolean ) ( getAttachFloppy ( ) . getEntity ( ) ) ) ; boolean isVmFirstRun = ( ( java.lang.Boolean ) ( getIsVmFirstRun ( ) . getEntity ( ) ) ) ; getIsSysprepEnabled ( ) . setEntity ( ( ( getIsWindowsOS ( ) ) && ( ( getInitializationType ( ) ) == ( org.ovirt.engine.core.common.businessentities.InitializationType.Sysprep ) ) ) ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( obj == null ) return false ; if ( ( obj.getClass ( ) ) != ( this . getClass ( ) ) ) return false ; org.ovirt.engine.core.common.businessentities.bookmarks that = ( ( org.ovirt.engine.core.common.businessentities.bookmarks ) ( obj ) ) ; boolean result = this . id.equals ( that.id ) ; result &= this . name.equals ( that.name ) ; result &= this . value.equals ( that.value ) ; return result ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( obj == null ) return false ; if ( ( obj.getClass ( ) ) != ( this . getClass ( ) ) ) return false ; org.ovirt.engine.core.common.businessentities.Bookmark that = ( ( org.ovirt.engine.core.common.businessentities.Bookmark ) ( obj ) ) ; boolean result = this . id.equals ( that.id ) ; result &= this . name.equals ( that.name ) ; result &= this . value.equals ( that.value ) ; return result ; }
Source:
private void assertGetDiscardAfterDeleteLegalForNewBlockStorageDomainPredicate ( boolean allLunsSupportDiscard ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidatorTest.injectorRule.bind ( org.ovirt.engine.core.bll.storage.utils.BlockStorageDiscardFunctionalityHelper.class , discardFunctionalityHelper ) ; org.mockito.Mockito.when ( discardFunctionalityHelper.allLunsSupportDiscard ( org.mockito.Matchers.anyCollectionOf ( org.ovirt.engine.core.common.businessentities.storage.LUNs.class ) ) ) . thenReturn ( allLunsSupportDiscard ) ; org.junit.Assert.assertEquals ( validator.getDiscardAfterDeleteLegalForNewBlockStorageDomainPredicate ( java.util.Collections.emptyList ( ) ) . get ( ) , allLunsSupportDiscard ) ; }

Target:
private void assertGetDiscardAfterDeleteLegalForNewBlockStorageDomainPredicate ( boolean allLunsSupportDiscard ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidatorTest.injectorRule.bind ( org.ovirt.engine.core.bll.storage.utils.BlockStorageDiscardFunctionalityHelper.class , discardFunctionalityHelper ) ; org.mockito.Mockito.when ( discardFunctionalityHelper.allLunsSupportDiscard ( org.mockito.ArgumentMatchers.anyCollectionOf ( org.ovirt.engine.core.common.businessentities.storage.LUNs.class ) ) ) . thenReturn ( allLunsSupportDiscard ) ; org.junit.Assert.assertEquals ( validator.getDiscardAfterDeleteLegalForNewBlockStorageDomainPredicate ( java.util.Collections.emptyList ( ) ) . get ( ) , allLunsSupportDiscard ) ; }
Source:
static org.ovirt.engine.api.model.Network setUpEntityExpectations ( org.ovirt.engine.api.model.Network entity , boolean isDisplay , boolean isRequired , int index ) { org.easymock.classextension.EasyMock.expect ( entity.getis_display ( ) ) . andReturn ( isDisplay ) . anyTimes ( ) ; org.easymock.classextension.EasyMock.expect ( entity.isRequired ( ) ) . andReturn ( isRequired ) . anyTimes ( ) ; return org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.setUpEntityExpectations ( entity , index ) ; }

Target:
static org.ovirt.engine.api.model.Network setUpEntityExpectations ( org.ovirt.engine.api.model.Network entity , boolean isDisplay , boolean isRequired , int index ) { org.ovirt.engine.core.common.businessentities.network_cluster networkCluster = new org.ovirt.engine.core.common.businessentities.network_cluster ( ) ; networkCluster.setis_display ( isDisplay ) ; networkCluster.setRequired ( isRequired ) ; org.easymock.classextension.EasyMock.expect ( entity.getCluster ( ) ) . andReturn ( networkCluster ) . anyTimes ( ) ; return org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.setUpEntityExpectations ( entity , index ) ; }
Source:
public void getPermissionCheckSubjectsTest ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = addCpuProfileCommand.getPermissionCheckSubjects ( ) ; org.junit.Assert.assertEquals ( 1 , permissions.size ( ) ) ; org.ovirt.engine.core.bll.utils.PermissionSubject permissionSubject = permissions.get ( 0 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.CLUSTER_ID , permissionSubject.getObjectId ( ) ) ; org.junit.Assert.assertEquals ( VdcObjectType.Cluster , permissionSubject.getObjectType ( ) ) ; }

Target:
public void getPermissionCheckSubjectsTest ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = addCpuProfileCommand.getPermissionCheckSubjects ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , permissions.size ( ) ) ; org.ovirt.engine.core.bll.utils.PermissionSubject permissionSubject = permissions.get ( 0 ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.CLUSTER_ID , permissionSubject.getObjectId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( VdcObjectType.Cluster , permissionSubject.getObjectType ( ) ) ; }
Source:
public void testGetExtendedHostDevicesByHostId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDeviceView > hostDevices = dao.getExtendedHostDevicesByHostId ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_HOST_ID ) ; org.junit.Assert.assertEquals ( getEneitiesTotalCount ( ) , hostDevices.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.HostDeviceView hostDevice : hostDevices ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_HOST_ID , hostDevice.getHostId ( ) ) ; } }

Target:
public void testGetExtendedHostDevicesByHostId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDeviceView > hostDevices = dao.getExtendedHostDevicesByHostId ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_HOST_ID ) ; org.junit.Assert.assertEquals ( getEntitiesTotalCount ( ) , hostDevices.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.HostDeviceView hostDevice : hostDevices ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_HOST_ID , hostDevice.getHostId ( ) ) ; } }
Source:
private void moveVMsToUnknown ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = getVmsToMoveToUnknown ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmList ) { destroyVmOnDestination ( vm ) ; resourceManager.runVdsCommand ( VDSCommandType.SetVmStatus , new org.ovirt.engine.core.common.vdscommands.SetVmStatusVDSCommandParameters ( vm.getId ( ) , org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVmId ( vm.getId ( ) ) ; auditLogDirector.log ( logable , AuditLogType.VM_SET_TO_UNKNOWN_STATUS ) ; } }

Target:
private void moveVmsToUnknown ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = getVmsToMoveToUnknown ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { destroyVmOnDestination ( vm ) ; resourceManager.runVdsCommand ( VDSCommandType.SetVmStatus , new org.ovirt.engine.core.common.vdscommands.SetVmStatusVDSCommandParameters ( vm.getId ( ) , org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVmId ( vm.getId ( ) ) ; auditLogDirector.log ( logable , AuditLogType.VM_SET_TO_UNKNOWN_STATUS ) ; } }
Source:
public boolean equals ( java.lang.Object obj ) { if ( obj == null ) { return false ; } if ( ! ( super . equals ( obj ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails brickDetails = ( ( org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails ) ( obj ) ) ; if ( ( brickDetails.getBrickId ( ) ) == null ) { return false ; } if ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getBrickId ( ) , brickDetails.getBrickId ( ) ) ) ) { return false ; } return true ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( obj == null ) { return false ; } if ( ! ( super . equals ( obj ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails brickDetails = ( ( org.ovirt.engine.core.common.businessentities.gluster.BrickProfileDetails ) ( obj ) ) ; if ( ( brickDetails.getBrickId ( ) ) == null ) { return false ; } if ( ! ( java.util.Objects.equals ( getBrickId ( ) , brickDetails.getBrickId ( ) ) ) ) { return false ; } return true ; }
Source:
private boolean validateSourceStorageDomain ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid sourceDomainId ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator validator = getValidator ( imageId , sourceDomainId ) ; return validate ( validator.isDomainExistAndActive ( ) ) ; }

Target:
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 ( ) ) ; }
Source:
public void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public void testAddStorageDomainWithHostName ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Host host = new org.ovirt.engine.api.model.Host ( ) ; host.setName ( NAMES [ 0 ] ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsStaticByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ 0 ] } , setUpVDStatic ( 0 ) ) ; doTestAddStorageDomain ( 0 , host , false ) ; }

Target:
public void testAddStorageDomainWithHostName ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Host host = new org.ovirt.engine.api.model.Host ( ) ; host.setName ( NAMES [ 0 ] ) ; setUpGetEntityExpectations ( QueryType.GetVdsStaticByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ 0 ] } , setUpVDStatic ( 0 ) ) ; doTestAddStorageDomain ( 0 , host , false ) ; }
Source:
private void enableEditPoolFields ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { descriptionEditor.setEnabled ( true ) ; commentEditor.setEnabled ( true ) ; prestartedVmsEditor.setEnabled ( true ) ; editPrestartedVmsEditor.setEnabled ( true ) ; incraseNumOfVmsEditor.setEnabled ( true ) ; editMaxAssignedVmsPerUserEditor.setEnabled ( true ) ; spiceProxyEditor.setEnabled ( model.getSpiceProxyEnabled ( ) . getEntity ( ) ) ; templateWithVersionEditor.setEnabled ( true ) ; }

Target:
private void enableEditPoolFields ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { descriptionEditor.setEnabled ( true ) ; commentEditor.setEnabled ( true ) ; prestartedVmsEditor.setEnabled ( true ) ; editPrestartedVmsEditor.setEnabled ( true ) ; increaseNumOfVmsEditor.setEnabled ( true ) ; editMaxAssignedVmsPerUserEditor.setEnabled ( true ) ; spiceProxyEditor.setEnabled ( model.getSpiceProxyEnabled ( ) . getEntity ( ) ) ; templateWithVersionEditor.setEnabled ( true ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS createServer ( org.ovirt.engine.core.compat.Guid serverId , java.lang.String hostname , org.ovirt.engine.core.compat.Version version ) { org.ovirt.engine.core.common.businessentities.VdsStatic vdsStatic = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; vdsStatic.setId ( serverId ) ; vdsStatic.setHostName ( hostname ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; vdsDynamic.setstatus ( VDSStatus.Up ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( vdsStatic , vdsDynamic , new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ) ; vds.setVdsGroupCompatibilityVersion ( version ) ; return vds ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS createServer ( org.ovirt.engine.core.compat.Guid serverId , java.lang.String hostname , org.ovirt.engine.core.compat.Version version ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( serverId ) ; vds.setHostName ( hostname ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setVdsGroupCompatibilityVersion ( version ) ; return vds ; }
Source:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
protected static org.ovirt.engine.core.compat.Guid getPrestartedVmToAttach ( org.ovirt.engine.core.compat.NGuid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Up ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( map.getvm_guid ( ) ) ) { return map.getvm_guid ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
private static org.ovirt.engine.core.common.businessentities.StoragePool fetchStoragePool ( org.ovirt.engine.core.compat.Guid storagePoolId ) { return org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( storagePoolId ) ; }
Source:
public void testParseMissingType ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:one=1" , "two=int" ) ; org.junit.Assert.assertNotNull ( ret ) ; org.junit.Assert.assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" ) ; }

Target:
public void testParseMissingType ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:one=1" , "two=int" ) ; org.junit.jupiter.api.Assertions.assertNotNull ( ret ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" ) ; }
Source:
public org.ovirt.engine.core.aaa.Authenticator create ( org.ovirt.engine.core.extensions.mgr.Configuration config ) throws org.ovirt.engine.core.extensions.mgr.ConfigurationException { java.lang.String header = config.getString ( org.ovirt.engine.core.aaa.header.HeaderAuthenticatorFactory.HEADER_PARAMETER ) ; if ( header == null ) { throw new org.ovirt.engine.core.extensions.mgr.ConfigurationException ( ( ( ( ( ( ( "The configuration file \"" + ( config.getFile ( ) . getAbsolutePath ( ) ) ) + "\" doesn\'t contain the " ) + "parameter \"" ) + ( config.getAbsoluteKey ( org.ovirt.engine.core.aaa.header.HeaderAuthenticatorFactory.HEADER_PARAMETER ) ) ) + "\" that specifies the name of " ) + "the header containing the remote user name." ) ) ; } return new org.ovirt.engine.core.aaa.header.HeaderAuthenticator ( header ) ; }

Target:
public org.ovirt.engine.core.aaa.Authenticator createImpl ( java.lang.String profileName , org.ovirt.engine.core.extensions.mgr.Configuration config ) throws org.ovirt.engine.core.extensions.mgr.ConfigurationException { java.lang.String header = config.getString ( org.ovirt.engine.core.aaa.header.HeaderAuthenticatorFactory.HEADER_PARAMETER ) ; if ( header == null ) { throw new org.ovirt.engine.core.extensions.mgr.ConfigurationException ( ( ( ( ( ( ( "The configuration file \"" + ( config.getFile ( ) . getAbsolutePath ( ) ) ) + "\" doesn\'t contain the " ) + "parameter \"" ) + ( config.getAbsoluteKey ( org.ovirt.engine.core.aaa.header.HeaderAuthenticatorFactory.HEADER_PARAMETER ) ) ) + "\" that specifies the name of " ) + "the header containing the remote user name." ) ) ; } return new org.ovirt.engine.core.aaa.header.HeaderAuthenticator ( profileName , header ) ; }
Source:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmStaticDAO ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getId ( ) ) ; UpdateVmTemplate ( ) ; updateWatchdog ( ) ; checkTrustedService ( ) ; org.ovirt.engine.core.bll.UpdateVmTemplateCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.VmHandler.warnMemorySizeLegal ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getParameters ( ) . getVmTemplateData ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ; if ( ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmStaticDAO ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getId ( ) ) ; updateOriginalTemplateNameOnDerivedVms ( ) ; UpdateVmTemplate ( ) ; updateWatchdog ( ) ; checkTrustedService ( ) ; org.ovirt.engine.core.bll.UpdateVmTemplateCommand.setSucceeded ( true ) ; } }
Source:
public java.lang.String getAdUserName ( ) { if ( ( mAdUserName ) == null ) { org.ovirt.engine.core.common.businessentities.DbUser user = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . get ( getAdUserId ( ) ) ; if ( user != null ) { mAdUserName = user.getusername ( ) ; } } return mAdUserName ; }

Target:
public java.lang.String getAdUserName ( ) { if ( ( mAdUserName ) == null ) { org.ovirt.engine.core.common.businessentities.DbUser user = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . get ( getAdUserId ( ) ) ; if ( user != null ) { mAdUserName = user.getLoginName ( ) ; } } return mAdUserName ; }
Source:
private boolean networkExists ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network_cluster > networks = org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.getNetworkClusterDAO ( ) . getAllForCluster ( org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.getVdsGroupId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network_cluster network_cluster : networks ) { if ( network_cluster.getnetwork_id ( ) . equals ( getNetwork ( ) . getId ( ) ) ) { return true ; } } return false ; }

Target:
private boolean networkExists ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network_cluster > networks = org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.getNetworkClusterDAO ( ) . getAllForCluster ( org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.getVdsGroupId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network_cluster network_cluster : networks ) { if ( network_cluster.getnetwork_id ( ) . equals ( org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.getParameters ( ) . getNetworkCluster ( ) . getnetwork_id ( ) ) ) { return true ; } } return false ; }
Source:
private void assertLabelBeingAttachedToValidBondFailed ( org.ovirt.engine.core.common.action.HostSetupNetworksParameters params , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = java.util.Collections.singletonList ( nic ) ; org.ovirt.engine.core.common.businessentities.network.NicLabel nicLabel = new org.ovirt.engine.core.common.businessentities.network.NicLabel ( nic.getId ( ) , nic.getName ( ) , "lbl1" ) ; org.junit.Assert.assertThat ( createNicLabelValidator ( params , nics ) . labelBeingAttachedToValidBond ( nicLabel ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.IMPROPER_BOND_IS_LABELED , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_BOND_NAME , nic.getName ( ) ) ) ) ; }

Target:
private void assertLabelBeingAttachedToValidBondFailed ( org.ovirt.engine.core.common.action.HostSetupNetworksParameters params , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics = java.util.Collections.singletonList ( nic ) ; org.ovirt.engine.core.common.businessentities.network.NicLabel nicLabel = new org.ovirt.engine.core.common.businessentities.network.NicLabel ( nic.getId ( ) , nic.getName ( ) , "lbl1" ) ; org.hamcrest.MatcherAssert.assertThat ( createNicLabelValidator ( params , nics ) . labelBeingAttachedToValidBond ( nicLabel ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.IMPROPER_BOND_IS_LABELED , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_BOND_NAME , nic.getName ( ) ) ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( getDisk ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } org.ovirt.engine.core.bll.validator.storage.DiskValidator oldDiskValidator = new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( getDisk ( ) ) ; return ( ( validate ( oldDiskValidator.validateNotHostedEngineDisk ( ) ) ) && ( validateAllVmsForDiskAreDown ( ) ) ) && ( canRemoveDiskBasedOnStorageTypeCheck ( ) ) ; }

Target:
private boolean validateHostedEngineDisks ( ) { org.ovirt.engine.core.bll.validator.storage.DiskValidator oldDiskValidator = new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( getDisk ( ) ) ; if ( ( ( getDisk ( ) . getVmEntityType ( ) ) != null ) && ( getDisk ( ) . getVmEntityType ( ) . isVmType ( ) ) ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : getVmsForDiskId ( ) ) { if ( ! ( validate ( oldDiskValidator.validRemovableHostedEngineDisks ( vm ) ) ) ) { return false ; } } } return true ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > getAllForVm ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > results = getCallsHandler ( ) . executeReadList ( "Getvm_interfaceByvm_id" , mapper , parameterSource ) ; java.util.Collections.sort ( results , new org.ovirt.engine.core.common.businessentities.InterfaceComparerByMAC ( ) ) ; return results ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > getAllForVm ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > results = getCallsHandler ( ) . executeReadList ( "Getvm_interfaceByvm_id" , mapper , parameterSource ) ; java.util.Collections.sort ( results , new org.ovirt.engine.core.common.businessentities.comparators.InterfaceComparerByMAC ( ) ) ; return results ; }
Source:
private void initVmDiskImage ( boolean isShareable ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setVmEntityType ( VmEntityType.VM ) ; diskImage.setShareable ( isShareable ) ; org.mockito.Mockito.when ( diskImageDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( diskImage ) ; }

Target:
public void passDiscardSupportedForCopyFloatingDiskOp ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.TEMPLATE ) ; command.getParameters ( ) . setOperation ( ImageOperation.Copy ) ; org.junit.Assert.assertTrue ( command.validatePassDiscardSupportedForDestinationStorageDomain ( ) ) ; }
Source:
public void ImportTemplate ( java.lang.String ovfstring , org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces ) throws org.ovirt.engine.core.utils.ovf.OvfReaderException { org.ovirt.engine.core.utils.ovf.OvfReader ovf = null ; try { ovf = new org.ovirt.engine.core.utils.ovf.OvfTemplateReader ( new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( ovfstring ) , vmTemplate , images , interfaces ) ; BuildOvf ( ovf ) ; initIcons ( vmTemplate ) ; } catch ( java.lang.Exception ex ) { java.lang.String message = generateOvfReaderErrorMessage ( ovf , ex ) ; logOvfLoadError ( message , ovfstring ) ; throw new org.ovirt.engine.core.utils.ovf.OvfReaderException ( message ) ; } }

Target:
public void importTemplate ( java.lang.String ovfstring , org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces ) throws org.ovirt.engine.core.utils.ovf.OvfReaderException { org.ovirt.engine.core.utils.ovf.OvfReader ovf = null ; try { ovf = new org.ovirt.engine.core.utils.ovf.OvfTemplateReader ( new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( ovfstring ) , vmTemplate , images , interfaces ) ; buildOvf ( ovf ) ; initIcons ( vmTemplate ) ; } catch ( java.lang.Exception ex ) { java.lang.String message = generateOvfReaderErrorMessage ( ovf , ex ) ; logOvfLoadError ( message , ovfstring ) ; throw new org.ovirt.engine.core.utils.ovf.OvfReaderException ( message ) ; } }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getRefreshCommand ( ) ) ) { refreshModel ( ) ; org.ovirt.engine.ui.uicommonweb.models.events.EventListModel.updatePagingAvailability ( ) ; } else if ( command == ( getDetailsCommand ( ) ) ) { details ( ) ; } else if ( "Cancel" . equals ( command.getName ( ) ) ) { cancel ( ) ; } }

Target:
protected void syncSearch ( ) { refreshModel ( ) ; }
Source:
private org.ovirt.engine.core.compat.Guid addDisk ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = getBackend ( ) . runInternalAction ( VdcActionType.AddDisk , buildAddDiskParameters ( disk ) , enclosingCommand.getContext ( ) . clone ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( returnValue.getFault ( ) . getError ( ) , java.lang.String.format ( "Failed to create disk! %s" , disk.getDiskAlias ( ) ) ) ; } return returnValue.getActionReturnValue ( ) ; }

Target:
private org.ovirt.engine.core.compat.Guid addDisk ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = getBackend ( ) . runInternalAction ( ActionType.AddDisk , buildAddDiskParameters ( disk ) , enclosingCommand.getContext ( ) . clone ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( returnValue.getFault ( ) . getError ( ) , java.lang.String.format ( "Failed to create disk! %s" , disk.getDiskAlias ( ) ) ) ; } return returnValue.getActionReturnValue ( ) ; }
Source:
protected void entityPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . entityPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "IsSelectedNullable" ) ) { org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel selectionTreeNodeModel = ( ( org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel ) ( sender ) ) ; org.ovirt.engine.ui.uicommonweb.models.tags.TagModel tagModel = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagModel ) ( selectionTreeNodeModel.getEntity ( ) ) ) ; tagModel.setSelection ( selectionTreeNodeModel.getIsSelectedNullable ( ) ) ; OnTagSelectionChanged ( tagModel , e ) ; } }

Target:
protected void entityPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . entityPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "IsSelectedNullable" ) ) { org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel selectionTreeNodeModel = ( ( org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel ) ( sender ) ) ; org.ovirt.engine.ui.uicommonweb.models.tags.TagModel tagModel = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagModel ) ( selectionTreeNodeModel.getEntity ( ) ) ) ; tagModel.setSelection ( selectionTreeNodeModel.getIsSelectedNullable ( ) ) ; onTagSelectionChanged ( tagModel , e ) ; } }
Source:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.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 void getStorageDomainMaxNameLength ( 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 ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }