auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void updateVdsFromParameters ( org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters parameters , org.ovirt.engine.core.common.businessentities.VDS vds ) { vds.getDynamicData ( ) . setNonOperationalReason ( parameters.getNonOperationalReason ( ) ) ; vds.getDynamicData ( ) . setMaintenanceReason ( parameters.getMaintenanceReason ( ) ) ; }

Target:
public java.lang.Void runInTransaction ( ) { _vdsManager.setStatus ( parameters.getStatus ( ) , vds ) ; _vdsManager.updatePartialDynamicData ( parameters.getNonOperationalReason ( ) , parameters.getMaintenanceReason ( ) ) ; _vdsManager.updateStatisticsData ( vds.getStatisticsData ( ) ) ; return null ; }
Source:
public 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 void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getSnapshotDao ( ) . get ( getSnapshotId ( ) ) ; if ( snapshot != null ) { jobProperties.put ( VdcObjectType.Snapshot.name ( ) . toLowerCase ( ) , snapshot.getDescription ( ) ) ; } } return jobProperties ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getImagesList ( ) { if ( ( ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImages ( ) ) == null ) && ( ! ( getSnapshot ( ) . getId ( ) . equals ( Guid.Empty ) ) ) ) { org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . setImages ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( getSnapshot ( ) . getId ( ) ) ) ; } return org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getParameters ( ) . getImages ( ) ; }
Source:
public void getFreeVfMoreThanOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 5 , 2 , 2 , 2 , 2 ) ; org.junit.Assert.assertEquals ( 5 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( networkDeviceHelper.getFreeVf ( nic , null ) ) ) ; }

Target:
public void getFreeVfNoFreeVf ( ) { freeVfCommon ( 0 , 1 , 2 , 3 , 4 , 5 ) ; org.junit.Assert.assertNull ( networkDeviceHelper.getFreeVf ( nic , null ) ) ; }
Source:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.getModel ( 0 ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void sameBondNameSentTwice ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( null ) ; mockExistingIfaces ( bond ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( bond , bond ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BOND_NAME_EXISTS ) ; }

Target:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; }
Source:
public final com.google.gwt.safehtml.shared.SafeHtml getValue ( T object ) { java.lang.Integer progressValue = getProgressValue ( object ) ; int progress = ( progressValue != null ) ? progressValue : 0 ; java.lang.String text = getProgressText ( object ) ; java.lang.String color = getColorByProgress ( progress ) ; return org.ovirt.engine.ui.webadmin.gin.ClientGinjectorProvider.getApplicationTemplates ( ) . progressBar ( progress , text , color ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getValue ( T object ) { java.lang.Integer progressValue = getProgressValue ( object ) ; int progress = ( progressValue != null ) ? progressValue : 0 ; java.lang.String text = getProgressText ( object ) ; java.lang.String color = getColorByProgress ( progress ) ; return org.ovirt.engine.ui.webadmin.gin.ClientGinjectorProvider.getApplicationTemplates ( ) . progressBar ( progress , text , color , getStyle ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc disconnectStoragePool ( java.lang.String spUUID , int hostSpmId , java.lang.String SCSIKey ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StoragePool.disconnect" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "hostID" , hostSpmId ) . withParameter ( "scsiKey" , SCSIKey ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn disconnectStoragePool ( java.lang.String spUUID , int hostSpmId , java.lang.String SCSIKey ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StoragePool.disconnect" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "hostID" , hostSpmId ) . withParameter ( "scsiKey" , SCSIKey ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , getPrincipalName ( sessionId ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.AUTH_RECORD_PARAMETER_NAME , false ) ) ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.PRINCIPAL_RECORD_PARAMETER_NAME , false ) ) ) , message , msgArgs ) ; getDbFacade ( ) . getEngineSessionDao ( ) . remove ( getEngineSessionSeqId ( sessionId ) ) ; sessionInfoMap.remove ( sessionId ) ; }

