auphong2707/dl4se-code-review-dataset huggingface dataset:
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.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 getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
void updateStyles ( java.lang.Boolean isNarrowStyle ) { java.lang.String editorStyle = ( isNarrowStyle ) ? style.editorContentNarrow ( ) : style.editorContent ( ) ; updateEditorStyle ( diskAliasLabel , editorStyle ) ; updateEditorStyle ( diskAliasEditor , editorStyle ) ; updateEditorStyle ( diskSizeLabel , editorStyle ) ; updateEditorStyle ( sourceStorageLabel , editorStyle ) ; updateEditorStyle ( volumeTypeListEditor , editorStyle ) ; updateEditorStyle ( sourceStorageListEditor , editorStyle ) ; updateEditorStyle ( storageListEditor , editorStyle ) ; updateEditorStyle ( quotaListEditor , editorStyle ) ; }

Target:
void updateStyles ( java.lang.Boolean isNarrowStyle ) { java.lang.String editorStyle = style.editorContentNarrow ( ) ; updateEditorStyle ( diskAliasLabel , editorStyle ) ; updateEditorStyle ( diskAliasEditor , editorStyle ) ; updateEditorStyle ( diskSizeLabel , editorStyle ) ; updateEditorStyle ( sourceStorageLabel , editorStyle ) ; updateEditorStyle ( volumeTypeListEditor , editorStyle ) ; updateEditorStyle ( sourceStorageListEditor , editorStyle ) ; updateEditorStyle ( storageListEditor , editorStyle ) ; updateEditorStyle ( diskProfileListEditor , editorStyle ) ; updateEditorStyle ( quotaListEditor , editorStyle ) ; }
Source:
private void prepareMocks ( org.ovirt.engine.core.bll.RemoveExternalEventCommand < org.ovirt.engine.core.common.action.RemoveExternalEventParameters > command ) { org.mockito.Mockito.doReturn ( auditLogDAO ) . when ( command ) . getAuditLogDao ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( auditLogDAO ) . get ( org.ovirt.engine.core.bll.RemoveExternalEventCommandTest.EVENT_ID_1 ) ; org.mockito.Mockito.doReturn ( getEventWithOvirtOrigin ( ) ) . when ( auditLogDAO ) . get ( org.ovirt.engine.core.bll.RemoveExternalEventCommandTest.EVENT_ID_2 ) ; org.mockito.Mockito.doReturn ( getEventWithExternalOrigin ( ) ) . when ( auditLogDAO ) . get ( org.ovirt.engine.core.bll.RemoveExternalEventCommandTest.EVENT_ID_3 ) ; }

Target:
private void prepareMocks ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand < org.ovirt.engine.core.common.action.RemoveAuditLogByIdParameters > command ) { org.mockito.Mockito.doReturn ( auditLogDAO ) . when ( command ) . getAuditLogDao ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( auditLogDAO ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_1 ) ; org.mockito.Mockito.doReturn ( getEventWithOvirtOrigin ( ) ) . when ( auditLogDAO ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_2 ) ; org.mockito.Mockito.doReturn ( getEventWithExternalOrigin ( ) ) . when ( auditLogDAO ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_3 ) ; }
Source:
public java.lang.Boolean call ( ) { try { proxy.deleteVolume ( cinderDisk.getImageId ( ) . toString ( ) ) ; return true ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException ex ) { if ( ( ex.getStatus ( ) ) == ( org.apache.commons.httpclient.HttpStatus.SC_NOT_FOUND ) ) { return false ; } throw ex ; } }

Target:
public boolean deleteVolume ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { return execute ( ( ) -> { try { proxy.deleteVolume ( cinderDisk.getImageId ( ) . toString ( ) ) ; return true ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException ex ) { if ( ( ex.getStatus ( ) ) == ( org.apache.commons.httpclient.HttpStatus.SC_NOT_FOUND ) ) { return false ; } throw ex ; } } ) ; }
Source:
public static void getExternalProviderDiscoveredHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalDiscoveredHost > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , params , aQuery ) ; }

Target:
public static void isSupportBridgesReportByVDSM ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportBridgesReportByVDSM ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public static void getRpmVersion ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ) ) ; }

Target:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.ValidationResult slavesValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE_ENTITY , "slaveA" ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_NAME , "networkName" ) ) ; org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , slavesValidationResult , slavesValidationResult ) ; }
Source:
public void canDoActionFailsOnNoConflictServers ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.AddGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = getHookEntity ( ) ; setUpMocksForAdd ( true , hook ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnNoConflictServers ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.AddGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = getHookEntity ( ) ; setUpMocksForAdd ( true , hook ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS.toString ( ) ) ) ; }
Source:
public static void GetVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( vmId ) , aQuery ) ; }

Target:
public static boolean IsWindowsOsType ( org.ovirt.engine.core.common.businessentities.VmOsType osType ) { if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetWindowsOsTypes ( ) . contains ( osType ) ) { return true ; } return false ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { callback.asyncCallback.onSuccess ( callback.getModel ( ) , null ) ; } }

Target:
public void onSuccess ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Frontend: sucessfully executed runAction, determining result!" ) ; handleActionResult ( actionType , parameters , result , ( callback != null ? callback : org.ovirt.engine.ui.frontend.Frontend.NULLABLE_ASYNC_CALLBACK ) , state , showErrorDialog ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getPeers ( java.lang.String server , java.lang.String username , java.lang.String password , java.lang.String fingerprint ) throws java.io.IOException , javax.naming.AuthenticationException { org.ovirt.engine.core.utils.ssh.SSHClient client = null ; try { client = connect ( server ) ; authenticate ( client , username , password ) ; java.lang.String serversXml = executePeerStatusCommand ( client ) ; return getFingerprints ( extractServers ( serversXml ) ) ; } finally { if ( client != null ) { client.disconnect ( ) ; } } }

