auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; clusterGuideModel.hosts = hosts ; clusterGuideModel.UpdateOptionsNonLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; clusterGuideModel.hosts = hosts ; clusterGuideModel.UpdateOptionsNonLocalFS ( ) ; }
Source:
protected void postSaveAction ( org.ovirt.engine.core.compat.Guid networkGuid , boolean succeeded ) { if ( succeeded ) { if ( ( ( java.lang.Boolean ) ( getIsVmNetwork ( ) . getEntity ( ) ) ) ) { performProfilesActions ( networkGuid ) ; stopProgress ( ) ; } else { stopProgress ( ) ; cancel ( ) ; } } }

Target:
protected void postSaveAction ( org.ovirt.engine.core.compat.Guid networkGuid , boolean succeeded ) { if ( succeeded ) { performProfilesActions ( networkGuid ) ; stopProgress ( ) ; cancel ( ) ; } }
Source:
private void updateDirectLunDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { if ( ( getDiskStorageType ( ) . getEntity ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { return ; } boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.DirectLUNDiskEnabled , datacenter.getCompatibilityVersion ( ) . getValue ( ) ) ) ) ; getIsDirectLunDiskAvaialable ( ) . setEntity ( isDirectLUNDiskkEnabled ) ; setMessage ( ( ! isDirectLUNDiskkEnabled ? org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.directLUNDiskNotSupported ( ) : "" ) ) ; getIsModelDisabled ( ) . setEntity ( ( ! isDirectLUNDiskkEnabled ) ) ; }

Target:
private void updateDirectLunDiskEnabled ( ) { if ( ( getDiskStorageType ( ) . getEntity ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { return ; } getIsDirectLunDiskAvaialable ( ) . setEntity ( true ) ; setMessage ( "" ) ; getIsModelDisabled ( ) . setEntity ( false ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.StorageConnection conn ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections entity = org.ovirt.engine.api.restapi.types.StorageDomainMapper.map ( conn , null ) ; org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond = getIscsiBond ( ) ; iscsiBond.getStorageConnectionIds ( ) . add ( entity.getid ( ) ) ; return performAction ( VdcActionType.EditIscsiBond , new org.ovirt.engine.core.common.action.EditIscsiBondParameters ( iscsiBond ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.StorageConnection conn ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections entity = org.ovirt.engine.api.restapi.types.StorageDomainMapper.map ( conn , null ) ; org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond = getIscsiBond ( ) ; iscsiBond.getStorageConnectionIds ( ) . add ( entity.getId ( ) ) ; return performAction ( VdcActionType.EditIscsiBond , new org.ovirt.engine.core.common.action.EditIscsiBondParameters ( iscsiBond ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.OpenStackNetworkProvider provider ) { validateParameters ( provider , "name" ) ; validateEnums ( org.ovirt.engine.api.model.OpenStackNetworkProvider.class , provider ) ; return performCreate ( VdcActionType.AddProvider , new org.ovirt.engine.core.common.action.ProviderParameters ( map ( provider ) ) , new org.ovirt.engine.api.restapi.resource.openstack.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetProviderById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.OpenStackNetworkProvider provider ) { validateParameters ( provider , "name" ) ; return performCreate ( VdcActionType.AddProvider , new org.ovirt.engine.core.common.action.ProviderParameters ( map ( provider ) ) , new org.ovirt.engine.api.restapi.resource.openstack.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetProviderById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public void testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; setUpGetStorageDomainsQueryExpectations ( 1 ) ; control.replay ( ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; control.replay ( ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }
Source:
public void testAllocateVm ( ) throws java.lang.Exception { setUpGetVmExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AttachUserToVmFromPoolAndRun , org.ovirt.engine.core.common.action.AttachUserToVmFromPoolAndRunParameters.class , new java.lang.String [ ] { "VmPoolId" , "Internal" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , GUIDS [ 0 ] ) ) ; verifyTestAllocateVmActionResponse ( resource.allocateVm ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testAllocateVm ( ) throws java.lang.Exception { setUpGetVmExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AttachUserToVmFromPoolAndRun , org.ovirt.engine.core.common.action.AttachUserToVmFromPoolAndRunParameters.class , new java.lang.String [ ] { "VmPoolId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , GUIDS [ 0 ] ) ) ; verifyTestAllocateVmActionResponse ( resource.allocateVm ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
private boolean canScheduleVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.List < org.ovirt.engine.core.compat.Guid > blacklist = new java.util.ArrayList < > ( ) ; if ( ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) != null ) { blacklist.add ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) ; } return schedulingManager.canSchedule ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getCluster ( ) , vm , blacklist , java.util.Collections.< org.ovirt.engine.core.compat.Guid > emptyList ( ) , vm.getDedicatedVmForVdsList ( ) , new java.util.ArrayList < > ( ) ) ; }

Target:
private boolean canScheduleVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.List < org.ovirt.engine.core.compat.Guid > blacklist = new java.util.ArrayList < > ( ) ; if ( ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) != null ) { blacklist.add ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) ; } return schedulingManager.canSchedule ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getCluster ( ) , vm , blacklist , java.util.Collections.< org.ovirt.engine.core.compat.Guid > emptyList ( ) , new java.util.ArrayList < > ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VmDevice generateNewEntity ( ) { java.util.Map < java.lang.String , java.lang.String > customProp = new java.util.LinkedHashMap < > ( ) ; customProp.put ( "prop1" , "value1" ) ; return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.dao.VmDeviceDAOTest.EXISTING_VM_ID ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , "floppy" , "type:'drive', controller:'0', bus:'0', unit:'1'" , 2 , new java.util.HashMap < java.lang.String , java.lang.Object > ( ) , true , false , false , "alias" , customProp , null ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmDevice generateNewEntity ( ) { java.util.Map < java.lang.String , java.lang.String > customProp = new java.util.LinkedHashMap < > ( ) ; customProp.put ( "prop1" , "value1" ) ; return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.dao.VmDeviceDAOTest.EXISTING_VM_ID ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , "floppy" , "type:'drive', controller:'0', bus:'0', unit:'1'" , 2 , new java.util.HashMap < java.lang.String , java.lang.Object > ( ) , true , false , false , "alias" , customProp , null , null ) ; }
Source:
protected void addVmNetwork ( ) { org.ovirt.engine.core.bll.network.vm.VnicProfileHelper vnicProfileHelper = new org.ovirt.engine.core.bll.network.vm.VnicProfileHelper ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVdsGroupId ( ) , getStoragePoolId ( ) , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVdsGroup ( ) . getcompatibility_version ( ) , org.ovirt.engine.core.common.AuditLogType.ADD_VM_FROM_SNAPSHOT_INVALID_INTERFACES ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : vmFromConfiguration.getInterfaces ( ) ) { vnicProfileHelper.updateNicWithVnicProfileForUser ( iface , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getCurrentUser ( ) . getUserId ( ) ) ; } vnicProfileHelper.auditInvalidInterfaces ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVmName ( ) ) ; super . addVmNetwork ( ) ; }

Target:
protected void addVmNetwork ( ) { org.ovirt.engine.core.bll.network.vm.VnicProfileHelper vnicProfileHelper = new org.ovirt.engine.core.bll.network.vm.VnicProfileHelper ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVdsGroupId ( ) , getStoragePoolId ( ) , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVdsGroup ( ) . getcompatibility_version ( ) , org.ovirt.engine.core.common.AuditLogType.ADD_VM_FROM_SNAPSHOT_INVALID_INTERFACES ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : vmFromConfiguration.getInterfaces ( ) ) { vnicProfileHelper.updateNicWithVnicProfileForUser ( iface , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getCurrentUser ( ) . getId ( ) ) ; } vnicProfileHelper.auditInvalidInterfaces ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVmName ( ) ) ; super . addVmNetwork ( ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VdsNetworkInterface getSlave ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface entity = new org.ovirt.engine.core.common.businessentities.VdsNetworkInterface ( ) ; entity.setId ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SLAVE_GUID ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SLAVE_NAME ) ; entity.setNetworkName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NETWORK_NAME ) ; entity.setBondName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_NAME ) ; entity.setBootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.BOOT_PROTOCOL ) ; return org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpStatistics ( entity , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SLAVE_GUID ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getSlave ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; entity.setId ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SLAVE_GUID ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SLAVE_NAME ) ; entity.setNetworkName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NETWORK_NAME ) ; entity.setBondName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_NAME ) ; entity.setBootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.BOOT_PROTOCOL ) ; return org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpStatistics ( entity , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.SLAVE_GUID ) ; }
Source:
protected org.ovirt.engine.ui.common.widget.table.SimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > createActionTable ( ) { return new org.ovirt.engine.ui.userportal.widget.table.column.UserPortalSimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > ( modelProvider , getTableResources ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.instance ( ) . getEventBus ( ) , new org.ovirt.engine.ui.userportal.widget.refresh.UserPortalRefreshManager ( modelProvider , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.instance ( ) . getEventBus ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.instance ( ) . getClientStorage ( ) ) ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.table.SimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > createActionTable ( ) { return new org.ovirt.engine.ui.userportal.widget.table.column.UserPortalSimpleActionTable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > ( modelProvider , getTableResources ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getEventBus ( ) , new org.ovirt.engine.ui.userportal.widget.refresh.UserPortalRefreshManager ( modelProvider , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getEventBus ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getClientStorage ( ) ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( boolean active ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage di = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; di.setActive ( true ) ; di.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setParentId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setImageStatus ( ImageStatus.OK ) ; return di ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( boolean active ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage di = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; di.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setParentId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; di.setImageStatus ( ImageStatus.OK ) ; di.setActive ( active ) ; return di ; }
Source:
private void failover ( ) { if ( ( ( ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.getParameters ( ) . getIgnoreFailoverLimit ( ) ) || ( ( _failoverCounter ) < ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.SpmCommandFailOverRetries ) ) - 1 ) ) ) && ( getCurrentIrsProxyData ( ) . getHasVdssForSpmSelection ( ) ) ) && ( getCurrentIrsProxyData ( ) . Failover ( ) ) ) { ( _failoverCounter ) ++ ; org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.ExecuteCommand ( ) ; } else { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; } }

Target:
private void failover ( ) { if ( ( ( ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.getParameters ( ) . getIgnoreFailoverLimit ( ) ) || ( ( _failoverCounter ) < ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.SpmCommandFailOverRetries ) ) - 1 ) ) ) && ( getCurrentIrsProxyData ( ) . getHasVdssForSpmSelection ( ) ) ) && ( getCurrentIrsProxyData ( ) . failover ( ) ) ) { ( _failoverCounter ) ++ ; org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.ExecuteCommand ( ) ; } else { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; } }
Source:
public void saveNewSanStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel sanStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( model.getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.businessentities.VDS host = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( model.getHost ( ) . getSelectedItem ( ) ) ) ; java.util.ArrayList < java.lang.String > usedLunsMessages = sanStorageModel.getUsedLunsMessages ( ) ; if ( usedLunsMessages.isEmpty ( ) ) { onSaveSanStorage ( ) ; } else { forceCreationWarning ( usedLunsMessages ) ; } }

