auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getDataCenterList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getVmNextRunConfiguration ( 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.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.network.Network network ) { return network.getId ( ) . equals ( getNetwork ( ) . getId ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network getNetworkById ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { org.ovirt.engine.core.compat.Guid networkId = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) . getId ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : networks ) { if ( network.getId ( ) . equals ( networkId ) ) { return network ; } } return null ; }
Source:
private java.lang.String getRunActionErrorMessage ( final java.util.List < java.lang.String > messages ) { if ( ( messages.size ( ) ) < 1 ) { return "No Message" ; } else { return messages.iterator ( ) . next ( ) ; } }

Target:
public void runMultipleActions ( final java.util.List < org.ovirt.engine.core.common.action.VdcActionType > actionTypes , final java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , final java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > callbacks , final org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback failureCallback , final java.lang.Object state ) { runMultipleActions ( actionTypes , parameters , callbacks , failureCallback , state , false ) ; }
Source:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public void testInventoryFile ( ) { java.nio.file.Path inventoryFile = java.nio.file.Paths.get ( "myfile" ) ; java.lang.String command = createCommand ( new org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder ( ) . inventoryFile ( inventoryFile ) . playbook ( org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK ) ) ; org.junit.Assert.assertEquals ( join ( AnsibleCommandBuilder.ANSIBLE_COMMAND , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_LOG_LEVEL , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.PRIVATE_KEY , ( "--inventory=" + inventoryFile ) , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK_FULL_PATH ) , command ) ; }

Target:
public void testInventoryFile ( ) { java.nio.file.Path inventoryFile = java.nio.file.Paths.get ( "myfile" ) ; java.lang.String command = createCommand ( new org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder ( ) . inventoryFile ( inventoryFile ) . playbook ( org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK ) ) ; org.junit.Assert.assertEquals ( join ( AnsibleCommandBuilder.ANSIBLE_COMMAND , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.IGNORE_SSH_CONFIG , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_LOG_LEVEL , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.PRIVATE_KEY , ( "--inventory=" + inventoryFile ) , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK_FULL_PATH ) , command ) ; }
Source:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.statisticssync_3_2.StatisticsSync.row9Struct.commonByteArrayLock ) { try { int length = 0 ; this . datacenter_id = ( ( java.lang.Object ) ( dis.readObject ( ) ) ) ; this . datacenter_join_id = readString ( dis ) ; this . datacenter_status = readInteger ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } catch ( java.lang.ClassNotFoundException eCNFE ) { throw new java.lang.RuntimeException ( eCNFE ) ; } } }

Target:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.statisticssync_3_2.StatisticsSync.row9Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_StatisticsSync ) { try { int length = 0 ; this . datacenter_id = ( ( java.lang.Object ) ( dis.readObject ( ) ) ) ; this . datacenter_join_id = readString ( dis ) ; this . datacenter_status = readInteger ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } catch ( java.lang.ClassNotFoundException eCNFE ) { throw new java.lang.RuntimeException ( eCNFE ) ; } } }
Source:
protected java.util.List < org.ovirt.engine.core.compat.Version > getVersions ( ) { org.ovirt.engine.core.compat.Version version = control.createMock ( org.ovirt.engine.core.compat.Version.class ) ; org.easymock.classextension.EasyMock.expect ( version.getMajor ( ) ) . andReturn ( 2 ) ; org.easymock.classextension.EasyMock.expect ( version.getMinor ( ) ) . andReturn ( 3 ) ; java.util.List < org.ovirt.engine.core.compat.Version > versions = new java.util.ArrayList < org.ovirt.engine.core.compat.Version > ( ) ; versions.add ( version ) ; return versions ; }

Target:
protected java.util.List < org.ovirt.engine.core.compat.Version > getVersions ( ) { org.ovirt.engine.core.compat.Version version = control.createMock ( org.ovirt.engine.core.compat.Version.class ) ; org.easymock.EasyMock.expect ( version.getMajor ( ) ) . andReturn ( 2 ) ; org.easymock.EasyMock.expect ( version.getMinor ( ) ) . andReturn ( 3 ) ; java.util.List < org.ovirt.engine.core.compat.Version > versions = new java.util.ArrayList < org.ovirt.engine.core.compat.Version > ( ) ; versions.add ( version ) ; return versions ; }
Source:
public org.ovirt.engine.core.aaa.DirectoryUser findUser ( java.lang.String name ) { org.ovirt.engine.core.common.utils.ExternalId id = null ; try { id = new org.ovirt.engine.core.common.utils.ExternalId ( name.getBytes ( "UTF-8" ) ) ; } catch ( java.io.UnsupportedEncodingException e ) { return null ; } return new org.ovirt.engine.core.aaa.DirectoryUser ( this . getName ( ) , id , name ) ; }