Target:
public boolean getSessionValid ( java.lang.String sessionId , boolean refresh ) { java.lang.Object obj = getData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.SESSION_VALID_PARAMETER_NAME , refresh ) ; return obj == null ? false : ( ( boolean ) ( obj ) ) ; }
Source:
public void canDoActionVmInPreview ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Down , null , diskImageId ) ; setVmInPreview ( true ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW.toString ( ) ) ) ; }

Target:
public void moveUnpluggedDiskVmDown ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Down , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId , false ) ; command.updateParameters ( ) ; org.junit.Assert.assertEquals ( command.getMoveDiskParametersList ( ) . size ( ) , 1 ) ; }
Source:
public boolean validateStoragePoolConnectionsInHost ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.List < org.ovirt.engine.core.common.businessentities.storage_server_connections > connections , org.ovirt.engine.core.compat.Guid storagePoolId ) { return true ; }

Target:
public static java.util.Map < org.ovirt.engine.core.common.businessentities.StorageType , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > filterConnectionsByStorageType ( org.ovirt.engine.core.common.businessentities.LUNs lun ) { java.util.Map < org.ovirt.engine.core.common.businessentities.StorageType , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > storageConnectionsForStorageTypeMap = new java.util.EnumMap < org.ovirt.engine.core.common.businessentities.StorageType , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > ( org.ovirt.engine.core.common.businessentities.StorageType.class ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections lunConnections : lun.getLunConnections ( ) ) { org.ovirt.engine.core.utils.MultiValueMapUtils.addToMap ( lunConnections.getstorage_type ( ) , lunConnections , storageConnectionsForStorageTypeMap ) ; } return storageConnectionsForStorageTypeMap ; }
Source:
public static void GetPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static void GetDocumentationBaseURL ( 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.DocsURL ) , aQuery ) ; }
Source:
public void diskImagesAlreadyExistBothExist ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) . when ( validator ) . getExistingDisk ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.storage.DiskImagesValidatorTest.createAliasReplacements ( disk1 , disk2 ) ) ) ) ) ; }

Target:
public void diskImagesAlreadyExistBothExist ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) . when ( validator ) . getExistingDisk ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.storage.DiskImagesValidatorTest.createAliasReplacements ( disk1 , disk2 ) ) ) ) ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.removeVnicProfiles ( ) ; org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetworkDAO ( ) . remove ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.setSucceeded ( true ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = new org.ovirt.engine.core.bll.validator.NetworkValidator ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetworkDAO ( ) . get ( getNetwork ( ) . getId ( ) ) ) ; return ( ( ( validate ( validator.networkIsSet ( ) ) ) && ( validate ( validator.notManagementNetwork ( ) ) ) ) && ( validate ( validator.networkNotUsedByVms ( ) ) ) ) && ( validate ( validator.networkNotUsedByTemplates ( ) ) ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.HostSetupNetworksVdsCommandParameters createSetupNetworksParameters ( int timeout ) { final org.ovirt.engine.core.common.vdscommands.HostSetupNetworksVdsCommandParameters hostCmdParams = new org.ovirt.engine.core.common.vdscommands.HostSetupNetworksVdsCommandParameters ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getVds ( ) , getNetworks ( ) , getRemovedNetworks ( ) , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getBonds ( ) , getRemovedBonds ( ) ) ; hostCmdParams.setRollbackOnFailure ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . rollbackOnFailure ( ) ) ; hostCmdParams.setConectivityTimeout ( timeout ) ; boolean hostNetworkQosSupported = org.ovirt.engine.core.common.FeatureSupported.hostNetworkQos ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getVds ( ) . getVdsGroupCompatibilityVersion ( ) ) ; hostCmdParams.setHostNetworkQosSupported ( hostNetworkQosSupported ) ; return hostCmdParams ; }