Target:
public void saveNewSanStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel sanStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( model.getSelectedItem ( ) ) ) ; java.util.ArrayList < java.lang.String > usedLunsMessages = sanStorageModel.getUsedLunsMessages ( ) ; if ( usedLunsMessages.isEmpty ( ) ) { onSaveSanStorage ( ) ; } else { forceCreationWarning ( usedLunsMessages ) ; } }
Source:
protected boolean isVmRunningOnNonDefaultVds ( ) { return ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDedicatedVmForVdsList ( ) . isEmpty ( ) ) == false ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDedicatedVmForVdsList ( ) . contains ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getRunOnVds ( ) ) ) == false ) ; }

Target:
protected boolean isVmRunningOnNonDefaultVds ( ) { return ( ! ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDedicatedVmForVdsList ( ) . isEmpty ( ) ) ) && ( ! ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDedicatedVmForVdsList ( ) . contains ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getRunOnVds ( ) ) ) ) ; }
Source:
public static boolean haveSameElements ( java.util.Collection < ? > c1 , java.util.Collection < ? > c2 ) { if ( ( c1 == null ) && ( c2 == null ) ) { return true ; } if ( ( ( c1 == null ) || ( c2 == null ) ) || ( ( c1.size ( ) ) != ( c2.size ( ) ) ) ) { return false ; } return ( c1.containsAll ( c2 ) ) && ( c2.containsAll ( c1 ) ) ; }

Target:
public static boolean haveSameElements ( java.util.Collection < ? > c1 , java.util.Collection < ? > c2 ) { if ( ( c1 == null ) && ( c2 == null ) ) { return true ; } if ( ( ( c1 == null ) || ( c2 == null ) ) || ( ( c1.size ( ) ) != ( c2.size ( ) ) ) ) { return false ; } return c1.containsAll ( c2 ) ; }
Source:
public java.lang.String generateId ( org.ovirt.engine.api.model.Version v ) { org.ovirt.engine.core.compat.NGuid guid = new org.ovirt.engine.core.compat.NGuid ( ( ( ( v.getMajor ( ) ) + "." ) + ( v.getMinor ( ) ) ) . getBytes ( ) , true ) ; return guid.toString ( ) ; }

Target:
public java.lang.String generateId ( org.ovirt.engine.api.model.Version v ) { org.ovirt.engine.core.compat.Guid guid = new org.ovirt.engine.core.compat.Guid ( ( ( ( v.getMajor ( ) ) + "." ) + ( v.getMinor ( ) ) ) . getBytes ( ) , true ) ; return guid.toString ( ) ; }
Source:
private java.util.List < org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback > verifyRunAction ( int exepectedNumOfRunActionExecutions , boolean waitForResult ) { org.mockito.Mockito.verify ( frontend , org.mockito.Mockito.times ( exepectedNumOfRunActionExecutions ) ) . runMultipleAction ( org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.ui.uicommonweb.action.ACTION_TYPE ) , org.mockito.ArgumentMatchers.anyListOf ( org.ovirt.engine.core.common.action.ActionParametersBase.class ) , callbackCaptor.capture ( ) , org.mockito.ArgumentMatchers.eq ( false ) , org.mockito.ArgumentMatchers.eq ( waitForResult ) ) ; return callbackCaptor.getAllValues ( ) ; }

Target:
private java.util.List < org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback > verifyRunAction ( int exepectedNumOfRunActionExecutions , boolean waitForResult ) { org.mockito.Mockito.verify ( frontend , org.mockito.Mockito.times ( exepectedNumOfRunActionExecutions ) ) . runMultipleAction ( org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.ui.uicommonweb.action.ACTION_TYPE ) , org.mockito.ArgumentMatchers.any ( ) , callbackCaptor.capture ( ) , org.mockito.ArgumentMatchers.eq ( false ) , org.mockito.ArgumentMatchers.eq ( waitForResult ) ) ; return callbackCaptor.getAllValues ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createPosixConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.StorageType type , java.lang.String vfsType , java.lang.String mountOptions ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( id , connection , type ) ; connectionDetails.setVfsType ( vfsType ) ; connectionDetails.setMountOptions ( mountOptions ) ; return connectionDetails ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createPosixConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.StorageType type , java.lang.String vfsType , java.lang.String mountOptions ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( connection , type ) ; connectionDetails.setVfsType ( vfsType ) ; connectionDetails.setMountOptions ( mountOptions ) ; return connectionDetails ; }
Source:
public static org.ovirt.engine.api.model.RngSources mapRngSources ( java.util.Collection < org.ovirt.engine.core.common.businessentities.VmRngDevice.Source > entity , org.ovirt.engine.api.model.RngSources template ) { org.ovirt.engine.api.model.RngSources result = ( template == null ) ? new org.ovirt.engine.api.model.RngSources ( ) : template ; if ( entity != null ) { for ( org.ovirt.engine.core.common.businessentities.VmRngDevice.Source source : entity ) { org.ovirt.engine.api.model.RngSource restSource = org.ovirt.engine.api.restapi.types.RngDeviceMapper.map ( source , null ) ; result.getRngSources ( ) . add ( restSource.name ( ) ) ; } } return result ; }

Target:
public static java.util.List < java.lang.String > mapRngSources ( java.util.Collection < org.ovirt.engine.core.common.businessentities.VmRngDevice.Source > entity ) { java.util.List < java.lang.String > result = new java.util.ArrayList ( ( entity != null ? entity.size ( ) : 0 ) ) ; if ( entity != null ) { for ( org.ovirt.engine.core.common.businessentities.VmRngDevice.Source source : entity ) { org.ovirt.engine.api.model.RngSource restSource = org.ovirt.engine.api.restapi.types.RngDeviceMapper.map ( source , null ) ; result.add ( restSource.name ( ) ) ; } } return result ; }
Source:
public void bootProtocolChangedOverBond ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , net.getName ( ) ) ; bond.setBootProtocol ( NetworkBootProtocol.None ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = createNics ( bond.getName ( ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; bond.setBootProtocol ( NetworkBootProtocol.Dhcp ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }

Target:
public void bootProtocolChangedOverBond ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , net.getName ( ) ) ; bond.setBootProtocol ( NetworkBootProtocol.None ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = createNics ( bond.getName ( ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; bond.setBootProtocol ( NetworkBootProtocol.Dhcp ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ) ) ; if ( vm != null ) { updateAppListFromVm ( vm ) ; } } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ) ) ; if ( vm != null ) { updateAppListFromVm ( vm ) ; } } }
Source:
private void updateCanSpecify ( ) { boolean isChangable = ( bootProtocolsAvailable ) && ( getIsStaticAddress ( ) ) ; getAddress ( ) . setChangeProhibitionReason ( ( isChangable && ( ! ( staticIpChangeAllowed ) ) ? org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . staticIpAddressSameAsHostname ( ) : null ) ) ; getAddress ( ) . setIsChangable ( ( isChangable && ( staticIpChangeAllowed ) ) ) ; getSubnet ( ) . setIsChangable ( isChangable ) ; getGateway ( ) . setIsChangable ( isChangable ) ; getCustomPropertiesModel ( ) . setIsChangable ( bootProtocolsAvailable ) ; }

Target:
private void updateCanSpecify ( ) { boolean isChangable = ( bootProtocolsAvailable ) && ( getIsStaticAddress ( ) ) ; getAddress ( ) . setChangeProhibitionReason ( ( isChangable && ( ! ( staticIpChangeAllowed ) ) ? org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . staticIpAddressSameAsHostname ( ) : null ) ) ; getAddress ( ) . setIsChangable ( ( isChangable && ( staticIpChangeAllowed ) ) ) ; getSubnet ( ) . setIsChangable ( isChangable ) ; getGateway ( ) . setIsChangable ( isChangable ) ; }
Source:
public void executeCommandWhenFailed ( ) { setUpMocksForAdd ( ) ; mockBackend ( false , EngineError.GlusterHookAddFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . removeGlusterServerHook ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_ADD_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommandWhenFailed ( ) { setUpMocksForAdd ( ) ; mockBackend ( false , EngineError.GlusterHookAddFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . removeGlusterServerHook ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_ADD_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > ( ) { @ java.lang.Override public org.ovirt.engine.api.model.Disk lookupEntity ( org.ovirt.engine.core.compat.Guid guid ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { return collection.lookupEntity ( guid ) ; } } ; org.ovirt.engine.api.restapi.resource.DiskStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.DiskStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Disk , org.ovirt.engine.api.model.Disk > ( entityType , guid , query ) ) ; }

Target:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > ( ) { @ java.lang.Override public org.ovirt.engine.api.model.Disk lookupEntity ( org.ovirt.engine.core.compat.Guid guid ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { return collection.lookupEntity ( guid ) ; } } ; org.ovirt.engine.api.restapi.resource.DiskStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.DiskStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource ( entityType , guid , query ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vmList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.compat.Guid > vmIds = getAffinityGroup ( ) . getEntityIds ( ) ; getVmsSelectionModel ( ) . init ( vmList , ( vmIds != null ? vmIds : new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList ) { java.util.List < org.ovirt.engine.core.compat.Guid > vmIds = getAffinityGroup ( ) . getEntityIds ( ) ; getVmsSelectionModel ( ) . init ( vmList , ( vmIds != null ? vmIds : new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ) ; stopProgress ( ) ; }
Source:
private void addSupportedQosTypes ( org.ovirt.engine.api.model.VersionCaps version ) { version.setQosTypes ( new org.ovirt.engine.api.model.QosTypes ( ) ) ; if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_3 ) ) { addQosTypes ( version , QosType.NETWORK ) ; } if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_5 ) ) { addQosTypes ( version , QosType.STORAGE , QosType.CPU ) ; } if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_6 ) ) { addQosTypes ( version , QosType.HOSTNETWORK ) ; } }

Target:
private void addSupportedQosTypes ( org.ovirt.engine.api.model.VersionCaps version ) { version.setQosTypes ( new org.ovirt.engine.api.model.QosTypes ( ) ) ; addQosTypes ( version , QosType.NETWORK ) ; if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_5 ) ) { addQosTypes ( version , QosType.STORAGE , QosType.CPU ) ; } if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_6 ) ) { addQosTypes ( version , QosType.HOSTNETWORK ) ; } }
Source:
public void validateNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void validateNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
private org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator initValidator ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = addNewNetworkToDaoMock ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createNic ( HostSetupNetworksValidator.VAR_INTERFACE_NAME ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( network , vdsNetworkInterface , null ) ; org.mockito.Mockito.when ( networkAttachmentDaoMock.get ( networkAttachment.getId ( ) ) ) . thenReturn ( networkAttachment ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addNetworkAttachments ( networkAttachment ) ) . addNetworks ( network ) . addExistingInterfaces ( vdsNetworkInterface ) . build ( ) ; return validator ; }

