auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void addStatistics ( org.ovirt.engine.api.model.Nic model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.NicStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.NicStatisticalQuery ( newModel ( model.getId ( ) ) ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.utils.LinkHelper.addLinks ( uriInfo , statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }

Target:
public org.ovirt.engine.api.resource.VmNicResource getNicResource ( java.lang.String id ) { return inject ( new org.ovirt.engine.api.restapi.resource.BackendVmNicResource ( id , vmId ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( disk ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } buildSharedLockMap ( ) ; return ( ( org.ovirt.engine.core.bll.RemoveDiskCommand.acquireLockInternal ( ) ) && ( validateAllVmsForDiskAreDown ( ) ) ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) ? canRemoveDiskBasedOnImageStorageCheck ( ) : true ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Disk getDisk ( ) { if ( ( disk ) == null ) { disk = getDiskDao ( ) . get ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getEntityId ( ) ) ) ) ; } return disk ; }
Source:
public void testInterfaceAlreadyLabeledWithWhenInterfaceIsLabeledBySameLabel ( ) { java.lang.String labelA = "labelA" ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setLabels ( java.util.Collections.singleton ( labelA ) ) ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.INTERFACE_ALREADY_LABELED , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_LABELED_NIC , vdsNetworkInterface.getName ( ) ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_NIC_LABEL , labelA ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceAlreadyLabeledWith ( labelA ) , matcher ) ; }

Target:
public void testInterfaceAlreadyLabeledWithWhenInterfaceIsLabeledBySameLabel ( ) { java.lang.String labelA = "labelA" ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setLabels ( java.util.Collections.singleton ( labelA ) ) ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.INTERFACE_ALREADY_LABELED , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_LABELED_NIC , vdsNetworkInterface.getName ( ) ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_NIC_LABEL , labelA ) ) ; org.hamcrest.MatcherAssert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceAlreadyLabeledWith ( labelA ) , matcher ) ; }
Source:
public void testSaveAndGetById ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity newOption = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity ( org.ovirt.engine.core.dao.gluster.GlusterOptionDaoTest.EXISTING_VOL_ID , org.ovirt.engine.core.dao.gluster.GlusterOptionDaoTest.OPTION_AUTH_REJECT , org.ovirt.engine.core.dao.gluster.GlusterOptionDaoTest.OPTION_AUTH_REJECT_VALUE ) ; dao.save ( newOption ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity retrievedOption = dao.getById ( newOption.getId ( ) ) ; org.junit.Assert.assertNotNull ( retrievedOption ) ; org.junit.Assert.assertEquals ( newOption , retrievedOption ) ; }

Target:
public void testSaveAndGetById ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity newOption = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity ( org.ovirt.engine.core.dao.gluster.GlusterOptionDaoTest.EXISTING_VOL_ID , org.ovirt.engine.core.dao.gluster.GlusterOptionDaoTest.OPTION_AUTH_REJECT , org.ovirt.engine.core.dao.gluster.GlusterOptionDaoTest.OPTION_AUTH_REJECT_VALUE ) ; dao.save ( newOption ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity retrievedOption = dao.getById ( newOption.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( retrievedOption ) ; org.junit.jupiter.api.Assertions.assertEquals ( newOption , retrievedOption ) ; }
Source:
public static void hasSpiceSupport ( int osId , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.ui.frontend.AsyncQuery callback ) { org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.HasSpiceSupport , osId , version ) , callback ) ; }

