auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean handlesEvent ( com.google.gwt.view.client.CellPreviewEvent < org.ovirt.engine.ui.uicommonweb.models.EntityModel > event ) { return org.ovirt.engine.ui.common.widget.table.column.AbstractCheckboxColumn.handlesEvent ( event ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( T object ) { if ( ! ( canEdit ( object ) ) ) { java.lang.String disabledMessage = getDisabledMessage ( object ) ; if ( ( disabledMessage != null ) && ( ! ( disabledMessage.isEmpty ( ) ) ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( disabledMessage ) ; } } return null ; }
Source:
private void setupVdsDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > expectedVds = java.util.Collections.singletonList ( vds ) ; org.ovirt.engine.core.dao.VdsDAO vdsDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDAO.class ) ; org.mockito.Mockito.when ( vdsDaoMock.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVds ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVdsDao ( ) ) . thenReturn ( vdsDaoMock ) ; }

Target:
private void setupNetworkDao ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getNetworkDao ( ) ) . thenReturn ( networkDaoMocked ) ; org.mockito.Mockito.when ( networkDaoMocked.get ( networkId ) ) . thenReturn ( networkMocked ) ; }
Source:
protected boolean validateCreateImage ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.validate ( VdcActionType.AddDisk , getAddDiskParameters ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getContext ( ) . clone ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return returnValue.isValid ( ) ; }

Target:
protected boolean validateCreateImage ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.validate ( ActionType.AddDisk , getAddDiskParameters ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getContext ( ) . clone ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return returnValue.isValid ( ) ; }
Source:
protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return getModel ( ) . getMoveCommand ( ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( ) { com.google.gwt.safehtml.shared.SafeHtml tooltip = null ; if ( ( getModel ( ) . isHotPlugAvailable ( ) ) && ( ! ( getModel ( ) . isPlugAvailableByDisks ( false ) ) ) ) { tooltip = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( org.ovirt.engine.ui.common.widget.uicommon.vm.VmDiskListModelTable.constants.diskHotPlugNotSupported ( ) ) ; } return tooltip ; }
Source:
protected void handleSpecificCommandActions ( ) { if ( ( mVmList.size ( ) ) > 0 ) { org.ovirt.engine.core.bll.StopVdsCommand.restartVdsVms ( ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) . getId ( ) ) ) ; } }

Target:
protected void handleSpecificCommandActions ( ) { if ( ( mVmList.size ( ) ) > 0 ) { org.ovirt.engine.core.bll.RestartVdsVmsOperation restartVmsOper = new org.ovirt.engine.core.bll.RestartVdsVmsOperation ( org.ovirt.engine.core.bll.StopVdsCommand.getContext ( ) , org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) ) ; restartVmsOper.restartVms ( mVmList ) ; runVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) . getId ( ) ) ) ; } }
Source:
public static void getVmNicList ( 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 != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private void verifyNicExistenceToHandle404StatusCode ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > hostInterfaces = getBackendCollection ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.class , VdcQueryType.GetVdsInterfacesByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( getHostId ( ) ) ) ; boolean found = false ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface hostInterface : hostInterfaces ) { if ( hostInterface.getId ( ) . equals ( nicId ) ) { found = true ; break ; } } if ( ! found ) { notFound ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.class ) ; } }

Target:
private void verifyNicExistenceToHandle404StatusCode ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > hostInterfaces = getBackendCollection ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.class , QueryType.GetVdsInterfacesByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( getHostId ( ) ) ) ; boolean found = false ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface hostInterface : hostInterfaces ) { if ( hostInterface.getId ( ) . equals ( nicId ) ) { found = true ; break ; } } if ( ! found ) { notFound ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.class ) ; } }
Source:
private void mockTransactionManagement ( ) throws javax.transaction.SystemException { javax.transaction.Transaction trans = org.mockito.Mockito.mock ( javax.transaction.Transaction.class ) ; javax.transaction.TransactionManager tm = org.mockito.Mockito.mock ( javax.transaction.TransactionManager.class ) ; org.mockito.Mockito.doReturn ( trans ) . when ( tm ) . getTransaction ( ) ; org.mockito.Mockito.doReturn ( tm ) . when ( mockStrategy ) . < javax.transaction.TransactionManager > findResource ( ContainerManagedResourceType.TRANSACTION_MANAGER ) ; }