Target:
public org.ovirt.engine.core.aaa.DirectoryUser findUser ( java.lang.String name ) { org.ovirt.engine.core.common.utils.ExternalId id = null ; try { id = new org.ovirt.engine.core.common.utils.ExternalId ( name.getBytes ( "UTF-8" ) ) ; } catch ( java.io.UnsupportedEncodingException e ) { return null ; } return new org.ovirt.engine.core.aaa.DirectoryUser ( getProfileName ( ) , id , name ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( major ) ; result = ( prime * result ) + ( minor ) ; result = ( prime * result ) + ( revision ) ; result = ( prime * result ) + ( build ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( major , minor , revision , build ) ; }
Source:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { 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 : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public void testRemoveByRemoveIsoDomain ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.SHARED_ISO_STORAGE_DOAMIN_FOR_SP2_AND_SP3 , FileTypeExtension.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertNotSame ( true , listOfRepoFiles.isEmpty ( ) ) ; org.ovirt.engine.core.dao.StorageDomainDAO storageDomainDao = dbFacade.getStorageDomainDAO ( ) ; storageDomainDao.remove ( FixturesTool.SHARED_ISO_STORAGE_DOAMIN_FOR_SP2_AND_SP3 ) ; listOfRepoFiles = getActiveIsoDomain ( ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertSame ( true , listOfRepoFiles.isEmpty ( ) ) ; }

Target:
public void testRemoveByRemoveIsoDomain ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.SHARED_ISO_STORAGE_DOAMIN_FOR_SP2_AND_SP3 , FileTypeExtension.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertNotSame ( true , listOfRepoFiles.isEmpty ( ) ) ; org.ovirt.engine.core.dao.StorageDomainDAO storageDomainDao = dbFacade.getStorageDomainDao ( ) ; storageDomainDao.remove ( FixturesTool.SHARED_ISO_STORAGE_DOAMIN_FOR_SP2_AND_SP3 ) ; listOfRepoFiles = getActiveIsoDomain ( ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertSame ( true , listOfRepoFiles.isEmpty ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeBrickAdd ( java.lang.String volumeName , java.lang.String [ ] bricks , int replicaCount , int stripeCount ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeBrickAdd ( volumeName , bricks , replicaCount , stripeCount ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wipeVolume ( java.lang.String sdUUID , java.lang.String imgUUID , java.lang.String volUUID ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.wipeVolume ( sdUUID , imgUUID , volUUID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; }
Source:
public java.lang.Object runInTransaction ( ) { getStorageHelper ( dom ) . storageDomainRemoved ( dom.getStorageStaticData ( ) ) ; getDbFacade ( ) . getStorageDomainDynamicDao ( ) . remove ( dom.getId ( ) ) ; getDbFacade ( ) . getStorageDomainStaticDao ( ) . remove ( dom.getId ( ) ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { getStorageHelper ( dom ) . storageDomainRemoved ( dom.getStorageStaticData ( ) ) ; getStorageDomainDynamicDao ( ) . remove ( dom.getId ( ) ) ; getStorageDomainStaticDAO ( ) . remove ( dom.getId ( ) ) ; return null ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.NetworkAttachment attachment ) { validateParameters ( attachment , "network.id" ) ; org.ovirt.engine.api.model.NetworkAttachment networkAttachment = map ( attachment ) ; org.ovirt.engine.core.common.action.NetworkAttachmentParameters params = new org.ovirt.engine.core.common.action.NetworkAttachmentParameters ( hostId , networkAttachment ) ; return performCreate ( VdcActionType.AddNetworkAttachment , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetNetworkAttachmentById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.NetworkAttachment attachment ) { validateParameters ( attachment , "network.id|name" ) ; org.ovirt.engine.api.model.NetworkAttachment networkAttachment = map ( attachment ) ; org.ovirt.engine.core.common.action.NetworkAttachmentParameters params = new org.ovirt.engine.core.common.action.NetworkAttachmentParameters ( hostId , networkAttachment ) ; return performCreate ( VdcActionType.AddNetworkAttachment , params , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetNetworkAttachmentById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
private java.lang.String [ ] createIncoherentNetworkIdentificationErrorReplacements ( org.ovirt.engine.core.compat.Guid violatingEntityId , org.ovirt.engine.core.compat.Guid networkId , java.lang.String networkName ) { return new java.lang.String [ ] { java.lang.String.format ( "$id %s" , violatingEntityId ) , java.lang.String.format ( "$networkId %s" , networkId ) , java.lang.String.format ( "$networkName %s" , networkName ) } ; }

Target:
private < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > boolean isNameAndIdIncoherent ( org.ovirt.engine.core.compat.Guid id , java.lang.String name , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { T entityById = map.get ( id ) ; T entityByName = map.get ( name ) ; return ! ( java.util.Objects.equals ( entityById , entityByName ) ) ; }
Source:
private void updateDiskVmSnapshotId ( ) { org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getVmId ( ) , SnapshotType.ACTIVE ) ; if ( disk.getDiskStorageType ( ) . isInternal ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getImageDao ( ) . updateImageVmSnapshotId ( diskImage.getImageId ( ) , snapshotId ) ; } else { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.StorageException , "update of snapshot id was initiated for unsupported disk type" ) ; } }

Target:
private void updateDiskVmSnapshotId ( ) { org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.storage.disk.AttachDiskToVmCommand.getVmId ( ) , SnapshotType.ACTIVE ) ; if ( disk.getDiskStorageType ( ) . isInternal ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; imageDao.updateImageVmSnapshotId ( diskImage.getImageId ( ) , snapshotId ) ; } else { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.StorageException , "update of snapshot id was initiated for unsupported disk type" ) ; } }
Source:
public void update ( int index , org.ovirt.engine.core.common.businessentities.aaa.DbUser user , java.lang.String value ) { transitionHandler.handlePlaceTransition ( true ) ; }

Target:
public void update ( int index , org.ovirt.engine.core.common.businessentities.aaa.DbUser user , java.lang.String value ) { java.util.Map < java.lang.String , java.lang.String > parameters = new java.util.HashMap < > ( ) ; parameters.put ( FragmentParams.NAME.getName ( ) , user.getName ( ) ) ; getPlaceTransitionHandler ( ) . handlePlaceTransition ( WebAdminApplicationPlaces.userGeneralSubTabPlace , parameters ) ; }
Source:
private static java.lang.Double AssignDoubleValue ( java.util.Map < java.lang.String , java.lang.Object > input , java.lang.String name ) { java.lang.Double returnValue = null ; if ( input.containsKey ( name ) ) { java.lang.String stringValue = ( ( java.lang.String ) ( ( ( input.get ( name ) ) instanceof java.lang.String ) ? input.get ( name ) : null ) ) ; returnValue = ( stringValue == null ) ? null : java.lang.Double.parseDouble ( stringValue ) ; } return returnValue ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.VdsNumaNode arg0 , org.ovirt.engine.core.common.businessentities.VdsNumaNode arg1 ) { return ( arg0.getIndex ( ) ) < ( arg1.getIndex ( ) ) ? - 1 : 1 ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getSecondaryDestinations ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { long requiredMemory = ( parameters.containsKey ( org.ovirt.engine.core.bll.scheduling.policyunits.HIGH_MEMORY_LIMIT_FOR_UNDER_UTILIZED ) ) ? java.lang.Long.parseLong ( parameters.get ( org.ovirt.engine.core.bll.scheduling.policyunits.HIGH_MEMORY_LIMIT_FOR_UNDER_UTILIZED ) ) : 0L ; return getUnderUtilizedMemoryHosts ( candidateHosts , requiredMemory , 0 ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getSecondaryDestinations ( org.ovirt.engine.core.common.businessentities.Cluster cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > candidateHosts , java.util.Map < java.lang.String , java.lang.String > parameters ) { long requiredMemory = ( parameters.containsKey ( PolicyUnitParameter.HIGH_MEMORY_LIMIT_FOR_UNDER_UTILIZED.getDbName ( ) ) ) ? java.lang.Long.parseLong ( parameters.get ( PolicyUnitParameter.HIGH_MEMORY_LIMIT_FOR_UNDER_UTILIZED.getDbName ( ) ) ) : 0L ; return getUnderUtilizedMemoryHosts ( candidateHosts , requiredMemory , 0 ) ; }
Source:
private void Run ( ) { org.ovirt.engine.core.common.businessentities.VM entity = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getItem ( ) . getEntity ( ) ) ) ; boolean reinitialize = ( ! ( entity.isInitialized ( ) ) ) && ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.IsWindowsOsType ( entity.getVmOs ( ) ) ) ; org.ovirt.engine.core.common.action.RunVmParams tempVar = new org.ovirt.engine.core.common.action.RunVmParams ( entity.getId ( ) ) ; tempVar.setReinitialize ( reinitialize ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RunVm , tempVar ) ; }

Target:
private void run ( ) { org.ovirt.engine.core.common.businessentities.VM entity = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getItem ( ) . getEntity ( ) ) ) ; boolean reinitialize = ( ! ( entity.isInitialized ( ) ) ) && ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isWindowsOsType ( entity.getVmOs ( ) ) ) ; org.ovirt.engine.core.common.action.RunVmParams tempVar = new org.ovirt.engine.core.common.action.RunVmParams ( entity.getId ( ) ) ; tempVar.setReinitialize ( reinitialize ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RunVm , tempVar ) ; }
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 getEngineSshPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.String > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.StringConverter ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetEngineSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel ) ( target ) ) ; loginModel.setENGINEUserActionGroupList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( returnValue ) ) ) ; loginModel.GetUserRoles ( loginModel ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel ) ( target ) ) ; loginModel.setENGINEUserActionGroupList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( returnValue ) ) ) ; loginModel.getENGINEUserActionGroupList ( ) . add ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel.ConsumeQuotaActionGroup ) ; loginModel.GetUserRoles ( loginModel ) ; }
Source:
public org.ovirt.engine.api.model.NIC get ( ) { for ( org.ovirt.engine.api.model.NIC nic : collection.list ( ) . getNics ( ) ) { if ( nic.getId ( ) . equals ( nicId ) ) { return nic ; } } throw new javax.ws.rs.WebApplicationException ( javax.ws.rs.core.Response.status ( Response.Status.NOT_FOUND ) . build ( ) ) ; }

Target:
public org.ovirt.engine.api.model.Nic get ( ) { for ( org.ovirt.engine.api.model.Nic nic : collection.list ( ) . getNics ( ) ) { if ( nic.getId ( ) . equals ( nicId ) ) { return nic ; } } throw new javax.ws.rs.WebApplicationException ( javax.ws.rs.core.Response.status ( Response.Status.NOT_FOUND ) . build ( ) ) ; }
Source:
public org.ovirt.engine.core.common.eventqueue.EventResult masterDomainNotOperational ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid storagePoolId ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = new org.ovirt.engine.core.common.action.ReconstructMasterParameters ( storagePoolId , storageDomainId , true ) ; boolean isSucceeded = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ReconstructMasterDomain , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) . getSucceeded ( ) ; return new org.ovirt.engine.core.common.eventqueue.EventResult ( isSucceeded , org.ovirt.engine.core.common.eventqueue.EventType.RECONSTRUCT ) ; }

Target:
public org.ovirt.engine.core.common.eventqueue.EventResult masterDomainNotOperational ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid storagePoolId , boolean isReconstructToInactiveDomains ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = new org.ovirt.engine.core.common.action.ReconstructMasterParameters ( storagePoolId , storageDomainId , true , isReconstructToInactiveDomains ) ; boolean isSucceeded = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ReconstructMasterDomain , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) . getSucceeded ( ) ; return new org.ovirt.engine.core.common.eventqueue.EventResult ( isSucceeded , org.ovirt.engine.core.common.eventqueue.EventType.RECONSTRUCT ) ; }
Source:
public int getPossibleOverheadInMb ( org.ovirt.engine.core.common.businessentities.VM vm ) { int videoRam = org.ovirt.engine.core.bll.utils.VideoDeviceSettings.totalVideoRAMSizeMb ( vm ) ; int cpuOverhead = 8 * ( vm.getNumOfCpus ( true ) ) ; int iothreadsOverhead = 8 * ( vm.getNumOfIoThreads ( ) ) ; return ( videoRam + cpuOverhead ) + iothreadsOverhead ; }

Target:
public int getPossibleOverheadInMb ( org.ovirt.engine.core.common.businessentities.VM vm ) { int videoRam = videoDeviceSettings.totalVideoRAMSizeMb ( vm ) ; int cpuOverhead = 8 * ( vm.getNumOfCpus ( true ) ) ; int iothreadsOverhead = 8 * ( vm.getNumOfIoThreads ( ) ) ; return ( videoRam + cpuOverhead ) + iothreadsOverhead ; }
Source:
public static void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { 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.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) , aQuery ) ; }

Target:
public static void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.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.core.common.queries.VdsIdParametersBase parameters = new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }
Source:
public void nullifiedSnapshotOnUpdateDiskToShareable ( ) { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.setDiskInfo ( createShareableDisk ( VolumeFormat.RAW ) ) ; org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = createDiskImage ( ) ; oldDisk.setVmSnapshotId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( oldDisk ) ; initializeCommand ( parameters ) ; mockVmStatusDown ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( ( ( oldDisk.getVmSnapshotId ( ) ) == null ) ) ; }

Target:
public void nullifiedSnapshotOnUpdateDiskToShareable ( ) { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.setDiskInfo ( createShareableDisk ( VolumeFormat.RAW ) ) ; org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = createDiskImage ( ) ; oldDisk.setVmSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( oldDisk ) ; initializeCommand ( parameters ) ; mockVmStatusDown ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( ( ( oldDisk.getVmSnapshotId ( ) ) == null ) ) ; }
Source:
public void testIncludeExcludeOrder ( ) { java.lang.String expected = "alonbl@redhat.com" ; filter.clearFilterEntries ( ) ; filter.addFilterEntries ( org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.parse ( ( ( ( ( ( ( ( ( ( ( ( ( ( "" + "include:message1(smtp:" ) + expected ) + ") " ) + "include:message2(smtp:" ) + expected ) + ") " ) + "exclude:message3(smtp:" ) + expected ) + ") " ) + "exclude:message1(smtp:" ) + expected ) + ") " ) + "include:*" ) ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message1" ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message2" ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message3" ) ) ; org.junit.Assert.assertTrue ( smtp.getEvents ( ) . contains ( ( "message1-->" + expected ) ) ) ; org.junit.Assert.assertTrue ( smtp.getEvents ( ) . contains ( ( "message2-->" + expected ) ) ) ; org.junit.Assert.assertEquals ( 2 , smtp.getEvents ( ) . size ( ) ) ; }

Target:
public void testIncludeExcludeOrder ( ) { java.lang.String expected = "alonbl@redhat.com" ; filter.clearFilterEntries ( ) ; filter.addFilterEntries ( org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.parse ( ( ( ( ( ( ( ( ( ( ( ( ( ( "" + "include:message1(smtp:" ) + expected ) + ") " ) + "include:message2(smtp:" ) + expected ) + ") " ) + "exclude:message3(smtp:" ) + expected ) + ") " ) + "exclude:message1(smtp:" ) + expected ) + ") " ) + "include:*" ) ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message1" ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message2" ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message3" ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( smtp.getEvents ( ) . contains ( ( "message1-->" + expected ) ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( smtp.getEvents ( ) . contains ( ( "message2-->" + expected ) ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , smtp.getEvents ( ) . size ( ) ) ; }
Source:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { java.lang.String css = ( isEnabled ( value ) ) ? enabledClassNames : disabledClassNames ; com.google.gwt.safehtml.shared.SafeHtml html = ( isEnabled ( value ) ) ? enabledHtml : disabledHtml ; sb.append ( org.ovirt.engine.ui.common.widget.table.cell.ImageButtonCell.template.span ( id , css , html ) ) ; }

Target:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , T value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { java.lang.String css = ( isEnabled ( value ) ) ? enabledClassNames : disabledClassNames ; com.google.gwt.safehtml.shared.SafeHtml html = ( isEnabled ( value ) ) ? enabledHtml : disabledHtml ; sb.append ( org.ovirt.engine.ui.common.widget.table.cell.AbstractImageButtonCell.template.span ( id , css , html ) ) ; }
Source:
public void testCanDoActionFlowUnableToLock ( ) { org.ovirt.engine.core.utils.lock.EngineLock lock = new org.ovirt.engine.core.utils.lock.EngineLock ( java.util.Collections.singletonMap ( vm.getId ( ) . toString ( ) , LockingGroup.VM.name ( ) ) , java.util.Collections.< java.lang.String , java.lang.String > emptyMap ( ) ) ; lockManager.acquireLock ( lock ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ; }

Target:
public void testCanDoActionFlowUnableToLock ( ) { org.ovirt.engine.core.utils.lock.EngineLock lock = new org.ovirt.engine.core.utils.lock.EngineLock ( java.util.Collections.singletonMap ( vm.getId ( ) . toString ( ) , LockMessagesMatchUtil.VM ) , java.util.Collections.< java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > emptyMap ( ) ) ; lockManager.acquireLock ( lock ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Permission permission ) { validateParameters ( permission , ( isPrincipalSubCollection ( ) ? new java.lang.String [ ] { "role.id|name" , "dataCenter|cluster|host|storageDomain|vm|vmPool|template.id" } : new java.lang.String [ ] { "role.id|name" , "user|group.id" } ) ) ; org.ovirt.engine.core.common.action.PermissionsOperationsParameters parameters = getParameters ( permission ) ; org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetPermissionById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; return performCreate ( VdcActionType.AddPermission , parameters , resolver ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Permission permission ) { validateParameters ( permission , ( isPrincipalSubCollection ( ) ? new java.lang.String [ ] { "role.id|name" , "dataCenter|cluster|host|storageDomain|vm|vmPool|template.id" } : new java.lang.String [ ] { "role.id|name" , "user|group.id" } ) ) ; org.ovirt.engine.core.common.action.PermissionsOperationsParameters parameters = getParameters ( permission ) ; org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetPermissionById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; return performCreate ( ActionType.AddPermission , parameters , resolver ) ; }
Source:
public void vmNameNullVm ( ) { b.setVmName ( null ) ; final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; v.setName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVm ( v ) ; final java.lang.String n = b.getVmName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }

Target:
public void vmNameNullVm ( ) { b.setVmName ( null ) ; final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; v.setName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVm ( v ) ; final java.lang.String n = b.getVmName ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }
Source:
private void doTestBadAddBookmark ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.AddBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { "Bookmark.Name" , "Bookmark.Value" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ 0 ] } , valid , success ) ) ; try { collection.add ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddBookmark ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.AddBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { "Bookmark.Name" , "Bookmark.Value" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ 0 ] } , valid , success ) ) ; try { collection.add ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public static boolean isBondVlan ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { boolean retVal = false ; if ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( iface ) ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : interfaces ) { if ( ( ( ( i.getBonded ( ) ) != null ) && ( ( i.getBonded ( ) ) == true ) ) && ( org.ovirt.engine.core.utils.NetworkUtils.interfaceBasedOn ( iface.getName ( ) , i.getName ( ) ) ) ) { retVal = true ; break ; } } } return retVal ; }

Target:
public static boolean isBondVlan ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { if ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( iface ) ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : interfaces ) { if ( ( java.lang.Boolean.TRUE.equals ( i.getBonded ( ) ) ) && ( org.ovirt.engine.core.utils.NetworkUtils.interfaceBasedOn ( iface.getName ( ) , i.getName ( ) ) ) ) { return true ; } } } return false ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotUnplugNic ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotunplugNic ( info.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc diskReplicateFinish ( java.lang.String vmUUID , java.util.Map srcDisk , java.util.Map dstDisk ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.diskReplicateFinish ( vmUUID , srcDisk , dstDisk ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.storage.LUN_storage_server_connection_map other = ( ( org.ovirt.engine.core.common.businessentities.storage.LUN_storage_server_connection_map ) ( obj ) ) ; return ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( id.lunId , other.id.lunId ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( id.storageServerConnection , other.id.storageServerConnection ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap other = ( ( org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap ) ( obj ) ) ; return ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( id.lunId , other.id.lunId ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( id.storageServerConnection , other.id.storageServerConnection ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroupWithOlderVersion ( boolean supportsVirtService , boolean supportsGlusterService ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createNewVdsGroup ( ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_0 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DC_ID1 ) ; group.setVirtService ( supportsVirtService ) ; group.setGlusterService ( supportsGlusterService ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroupWithOlderVersion ( boolean supportsVirtService , boolean supportsGlusterService ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createNewVdsGroup ( ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_0 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DC_ID1 ) ; group.setVirtService ( supportsVirtService ) ; group.setGlusterService ( supportsGlusterService ) ; group.setMaxVdsMemoryOverCommit ( 100 ) ; return group ; }
Source:
private org.ovirt.engine.core.bll.snapshots.SnapshotsValidator mockSuccessfulSnapshotValidator ( ) { org.ovirt.engine.core.bll.snapshots.SnapshotsValidator snapshotsValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.snapshots.SnapshotsValidator.class ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotDuringSnapshot ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.doReturn ( snapshotsValidator ) . when ( command ) . getSnapshotsValidator ( ) ; return snapshotsValidator ; }

Target:
private org.ovirt.engine.core.bll.snapshots.SnapshotsValidator mockSuccessfulSnapshotValidator ( ) { org.ovirt.engine.core.bll.snapshots.SnapshotsValidator snapshotsValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.snapshots.SnapshotsValidator.class ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotDuringSnapshot ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.doReturn ( snapshotsValidator ) . when ( command ) . getSnapshotsValidator ( ) ; return snapshotsValidator ; }
Source:
public void pauseJob ( java.lang.String jobId ) { try { sched.pauseJob ( org.quartz.JobKey.jobKey ( jobId , Scheduler.DEFAULT_GROUP ) ) ; } catch ( org.quartz.SchedulerException se ) { log.error ( ( "failed to pause a job with id=" + jobId ) , se ) ; } }

Target:
public void rescheduleAJob ( java.lang.String oldTriggerName , java.lang.String oldTriggerGroup , org.quartz.Trigger newTrigger ) { try { if ( ! ( sched.isShutdown ( ) ) ) { sched.rescheduleJob ( org.quartz.TriggerKey.triggerKey ( oldTriggerName , oldTriggerGroup ) , newTrigger ) ; } } catch ( org.quartz.SchedulerException se ) { log.error ( "failed to reschedule the job: {}" , se.getMessage ( ) ) ; log.debug ( "Exception" , se ) ; } }
Source:
public void testFindDefaultManagementNetworkNonDefault ( ) { org.mockito.Mockito.when ( mockNetworkDao.getAllForDataCenter ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( java.util.Arrays.asList ( mockNetwork , mockNetwork ) ) ; org.mockito.Mockito.when ( mockNetworkDao.getManagementNetworks ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( java.util.Collections.singletonList ( mockNetwork ) ) ; final org.ovirt.engine.core.common.businessentities.network.Network actual = underTest.findDefaultManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ; org.junit.Assert.assertSame ( actual , mockNetwork ) ; }

Target:
public void testFindDefaultManagementNetworkNonDefault ( ) { org.mockito.Mockito.when ( mockNetworkDao.getAllForDataCenter ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( java.util.Arrays.asList ( mockNetwork , mockNetwork ) ) ; org.mockito.Mockito.when ( mockNetworkDao.getManagementNetworks ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( java.util.Collections.singletonList ( mockNetwork ) ) ; final org.ovirt.engine.core.common.businessentities.network.Network actual = underTest.findDefaultManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ; org.junit.jupiter.api.Assertions.assertSame ( actual , mockNetwork ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.models.VmConsoles getVmConsolesForVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { return vmConsoles.get ( vm.getId ( ) ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.VmConsoles getVmConsolesForEntity ( java.lang.Object entity ) { if ( entity instanceof org.ovirt.engine.core.common.businessentities.VM ) { return vmConsoles.get ( ( ( org.ovirt.engine.core.common.businessentities.VM ) ( entity ) ) . getId ( ) ) ; } else if ( entity instanceof org.ovirt.engine.core.common.businessentities.VmPool ) { return poolConsoles.get ( ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( entity ) ) . getVmPoolId ( ) ) ; } throw new java.lang.IllegalArgumentException ( "Entity must be instance of VM or VmPool!" ) ; }