auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Event event ) { validateParameters ( event , "origin" , "severity" , "customId" , "description" ) ; validateEnums ( org.ovirt.engine.api.model.Event.class , event ) ; return performCreate ( VdcActionType.AddExternalEvent , getParameters ( event ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < java.lang.Long > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetAuditLogById , org.ovirt.engine.core.common.queries.GetAuditLogByIdParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Event event ) { validateParameters ( event , "origin" , "severity" , "customId" , "description" ) ; return performCreate ( VdcActionType.AddExternalEvent , getParameters ( event ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < java.lang.Long > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetAuditLogById , org.ovirt.engine.core.common.queries.GetAuditLogByIdParameters.class ) ) ; }
Source:
public void testRemoveNotExisting ( ) throws java.lang.Exception { setUpGetNotExistingEntityExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendStorageServerConnectionResource.HOST , GUIDS [ 1 ] . toString ( ) ) ; setUriInfo ( uriInfo ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNotExisting ( ) throws java.lang.Exception { setUpGetNotExistingEntityExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendStorageServerConnectionResource.HOST , GUIDS [ 1 ] . toString ( ) ) ; setUriInfo ( uriInfo ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , C value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < C > valueUpdater ) { com.google.gwt.safehtml.shared.SafeHtml tooltip = getTooltip ( value ) ; if ( tooltip == null ) { tooltip = getTooltip ( value , parent ) ; } org.ovirt.engine.ui.common.utils.ElementTooltipUtils.handleCellEvent ( event , parent , tooltip ) ; super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , C value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < C > valueUpdater ) { com.google.gwt.safehtml.shared.SafeHtml tooltip = getTooltip ( value ) ; if ( tooltip == null ) { tooltip = getTooltip ( value , parent , event ) ; } org.ovirt.engine.ui.common.utils.ElementTooltipUtils.handleCellEvent ( event , parent , tooltip ) ; super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; }
Source:
protected void onReveal ( ) { org.ovirt.engine.ui.uicompat.Event < org.ovirt.engine.ui.uicompat.EventArgs > entityChangedEvent = getModel ( ) . getDiskViewType ( ) . getEntityChangedEvent ( ) ; if ( ! ( entityChangedEvent.getListeners ( ) . contains ( getView ( ) . getDiskTypeChangedEventListener ( ) ) ) ) { entityChangedEvent.addListener ( getView ( ) . getDiskTypeChangedEventListener ( ) ) ; } super . onReveal ( ) ; getView ( ) . handleQuotaColumnVisibility ( ) ; }

Target:
protected void onReveal ( ) { super . onReveal ( ) ; getView ( ) . handleQuotaColumnVisibility ( ) ; }
Source:
public void testList ( ) throws java.lang.Exception { int numOfEntitiesInList = 2 ; setUpGetEntityExpectations ( VdcQueryType.GetStorageServerConnectionExtensionsByHostId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionExtensionsResourceTest.hostID } , getEntityList ( numOfEntitiesInList ) ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; control.replay ( ) ; java.util.List < org.ovirt.engine.api.model.StorageConnectionExtension > retCollection = getCollection ( ) ; assertNotNull ( retCollection ) ; assertEquals ( retCollection.size ( ) , numOfEntitiesInList ) ; }

Target:
public void testList ( ) throws java.lang.Exception { int numOfEntitiesInList = 2 ; setUpGetEntityExpectations ( VdcQueryType.GetStorageServerConnectionExtensionsByHostId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionExtensionsResourceTest.hostID } , getEntityList ( numOfEntitiesInList ) ) ; javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; control.replay ( ) ; java.util.List < org.ovirt.engine.api.model.StorageConnectionExtension > retCollection = getCollection ( ) ; assertNotNull ( retCollection ) ; assertEquals ( numOfEntitiesInList , retCollection.size ( ) ) ; }
Source:
private org.ovirt.engine.core.common.action.SetupNetworksParameters createParametersForBond ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > bondedIfaces ) { org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.SetupNetworksParameters ( ) ; parameters.getInterfaces ( ) . add ( bond ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : bondedIfaces ) { parameters.getInterfaces ( ) . add ( enslaveOrReleaseNIC ( iface , bond.getName ( ) ) ) ; } return parameters ; }

Target:
private org.ovirt.engine.core.common.action.SetupNetworksParameters createParametersForBond ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > bondedIfaces ) { org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.SetupNetworksParameters ( ) ; parameters.getInterfaces ( ) . add ( bond ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : bondedIfaces ) { parameters.getInterfaces ( ) . add ( enslaveOrReleaseNIC ( iface , bond.getName ( ) ) ) ; } return parameters ; }
Source:
public void testGetAllNetworkSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Network" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.Network ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( networkResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }

Target:
public void testGetAllNetworkSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Network" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.Network ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( networkResultList , searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
public java.util.Set < java.lang.String > getConsumedEvents ( ) { java.util.Set < java.lang.String > set = new java.util.HashSet < > ( ) ; org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.addTooltipsEvents ( set ) ; set.add ( BrowserEvents.CHANGE ) ; set.add ( BrowserEvents.KEYDOWN ) ; set.add ( BrowserEvents.MOUSEMOVE ) ; return set ; }

Target:
public java.util.Set < java.lang.String > getConsumedEvents ( ) { java.util.Set < java.lang.String > set = new java.util.HashSet ( super . getConsumedEvents ( ) ) ; set.add ( BrowserEvents.MOUSEMOVE ) ; return set ; }
Source:
public java.lang.Object GetValue ( java.lang.Object obj , java.lang.Object defaultValue ) { java.lang.Object returnValue = null ; try { returnValue = pd.getReadMethod ( ) . invoke ( obj ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.compat.backendcompat.PropertyInfo.log.warn ( ( ( ( "Unable to get value of property: " + ( pd.getDisplayName ( ) ) ) + " for class " ) + ( obj.getClass ( ) . getName ( ) ) ) ) ; } return returnValue == null ? defaultValue : returnValue ; }

Target:
public java.lang.Object getValue ( java.lang.Object obj , java.lang.Object defaultValue ) { java.lang.Object returnValue = null ; try { returnValue = pd.getReadMethod ( ) . invoke ( obj ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.compat.backendcompat.PropertyInfo.log.warn ( ( ( ( "Unable to get value of property: " + ( pd.getDisplayName ( ) ) ) + " for class " ) + ( obj.getClass ( ) . getName ( ) ) ) ) ; } return returnValue == null ? defaultValue : returnValue ; }
Source:
public void networkWithTheSameDefaultMTUAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "nonVm" ) ; net.setVmNetwork ( false ) ; org.ovirt.engine.core.common.businessentities.network.Network newNet = createNetwork ( "vlanVm" ) ; newNet.setVlanId ( 100 ) ; mockExistingNetworks ( net , newNet ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic.getName ( ) , newNet.getVlanId ( ) , newNet.getName ( ) ) ) ) ; validateAndExpectNoViolations ( helper ) ; }

Target:
public void networkWithTheSameDefaultMTUAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "nonVm" ) ; net.setVmNetwork ( false ) ; org.ovirt.engine.core.common.businessentities.network.Network newNet = createNetwork ( "vlanVm" ) ; newNet.setVlanId ( 100 ) ; mockExistingNetworks ( net , newNet ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic , newNet.getVlanId ( ) , newNet.getName ( ) ) ) ) ; validateAndExpectNoViolations ( helper ) ; }
Source:
private org.ovirt.engine.core.bll.AddVmFromTemplateCommand < org.ovirt.engine.core.common.action.AddVmFromTemplateParameters > setupCanAddVmFromTemplateTests ( final int domainSizeGB , final int sizeRequired , final int pctRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired , pctRequired ) ; org.ovirt.engine.core.bll.AddVmFromTemplateCommand < org.ovirt.engine.core.common.action.AddVmFromTemplateParameters > cmd = createVmFromTemplateCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; return cmd ; }