Target:
private void mockTransactionManagement ( ) throws javax.transaction.SystemException { javax.transaction.Transaction trans = org.mockito.Mockito.mock ( javax.transaction.Transaction.class ) ; javax.transaction.TransactionManager tm = org.mockito.Mockito.mock ( javax.transaction.TransactionManager.class ) ; org.mockito.Mockito.doReturn ( trans ) . when ( tm ) . getTransaction ( ) ; mockResource ( ContainerManagedResourceType.TRANSACTION_MANAGER , tm ) ; }
Source:
public void testIsNotLocalFsWithDefaultClusterWhenClusterIsDefault ( ) { storagePool.setStorageType ( StorageType.LOCALFS ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . containsDefaultCluster ( ) ; org.ovirt.engine.core.bll.ValidationResult result = validator.isNotLocalfsWithDefaultCluster ( ) ; org.junit.Assert.assertFalse ( result.isValid ( ) ) ; org.ovirt.engine.core.bll.storage.StoragePoolValidatorTest.assertMessage ( result , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_WITH_DEFAULT_VDS_GROUP_CANNOT_BE_LOCALFS ) ; }

Target:
public void testIsNotLocalFsWithDefaultClusterWhenClusterIsDefault ( ) { storagePool.setIsLocal ( true ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . containsDefaultCluster ( ) ; org.ovirt.engine.core.bll.ValidationResult result = validator.isNotLocalfsWithDefaultCluster ( ) ; org.junit.Assert.assertFalse ( result.isValid ( ) ) ; org.ovirt.engine.core.bll.storage.StoragePoolValidatorTest.assertMessage ( result , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_WITH_DEFAULT_VDS_GROUP_CANNOT_BE_LOCALFS ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { injectorRule.bind ( org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.class , org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.class ) ) ; existingSnapshot = createSnapshot ( existingSnapshotId ) ; existingVm = createVm ( existingVmId ) ; existingSnapshot.setVmConfiguration ( org.ovirt.engine.core.bll.snapshots.SnapshotVmConfigurationHelperTest.EXISTING_VM_NAME ) ; existingDiskImage = createDiskImage ( existingImageId , existingImageGroupId ) ; snapshotVmConfigurationHelper = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.snapshots.SnapshotVmConfigurationHelper ( ) ) ; snapshotsManager = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.snapshots.SnapshotsManager.class ) ; org.mockito.Mockito.when ( snapshotVmConfigurationHelper.getSnapshotManager ( ) ) . thenReturn ( snapshotsManager ) ; setUpDaoMocks ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { injectorRule.bind ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerDc.class , org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerDc.class ) ) ; existingSnapshot = createSnapshot ( existingSnapshotId ) ; existingVm = createVm ( existingVmId ) ; existingSnapshot.setVmConfiguration ( org.ovirt.engine.core.bll.snapshots.SnapshotVmConfigurationHelperTest.EXISTING_VM_NAME ) ; existingDiskImage = createDiskImage ( existingImageId , existingImageGroupId ) ; snapshotVmConfigurationHelper = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.snapshots.SnapshotVmConfigurationHelper ( ) ) ; snapshotsManager = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.snapshots.SnapshotsManager.class ) ; org.mockito.Mockito.when ( snapshotVmConfigurationHelper.getSnapshotManager ( ) ) . thenReturn ( snapshotsManager ) ; setUpDaoMocks ( ) ; }
Source:
public void getStorageDomainList ( 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 ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getHostListByStatus ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > aQuery , org.ovirt.engine.core.common.businessentities.VDSStatus status , boolean doRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.SearchParameters searchParameters = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Host: " + ( status == null ? "" : "status=" + ( status.name ( ) ) ) ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; searchParameters.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , ( doRefresh ? searchParameters : searchParameters.withoutRefresh ( ) ) , aQuery ) ; }
Source:
public static void getVmById ( 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.RunQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { 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.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }
Source:
private boolean validateAttachment ( ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator validator = new org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator ( getNetworkCluster ( ) , org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ; return ( ( ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isManagementNetwork ( getNetwork ( ) ) ) ) || ( validate ( validator.managementNetworkAttachment ( getNetworkName ( ) ) ) ) ) && ( validate ( validator.migrationPropertySupported ( getNetworkName ( ) ) ) ) ) && ( ( ! ( getPersistedNetwork ( ) . isExternal ( ) ) ) || ( validateExternalNetwork ( validator ) ) ) ; }

Target:
protected org.ovirt.engine.core.compat.Version getClusterVersion ( ) { return org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) . getcompatibility_version ( ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , new org.ovirt.engine.core.common.businessentities.VM ( ) , 1 ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( wae.getResponse ( ) . getStatus ( ) , 404 ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , new org.ovirt.engine.core.common.businessentities.VM ( ) , 1 ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( wae.getResponse ( ) . getStatus ( ) , 404 ) ; } }
Source:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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 ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
private void setVmWatchdogToParams ( final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.action.VmManagementParametersBase updateVmParams ) { org.ovirt.engine.core.common.businessentities.VmWatchdogType wdModel = model.getWatchdogModel ( ) . getSelectedItem ( ) ; updateVmParams.setUpdateWatchdog ( true ) ; if ( wdModel != null ) { org.ovirt.engine.core.common.businessentities.VmWatchdog vmWatchdog = new org.ovirt.engine.core.common.businessentities.VmWatchdog ( ) ; vmWatchdog.setAction ( model.getWatchdogAction ( ) . getSelectedItem ( ) ) ; vmWatchdog.setModel ( wdModel ) ; updateVmParams.setWatchdog ( vmWatchdog ) ; } }

Target:
private void onRestoreFromExportDomain ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel importModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel ) ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getWindow ( ) ) ) ; if ( ( importModel.getProgress ( ) ) != null ) { return ; } if ( ! ( importModel.validate ( ) ) ) { return ; } importModel.importVms ( new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { getWindow ( ) . stopProgress ( ) ; setWindow ( null ) ; } } ) ; }
Source:
private void canDoActionFailed ( final org.ovirt.engine.core.common.errors.EngineMessage reason ) { org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( reason.toString ( ) ) ) ; }