Target:
private java.util.Set < java.lang.String > getRemovedBondNames ( ) { if ( ( removedBondNames ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > existingVdsInterfaceToBeRemoved = getRemovedBonds ( ) ; java.util.Set < java.lang.String > removedBondNames = new java.util.HashSet ( existingVdsInterfaceToBeRemoved.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface removedBondInterface : existingVdsInterfaceToBeRemoved ) { removedBondNames.add ( removedBondInterface.getName ( ) ) ; } this . removedBondNames = removedBondNames ; } return removedBondNames ; }
Source:
protected void build ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { vm.setVmtGuid ( model.getTemplate ( ) . getSelectedItem ( ) . getId ( ) ) ; vm.setInstanceTypeId ( model.getInstanceTypes ( ) . getSelectedItem ( ) . getId ( ) ) ; }

Target:
protected void build ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { vm.setVmtGuid ( model.getTemplateWithVersion ( ) . getSelectedItem ( ) . getTemplateVersion ( ) . getId ( ) ) ; vm.setInstanceTypeId ( model.getInstanceTypes ( ) . getSelectedItem ( ) . getId ( ) ) ; }
Source:
public void saveGlusterServerHook ( org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid hostId , java.lang.String checksum , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStatus status ) { getCallsHandler ( ) . executeModification ( "InsertGlusterServerHook" , getCustomMapSqlParameterSource ( ) . addValue ( "hook_id" , hookId ) . addValue ( "host_id" , hostId ) . addValue ( "checksum" , checksum ) . addValue ( "status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( status ) ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook getGlusterServerHook ( org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverHook = getCallsHandler ( ) . executeRead ( "GetGlusterServerHook" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoDbFacadeImpl.glusterServerHookRowMapper , getCustomMapSqlParameterSource ( ) . addValue ( "hook_id" , hookId ) . addValue ( "server_id" , serverId ) ) ; return serverHook ; }
Source:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public void getAncestorImagesByImagesIds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.util.List < org.ovirt.engine.core.compat.Guid > imagesIds ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) { @ java.lang.Override public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.IdsQueryParameters params = new org.ovirt.engine.core.common.queries.IdsQueryParameters ( imagesIds ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAncestorImagesByImagesIds , params , aQuery ) ; }
Source:
public void testUpdateSetAndUploadIconFailure ( ) throws java.lang.Exception { control.replay ( ) ; final org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 0 ) ; model.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; try { verifyModel ( resource.update ( model ) , 0 ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }

Target:
public void testUpdateSetAndUploadIconFailure ( ) throws java.lang.Exception { control.replay ( ) ; final org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 0 ) ; model.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; try { verifyModel ( resource.update ( model ) , 0 ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }
Source:
protected void updateIsDiskHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = vm.getVdsGroupCompatibilityVersion ( ) ; if ( clusterCompatibilityVersion == null ) { setIsDiskHotPlugSupported ( false ) ; } else { setIsDiskHotPlugSupported ( ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDiskHotpluggableInterfaces ( getEntity ( ) . getOs ( ) , clusterCompatibilityVersion ) . isEmpty ( ) ) ) ) ; } }

Target:
protected void updateIsDiskHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = vm.getClusterCompatibilityVersion ( ) ; if ( clusterCompatibilityVersion == null ) { setIsDiskHotPlugSupported ( false ) ; } else { setIsDiskHotPlugSupported ( ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDiskHotpluggableInterfaces ( getEntity ( ) . getOs ( ) , clusterCompatibilityVersion ) . isEmpty ( ) ) ) ) ; } }
Source:
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 ) ; }