Target:
private org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator initValidator ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = addNewNetworkToDaoMock ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createNic ( HostSetupNetworksValidator.VAR_INTERFACE_NAME ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( network , vdsNetworkInterface , null ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addNetworkAttachments ( networkAttachment ) ) . addNetworks ( network ) . addExistingInterfaces ( vdsNetworkInterface ) . build ( ) ; return validator ; }
Source:
public void setDefaultNames1 ( ) { org.ovirt.engine.core.common.businessentities.VDS host = context.host ; if ( ( host.getStoragePoolId ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDataCenterById ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.hostDataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; setDefaultNames2 ( ) ; } } , frontendHash ) , host.getStoragePoolId ( ) ) ; } else { setDefaultNames2 ( ) ; } }

Target:
public void setDefaultNames1 ( ) { org.ovirt.engine.core.common.businessentities.VDS host = context.host ; if ( ( host.getStoragePoolId ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDataCenterById ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.hostDataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; setDefaultNames2 ( ) ; } } , frontendHash ) , host.getStoragePoolId ( ) ) ; } else { setDefaultNames2 ( ) ; } }
Source:
public void init ( ) { org.mockito.Mockito.doReturn ( clusterDao ) . when ( tasksSyncJob ) . getClusterDao ( ) ; org.mockito.Mockito.doReturn ( getClusters ( ) ) . when ( clusterDao ) . getAll ( ) ; org.mockito.Mockito.doReturn ( provider ) . when ( tasksSyncJob ) . getProvider ( ) ; org.mockito.Mockito.doReturn ( stepDao ) . when ( tasksSyncJob ) . getStepDao ( ) ; org.mockito.Mockito.doReturn ( volumeDao ) . when ( tasksSyncJob ) . getVolumeDao ( ) ; org.mockito.Mockito.doReturn ( taskUtils ) . when ( tasksSyncJob ) . getGlusterTaskUtils ( ) ; }

Target:
public void init ( ) { org.mockito.Mockito.doReturn ( getClusters ( ) ) . when ( clusterDao ) . getAll ( ) ; org.mockito.Mockito.doReturn ( provider ) . when ( tasksSyncJob ) . getProvider ( ) ; org.mockito.Mockito.doReturn ( taskUtils ) . when ( tasksSyncJob ) . getGlusterTaskUtils ( ) ; }
Source:
private void dontRunNextInCaseOfErrorCommon ( boolean waitForResult ) { org.ovirt.engine.ui.uicommonweb.action.UiAction action1 = createAction ( waitForResult , false ) ; org.ovirt.engine.ui.uicommonweb.action.UiAction action2 = createAction ( ) ; action1.then ( action2 ) ; action1.runAction ( ) ; org.ovirt.engine.ui.uicommonweb.action.UiAction.ActionFlowState flowState = action1.getActionFlowState ( ) ; verifyRunActionAndExecuteCallbacksRandomly ( false , flowState , 1 , waitForResult ) ; verifyRunAction ( 1 , waitForResult ) ; assertFinishedWithErrors ( java.util.Collections.singletonList ( action1 ) , 1 ) ; }

Target:
private void dontRunNextInCaseOfErrorCommon ( boolean waitForResult ) { org.ovirt.engine.ui.uicommonweb.action.UiAction action1 = createAction ( waitForResult , false ) ; org.ovirt.engine.ui.uicommonweb.action.UiAction action2 = createAction ( ) ; action1.then ( action2 ) ; action1.runAction ( ) ; org.ovirt.engine.ui.uicommonweb.action.UiAction.ActionFlowState flowState = action1.getActionFlowState ( ) ; verifyRunActionAndExecuteCallbacksRandomly ( flowState , waitForResult ) ; verifyRunAction ( 1 , waitForResult ) ; assertFinishedWithErrors ( java.util.Collections.singletonList ( action1 ) , 1 ) ; }
Source:
public static boolean qosConfiguredOnInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.network.Network network ) { if ( iface.isQosOverridden ( ) ) { return ( iface.getQos ( ) ) != null ; } else { return ( network != null ) && ( ( network.getQosId ( ) ) != null ) ; } }

Target:
public static boolean qosConfiguredOnInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.network.Network network ) { if ( iface.isQosOverridden ( ) ) { return ( ( iface.getQos ( ) ) != null ) && ( ! ( iface.getQos ( ) . isEmpty ( ) ) ) ; } else { return ( network != null ) && ( ( network.getQosId ( ) ) != null ) ; } }
Source:
public java.lang.Void runInTransaction ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForCluster ( vds.getvds_group_id ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : networks ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( vds.getvds_group_id ( ) , net ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForCluster ( vds.getvds_group_id ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : networks ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( vds.getvds_group_id ( ) , net ) ; } return null ; }
Source:
public void unmanagedVlanAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; java.lang.String networkName = "net" ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic.getName ( ) , 100 , networkName ) ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORKS_DONT_EXIST_IN_CLUSTER , networkName ) ; }

Target:
public void unmanagedVlanAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; java.lang.String networkName = "net" ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic , 100 , networkName ) ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORKS_DONT_EXIST_IN_CLUSTER , networkName ) ; }
Source:
public void rerun ( ) { org.ovirt.engine.core.bll.MigrateVmCommand.setVm ( null ) ; determineMigrationFailueForAuditLog ( ) ; if ( ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) { setVdsDestinationId ( null ) ; super . rerun ( ) ; } else { decreasePendingVms ( getDestinationVds ( ) . getId ( ) ) ; _isRerun = true ; org.ovirt.engine.core.bll.MigrateVmCommand.setSucceeded ( false ) ; org.ovirt.engine.core.bll.MigrateVmCommand.log ( ) ; } }

Target:
public void rerun ( ) { org.ovirt.engine.core.bll.MigrateVmCommand.setVm ( null ) ; determineMigrationFailueForAuditLog ( ) ; if ( ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) { setVdsDestinationId ( null ) ; super . rerun ( ) ; } else { decreasePendingVms ( getDestinationVds ( ) . getId ( ) ) ; _isRerun = true ; org.ovirt.engine.core.bll.MigrateVmCommand.setSucceeded ( false ) ; org.ovirt.engine.core.bll.MigrateVmCommand.log ( ) ; } }
Source:
private java.util.Map getDynamicValues ( org.ovirt.vdsmfake.domain.VM vm ) { java.util.Map values = map ( ) ; values.put ( "appsList" , lst ( ) ) ; values.put ( "cpuSys" , ( "0." + ( getRandomNumber ( vm , "cpuSys" , 2 ) ) ) ) ; values.put ( "cpuUser" , ( "0." + ( getRandomNumber ( vm , "cpuUser" , 2 ) ) ) ) ; values.put ( "hash" , getRandomNumber ( vm , "hash" , 20 ) ) ; return values ; }

Target:
private java.util.Map getDynamicValues ( org.ovirt.vdsmfake.domain.VM vm ) { java.util.Map values = map ( ) ; values.put ( "cpuSys" , ( "0." + ( getRandomNumber ( vm , "cpuSys" , 2 ) ) ) ) ; values.put ( "cpuUser" , ( "0." + ( getRandomNumber ( vm , "cpuUser" , 2 ) ) ) ) ; values.put ( "hash" , getRandomNumber ( vm , "hash" , 20 ) ) ; return values ; }
Source:
public void testProtectRhel7InRhel6 ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createBaseVds ( ) ; vdsFromDb.setHostOs ( "RHEL - 6Server - 6.5.0.1.el6" ) ; vds.setHostOs ( "RHEL - 7Server - 1.el7" ) ; virtStrategy.processSoftwareCapabilities ( vds ) ; org.junit.Assert.assertTrue ( vds.getStatus ( ) . equals ( VDSStatus.NonOperational ) ) ; }

Target:
public void testProtectRhel7InRhel6 ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createBaseVds ( ) ; vdsFromDb.setHostOs ( "RHEL - 6Server - 6.5.0.1.el6" ) ; vds.setHostOs ( "RHEL - 7Server - 1.el7" ) ; virtStrategy.processSoftwareCapabilities ( vds ) ; org.junit.Assert.assertEquals ( VDSStatus.NonOperational , vds.getStatus ( ) ) ; }
Source:
public void addContextMenuHandler ( com.google.gwt.user.client.ui.Widget widget ) { widget.addDomHandler ( new com.google.gwt.event.dom.client.ContextMenuHandler ( ) { @ java.lang.Override public void onContextMenu ( com.google.gwt.event.dom.client.ContextMenuEvent event ) { event.preventDefault ( ) ; event.stopPropagation ( ) ; if ( hasActionButtons ( ) ) { int eventX = event.getNativeEvent ( ) . getClientX ( ) ; int eventY = event.getNativeEvent ( ) . getClientY ( ) ; updateContextMenu ( contextMenuBar , actionButtonList , contextPopupPanel ) ; contextPopupPanel.showAndFitToScreen ( eventX , eventY ) ; } } } , com.google.gwt.event.dom.client.ContextMenuEvent.getType ( ) ) ; }

Target:
public void onContextMenu ( com.google.gwt.event.dom.client.ContextMenuEvent event ) { this . onContextMenu ( event ) ; }
Source:
protected void fillMacAddressIfMissing ( org.ovirt.engine.core.common.businessentities.network.VmNic iface ) { if ( ( org.apache.commons.lang.StringUtils.isEmpty ( iface.getMacAddress ( ) ) ) && ( ( org.ovirt.engine.core.bll.ImportVmCommand.getMacPool ( ) . getAvailableMacsCount ( ) ) > 0 ) ) { iface.setMacAddress ( org.ovirt.engine.core.bll.ImportVmCommand.getMacPool ( ) . allocateNewMac ( ) ) ; } }

Target:
private void fillMacAddressIfMissing ( org.ovirt.engine.core.common.businessentities.network.VmNic iface ) { if ( ( org.apache.commons.lang.StringUtils.isEmpty ( iface.getMacAddress ( ) ) ) && ( ( org.ovirt.engine.core.bll.ImportVmCommand.getMacPool ( ) . getAvailableMacsCount ( ) ) > 0 ) ) { iface.setMacAddress ( org.ovirt.engine.core.bll.ImportVmCommand.getMacPool ( ) . allocateNewMac ( ) ) ; } }
Source:
public void setup ( ) { validator = new org.ovirt.engine.core.bll.validator.FenceValidator ( ) ; validator = org.mockito.Mockito.spy ( validator ) ; org.mockito.Mockito.stub ( validator.getProxyLocator ( org.mockito.Mockito.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) . toReturn ( proxyLocator ) ; org.mockito.Mockito.stub ( validator.getBackend ( ) ) . toReturn ( backend ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( configUtils ) ; }

Target:
public void setup ( ) { validator = new org.ovirt.engine.core.bll.validator.FenceValidator ( ) ; validator = org.mockito.Mockito.spy ( validator ) ; org.mockito.Mockito.stub ( validator.getProxyLocator ( org.mockito.Mockito.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) . toReturn ( proxyLocator ) ; org.mockito.Mockito.doReturn ( backend ) . when ( validator ) . getBackend ( ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( configUtils ) ; }