auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void storeInHttpSession ( final java.lang.String key , final java.lang.String value , final org.ovirt.engine.ui.frontend.communication.StorageCallback callback ) { getService ( ) . storeInHttpSession ( key , value , new com.google.gwt.user.client.rpc.AsyncCallback < java.lang.Void > ( ) { @ java.lang.Override public void onSuccess ( final java.lang.Void result ) { callback.onSuccess ( null ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { callback.onFailure ( caught ) ; } } ) ; }

Target:
public void serviceFound ( org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync service ) { service.storeInHttpSession ( key , value , new com.google.gwt.user.client.rpc.AsyncCallback < java.lang.Void > ( ) { @ java.lang.Override public void onSuccess ( final java.lang.Void result ) { callback.onSuccess ( null ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { callback.onFailure ( caught ) ; } } ) ; }
Source:
private void checkActions ( java.util.Set < java.nio.channels.SelectionKey > keys ) { for ( java.nio.channels.SelectionKey key : keys ) { java.lang.Object attachement = key.attachment ( ) ; if ( org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.class . isInstance ( attachement ) ) { final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = ( ( org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient ) ( attachement ) ) ; client.performAction ( ) ; } } }

Target:
private void checkActions ( java.util.Set < java.nio.channels.SelectionKey > keys ) { keys.stream ( ) . filter ( ( key ) -> org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.class . isInstance ( key.attachment ( ) ) ) . forEach ( ( key ) -> ( ( org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient ) ( key.attachment ( ) ) ) . performAction ( ) ) ; }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , java.util.ArrayList < org.ovirt.engine.core.compat.Guid > asyncTasks , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > asyncStatuses ) { java.lang.String uri = ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.URL_BASE ) + "/action" ; return setUpActionExpectations ( task , clz , names , values , true , true , null , asyncTasks , asyncStatuses , null , null , uri , true ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.ActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , java.util.ArrayList < org.ovirt.engine.core.compat.Guid > asyncTasks , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > asyncStatuses ) { java.lang.String uri = ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.URL_BASE ) + "/action" ; return setUpActionExpectations ( task , clz , names , values , true , true , null , asyncTasks , asyncStatuses , null , null , uri , true ) ; }
Source:
public static org.ovirt.engine.core.vdsbroker.MonitoringStrategy getMonitoringStrategyForVds ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.vdsbroker.MonitoringStrategy returnedStrategy = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.virtMonitoringStrategy ; org.ovirt.engine.core.compat.Guid vdsGroupId = vds.getVdsGroupId ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.vdsGroupDao.get ( vdsGroupId ) ; if ( ( vdsGroup.supportsVirtService ( ) ) && ( vdsGroup.supportsGlusterService ( ) ) ) { returnedStrategy = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.multipleMonitoringStrategy ; } else if ( vdsGroup.supportsVirtService ( ) ) { returnedStrategy = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.virtMonitoringStrategy ; } else if ( vdsGroup.supportsGlusterService ( ) ) { returnedStrategy = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.glusterMonitoringStrategy ; } return returnedStrategy ; }

Target:
public static org.ovirt.engine.core.vdsbroker.MonitoringStrategy getMonitoringStrategyForVds ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.vdsbroker.MonitoringStrategy returnedStrategy = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.virtMonitoringStrategy ; org.ovirt.engine.core.compat.Guid clusterId = vds.getClusterId ( ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.clusterDao.get ( clusterId ) ; if ( ( cluster.supportsVirtService ( ) ) && ( cluster.supportsGlusterService ( ) ) ) { returnedStrategy = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.multipleMonitoringStrategy ; } else if ( cluster.supportsVirtService ( ) ) { returnedStrategy = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.virtMonitoringStrategy ; } else if ( cluster.supportsGlusterService ( ) ) { returnedStrategy = org.ovirt.engine.core.vdsbroker.MonitoringStrategyFactory.glusterMonitoringStrategy ; } return returnedStrategy ; }
Source:
public static void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }

Target:
public static void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , 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 ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }
Source:
public void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getClustersHavingHosts ( 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllClustersHavingHosts , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VDS getVds ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vds.setVdsName ( "gfs1" ) ; vds.setVdsGroupId ( CLUSTER_ID ) ; vds.setStatus ( status ) ; return vds ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VDS getVds ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vds.setVdsName ( "gfs1" ) ; vds.setClusterId ( CLUSTER_ID ) ; vds.setStatus ( status ) ; return vds ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc snapshot ( java.lang.String vmId , java.util.Map < java.lang.String , java.lang.String > [ ] snapParams ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.snapshot ( vmId , snapParams ) ; 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.ImageSizeReturnForXmlRpc diskSizeExtend ( java.lang.String vmId , java.util.Map < java.lang.String , java.lang.String > diskParams , java.lang.String newSize ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.diskSizeExtend ( vmId , diskParams , newSize ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ImageSizeReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.ImageSizeReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetVdsGroupsByStoragePoolIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetVdsGroupsByStoragePoolIdQuery.getDbFacade ( ) . getVdsGroupDao ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.GetVdsGroupsByStoragePoolIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetVdsGroupsByStoragePoolIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVdsGroupsByStoragePoolIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetClustersByStoragePoolIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetClustersByStoragePoolIdQuery.getDbFacade ( ) . getClusterDao ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.GetClustersByStoragePoolIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetClustersByStoragePoolIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetClustersByStoragePoolIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public void testGetAllInterfacesForVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > result = dao.getAllForVm ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.VM_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.VM_ID , iface.getVmId ( ) ) ; } }

Target:
public void testGetAllInterfacesForVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > result = dao.getAllForVm ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.VM_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : result ) { org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoTest.VM_ID , iface.getVmId ( ) ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.VDS createBaseVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setSupportedEmulatedMachines ( "pc-1.0" ) ; vds.getSupportedRngSources ( ) . add ( VmRngDevice.Source.URANDOM ) ; vds.setStatus ( VDSStatus.Up ) ; return vds ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS createBaseVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setSupportedEmulatedMachines ( "pc-1.0" ) ; vds.getSupportedRngSources ( ) . add ( VmRngDevice.Source.URANDOM ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setId ( vdsId ) ; vds.setClusterId ( clusterId ) ; return vds ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.deprecatedRemove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
protected boolean validateStpProperty ( ) { boolean stpIsAllowed = true ; if ( ( ! ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getParameters ( ) . getNetwork ( ) . isVmNetwork ( ) ) ) && ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getParameters ( ) . getNetwork ( ) . getstp ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.NON_VM_NETWORK_CANNOT_SUPPORT_STP ) ; stpIsAllowed = false ; } return stpIsAllowed ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult mtuValid ( ) { return ( ( getNetwork ( ) . getMtu ( ) ) == 0 ) || ( org.ovirt.engine.core.bll.validator.FeatureSupported.mtuSpecification ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getStoragePool ( ) . getcompatibility_version ( ) ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_MTU_OVERRIDE_NOT_SUPPORTED ) ; }
Source:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , boolean active , org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap , org.ovirt.engine.core.compat.Guid vmId ) { try { org.ovirt.engine.core.bll.ImagesHandler.addImage ( image , active , imageStorageDomainMap ) ; org.ovirt.engine.core.bll.ImagesHandler.addDiskToVmIfNotExists ( image , vmId ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.DB , ex ) ; } }

Target:
public static void addDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , boolean active , org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap , org.ovirt.engine.core.compat.Guid vmId ) { try { org.ovirt.engine.core.bll.ImagesHandler.addImage ( image , active , imageStorageDomainMap ) ; org.ovirt.engine.core.bll.ImagesHandler.addDiskToVmIfNotExists ( image , vmId ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.DB , ex ) ; } }
Source:
public static void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters p = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue qretVal = getBackend ( ) . runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; if ( ! ( qretVal.getSucceeded ( ) ) ) { return null ; } return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( qretVal.getReturnValue ( ) ) ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters p = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue qRetVal = getBackend ( ) . runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; if ( ! ( qRetVal.getSucceeded ( ) ) ) { return null ; } return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( qRetVal.getReturnValue ( ) ) ) ; }
Source:
public org.ovirt.engine.api.model.VM get ( ) { org.ovirt.engine.api.model.VM vm = performGet ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) ) ; return removeRestrictedInfo ( vm ) ; }

