auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void takeVm ( ) { org.ovirt.engine.core.common.businessentities.VmPool entity = ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( getItem ( ) . getEntity ( ) ) ) ; org.ovirt.engine.core.common.action.VmPoolUserParameters params = new org.ovirt.engine.core.common.action.VmPoolUserParameters ( entity.getVmPoolId ( ) , org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getLoggedInUser ( ) . getId ( ) , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.AttachUserToVmFromPoolAndRun , params , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { return ; } } } , this ) ; }

Target:
private void takeVm ( ) { org.ovirt.engine.core.common.businessentities.VmPool entity = ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( getItem ( ) . getEntity ( ) ) ) ; org.ovirt.engine.core.common.action.AttachUserToVmFromPoolAndRunParameters params = new org.ovirt.engine.core.common.action.AttachUserToVmFromPoolAndRunParameters ( entity.getVmPoolId ( ) , org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getLoggedInUser ( ) . getId ( ) , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.AttachUserToVmFromPoolAndRun , params , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { return ; } } } , this ) ; }
Source:
public org.ovirt.engine.core.authentication.Authenticator create ( org.ovirt.engine.core.authentication.Configuration config ) throws org.ovirt.engine.core.authentication.ConfigurationException { java.lang.String header = config.getString ( org.ovirt.engine.core.authentication.header.HeaderAuthenticatorFactory.HEADER_PARAMETER ) ; if ( header == null ) { throw new org.ovirt.engine.core.authentication.ConfigurationException ( ( ( ( ( ( ( "The configuration file \"" + ( config.getFile ( ) . getAbsolutePath ( ) ) ) + "\" doesn\'t contain the " ) + "parameter \"" ) + ( config.getAbsoluteKey ( org.ovirt.engine.core.authentication.header.HeaderAuthenticatorFactory.HEADER_PARAMETER ) ) ) + "\" that specifies the name of " ) + "the header containing the remote user name." ) ) ; } return new org.ovirt.engine.core.authentication.header.HeaderAuthenticator ( header ) ; }

Target:
public org.ovirt.engine.core.authentication.Authenticator create ( org.ovirt.engine.core.extensions.mgr.Configuration config ) throws org.ovirt.engine.core.extensions.mgr.ConfigurationException { java.lang.String header = config.getString ( org.ovirt.engine.core.authentication.header.HeaderAuthenticatorFactory.HEADER_PARAMETER ) ; if ( header == null ) { throw new org.ovirt.engine.core.extensions.mgr.ConfigurationException ( ( ( ( ( ( ( "The configuration file \"" + ( config.getFile ( ) . getAbsolutePath ( ) ) ) + "\" doesn\'t contain the " ) + "parameter \"" ) + ( config.getAbsoluteKey ( org.ovirt.engine.core.authentication.header.HeaderAuthenticatorFactory.HEADER_PARAMETER ) ) ) + "\" that specifies the name of " ) + "the header containing the remote user name." ) ) ; } return new org.ovirt.engine.core.authentication.header.HeaderAuthenticator ( header ) ; }
Source:
private void mockGetVmStatsCommand ( boolean mockSuccess ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; if ( mockSuccess ) { vdsReturnValue.setSucceeded ( true ) ; vdsReturnValue.setReturnValue ( createRunningVms ( ) . get ( org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfoTest.VM_1 ) ) ; } org.mockito.Mockito.when ( resourceManager.runVdsCommand ( org.mockito.Mockito.eq ( VDSCommandType.GetVmStats ) , ( ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase ) ( org.mockito.Mockito.anyObject ( ) ) ) ) ) . thenReturn ( vdsReturnValue ) ; }

Target:
private void mockGetVmStatsCommand ( boolean mockSuccess ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; if ( mockSuccess ) { vdsReturnValue.setSucceeded ( true ) ; vdsReturnValue.setReturnValue ( createRunningVms ( ) . get ( org.ovirt.engine.core.vdsbroker.HostMonitoringTest.VM_1 ) ) ; } org.mockito.Mockito.when ( resourceManager.runVdsCommand ( org.mockito.Mockito.eq ( VDSCommandType.GetVmStats ) , ( ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase ) ( org.mockito.Mockito.anyObject ( ) ) ) ) ) . thenReturn ( vdsReturnValue ) ; }
Source:
public void testLogReturnLogsWhenLogLevelActiveAndNoExpandReturn ( ) throws java.lang.Exception { java.lang.String id = "" ; org.ovirt.engine.core.utils.log.Log log = org.mockito.Mockito.mock ( org.ovirt.engine.core.utils.log.Log.class ) ; org.mockito.Mockito.when ( log.isInfoEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclassNoReturn ( ) , new java.lang.Object ( ) ) ; org.mockito.Mockito.verify ( log ) . infoFormat ( org.mockito.Matchers.eq ( LoggedUtils.EXIT_LOG_VOID ) , org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.eq ( id ) ) ; }

Target:
public void testLogReturnLogsWhenLogLevelActiveAndNoExpandReturn ( ) throws java.lang.Exception { java.lang.String id = "" ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isInfoEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logReturn ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclassNoReturn ( ) , new java.lang.Object ( ) ) ; org.mockito.Mockito.verify ( log ) . info ( org.mockito.Matchers.eq ( LoggedUtils.EXIT_LOG_VOID ) , new java.lang.Object [ ] { org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.eq ( id ) } ) ; }
Source:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public static void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void reportNonOperationReason ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVdsId ( ) , reason , customLogValues ) ; runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getContext ( ) ) ) ; }

Target:
private void reportNonOperationReason ( org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVdsId ( ) , reason , customLogValues ) ; runInternalAction ( ActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getContext ( ) ) ) ; }
Source:
public void canDoActionFailedVMNotFound ( ) throws java.lang.Exception { initializeCommand ( createParameters ( ) ) ; mockNullVm ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND.toString ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmDevice stubVmDevice ( org.ovirt.engine.core.compat.Guid diskId , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = createVmDevice ( diskId , vmId ) ; org.mockito.Mockito.doReturn ( vmDevice ) . when ( command ) . getVmDeviceForVm ( ) ; return vmDevice ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM createVmForTesting ( java.lang.String initrd , java.lang.String kernel ) { mockVm ( command ) ; command.getVm ( ) . setinitrd_url ( initrd ) ; command.getVm ( ) . setkernel_url ( kernel ) ; command.createVm ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ; return vm ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM createVmForTesting ( java.lang.String initrd , java.lang.String kernel ) { mockVm ( command ) ; command.getVm ( ) . setInitrdUrl ( initrd ) ; command.getVm ( ) . setKernelUrl ( kernel ) ; command.createVm ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ; return vm ; }
Source:
public static void GetDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , 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.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.GetVmConfigurationBySnapshotQueryParams ( snapshotSourceId ) , aQuery ) ; }
Source:
public void testAddLabelToNicAndValidateWhenUsingInvalidLabel ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setLabels ( new java.util.HashSet < java.lang.String > ( ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . addLabelToNicAndValidate ( "**uups!**" , new java.util.ArrayList < java.lang.Class < ? > > ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.IMPROPER_INTERFACE_IS_LABELED ) ) ; }

Target:
public void testAddLabelToNicAndValidateWhenUsingInvalidLabel ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setLabels ( new java.util.HashSet < java.lang.String > ( ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . addLabelToNicAndValidate ( "**uups!**" , new java.util.ArrayList < java.lang.Class < ? > > ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.IMPROPER_INTERFACE_IS_LABELED ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getParameters ( ) . getRngDevice ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.RNG_NOT_FOUND ) ; } if ( ! ( getRngDevices ( ) . isEmpty ( ) ) ) { return failCanDoAction ( VdcBllMessages.RNG_ALREADY_EXISTS ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ! ( isRngSupportedByCluster ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL ) ; } if ( ! ( getRngDevices ( ) . isEmpty ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_RNG_ALREADY_EXISTS ) ; } return true ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsListForDisk ( org.ovirt.engine.core.compat.Guid id ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; java.util.List < org.ovirt.engine.core.dao.VmDAODbFacadeImpl.VMWithPlugInfo > vms = getVmsWithPlugInfo ( id ) ; for ( org.ovirt.engine.core.dao.VmDAODbFacadeImpl.VMWithPlugInfo vm : vms ) { result.add ( vm.getVM ( ) ) ; } return result ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsListForDisk ( org.ovirt.engine.core.compat.Guid id , boolean includeVmsSnapshotAttachedTo ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > > vms = getVmsWithPlugInfo ( id ) ; for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > pair : vms ) { if ( includeVmsSnapshotAttachedTo || ( ( pair.getSecond ( ) . getSnapshotId ( ) ) == null ) ) { result.add ( pair.getFirst ( ) ) ; } } return result ; }
Source:
public void testExecuteQuery ( ) { java.lang.String vmName = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getName ( ) ) . thenReturn ( vmName ) ; boolean result = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextBoolean ( ) ; org.mockito.Mockito.doReturn ( result ) . when ( getQuery ( ) ) . isVmWithSameNameExistStatic ( vmName , null ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( "Wrong result" , result , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testExecuteQuery ( ) { java.lang.String vmName = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getName ( ) ) . thenReturn ( vmName ) ; boolean result = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextBoolean ( ) ; org.mockito.Mockito.doReturn ( result ) . when ( getQuery ( ) ) . isVmWithSameNameExistStatic ( vmName , null ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( result , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) , "Wrong result" ) ; }
Source:
private static void mapHostNetworkQosToEntity ( org.ovirt.engine.api.model.QoS model , org.ovirt.engine.core.common.businessentities.network.HostNetworkQos entity ) { if ( model.isSetOutboundAverageLinkshare ( ) ) { entity.setOutAverageLinkshare ( model.getOutboundAverageLinkshare ( ) ) ; } if ( model.isSetOutboundAverageUpperlimit ( ) ) { entity.setOutAverageUpperlimit ( model.getOutboundAverageUpperlimit ( ) ) ; } if ( model.isSetOutboundAverageRealtime ( ) ) { entity.setOutAverageRealtime ( model.getOutboundAverageRealtime ( ) ) ; } }

Target:
private static void mapHostNetworkQosToEntity ( org.ovirt.engine.api.model.Qos model , org.ovirt.engine.core.common.businessentities.network.HostNetworkQos entity ) { if ( model.isSetOutboundAverageLinkshare ( ) ) { entity.setOutAverageLinkshare ( model.getOutboundAverageLinkshare ( ) ) ; } if ( model.isSetOutboundAverageUpperlimit ( ) ) { entity.setOutAverageUpperlimit ( model.getOutboundAverageUpperlimit ( ) ) ; } if ( model.isSetOutboundAverageRealtime ( ) ) { entity.setOutAverageRealtime ( model.getOutboundAverageRealtime ( ) ) ; } }
Source:
public void updateOptions ( ) { getCompulsoryActions ( ) . clear ( ) ; getOptionalActions ( ) . clear ( ) ; if ( ( getEntity ( ) ) != null ) { startProgress ( null ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getVmDiskList ( 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 ) { updateOptionsPostData ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ) ; } } ) , getEntity ( ) . getId ( ) ) ; } }

Target:
public void updateOptions ( boolean containsDisks ) { getCompulsoryActions ( ) . clear ( ) ; getOptionalActions ( ) . clear ( ) ; startProgress ( null ) ; org.ovirt.engine.ui.uicommonweb.UICommand addDiskAction = new org.ovirt.engine.ui.uicommonweb.UICommand ( "AddDisk" , this ) ; if ( ! containsDisks ) { addDiskAction.setTitle ( VmConfigureVirtualDisksAction ) ; getCompulsoryActions ( ) . add ( addDiskAction ) ; } else { addDiskAction.setTitle ( VmAddAnotherVirtualDiskAction ) ; getOptionalActions ( ) . add ( addDiskAction ) ; } stopProgress ( ) ; }
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.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" ) ; }

Target:
public void init ( ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initializing Scheduling manager" ) ; loadPolicyUnits ( ) ; loadClusterPolicies ( ) ; loadExternalScheduler ( ) ; enableLoadBalancer ( ) ; enableHaReservationCheck ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initialized Scheduling manager" ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > getInterfaces ( ) { if ( ( interfaces ) == null ) { interfaces = getVmNicDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } return interfaces ; }

Target:
protected void removeVmUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsVmMap > all = org.ovirt.engine.core.bll.VmCommand.getTagDao ( ) . getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsVmMap tagVm : all ) { org.ovirt.engine.core.bll.VmCommand.getTagDao ( ) . detachVmFromTag ( tagVm.gettag_id ( ) , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } }
Source:
private java.lang.String getTypeRef ( org.ovirt.api.metamodel.concepts.Type type ) { if ( ( type instanceof org.ovirt.api.metamodel.concepts.StructType ) || ( type instanceof org.ovirt.api.metamodel.concepts.PrimitiveType ) ) { return type.getName ( ) . toString ( ) ; } if ( type instanceof org.ovirt.api.metamodel.concepts.ListType ) { org.ovirt.api.metamodel.concepts.ListType listType = ( ( org.ovirt.api.metamodel.concepts.ListType ) ( type ) ) ; org.ovirt.api.metamodel.concepts.Type elementType = listType.getElementType ( ) ; return ( getTypeRef ( elementType ) ) + "[]" ; } return "" ; }

Target:
private java.lang.String getTypeRef ( org.ovirt.api.metamodel.concepts.Type type ) { if ( ( ( type instanceof org.ovirt.api.metamodel.concepts.StructType ) || ( type instanceof org.ovirt.api.metamodel.concepts.PrimitiveType ) ) || ( type instanceof org.ovirt.api.metamodel.concepts.EnumType ) ) { return type.getName ( ) . toString ( ) ; } if ( type instanceof org.ovirt.api.metamodel.concepts.ListType ) { org.ovirt.api.metamodel.concepts.ListType listType = ( ( org.ovirt.api.metamodel.concepts.ListType ) ( type ) ) ; org.ovirt.api.metamodel.concepts.Type elementType = listType.getElementType ( ) ; return ( getTypeRef ( elementType ) ) + "[]" ; } return "" ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc shutdownHost ( int reboot ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.shutdownHost ( reboot ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc glusterHostUUIDGet ( ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterHostUUIDGet ( ) ; org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testValidateNoVM ( ) { org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setId ( new org.ovirt.engine.core.compat.Guid ( "a09f57b1-5739-4352-bf88-a6f834ed46db" ) ) ; params.setAction ( VmWatchdogAction.PAUSE ) ; params.setModel ( vmWatchdogType ) ; final org.ovirt.engine.core.dao.VmDao vmDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDao.class ) ; org.ovirt.engine.core.bll.UpdateWatchdogCommand command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateWatchdogCommand ( params , null ) ) ; org.mockito.Mockito.doReturn ( vmDaoMock ) . when ( command ) . getVmDao ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }

Target:
public void getSpecParams ( ) { command.getParameters ( ) . setAction ( VmWatchdogAction.RESET ) ; command.getParameters ( ) . setModel ( vmWatchdogType ) ; java.util.HashMap < java.lang.String , java.lang.Object > specParams = command.getSpecParams ( ) ; org.junit.Assert.assertNotNull ( specParams ) ; org.junit.Assert.assertEquals ( "i6300esb" , specParams.get ( "model" ) ) ; org.junit.Assert.assertEquals ( "reset" , specParams.get ( "action" ) ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult validateVdsStatus ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) && ( ( vm.getRunOnVds ( ) ) != null ) ) && ( ( getVdsDynamic ( vm.getRunOnVds ( ) ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , VdcBllMessages.VAR__HOST_STATUS__UP.toString ( ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult validateVdsStatus ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) && ( ( vm.getRunOnVds ( ) ) != null ) ) && ( ( getVdsDynamic ( vm.getRunOnVds ( ) ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , EngineMessage.VAR__HOST_STATUS__UP.toString ( ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public static void GetRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters ( roleId ) , aQuery ) ; }

Target:
public static void IsTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmTemlateWithSameNameExistParameters ( name ) , aQuery ) ; }
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 getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
private boolean validateCanUpdateReadOnly ( ) { if ( ( shouldUpdateReadOnly ( ) ) && ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return true ; }

Target:
private boolean validateCanUpdateReadOnly ( ) { if ( ( ( updateReadOnlyRequested ( ) ) && ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) && ( vmDeviceForVm.getIsPlugged ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return true ; }
Source:
private void updateFenceAgents ( ) { if ( ( getParameters ( ) . getFenceAgents ( ) ) != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getFenceAgentDao ( ) . removeByVdsId ( getVdsId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent : getParameters ( ) . getFenceAgents ( ) ) { agent.setHostId ( getVdsId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getFenceAgentDao ( ) . save ( agent ) ; } } }

Target:
private void updateFenceAgents ( ) { if ( ( getParameters ( ) . getFenceAgents ( ) ) != null ) { fenceAgentDao.removeByVdsId ( getVdsId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent : getParameters ( ) . getFenceAgents ( ) ) { agent.setHostId ( getVdsId ( ) ) ; fenceAgentDao.save ( agent ) ; } } }
Source:
private void updateActionAvailability ( ) { getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) > 0 ) ) ) ; }

Target:
private void updateActionAvailability ( ) { newCommand.setIsExecutionAllowed ( isExecutionAllowed ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) > 0 ) ) && ( isExecutionAllowed ) ) ) ; }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { if ( ( ( getVm ( ) . getrun_on_vds ( ) ) != null ) && ( getVm ( ) . getrun_on_vds ( ) . equals ( vds.getId ( ) ) ) ) { sb.append ( "is the same host the VM is currently running on" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_TO_SAME_HOST ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { java.lang.Integer cores = org.ovirt.engine.core.bll.VdsSelector.getEffectiveCpuCores ( vds ) ; if ( ( cores != null ) && ( ( getVm ( ) . getNumOfCpus ( ) ) > cores ) ) { sb.append ( "has less cores(" ) . append ( cores ) . append ( ") than " ) . append ( getVm ( ) . getNumOfCpus ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ( snapshots ) == null ) || ( snapshots.isEmpty ( ) ) ) { failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NO_SNAPSHOTS_EXIST , getGlusterVolumeName ( ) ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession session : georepSessions ) { if ( ( ( session.getSlaveVolumeId ( ) ) == null ) || ( ( session.getSlaveNodeUuid ( ) ) == null ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_REMOTE_CLUSTER_NOT_MAINTAINED_BY_ENGINE ) ; } } if ( ( ( snapshots ) == null ) || ( snapshots.isEmpty ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NO_SNAPSHOTS_EXIST , getGlusterVolumeName ( ) ) ; } return true ; }
Source:
private java.util.Set < java.lang.String > getRemovedBonds ( ) { if ( ( removedBonds ) == null ) { removedBonds = new java.util.HashSet ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) . size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Bond bond : org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) ) { removedBonds.add ( bond.getName ( ) ) ; } } return removedBonds ; }

Target:
private org.ovirt.engine.core.common.vdscommands.HostSetupNetworksVdsCommandParameters createSetupNetworksParameters ( int timeout ) { final org.ovirt.engine.core.common.vdscommands.HostSetupNetworksVdsCommandParameters hostCmdParams = new org.ovirt.engine.core.common.vdscommands.HostSetupNetworksVdsCommandParameters ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getVds ( ) , getNetworksToConfigure ( ) , getRemovedNetworks ( ) , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getBonds ( ) , getRemovedBondNames ( ) ) ; hostCmdParams.setRollbackOnFailure ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . rollbackOnFailure ( ) ) ; hostCmdParams.setConectivityTimeout ( timeout ) ; boolean hostNetworkQosSupported = org.ovirt.engine.core.common.FeatureSupported.hostNetworkQos ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getVds ( ) . getVdsGroupCompatibilityVersion ( ) ) ; hostCmdParams.setHostNetworkQosSupported ( hostNetworkQosSupported ) ; return hostCmdParams ; }
Source:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult domainIsValidDestination ( ) { if ( ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) || ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult domainIsValidDestination ( ) { if ( storageDomain.getStorageDomainType ( ) . isIsoOrImportExportDomain ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void testAttachFailure ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpActionExpectations ( ActionType.AttachStorageConnectionToStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , false , false ) ; org.ovirt.engine.api.model.StorageConnection connection = new org.ovirt.engine.api.model.StorageConnection ( ) ; connection.setId ( GUIDS [ 3 ] . toString ( ) ) ; try { javax.ws.rs.core.Response response = collection.add ( connection ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyBadRequest ( wae ) ; } }

Target:
public void testAttachFailure ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpActionExpectations ( ActionType.AttachStorageConnectionToStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , false , false ) ; org.ovirt.engine.api.model.StorageConnection connection = new org.ovirt.engine.api.model.StorageConnection ( ) ; connection.setId ( GUIDS [ 3 ] . toString ( ) ) ; verifyBadRequest ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( connection ) ) ) ; }
Source:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VDS getInverse ( org.ovirt.engine.core.common.businessentities.VdsStatic to ) { org.ovirt.engine.core.common.businessentities.VDS inverse = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; inverse.setId ( to.getId ( ) ) ; inverse.setvds_name ( to.getvds_name ( ) ) ; inverse.sethost_name ( to.gethost_name ( ) ) ; inverse.setvds_group_id ( to.getvds_group_id ( ) ) ; inverse.setport ( to.getport ( ) ) ; inverse.setVdsSpmPriority ( to.getVdsSpmPriority ( ) ) ; return inverse ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VDS getInverse ( org.ovirt.engine.core.common.businessentities.VdsStatic to ) { org.ovirt.engine.core.common.businessentities.VDS inverse = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; inverse.setId ( to.getId ( ) ) ; inverse.setVdsName ( to.getVdsName ( ) ) ; inverse.setHostName ( to.getHostName ( ) ) ; inverse.setVdsGroupId ( to.getVdsGroupId ( ) ) ; inverse.setPort ( to.getPort ( ) ) ; inverse.setVdsSpmPriority ( to.getVdsSpmPriority ( ) ) ; inverse.setConsoleAddress ( to.getConsoleAddress ( ) ) ; return inverse ; }
Source:
private void updateAdminStatus ( org.ovirt.engine.core.common.businessentities.permissions perm ) { org.ovirt.engine.core.common.businessentities.Role role = org.ovirt.engine.core.bll.AddPermissionCommand.getRoleDao ( ) . get ( perm.getrole_id ( ) ) ; if ( ( role.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.RoleType.ADMIN ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.setIsAdminGUIFlag ( perm.getad_element_id ( ) , true ) ; } }

Target:
private void updateAdminStatus ( org.ovirt.engine.core.common.businessentities.Permissions perm ) { org.ovirt.engine.core.common.businessentities.Role role = org.ovirt.engine.core.bll.AddPermissionCommand.getRoleDao ( ) . get ( perm.getrole_id ( ) ) ; if ( ( role.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.RoleType.ADMIN ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.setIsAdminGUIFlag ( perm.getad_element_id ( ) , true ) ; } }
Source:
public void generate ( org.ovirt.api.metamodel.concepts.Model model ) throws java.io.IOException { buffer = new org.ovirt.sdk.ruby.RubyBuffer ( ) ; buffer.setFileName ( ( ( ( rubyNames.getModulePath ( ) ) + ( java.io.File.separator ) ) + "version" ) ) ; generateVersion ( ) ; try { buffer.write ( out ) ; } catch ( java.io.IOException exception ) { throw new java.lang.IllegalStateException ( "Error writing version file" , exception ) ; } }

Target:
public void generate ( org.ovirt.api.metamodel.concepts.Model model ) throws java.io.IOException { buffer = javax.enterprise.inject.spi.CDI.current ( ) . select ( org.ovirt.sdk.ruby.RubyBuffer.class ) . get ( ) ; buffer.setFileName ( ( ( ( rubyNames.getModulePath ( ) ) + ( java.io.File.separator ) ) + "version" ) ) ; generateVersion ( ) ; try { buffer.write ( out ) ; } catch ( java.io.IOException exception ) { throw new java.lang.IllegalStateException ( "Error writing version file" , exception ) ; } }
Source:
public static void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment model = createIncompleteNetworkAttachment ( ) ; setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "NetworkAttachment" , "add" , getIncompleteFields ( ) ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment model = createIncompleteNetworkAttachment ( ) ; setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.setUpBasicUriExpectations ( ) ) ; setUpVerifyHostExpectations ( ) ; control.replay ( ) ; try { collection.add ( model ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "NetworkAttachment" , "add" , getIncompleteFields ( ) ) ; } }
Source:
public void doPolling ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { org.ovirt.engine.core.bll.CommandBase < ? > rootCommand = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.retrieveCommand ( cmdId ) ; if ( ( childCommandsExist ( childCmdIds ) ) && ( evaluateHostUpgradeInternalCommandProgress ( childCmdIds , rootCommand ) ) ) { return ; } if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( getHostUpgradeInternalCmdId ( childCmdIds ) ) ) { evaluateMaintenanceHostCommandProgress ( childCmdIds , rootCommand ) ; } }

Target:
public void doPolling ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { org.ovirt.engine.core.bll.CommandBase < ? > rootCommand = commandCoordinatorUtil.retrieveCommand ( cmdId ) ; if ( ( childCommandsExist ( childCmdIds ) ) && ( evaluateHostUpgradeInternalCommandProgress ( childCmdIds , rootCommand ) ) ) { return ; } if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( getHostUpgradeInternalCmdId ( childCmdIds ) ) ) { evaluateMaintenanceHostCommandProgress ( childCmdIds , rootCommand ) ; } }
Source:
public boolean addMac ( java.lang.String mac ) { lockObj.writeLock ( ) . lock ( ) ; try { checkIfInitialized ( ) ; boolean added = macsStorage.useMac ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( mac ) ) ; logWhenMacPoolIsEmpty ( ) ; return added ; } finally { lockObj.writeLock ( ) . unlock ( ) ; } }

Target:
public boolean addMac ( java.lang.String mac ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock l = new org.ovirt.engine.core.utils.lock.AutoCloseableLock ( lockObj.writeLock ( ) ) ) { checkIfInitialized ( ) ; boolean added = macsStorage.useMac ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( mac ) ) ; logWhenMacPoolIsEmpty ( ) ; return added ; } }