Target:
public void getUserMessageOfTheDayViaPublic ( 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.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public java.lang.Object transform ( java.lang.Object input ) { return ( ( org.ovirt.engine.core.common.businessentities.VM ) ( input ) ) . getId ( ) ; }

Target:
public void testGetVmsByIds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getVmsByIds ( java.util.Arrays.asList ( FixturesTool.VM_RHEL5_POOL_60 , FixturesTool.VM_RHEL5_POOL_59 ) ) ; org.junit.Assert.assertEquals ( "loaded templates list isn't in the expected size" , 2 , result.size ( ) ) ; java.util.Collection < org.ovirt.engine.core.compat.Guid > recieved = result.stream ( ) . map ( VM :: getId ) . collect ( java.util.stream.Collectors.toList ( ) ) ; org.junit.Assert.assertTrue ( "the received list didn't contain an expected VM" , recieved.contains ( FixturesTool.VM_RHEL5_POOL_60 ) ) ; org.junit.Assert.assertTrue ( "the received list didn't contain an expected VM" , recieved.contains ( FixturesTool.VM_RHEL5_POOL_59 ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.Bond createBond ( org.ovirt.engine.core.compat.Guid id , java.lang.String bondName , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves ) { org.ovirt.engine.core.common.businessentities.network.Bond result = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; result.setId ( id ) ; result.setName ( bondName ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave : slaves ) { result.getSlaves ( ) . add ( slave.getName ( ) ) ; } return result ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Bond createBond ( org.ovirt.engine.core.compat.Guid id , java.lang.String bondName , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves ) { org.ovirt.engine.core.common.businessentities.network.Bond result = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; result.setId ( id ) ; result.setName ( bondName ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave : slaves ) { slave.setBondName ( bondName ) ; } return result ; }
Source:
private boolean isEditConsoleEnabled ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { return ( ( item != null ) && ( ( item.getVM ( ) ) != null ) ) && ( item.getVM ( ) . isRunningOrPaused ( ) ) ; }

Target:
private boolean isEditConsoleEnabled ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { if ( item == null ) { return false ; } return ( item.isPool ( ) ) || ( ( ( item.getVM ( ) ) != null ) && ( item.getVM ( ) . isRunningOrPaused ( ) ) ) ; }
Source:
protected boolean canDoAction ( ) { boolean returnValue = super . canDoAction ( ) ; oldPool = org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getVmPoolDAO ( ) . get ( org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getVmPool ( ) . getVmPoolId ( ) ) ; if ( returnValue && ( ( oldPool ) == null ) ) { addCanDoActionMessage ( VdcBllMessages.VM_POOL_CANNOT_UPDATE_POOL_NOT_FOUND ) ; returnValue = false ; } else if ( returnValue && ( ( org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) < 0 ) ) { addCanDoActionMessage ( VdcBllMessages.VM_POOL_CANNOT_DECREASE_VMS_FROM_POOL ) ; returnValue = false ; } return returnValue ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } oldPool = org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getVmPoolDAO ( ) . get ( org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getVmPool ( ) . getVmPoolId ( ) ) ; if ( ( oldPool ) == null ) { return failCanDoAction ( VdcBllMessages.VM_POOL_CANNOT_UPDATE_POOL_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.UpdateVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) < 0 ) { return failCanDoAction ( VdcBllMessages.VM_POOL_CANNOT_DECREASE_VMS_FROM_POOL ) ; } return true ; }
Source:
public static 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.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase ) ( target ) ) ; java.lang.Object result = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; model.PostDiscoverTargetsInternal ( ( result != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ) ( result ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase ) ( target ) ) ; java.lang.Object result = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; model.postDiscoverTargetsInternal ( ( result != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ) ( result ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( ) ) ) ; }
Source:
protected void endSuccessfully ( ) { super . endSuccessfully ( ) ; if ( isLastTaskHandler ( ) ) { org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getExecutionContext ( ) , false ) ; } }