Target:
private org.ovirt.engine.core.bll.AddVmFromTemplateCommand < org.ovirt.engine.core.common.action.AddVmFromTemplateParameters > setupCanAddVmFromTemplateTests ( final int domainSizeGB , final int sizeRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; org.ovirt.engine.core.bll.AddVmFromTemplateCommand < org.ovirt.engine.core.common.action.AddVmFromTemplateParameters > cmd = createVmFromTemplateCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; return cmd ; }
Source:
protected boolean setAndValidateDiskProfiles ( ) { return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) , org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getCurrentUser ( ) ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) , org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.storage.disk.image.RegisterDiskCommand.getCurrentUser ( ) ) ) ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters buildCreateVmParameters ( ) { org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters createVmParams = super . buildCreateVmParameters ( ) ; org.ovirt.engine.core.common.action.RunVmOnceParams runOnceParams = org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) ; org.ovirt.engine.core.common.action.SysPrepParams sysPrepParams = new org.ovirt.engine.core.common.action.SysPrepParams ( ) ; sysPrepParams.setSysPrepDomainName ( runOnceParams.getSysPrepDomainName ( ) ) ; sysPrepParams.setSysPrepUserName ( runOnceParams.getSysPrepUserName ( ) ) ; sysPrepParams.setSysPrepPassword ( runOnceParams.getSysPrepPassword ( ) ) ; createVmParams.setSysPrepParams ( sysPrepParams ) ; createVmParams.setVmInit ( runOnceParams.getVmInit ( ) ) ; return createVmParams ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters buildCreateVmParameters ( ) { org.ovirt.engine.core.common.vdscommands.CreateVmVDSCommandParameters createVmParams = super . buildCreateVmParameters ( ) ; org.ovirt.engine.core.common.action.RunVmOnceParams runOnceParams = org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) ; org.ovirt.engine.core.common.action.SysPrepParams sysPrepParams = new org.ovirt.engine.core.common.action.SysPrepParams ( ) ; sysPrepParams.setSysPrepDomainName ( runOnceParams.getSysPrepDomainName ( ) ) ; sysPrepParams.setSysPrepUserName ( runOnceParams.getSysPrepUserName ( ) ) ; sysPrepParams.setSysPrepPassword ( runOnceParams.getSysPrepPassword ( ) ) ; createVmParams.setSysPrepParams ( sysPrepParams ) ; createVmParams.getVm ( ) . setVmInit ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getVmInit ( ) ) ; return createVmParams ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getCustomValues ( ) { addCustomValue ( GlusterConstants.VOLUME_NAME , getGlusterVolumeName ( ) ) ; addCustomValue ( GlusterConstants.GEO_REP_USER , getParameters ( ) . getUserName ( ) ) ; addCustomValue ( GlusterConstants.GEO_REP_USER_GROUP , getParameters ( ) . getUserGroup ( ) ) ; addCustomValue ( GlusterConstants.GEO_REP_SLAVE_VOLUME_NAME , getParameters ( ) . getSlaveVolumeName ( ) ) ; addCustomValue ( GlusterConstants.SERVICE_TYPE , ServiceType.GLUSTER.name ( ) ) ; return super . getCustomValues ( ) ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getCustomValues ( ) { addCustomValue ( GlusterConstants.VOLUME_NAME , getGlusterVolumeName ( ) ) ; addCustomValue ( GlusterConstants.GEO_REP_USER , getParameters ( ) . getUserName ( ) ) ; addCustomValue ( GlusterConstants.GEO_REP_SLAVE_VOLUME_NAME , getParameters ( ) . getSlaveVolumeName ( ) ) ; addCustomValue ( GlusterConstants.SERVICE_TYPE , ServiceType.GLUSTER.name ( ) ) ; return super . getCustomValues ( ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase runAction ( org.ovirt.engine.core.bll.CommandBase < ? > command , boolean runAsInternal ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = evaluateCorrelationId ( command ) ; if ( returnValue != null ) { return returnValue ; } command.setInternalExecution ( runAsInternal ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , runAsInternal ) ; command.insertAsyncTaskPlaceHolders ( ) ; returnValue = command.executeAction ( ) ; returnValue.setCorrelationId ( command.getParameters ( ) . getCorrelationId ( ) ) ; returnValue.setJobId ( command.getJobId ( ) ) ; return returnValue ; }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase runAction ( org.ovirt.engine.core.bll.CommandBase < ? > command , boolean runAsInternal ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = evaluateCorrelationId ( command ) ; if ( returnValue != null ) { return returnValue ; } command.setInternalExecution ( runAsInternal ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , runAsInternal ) ; returnValue = command.executeAction ( ) ; returnValue.setCorrelationId ( command.getParameters ( ) . getCorrelationId ( ) ) ; returnValue.setJobId ( command.getJobId ( ) ) ; return returnValue ; }
Source:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.VmPool selectedItem ) { driver.edit ( getDetailModel ( ) ) ; monitorCount.setValue ( java.lang.String.valueOf ( getDetailModel ( ) . getMonitorCount ( ) ) ) ; isStateless.setValue ( java.lang.Boolean.toString ( getDetailModel ( ) . getIsStateless ( ) ) ) ; oS.setValue ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getOsName ( getDetailModel ( ) . getOS ( ) ) ) ; formBuilder.update ( getDetailModel ( ) ) ; defaultHost.setTitle ( getDetailModel ( ) . getDefaultHost ( ) ) ; }

Target:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.VmPool selectedItem ) { driver.edit ( getDetailModel ( ) ) ; monitorCount.setValue ( java.lang.String.valueOf ( getDetailModel ( ) . getMonitorCount ( ) ) ) ; isStateless.setValue ( java.lang.Boolean.toString ( getDetailModel ( ) . getIsStateless ( ) ) ) ; oS.setValue ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getOsName ( getDetailModel ( ) . getOS ( ) ) ) ; formBuilder.update ( getDetailModel ( ) ) ; }
Source:
private static void SetVmTemplateStatus ( org.ovirt.engine.core.compat.Guid vmTemplateGuid , org.ovirt.engine.core.common.businessentities.VmTemplateStatus status , org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . get ( vmTemplateGuid ) ; if ( vmTemplate != null ) { if ( compensationContext != null ) { compensationContext.snapshotEntityStatus ( vmTemplate , vmTemplate.getStatus ( ) ) ; } vmTemplate.setStatus ( status ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . update ( vmTemplate ) ; } else { org.ovirt.engine.core.bll.VmTemplateHandler.log.warnFormat ( "VmTemplateHandler::SetVmTemplateStatus: vmTemplate is null, not setting status '{0}' to vmTemplate" , status ) ; } }

Target:
private static void SetVmTemplateStatus ( org.ovirt.engine.core.compat.Guid vmTemplateGuid , org.ovirt.engine.core.common.businessentities.VmTemplateStatus status , org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . get ( vmTemplateGuid ) ; if ( vmTemplate != null ) { if ( compensationContext != null ) { compensationContext.snapshotEntityStatus ( vmTemplate ) ; } vmTemplate.setStatus ( status ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . update ( vmTemplate ) ; } else { org.ovirt.engine.core.bll.VmTemplateHandler.log.warnFormat ( "VmTemplateHandler::SetVmTemplateStatus: vmTemplate is null, not setting status '{0}' to vmTemplate" , status ) ; } }
Source:
static java.lang.String resolveMessage ( java.lang.String message , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ) { java.lang.String returnValue = message ; if ( logable != null ) { java.util.Map < java.lang.String , java.lang.String > map = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getAvailableValues ( logable ) ; returnValue = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resolveMessage ( message , map ) ; } return returnValue ; }

Target:
static java.lang.String resolveMessage ( java.lang.String message , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ) { java.lang.String returnValue = message ; if ( logable != null ) { java.util.Map < java.lang.String , java.lang.String > map = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getAvailableValues ( message , logable ) ; returnValue = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resolveMessage ( message , map ) ; } return returnValue ; }
Source:
public static org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel createNewSnapshotModel ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.ui.uicommonweb.ICommandTarget cancelCommandTarget ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ( ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . createSnapshotTitle ( ) ) ; model.setHashName ( "create_snapshot" ) ; model.setVm ( vm ) ; model.setCancelCommand ( new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , cancelCommandTarget ) . setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) . setIsCancel ( true ) ) ; model.initialize ( ) ; return model ; }

Target:
public static org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel createNewSnapshotModel ( org.ovirt.engine.ui.uicommonweb.ICommandTarget cancelCommandTarget ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ( ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . createSnapshotTitle ( ) ) ; model.setHashName ( "create_snapshot" ) ; model.setCancelCommand ( new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , cancelCommandTarget ) . setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) . setIsCancel ( true ) ) ; return model ; }
Source:
private void setNonOperational ( 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 ( getVds ( ) . getId ( ) , reason , customLogValues ) ; tempVar.setSaveToDb ( true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
private void setNonOperational ( 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 ( getVds ( ) . getId ( ) , reason , customLogValues ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
public void testList ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpGetEntityExpectations ( VdcQueryType.GetDbUserByUserId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , getUserByIdx ( 1 ) ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }

Target:
public void testList ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpGetEntityExpectations ( VdcQueryType.GetDbUserByUserId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , getUserByIdx ( 1 ) , true ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; verifyCollection ( getCollection ( ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) , null ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getNetworkDao ( ) ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; datacenter = new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ; new_net = new org.ovirt.engine.core.common.businessentities.Network ( ) ; new_net.setname ( "newnet1" ) ; new_net.setdescription ( "New network" ) ; new_net.setstorage_pool_id ( datacenter ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getNetworkDao ( ) ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; datacenter = new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ; new_net = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; new_net.setname ( "newnet1" ) ; new_net.setdescription ( "New network" ) ; new_net.setstorage_pool_id ( datacenter ) ; }
Source:
com.google.gwt.http.client.RequestBuilder createRequest ( java.lang.String engineAuthToken ) { com.google.gwt.http.client.RequestBuilder builder = new com.google.gwt.http.client.RequestBuilder ( com.google.gwt.http.client.RequestBuilder.GET , restApiBaseUrl ) ; builder.setHeader ( "Session-TTL" , restApiSessionTimeout ) ; java.lang.String preferValue = "persistent-auth, csrf-protection" ; if ( engineAuthToken != null ) { preferValue += ", new-auth" ; builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.ENGINE_AUTH_TOKEN_HEADER , engineAuthToken ) ; } builder.setHeader ( "Prefer" , preferValue ) ; java.lang.String sessionId = getSessionId ( ) ; if ( sessionId != null ) { builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.SESSION_ID_HEADER , sessionId ) ; } return builder ; }

Target:
com.google.gwt.http.client.RequestBuilder createRequest ( java.lang.String engineAuthToken ) { com.google.gwt.http.client.RequestBuilder builder = new com.google.gwt.http.client.RequestBuilder ( com.google.gwt.http.client.RequestBuilder.GET , restApiBaseUrl ) ; builder.setHeader ( "Session-TTL" , java.lang.String.valueOf ( restApiSessionTimeout ) ) ; java.lang.String preferValue = "persistent-auth, csrf-protection" ; if ( engineAuthToken != null ) { preferValue += ", new-auth" ; builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.ENGINE_AUTH_TOKEN_HEADER , engineAuthToken ) ; } builder.setHeader ( "Prefer" , preferValue ) ; java.lang.String sessionId = getSessionId ( ) ; if ( sessionId != null ) { builder.setHeader ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.SESSION_ID_HEADER , sessionId ) ; } return builder ; }
Source:
protected void initialize ( com.google.gwt.user.client.ui.UIObject decoratedWidget , com.google.gwt.user.client.ui.Image attachedSeparatedImage , org.ovirt.engine.ui.common.widget.editor.generic.BaseEntityModelDetachableWidget.BaseStyle style ) { this . decoratedWidget = decoratedWidget ; this . attachedSeparatedImage = attachedSeparatedImage ; this . tooltip.setWidget ( attachedSeparatedImage ) ; this . tooltip.reconfigure ( ) ; this . style = style ; setAttached ( true ) ; setDetachableIconVisible ( false ) ; }

Target:
protected void initialize ( com.google.gwt.user.client.ui.UIObject decoratedWidget , com.google.gwt.user.client.ui.Image attachedSeparatedImage , org.ovirt.engine.ui.common.widget.editor.generic.BaseEntityModelDetachableWidget.BaseStyle style ) { this . decoratedWidget = decoratedWidget ; this . attachedSeparatedImage = attachedSeparatedImage ; this . style = style ; setAttached ( true ) ; setDetachableIconVisible ( false ) ; }
Source:
private java.util.List < java.lang.String > nicsToNetworksToSync ( java.util.List < org.ovirt.engine.api.model.HostNIC > hostNics ) { java.util.List < java.lang.String > networks = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.api.model.HostNIC nic : hostNics ) { if ( ( ( nic.isSetOverrideConfiguration ( ) ) && ( nic.isOverrideConfiguration ( ) ) ) && ( nic.isSetNetwork ( ) ) ) { org.ovirt.engine.api.model.Network net = lookupNetwork ( nic.getNetwork ( ) ) ; networks.add ( net.getname ( ) ) ; } } return networks ; }

Target:
private java.util.List < java.lang.String > nicsToNetworksToSync ( java.util.List < org.ovirt.engine.api.model.HostNIC > hostNics ) { java.util.List < java.lang.String > networks = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.api.model.HostNIC nic : hostNics ) { if ( ( ( nic.isSetOverrideConfiguration ( ) ) && ( nic.isOverrideConfiguration ( ) ) ) && ( nic.isSetNetwork ( ) ) ) { org.ovirt.engine.api.model.Network net = lookupNetwork ( nic.getNetwork ( ) ) ; networks.add ( net.getName ( ) ) ; } } return networks ; }
Source:
private javax.ws.rs.core.Response handleFailure ( org.ovirt.engine.api.model.Action action , java.lang.String message ) { action.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( CreationStatus.FAILED ) ) ; action.setFault ( new org.ovirt.engine.api.model.Fault ( ) ) ; action.getFault ( ) . setReason ( message ) ; return javax.ws.rs.core.Response.ok ( ) . entity ( action ) . build ( ) ; }

Target:
private javax.ws.rs.core.Response handleFailure ( org.ovirt.engine.api.model.Action action , java.lang.String message ) { action.setStatus ( CreationStatus.FAILED.value ( ) ) ; action.setFault ( new org.ovirt.engine.api.model.Fault ( ) ) ; action.getFault ( ) . setReason ( message ) ; return javax.ws.rs.core.Response.ok ( ) . entity ( action ) . build ( ) ; }
Source:
private boolean handleQueryError ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue , org.ovirt.engine.ui.uicommonweb.models.users.AdElementListModel model ) { model.setMessage ( null ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { model.setMessage ( org.ovirt.engine.ui.frontend.Frontend.getAppErrorsTranslator ( ) . TranslateErrorTextSingle ( returnValue.getExceptionString ( ) ) ) ; getSearchInProgress ( ) . setEntity ( false ) ; return true ; } return false ; }

Target:
private boolean handleQueryError ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue , org.ovirt.engine.ui.uicommonweb.models.users.AdElementListModel model ) { model.setMessage ( null ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { model.setMessage ( org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getAppErrorsTranslator ( ) . TranslateErrorTextSingle ( returnValue.getExceptionString ( ) ) ) ; getSearchInProgress ( ) . setEntity ( false ) ; return true ; } return false ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ! ( newModel.getName ( ) . getEntity ( ) . equals ( getName ( ) . getEntity ( ) ) ) ) { getName ( ) . getEntityChangedEvent ( ) . removeListener ( networkNameListener ) ; newModel.getName ( ) . getEntityChangedEvent ( ) . removeListener ( this ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { newModel.getName ( ) . setEntity ( getName ( ) . getEntity ( ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.network.NetworkCluster cloneNetworkCluster ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster instance ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster obj = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; obj.setStatus ( instance.getStatus ( ) ) ; obj.setDisplay ( instance.isDisplay ( ) ) ; obj.setRequired ( instance.isRequired ( ) ) ; obj.setMigration ( instance.isMigration ( ) ) ; return obj ; }

Target:
private static org.ovirt.engine.core.common.businessentities.network.NetworkCluster cloneNetworkCluster ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster instance ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster obj = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; obj.setId ( instance.getId ( ) ) ; obj.setStatus ( instance.getStatus ( ) ) ; obj.setDisplay ( instance.isDisplay ( ) ) ; obj.setRequired ( instance.isRequired ( ) ) ; obj.setMigration ( instance.isMigration ( ) ) ; return obj ; }
Source:
private void populateCummulativeStatistics ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.FopStats > fopStats , org.ovirt.engine.ui.uicommonweb.models.ListModel profileStats ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > > fopStatsEntities = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > > ( ) ; for ( int i = 0 ; i < ( fopStats.size ( ) ) ; i ++ ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > fopStatEntity = new org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > ( fopStats.get ( i ) ) ; fopStatsEntities.add ( fopStatEntity ) ; } profileStats.setItems ( fopStatsEntities ) ; }

Target:
private void populateCummulativeStatistics ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.FopStats > fopStats , org.ovirt.engine.ui.uicommonweb.models.ListModel profileStats ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > > fopStatsEntities = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( fopStats.size ( ) ) ; i ++ ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.gluster.FopStats > fopStatEntity = new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( fopStats.get ( i ) ) ; fopStatsEntities.add ( fopStatEntity ) ; } profileStats.setItems ( fopStatsEntities ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderNetworkListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderNetworkListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; }
Source:
protected static boolean canAttachPrestartedVmToUser ( org.ovirt.engine.core.compat.Guid vmId ) { boolean returnValue = true ; java.util.ArrayList < java.lang.String > messages = new java.util.ArrayList < java.lang.String > ( ) ; if ( org.ovirt.engine.core.bll.VmPoolCommandBase.vmAssignedToUser ( vmId , messages ) ) { returnValue = false ; } if ( returnValue ) { if ( ! ( org.ovirt.engine.core.bll.VmPoolCommandBase.vmIsRunningStateless ( vmId ) ) ) { returnValue = false ; } } return returnValue ; }

Target:
protected static boolean canAttachPrestartedVmToUser ( org.ovirt.engine.core.compat.Guid vmId ) { return ( ! ( org.ovirt.engine.core.bll.VmPoolCommandBase.vmAssignedToUser ( vmId , new java.util.ArrayList < java.lang.String > ( ) ) ) ) && ( org.ovirt.engine.core.bll.VmPoolCommandBase.vmIsRunningStateless ( vmId ) ) ; }
Source:
private org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters buildCreateSnapshotParameters ( ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters parameters = new org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , org.ovirt.engine.core.bll.RunVmCommand.STATELESS_SNAPSHOT_DESCRIPTION ) ; parameters.setShouldBeLogged ( false ) ; parameters.setParentCommand ( org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) ) ; parameters.setParentParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) ) ; parameters.setEntityInfo ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getEntityInfo ( ) ) ; parameters.setSnapshotType ( SnapshotType.STATELESS ) ; return parameters ; }

Target:
private org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters buildCreateSnapshotParameters ( ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters parameters = new org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , org.ovirt.engine.core.bll.RunVmCommand.STATELESS_SNAPSHOT_DESCRIPTION , false ) ; parameters.setShouldBeLogged ( false ) ; parameters.setParentCommand ( org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) ) ; parameters.setParentParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) ) ; parameters.setEntityInfo ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getEntityInfo ( ) ) ; parameters.setSnapshotType ( SnapshotType.STATELESS ) ; return parameters ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , getRequiredAddFields ( ) ) ; org.ovirt.engine.core.common.businessentities.network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = getActionParameters ( network , entity ) ; return performCreation ( addAction , params , new org.ovirt.engine.api.restapi.resource.DataCenterNetworkIdResolver ( network.getName ( ) , params.getStoragePoolId ( ) . toString ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , getRequiredAddFields ( ) ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = getActionParameters ( network , entity ) ; return performCreation ( addAction , params , new org.ovirt.engine.api.restapi.resource.DataCenterNetworkIdResolver ( network.getName ( ) , params.getStoragePoolId ( ) . toString ( ) ) ) ; }
Source:
protected org.ovirt.engine.core.bll.UpdateVmPoolCommand < org.ovirt.engine.core.common.action.AddVmPoolParameters > createCommand ( ) { org.ovirt.engine.core.common.action.AddVmPoolParameters param = new org.ovirt.engine.core.common.action.AddVmPoolParameters ( vmPools , testVm , VM_COUNT ) ; param.setStorageDomainId ( firstStorageDomainId ) ; return org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateVmPoolCommand ( param , org.ovirt.engine.core.bll.context.CommandContext.createContext ( param.getSessionId ( ) ) ) ) ; }

Target:
protected org.ovirt.engine.core.bll.UpdateVmPoolCommand < org.ovirt.engine.core.common.action.AddVmPoolParameters > createCommand ( ) { org.ovirt.engine.core.common.action.AddVmPoolParameters param = new org.ovirt.engine.core.common.action.AddVmPoolParameters ( vmPools , testVm , VM_COUNT ) ; param.setStorageDomainId ( firstStorageDomainId ) ; return org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateVmPoolCommand ( param , null ) ) ; }
Source:
protected void setUpGetGraphicsExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetGraphicsDevices , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ) ) ; } }

Target:
protected void setUpGetGraphicsExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetGraphicsDevices , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ) ) ; } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic storage = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainStaticDao ( ) . get ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( storage.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = executeVerb ( ) ; buildOvfReturnValue ( retVal.getReturnValue ( ) ) ; } else { org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getQueryReturnValue ( ) . setReturnValue ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic storage = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainStaticDao ( ) . get ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( storage.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = null ; retVal = executeVerb ( storage ) ; buildOvfReturnValue ( retVal.getReturnValue ( ) ) ; } else { org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getQueryReturnValue ( ) . setReturnValue ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ) ; } }
Source:
private boolean isMakeCreatorExplicitOwner ( ) { return ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isMakeCreatorExplicitOwner ( ) ) || ( ! ( checkUserAuthorization ( org.ovirt.engine.core.bll.AddVmCommand.getCurrentUser ( ) . getId ( ) , ActionGroup.MANIPULATE_PERMISSIONS , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , VdcObjectType.VM ) ) ) ; }

Target:
private boolean isMakeCreatorExplicitOwner ( ) { return ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isMakeCreatorExplicitOwner ( ) ) || ( ( ( org.ovirt.engine.core.bll.AddVmCommand.getCurrentUser ( ) ) != null ) && ( ! ( checkUserAuthorization ( org.ovirt.engine.core.bll.AddVmCommand.getCurrentUser ( ) . getId ( ) , ActionGroup.MANIPULATE_PERMISSIONS , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , VdcObjectType.VM ) ) ) ) ; }
Source:
protected void updateUserCdImage ( org.ovirt.engine.core.compat.Guid storagePoolId ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getIrsImageList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < java.lang.String > images = ( ( java.util.List < java.lang.String > ) ( returnValue ) ) ; setImagesToModel ( model , images ) ; } } ) , storagePoolId ) ; }

Target:
protected void updateUserCdImage ( org.ovirt.engine.core.compat.Guid storagePoolId ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getIrsImageList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < java.lang.String > images = ( ( java.util.List < java.lang.String > ) ( returnValue ) ) ; setImagesToModel ( model , images ) ; } } ) , storagePoolId ) ; }