Target:
public org.ovirt.engine.api.model.VM get ( ) { org.ovirt.engine.api.model.VM vm ; if ( isNextRunRequested ( ) ) { vm = performGet ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) ) ; } else { vm = performGet ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) ) ; } return removeRestrictedInfo ( vm ) ; }
Source:
protected void onCommonModelChange ( ) { super . onCommonModelChange ( ) ; getModel ( ) . getResetRequestedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.util.Iterator < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > iterator = getModel ( ) . getItems ( ) . iterator ( ) ; if ( iterator.hasNext ( ) ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagModel root = getModel ( ) . cloneTagModel ( iterator.next ( ) ) ; updateDataProvider ( java.util.Arrays.asList ( root ) ) ; } } } ) ; }

Target:
protected void initializeModelHandlers ( ) { super . initializeModelHandlers ( ) ; getModel ( ) . getResetRequestedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.util.Iterator < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > iterator = getModel ( ) . getItems ( ) . iterator ( ) ; if ( iterator.hasNext ( ) ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagModel root = getModel ( ) . cloneTagModel ( iterator.next ( ) ) ; updateDataProvider ( java.util.Arrays.asList ( root ) ) ; } } } ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VnicProfile findVnicProfileForUser ( org.ovirt.engine.core.common.businessentities.DbUser user , org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > networkProfiles = org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.getVnicProfileDao ( ) . getAllForNetwork ( network.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile : networkProfiles ) { if ( ( ( user == null ) && ( ! ( profile.isPortMirroring ( ) ) ) ) || ( ( user != null ) && ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.isVnicProfilePermitted ( user , profile , false ) ) ) ) { return profile ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VnicProfile findVnicProfileForUser ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user , org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > networkProfiles = org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.getVnicProfileDao ( ) . getAllForNetwork ( network.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile : networkProfiles ) { if ( ( ( user == null ) && ( ! ( profile.isPortMirroring ( ) ) ) ) || ( ( user != null ) && ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.isVnicProfilePermitted ( user , profile , false ) ) ) ) { return profile ; } } return null ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskImageByImageId ( org.ovirt.engine.core.compat.Guid imageId ) { if ( diskImagesMap.containsKey ( imageId ) ) { return diskImagesMap.get ( imageId ) ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImageDao ( ) . get ( imageId ) ; diskImagesMap.put ( imageId , diskImage ) ; return diskImage ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage getDiskImageByImageId ( org.ovirt.engine.core.compat.Guid imageId ) { if ( diskImagesMap.containsKey ( imageId ) ) { return diskImagesMap.get ( imageId ) ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getDiskImageDao ( ) . get ( imageId ) ; diskImagesMap.put ( imageId , diskImage ) ; return diskImage ; }
Source:
public void setUp ( ) throws java.lang.Exception { sourceMacPoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; targetMacPoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; macsToMigrate = java.util.Arrays.asList ( "mac1" , "mac2" , "mac3" ) ; org.mockito.Mockito.when ( macPoolPerCluster.getMacPoolById ( sourceMacPoolId , commandContext ) ) . thenReturn ( sourceMacPool ) ; org.mockito.Mockito.when ( macPoolPerCluster.getMacPoolById ( targetMacPoolId , commandContext ) ) . thenReturn ( targetMacPool ) ; }

Target:
public void setUp ( ) { sourceMacPoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; targetMacPoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; macsToMigrate = new java.util.ArrayList < > ( java.util.Arrays.asList ( "mac1" , "mac2" , "mac3" ) ) ; org.mockito.Mockito.when ( macPoolPerCluster.getMacPoolById ( sourceMacPoolId , commandContext ) ) . thenReturn ( sourceMacPool ) ; org.mockito.Mockito.when ( macPoolPerCluster.getMacPoolById ( targetMacPoolId , commandContext ) ) . thenReturn ( targetMacPool ) ; org.mockito.Mockito.when ( macPoolPerCluster.getMacPoolById ( targetMacPoolId ) ) . thenReturn ( targetMacPool ) ; cluster = createCluster ( sourceMacPoolId ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterQuotaListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( ( ( lastExecutedCommand.equals ( getModel ( ) . getCreateQuotaCommand ( ) ) ) || ( lastExecutedCommand.equals ( getModel ( ) . getEditQuotaCommand ( ) ) ) ) || ( lastExecutedCommand.equals ( getModel ( ) . getCloneQuotaCommand ( ) ) ) ) { return quotaPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterQuotaListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( ( ( lastExecutedCommand.equals ( getModel ( ) . getCreateCommand ( ) ) ) || ( lastExecutedCommand.equals ( getModel ( ) . getEditCommand ( ) ) ) ) || ( lastExecutedCommand.equals ( getModel ( ) . getCloneCommand ( ) ) ) ) { return quotaPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
protected boolean canDoAction ( ) { _allNetworkCluster = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkClusterDAO ( ) . getAllForCluster ( org.ovirt.engine.core.bll.UpdateDisplayToVdsGroupCommand.getParameters ( ) . getVdsGroupId ( ) ) ; _networkCluster = org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( _allNetworkCluster , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.network_cluster > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.network_cluster x ) { return x.getnetwork_id ( ) . equals ( getParameters ( ) . getNetwork ( ) . getId ( ) ) ; } } ) ; return ( _networkCluster ) != null ; }

Target:
protected boolean canDoAction ( ) { _allNetworkCluster = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkClusterDao ( ) . getAllForCluster ( org.ovirt.engine.core.bll.UpdateDisplayToVdsGroupCommand.getParameters ( ) . getVdsGroupId ( ) ) ; _networkCluster = org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( _allNetworkCluster , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.network_cluster > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.network_cluster x ) { return x.getnetwork_id ( ) . equals ( getParameters ( ) . getNetwork ( ) . getId ( ) ) ; } } ) ; return ( _networkCluster ) != null ; }
Source:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { for ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel model : getItems ( ) ) { if ( model.isManagement ( ) ) { managementNetwork = model ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { for ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel model : getItems ( ) ) { if ( model.isManagement ( ) ) { managementNetwork = model ; } if ( model.isGlusterNetwork ( ) ) { glusterNetwork = model ; } } }
Source:
public void updateDisksStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disksList ) { disk.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Collections.singletonList ( storageDomain.getId ( ) ) ) ) ; } updateDiskVolumeType ( storageDomain.getStorageType ( ) , disksList.get ( 0 ) ) ; }

Target:
public void updateDisksStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisks ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : memoryDisks ) { disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( storageDomain.getId ( ) ) ) ) ; } updateDiskVolumeType ( storageDomain.getStorageType ( ) , memoryDisks.get ( 0 ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ) ( source ) ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo cifsOption = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo ( ) ; cifsOption.setKey ( "user.cifs" ) ; list.add ( cifsOption ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo > ( ) ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > GetNicTypeList ( org.ovirt.engine.core.common.businessentities.VmOsType osType , boolean hasDualmode ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ( java.util.Arrays.asList ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.values ( ) ) ) ; list.remove ( VmInterfaceType.rtl8139_pv ) ; if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.IsWindowsOsType ( osType ) ) { if ( ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.WindowsXP ) ) && hasDualmode ) { list.add ( VmInterfaceType.rtl8139_pv ) ; } } return list ; }
Source:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }

Target:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
protected void addUrlParams ( java.lang.StringBuffer methodExtraParamsDef , java.lang.StringBuffer urlParamsToBuild , org.ovirt.engine.sdk.entities.Parameter parameter ) { methodExtraParamsDef.append ( org.ovirt.engine.sdk.codegen.templates.AbstractOverloadableTemplate.extraMethodParameterTemplate.getTemplate ( org.ovirt.engine.sdk.codegen.utils.TypeUtils.toJava ( parameter.getType ( ) ) , org.ovirt.engine.sdk.codegen.utils.UrlUtils.toQueryParam ( parameter.getName ( ) ) ) ) ; urlParamsToBuild.append ( ( "\n" + ( org.ovirt.engine.sdk.codegen.templates.AbstractOverloadableTemplate.urlBuilderParameterTemplate.getTemplate ( parameter.getName ( ) , org.ovirt.engine.sdk.codegen.utils.UrlUtils.toQueryParam ( parameter.getName ( ) ) , org.ovirt.engine.sdk.codegen.utils.UrlUtils.toParamType ( parameter.getContext ( ) ) ) ) ) ) ; }

Target:
protected java.util.List < java.lang.String > getUrlParameterDeclarations ( java.util.List < org.ovirt.engine.sdk.entities.Parameter > params ) { java.util.List < java.lang.String > paramDecls = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.sdk.entities.Parameter param : params ) { java.lang.String paramName = org.ovirt.engine.sdk.codegen.utils.UrlUtils.toQueryParam ( param.getName ( ) ) ; java.lang.String paramType = org.ovirt.engine.sdk.codegen.utils.TypeUtils.toJava ( param.getType ( ) ) ; org.ovirt.engine.sdk.codegen.templates.MethodParameterTemplate paramDeclTemplate = new org.ovirt.engine.sdk.codegen.templates.MethodParameterTemplate ( ) ; java.lang.String paramDecl = paramDeclTemplate.getTemplate ( paramType , paramName ) ; paramDecls.add ( paramDecl ) ; } return paramDecls ; }
Source:
public boolean StorageDomainRemoved ( org.ovirt.engine.core.common.businessentities.storage_domain_static storageDomain ) { org.ovirt.engine.core.common.businessentities.storage_server_connections connection = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . get ( storageDomain.getstorage ( ) ) ; if ( connection != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getid ( ) ) ; } return true ; }

Target:
public boolean storageDomainRemoved ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomain ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . get ( storageDomain.getstorage ( ) ) ; if ( connection != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . remove ( connection.getid ( ) ) ; } return true ; }
Source:
private void endVmRelatedOps ( ) { org.ovirt.engine.core.bll.ImportVmCommand.setVm ( null ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.unLockVm ( getVm ( ) ) ; } else { org.ovirt.engine.core.bll.ImportVmCommand.setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "VM is null, not performing full endAction" ) ; } }

Target:
protected void processImages ( ) { processImages ( ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.isImagesAlreadyOnTarget ( ) ) ) ) ; if ( org.ovirt.engine.core.bll.ImportVmCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . isEmpty ( ) ) { org.ovirt.engine.core.bll.VmHandler.unLockVm ( getVm ( ) ) ; } }
Source:
public void testEvalDifferentAddress ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockOtherIface.getName ( ) ) . thenReturn ( org.ovirt.engine.core.vdsbroker.vdsbroker.predicates.DisplayInterfaceEqualityPredicateTest.TEST_INTERFACE_NAME ) ; org.mockito.Mockito.when ( mockOtherIface.getAddress ( ) ) . thenReturn ( ( "not" + ( org.ovirt.engine.core.vdsbroker.vdsbroker.predicates.DisplayInterfaceEqualityPredicateTest.TEST_INTERFACE_ADDRESS ) ) ) ; org.junit.Assert.assertFalse ( underTest.test ( mockOtherIface ) ) ; }

Target:
public void testEvalDifferentAddress ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockOtherIface.getName ( ) ) . thenReturn ( org.ovirt.engine.core.vdsbroker.vdsbroker.predicates.DisplayInterfaceEqualityPredicateTest.TEST_INTERFACE_NAME ) ; org.mockito.Mockito.when ( mockOtherIface.getIpv4Address ( ) ) . thenReturn ( ( "not" + ( org.ovirt.engine.core.vdsbroker.vdsbroker.predicates.DisplayInterfaceEqualityPredicateTest.TEST_INTERFACE_ADDRESS ) ) ) ; org.junit.Assert.assertFalse ( underTest.test ( mockOtherIface ) ) ; }
Source:
public boolean isHostedEngineStorageDomain ( final org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = vmDao.getAllForStorageDomain ( storageDomain.getId ( ) ) ; if ( vms == null ) { return false ; } return vms.stream ( ) . filter ( VM :: isHostedEngine ) . findAny ( ) . isPresent ( ) ; }

Target:
private void init ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > byName = vmStaticDao.getAllByName ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.HostedEngineVmName ) ) ; if ( ( byName != null ) && ( ! ( byName.isEmpty ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = byName.get ( 0 ) ; hostedEngineVm = vmDao.get ( vmStatic.getId ( ) ) ; vmHandler.updateDisksFromDb ( hostedEngineVm ) ; } initHostedEngineStorageDomain ( ) ; }
Source:
public void diskImagesAlreadyExistBothExist ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ) . when ( validator ) . getExistingDisk ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.junit.matchers.JUnitMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.junit.matchers.JUnitMatchers.hasItem ( org.ovirt.engine.core.bll.validator.DiskImagesValidatorTest.createAliasReplacements ( disk1 , disk2 ) ) ) ) ) ; }

Target:
public void diskImagesAlreadyExistBothExist ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ) . when ( validator ) . getExistingDisk ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.DiskImagesValidatorTest.createAliasReplacements ( disk1 , disk2 ) ) ) ) ) ; }
Source:
public void testRemoveVmFromPool ( ) { int before = dao.getVmPoolsMapByVmPoolId ( existingVmPoolMap.getvm_pool_id ( ) ) . size ( ) ; dao.removeVmFromVmPool ( org.ovirt.engine.core.dao.VmPoolDAOTest.EXISTING_VM_ID ) ; int after = dao.getVmPoolsMapByVmPoolId ( existingVmPoolMap.getvm_pool_id ( ) ) . size ( ) ; org.junit.Assert.assertEquals ( ( before - 1 ) , after ) ; org.ovirt.engine.core.common.businessentities.vm_pool_map result = dao.getVmPoolMapByVmGuid ( org.ovirt.engine.core.dao.VmPoolDAOTest.EXISTING_VM_ID ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void testRemoveVmFromPool ( ) { int before = dao.getVmPoolsMapByVmPoolId ( existingVmPoolMap.getvm_pool_id ( ) ) . size ( ) ; dao.removeVmFromVmPool ( org.ovirt.engine.core.dao.VmPoolDAOTest.EXISTING_VM_ID ) ; int after = dao.getVmPoolsMapByVmPoolId ( existingVmPoolMap.getvm_pool_id ( ) ) . size ( ) ; org.junit.Assert.assertEquals ( ( before - 1 ) , after ) ; org.ovirt.engine.core.common.businessentities.VmPoolMap result = dao.getVmPoolMapByVmGuid ( org.ovirt.engine.core.dao.VmPoolDAOTest.EXISTING_VM_ID ) ; org.junit.Assert.assertNull ( result ) ; }
Source:
protected void mockVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( "3.1" ) ) ; command.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDao ( ) ; org.mockito.Mockito.when ( vdsDao.get ( Guid.Empty ) ) . thenReturn ( vds ) ; }

Target:
protected void mockVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setClusterCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( "3.1" ) ) ; command.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDao ( ) ; org.mockito.Mockito.when ( vdsDao.get ( Guid.Empty ) ) . thenReturn ( vds ) ; }
Source:
public static void GetHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters ( id ) , aQuery ) ; }

Target:
public static void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters ( id ) , aQuery ) ; }