Target:
public java.util.Map < java.lang.String , java.lang.String > getPeers ( java.lang.String server , java.lang.String username , java.lang.String password , java.lang.String fingerprint ) throws java.io.IOException , javax.naming.AuthenticationException { try ( final org.ovirt.engine.core.utils.ssh.SSHClient client = getSSHClient ( ) ) { connect ( client , server ) ; authenticate ( client , username , password ) ; java.lang.String serversXml = executePeerStatusCommand ( client ) ; return getFingerprints ( extractServers ( serversXml ) ) ; } }
Source:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public static void getDataCentersByStorageDomain ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { getNetwork ( ) . setLabel ( getLabel ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( ActionType.UpdateNetwork , new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( getNetwork ( ) . getDataCenterId ( ) , getNetwork ( ) ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { propagateFailure ( result ) ; } org.ovirt.engine.core.bll.network.dc.LabelNetworkCommand.getReturnValue ( ) . setActionReturnValue ( getLabel ( ) ) ; setSucceeded ( result.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { getNetwork ( ) . setLabel ( getLabel ( ) ) ; org.ovirt.engine.core.common.action.ActionReturnValue result = runInternalAction ( ActionType.UpdateNetwork , new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( getNetwork ( ) . getDataCenterId ( ) , getNetwork ( ) ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { propagateFailure ( result ) ; } org.ovirt.engine.core.bll.network.dc.LabelNetworkCommand.getReturnValue ( ) . setActionReturnValue ( getLabel ( ) ) ; setSucceeded ( result.getSucceeded ( ) ) ; }
Source:
protected void initFrontend ( ) { super . initFrontend ( ) ; org.ovirt.engine.ui.frontend.Frontend.setLoginHandler ( new org.ovirt.engine.ui.frontend.FrontendLoginHandler ( ) { @ java.lang.Override public void onLoginSuccess ( final java.lang.String userName , final java.lang.String password , final java.lang.String domain ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { final java.lang.String domainToken = "@" ; restApiSessionManager.acquireSession ( ( userName.contains ( domainToken ) ? userName : ( userName + domainToken ) + domain ) , password ) ; } } ) ; } @ java.lang.Override public void onLogout ( ) { restApiSessionManager.releaseSession ( ) ; } } ) ; }

Target:
protected void initFrontend ( ) { super . initFrontend ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . setLoginHandler ( new org.ovirt.engine.ui.frontend.FrontendLoginHandler ( ) { @ java.lang.Override public void onLoginSuccess ( final java.lang.String userName , final java.lang.String password , final java.lang.String domain ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { final java.lang.String domainToken = "@" ; restApiSessionManager.acquireSession ( ( userName.contains ( domainToken ) ? userName : ( userName + domainToken ) + domain ) , password ) ; } } ) ; } @ java.lang.Override public void onLogout ( ) { restApiSessionManager.releaseSession ( ) ; } } ) ; }
Source:
public void testGetDiskAttachedToMultipleVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk > unregisteredDisk = dao.getByDiskIdAndStorageDomainId ( FixturesTool.UNREGISTERED_DISK3 , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; org.junit.Assert.assertTrue ( "Disk should exists in the UnregisteredDisks table" , ( ! ( unregisteredDisk.isEmpty ( ) ) ) ) ; org.junit.Assert.assertTrue ( "Disk should have multiple vms attached" , ( ( unregisteredDisk.get ( 0 ) . getVms ( ) . size ( ) ) > 1 ) ) ; }

Target:
public void testGetDiskAttachedToMultipleVms ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk > unregisteredDisk = dao.getByDiskIdAndStorageDomainId ( FixturesTool.UNREGISTERED_DISK3 , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; org.junit.Assert.assertTrue ( "Disk should exists in the UnregisteredDisks table" , ( ! ( unregisteredDisk.isEmpty ( ) ) ) ) ; org.junit.Assert.assertTrue ( "Disk should be attached to VM" , ( ( unregisteredDisk.get ( 0 ) . getVms ( ) . size ( ) ) == 1 ) ) ; }
Source:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public void getNetworkList ( 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 != 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.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private < T > void maybeSetSelectedItem ( org.ovirt.engine.ui.uicommonweb.models.ListModel < T > listModel , T value ) { if ( ( ( listModel != null ) && ( listModel.getIsChangable ( ) ) ) && ( listModel.getIsAvailable ( ) ) ) { listModel.setSelectedItem ( value ) ; } }

Target:
protected < T > void maybeSetSelectedItem ( org.ovirt.engine.ui.uicommonweb.models.ListModel < T > entityModel , T value ) { if ( ( alwaysEnabledFieldUpdate ) || ( ( ( entityModel != null ) && ( entityModel.getIsChangable ( ) ) ) && ( entityModel.getIsAvailable ( ) ) ) ) { entityModel.setSelectedItem ( value ) ; } }
Source:
public static void getUpHostListByCluster ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public static void getDefaultSpmPriority ( 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 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
public synchronized boolean StoragePoolHasUnclearedTasks ( org.ovirt.engine.core.compat.Guid storagePoolId ) { for ( org.ovirt.engine.core.bll.SPMAsyncTask task : _tasks.values ( ) ) { if ( ( ( ( task.getState ( ) ) != ( AsyncTaskState.Cleared ) ) && ( ( task.getState ( ) ) != ( AsyncTaskState.ClearFailed ) ) ) && ( task.getStoragePoolID ( ) . equals ( storagePoolId ) ) ) { return true ; } } return false ; }

Target:
public synchronized void StopStoragePoolTasks ( final org.ovirt.engine.core.common.businessentities.storage_pool sp ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "Attempting to get and stop tasks on storage pool '{0}'" , sp.getname ( ) ) ; AddStoragePoolExistingTasks ( sp ) ; java.util.List < org.ovirt.engine.core.bll.SPMAsyncTask > list = org.ovirt.engine.core.utils.linq.LinqUtils.filter ( _tasks.values ( ) , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.bll.SPMAsyncTask > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.bll.SPMAsyncTask a ) { return a.getStoragePoolID ( ) . equals ( sp.getId ( ) ) ; } } ) ; for ( org.ovirt.engine.core.bll.SPMAsyncTask task : list ) { task.stopTask ( ) ; } }
Source:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { 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.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }
Source:
public static org.ovirt.engine.core.compat.Guid getStorageDomainId ( org.ovirt.engine.api.restapi.resource.BackendResource resource , java.lang.String providerId ) { org.ovirt.engine.core.compat.Guid storageDomainId = null ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = resource.runQuery ( VdcQueryType.GetAllStorageDomains , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) . getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { java.lang.String storageId = storageDomain.getStorage ( ) ; if ( providerId.equals ( storageId ) ) { storageDomainId = storageDomain.getId ( ) ; break ; } } return storageDomainId ; }

Target:
public static org.ovirt.engine.core.compat.Guid getStorageDomainId ( org.ovirt.engine.api.restapi.resource.BackendResource resource , java.lang.String providerId ) { org.ovirt.engine.core.compat.Guid storageDomainId = null ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = resource.runQuery ( QueryType.GetAllStorageDomains , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) . getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { java.lang.String storageId = storageDomain.getStorage ( ) ; if ( providerId.equals ( storageId ) ) { storageDomainId = storageDomain.getId ( ) ; break ; } } return storageDomainId ; }
Source:
private static java.lang.String getPath ( java.lang.Class < ? > clz ) { for ( java.lang.reflect.Method method : org.ovirt.engine.api.resource.SystemResource.class . getMethods ( ) ) { if ( ( method.getReturnType ( ) ) == clz ) { javax.ws.rs.Path annotation = method.getAnnotation ( javax.ws.rs.Path.class ) ; if ( annotation != null ) { return annotation.value ( ) ; } } } org.ovirt.engine.api.utils.LinkHelper.log.error ( ( ( "Can\'t find relative path for class \"" + ( clz.getName ( ) ) ) + "\", will return null" ) ) ; return null ; }

Target:
private static java.lang.String getPath ( java.lang.Class < ? > clz ) { for ( java.lang.reflect.Method method : org.ovirt.engine.api.resource.SystemResource.class . getMethods ( ) ) { if ( ( method.getReturnType ( ) ) == clz ) { javax.ws.rs.Path annotation = method.getAnnotation ( javax.ws.rs.Path.class ) ; if ( annotation != null ) { return annotation.value ( ) ; } } } org.ovirt.engine.api.restapi.util.LinkHelper.log.error ( ( ( "Can\'t find relative path for class \"" + ( clz.getName ( ) ) ) + "\", will return null" ) ) ; return null ; }
Source:
public void clearErrorMessage ( ) { setErrorMessageHtml ( null ) ; errorMessagePanel.setVisible ( false ) ; }

Target:
public void setErrorMessages ( java.util.List < com.google.gwt.safehtml.shared.SafeHtml > messages ) { clearErrorMessages ( ) ; for ( com.google.gwt.safehtml.shared.SafeHtml message : messages ) { org.gwtbootstrap3.client.ui.Label messageLabel = new org.gwtbootstrap3.client.ui.Label ( ) ; messageLabel.setHTML ( message.asString ( ) ) ; messageLabel.addStyleName ( style.loginMessageError ( ) ) ; errorMessagePanel.add ( messageLabel ) ; errorMessagePanel.setVisible ( true ) ; } }
Source:
protected void executeCommand ( ) { if ( org.ovirt.engine.core.bll.RemoveVdsSpmIdCommand.getParameters ( ) . isCompensationEnabled ( ) ) { org.ovirt.engine.core.bll.RemoveVdsSpmIdCommand.getCompensationContext ( ) . snapshotEntity ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsSpmIdMapDAO ( ) . get ( org.ovirt.engine.core.bll.RemoveVdsSpmIdCommand.getVdsId ( ) ) ) ; } org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsSpmIdMapDAO ( ) . remove ( org.ovirt.engine.core.bll.RemoveVdsSpmIdCommand.getVdsId ( ) ) ; if ( org.ovirt.engine.core.bll.RemoveVdsSpmIdCommand.getParameters ( ) . isCompensationEnabled ( ) ) { org.ovirt.engine.core.bll.RemoveVdsSpmIdCommand.getCompensationContext ( ) . stateChanged ( ) ; } org.ovirt.engine.core.bll.RemoveVdsSpmIdCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { if ( org.ovirt.engine.core.bll.RemoveVdsSpmIdCommand.getParameters ( ) . isCompensationEnabled ( ) ) { org.ovirt.engine.core.bll.RemoveVdsSpmIdCommand.getCompensationContext ( ) . snapshotEntity ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsSpmIdMapDao ( ) . get ( org.ovirt.engine.core.bll.RemoveVdsSpmIdCommand.getVdsId ( ) ) ) ; } org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsSpmIdMapDao ( ) . remove ( org.ovirt.engine.core.bll.RemoveVdsSpmIdCommand.getVdsId ( ) ) ; if ( org.ovirt.engine.core.bll.RemoveVdsSpmIdCommand.getParameters ( ) . isCompensationEnabled ( ) ) { org.ovirt.engine.core.bll.RemoveVdsSpmIdCommand.getCompensationContext ( ) . stateChanged ( ) ; } org.ovirt.engine.core.bll.RemoveVdsSpmIdCommand.setSucceeded ( true ) ; }
Source:
public void testGetClustersHavingHosts ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = ( ( org.ovirt.engine.core.dao.ClusterDaoImpl ) ( dao ) ) . getClustersHavingHosts ( ) ; org.junit.Assert.assertNotNull ( clusters ) ; org.junit.Assert.assertThat ( clusters , org.hamcrest.Matchers.hasSize ( 4 ) ) ; }

Target:
public void testGetClustersByServiceAndCompatibilityVersion ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = dao.getClustersByServiceAndCompatibilityVersion ( true , false , "2.3" ) ; org.junit.Assert.assertNotNull ( clusters ) ; org.junit.Assert.assertEquals ( 1 , clusters.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.GLUSTER_CLUSTER_ID , clusters.get ( 0 ) . getId ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult interfaceAlreadyLabeledWith ( java.lang.String label ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.INTERFACE_ALREADY_LABELED ) . when ( ( ( org.ovirt.engine.core.utils.NetworkUtils.isLabeled ( iface ) ) && ( iface.getLabels ( ) . contains ( label ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult interfaceAlreadyLabeledWith ( java.lang.String label ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.INTERFACE_ALREADY_LABELED , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.HostInterfaceValidator.VAR_LABELED_NIC , iface.getName ( ) ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.HostInterfaceValidator.VAR_NIC_LABEL , label ) ) . when ( ( ( org.ovirt.engine.core.utils.NetworkUtils.isLabeled ( iface ) ) && ( iface.getLabels ( ) . contains ( label ) ) ) ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.StorageDomain a ) { return ( ( ( ( a.getstorage_domain_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) && ( ( a.getstorage_domain_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) && ( ( a.getstatus ( ) ) != null ) ) && ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.StorageDomain a ) { return ( ( ( ( a.getStorageDomainType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) && ( ( a.getStorageDomainType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) && ( ( a.getStatus ( ) ) != null ) ) && ( ( a.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ; }
Source:
private static void resetDisplay ( org.ovirt.engine.api.model.BaseResource res ) { if ( res instanceof org.ovirt.engine.api.model.VM ) { ( ( org.ovirt.engine.api.model.VM ) ( res ) ) . setDisplay ( null ) ; } if ( res instanceof org.ovirt.engine.api.model.Template ) { ( ( org.ovirt.engine.api.model.Template ) ( res ) ) . setDisplay ( null ) ; } }

Target:
private static void resetDisplay ( org.ovirt.engine.api.model.BaseResource res ) { if ( res instanceof org.ovirt.engine.api.model.Vm ) { ( ( org.ovirt.engine.api.model.Vm ) ( res ) ) . setDisplay ( null ) ; } if ( res instanceof org.ovirt.engine.api.model.Template ) { ( ( org.ovirt.engine.api.model.Template ) ( res ) ) . setDisplay ( null ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel diskViewType = ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) ; disksViewRadioGroup.setDiskStorageType ( ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType ) ( diskViewType.getEntity ( ) ) ) ) ; onDiskViewTypeChanged ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel diskViewType = ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) ; disksViewRadioGroup.setDiskStorageType ( ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType ) ( diskViewType.getEntity ( ) ) ) ) ; if ( ( commonModel.getSelectedItem ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.disks.DiskListModel ) { onDiskViewTypeChanged ( ) ; } }
Source:
private void changeRawToCowIfSparseOnBlockDevice ( org.ovirt.engine.core.common.businessentities.StorageType storageType , org.ovirt.engine.core.common.businessentities.DiskImage image ) { if ( ( ( ( storageType == ( org.ovirt.engine.core.common.businessentities.StorageType.FCP ) ) || ( storageType == ( org.ovirt.engine.core.common.businessentities.StorageType.ISCSI ) ) ) && ( ( image.getvolume_format ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ) ) ) && ( ( image.getvolume_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) { image.setvolume_format ( VolumeFormat.COW ) ; } }

Target:
private void changeRawToCowIfSparseOnBlockDevice ( org.ovirt.engine.core.common.businessentities.StorageType storageType , org.ovirt.engine.core.common.businessentities.DiskImage image ) { if ( ( ( ( storageType == ( org.ovirt.engine.core.common.businessentities.StorageType.FCP ) ) || ( storageType == ( org.ovirt.engine.core.common.businessentities.StorageType.ISCSI ) ) ) && ( ( image.getVolumeFormat ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ) ) ) && ( ( image.getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) { image.setvolumeFormat ( VolumeFormat.COW ) ; } }
Source:
private boolean isStorageDomainValid ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.ImageType imageType , boolean forceRefresh ) { if ( storageDomainId == null ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.error ( "Storage domain ID received from command query is null." ) ; return false ; } if ( ! ( refreshRepos ( storageDomainId , imageType , forceRefresh ) ) ) { return false ; } return true ; }

Target:
private boolean isStorageDomainValid ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.ImageFileType imageType , boolean forceRefresh ) { if ( storageDomainId == null ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.error ( "Storage domain ID received from command query is null." ) ; return false ; } if ( ! ( refreshRepos ( storageDomainId , imageType , forceRefresh ) ) ) { return false ; } return true ; }
Source:
private org.ovirt.engine.core.compat.Guid getDiskProfileId ( ) { if ( ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) != null ) && ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) == ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) ) ) { return getDiskImageInfo ( ) . getDiskProfileId ( ) ; } return null ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( getDiskImageInfo ( ) , getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.AddDiskCommand.getStoragePool ( ) . getcompatibility_version ( ) ) ) ; }
Source:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) , aQuery ) ; }
Source:
public void testRemoveForced ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVds , org.ovirt.engine.core.common.action.RemoveVdsParameters.class , new java.lang.String [ ] { "VdsId" , "ForceAction" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.TRUE } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setForce ( true ) ; verifyRemove ( resource.remove ( action ) ) ; }

Target:
public void testRemoveForced ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveVds , org.ovirt.engine.core.common.action.RemoveVdsParameters.class , new java.lang.String [ ] { "VdsId" , "ForceAction" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.TRUE } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendHostResource.FORCE , java.lang.Boolean.TRUE.toString ( ) ) ; setUriInfo ( uriInfo ) ; control.replay ( ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.UpdateVmPoolCommand.getVmPoolId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_POOL , getVmPoolIsBeingUpdatedMessage ( ) ) ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.UpdateVmPoolCommand.getVmPoolId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_POOL , new org.ovirt.engine.core.bll.LockMessage ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_POOL_IS_BEING_UPDATED ) . withOptional ( "VmPoolName" , ( ( org.ovirt.engine.core.bll.UpdateVmPoolCommand.getVmPool ( ) ) != null ? org.ovirt.engine.core.bll.UpdateVmPoolCommand.getVmPool ( ) . getName ( ) : null ) ) ) ) ; }
Source:
public void testMissingSuperFieldAlternatives ( ) { org.ovirt.engine.api.model.Permission permission = new org.ovirt.engine.api.model.Permission ( ) ; permission.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( permission , "user|vm.name" ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Permission" , "user|vm.name" ) ; } }

Target:
public void testMissingSuperFieldAlternatives ( ) { org.ovirt.engine.api.model.Permission permission = new org.ovirt.engine.api.model.Permission ( ) ; permission.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( permission , "user|vm.name" ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Permission" , "user|vm.name" ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setstatus ( VMStatus.Down ) ; vm.setguest_os ( "rhel6" ) ; vm.setId ( vmId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( command , vmDAO ) ; mockGetForDisk ( vm ) ; mockGetVmsListForDisk ( vm ) ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = mockStoragePool ( Version.v3_1 ) ; vm.setstorage_pool_id ( storagePool.getId ( ) ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusDown ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setstatus ( VMStatus.Down ) ; vm.setguest_os ( "rhel6" ) ; vm.setId ( vmId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( command , vmDAO ) ; mockGetForDisk ( vm ) ; mockGetVmsListForDisk ( vm ) ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = mockStoragePool ( Version.v3_1 ) ; vm.setstorage_pool_id ( storagePool.getId ( ) ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; return vm ; }
Source:
protected boolean setAndValidateDiskProfiles ( ) { return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getCurrentUser ( ) ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { return validate ( diskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getCurrentUser ( ) ) ) ; }
Source:
public void networkExists ( ) { simulateClusterExists ( ) ; org.mockito.Mockito.when ( mockNetworkDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getNetwork ( ) ) ; org.mockito.Mockito.when ( mockNetworkClusterDao.get ( param.getNetworkCluster ( ) . getId ( ) ) ) . thenReturn ( param.getNetworkCluster ( ) ) ; assertValidateFailure ( EngineMessage.NETWORK_ALREADY_ATTACHED_TO_CLUSTER.toString ( ) ) ; }

Target:
public void networkExists ( ) { simulateClusterExists ( ) ; org.mockito.Mockito.when ( mockNetworkDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getNetwork ( ) ) ; org.mockito.Mockito.when ( mockNetworkClusterDao.get ( param.getNetworkCluster ( ) . getId ( ) ) ) . thenReturn ( param.getNetworkCluster ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( underTest , EngineMessage.NETWORK_ALREADY_ATTACHED_TO_CLUSTER ) ; }
Source:
public void mockDbFacadeAndDao ( ) { vdsDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDao.class ) ; org.mockito.Mockito.when ( vdsDao.getAllForClusterWithStatus ( CLUSTER_ID , VDSStatus.Up ) ) . thenReturn ( mockGetAllVdsForwithStatus ( VDSStatus.Up ) ) ; clusterUtils = org.mockito.Mockito.spy ( org.ovirt.engine.core.bll.utils.ClusterUtils.getInstance ( ) ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( clusterUtils ) . getVdsDao ( ) ; }

Target:
public void mockDbFacadeAndDao ( ) { vdsDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDao.class ) ; org.mockito.Mockito.when ( vdsDao.getAllForClusterWithStatusAndPeerStatus ( CLUSTER_ID , VDSStatus.Up , PeerStatus.CONNECTED ) ) . thenReturn ( mockGetAllVdsForwithStatus ( VDSStatus.Up ) ) ; clusterUtils = org.mockito.Mockito.spy ( org.ovirt.engine.core.bll.utils.ClusterUtils.getInstance ( ) ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( clusterUtils ) . getVdsDao ( ) ; }
Source:
public void finishSshSoftFencingExecution ( org.ovirt.engine.core.common.businessentities.VDS vds ) { mUnrespondedAttempts.set ( 0 ) ; setStatus ( VDSStatus.Connecting , vds ) ; updateDynamicData ( vds.getDynamicData ( ) ) ; }

Target:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( cachedVds.getStatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debug ( "Failed to refresh VDS, network error, continuing, vds='{}'({}): {}" , cachedVds.getName ( ) , cachedVds.getId ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warn ( "Failed to refresh VDS, network error, continuing, vds='{}'({}): {}" , cachedVds.getName ( ) , cachedVds.getId ( ) , e.getMessage ( ) ) ; } org.ovirt.engine.core.vdsbroker.VdsManager.log.debug ( "Exception" , e ) ; }