auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > getAllImagesAsRepoImages ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > repoImages = new java.util.ArrayList < > ( ) ; long currentTime = java.lang.System.currentTimeMillis ( ) ; for ( com.woorea.openstack.glance.model.Image glanceImage : getClient ( ) . images ( ) . list ( true ) . execute ( ) ) { org.ovirt.engine.core.common.businessentities.RepoImage repoImage = org.ovirt.engine.core.bll.provider.OpenstackImageProviderProxy.imageToRepoImage ( glanceImage ) ; repoImage.setLastRefreshed ( currentTime ) ; repoImages.add ( repoImage ) ; } return repoImages ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > getAllImagesAsRepoImages ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > repoImages = new java.util.ArrayList < > ( ) ; long currentTime = java.lang.System.currentTimeMillis ( ) ; for ( com.woorea.openstack.glance.model.Image glanceImage : getClient ( ) . images ( ) . list ( true ) . execute ( ) ) { org.ovirt.engine.core.common.businessentities.RepoImage repoImage = org.ovirt.engine.core.bll.provider.OpenStackImageProviderProxy.imageToRepoImage ( glanceImage ) ; repoImage.setLastRefreshed ( currentTime ) ; repoImages.add ( repoImage ) ; } return repoImages ; }
Source:
protected org.ovirt.engine.core.compat.Guid getDataCenterId ( org.ovirt.engine.api.model.Network network ) { return getEntity ( org.ovirt.engine.core.common.businessentities.StoragePool.class , SearchType.StoragePool , ( "Datacenter: name=" + ( network.getDataCenter ( ) . getName ( ) ) ) ) . getId ( ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getDataCenterId ( org.ovirt.engine.api.model.Network network ) { java.lang.String networkName = network.getDataCenter ( ) . getName ( ) ; return getEntity ( org.ovirt.engine.core.common.businessentities.StoragePool.class , VdcQueryType.GetStoragePoolByDatacenterName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( networkName ) , ( "Datacenter: name=" + networkName ) ) . getId ( ) ; }
Source:
public void labelBeingAttachedToValidBondNotBond ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( ) ; 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 ( nics ) . labelBeingAttachedToValidBond ( nicLabel ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void labelBeingAttachedToValidBondNotBond ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( ) ; 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 ( nics ) . labelBeingAttachedToValidBond ( nicLabel ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case LoginUser : case LoginAdminUser : org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( parameters.getActionType ( ) , parameters ) ; return command.executeAction ( ) ; default : return getErrorCommandReturnValue ( EngineMessage.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } }

Target:
private void logExecution ( java.lang.String sessionId , java.lang.String details ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = sessionDataContainer.getUser ( sessionId , false ) ; org.ovirt.engine.core.bll.Backend.log.debug ( "Executing {}{}" , details , ( user == null ? "." : java.lang.String.format ( " for user %s@%s." , user.getLoginName ( ) , user.getDomain ( ) ) ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = getNetworkDAO ( ) . getAllForCluster ( vds.getVdsGroupId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : networks ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( vds.getVdsGroupId ( ) , net ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = getNetworkDao ( ) . getAllForCluster ( vds.getVdsGroupId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : networks ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( vds.getVdsGroupId ( ) , net ) ; } return null ; }
Source:
private org.ovirt.engine.core.compat.Guid getStoragePoolId ( ) { org.ovirt.engine.core.compat.Guid result = null ; org.ovirt.engine.core.common.queries.GetVmTemplateParameters params = org.ovirt.engine.core.bll.GetVmTemplateQuery.getParameters ( ) ; if ( ( params.getDataCenterId ( ) ) != null ) { result = params.getDataCenterId ( ) ; } else if ( ( params.getClusterId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getClusterDao ( ) . get ( params.getClusterId ( ) ) ; if ( cluster != null ) { result = cluster.getStoragePoolId ( ) ; } } return result ; }

Target:
private org.ovirt.engine.core.compat.Guid getStoragePoolId ( ) { org.ovirt.engine.core.compat.Guid result = null ; org.ovirt.engine.core.common.queries.GetVmTemplateParameters params = org.ovirt.engine.core.bll.GetVmTemplateQuery.getParameters ( ) ; if ( ( params.getDataCenterId ( ) ) != null ) { result = params.getDataCenterId ( ) ; } else if ( ( params.getClusterId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = clusterDao.get ( params.getClusterId ( ) ) ; if ( cluster != null ) { result = cluster.getStoragePoolId ( ) ; } } return result ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case LoginUser : case LoginAdminUser : org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( parameters.getActionType ( ) , parameters ) ; return command.executeAction ( ) ; default : return getErrorCommandReturnValue ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case LoginUser : case LoginAdminUser : org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( parameters.getActionType ( ) , parameters ) ; return command.executeAction ( ) ; default : return getErrorCommandReturnValue ( EngineMessage.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } }
Source:
public boolean poll ( ) { waitBetweenPolls ( ) ; org.ovirt.engine.core.bll.network.host.HostPoller.LOGGER.trace ( "Request to do poll for host {}." , parameters.getVdsId ( ) ) ; org.ovirt.engine.core.common.interfaces.FutureVDSCall < org.ovirt.engine.core.common.vdscommands.VDSReturnValue > task = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . runFutureVdsCommand ( FutureVDSCommandType.Poll , parameters ) ; org.ovirt.engine.core.bll.network.host.HostPoller.LOGGER.trace ( "FutureVDSCommandType.Poll executed for host{}." , parameters.getVdsId ( ) ) ; boolean succeeded = getValue ( task ) ; org.ovirt.engine.core.bll.network.host.HostPoller.LOGGER.trace ( "Result of FutureVDSCommandType.Poll for host {}: {}" , parameters.getVdsId ( ) , succeeded ) ; timestampOfEndOfPreviousInvocation = currentTimestamp ( ) ; return succeeded ; }

Target:
public boolean poll ( ) { waitBetweenPolls ( ) ; org.ovirt.engine.core.bll.network.host.HostPoller.LOGGER.trace ( "Request to do poll for host {}." , parameters.getVdsId ( ) ) ; org.ovirt.engine.core.common.interfaces.FutureVDSCall < org.ovirt.engine.core.common.vdscommands.VDSReturnValue > task = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.interfaces.BackendInternal.class ) . getResourceManager ( ) . runFutureVdsCommand ( FutureVDSCommandType.Poll , parameters ) ; org.ovirt.engine.core.bll.network.host.HostPoller.LOGGER.trace ( "FutureVDSCommandType.Poll executed for host{}." , parameters.getVdsId ( ) ) ; boolean succeeded = getValue ( task ) ; org.ovirt.engine.core.bll.network.host.HostPoller.LOGGER.trace ( "Result of FutureVDSCommandType.Poll for host {}: {}" , parameters.getVdsId ( ) , succeeded ) ; timestampOfEndOfPreviousInvocation = currentTimestamp ( ) ; return succeeded ; }
Source:
private void updateActionAvailability ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( ) ; if ( vds != null ) { getSyncStorageDevicesCommand ( ) . setIsExecutionAllowed ( ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) ; } }

Target:
private void updateActionAvailability ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( ) ; if ( vds != null ) { getSyncStorageDevicesCommand ( ) . setIsExecutionAllowed ( ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) ; getCreateBrickCommand ( ) . setIsExecutionAllowed ( ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) ; } }
Source:
private void decreasePendingVms ( org.ovirt.engine.core.compat.Guid vdsId , int numOfCpus , int minAllocatedMem , java.lang.String vmName ) { getVdsDynamicDao ( ) . updatePartialVdsDynamicCalc ( vdsId , 0 , ( - numOfCpus ) , ( - minAllocatedMem ) , 0 , 0 ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log.debugFormat ( "Decreasing vds {0} pending vcpu count by {1} and vmem size by {2} (Vm: {3})" , vdsId , numOfCpus , minAllocatedMem , vmName ) ; }

Target:
private void decreasePendingVms ( ) { org.ovirt.engine.core.compat.Guid vdsId = getCurrentVdsId ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.RunVmCommandBase.getVm ( ) ; if ( ( vdsId == null ) || ( vdsId.equals ( lastDecreasedVds ) ) ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debugFormat ( "PendingVms for the guest {0} running on host {1} was already released, not releasing again" , vm.getName ( ) , vdsId ) ; return ; } lastDecreasedVds = vdsId ; org.ovirt.engine.core.bll.VmHandler.decreasePendingVms ( vm , vdsId ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; }
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 GetStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; }

Target:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
protected boolean validateStorageDomains ( ) { org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidator storageDomainsValidator = getStorageDomainsValidator ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getStoragePoolId ( ) , getStorageDomainsIds ( ) ) ; return ( ( validate ( storageDomainsValidator.allDomainsExistAndActive ( ) ) ) && ( validate ( storageDomainsValidator.allDomainsWithinThresholds ( ) ) ) ) && ( validate ( storageDomainsValidator.allDomainsHaveSpaceForClonedDisks ( getSourceImages ( ) ) ) ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getSnapshotsDummiesForStorageAllocations ( ) { return org.ovirt.engine.core.bll.ImagesHandler.getSnapshotsDummiesForStorageAllocations ( getSourceImages ( ) ) ; }
Source:
private void handleDirectorySearcherException ( java.lang.Exception ex ) { if ( ex instanceof org.ovirt.engine.extensions.aaa.builtin.kerberosldap.AuthenticationResultException ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.AuthenticationResultException authResultException = ( ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.AuthenticationResultException ) ( ex ) ) ; org.ovirt.engine.core.utils.kerberos.AuthenticationResult result = authResultException.getResult ( ) ; if ( result == null ) { result = org.ovirt.engine.core.utils.kerberos.AuthenticationResult.OTHER ; } org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapAuthenticateUserCommand.log.error ( result.getDetailedMessage ( ) ) ; getParameters ( ) . getOutputMap ( ) . put ( Authn.InvokeKeys.RESULT , resultsMap.get ( result ) ) ; } }

Target:
private void handleDirectorySearcherException ( org.ovirt.engine.api.extensions.ExtMap output , java.lang.Exception ex ) { if ( ex instanceof org.ovirt.engine.extensions.aaa.builtin.kerberosldap.AuthenticationResultException ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.AuthenticationResultException authResultException = ( ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.AuthenticationResultException ) ( ex ) ) ; org.ovirt.engine.core.utils.kerberos.AuthenticationResult result = authResultException.getResult ( ) ; if ( result == null ) { result = org.ovirt.engine.core.utils.kerberos.AuthenticationResult.OTHER ; } org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapAuthenticateUserCommand.log.error ( result.getDetailedMessage ( ) ) ; output.put ( Authn.InvokeKeys.RESULT , resultsMap.get ( result ) ) ; } }
Source:
private void getImageChildren ( org.ovirt.engine.core.compat.Guid snapshot , java.util.List < org.ovirt.engine.core.compat.Guid > children ) { java.util.List < org.ovirt.engine.core.compat.Guid > list = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImageDao ( ) . getAllSnapshotsForParent ( snapshot ) ) { list.add ( image.getImageId ( ) ) ; } children.addAll ( list ) ; for ( org.ovirt.engine.core.compat.Guid snapshotId : list ) { getImageChildren ( snapshotId , children ) ; } }

Target:
private void getImageChildren ( org.ovirt.engine.core.compat.Guid snapshot , java.util.List < org.ovirt.engine.core.compat.Guid > children ) { java.util.List < org.ovirt.engine.core.compat.Guid > list = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImageDao ( ) . getAllSnapshotsForParent ( snapshot ) ) { list.add ( image.getImageId ( ) ) ; } children.addAll ( list ) ; for ( org.ovirt.engine.core.compat.Guid snapshotId : list ) { getImageChildren ( snapshotId , children ) ; } }
Source:
protected org.ovirt.engine.api.model.Snapshots mapCollection ( java.util.List < org.ovirt.engine.api.model.Snapshot > entities ) { org.ovirt.engine.api.model.Snapshots snapshots = new org.ovirt.engine.api.model.Snapshots ( ) ; for ( org.ovirt.engine.api.model.Snapshot entity : entities ) { org.ovirt.engine.api.model.Snapshot snapshot = map ( entity , null ) ; snapshot = addLinks ( snapshot ) ; snapshot = addVmConfiguration ( entity , snapshot ) ; snapshots.getSnapshots ( ) . add ( snapshot ) ; } return snapshots ; }

Target:
protected org.ovirt.engine.api.model.Snapshots mapCollection ( java.util.List < org.ovirt.engine.api.model.Snapshot > entities ) { org.ovirt.engine.api.model.Snapshots snapshots = new org.ovirt.engine.api.model.Snapshots ( ) ; for ( org.ovirt.engine.api.model.Snapshot entity : entities ) { org.ovirt.engine.api.model.Snapshot snapshot = map ( entity , null ) ; snapshot = populate ( snapshot , entity ) ; snapshot = addLinks ( snapshot ) ; snapshot = addVmConfiguration ( entity , snapshot ) ; snapshots.getSnapshots ( ) . add ( snapshot ) ; } return snapshots ; }
Source:
public void save ( ) { org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface guestAgentInterface = createVmGuestAgentInterface ( ) ; org.junit.Assert.assertFalse ( dao.getAllForVm ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoTest.EXISTING_VM_ID ) . contains ( guestAgentInterface ) ) ; dao.save ( guestAgentInterface ) ; org.junit.Assert.assertTrue ( dao.getAllForVm ( org.ovirt.engine.core.dao.VmGuestAgentInterfaceDaoTest.EXISTING_VM_ID ) . contains ( guestAgentInterface ) ) ; }

Target:
public void getAllForVmForUnprivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > interfaces = dao.getAllForVm ( FixturesTool.VM_RHEL5_POOL_50 , org.ovirt.engine.core.dao.UNPRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertTrue ( interfaces.isEmpty ( ) ) ; }
Source:
private static void assertFullGetAllAttachableDisksByPoolId ( java.util.List < org.ovirt.engine.core.common.businessentities.Disk > disks ) { org.junit.Assert.assertEquals ( "There should be only three attachable disks" , 3 , disks.size ( ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > expectedFloatingDiskIds = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( FixturesTool.FLOATING_DISK_ID , FixturesTool.FLOATING_LUN_ID ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > actualFloatingDiskIds = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : disks ) { actualFloatingDiskIds.add ( disk.getId ( ) ) ; } org.junit.Assert.assertEquals ( "Wrong attachable disks" , expectedFloatingDiskIds , actualFloatingDiskIds ) ; }

Target:
private static void assertFullGetAllAttachableDisksByPoolId ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { org.junit.Assert.assertEquals ( "There should be only three attachable disks" , 3 , disks.size ( ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > expectedFloatingDiskIds = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( FixturesTool.FLOATING_DISK_ID , FixturesTool.FLOATING_LUN_ID ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > actualFloatingDiskIds = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { actualFloatingDiskIds.add ( disk.getId ( ) ) ; } org.junit.Assert.assertEquals ( "Wrong attachable disks" , expectedFloatingDiskIds , actualFloatingDiskIds ) ; }
Source:
public org.ovirt.engine.api.model.CdRom update ( org.ovirt.engine.api.model.CdRom resource ) { if ( org.ovirt.engine.api.common.util.QueryHelper.hasConstraint ( getUriInfo ( ) . getQueryParameters ( ) , org.ovirt.engine.api.restapi.resource.BackendCdRomResource.CURRENT_CONSTRAINT_PARAMETER ) ) { validateParameters ( resource , requiredUpdateFields ) ; performAction ( VdcActionType.ChangeDisk , new org.ovirt.engine.core.common.action.ChangeDiskCommandParameters ( getEntity ( entityResolver , true ) . getId ( ) , resource.getFile ( ) . getId ( ) ) ) ; return resource ; } else { return super . update ( resource ) ; } }

Target:
public org.ovirt.engine.api.model.CdRom update ( org.ovirt.engine.api.model.CdRom resource ) { if ( ( org.ovirt.engine.api.common.util.QueryHelper.hasConstraint ( getUriInfo ( ) . getQueryParameters ( ) , org.ovirt.engine.api.restapi.resource.BackendCdRomResource.CURRENT_CONSTRAINT_PARAMETER ) ) || ( org.ovirt.engine.api.common.util.QueryHelper.hasMatrixParam ( getUriInfo ( ) , org.ovirt.engine.api.restapi.resource.BackendCdRomResource.CURRENT_CONSTRAINT_PARAMETER ) ) ) { validateParameters ( resource , requiredUpdateFields ) ; performAction ( VdcActionType.ChangeDisk , new org.ovirt.engine.core.common.action.ChangeDiskCommandParameters ( getEntity ( entityResolver , true ) . getId ( ) , resource.getFile ( ) . getId ( ) ) ) ; return resource ; } else { return super . update ( resource ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult networkInVfsConfig ( org.ovirt.engine.core.compat.Guid networkId ) { java.lang.String networkName = getNetwork ( networkId ) . getName ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_NOT_IN_VFS_CONFIG , getNicNameReplacement ( ) , java.lang.String.format ( org.ovirt.engine.core.bll.validator.VfsConfigValidator.NETWORK_NAME_REPLACEMENT , networkName ) ) . when ( ( ! ( oldVfsConfig.getNetworks ( ) . contains ( networkId ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkInVfsConfig ( org.ovirt.engine.core.compat.Guid networkId ) { java.lang.String networkName = getNetwork ( networkId ) . getName ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_NOT_IN_VFS_CONFIG , getNicNameReplacement ( ) , java.lang.String.format ( org.ovirt.engine.core.bll.validator.VfsConfigValidator.NETWORK_NAME_REPLACEMENT , networkName ) ) . when ( ( ! ( oldVfsConfig.getNetworks ( ) . contains ( networkId ) ) ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVds ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVds ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL ) ; } if ( ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVds ( ) ) == null ) && ( ! ( selectProxyHost ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_NO_VDS_IN_POOL ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVds ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVds ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL ) ; } if ( ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVds ( ) ) == null ) && ( ! ( selectProxyHost ( ) ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_NO_VDS_IN_POOL ) ; } return true ; }
Source:
private java.util.List < java.lang.String > getExisitingHostNetworkNames ( ) { java.util.List < java.lang.String > list = new java.util.ArrayList < java.lang.String > ( getExistingIfaces ( ) . size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : getExistingIfaces ( ) . values ( ) ) { if ( org.apache.commons.lang.StringUtils.isNotBlank ( iface.getNetworkName ( ) ) ) { list.add ( iface.getNetworkName ( ) ) ; } } return list ; }

Target:
private boolean unmanagedNetworkChanged ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface existingIface = getExistingIfaces ( ) . get ( iface.getName ( ) ) ; return ( existingIface == null ) || ( ! ( iface.getNetworkName ( ) . equals ( existingIface.getNetworkName ( ) ) ) ) ; }
Source:
public void testValidateThereIsEnoughOfFreeMacsNegative ( ) { org.mockito.Mockito.when ( macPoolMock.getAvailableMacsCount ( ) ) . thenReturn ( 0 ) ; final org.ovirt.engine.core.bll.ValidationResult actual = underTest.validateThereIsEnoughOfFreeMacs ( java.util.Collections.singletonList ( vmNetworkInterfaceMock ) , macPoolMock , org.ovirt.engine.core.bll.validator.VmNicMacsUtilsTest.ALWAYS_TRUE ) ; org.junit.Assert.assertThat ( actual , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES ) ) ; }

Target:
public void testValidateThereIsEnoughOfFreeMacsNegative ( ) { org.mockito.Mockito.when ( macPoolMock.getAvailableMacsCount ( ) ) . thenReturn ( 0 ) ; final org.ovirt.engine.core.bll.ValidationResult actual = underTest.validateThereIsEnoughOfFreeMacs ( java.util.Collections.singletonList ( vmNetworkInterfaceMock ) , macPoolMock , org.ovirt.engine.core.bll.validator.VmNicMacsUtilsTest.ALWAYS_TRUE ) ; org.hamcrest.MatcherAssert.assertThat ( actual , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES ) ) ; }
Source:
public void persistCommand ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.compat.Guid rootCommandId , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.core.compat.CommandStatus status , boolean enableCallBack ) { commandsCache.put ( commandId , rootCommandId , actionType , params , status , enableCallBack ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > getCommandsWithCallBackEnabled ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > cmdEntities = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ; for ( org.ovirt.engine.core.compat.Guid cmdId : commandsCache.keySet ( ) ) { cmdEntity = commandsCache.get ( cmdId ) ; if ( commandsCache.get ( cmdId ) . isCallBackEnabled ( ) ) { cmdEntities.add ( cmdEntity ) ; } } return cmdEntities ; }
Source:
public void qosOnNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNic ( "eth0" , null , null , network.getName ( ) ) ; org.ovirt.engine.core.compat.Guid qosId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; network.setQosId ( qosId ) ; org.ovirt.engine.core.common.businessentities.network.NetworkQoS qos = createQos ( ) ; qos.setId ( qosId ) ; org.mockito.Mockito.when ( qosDao.get ( qosId ) ) . thenReturn ( qos ) ; qos ( network , iface , qos , true ) ; }

Target:
public void qosOnNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNic ( "eth0" , null , null , network.getName ( ) ) ; org.ovirt.engine.core.compat.Guid qosId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; network.setQosId ( qosId ) ; org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = createQos ( ) ; qos.setId ( qosId ) ; org.mockito.Mockito.when ( qosDao.get ( qosId ) ) . thenReturn ( qos ) ; qos ( network , iface , qos , true ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn createVolumeContainer ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > createVolumeInfo ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.create_volume" ) . withParameter ( "job_id" , jobId ) . withParameter ( "vol_info" , createVolumeInfo ) . 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 ) ; }

Target:
public java.util.concurrent.FutureTask < java.util.Map < java.lang.String , java.lang.Object > > timeBoundPollConfirmConnectivity ( final long timeout , final java.util.concurrent.TimeUnit unit ) { return timeBoundPollInternal ( timeout , unit , "Host.confirmConnectivity" ) ; }
Source:
public void setSwapFree ( java.lang.Long value ) { if ( ( ( swapFree ) == null ) && ( value == null ) ) { return ; } if ( ( ( swapFree ) == null ) || ( ! ( swapFree.equals ( value ) ) ) ) { swapFree = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "SwapFree" ) ) ; } }

Target:
public void setNumberOfSockets ( java.lang.Integer value ) { if ( ( ( numberOfSockets ) == null ) && ( value == null ) ) { return ; } if ( ( ( numberOfSockets ) == null ) || ( ! ( numberOfSockets.equals ( value ) ) ) ) { numberOfSockets = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "NumberOfSockets" ) ) ; } }
Source:
private org.ovirt.engine.core.bll.context.CommandContext createContextForStatelessSnapshotCreation ( ) { java.util.Map < java.lang.String , java.lang.String > values = getVmValuesForMsgResolving ( ) ; org.ovirt.engine.core.common.job.Step createSnapshotsStep = addSubStep ( StepEnum.EXECUTING , StepEnum.CREATING_SNAPSHOTS , values ) ; org.ovirt.engine.core.bll.job.ExecutionContext createSnapshotsCtx = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; createSnapshotsCtx.setMonitored ( true ) ; createSnapshotsCtx.setStep ( createSnapshotsStep ) ; return org.ovirt.engine.core.bll.RunVmCommand.getContext ( ) . withExecutionContext ( createSnapshotsCtx ) ; }

Target:
private org.ovirt.engine.core.bll.context.CommandContext createContextForStatelessSnapshotCreation ( ) { java.util.Map < java.lang.String , java.lang.String > values = getVmValuesForMsgResolving ( ) ; org.ovirt.engine.core.common.job.Step createSnapshotsStep = addSubStep ( StepEnum.EXECUTING , StepEnum.CREATING_SNAPSHOTS , values ) ; org.ovirt.engine.core.bll.job.ExecutionContext createSnapshotsCtx = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; createSnapshotsCtx.setMonitored ( true ) ; createSnapshotsCtx.setStep ( createSnapshotsStep ) ; org.ovirt.engine.core.bll.RunVmCommand.getContext ( ) . withExecutionContext ( createSnapshotsCtx ) ; org.ovirt.engine.core.bll.RunVmCommand.persistCommandIfNeeded ( ) ; return org.ovirt.engine.core.bll.RunVmCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) ; }
Source:
private void vnicProfileForVmNetworkTest ( boolean vmNetwork , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.mockito.Mockito.when ( network.isVmNetwork ( ) ) . thenReturn ( vmNetwork ) ; org.mockito.Mockito.when ( networkDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( network ) ; org.junit.Assert.assertThat ( validator.vnicProfileForVmNetworkOnly ( ) , matcher ) ; }

Target:
private void vnicProfileForVmNetworkTest ( boolean vmNetwork , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.mockito.Mockito.when ( network.isVmNetwork ( ) ) . thenReturn ( vmNetwork ) ; org.mockito.Mockito.when ( networkDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( network ) ; org.junit.Assert.assertThat ( validator.vnicProfileForVmNetworkOnly ( ) , matcher ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > newItems = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.Collections.sort ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.NetworkComparator ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( newItems ) ; }
Source:
public void testGenerateEtag ( ) { java.io.File mockFile = org.mockito.Mockito.mock ( java.io.File.class ) ; org.mockito.Mockito.when ( mockFile.length ( ) ) . thenReturn ( 1234L ) ; java.util.Date lastModifiedDate = new java.util.Date ( ) ; org.mockito.Mockito.when ( mockFile.lastModified ( ) ) . thenReturn ( lastModifiedDate.getTime ( ) ) ; java.lang.String result = testServlet.generateEtag ( mockFile ) ; org.junit.Assert.assertNotNull ( "There should be a result" , result ) ; org.junit.Assert.assertEquals ( ( ( "W/\"1234-" + ( lastModifiedDate.getTime ( ) ) ) + "\"" ) , result ) ; }

Target:
public void testGetFullPath_SaneParameter ( ) { java.io.File file = testServlet.getFile ( mockFile , "/branding/test" ) ; org.junit.Assert.assertNotNull ( "Path should not be null" , file ) ; org.junit.Assert.assertEquals ( "Path should be '/abs/test/branding/test'" , "/abs/test/branding/test" , file.getAbsolutePath ( ) ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.getParameters ( ) . getVdsId ( ) ) ; org.ovirt.engine.core.bll.FenceExecutor executor = new org.ovirt.engine.core.bll.FenceExecutor ( vds ) ; org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue result = executor.checkStatus ( ) ; if ( result.getSucceeded ( ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.RemoveAllVdsAlerts ( org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.getParameters ( ) . getVdsId ( ) , true ) ; org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; } else { handleError ( result ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.getParameters ( ) . getVdsId ( ) ) ; org.ovirt.engine.core.bll.FenceExecutor executor = new org.ovirt.engine.core.bll.FenceExecutor ( vds ) ; org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue result = executor.checkHostStatus ( ) ; if ( result.getSucceeded ( ) ) { org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; } else { handleError ( result ) ; } }
Source:
public void testToByteArrayAllNull ( ) { final byte [ ] allNullArray = Guid.Empty.toByteArray ( ) ; org.junit.Assert.assertNotNull ( allNullArray ) ; for ( int i = 0 ; i < 16 ; i ++ ) { org.junit.Assert.assertEquals ( 0 , allNullArray [ i ] ) ; } }

Target:
public void testToByteArrayAllNull ( ) { final byte [ ] allNullArray = Guid.Empty.toByteArray ( ) ; org.junit.jupiter.api.Assertions.assertNotNull ( allNullArray ) ; for ( int i = 0 ; i < 16 ; i ++ ) { org.junit.jupiter.api.Assertions.assertEquals ( 0 , allNullArray [ i ] ) ; } }
Source:
public static org.ovirt.engine.api.model.Options map ( org.ovirt.engine.core.common.queries.ValueObjectMap entity , org.ovirt.engine.api.model.Options template ) { org.ovirt.engine.api.model.Options model = ( template != null ) ? template : new org.ovirt.engine.api.model.Options ( ) ; for ( org.ovirt.engine.core.common.queries.ValueObjectPair option : entity.getValuePairs ( ) ) { model.getOptions ( ) . add ( org.ovirt.engine.api.restapi.types.HostMapper.map ( option , null ) ) ; } return model ; }

Target:
public static org.ovirt.engine.api.model.Options map ( java.util.Map < java.lang.String , java.lang.String > entity , org.ovirt.engine.api.model.Options template ) { org.ovirt.engine.api.model.Options model = ( template != null ) ? template : new org.ovirt.engine.api.model.Options ( ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String > option : entity.entrySet ( ) ) { model.getOptions ( ) . add ( org.ovirt.engine.api.restapi.types.HostMapper.map ( option , null ) ) ; } return model ; }
Source:
public org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fence ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType fenceAction ) { java.util.List < org.ovirt.engine.core.common.businessentities.pm.FenceAgent > fenceAgents = getDbFacade ( ) . getFenceAgentDao ( ) . getFenceAgentsForHost ( fencedHost.getId ( ) ) ; if ( ( fenceAgents == null ) || ( fenceAgents.isEmpty ( ) ) ) { return new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN , java.lang.String.format ( "Invalid fence agents defined for host '%s'." , fencedHost.getHostName ( ) ) ) ; } return fence ( fenceAction , fenceAgents ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fence ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType fenceAction ) { java.util.List < org.ovirt.engine.core.common.businessentities.pm.FenceAgent > fenceAgents = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.dao.FenceAgentDao.class ) . getFenceAgentsForHost ( fencedHost.getId ( ) ) ; if ( ( fenceAgents == null ) || ( fenceAgents.isEmpty ( ) ) ) { return new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN , java.lang.String.format ( "Invalid fence agents defined for host '%s'." , fencedHost.getHostName ( ) ) ) ; } return fence ( fenceAction , fenceAgents ) ; }
Source:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > > aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public void getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.Permissions permission ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "ad_element_id" , permission.getAdElementId ( ) ) . addValue ( "id" , permission.getId ( ) ) . addValue ( "role_id" , permission.getRoleId ( ) ) . addValue ( "object_id" , permission.getObjectId ( ) ) . addValue ( "object_type_id" , permission.getObjectType ( ) . getValue ( ) ) ; getCallsHandler ( ) . executeModification ( "InsertPermission" , parameterSource ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.Permission permission ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "ad_element_id" , permission.getAdElementId ( ) ) . addValue ( "id" , permission.getId ( ) ) . addValue ( "role_id" , permission.getRoleId ( ) ) . addValue ( "object_id" , permission.getObjectId ( ) ) . addValue ( "object_type_id" , permission.getObjectType ( ) . getValue ( ) ) ; getCallsHandler ( ) . executeModification ( "InsertPermission" , parameterSource ) ; }
Source:
private org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters createActivateDeactivateParameters ( org.ovirt.engine.core.common.businessentities.network.VmNic nic , org.ovirt.engine.core.common.action.PlugAction plugAction ) { org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters parameters = new org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters ( nic , plugAction ) ; parameters.setVmId ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) ; return parameters ; }

Target:
private boolean activateOrDeactivateNic ( org.ovirt.engine.core.common.businessentities.network.VmNic nic , org.ovirt.engine.core.common.action.PlugAction plugAction , boolean newNic ) { org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters parameters = new org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters ( nic , plugAction , newNic ) ; parameters.setVmId ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getBackend ( ) . runInternalAction ( VdcActionType.ActivateDeactivateVmNic , parameters ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { propagateFailure ( returnValue ) ; } return returnValue.getSucceeded ( ) ; }
Source:
public void hostNInUse ( ) { org.mockito.Mockito.when ( oldHost.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.ArgumentMatchers.any ( java.lang.String.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VDS_WITH_SAME_HOST_EXIST ) ) ; }

Target:
public void hostNInUse ( ) { org.mockito.Mockito.when ( oldHost.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.ArgumentMatchers.anyString ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VDS_WITH_SAME_HOST_EXIST ) ) ; }