Target:
private static void initDisplayTypes ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.displayTypes = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDisplayTypes ) , callback ) ; }
Source:
private void writeOwnerModels ( ) { logger.log ( Type.DEBUG , "Strating to write OwnerModels" ) ; sw.println ( ) ; sw.println ( "@Override" ) ; sw.println ( "protected java.util.Map<String, org.ovirt.engine.ui.uicommonweb.models.EntityModel> getOwnerModels() {" ) ; sw.indent ( ) ; sw.println ( "java.util.Map<String, org.ovirt.engine.ui.uicommonweb.models.EntityModel> regs = new java.util.HashMap<String, org.ovirt.engine.ui.uicommonweb.models.EntityModel>();" ) ; logger.log ( Type.DEBUG , "Going over Editor Fields" ) ; for ( com.google.gwt.editor.rebind.model.EditorData editorData : model.getEditorData ( ) ) { logger.log ( Type.DEBUG , ( "Going over Field: " + editorData ) ) ; java.lang.String path = editorData.getPath ( ) ; if ( ( path.length ( ) ) == 0 ) { continue ; } com.google.gwt.core.ext.typeinfo.JClassType propertyOwnerType = eraseType ( editorData.getPropertyOwnerType ( ) ) ; if ( ( propertyOwnerType == ( listModelType ) ) || ( propertyOwnerType == ( entityModelType ) ) ) { logger.log ( Type.DEBUG , ( "Found owner Model Field: " + editorData ) ) ; sw.println ( "regs.put(\"%s\", getObject()%s);" , path , editorData.getBeanOwnerExpression ( ) ) ; } } sw.println ( "return regs;" ) ; sw.outdent ( ) ; sw.println ( "}" ) ; }

Target:
private void writeOwnerModels ( ) { logger.log ( Type.DEBUG , "Starting to write OwnerModels" ) ; sw.println ( ) ; sw.println ( "@Override" ) ; sw.println ( "protected java.util.Map<String, org.ovirt.engine.ui.uicommonweb.models.EntityModel> getOwnerModels() {" ) ; sw.indent ( ) ; sw.println ( "java.util.Map<String, org.ovirt.engine.ui.uicommonweb.models.EntityModel> regs = new java.util.HashMap<String, org.ovirt.engine.ui.uicommonweb.models.EntityModel>();" ) ; logger.log ( Type.DEBUG , "Going over Editor Fields" ) ; for ( com.google.gwt.editor.rebind.model.EditorData editorData : model.getEditorData ( ) ) { logger.log ( Type.DEBUG , ( "Going over Field: " + editorData ) ) ; java.lang.String path = editorData.getPath ( ) ; if ( ( path.length ( ) ) == 0 ) { continue ; } com.google.gwt.core.ext.typeinfo.JClassType propertyOwnerType = eraseType ( editorData.getPropertyOwnerType ( ) ) ; if ( ( propertyOwnerType == ( listModelType ) ) || ( propertyOwnerType == ( entityModelType ) ) ) { logger.log ( Type.DEBUG , ( "Found owner Model Field: " + editorData ) ) ; sw.println ( "regs.put(\"%s\", getObject()%s);" , path , editorData.getBeanOwnerExpression ( ) ) ; } } sw.println ( "return regs;" ) ; sw.outdent ( ) ; sw.println ( "}" ) ; }
Source:
public static void GetMaximalVmMemSize64OS ( 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.Integer ) ( source ) ) . intValue ( ) : - 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getMaximalVmMemSize64OS ( 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.Integer ) ( source ) ) . intValue ( ) : - 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
private void setUpGetEntityExpectations ( org.ovirt.engine.core.compat.Guid entityId , boolean returnNull ) throws java.lang.Exception { java.lang.String [ ] names = new java.lang.String [ ] { "TagId" } ; java.lang.Object [ ] values = new java.lang.Object [ ] { entityId } ; org.ovirt.engine.core.common.businessentities.tags tag = null ; if ( ! returnNull ) { tag = new org.ovirt.engine.core.common.businessentities.tags ( ) ; tag.settag_id ( entityId ) ; } setUpGetEntityExpectations ( VdcQueryType.GetTagByTagId , org.ovirt.engine.core.common.queries.GetTagByTagIdParameters.class , names , values , tag ) ; }

Target:
private void setUpGetEntityExpectations ( org.ovirt.engine.core.compat.Guid entityId , boolean returnNull ) throws java.lang.Exception { java.lang.String [ ] names = new java.lang.String [ ] { "Id" } ; java.lang.Object [ ] values = new java.lang.Object [ ] { entityId } ; org.ovirt.engine.core.common.businessentities.tags tag = null ; if ( ! returnNull ) { tag = new org.ovirt.engine.core.common.businessentities.tags ( ) ; tag.settag_id ( entityId ) ; } setUpGetEntityExpectations ( VdcQueryType.GetTagByTagId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , names , values , tag ) ; }
Source:
private javax.ws.rs.core.Response addSAN ( org.ovirt.engine.api.model.StorageDomain model , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.common.businessentities.StorageDomainStatic entity , org.ovirt.engine.core.compat.Guid hostId ) { boolean overrideLuns = ( model.getStorage ( ) . isSetOverrideLuns ( ) ) ? model.getStorage ( ) . isOverrideLuns ( ) : false ; return performCreate ( VdcActionType.AddSANStorageDomain , getSanAddParams ( entity , hostId , getLunIds ( model.getStorage ( ) , storageType , hostId ) , overrideLuns ) , ID_RESOLVER ) ; }

Target:
private javax.ws.rs.core.Response addSAN ( org.ovirt.engine.api.model.StorageDomain model , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.common.businessentities.StorageDomainStatic entity , org.ovirt.engine.core.compat.Guid hostId ) { boolean overrideLuns = ( model.getStorage ( ) . isSetOverrideLuns ( ) ) ? model.getStorage ( ) . isOverrideLuns ( ) : false ; return performCreate ( ActionType.AddSANStorageDomain , getSanAddParams ( entity , hostId , getLunIds ( model.getStorage ( ) , storageType , hostId ) , overrideLuns ) , ID_RESOLVER ) ; }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public static org.ovirt.engine.core.bll.ValidationResult isCinderHasNoImages ( org.ovirt.engine.core.compat.Guid storageDomainId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > cinderDisks = org.ovirt.engine.core.bll.storage.connection.CINDERStorageHelper.getDbFacade ( ) . getDiskImageDao ( ) . getAllForStorageDomain ( storageDomainId ) ; if ( ! ( cinderDisks.isEmpty ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ERROR_CANNOT_DETACH_CINDER_PROVIDER_WITH_IMAGES ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
private static org.ovirt.engine.core.dao.DiskImageDao getDiskImageDao ( ) { return org.ovirt.engine.core.bll.storage.connection.CINDERStorageHelper.getDbFacade ( ) . getDiskImageDao ( ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VMStatus getRawValue ( org.ovirt.engine.core.common.businessentities.VM object ) { return object.getStatus ( ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VMStatus getRawValue ( org.ovirt.engine.core.common.businessentities.VM object ) { final org.ovirt.engine.core.common.businessentities.VDS vds = getDetailModel ( ) . getEntity ( ) ; if ( ( object.getStatus ( ) . equals ( VMStatus.MigratingFrom ) ) && ( vds.getId ( ) . equals ( object.getMigratingToVds ( ) ) ) ) { return org.ovirt.engine.core.common.businessentities.VMStatus.MigratingTo ; } return object.getStatus ( ) ; }
Source:
public void validateFailsWithClusterDoesNotSupportGluster ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( getVolume ( 2 , false ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getCluster ( false ) ) . when ( clusterDao ) . get ( org.mockito.Mockito.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER ) ; }

Target:
public void validateFailsWithClusterDoesNotSupportGluster ( ) { org.mockito.Mockito.doReturn ( getCluster ( false , Version.v4_1 ) ) . when ( clusterDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER ) ; }
Source:
public void setSearchString ( java.lang.String searchString ) { if ( ( org.ovirt.engine.ui.uicompat.external.StringUtils.isNotEmpty ( searchString ) ) && ( searchString.trim ( ) . toUpperCase ( ) . startsWith ( searchStringPrefixLabel.getText ( ) . toUpperCase ( ) ) ) ) { searchStringInput.setText ( searchString.trim ( ) . substring ( searchStringPrefixLabel.getText ( ) . length ( ) ) ) ; } else { searchStringInput.setText ( searchString ) ; } }

Target:
public void setSearchString ( java.lang.String searchString ) { if ( ( org.ovirt.engine.core.compat.StringHelper.isNotNullOrEmpty ( searchString ) ) && ( searchString.trim ( ) . toUpperCase ( ) . startsWith ( searchStringPrefixLabel.getText ( ) . toUpperCase ( ) ) ) ) { searchStringInput.setText ( searchString.trim ( ) . substring ( searchStringPrefixLabel.getText ( ) . length ( ) ) ) ; } else { searchStringInput.setText ( searchString ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( args != null ) && ( args instanceof org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( "IsChangable" . equals ( propName ) ) { cloudInitPasswordSetEditor.setTitle ( ( model.getCloudInitPasswordSet ( ) . getIsChangable ( ) ? org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmInitWidget.constants.vmInitPasswordSetToolTip ( ) : org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmInitWidget.constants.vmInitPasswordNotSetToolTip ( ) ) ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( "IsChangable" . equals ( propName ) ) { cloudInitPasswordSetEditor.setTitle ( ( model.getCloudInitPasswordSet ( ) . getIsChangable ( ) ? org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmInitWidget.constants.vmInitPasswordSetToolTip ( ) : org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmInitWidget.constants.vmInitPasswordNotSetToolTip ( ) ) ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.VdcOption mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.VdcOption entity = new org.ovirt.engine.core.common.businessentities.VdcOption ( ) ; entity.setoption_name ( rs.getString ( "option_name" ) ) ; entity.setoption_value ( rs.getString ( "option_value" ) ) ; entity.setoption_id ( rs.getInt ( "option_id" ) ) ; entity.setversion ( rs.getString ( "version" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.VdcOption getByNameAndVersion ( java.lang.String name , java.lang.String version ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "option_name" , name ) . addValue ( "version" , version ) ; return getCallsHandler ( ) . executeRead ( "GetVdcOptionByName" , org.ovirt.engine.core.dao.VdcOptionDAODbFacadeImpl.VdcOptionRowMapper.instance , parameterSource ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { try { status = org.ovirt.engine.core.vdsbroker.HotUnplugMemoryVDSCommand.getBroker ( ) . hotUnplugMemory ( org.ovirt.engine.core.vdsbroker.architecture.MemoryUtils.createHotplugMemoryParamsMap ( org.ovirt.engine.core.vdsbroker.HotUnplugMemoryVDSCommand.getParameters ( ) . getMemoryDeviceToUnplug ( ) , true ) ) ; org.ovirt.engine.core.vdsbroker.HotUnplugMemoryVDSCommand.proceedProxyReturnValue ( ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.vdsbroker.HotUnplugMemoryVDSCommand.setVdsRuntimeErrorAndReport ( e ) ; org.ovirt.engine.core.vdsbroker.HotUnplugMemoryVDSCommand.getVDSReturnValue ( ) . setExceptionString ( null ) ; } }

Target:
protected void executeVdsBrokerCommand ( ) { try { status = org.ovirt.engine.core.vdsbroker.HotUnplugMemoryVDSCommand.getBroker ( ) . hotUnplugMemory ( org.ovirt.engine.core.vdsbroker.architecture.MemoryUtils.createHotplugMemoryParamsMap ( org.ovirt.engine.core.vdsbroker.HotUnplugMemoryVDSCommand.getParameters ( ) . getMemoryDeviceToUnplug ( ) , true , org.ovirt.engine.core.vdsbroker.HotUnplugMemoryVDSCommand.getParameters ( ) . getMinAllocatedMemoryMb ( ) ) ) ; org.ovirt.engine.core.vdsbroker.HotUnplugMemoryVDSCommand.proceedProxyReturnValue ( ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.vdsbroker.HotUnplugMemoryVDSCommand.setVdsRuntimeErrorAndReport ( e ) ; org.ovirt.engine.core.vdsbroker.HotUnplugMemoryVDSCommand.getVDSReturnValue ( ) . setExceptionString ( null ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.storage_domains map ( org.ovirt.engine.api.model.Storage model , org.ovirt.engine.core.common.businessentities.storage_domains template ) { org.ovirt.engine.core.common.businessentities.storage_domains entity = ( template != null ) ? template : new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; entity.setstorage ( model.getId ( ) ) ; if ( model.isSetType ( ) ) { org.ovirt.engine.api.model.StorageType storageType = org.ovirt.engine.api.model.StorageType.fromValue ( model.getType ( ) ) ; if ( storageType != null ) { entity.setstorage_type ( org.ovirt.engine.api.restapi.types.StorageDomainMapper.map ( storageType , null ) ) ; } } return entity ; }

Target:
public static org.ovirt.engine.core.common.businessentities.StorageDomain map ( org.ovirt.engine.api.model.Storage model , org.ovirt.engine.api.restapi.types.StorageDomain template ) { org.ovirt.engine.api.restapi.types.StorageDomain entity = ( template != null ) ? template : new org.ovirt.engine.api.restapi.types.StorageDomain ( ) ; entity.setstorage ( model.getId ( ) ) ; if ( model.isSetType ( ) ) { org.ovirt.engine.api.model.StorageType storageType = org.ovirt.engine.api.model.StorageType.fromValue ( model.getType ( ) ) ; if ( storageType != null ) { entity.setstorage_type ( org.ovirt.engine.api.restapi.types.StorageDomainMapper.map ( storageType , null ) ) ; } } return entity ; }
Source:
private org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand < org.ovirt.engine.core.common.action.TransferDiskImageParameters > getCommand ( ) { return ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand ) ( transferImageCommand ) ) ; }

Target:
protected void initCommand ( ) { org.mockito.Mockito.doNothing ( ) . when ( transferImageCommand ) . createImage ( ) ; org.mockito.Mockito.doNothing ( ) . when ( transferImageCommand ) . persistCommand ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; org.mockito.Mockito.doNothing ( ) . when ( transferImageCommand ) . lockImage ( ) ; org.mockito.Mockito.doNothing ( ) . when ( transferImageCommand ) . startImageTransferSession ( ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { defaultProfile.getName ( ) . setEntity ( getName ( ) . getEntity ( ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ! ( defaultProfile.getName ( ) . getEntity ( ) . equals ( getName ( ) . getEntity ( ) ) ) ) { getName ( ) . getEntityChangedEvent ( ) . removeListener ( networkNameListener ) ; defaultProfile.getName ( ) . getEntityChangedEvent ( ) . removeListener ( this ) ; } }
Source:
public org.ovirt.engine.sdk.entities.Action refreshcapabilities ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/refreshcapabilities" ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.entities.Action refresh ( org.ovirt.engine.sdk.entities.Action action ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( this . getHref ( ) ) + "/refresh" ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . action ( url , action , org.ovirt.engine.sdk.entities.Action.class , org.ovirt.engine.sdk.entities.Action.class , headers ) ; }
Source:
private org.ovirt.engine.core.common.action.RemoveImageParameters buildRemoveImageParameters ( org.ovirt.engine.core.common.businessentities.DiskImage image ) { org.ovirt.engine.core.common.action.RemoveImageParameters result = new org.ovirt.engine.core.common.action.RemoveImageParameters ( image.getImageId ( ) ) ; result.setParentCommand ( org.ovirt.engine.core.bll.RemoveAllVmImagesCommand.getParameters ( ) . getParentCommand ( ) ) ; result.setParentParameters ( org.ovirt.engine.core.bll.RemoveAllVmImagesCommand.getParameters ( ) . getParentParameters ( ) ) ; result.setDiskImage ( image ) ; result.setEntityId ( org.ovirt.engine.core.bll.RemoveAllVmImagesCommand.getParameters ( ) . getEntityId ( ) ) ; result.setForceDelete ( org.ovirt.engine.core.bll.RemoveAllVmImagesCommand.getParameters ( ) . getForceDelete ( ) ) ; return result ; }

Target:
private org.ovirt.engine.core.common.action.RemoveImageParameters buildRemoveImageParameters ( org.ovirt.engine.core.common.businessentities.DiskImage image ) { org.ovirt.engine.core.common.action.RemoveImageParameters result = new org.ovirt.engine.core.common.action.RemoveImageParameters ( image.getImageId ( ) ) ; result.setParentCommand ( org.ovirt.engine.core.bll.RemoveAllVmImagesCommand.getParameters ( ) . getParentCommand ( ) ) ; result.setParentParameters ( org.ovirt.engine.core.bll.RemoveAllVmImagesCommand.getParameters ( ) . getParentParameters ( ) ) ; result.setDiskImage ( image ) ; result.setEntityId ( org.ovirt.engine.core.bll.RemoveAllVmImagesCommand.getParameters ( ) . getEntityId ( ) ) ; result.setForceDelete ( org.ovirt.engine.core.bll.RemoveAllVmImagesCommand.getParameters ( ) . getForceDelete ( ) ) ; result.setShouldLockImage ( false ) ; return result ; }
Source:
public java.lang.Object call ( ) throws java.lang.Exception { _parser.cliEnvironmentSet ( VdsmEnv.MANAGEMENT_BRIDGE_NAME , org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) ) ; return null ; }

Target:
public java.lang.Object call ( ) throws java.lang.Exception { if ( ( _managementNetwork ) != null ) { _parser.cliEnvironmentSet ( VdsmEnv.MANAGEMENT_BRIDGE_NAME , _managementNetwork ) ; } else if ( _isNode ) { _parser.cliEnvironmentSet ( VdsmEnv.MANAGEMENT_BRIDGE_NAME , org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) ) ; } else { _parser.cliNoop ( ) ; } return null ; }
Source:
protected java.util.Map < java.lang.String , java.lang.String > getExclusiveLocks ( ) { java.util.Map < java.lang.String , java.lang.String > locks = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; java.util.Map < java.lang.String , java.lang.String > parentLocks = super . getExclusiveLocks ( ) ; if ( parentLocks != null ) { locks.putAll ( parentLocks ) ; } locks.put ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getVmTemplateId ( ) . toString ( ) , LockingGroup.TEMPLATE.name ( ) ) ; return locks ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > locks = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > ( ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > parentLocks = super . getExclusiveLocks ( ) ; if ( parentLocks != null ) { locks.putAll ( parentLocks ) ; } locks.put ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getVmTemplateId ( ) . toString ( ) , LockMessagesMatchUtil.TEMPLATE ) ; return locks ; }
Source:
public void auditInvalidInterfaces ( java.lang.String entityName ) { if ( ! ( invalidNetworkNames.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "EntityName" , entityName ) ; logable.addCustomValue ( "Networks" , org.apache.commons.lang.StringUtils.join ( invalidNetworkNames , ',' ) ) ; logable.addCustomValue ( "Interfaces" , org.apache.commons.lang.StringUtils.join ( invalidIfaceNames , ',' ) ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( logable , logType ) ; } }

Target:
public void auditInvalidInterfaces ( java.lang.String entityName ) { if ( ! ( invalidNetworkNames.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = org.ovirt.engine.core.di.Injector.injectMembers ( new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ) ; logable.addCustomValue ( "EntityName" , entityName ) ; logable.addCustomValue ( "Networks" , org.apache.commons.lang.StringUtils.join ( invalidNetworkNames , ',' ) ) ; logable.addCustomValue ( "Interfaces" , org.apache.commons.lang.StringUtils.join ( invalidIfaceNames , ',' ) ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( logable , logType ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; java.util.Collections.sort ( dataCenters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; getDataCenters ( ) . setItems ( dataCenters ) ; getDataCenters ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCenters ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetExternalNetworkList ( networkQuery , provider.getId ( ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { dataCenters.addAll ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) ; java.util.Collections.sort ( dataCenters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetExternalNetworkList ( networkQuery , provider.getId ( ) ) ; }
Source:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.api.model.Disk entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetAllDisksByVmId , org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.PARENT_ID } , entity ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.api.model.Disk entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetAllDisksByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.PARENT_ID } , entity ) ; } }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true , getEntity ( 0 ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true , getEntity ( 0 ) ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void rollbackQuota ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getImagesList ( ) ) { org.ovirt.engine.core.compat.Guid quotaId = image.getQuotaId ( ) ; if ( quotaId != null ) { org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . rollbackQuota ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getStoragePool ( ) , java.util.Arrays.asList ( quotaId ) ) ; } } }

Target:
public void rollbackQuota ( ) { if ( getImagesList ( ) . isEmpty ( ) ) { return ; } setStoragePoolId ( getImagesList ( ) . get ( 0 ) . getstorage_pool_id ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getImagesList ( ) ) { org.ovirt.engine.core.compat.Guid quotaId = image.getQuotaId ( ) ; if ( quotaId != null ) { org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . rollbackQuota ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getStoragePool ( ) , java.util.Arrays.asList ( quotaId ) ) ; } } }
Source:
public void mixedClusterServicesNotSupported ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , false ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.mixedClusterServicesSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.VDS_GROUP_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ) ; }

Target:
public void mixedClusterServicesNotSupported ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , false ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.mixedClusterServicesSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_GROUP_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ) ; }
Source:
public void deallocate ( org.ovirt.engine.core.common.businessentities.network.VmNic nic ) { try { com.woorea.openstack.quantum.model.Port port = locatePort ( nic ) ; if ( port != null ) { getClient ( ) . ports ( ) . delete ( port.getId ( ) ) . execute ( ) ; } } catch ( java.lang.RuntimeException e ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.PROVIDER_FAILURE , e ) ; } }

Target:
protected com.woorea.openstack.quantum.model.Port createNewPortForAllocate ( org.ovirt.engine.core.common.businessentities.network.VmNic nic , java.util.List < java.lang.String > securityGroups , java.lang.String hostId , org.ovirt.engine.core.common.businessentities.network.Network externalNetwork ) { com.woorea.openstack.quantum.model.Port portForCreate = super . createNewPortForAllocate ( nic , securityGroups , hostId , externalNetwork ) ; portForCreate.setTenantId ( externalNetwork.getTenantId ( ) ) ; return portForCreate ; }
Source:
private boolean isTaskStateError ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue ) { if ( ( ( vdsReturnValue != null ) && ( ( vdsReturnValue.getVdsError ( ) ) != null ) ) && ( ( vdsReturnValue.getVdsError ( ) . getCode ( ) ) == ( org.ovirt.engine.core.common.errors.VdcBllErrors.TaskStateError ) ) ) { org.ovirt.engine.core.bll.SPMAsyncTask.log.infoFormat ( "SPMAsyncTask::ClearAsyncTask: At time of attemp to clear task '{0}' the response code was {2} and message was {3}. Task will not be cleaned" , getVdsmTaskId ( ) , vdsReturnValue.getVdsError ( ) . getCode ( ) , vdsReturnValue.getVdsError ( ) . getMessage ( ) ) ; return true ; } return false ; }

Target:
private boolean isTaskStateError ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue ) { if ( ( ( vdsReturnValue != null ) && ( ( vdsReturnValue.getVdsError ( ) ) != null ) ) && ( ( vdsReturnValue.getVdsError ( ) . getCode ( ) ) == ( org.ovirt.engine.core.common.errors.VdcBllErrors.TaskStateError ) ) ) { org.ovirt.engine.core.bll.SPMAsyncTask.log.infoFormat ( "SPMAsyncTask::ClearAsyncTask: At time of attempt to clear task '{0}' the response code was {1} and message was {2}. Task will not be cleaned" , getVdsmTaskId ( ) , vdsReturnValue.getVdsError ( ) . getCode ( ) , vdsReturnValue.getVdsError ( ) . getMessage ( ) ) ; return true ; } return false ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getVmStaticData ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueFromAddVm ; if ( VmTemplateHandler.BlankVmTemplateId.equals ( vmStatic.getVmtGuid ( ) ) ) { returnValueFromAddVm = addVmFromScratch ( vmStatic ) ; } else { returnValueFromAddVm = addVm ( vmStatic ) ; } if ( returnValueFromAddVm.getSucceeded ( ) ) { org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getTaskIdList ( ) . addAll ( returnValueFromAddVm.getInternalTaskIdList ( ) ) ; addVmToPool ( vmStatic ) ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getVmStaticData ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueFromAddVm ; if ( VmTemplateHandler.BlankVmTemplateId.equals ( vmStatic.getVmtGuid ( ) ) ) { returnValueFromAddVm = addVmFromScratch ( vmStatic ) ; } else { returnValueFromAddVm = addVm ( vmStatic ) ; } if ( returnValueFromAddVm.getSucceeded ( ) ) { org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getTaskIdList ( ) . addAll ( returnValueFromAddVm.getInternalVdsmTaskIdList ( ) ) ; addVmToPool ( vmStatic ) ; } }
Source:
public static java.lang.String toPlural ( java.lang.String singular ) { java.lang.String plural = org.ovirt.engine.sdk.codegen.utils.StringUtils.PLURAL_EXCEPTIONS.get ( singular ) ; if ( plural == null ) { if ( ( ( singular.length ( ) ) >= 1 ) && ( ! ( singular.endsWith ( "s" ) ) ) ) { plural = singular + "s" ; } else { plural = singular ; } } return plural ; }

Target:
public static java.lang.String concatenateValues ( java.util.Map < java.lang.String , java.lang.String > map ) { java.util.List < java.lang.String > keys = new java.util.ArrayList < > ( map.keySet ( ) ) ; java.util.Collections.sort ( keys ) ; java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; keys.forEach ( ( key ) -> buffer.append ( map.get ( key ) ) ) ; return buffer.toString ( ) ; }
Source:
public void getFreeVfOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 1 , 4 , 3 , 2 , 1 ) ; org.junit.Assert.assertEquals ( 1 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( hostNicVfsConfigHelper.getFreeVf ( nic ) ) ) ; }

Target:
public void getFreeVfMoreThanOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 5 , 2 , 2 , 2 , 2 ) ; org.junit.Assert.assertEquals ( 5 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( hostNicVfsConfigHelper.getFreeVf ( nic , null ) ) ) ; }
Source:
public void test64BitMemoryExceedsLimit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVdsGroupCompatibilityVersion ( Version.v3_3 ) ; vm.setVmMemSizeMb ( ( ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest.MEMORY_LIMIT_64_BIT ) + 1 ) ) ; vm.setVmOs ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest._64_BIT_OS ) ; mockOsRepository ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateMemorySize ( vm ) , false , VdcBllMessages.ACTION_TYPE_FAILED_MEMORY_EXCEEDS_SUPPORTED_LIMIT ) ; }

Target:
public void test64BitMemoryExceedsLimit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVdsGroupCompatibilityVersion ( Version.v3_3 ) ; vm.setVmMemSizeMb ( ( ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest.MEMORY_LIMIT_64_BIT ) + 1 ) ) ; vm.setVmOs ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest._64_BIT_OS ) ; mockOsRepository ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateMemorySize ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_MEMORY_EXCEEDS_SUPPORTED_LIMIT ) ; }
Source:
public void init ( ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initializing Scheduling manager" ) ; loadPolicyUnits ( ) ; loadClusterPolicies ( ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread discoveryThread = new org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread ( ) ; if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.ExternalSchedulerEnabled ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Starting external scheduler dicovery thread" ) ; discoveryThread.start ( ) ; } else { discoveryThread.markExternalPoliciesAsDisabled ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "External scheduler disabled, discovery skipped" ) ; } org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initialized Scheduling manager" ) ; }

Target:
public void init ( ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initializing Scheduling manager" ) ; loadPolicyUnits ( ) ; loadClusterPolicies ( ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread discoveryThread = new org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread ( ) ; if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.ExternalSchedulerEnabled ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Starting external scheduler dicovery thread" ) ; discoveryThread.start ( ) ; } else { discoveryThread.markAllExternalPoliciesAsDisabled ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "External scheduler disabled, discovery skipped" ) ; } org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initialized Scheduling manager" ) ; }
Source:
private boolean isRngSupportedForClusterVersion ( org.ovirt.engine.core.compat.Version version ) { if ( version == null ) { return false ; } java.lang.Boolean supported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.VirtIoRngDeviceSupported , version.toString ( ) ) ) ) ; return supported == null ? false : supported ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.MigrationBandwidthLimitType > getMigrationBandwidthLimitType ( ) { return migrationBandwidthLimitType ; }
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.gluster.VolumeGeneralModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeGeneralModel ) ( sender ) ) ; if ( "VolumeType" . equals ( ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ) ) { translateVolumeType ( ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( model.getEntity ( ) ) ) ) ; } }

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.gluster.VolumeGeneralModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeGeneralModel ) ( sender ) ) ; if ( "VolumeType" . equals ( ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ) ) { translateVolumeType ( ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( model.getEntity ( ) ) ) ) ; } }
Source:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }