auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.CreateSnapshotCommand.CanCreateSnapshot ( ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = performImageVdsmOperation ( ) ; if ( ( vdsReturnValue != null ) && ( vdsReturnValue.getSucceeded ( ) ) ) { ProcessOldImageFromDb ( ) ; AddDiskImageToDb ( mNewCreatedDiskImage , null ) ; setActionReturnValue ( mNewCreatedDiskImage ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.setSucceeded ( true ) ; } } }

Target:
protected void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.CreateSnapshotCommand.canCreateSnapshot ( ) ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = performImageVdsmOperation ( ) ; if ( ( vdsReturnValue != null ) && ( vdsReturnValue.getSucceeded ( ) ) ) { processOldImageFromDb ( ) ; addDiskImageToDb ( mNewCreatedDiskImage , null ) ; setActionReturnValue ( mNewCreatedDiskImage ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.setSucceeded ( true ) ; } } }
Source:
protected boolean canDoAction ( ) { if ( ! ( ( ( getSourceVmFromDb ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) || ( getSourceVmFromDb ( ) . isDown ( ) ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return super . canDoAction ( ) ; }

Target:
protected boolean validate ( ) { if ( ! ( ( ( getSourceVmFromDb ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) || ( getSourceVmFromDb ( ) . isDown ( ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return super . validate ( ) ; }
Source:
protected void syncSearch ( ) { org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { setItems ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; } } ; org.ovirt.engine.core.common.queries.VdcQueryParametersBase params = new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ; params.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , params , asyncQuery ) ; }

Target:
protected void syncSearch ( ) { org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { setItems ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; } } ; org.ovirt.engine.core.common.queries.GetAllProvidersParameters params = new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) ; params.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , params , asyncQuery ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkResourceTest.NETWORK_ID } , getEntity ( 0 ) ) ; verifyModel ( resource.get ( ) , 0 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; verifyModel ( resource.get ( ) , 0 ) ; }
Source:
protected boolean isDiskExists ( org.ovirt.engine.core.compat.Guid id ) { return org.ovirt.engine.core.bll.ImportVmCommand.getBaseDiskDao ( ) . exists ( id ) ; }

Target:
java.util.Set < org.ovirt.engine.core.common.businessentities.GraphicsType > getGraphicsTypesForVm ( ) { java.util.Set < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypes = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice graphics : getDevicesOfType ( VmDeviceGeneralType.GRAPHICS ) ) { graphicsTypes.add ( org.ovirt.engine.core.common.businessentities.GraphicsType.fromVmDeviceType ( org.ovirt.engine.core.common.utils.VmDeviceType.getByName ( graphics.getDevice ( ) ) ) ) ; } return graphicsTypes ; }
Source:
private void verifyAsyncActionStartedAndCompleted ( ) { verifyAsyncActionStarted ( ) ; org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.atLeastOnce ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( testState ) ) ; }

Target:
private void verifyAsyncActionStartedAndSucceeded ( ) { verifyAsyncActionStarted ( ) ; org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.atLeastOnce ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( testState , true , true ) ) ; org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.never ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( testState , true , false ) ) ; }
Source:
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 ) ; }