Target:
public void cantDowngradeIfMixedTypesNotSupported ( ) { storagePoolVersion35 ( ) ; cmd.getStoragePool ( ) . setCompatibilityVersion ( Version.v3_3 ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sdISCI = createStorageDomain ( StorageFormatType.V3 , StorageType.ISCSI ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sdNFS = createStorageDomain ( StorageFormatType.V3 , StorageType.NFS ) ; setAttachedDomains ( sdISCI , sdNFS ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED ) ; }
Source:
protected boolean validateMTUOverrideSupport ( ) { boolean mtuSupported = true ; if ( ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getParameters ( ) . getNetwork ( ) . getMtu ( ) ) != 0 ) { mtuSupported = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.MTUOverrideSupported , org.ovirt.engine.core.bll.network.dc.NetworkCommon.getStoragePool ( ) . getcompatibility_version ( ) . getValue ( ) ) ; if ( ! mtuSupported ) { addCanDoActionMessage ( VdcBllMessages.NETWORK_MTU_OVERRIDE_NOT_SUPPORTED ) ; } } return mtuSupported ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult mtuValid ( ) { return ( ( getNetwork ( ) . getMtu ( ) ) == 0 ) || ( org.ovirt.engine.core.bll.validator.FeatureSupported.mtuSpecification ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getStoragePool ( ) . getcompatibility_version ( ) ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_MTU_OVERRIDE_NOT_SUPPORTED ) ; }
Source:
static org.ovirt.engine.core.common.businessentities.VmTemplate setUpEntityExpectations ( org.ovirt.engine.api.restapi.resource.VmTemplate entity , int index ) { entity.setId ( GUIDS [ index ] ) ; entity.setVdsGroupId ( GUIDS [ 2 ] ) ; entity.setName ( NAMES [ index ] ) ; entity.setDescription ( DESCRIPTIONS [ index ] ) ; entity.setCpuPerSocket ( 4 ) ; entity.setNumOfSockets ( 2 ) ; entity.setDefaultDisplayType ( DisplayType.cirrus ) ; entity.setNumOfMonitors ( 2 ) ; entity.setVmType ( VmType.Server ) ; return entity ; }

Target:
static org.ovirt.engine.core.common.businessentities.VmTemplate setUpEntityExpectations ( org.ovirt.engine.api.restapi.resource.VmTemplate entity , int index ) { entity.setId ( GUIDS [ index ] ) ; entity.setClusterId ( GUIDS [ 2 ] ) ; entity.setName ( NAMES [ index ] ) ; entity.setDescription ( DESCRIPTIONS [ index ] ) ; entity.setCpuPerSocket ( 4 ) ; entity.setNumOfSockets ( 2 ) ; entity.setDefaultDisplayType ( DisplayType.cirrus ) ; entity.setNumOfMonitors ( 2 ) ; entity.setVmType ( VmType.Server ) ; return entity ; }
Source:
private java.lang.String getStorageType ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = getConnection ( ) ; switch ( connection.getstorage_type ( ) ) { case NFS : if ( ( connection.getNfsVersion ( ) ) == ( org.ovirt.engine.core.common.businessentities.NfsVersion.V4 ) ) { return "nfs4" ; } else { return "nfs3" ; } case ISCSI : return "iscsi" ; case GLUSTERFS : return "glusterfs" ; case FCP : return "fc" ; } throw new java.lang.IllegalArgumentException ( ( "There is no legal storage type for the connection " + ( connection.toString ( ) ) ) ) ; }

Target:
protected java.lang.String fromDeployAction ( org.ovirt.engine.core.common.businessentities.HostedEngineDeployConfiguration.Action deployAction ) { switch ( deployAction ) { case DEPLOY : return org.ovirt.ovirt_host_deploy.constants.Const.HOSTED_ENGINE_ACTION_DEPLOY ; case UNDEPLOY : return org.ovirt.ovirt_host_deploy.constants.Const.HOSTED_ENGINE_ACTION_REMOVE ; } return org.ovirt.ovirt_host_deploy.constants.Const.HOSTED_ENGINE_ACTION_NONE ; }
Source:
public void validateVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }

Target:
public void validateVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; initSnapshotValidator ( ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }
Source:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants , org.ovirt.engine.ui.webadmin.ApplicationDynamicConstants dynamicConstants ) { headerLabel.setText ( dynamicConstants.loginHeaderLabel ( ) ) ; userNameLabel.setText ( constants.loginFormUserNameLabel ( ) ) ; passwordLabel.setText ( constants.loginFormPasswordLabel ( ) ) ; domainLabel.setText ( constants.loginFormDomainLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; }

Target:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants , org.ovirt.engine.ui.webadmin.ApplicationDynamicMessages dynamicMessages ) { headerLabel.setText ( dynamicMessages.loginHeaderLabel ( ) ) ; userNameLabel.setText ( constants.loginFormUserNameLabel ( ) ) ; passwordLabel.setText ( constants.loginFormPasswordLabel ( ) ) ; domainLabel.setText ( constants.loginFormDomainLabel ( ) ) ; loginButton.setLabel ( constants.loginButtonLabel ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageTemplateListModel templateModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageTemplateListModel ) ( model ) ) ; templateModel.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; templateModel.setIsEmpty ( ( ( ( ( java.util.List ) ( templateModel.getItems ( ) ) ) . size ( ) ) == 0 ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageTemplateListModel templateModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageTemplateListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( templates , new org.ovirt.engine.ui.uicommonweb.Linq.VmTemplateComparator ( ) ) ; templateModel.setItems ( templates ) ; templateModel.setIsEmpty ( ( ( templates.size ( ) ) == 0 ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { createSpmControls ( object ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { proxyListBox.clear ( ) ; for ( java.lang.Object item : object.getPmProxyPreferencesList ( ) . getItems ( ) ) { proxyListBox.addItem ( ( ( java.lang.String ) ( item ) ) ) ; } }
Source:
protected void setUpGetPayloadExpectations ( int times ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , payload ) ; } }

Target:
protected void setUpGetPayloadExpectations ( int times , int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; } }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks = org.ovirt.engine.core.bll.GetDisksForQuotaIdQuery.getDbFacade ( ) . getDiskImageDao ( ) . getAllForQuotaId ( org.ovirt.engine.core.bll.GetDisksForQuotaIdQuery.getParameters ( ) . getQuotaId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : disks ) { diskImage.getSnapshots ( ) . addAll ( org.ovirt.engine.core.bll.ImagesHandler.getAllImageSnapshots ( diskImage.getImageId ( ) , diskImage.getit_guid ( ) ) ) ; } org.ovirt.engine.core.bll.GetDisksForQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( disks ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks = org.ovirt.engine.core.bll.GetDisksForQuotaIdQuery.getDbFacade ( ) . getDiskImageDao ( ) . getAllForQuotaId ( org.ovirt.engine.core.bll.GetDisksForQuotaIdQuery.getParameters ( ) . getQuotaId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : disks ) { diskImage.getSnapshots ( ) . addAll ( org.ovirt.engine.core.bll.ImagesHandler.getAllImageSnapshots ( diskImage.getImageId ( ) , diskImage.getImageTemplateId ( ) ) ) ; } org.ovirt.engine.core.bll.GetDisksForQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( disks ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void testGetAllForDedicatedPowerClientByVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllForDedicatedPowerClientByVds ( org.ovirt.engine.core.dao.VmDAOTest.VDS_STATIC_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmDAOTest.VDS_GROUP_ID , vm.getVdsGroupId ( ) ) ; } }

Target:
public void getAllRunningOnOrMigratingToVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllRunningOnOrMigratingToVds ( org.ovirt.engine.core.dao.VmDAOTest.VDS_STATIC_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }
Source:
public void testNetworkNotChangedWhenDifferentNetworkIds ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment oldAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; oldAttachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . networkNotChanged ( oldAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.CANNOT_CHANGE_ATTACHED_NETWORK ) ) ; }

Target:
public void testNetworkNotChangedWhenDifferentNetworkIds ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment oldAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; oldAttachment.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; oldAttachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . networkNotChanged ( oldAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CANNOT_CHANGE_ATTACHED_NETWORK , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_NETWORK_ATTACHMENT_ID , oldAttachment.getId ( ) ) ) ) ; }
Source:
public static void getVmGuestAgentInterfacesByVmId ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getNumberOfVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNumberOfVmsInVdsGroupByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.compat.Guid getStorageDomainIdForVmMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList ) { if ( ( cachedStorageDomainId.equals ( Guid.Empty ) ) && ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.VmHandler.findStorageDomainForMemory ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getStoragePoolId ( ) , memoryDisksList ) ; if ( storageDomain != null ) { cachedStorageDomainId = storageDomain.getId ( ) ; } } return cachedStorageDomainId ; }

