auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void canRunForHostedEngine ( ) { org.ovirt.engine.core.common.businessentities.VM hostedEngine = new org.ovirt.engine.core.common.businessentities.VM ( ) ; hostedEngine.setOrigin ( OriginType.MANAGED_HOSTED_ENGINE ) ; underTest.setVm ( hostedEngine ) ; underTest.init ( ) ; org.junit.Assert.assertThat ( underTest.canRunActionOnNonManagedVm ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void canRunForHostedEngine ( ) { org.ovirt.engine.core.common.businessentities.VM hostedEngine = new org.ovirt.engine.core.common.businessentities.VM ( ) ; hostedEngine.setOrigin ( OriginType.MANAGED_HOSTED_ENGINE ) ; underTest.setVm ( hostedEngine ) ; underTest.init ( ) ; org.hamcrest.MatcherAssert.assertThat ( underTest.canRunActionOnNonManagedVm ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
public void insufficientDiskSpaceWithCollapse ( ) { final org.ovirt.engine.core.bll.exportimport.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > command = setupDiskSpaceTest ( createParameters ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateImages ( org.mockito.Matchers.anyMapOf ( org.ovirt.engine.core.compat.Guid.class , org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.mockito.Mockito.when ( command.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.Matchers.anyCollectionOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void setUp ( ) { org.mockito.Mockito.doReturn ( null ) . when ( cmd ) . getCluster ( ) ; }
Source:
public static void getWatchdogByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetWatchdog , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > filterTemplatesByArchitecture ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > list , org.ovirt.engine.core.common.businessentities.ArchitectureType architecture ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > filteredList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : list ) { if ( ( template.getId ( ) . equals ( Guid.Empty ) ) || ( template.getClusterArch ( ) . equals ( architecture ) ) ) { filteredList.add ( template ) ; } } return filteredList ; }
Source:
protected org.ovirt.engine.core.common.action.RunVmOnceParams createRunVmOnceParams ( ) { org.ovirt.engine.core.common.action.RunVmOnceParams params = super . createRunVmOnceParams ( ) ; if ( ( getSysPrepDomainName ( ) . getSelectedItem ( ) ) != null ) { params.setSysPrepDomainName ( ( ( java.lang.String ) ( getSysPrepDomainName ( ) . getSelectedItem ( ) ) ) ) ; } return params ; }

Target:
protected void onRunOnce ( ) { startProgress ( null ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RunVmOnce , createRunVmOnceParams ( ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( ) ; commandTarget.executeCommand ( runOnceCommand ) ; } } , this ) ; }
Source:
protected void expectGetConnections ( org.ovirt.engine.core.dao.StorageServerConnectionDao dao ) { for ( int i = 0 ; i < ( org.ovirt.engine.core.bll.GetLunsByVgIdTest.GUIDS.length ) ; i ++ ) { org.mockito.Mockito.when ( dao.get ( org.ovirt.engine.core.bll.GetLunsByVgIdTest.GUIDS [ i ] . toString ( ) ) ) . thenReturn ( setUpConnection ( i ) ) ; } }

Target:
protected void expectGetConnections ( org.ovirt.engine.core.dao.StorageServerConnectionDao dao ) { for ( int i = 0 ; i < ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS.length ) ; i ++ ) { org.mockito.Mockito.when ( dao.get ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.GUIDS [ i ] . toString ( ) ) ) . thenReturn ( setUpConnection ( i ) ) ; } }
Source:
public void validateFailsOnSameServerIncreasingReplica ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeIdRepl , getBricks ( volumeIdRepl , 2 , true ) , 3 , 0 , false ) ) ; prepareMocks ( cmd ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity vol = getMultiBrickVolume ( volumeIdRepl , 4 ) ; vol.setVolumeType ( GlusterVolumeType.DISTRIBUTED_REPLICATE ) ; vol.setReplicaCount ( 2 ) ; org.mockito.Mockito.doReturn ( vol ) . when ( volumeDao ) . getById ( volumeIdRepl ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsOnSameServerIncreasingReplica ( ) { initTestCommand ( volumeIdRepl , getBricks ( volumeIdRepl , 2 , true ) , 3 , 0 , false ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity vol = getMultiBrickVolume ( volumeIdRepl , 4 ) ; vol.setVolumeType ( GlusterVolumeType.DISTRIBUTED_REPLICATE ) ; vol.setReplicaCount ( 2 ) ; org.mockito.Mockito.doReturn ( vol ) . when ( volumeDao ) . getById ( volumeIdRepl ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
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 , boolean canDo , boolean success , java.lang.Object taskReturn , java.util.ArrayList < org.ovirt.engine.core.compat.Guid > asyncTasks , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > asyncStatuses , org.ovirt.engine.core.compat.Guid jobId , org.ovirt.engine.core.common.job.JobExecutionStatus jobStatus , java.lang.String baseUri , boolean replay ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , taskReturn , asyncTasks , asyncStatuses , jobId , jobStatus , baseUri , replay , org.ovirt.engine.api.restapi.resource.AbstractBackendBaseTest.CANT_DO ) ; }

Target:
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 , boolean valid , boolean success , java.lang.Object taskReturn , java.util.ArrayList < org.ovirt.engine.core.compat.Guid > asyncTasks , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > asyncStatuses , org.ovirt.engine.core.compat.Guid jobId , org.ovirt.engine.core.common.job.JobExecutionStatus jobStatus , java.lang.String baseUri , boolean replay ) { return setUpActionExpectations ( task , clz , names , values , valid , success , taskReturn , asyncTasks , asyncStatuses , jobId , jobStatus , baseUri , replay , org.ovirt.engine.api.restapi.resource.AbstractBackendBaseTest.CANT_DO ) ; }
Source:
public void init ( javax.servlet.FilterConfig filterConfig ) throws javax.servlet.ServletException { if ( ( org.ovirt.engine.ui.frontend.server.caching.CachingFilter.cachePattern ) == null ) { org.ovirt.engine.ui.frontend.server.caching.CachingFilter.cachePattern = compilePatternFromInitParam ( filterConfig , org.ovirt.engine.ui.frontend.server.caching.CachingFilter.CACHE_INIT_PARAM ) ; } if ( ( org.ovirt.engine.ui.frontend.server.caching.CachingFilter.noCachePattern ) == null ) { org.ovirt.engine.ui.frontend.server.caching.CachingFilter.noCachePattern = compilePatternFromInitParam ( filterConfig , org.ovirt.engine.ui.frontend.server.caching.CachingFilter.NO_CACHE_INIT_PARAM ) ; } if ( ( org.ovirt.engine.ui.frontend.server.caching.CachingFilter.noStorePattern ) == null ) { org.ovirt.engine.ui.frontend.server.caching.CachingFilter.noStorePattern = compilePatternFromInitParam ( filterConfig , org.ovirt.engine.ui.frontend.server.caching.CachingFilter.NO_STORE_INIT_PARAM ) ; } }

Target:
public void init ( javax.servlet.FilterConfig filterConfig ) throws javax.servlet.ServletException { if ( ( org.ovirt.engine.core.utils.servlet.CachingFilter.cachePattern ) == null ) { org.ovirt.engine.core.utils.servlet.CachingFilter.cachePattern = compilePatternFromInitParam ( filterConfig , org.ovirt.engine.core.utils.servlet.CachingFilter.CACHE_INIT_PARAM ) ; } if ( ( org.ovirt.engine.core.utils.servlet.CachingFilter.noCachePattern ) == null ) { org.ovirt.engine.core.utils.servlet.CachingFilter.noCachePattern = compilePatternFromInitParam ( filterConfig , org.ovirt.engine.core.utils.servlet.CachingFilter.NO_CACHE_INIT_PARAM ) ; } if ( ( org.ovirt.engine.core.utils.servlet.CachingFilter.noStorePattern ) == null ) { org.ovirt.engine.core.utils.servlet.CachingFilter.noStorePattern = compilePatternFromInitParam ( filterConfig , org.ovirt.engine.core.utils.servlet.CachingFilter.NO_STORE_INIT_PARAM ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel vmGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; vmGuideModel.disks = disks ; vmGuideModel.UpdateOptionsPostData ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel vmGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; vmGuideModel.disks = disks ; vmGuideModel.updateOptionsPostData ( ) ; }
Source:
public static void getClusterList ( 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.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.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getClusterList ( 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.RunQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void validateTemplateImageIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initTemplateDiskImage ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ) . when ( command ) . getTemplateForImage ( ) ; command.init ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.VM_TEMPLATE_IMAGE_IS_LOCKED.toString ( ) ) ) ; }

Target:
public void validateDiskIsOvfStore ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; command.getImage ( ) . setContentType ( DiskContentType.OVF_STORE ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_OVF_DISK_NOT_SUPPORTED ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetworkDAO ( ) . save ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) ) ; addPermissions ( ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetworkDAO ( ) . save ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) ) ; org.ovirt.engine.core.bll.network.cluster.NetworkHelper.addPermissions ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getCurrentUser ( ) . getUserId ( ) , org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) , org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getParameters ( ) . isPublicUse ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.setSucceeded ( true ) ; }
Source:
private void updateTaskStatuses ( java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > > poolsAllTasksMap ) { for ( org.ovirt.engine.core.bll.SPMAsyncTask task : _tasks.values ( ) ) { if ( task.getShouldPoll ( ) ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > asyncTasksForPoolMap = poolsAllTasksMap.get ( task.getStoragePoolID ( ) ) ; if ( asyncTasksForPoolMap != null ) { org.ovirt.engine.core.common.businessentities.AsyncTaskStatus cachedAsyncTaskStatus = asyncTasksForPoolMap.get ( task.getTaskID ( ) ) ; task.UpdateTask ( cachedAsyncTaskStatus ) ; } } } }

Target:
private void updateTaskStatuses ( java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > > poolsAllTasksMap ) { for ( org.ovirt.engine.core.bll.SPMAsyncTask task : _tasks.values ( ) ) { if ( task.getShouldPoll ( ) ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > asyncTasksForPoolMap = poolsAllTasksMap.get ( task.getStoragePoolID ( ) ) ; if ( asyncTasksForPoolMap != null ) { org.ovirt.engine.core.common.businessentities.AsyncTaskStatus cachedAsyncTaskStatus = asyncTasksForPoolMap.get ( task.getVdsmTaskId ( ) ) ; task.UpdateTask ( cachedAsyncTaskStatus ) ; } } } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeBrickAdd ( java.lang.String volumeName , java.lang.String [ ] bricks , int replicaCount , int stripeCount ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.addBrick" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "brickList" , new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( bricks ) ) ) . withParameter ( "replicaCount" , replicaCount ) . withParameter ( "stripeCount" , stripeCount ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc remove_image_ticket ( java.lang.String ticketId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.remove_image_ticket" ) . withParameter ( "uuid" , ticketId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
private org.ovirt.engine.ui.frontend.server.dashboard.Dashboard getDashboardFromCache ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { org.ovirt.engine.ui.frontend.server.dashboard.Dashboard dashboard ; org.ovirt.engine.ui.frontend.server.dashboard.Inventory inventory ; synchronized ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_LOCK ) { dashboard = org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.dashboardCache.get ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_KEY ) ; if ( dashboard == null ) { dashboard = populateUtilizationCache ( ) ; } inventory = org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.inventoryCache.get ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.INVENTORY_KEY ) ; if ( inventory == null ) { inventory = populateInventoryCache ( ) ; } } dashboard.setInventory ( inventory ) ; return dashboard ; }