Target:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { 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.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public void testGetBondMode ( ) { for ( org.ovirt.engine.core.common.businessentities.network.BondMode bondMode : org.ovirt.engine.core.common.businessentities.network.BondMode.values ( ) ) { org.junit.Assert.assertEquals ( bondMode , org.ovirt.engine.core.common.businessentities.network.BondMode.getBondMode ( bondMode.getValue ( ) ) ) ; org.junit.Assert.assertEquals ( bondMode , org.ovirt.engine.core.common.businessentities.network.BondMode.getBondMode ( bondMode.getStringValue ( ) ) ) ; org.junit.Assert.assertNull ( org.ovirt.engine.core.common.businessentities.network.BondMode.getBondMode ( ( "mode=" + ( bondMode.getValue ( ) ) ) ) ) ; org.junit.Assert.assertNull ( org.ovirt.engine.core.common.businessentities.network.BondMode.getBondMode ( ( "mode=" + ( bondMode.getStringValue ( ) ) ) ) ) ; } }

Target:
public void testGetBondMode ( ) { for ( org.ovirt.engine.core.common.businessentities.network.BondMode bondMode : org.ovirt.engine.core.common.businessentities.network.BondMode.values ( ) ) { org.junit.jupiter.api.Assertions.assertEquals ( bondMode , org.ovirt.engine.core.common.businessentities.network.BondMode.getBondMode ( bondMode.getValue ( ) ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( bondMode , org.ovirt.engine.core.common.businessentities.network.BondMode.getBondMode ( bondMode.getStringValue ( ) ) ) ; org.junit.jupiter.api.Assertions.assertNull ( org.ovirt.engine.core.common.businessentities.network.BondMode.getBondMode ( ( "mode=" + ( bondMode.getValue ( ) ) ) ) ) ; org.junit.jupiter.api.Assertions.assertNull ( org.ovirt.engine.core.common.businessentities.network.BondMode.getBondMode ( ( "mode=" + ( bondMode.getStringValue ( ) ) ) ) ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.network.NetworkView mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.NetworkView entity = super . mapRow ( rs , rowNum ) ; entity.setStoragePoolName ( rs.getString ( "storage_pool_name" ) ) ; entity.setCompatabilityVersion ( new org.ovirt.engine.core.compat.Version ( rs.getString ( "compatibility_version" ) ) ) ; entity.setProviderName ( rs.getString ( "provider_name" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.NetworkView mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.NetworkView entity = super . mapRow ( rs , rowNum ) ; entity.setStoragePoolName ( rs.getString ( "storage_pool_name" ) ) ; entity.setCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( rs.getString ( "compatibility_version" ) ) ) ; entity.setProviderName ( rs.getString ( "provider_name" ) ) ; return entity ; }
Source:
public void doTestRegister ( org.ovirt.engine.core.common.businessentities.Cluster cluster , boolean importAsNewEntity ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.ImportVmFromConfiguration , org.ovirt.engine.core.common.action.ImportVmParameters.class , new java.lang.String [ ] { "ContainerId" , "StorageDomainId" , "ClusterId" , "ImportAsNewEntity" , "ImagesExistOnTargetStorageDomain" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.VM_ID , GUIDS [ 3 ] , GUIDS [ 1 ] , importAsNewEntity , true } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setCluster ( cluster ) ; action.setClone ( importAsNewEntity ) ; verifyActionResponse ( resource.register ( action ) ) ; }

Target:
public void doTestRegister ( org.ovirt.engine.core.common.businessentities.Cluster cluster , boolean importAsNewEntity ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.ImportVmFromConfiguration , org.ovirt.engine.core.common.action.ImportVmParameters.class , new java.lang.String [ ] { "ContainerId" , "StorageDomainId" , "ClusterId" , "ImportAsNewEntity" , "ImagesExistOnTargetStorageDomain" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.VM_ID , GUIDS [ 3 ] , GUIDS [ 1 ] , importAsNewEntity , true } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setCluster ( cluster ) ; action.setClone ( importAsNewEntity ) ; verifyActionResponse ( resource.register ( action ) ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.MoveDiskModel moveDiskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.MoveDiskModel ) ( vmListModel.getWindow ( ) ) ) ; java.util.LinkedList < org.ovirt.engine.core.common.businessentities.DiskImage > disks = ( ( java.util.LinkedList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( returnValue ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; diskImages.addAll ( disks ) ; moveDiskModel.init ( diskImages ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( target ) ) ; vmListModel.postMigrateGetUpHosts ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ) ; }
Source:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }

Target:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmsWithNumaByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.UpdateNetworkOnClusterCommand.getNetworkClusterDAO ( ) . update ( getNetworkCluster ( ) ) ; if ( getNetworkCluster ( ) . getis_display ( ) ) { org.ovirt.engine.core.bll.UpdateNetworkOnClusterCommand.getNetworkClusterDAO ( ) . setNetworkExclusivelyAsDisplay ( org.ovirt.engine.core.bll.UpdateNetworkOnClusterCommand.getVdsGroupId ( ) , getNetwork ( ) . getId ( ) ) ; } org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.SetNetworkStatus ( org.ovirt.engine.core.bll.UpdateNetworkOnClusterCommand.getVdsGroupId ( ) , getNetwork ( ) ) ; org.ovirt.engine.core.bll.UpdateNetworkOnClusterCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.UpdateNetworkOnClusterCommand.getNetworkClusterDAO ( ) . update ( getNetworkCluster ( ) ) ; if ( getNetworkCluster ( ) . getis_display ( ) ) { org.ovirt.engine.core.bll.UpdateNetworkOnClusterCommand.getNetworkClusterDAO ( ) . setNetworkExclusivelyAsDisplay ( org.ovirt.engine.core.bll.UpdateNetworkOnClusterCommand.getVdsGroupId ( ) , getNetwork ( ) . getId ( ) ) ; } org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( org.ovirt.engine.core.bll.UpdateNetworkOnClusterCommand.getVdsGroupId ( ) , getNetwork ( ) ) ; org.ovirt.engine.core.bll.UpdateNetworkOnClusterCommand.setSucceeded ( true ) ; }
Source:
public void getDataCenterMaxNameLength ( 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 ) ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public 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 ) ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.action.RemoveDiskParameters buildChildCommandParameters ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { org.ovirt.engine.core.common.action.RemoveDiskParameters param = new org.ovirt.engine.core.common.action.RemoveDiskParameters ( cinderDisk.getId ( ) , cinderDisk.getStorageIds ( ) . get ( 0 ) ) ; return withRootCommandInfo ( param , org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getParameters ( ) . getParentCommand ( ) ) ; }

Target:
private org.ovirt.engine.core.common.action.RemoveDiskParameters buildChildCommandParameters ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { org.ovirt.engine.core.common.action.RemoveDiskParameters removeDiskParams = new org.ovirt.engine.core.common.action.RemoveDiskParameters ( cinderDisk.getId ( ) , cinderDisk.getStorageIds ( ) . get ( 0 ) ) ; removeDiskParams.setParentCommand ( org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getActionType ( ) ) ; removeDiskParams.setParentParameters ( org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getParameters ( ) ) ; return removeDiskParams ; }
Source:
public static void IsBackendAvailable ( 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 ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( true ) ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void GetClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters ( id ) , aQuery ) ; }
Source:
protected void setUpFactory ( org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand ... commands ) { org.mockito.stubbing.OngoingStubbing stubbing = org.mockito.Mockito.when ( commandFactory.createWrappedCommand ( org.mockito.Matchers.any ( org.ovirt.engine.core.bll.context.CommandContext.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.action.VdcActionType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) , org.mockito.Matchers.anyBoolean ( ) ) ) ; for ( org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand command : commands ) { stubbing = stubbing.thenReturn ( command ) ; } }

Target:
protected void setUpFactory ( org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand ... commands ) { org.mockito.stubbing.OngoingStubbing stubbing = org.mockito.Mockito.when ( commandFactory.createWrappedCommand ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.bll.context.CommandContext.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.VdcActionType.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) ; for ( org.ovirt.engine.core.bll.MultipleActionsRunnerBaseTest.TestCommand command : commands ) { stubbing = stubbing.thenReturn ( command ) ; } }
Source:
public org.ovirt.engineextensions.aaa.ldap.ASN1OctetString decode ( java.lang.String value ) { java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat ( "yyyyMMddHHmmss" ) ; sdf.setTimeZone ( java.util.TimeZone.getTimeZone ( "UTC" ) ) ; return new org.ovirt.engineextensions.aaa.ldap.ASN1OctetString ( ( ( sdf.format ( new java.util.Date ( java.lang.Long.valueOf ( value ) ) ) ) + "Z" ) ) ; }

Target:
public org.ovirt.engineextensions.aaa.ldap.ASN1OctetString decode ( java.lang.String value , org.ovirt.engineextensions.aaa.ldap.MapProperties props ) { java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat ( "yyyyMMddHHmmss" ) ; sdf.setTimeZone ( java.util.TimeZone.getTimeZone ( "UTC" ) ) ; return new org.ovirt.engineextensions.aaa.ldap.ASN1OctetString ( ( ( sdf.format ( new java.util.Date ( java.lang.Long.valueOf ( value ) ) ) ) + "Z" ) ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel 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.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostEventListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand.equals ( getModel ( ) . getDetailsCommand ( ) ) ) { return eventPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmDataFromPoolByPoolName ( org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getParameters ( ) . getName ( ) , org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getParameters ( ) . isFiltered ( ) ) ; if ( vm != null ) { org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( vm.getStaticData ( ) , true ) ; } org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getQueryReturnValue ( ) . setReturnValue ( vm ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VM vm = null ; org.ovirt.engine.core.common.businessentities.VmPool vmpool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getByName ( org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getParameters ( ) . getName ( ) ) ; if ( vmpool != null ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue getVmRet = org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getBackend ( ) . runInternalQuery ( VdcQueryType.GetVmDataByPoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmpool.getVmPoolId ( ) ) ) ; if ( getVmRet != null ) { vm = getVmRet.getReturnValue ( ) ; } } org.ovirt.engine.core.bll.GetVmDataByPoolNameQuery.getQueryReturnValue ( ) . setReturnValue ( vm ) ; }
Source:
private boolean computeAndCommitLabelChanges ( final org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity , org.ovirt.engine.ui.uicommonweb.models.hosts.PfNicLabelModel labelsModel ) { if ( ! ( labelsModel.wasChanged ( ) ) ) { return true ; } java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > potentialNetworks = getPotentialNetworks ( labelsModel , nicMap.get ( entity.getName ( ) ) . getItems ( ) ) ; if ( validateNetworksCanCoexist ( potentialNetworks ) ) { commitNetworksAndLabelChanges ( labelsModel , entity , potentialNetworks ) ; redraw ( ) ; return true ; } return false ; }

Target:
private boolean computeAndCommitLabelChanges ( final org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity , org.ovirt.engine.ui.uicommonweb.models.hosts.NicLabelModel labelsModel ) { if ( ! ( labelsModel.wasChanged ( ) ) ) { return true ; } java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > potentialNetworks = getPotentialNetworks ( labelsModel , nicMap.get ( entity.getName ( ) ) . getItems ( ) ) ; if ( validateNetworksCanCoexist ( potentialNetworks ) ) { commitNetworksAndLabelChanges ( labelsModel , entity , potentialNetworks ) ; redraw ( ) ; return true ; } return false ; }
Source:
private org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel determineConsoleModelFromVm ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel > cachedModels ) { return ( vm.getDefaultDisplayType ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.vnc ) ? cachedModels.get ( org.ovirt.engine.ui.uicommonweb.models.ConsoleModelsCache.VNC_INDEX ) : cachedModels.get ( org.ovirt.engine.ui.uicommonweb.models.ConsoleModelsCache.SPICE_INDEX ) ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel determineConsoleModelFromVm ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel > cachedModels ) { org.ovirt.engine.core.common.businessentities.DisplayType vmDisplayType = ( vm.isRunningOrPaused ( ) ) ? vm.getDisplayType ( ) : vm.getDefaultDisplayType ( ) ; return cachedModels.get ( ( vmDisplayType == ( org.ovirt.engine.core.common.businessentities.DisplayType.vnc ) ? org.ovirt.engine.ui.uicommonweb.models.ConsoleModelsCache.VNC_INDEX : org.ovirt.engine.ui.uicommonweb.models.ConsoleModelsCache.SPICE_INDEX ) ) ; }
Source:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getRedirectServletReportsPage ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static boolean canRemoveVmFromPool ( org.ovirt.engine.core.compat.Guid vmId , java.util.ArrayList < java.lang.String > messages ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmPoolMapByVmGuid ( vmId ) ) == null ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_DETACH_VM_NOT_ATTACHED_TO_POOL.toString ( ) ) ; returnValue = false ; } if ( returnValue ) { if ( org.ovirt.engine.core.bll.RemoveVmCommand.isVmRunning ( vmId ) ) { messages.add ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_RUNNING_VM_FROM_POOL.toString ( ) ) ; returnValue = false ; } } return returnValue ; }

Target:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVm ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolDAO ( ) . getVmPoolMapByVmGuid ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmId ( ) ) ) == null ) { return failCanDoAction ( VdcBllMessages.VM_POOL_CANNOT_DETACH_VM_NOT_ATTACHED_TO_POOL ) ; } if ( org.ovirt.engine.core.bll.RemoveVmCommand.isVmRunning ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getParameters ( ) . getVmId ( ) ) ) { return failCanDoAction ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_RUNNING_VM_FROM_POOL ) ; } return true ; }
Source:
public static com.google.gwt.safehtml.shared.SafeHtml getTooltip ( java.util.Map < com.google.gwt.safehtml.shared.SafeHtml , java.lang.String > imagesToText ) { java.lang.String tooltip = "" ; for ( java.util.Map.Entry < com.google.gwt.safehtml.shared.SafeHtml , java.lang.String > imageToText : imagesToText.entrySet ( ) ) { if ( ! ( tooltip.isEmpty ( ) ) ) { tooltip = tooltip.concat ( org.ovirt.engine.ui.webadmin.widget.table.column.MultiImageColumnHelper.constants.lineBreak ( ) ) ; } tooltip = tooltip.concat ( org.ovirt.engine.ui.webadmin.widget.table.column.MultiImageColumnHelper.templates.imageTextSetupNetwork ( imageToText.getKey ( ) , imageToText.getValue ( ) ) . asString ( ) ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( tooltip ) ; }

Target:
public static java.lang.String getTooltip ( java.util.Map < com.google.gwt.safehtml.shared.SafeHtml , java.lang.String > imagesToText ) { java.lang.String tooltip = "" ; for ( java.util.Map.Entry < com.google.gwt.safehtml.shared.SafeHtml , java.lang.String > imageToText : imagesToText.entrySet ( ) ) { if ( ! ( tooltip.isEmpty ( ) ) ) { tooltip = tooltip.concat ( "\n" ) ; } tooltip = tooltip.concat ( imageToText.getValue ( ) ) ; } return tooltip ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel consoleModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel ) ( model ) ) ; consoleModel.postGetHost ( ( ( java.lang.String ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel consoleModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel ) ( model ) ) ; this . host = ( ( java.lang.String ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; consoleModel.setAndInvokeClient ( ) ; }
Source:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public void getDataCenterMaxNameLength ( 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private boolean validateInputManagementNetwork ( ) { managementNetwork = getManagementNetworkById ( ) ; if ( ( managementNetwork ) == null ) { addCanDoActionMessage ( EngineMessage.NETWORK_NOT_EXISTS ) ; return false ; } final org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase networkClusterValidator = createNetworkClusterValidator ( ) ; return ( ( validate ( networkClusterValidator.networkBelongsToClusterDataCenter ( org.ovirt.engine.core.bll.AddVdsGroupCommand.getVdsGroup ( ) , managementNetwork ) ) ) && ( validate ( networkClusterValidator.managementNetworkRequired ( managementNetwork ) ) ) ) && ( validate ( networkClusterValidator.managementNetworkNotExternal ( managementNetwork ) ) ) ; }

Target:
private boolean validateInputManagementNetwork ( ) { setManagementNetwork ( getManagementNetworkById ( ) ) ; if ( ( getManagementNetwork ( ) ) == null ) { addCanDoActionMessage ( EngineMessage.NETWORK_NOT_EXISTS ) ; return false ; } final org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase networkClusterValidator = createNetworkClusterValidator ( ) ; return ( ( validate ( networkClusterValidator.networkBelongsToClusterDataCenter ( org.ovirt.engine.core.bll.AddVdsGroupCommand.getVdsGroup ( ) , getManagementNetwork ( ) ) ) ) && ( validate ( networkClusterValidator.managementNetworkRequired ( getManagementNetwork ( ) ) ) ) ) && ( validate ( networkClusterValidator.managementNetworkNotExternal ( getManagementNetwork ( ) ) ) ) ; }
Source:
private void preSavePhase2 ( ) { final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > cpuPinning = model.getCpuPinning ( ) ; if ( ( ( ! ( cpuPinning.getIsChangable ( ) ) ) && ( ( cpuPinning.getEntity ( ) ) != null ) ) && ( ! ( cpuPinning.getEntity ( ) . isEmpty ( ) ) ) ) { confirmCpuPinningLost ( ) ; } else { preSavePhase3 ( ) ; } }

Target:
protected void sendWarningForNonExportableDisks ( org.ovirt.engine.core.common.businessentities.VM entity ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVmDiskList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getWindow ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( target ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > vmDisks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelHelper.sendWarningForNonExportableDisks ( model , vmDisks , VmModelHelper.WarningType.VM_EXPORT ) ; } } ) , entity.getId ( ) ) ; }
Source:
public void testRemoveAndSave ( ) { dao.remove ( FixturesTool.POSIX_STORAGE_DOMAIN_ID , FixturesTool.GLUSTER_GEOREP_SESSION_ID2 ) ; org.ovirt.engine.core.common.businessentities.StorageDomainDR result = dao.get ( FixturesTool.POSIX_STORAGE_DOMAIN_ID , FixturesTool.GLUSTER_GEOREP_SESSION_ID2 ) ; org.junit.Assert.assertNull ( result ) ; dao.save ( storageDomainDR ) ; result = dao.get ( FixturesTool.POSIX_STORAGE_DOMAIN_ID , FixturesTool.GLUSTER_GEOREP_SESSION_ID2 ) ; org.junit.Assert.assertEquals ( storageDomainDR , result ) ; }

Target:
public void testRemoveAndSave ( ) { dao.remove ( FixturesTool.POSIX_STORAGE_DOMAIN_ID , FixturesTool.GLUSTER_GEOREP_SESSION_ID2 ) ; org.ovirt.engine.core.common.businessentities.StorageDomainDR result = dao.get ( FixturesTool.POSIX_STORAGE_DOMAIN_ID , FixturesTool.GLUSTER_GEOREP_SESSION_ID2 ) ; org.junit.jupiter.api.Assertions.assertNull ( result ) ; dao.save ( storageDomainDR ) ; result = dao.get ( FixturesTool.POSIX_STORAGE_DOMAIN_ID , FixturesTool.GLUSTER_GEOREP_SESSION_ID2 ) ; org.junit.jupiter.api.Assertions.assertEquals ( storageDomainDR , result ) ; }
Source:
public boolean isStartupTimeoutPassed ( java.util.List < java.lang.String > messages ) { java.util.Date waitTo = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getStartedAt ( ) . addSeconds ( ( ( java.lang.Integer ) ( org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.DisableFenceAtStartupInSec ) ) ) ) ; java.util.Date now = new java.util.Date ( ) ; if ( ! ( ( waitTo.before ( now ) ) || ( waitTo.equals ( now ) ) ) ) { messages.add ( VdcBllMessages.VDS_FENCE_DISABLED_AT_SYSTEM_STARTUP_INTERVAL.name ( ) ) ; return false ; } else { return true ; } }

Target:
protected org.ovirt.engine.core.bll.interfaces.BackendInternal getBackend ( ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) ; }
Source:
protected void executeCommand ( ) { setSucceeded ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DisconnectStorageServer , new org.ovirt.engine.core.common.vdscommands.ConnectStorageServerVDSCommandParameters ( org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getstorage_type ( ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections [ ] { org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getConnection ( ) } ) ) ) ) . getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.setSucceeded ( disconnectStorage ( ) ) ; }
Source:
private java.util.Set < org.ovirt.engine.core.compat.Guid > getStorageGuidSet ( ) { java.util.Set < org.ovirt.engine.core.compat.Guid > destImageDomains = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskInfoDestinationMap.values ( ) ) { destImageDomains.add ( diskImage.getstorage_ids ( ) . get ( 0 ) ) ; } return destImageDomains ; }

Target:
private java.util.Set < org.ovirt.engine.core.compat.Guid > getStorageGuidSet ( ) { java.util.Set < org.ovirt.engine.core.compat.Guid > destImageDomains = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskInfoDestinationMap.values ( ) ) { destImageDomains.add ( diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return destImageDomains ; }
Source:
public void canDoActionSpaceValidationFails ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockMaxPciSlots ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.AddDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; }

Target:
public void canDoActionSpaceValidationFails ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockMaxPciSlots ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.AddDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( oldIface ) ; getCompensationContext ( ) . snapshotEntity ( oldVmDevice ) ; getVmNetworkInterfaceDao ( ) . update ( getInterface ( ) ) ; oldVmDevice.setCustomProperties ( getInterface ( ) . getCustomProperties ( ) ) ; getDbFacade ( ) . getVmDeviceDao ( ) . update ( oldVmDevice ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
private boolean liveActionRequired ( ) { return ( ( oldVmDevice.getIsPlugged ( ) ) && ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getInterface ( ) . isPlugged ( ) ) ) && ( ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ; }
Source:
public static void getClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public org.ovirt.engine.sdk.decorators.DataCenterCluster update ( java.lang.Boolean async ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; if ( async != null ) { urlBuilder.add ( "async" , async , UrlParameterType.MATRIX ) ; } url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.Cluster.class , org.ovirt.engine.sdk.decorators.DataCenterCluster.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.DataCenterCluster update ( java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; if ( correlationId != null ) { headersBuilder.add ( "Correlation-Id" , correlationId ) ; } java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.Cluster.class , org.ovirt.engine.sdk.decorators.DataCenterCluster.class , headers ) ; }
Source:
public void PostUpdateVmTemplate ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( getWindow ( ) ) ) ; model.StopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { Cancel ( ) ; } }

Target:
protected void selectedItemPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . selectedItemPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "status" ) ) { updateActionAvailability ( ) ; } }
Source:
protected void asyncSearch ( ) { super . asyncSearch ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; setAsyncResult ( null ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }

Target:
public void setItems ( java.lang.Iterable value ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( value != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.Disk > cast ( value ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; org.ovirt.engine.ui.uicommonweb.Linq.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; super . setItems ( disks ) ; updateActionAvailability ( ) ; }
Source:
private java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.compat.Guid > > getIdsOfNetworkAttachmentsRelatedToInterfaceNames ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments ) { java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.compat.Guid > > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : networkAttachments ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( attachment.getNicName ( ) , attachment.getId ( ) , map , new org.ovirt.engine.core.utils.collections.MultiValueMapUtils.ListCreator < org.ovirt.engine.core.compat.Guid > ( ) ) ; } return map ; }

Target:
private java.util.Set < java.lang.String > getNetworkAttachmentInterfaceNames ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments ) { java.util.Set < java.lang.String > networkAttachmentNicNames = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : networkAttachments ) { networkAttachmentNicNames.add ( attachment.getNicName ( ) ) ; } return networkAttachmentNicNames ; }