Target:
public org.ovirt.engine.core.compat.Guid getStorageDomainIdForVmMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList ) { if ( ( cachedStorageDomainId.equals ( Guid.Empty ) ) && ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.getInstance ( ) . findStorageDomainForMemory ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getStoragePoolId ( ) , memoryDisksList , getDisksList ( ) ) ; if ( storageDomain != null ) { cachedStorageDomainId = storageDomain.getId ( ) ; } } return cachedStorageDomainId ; }
Source:
public void testGetAllStaticByName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > result = dao.getAllByName ( "rhel5-pool-50" ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmStatic vm : result ) { org.junit.Assert.assertEquals ( "rhel5-pool-50" , vm.getvm_name ( ) ) ; } }

Target:
public void testGetAllStaticByName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > result = dao.getAllByName ( "rhel5-pool-50" ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmStatic vm : result ) { org.junit.Assert.assertEquals ( "rhel5-pool-50" , vm.getVmName ( ) ) ; } }
Source:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { setPayload ( model ) ; setBallooning ( model ) ; setConsoleDevice ( model ) ; setVirtioScsiController ( model ) ; setSoundcard ( model ) ; setCertificateInfo ( model ) ; setVmOvfConfiguration ( model , entity ) ; setRngDevice ( model ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.Vm doPopulate ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.api.restapi.resource.VM entity ) { setPayload ( model ) ; setBallooning ( model ) ; setConsoleDevice ( model ) ; setVirtioScsiController ( model ) ; setSoundcard ( model ) ; setCertificateInfo ( model ) ; setVmOvfConfiguration ( model , entity ) ; setRngDevice ( model ) ; return model ; }
Source:
private void removeVmStatelessImages ( ) { if ( getSnapshotDAO ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.infoFormat ( "Deleting snapshot for stateless vm {0}" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }

Target:
private void removeVmStatelessImages ( ) { if ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getSnapshotDAO ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.info ( "Deleting snapshot for stateless vm '{}'" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }
Source:
protected void selectedItemPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . selectedItemPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "status" ) ) { updateActionAvailability ( ) ; } else if ( e.PropertyName.equals ( "display_type" ) ) { updateConsoleModels ( ) ; } }

Target:
private boolean isConsoleCommandsExecutionAllowed ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VM > list = ( ( getSelectedItem ( ) ) == null ) ? null : getSelectedItems ( ) ; if ( list == null ) { return false ; } for ( org.ovirt.engine.core.common.businessentities.VM vm : list ) { if ( consoleModelsCache.getVmConsolesForEntity ( vm ) . canConnectToConsole ( ) ) { return true ; } } return false ; }
Source:
public void InitCdImage ( ) { getModel ( ) . getCdImage ( ) . setSelectedItem ( vm.getIsoPath ( ) ) ; boolean hasCd = ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vm.getIsoPath ( ) ) ) ; getModel ( ) . getCdImage ( ) . setIsChangable ( hasCd ) ; getModel ( ) . getCdAttached ( ) . setEntity ( hasCd ) ; UpdateCdImage ( ) ; }

Target:
public void initCdImage ( ) { getModel ( ) . getCdImage ( ) . setSelectedItem ( vm.getIsoPath ( ) ) ; boolean hasCd = ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vm.getIsoPath ( ) ) ) ; getModel ( ) . getCdImage ( ) . setIsChangable ( hasCd ) ; getModel ( ) . getCdAttached ( ) . setEntity ( hasCd ) ; updateCdImage ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; return new org.ovirt.engine.core.common.businessentities.AsyncTasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getVdsmTaskId ( ) , parentParameters , getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , parentParameters.getCommandId ( ) , asyncTaskCreationInfo.getStoragePoolID ( ) , asyncTaskCreationInfo.getTaskType ( ) ) ; }

Target:
protected void removeCommand ( ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.removeCommand ( getCommandId ( ) ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypesCollection = new java.util.HashSet < org.ovirt.engine.core.common.businessentities.GraphicsType > ( ) ; for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice graphicsDevice : graphicsDevices ) { graphicsTypesCollection.add ( graphicsDevice.getGraphicsType ( ) ) ; } org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes graphicsTypes = UnitVmModel.GraphicsTypes.fromGraphicsTypes ( graphicsTypesCollection ) ; org.ovirt.engine.ui.uicompat.Translator translator = org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) ; setGraphicsType ( translator.get ( graphicsTypes ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypesCollection = new java.util.HashSet < org.ovirt.engine.core.common.businessentities.GraphicsType > ( ) ; for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice graphicsDevice : graphicsDevices ) { graphicsTypesCollection.add ( graphicsDevice.getGraphicsType ( ) ) ; } org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes graphicsTypes = UnitVmModel.GraphicsTypes.fromGraphicsTypes ( graphicsTypesCollection ) ; org.ovirt.engine.ui.uicompat.Translator translator = org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) ; setGraphicsType ( translator.translate ( graphicsTypes ) ) ; }
Source:
public static void decreasePendingVms ( org.ovirt.engine.core.compat.Guid vdsId , int numOfCpus , int minAllocatedMem , java.lang.String vmName ) { org.ovirt.engine.core.bll.VmHandler.getVdsDynamicDao ( ) . updatePartialVdsDynamicCalc ( vdsId , 0 , ( - numOfCpus ) , ( - minAllocatedMem ) , 0 , 0 ) ; org.ovirt.engine.core.bll.VmHandler.log.debugFormat ( "Decreasing vds {0} pending vcpu count by {1} and vmem size by {2} (Vm: {3})" , vdsId , numOfCpus , minAllocatedMem , vmName ) ; }

Target:
public static void decreasePendingVms ( org.ovirt.engine.core.compat.Guid vdsId , int numOfCpus , int minAllocatedMem , java.lang.String vmName ) { org.ovirt.engine.core.bll.VmHandler.getVdsDynamicDao ( ) . updatePartialVdsDynamicCalc ( vdsId , 0 , ( - numOfCpus ) , ( - minAllocatedMem ) , 0 , 0 ) ; org.ovirt.engine.core.bll.VmHandler.log.debug ( "Decreasing vds '{}' pending vcpu count by and vmem size by (Vm '{}')" , vdsId , numOfCpus , minAllocatedMem , vmName ) ; }
Source:
private void buidExclusiveLockMap ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > listVms ) { if ( ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getParameters ( ) . getDiskInfo ( ) . isBoot ( ) ) && ( listVms != null ) ) && ( ! ( listVms.isEmpty ( ) ) ) ) { exclusiveLockMap = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { exclusiveLockMap.put ( vm.getId ( ) . toString ( ) , LockingGroup.VM_DISK_BOOT.name ( ) ) ; } } }

Target:
private void buildExclusiveLockMap ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsDiskPluggedTo ) { if ( newDisk.isBoot ( ) ) { exclusiveLockMap = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsDiskPluggedTo ) { exclusiveLockMap.put ( vm.getId ( ) . toString ( ) , LockingGroup.VM_DISK_BOOT.name ( ) ) ; } } }
Source:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetwork , org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateNetwork , org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void readCpuItem ( org.ovirt.engine.core.compat.backendcompat.XmlNode node ) { vmBase.setNumOfSockets ( java.lang.Integer.parseInt ( node.SelectSingleNode ( "rasd:num_of_sockets" , _xmlNS ) . innerText ) ) ; vmBase.setCpuPerSocket ( java.lang.Integer.parseInt ( node.SelectSingleNode ( "rasd:cpu_per_socket" , _xmlNS ) . innerText ) ) ; }

Target:
private void readCpuItem ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node ) { vmBase.setNumOfSockets ( java.lang.Integer.parseInt ( node.SelectSingleNode ( "rasd:num_of_sockets" , _xmlNS ) . innerText ) ) ; vmBase.setCpuPerSocket ( java.lang.Integer.parseInt ( node.SelectSingleNode ( "rasd:cpu_per_socket" , _xmlNS ) . innerText ) ) ; }