Target:
private org.ovirt.engine.ui.frontend.server.dashboard.Inventory populateInventoryCache ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { long startTime = java.lang.System.currentTimeMillis ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.Inventory inventory = lookupInventory ( ) ; long endTime = java.lang.System.currentTimeMillis ( ) ; if ( enableBackgroundCacheUpdate ) { inventoryCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.INVENTORY_KEY , inventory ) ; } else { inventoryCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.INVENTORY_KEY , inventory , org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.INVENTORY_CACHE_UPDATE_INTERVAL , java.util.concurrent.TimeUnit.SECONDS ) ; } org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.log.debug ( "Dashboard inventoy cache updated in {}ms" , ( endTime - startTime ) ) ; return inventory ; }
Source:
private void setHasSearchStringPrefix ( boolean value ) { if ( ( hasSearchStringPrefix ) != value ) { hasSearchStringPrefix = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "HasSearchStringPrefix" ) ) ; } }

Target:
public void setSearchString ( java.lang.String value , boolean checkIfNewValue ) { if ( ( ! checkIfNewValue ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( searchString , value ) ) ) ) { searchString = value ; SearchStringChanged ( ) ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SearchString" ) ) ; } }
Source:
public void testAddStorageDomainNoHost ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.StorageDomain model = org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "StorageDomain" , "add" , "host.id|name" ) ; } }

Target:
public void testAddStorageDomainNoHost ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.StorageDomain model = org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 0 ) ; verifyIncompleteException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( model ) ) , "StorageDomain" , "add" , "host.id|name" ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel ) ( result.getState ( ) ) ) ; localModel.PostOnSaveInternal ( result.getReturnValue ( ) ) ; }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel ) ( result.getState ( ) ) ) ; if ( ( ( java.lang.Boolean ) ( model.getIsImportGlusterConfiguration ( ) . getEntity ( ) ) ) ) { localModel.postOnSaveInternalWithImport ( result.getReturnValue ( ) ) ; } else { localModel.PostOnSaveInternal ( result.getReturnValue ( ) ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.extensions.mgr.ExtensionProxy > getProvidedExtensions ( java.lang.String provides ) { java.util.List < org.ovirt.engine.core.extensions.mgr.ExtensionProxy > results = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.extensions.mgr.ExtensionsManager.ExtensionEntry entry : loadedEntries.values ( ) ) { if ( ( entry.activated ) && ( entry.extension.getContext ( ) . < java.util.List > get ( Base.ContextKeys.PROVIDES ) . contains ( provides ) ) ) { results.add ( entry.extension ) ; } } return results ; }

Target:
public java.util.List < org.ovirt.engine.core.extensions.mgr.ExtensionProxy > getLoadedExtensions ( ) { java.util.List < org.ovirt.engine.core.extensions.mgr.ExtensionProxy > results = new java.util.ArrayList < > ( loadedEntries.size ( ) ) ; for ( org.ovirt.engine.core.extensions.mgr.ExtensionsManager.ExtensionEntry entry : loadedEntries.values ( ) ) { results.add ( entry.extension ) ; } return results ; }
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 , boolean canDo , boolean success , java.lang.Object taskReturn , java.lang.String baseUri , boolean replay , java.lang.String errorMessage ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , taskReturn , null , null , null , null , baseUri , replay , errorMessage ) ; }

Target:
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 , boolean valid , boolean success , java.lang.Object taskReturn , java.lang.String baseUri , boolean replay , java.lang.String errorMessage ) { return setUpActionExpectations ( task , clz , names , values , valid , success , taskReturn , null , null , null , null , baseUri , replay , errorMessage ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc setVmTicket ( java.lang.String vmId , java.lang.String otp64 , java.lang.String sec , java.lang.String connectionAction , java.util.Map < java.lang.String , java.lang.String > params ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.setTicket" ) . withParameter ( "vmID" , vmId ) . withParameter ( "password" , otp64 ) . withParameter ( "ttl" , sec ) . withParameter ( "existingConnAction" , connectionAction ) . withParameter ( "params" , params ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc snapshot ( java.lang.String vmId , java.util.Map < java.lang.String , java.lang.String > [ ] disks , java.lang.String memory ) { return snapshot ( vmId , disks , memory , false ) ; }
Source:
public void testGetSupportedHostFeaturesByHostId ( ) { java.util.Set < java.lang.String > featuresSupported = dao.getSupportedHostFeaturesByHostId ( org.ovirt.engine.core.dao.SupportedHostFeatureDaoTest.EXISTING_HOST_ID_1 ) ; org.junit.Assert.assertNotNull ( "Failed to retrive supported addtional features in the host" , featuresSupported ) ; java.util.Set < java.lang.String > expectedFeatures = new java.util.HashSet < > ( java.util.Arrays.asList ( "TEST_FEATURE_1" , "TEST_FEATURE_2" ) ) ; org.junit.Assert.assertEquals ( "Failed to retrive supported addtional features in the host" , expectedFeatures , featuresSupported ) ; }

Target:
public void testGetSupportedHostFeaturesByHostId ( ) { java.util.Set < java.lang.String > featuresSupported = dao.getSupportedHostFeaturesByHostId ( FixturesTool.HOST_ID ) ; org.junit.Assert.assertNotNull ( "Failed to retrive supported addtional features in the host" , featuresSupported ) ; java.util.Set < java.lang.String > expectedFeatures = new java.util.HashSet < > ( java.util.Arrays.asList ( "TEST_FEATURE_1" , "TEST_FEATURE_2" ) ) ; org.junit.Assert.assertEquals ( "Failed to retrive supported addtional features in the host" , expectedFeatures , featuresSupported ) ; }
Source:
protected void verify ( org.ovirt.engine.api.model.ImageTransfer model , org.ovirt.engine.api.model.ImageTransfer transform ) { org.junit.Assert.assertNotNull ( transform ) ; org.junit.Assert.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.Assert.assertEquals ( model.getHost ( ) . getId ( ) , transform.getHost ( ) . getId ( ) ) ; org.junit.Assert.assertEquals ( model.getImage ( ) . getId ( ) , transform.getImage ( ) . getId ( ) ) ; }

Target:
protected void verify ( org.ovirt.engine.api.model.ImageTransfer model , org.ovirt.engine.api.model.ImageTransfer transform ) { org.junit.jupiter.api.Assertions.assertNotNull ( transform ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getHost ( ) . getId ( ) , transform.getHost ( ) . getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getImage ( ) . getId ( ) , transform.getImage ( ) . getId ( ) ) ; }
Source:
private java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > getStorageToDiskMap ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > storageToDisksMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getSourceImages ( ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( disk.getStorageIds ( ) . get ( 0 ) , disk , storageToDisksMap ) ; } return storageToDisksMap ; }

Target:
protected org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator getStorageDomainsValidator ( org.ovirt.engine.core.compat.Guid spId , java.util.Collection < org.ovirt.engine.core.compat.Guid > sdIds ) { return new org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator ( spId , sdIds ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity getGlusterVolume ( java.lang.String name , org.ovirt.engine.core.compat.Guid volumeID , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType volumeType , int replicaCount , java.lang.String volumeOptions , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks , org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus status ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ; volume.setName ( name ) ; volume.setId ( volumeID ) ; volume.setReplicaCount ( replicaCount ) ; volume.setVolumeType ( volumeType ) ; volume.setOptions ( volumeOptions ) ; volume.setBricks ( bricks ) ; volume.setStatus ( status ) ; return volume ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity getGlusterVolume ( java.lang.String name , org.ovirt.engine.core.compat.Guid volumeID , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType volumeType , java.lang.String volumeOptions , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks , org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus status ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ; volume.setName ( name ) ; volume.setId ( volumeID ) ; volume.setReplicaCount ( 3 ) ; volume.setVolumeType ( volumeType ) ; volume.setOptions ( volumeOptions ) ; volume.setBricks ( bricks ) ; volume.setStatus ( status ) ; return volume ; }
Source:
public void runFailedAutoStartVM ( org.ovirt.engine.core.compat.Guid vmId ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase event = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; event.setVmId ( vmId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( event , AuditLogType.HA_VM_FAILED ) ; org.ovirt.engine.core.bll.VdsEventListener.log.infoFormat ( "Highly Available VM went down. Attempting to restart. VM Name: {0}, VM Id:{1}" , event.getVmName ( ) , vmId ) ; org.ovirt.engine.core.bll.AutoStartVmsRunner.getInstance ( ) . addVmToRun ( vmId ) ; }

Target:
public void runFailedAutoStartVMs ( java.util.List < org.ovirt.engine.core.compat.Guid > vmIds ) { for ( org.ovirt.engine.core.compat.Guid vmId : vmIds ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase event = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; event.setVmId ( vmId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( event , AuditLogType.HA_VM_FAILED ) ; org.ovirt.engine.core.bll.VdsEventListener.log.infoFormat ( "Highly Available VM went down. Attempting to restart. VM Name: {0}, VM Id: {1}" , event.getVmName ( ) , vmId ) ; } org.ovirt.engine.core.bll.AutoStartVmsRunner.getInstance ( ) . addVmsToRun ( vmIds ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc migrateStatus ( java.lang.String vmId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.migrateStatus ( vmId ) ; 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 glusterGeoRepKeysUpdate ( java.util.List < java.lang.String > geoRepPubKeys , java.lang.String userName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterGeoRepKeysUpdate ( userName , geoRepPubKeys ) ; 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:
private void Reset ( ) { setSelectedItems ( new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > ( ) ) ; if ( ( getItems ( ) ) != null ) { for ( java.lang.Object item : getItems ( ) ) { ResetInternal ( ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagModel ) ( item ) ) ) ; } } getResetRequestedEvent ( ) . raise ( this , EventArgs.Empty ) ; }

Target:
protected void asyncSearch ( ) { super . asyncSearch ( ) ; syncSearch ( ) ; }
Source:
private void handleTransferring ( final org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand < T > . StateContext context ) { if ( ( context.iterationTimestamp ) >= ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getSessionExpiration ( ) ) - ( getHostTicketRefreshAllowance ( ) ) ) ) { log.info ( "Renewing transfer ticket for {}" , getTransferDescription ( ) ) ; extendImageTransferSession ( context.entity ) ; } else { log.debug ( "Not yet renewing transfer ticket for {}" , getTransferDescription ( ) ) ; } resetPeriodicPauseLogTime ( 0 ) ; }

Target:
private void handleTransferring ( final org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand < T > . StateContext context ) { extendTicketIfNecessary ( context ) ; resetPeriodicPauseLogTime ( 0 ) ; pollTransferStatus ( context ) ; }
Source:
protected void onLogin ( final org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . setSsoToken ( user.getEngineSessionId ( ) ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . init ( ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getReportsInitEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override 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 ) { commonModelProvider.get ( ) . updateReportsAvailability ( ) ; } } ) ; performLogin ( loginModel ) ; }

Target:
public void execute ( ) { performPlaceTransition ( ) ; }
Source:
private boolean isReplicaCountIncreased ( ) { if ( ( ( ( getGlusterVolume ( ) . getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.REPLICATE ) ) || ( ( getGlusterVolume ( ) . getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.DISTRIBUTED_REPLICATE ) ) ) && ( ( getParameters ( ) . getReplicaCount ( ) ) > ( getGlusterVolume ( ) . getReplicaCount ( ) ) ) ) { return true ; } else { return false ; } }

Target:
private boolean isReplicaCountIncreased ( int replicaCount ) { if ( ( ( ( getGlusterVolume ( ) . getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.REPLICATE ) ) || ( ( getGlusterVolume ( ) . getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.DISTRIBUTED_REPLICATE ) ) ) && ( replicaCount > ( getGlusterVolume ( ) . getReplicaCount ( ) ) ) ) { return true ; } else { return false ; } }
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVds ( ) . getKdumpStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.KdumpStatus.ENABLED ) ) { addCanDoActionMessage ( VdcBllMessages.KDUMP_DETECTION_NOT_CONFIGURED_ON_VDS ) ; return false ; } boolean detectionEnabled = org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVds ( ) . isPmKdumpDetection ( ) ; if ( ! detectionEnabled ) { addCanDoActionMessage ( VdcBllMessages.KDUMP_DETECTION_NOT_ENABLED_FOR_VDS ) ; } return detectionEnabled ; }

Target:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVds ( ) . getKdumpStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.KdumpStatus.ENABLED ) ) { addCanDoActionMessage ( EngineMessage.KDUMP_DETECTION_NOT_CONFIGURED_ON_VDS ) ; return false ; } boolean detectionEnabled = org.ovirt.engine.core.bll.pm.VdsKdumpDetectionCommand.getVds ( ) . isPmKdumpDetection ( ) ; if ( ! detectionEnabled ) { addCanDoActionMessage ( EngineMessage.KDUMP_DETECTION_NOT_ENABLED_FOR_VDS ) ; } return detectionEnabled ; }
Source:
public static void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public static void getAllVnicProfiles ( 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVnicProfiles , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > retval = org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getDbFacade ( ) . getVmTemplateDAO ( ) . getAll ( org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getParameters ( ) . isFiltered ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : retval ) { AnonymousMethod1 ( template ) ; } org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getQueryReturnValue ( ) . setReturnValue ( retval ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > retval = org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getDbFacade ( ) . getVmTemplateDao ( ) . getAll ( org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getParameters ( ) . isFiltered ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : retval ) { AnonymousMethod1 ( template ) ; } org.ovirt.engine.core.bll.GetAllVmTemplatesQuery.getQueryReturnValue ( ) . setReturnValue ( retval ) ; }
Source:
public void run ( ) { try { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . IsStoragePoolMasterUp ( _storagePoolId ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolUpEvent ( storagePool , _isSpmStartCalled ) ; } } catch ( java.lang.RuntimeException exp ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.error ( "Error in StoragePoolUpEvent - " , exp ) ; } }

Target:
public void run ( ) { try { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . isStoragePoolMasterUp ( _storagePoolId ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolUpEvent ( storagePool , _isSpmStartCalled ) ; } } catch ( java.lang.RuntimeException exp ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.error ( "Error in StoragePoolUpEvent - " , exp ) ; } }
Source:
public void testChangeCdUsingMatrixParameter ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , "current" ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( getVm ( ) ) ; setUpActionExpectations ( ActionType.ChangeDisk , org.ovirt.engine.core.common.action.ChangeDiskCommandParameters.class , new java.lang.String [ ] { "CdImagePath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO } , true , true ) ; org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO ) ; cdrom = resource.update ( cdrom ) ; assertTrue ( cdrom.isSetFile ( ) ) ; }

Target:
public void testChangeCdUsingMatrixParameter ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , "current" ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( getVm ( ) ) ; setUpActionExpectations ( ActionType.ChangeDisk , org.ovirt.engine.core.common.action.ChangeDiskCommandParameters.class , new java.lang.String [ ] { "CdImagePath" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO } , true , true ) ; org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO ) ; cdrom = resource.update ( cdrom ) ; org.junit.Assert.assertTrue ( cdrom.isSetFile ( ) ) ; }
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.Label > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > ) ( 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.Label > ( ) ; }

Target:
public void getDataCenterById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
private org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel lineModelFromBond ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel model = lineModelFromInterface ( nic ) ; model.setInterface ( nic ) ; model.setIsBonded ( true ) ; model.setBondName ( nic.getName ( ) ) ; model.setAddress ( nic.getAddress ( ) ) ; return model ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel lineModelFromBond ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel model = lineModelFromInterface ( nic ) ; model.setInterface ( nic ) ; model.setIsBonded ( true ) ; model.setBondName ( nic.getName ( ) ) ; model.setAddress ( nic.getIpv4Address ( ) ) ; return model ; }
Source:
public void compensate ( org.ovirt.engine.core.bll.CommandBase command , org.ovirt.engine.core.common.businessentities.TransientCompensationBusinessEntity entity ) { switch ( entity.getTransientEntityType ( ) ) { case RELEASE_MACS : handleReleaseMacsCompensation ( ( ( org.ovirt.engine.core.common.businessentities.ReleaseMacsTransientCompensation ) ( entity ) ) ) ; break ; default : throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Unable to compensate type %s, please handle this compensation in command %s." , BusinessEntitySnapshot.SnapshotType.TRANSIENT_ENTITY , command ) ) ; } }

Target:
public void compensate ( java.lang.String commandType , org.ovirt.engine.core.common.businessentities.TransientCompensationBusinessEntity entity ) { switch ( entity.getTransientEntityType ( ) ) { case RELEASE_MACS : handleReleaseMacsCompensation ( ( ( org.ovirt.engine.core.common.businessentities.ReleaseMacsTransientCompensation ) ( entity ) ) ) ; break ; default : throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Unable to compensate type %s, please handle this compensation in command %s." , BusinessEntitySnapshot.SnapshotType.TRANSIENT_ENTITY , commandType ) ) ; } }
Source:
public void acquireLockWait ( org.ovirt.engine.core.utils.lock.EngineLock lock ) { org.ovirt.engine.core.bll.lock.InMemoryLockManager.log.debugFormat ( "Before acquiring and wait lock {0}" , lock ) ; validateLockForAcquireAndWait ( lock ) ; globalLock.lock ( ) ; try { while ( ! ( acquireLockInternal ( lock ) ) ) { org.ovirt.engine.core.bll.lock.InMemoryLockManager.log.infoFormat ( "Failed to acquire lock and wait lock {0}" , lock ) ; releasedLock.await ( ) ; } } catch ( java.lang.InterruptedException e ) { } finally { globalLock.unlock ( ) ; } }

Target:
public void acquireLockWait ( org.ovirt.engine.core.utils.lock.EngineLock lock ) { org.ovirt.engine.core.bll.lock.InMemoryLockManager.log.debugFormat ( "Before acquiring and wait lock {0}" , lock ) ; validateLockForAcquireAndWait ( lock ) ; globalLock.lock ( ) ; try { while ( ! ( acquireLockInternal ( lock ) . getFirst ( ) ) ) { org.ovirt.engine.core.bll.lock.InMemoryLockManager.log.infoFormat ( "Failed to acquire lock and wait lock {0}" , lock ) ; releasedLock.await ( ) ; } } catch ( java.lang.InterruptedException e ) { } finally { globalLock.unlock ( ) ; } }
Source:
protected org.ovirt.engine.core.dao.StorageServerConnectionDao setUpStorageServerConnectionDao ( ) { storageServerConnectionDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageServerConnectionDao.class ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getStorageServerConnectionDao ( ) ) . thenReturn ( storageServerConnectionDao ) ; return storageServerConnectionDao ; }

Target:
private void prepareMocks ( ) { vdsBrokerFrontendMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.interfaces.VDSBrokerFrontend.class ) ; org.mockito.Mockito.doReturn ( vdsBrokerFrontendMock ) . when ( getQuery ( ) ) . getVdsBroker ( ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getStorageServerConnectionDao ( ) ) . thenReturn ( storageServerConnectionDao ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getStorageServerConnectionLunMapDao ( ) ) . thenReturn ( storageServerConnectionLunMapDao ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getLunDao ( ) ) . thenReturn ( lunDao ) ; }