Target:
protected void endWithFailure ( ) { if ( isConsiderSuccessful ( ) ) { auditLog ( this , AuditLogType.USER_MOVE_IMAGE_GROUP_FAILED_TO_DELETE_SRC_IMAGE ) ; this . endSuccessfully ( ) ; return ; } super . endWithFailure ( ) ; handleDestDisk ( ) ; unlockDisk ( ) ; org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.setSucceeded ( true ) ; }
Source:
public static boolean detectOverflowUsingClientHeight ( com.google.gwt.dom.client.Element parent ) { int clientHeightBefore = parent.getClientHeight ( ) ; java.lang.String whiteSpaceValue = parent.getStyle ( ) . getProperty ( "whiteSpace" ) ; parent.getStyle ( ) . setProperty ( "whiteSpace" , "normal" ) ; int scrollHeightAfter = parent.getScrollHeight ( ) ; int clientHeightAfter = parent.getClientHeight ( ) ; parent.getStyle ( ) . setProperty ( "whiteSpace" , whiteSpaceValue ) ; return ( clientHeightAfter > clientHeightBefore ) || ( clientHeightAfter < scrollHeightAfter ) ; }

Target:
public static boolean detectVerticalOverflow ( com.google.gwt.dom.client.Element element ) { int scrollHeight = element.getScrollHeight ( ) ; int clientHeight = element.getClientHeight ( ) ; return scrollHeight > clientHeight ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { return null ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return diskImage.getId ( ) . toString ( ) ; }
Source:
public static void getDomainListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }
Source:
private void internalEndWithFailure ( ) { log.errorFormat ( "Ending command with failure: {0}" , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { getCurrentTaskHandler ( ) . endWithFailure ( ) ; revertPreviousHandlers ( ) ; startPollingAsyncTasks ( ) ; } else { endWithFailure ( ) ; } rollBackQuota ( ) ; }

Target:
private void internalEndWithFailure ( ) { log.errorFormat ( "Ending command with failure: {0}" , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { getCurrentTaskHandler ( ) . endWithFailure ( ) ; revertPreviousHandlers ( ) ; startPollingAsyncTasks ( ) ; } else { endWithFailure ( ) ; } rollbackQuota ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.Network getManagementNetwork ( ) { if ( ( managementNetwork ) == null ) { managementNetwork = getDbFacade ( ) . getNetworkDao ( ) . getByNameAndDataCenter ( org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) , host.getStoragePoolId ( ) ) ; } return managementNetwork ; }

Target:
private java.lang.String resolveHostManagementNetworkAddress ( java.lang.String managementNetworkName ) { if ( managementNetworkName == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( host.getInterfaces ( ) , new org.ovirt.engine.core.utils.network.predicate.InterfaceByNetworkNamePredicate ( managementNetworkName ) ) ; return iface != null ? iface.getAddress ( ) : null ; }
Source:
protected void executeCommand ( ) { try { addVmToDb ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; if ( vm.getImages ( ) . isEmpty ( ) ) { endVmRelatedOps ( ) ; } else { processImages ( ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMacs ( macsAdded ) ; throw e ; } setSucceeded ( true ) ; }

Target:
protected void endWithFailure ( ) { setVm ( null ) ; if ( ( getVm ( ) ) != null ) { endActionOnAllImageGroups ( ) ; removeVmNetworkInterfaces ( ) ; removeVmSnapshots ( getVm ( ) ) ; getVmDynamicDAO ( ) . remove ( getVmId ( ) ) ; getVmStatisticsDAO ( ) . remove ( getVmId ( ) ) ; getVmStaticDAO ( ) . remove ( getVmId ( ) ) ; setSucceeded ( true ) ; } else { setVm ( getParameters ( ) . getVm ( ) ) ; getReturnValue ( ) . setEndActionTryAgain ( false ) ; } }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeSnapshotCreate ( volumeName , snapshotName , description , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc getExternalVmList ( java.lang.String uri , java.lang.String username , java.lang.String password ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getExternalVMs ( uri , username , password ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testDetermineMessageReturnsObjectForParameterExpansion ( ) throws java.lang.Exception { java.lang.Object obj = new java.lang.Object ( ) ; org.ovirt.engine.core.utils.log.Log log = org.mockito.Mockito.mock ( org.ovirt.engine.core.utils.log.Log.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.junit.Assert.assertSame ( obj , org.ovirt.engine.core.utils.log.LoggedUtils.determineMessage ( log , org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass.class . getAnnotation ( org.ovirt.engine.core.utils.log.Logged.class ) , obj ) ) ; }

Target:
public void testDetermineMessageReturnsObjectForParameterExpansion ( ) throws java.lang.Exception { java.lang.Object obj = new java.lang.Object ( ) ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.junit.Assert.assertSame ( obj , org.ovirt.engine.core.utils.log.LoggedUtils.determineMessage ( log , org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass.class . getAnnotation ( org.ovirt.engine.core.utils.log.Logged.class ) , obj ) ) ; }
Source:
public void hostAttachedToLocalStorageWithoutDataCenter ( ) { org.mockito.Mockito.when ( storagePoolDao.getForCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( dbFacade.getStoragePoolDao ( ) ) . thenReturn ( storagePoolDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; org.junit.Assert.assertThat ( validator.validateSingleHostAttachedToLocalStorage ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void hostNameIsUsed ( ) { org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VDS_WITH_SAME_HOST_EXIST ) ) ; }
Source:
public void OnApprove ( ) { OnSave ( true ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( HostGeneralModel.RequestEditEventDefinition ) ) { getEditWithPMemphasisCommand ( ) . execute ( ) ; } if ( ev.matchesDefinition ( HostGeneralModel.RequestGOToEventsTabEventDefinition ) ) { goToEventsTab ( ) ; } }
Source:
private java.lang.String getNewMonitorSpecParams ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; sb.append ( "vram=" ) ; sb.append ( VmDeviceCommonUtils.HIGH_VIDEO_MEM ) ; sb.append ( ",deviceId=" ) ; sb.append ( java.lang.String.valueOf ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ) ; return sb.toString ( ) ; }

Target:
private void addMemBalloonDevice ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct struct = new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct ( ) ; struct.add ( VdsProperties.Type , vmDevice.getType ( ) ) ; struct.add ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; addDevice ( struct , vmDevice , null ) ; }
Source:
protected void endWithFailure ( ) { org.ovirt.engine.core.bll.HibernateVmCommand.revertTasks ( ) ; if ( ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getRunOnVds ( ) ) != null ) { org.ovirt.engine.core.bll.HibernateVmCommand.getSnapshotDAO ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.HibernateVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.HibernateVmCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.HibernateVmCommand.log.warn ( "VM '{}' doesn't have 'run_on_vds' value - not clearing 'hibernation_vol_handle' info." , org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getName ( ) ) ; org.ovirt.engine.core.bll.HibernateVmCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; } }

Target:
protected void endWithFailure ( ) { org.ovirt.engine.core.bll.HibernateVmCommand.revertTasks ( ) ; if ( ( org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getRunOnVds ( ) ) != null ) { org.ovirt.engine.core.bll.HibernateVmCommand.getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.HibernateVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.HibernateVmCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.HibernateVmCommand.log.warn ( "VM '{}' doesn't have 'run_on_vds' value - not clearing 'hibernation_vol_handle' info." , org.ovirt.engine.core.bll.HibernateVmCommand.getVm ( ) . getName ( ) ) ; org.ovirt.engine.core.bll.HibernateVmCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getCinderLeafImages ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > leafCinderDisks = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.filterCinderDisks ( disks ) ; for ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinder : cinderDisks ) { leafCinderDisks.add ( getSnapshotLeaf ( cinder.getId ( ) ) ) ; } return leafCinderDisks ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getCinderLeafImages ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > leafCinderDisks = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.filterCinderDisks ( disks ) ; for ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinder : cinderDisks ) { leafCinderDisks.add ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getSnapshotLeaf ( cinder.getId ( ) ) ) ; } return leafCinderDisks ; }
Source:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }

Target:
public void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }