auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetEntityNameByIdAndTypeForVM ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = dbFacade.getVmStaticDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDaoTest.VM_ID ) ; org.junit.Assert.assertNotNull ( vmStatic ) ; java.lang.String name = vmStatic.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDaoTest.VM_STATIC_GUID , VdcObjectType.VM ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForVM ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = dbFacade.getVmStaticDao ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.VM_ID ) ; org.junit.Assert.assertNotNull ( vmStatic ) ; java.lang.String name = vmStatic.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.VM_STATIC_GUID , VdcObjectType.VM ) ) ) ; }
Source:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void getVmSnapshotList ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private void waitForConnect ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { try { this . connected.await ( policy.getRetryTimeOut ( ) , policy.getTimeUnit ( ) ) ; } catch ( java.lang.InterruptedException e ) { log.error ( e.getMessage ( ) , e ) ; disconnect ( "Waiting for connect interrupted" ) ; throw new java.lang.IllegalStateException ( "Communication interrupted" ) ; } }

Target:
public java.lang.Void call ( ) throws java.lang.Exception { connected.await ( policy.getRetryTimeOut ( ) , policy.getTimeUnit ( ) ) ; return null ; }
Source:
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 ) ; }

Target:
public void getTemplateNicList ( 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 < > ( ( ( 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.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { final java.util.Map < java.lang.Integer , org.ovirt.engine.core.common.queries.VmIconIdSizePair > returnMap = returnValue.getReturnValue ( ) ; if ( ( returnMap.get ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DEFAULT_OS_ID ) ) == null ) { throw new java.lang.RuntimeException ( "Engine did not provide icon IDs of default OS." ) ; } osIdToDefaultIconIdMap = java.util.Collections.unmodifiableMap ( returnMap ) ; initializeLargeToSmallIconMap ( ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { osNames = returnValue.getReturnValue ( ) ; initOsIds ( ) ; }
Source:
public java.lang.String toString ( ) { return ( ( ( ( ( ( ( ( ( ( "StorageDomainOvfInfo{" + "storageDomainId=" ) + ( storageDomainId ) ) + ", storedOvfIds=" ) + ( storedOvfIds ) ) + ", ovfDiskId=" ) + ( ovfDiskId ) ) + ", status=" ) + ( status ) ) + ", lastUpdated=" ) + ( lastUpdated ) ) + '}' ; }

Target:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "storageDomainId" , storageDomainId ) . append ( "storedOvfIds" , storedOvfIds ) . append ( "ovfDiskId" , ovfDiskId ) . append ( "status" , status ) . append ( "lastUpdated" , lastUpdated ) . build ( ) ; }
Source:
public static void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
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 ) ; }
Source:
private org.ovirt.engine.core.compat.Guid pickProxyHostFromDataCenter ( ) { org.ovirt.engine.core.compat.Guid dataCenterId = ( ( org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getDataCenterId ( ) ) == null ) ? getRandomDataCenter ( ) : org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getDataCenterId ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdss = org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getVdsDao ( ) . getAllForStoragePoolAndStatus ( dataCenterId , VDSStatus.Up ) ; if ( vdss.isEmpty ( ) ) { logNoProxyAvailable ( org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getDataCenterId ( ) ) ; throw new java.lang.IllegalArgumentException ( ) ; } return vdss.get ( 0 ) . getId ( ) ; }

Target:
private boolean isGetNamesOfVmsFromExternalProviderSupported ( ) { return org.ovirt.engine.core.common.FeatureSupported.isGetNamesOfVmsFromExternalProviderSupported ( dbFacade.getStoragePoolDao ( ) . get ( org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getDataCenterId ( ) ) . getCompatibilityVersion ( ) ) ; }
Source:
public void vlanBondNameMismatch ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifacesToBond = createBondSlaves ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , ifacesToBond ) ; parameters.getInterfaces ( ) . add ( createVlan ( ( ( bond.getName ( ) ) + "1" ) , 100 , "net" ) ) ; mockExistingIfacesWithBond ( bond , ifacesToBond ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_INTERFACE_NOT_EXISTS ) ; }

Target:
public void vlanBondNameMismatch ( ) { 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 > ifacesToBond = createNics ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , ifacesToBond ) ; parameters.getInterfaces ( ) . add ( createVlan ( ( ( bond.getName ( ) ) + "1" ) , 100 , "net" ) ) ; mockExistingIfacesWithBond ( bond , ifacesToBond ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_INTERFACE_NOT_EXISTS ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase removeCinderDisk ( org.ovirt.engine.core.compat.Guid cinderDiskId , org.ovirt.engine.core.compat.Guid storageDomainId ) { java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > future = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( VdcActionType.RemoveCinderDisk , buildChildCommandParameters ( cinderDiskId ) , null , new org.ovirt.engine.core.common.businessentities.SubjectEntity ( org.ovirt.engine.core.common.VdcObjectType.Storage , storageDomainId ) ) ; try { return future.get ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.ExecutionException e ) { org.ovirt.engine.core.bll.storage.disk.cinder.CloneCinderDisksCommandCallback.log.error ( "Fail to revert disk id '{}'" , cinderDiskId ) ; e.printStackTrace ( ) ; return null ; } }

Target:
private void removeCinderDisk ( org.ovirt.engine.core.compat.Guid cinderDiskId , org.ovirt.engine.core.compat.Guid storageDomainId ) { java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > future = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( VdcActionType.RemoveCinderDisk , buildChildCommandParameters ( cinderDiskId ) , null , new org.ovirt.engine.core.common.businessentities.SubjectEntity ( org.ovirt.engine.core.common.VdcObjectType.Storage , storageDomainId ) ) ; try { future.get ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.ExecutionException e ) { org.ovirt.engine.core.bll.storage.disk.cinder.CloneCinderDisksCommandCallback.log.error ( "Fail to revert disk id '{}'." , cinderDiskId ) ; org.ovirt.engine.core.bll.storage.disk.cinder.CloneCinderDisksCommandCallback.log.error ( "Exception: " , e ) ; } }
Source:
public org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider < java.util.Map < java.lang.String , java.lang.String > , org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel , org.ovirt.engine.ui.uicommonweb.models.hosts.HostHooksListModel > getHostHooksListProvider ( org.ovirt.engine.ui.webadmin.gin.ClientGinjector ginjector ) { return new org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider < java.util.Map < java.lang.String , java.lang.String > , org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel , org.ovirt.engine.ui.uicommonweb.models.hosts.HostHooksListModel > ( ginjector , org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.class , org.ovirt.engine.ui.uicommonweb.models.hosts.HostHooksListModel.class ) ; }

Target:
public org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider < java.util.Map < java.lang.String , java.lang.String > , org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel , org.ovirt.engine.ui.uicommonweb.models.hosts.HostHooksListModel > getHostHooksListProvider ( com.google.gwt.event.shared.EventBus eventBus , com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget > defaultConfirmPopupProvider ) { return new org.ovirt.engine.ui.common.uicommon.model.SearchableDetailTabModelProvider < java.util.Map < java.lang.String , java.lang.String > , org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel , org.ovirt.engine.ui.uicommonweb.models.hosts.HostHooksListModel > ( eventBus , defaultConfirmPopupProvider , org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.class , org.ovirt.engine.ui.uicommonweb.models.hosts.HostHooksListModel.class ) ; }
Source:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
private static java.util.List < java.lang.String > getListOfIsoFiles ( java.io.File directory ) { java.util.List < java.lang.String > isoFileList = new java.util.ArrayList < java.lang.String > ( ) ; java.io.File [ ] filterOvirtFiles = org.ovirt.engine.core.bll.GetoVirtISOsQuery.filterOvirtFiles ( directory , org.ovirt.engine.core.bll.GetoVirtISOsQuery.isoPattern ) ; for ( java.io.File file : filterOvirtFiles ) { isoFileList.add ( file.getName ( ) ) ; } return isoFileList ; }

Target:
private static java.util.regex.Pattern getIsoPattern ( ) { java.lang.String expectedPattern = ( org.ovirt.engine.core.bll.GetoVirtISOsQuery.getOvirtIsoPrefix ( ) ) + "-.*.iso" ; if ( ( ( org.ovirt.engine.core.bll.GetoVirtISOsQuery.isoPattern ) == null ) || ( ! ( expectedPattern.equals ( org.ovirt.engine.core.bll.GetoVirtISOsQuery.isoPattern.toString ( ) ) ) ) ) { org.ovirt.engine.core.bll.GetoVirtISOsQuery.isoPattern = java.util.regex.Pattern.compile ( expectedPattern ) ; } return org.ovirt.engine.core.bll.GetoVirtISOsQuery.isoPattern ; }
Source:
public org.ovirt.engine.core.common.businessentities.RoleGroupMap getByActionGroupAndRole ( org.ovirt.engine.core.common.businessentities.ActionGroup group , org.ovirt.engine.core.compat.Guid id ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "action_group_id" , group.getId ( ) ) . addValue ( "role_id" , id ) ; return getCallsHandler ( ) . executeRead ( "Get_roles_groups_By_action_group_id_And_By_role_id" , RoleGroupMapRowMapper.instance , parameterSource ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.RoleGroupMap getByActionGroupAndRole ( org.ovirt.engine.core.common.businessentities.ActionGroup group , org.ovirt.engine.core.compat.Guid id ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "action_group_id" , group.getId ( ) ) . addValue ( "role_id" , id ) ; return getCallsHandler ( ) . executeRead ( "Get_roles_groups_By_action_group_id_And_By_role_id" , org.ovirt.engine.core.dao.RoleGroupMapDAODbFacadeImpl.RoleGroupMapRowMapper.instance , parameterSource ) ; }
Source:
public void testIsQcowV2SupportedForDcVersionV4 ( ) { disk1.setVolumeFormat ( VolumeFormat.COW ) ; disk1.setQcowCompat ( QcowCompat.QCOW2_V2 ) ; org.ovirt.engine.core.common.businessentities.StoragePool sp = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; sp.setStoragePoolFormatType ( StorageFormatType.V4 ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( sp ) ; org.junit.Assert.assertThat ( validator.isQcowVersionSupportedForDcVersion ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testIsQcowV2SupportedForDcVersionV4 ( ) { disk1.setVolumeFormat ( VolumeFormat.COW ) ; disk1.setQcowCompat ( QcowCompat.QCOW2_V2 ) ; org.ovirt.engine.core.common.businessentities.StoragePool sp = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; sp.setStoragePoolFormatType ( StorageFormatType.V4 ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( sp ) ; org.hamcrest.MatcherAssert.assertThat ( validator.isQcowVersionSupportedForDcVersion ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StoragePool setUpStoragePool ( int index ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = control.createMock ( org.ovirt.engine.core.common.businessentities.StoragePool.class ) ; org.ovirt.engine.api.model.Version version = new org.ovirt.engine.api.model.Version ( 2 , 2 ) ; if ( index != ( - 1 ) ) { org.easymock.EasyMock.expect ( pool.getId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; } org.easymock.EasyMock.expect ( pool.getCompatibilityVersion ( ) ) . andReturn ( version ) . anyTimes ( ) ; return pool ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StoragePool setUpStoragePool ( int index ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.StoragePool.class ) ; org.ovirt.engine.api.model.Version version = new org.ovirt.engine.api.model.Version ( 2 , 2 ) ; if ( index != ( - 1 ) ) { org.mockito.Mockito.when ( pool.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; } org.mockito.Mockito.when ( pool.getCompatibilityVersion ( ) ) . thenReturn ( version ) ; return pool ; }
Source:
protected void disconnectFromStorage ( ) { org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters connectionParametersForVdsm = createParametersForVdsm ( org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) . getstorage_type ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) ) ; boolean isDisconnectSucceeded = runVdsCommand ( VDSCommandType.DisconnectStorageServer , connectionParametersForVdsm ) . getSucceeded ( ) ; if ( ! isDisconnectSucceeded ) { log.warn ( ( "Failed to disconnect storage connection " + ( org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) ) ) ) ; } }

Target:
protected void disconnectFromStorage ( ) { org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters connectionParametersForVdsm = createParametersForVdsm ( org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , Guid.Empty , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) . getstorage_type ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) ) ; boolean isDisconnectSucceeded = runVdsCommand ( VDSCommandType.DisconnectStorageServer , connectionParametersForVdsm ) . getSucceeded ( ) ; if ( ! isDisconnectSucceeded ) { log.warn ( ( "Failed to disconnect storage connection " + ( org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) ) ) ) ; } }
Source:
static org.ovirt.engine.core.common.businessentities.network.BondMode getBondMode ( java.lang.String bondOptions ) { if ( bondOptions == null ) { return null ; } java.lang.String bondModeValue = org.ovirt.engine.core.common.businessentities.network.BondMode.findMode ( bondOptions ) ; if ( bondModeValue == null ) { return null ; } for ( org.ovirt.engine.core.common.businessentities.network.BondMode bondMode : org.ovirt.engine.core.common.businessentities.network.BondMode.values ( ) ) { if ( bondMode.getValue ( ) . equals ( bondModeValue ) ) { return bondMode ; } } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.BondMode getBondMode ( java.lang.String bondModeValue ) { if ( bondModeValue == null ) { return null ; } for ( org.ovirt.engine.core.common.businessentities.network.BondMode bondMode : org.ovirt.engine.core.common.businessentities.network.BondMode.values ( ) ) { if ( ( bondMode.getStringValue ( ) . equals ( bondModeValue ) ) || ( bondMode.getValue ( ) . equals ( bondModeValue ) ) ) { return bondMode ; } } return null ; }
Source:
private boolean hasTasksWithoutVdsmId ( java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > tasks ) { for ( org.ovirt.engine.core.common.businessentities.AsyncTasks task : tasks ) { if ( org.ovirt.engine.core.bll.tasks.AsyncTaskManager.hasEmptyVdsmId ( task ) ) { return true ; } } return false ; }

Target:
public boolean doesCommandContainAsyncTask ( org.ovirt.engine.core.compat.Guid cmdId ) { for ( org.ovirt.engine.core.bll.tasks.interfaces.SPMTask task : _tasks.values ( ) ) { if ( task.getParameters ( ) . getDbAsyncTask ( ) . getCommandId ( ) . equals ( cmdId ) ) { return true ; } } return false ; }
Source:
public void validateVmIsNotDown ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( diskValidator.isDiskPluggedToVmsThatAreNotDown ( org.mockito.ArgumentMatchers.anyBoolean ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }

Target:
public void validateVmIsNotDown ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( diskValidator.isDiskPluggedToVmsThatAreNotDown ( org.mockito.ArgumentMatchers.anyBoolean ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }
Source:
private boolean networkRequiredOnVds ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmIface , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > networksByName , boolean onlyRequiredNetworks ) { boolean networkRequiredOnVds = true ; if ( ! ( vmIface.isPlugged ( ) ) ) { networkRequiredOnVds = false ; } else if ( onlyRequiredNetworks ) { networkRequiredOnVds = networksByName.get ( vmIface.getNetworkName ( ) ) . getCluster ( ) . isRequired ( ) ; } return networkRequiredOnVds ; }

Target:
private boolean networkRequiredOnVds ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmIface , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > networksByName , boolean onlyRequiredNetworks ) { if ( ! ( vmIface.isPlugged ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.network.Network network = networksByName.get ( vmIface.getNetworkName ( ) ) ; if ( onlyRequiredNetworks ) { return network.getCluster ( ) . isRequired ( ) ; } return ! ( network.isExternal ( ) ) ; }
Source:
private void buildVmGraphicsDevicesFromDb ( boolean usesGraphicsAsDevice ) { if ( usesGraphicsAsDevice ) { buildVmDevicesFromDb ( VmDeviceGeneralType.GRAPHICS , false ) ; } java.lang.String legacyDisplay = deriveDisplayTypeLegacy ( ) ; if ( legacyDisplay != null ) { createInfo.put ( VdsProperties.display , legacyDisplay ) ; } }

Target:
private java.util.Map < java.lang.String , java.lang.Object > buildVmGraphicsSpecParamsFromVm ( java.util.Map < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > infos ) { java.util.Map < java.lang.String , java.lang.Object > specParamsFromVm = null ; if ( ( infos != null ) && ( infos.containsKey ( GraphicsType.SPICE ) ) ) { specParamsFromVm = new java.util.HashMap ( ) ; addVmSpiceOptions ( infos , specParamsFromVm ) ; } return specParamsFromVm ; }
Source:
public org.ovirt.engine.sdk.decorators.Template add ( org.ovirt.engine.sdk.decorators.Template template , java.lang.String expect , java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . add ( "Expect" , expect ) . add ( "Correlation-Id" , correlationId ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , template , org.ovirt.engine.sdk.entities.Template.class , org.ovirt.engine.sdk.decorators.Template.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.Template add ( org.ovirt.engine.sdk.decorators.Template template ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , template , org.ovirt.engine.sdk.entities.Template.class , org.ovirt.engine.sdk.decorators.Template.class , headers ) ; }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { 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.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; model.dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; if ( ( ( model.dataCenter ) == null ) || ( ( model.dataCenter.getStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) { model.updateOptionsNonLocalFSData ( ) ; } else { model.updateOptionsLocalFSData ( ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; model.dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; if ( ( ( model.dataCenter ) == null ) || ( ! ( model.dataCenter.isLocal ( ) ) ) ) { model.updateOptionsNonLocalFSData ( ) ; } else { model.updateOptionsLocalFSData ( ) ; } }
Source:
public void testUpdateFieldsQuotaEnforcementType ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.DISABLED ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.HARD_ENFORCEMENT ) ; org.junit.Assert.assertTrue ( "Update should be valid for different quota enforcement types" , vmTemplateHandler.isUpdateValid ( src , dest ) ) ; }

Target:
public void testUpdateFieldsQuotaEnforcementType ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.DISABLED ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.HARD_ENFORCEMENT ) ; org.junit.jupiter.api.Assertions.assertTrue ( vmTemplateHandler.isUpdateValid ( src , dest ) , "Update should be valid for different quota enforcement types" ) ; }
Source:
private void setUpGetEntityWithNoCertificateInfoExpectations ( int times , boolean notFound , org.ovirt.engine.core.common.businessentities.VDS entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : entity ) ) ; } }

Target:
private void setUpGetEntityWithNoCertificateInfoExpectations ( int times , boolean notFound , org.ovirt.engine.core.common.businessentities.VDS entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : entity ) ) ; } }
Source:
public synchronized void StopStoragePoolTasks ( final org.ovirt.engine.core.common.businessentities.storage_pool sp ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "Attempting to get and stop tasks on storage pool '{0}'" , sp.getname ( ) ) ; AddStoragePoolExistingTasks ( sp ) ; java.util.List < org.ovirt.engine.core.bll.SPMAsyncTask > list = org.ovirt.engine.core.utils.linq.LinqUtils.filter ( _tasks.values ( ) , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.bll.SPMAsyncTask > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.bll.SPMAsyncTask a ) { return a.getStoragePoolID ( ) . equals ( sp.getId ( ) ) ; } } ) ; for ( org.ovirt.engine.core.bll.SPMAsyncTask task : list ) { task.StopTask ( ) ; } }

Target:
public synchronized void StopStoragePoolTasks ( final org.ovirt.engine.core.common.businessentities.storage_pool sp ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "Attempting to get and stop tasks on storage pool '{0}'" , sp.getname ( ) ) ; AddStoragePoolExistingTasks ( sp ) ; java.util.List < org.ovirt.engine.core.bll.SPMAsyncTask > list = org.ovirt.engine.core.utils.linq.LinqUtils.filter ( _tasks.values ( ) , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.bll.SPMAsyncTask > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.bll.SPMAsyncTask a ) { return a.getStoragePoolID ( ) . equals ( sp.getId ( ) ) ; } } ) ; for ( org.ovirt.engine.core.bll.SPMAsyncTask task : list ) { task.stopTask ( ) ; } }
Source:
public void canDoActionEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void canDoActionVmInPreview ( ) { initializeCommand ( ImageOperation.Move ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.AuditLog event = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . get ( org.ovirt.engine.core.bll.RemoveExternalEventCommand.getParameters ( ) . getId ( ) ) ; if ( event == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_NOT_FOUND ) ; } if ( OVIRT.equalsIgnoreCase ( event.getOrigin ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; } if ( ( event.getseverity ( ) ) == ( org.ovirt.engine.core.common.AuditLogSeverity.ALERT ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLRGAL_OPERATION ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.AuditLog event = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . get ( org.ovirt.engine.core.bll.RemoveExternalEventCommand.getParameters ( ) . getId ( ) ) ; if ( event == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_NOT_FOUND ) ; } if ( OVIRT.equalsIgnoreCase ( event.getOrigin ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; } if ( ( event.getseverity ( ) ) == ( org.ovirt.engine.core.common.AuditLogSeverity.ALERT ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_OPERATION ) ; } return true ; }
Source:
protected org.ovirt.engine.core.common.errors.VdcBllErrors GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.StatusForXmlRpc xmlRpcStatus ) { try { org.ovirt.engine.core.common.errors.VdcBllErrors bllErrors = org.ovirt.engine.core.common.errors.VdcBllErrors.forValue ( xmlRpcStatus.mCode ) ; if ( bllErrors == null ) { log.warn ( ( "Unexpected return value: " + xmlRpcStatus ) ) ; bllErrors = org.ovirt.engine.core.common.errors.VdcBllErrors.unexpected ; } return bllErrors ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.core.common.errors.VdcBllErrors.unexpected ; } }

Target:
protected org.ovirt.engine.core.common.errors.VdcBllErrors getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.StatusForXmlRpc xmlRpcStatus ) { try { org.ovirt.engine.core.common.errors.VdcBllErrors bllErrors = org.ovirt.engine.core.common.errors.VdcBllErrors.forValue ( xmlRpcStatus.mCode ) ; if ( bllErrors == null ) { log.warn ( ( "Unexpected return value: " + xmlRpcStatus ) ) ; bllErrors = org.ovirt.engine.core.common.errors.VdcBllErrors.unexpected ; } return bllErrors ; } catch ( java.lang.Exception e ) { return org.ovirt.engine.core.common.errors.VdcBllErrors.unexpected ; } }
Source:
public static void GetLocalFSPath ( 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.RhevhLocalFSPath ) , aQuery ) ; }

Target:
public static void GetHighUtilizationForPowerSave ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.HighUtilizationForPowerSave ) , aQuery ) ; }
Source:
private boolean canRemoveTemplateDisk ( ) { if ( ( org.ovirt.engine.core.bll.RemoveDiskCommand.getVmTemplate ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.Locked ) ) { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImage ( ) ; if ( ( diskImage.getStorageIds ( ) . size ( ) ) == 1 ) { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_LAST_DOMAIN ) ; } if ( ! ( checkDerivedVmFromTemplateExists ( diskImage ) ) ) { return false ; } return true ; }

Target:
private boolean canRemoveTemplateDisk ( ) { if ( ( org.ovirt.engine.core.bll.RemoveDiskCommand.getVmTemplate ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmTemplateStatus.Locked ) ) { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED ) ; } org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImage ( ) ; if ( ( diskImage.getStorageIds ( ) . size ( ) ) == 1 ) { return failCanDoAction ( VdcBllMessages.VM_TEMPLATE_IMAGE_LAST_DOMAIN ) ; } if ( ( ! ( checkDerivedVmFromTemplateExists ( diskImage ) ) ) || ( ! ( checkDerivedDisksFromDiskNotExist ( diskImage ) ) ) ) { return false ; } return true ; }
Source:
protected org.ovirt.engine.api.model.GlusterVolume postPopulate ( org.ovirt.engine.api.model.GlusterVolume model ) { model.setVolumeType ( GlusterVolumeType.DISTRIBUTE.name ( ) . toLowerCase ( ) ) ; java.util.List < java.lang.String > transportTypes = model.getTransportTypes ( ) . getTransportTypes ( ) ; transportTypes.clear ( ) ; transportTypes.add ( TransportType.TCP.name ( ) . toLowerCase ( ) ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.GlusterVolume postPopulate ( org.ovirt.engine.api.model.GlusterVolume model ) { model.setVolumeType ( GlusterVolumeType.DISTRIBUTE ) ; java.util.List < org.ovirt.engine.api.model.TransportType > transportTypes = model.getTransportTypes ( ) . getTransportTypes ( ) ; transportTypes.clear ( ) ; transportTypes.add ( TransportType.TCP ) ; return model ; }
Source:
public static void getTemplateNicList ( 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.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
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 ( ) ; } }

Target:
public void postUpdateVmTemplate ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { cancel ( ) ; } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.GetVmByVmIdQuery.getDbFacade ( ) . getVmDao ( ) . get ( org.ovirt.engine.core.bll.GetVmByVmIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetVmByVmIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVmByVmIdQuery.getParameters ( ) . isFiltered ( ) ) ; if ( vm != null ) { updateVMDetails ( vm ) ; org.ovirt.engine.core.bll.GetVmByVmIdQuery.getQueryReturnValue ( ) . setReturnValue ( vm ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VM vm = vmDao.get ( org.ovirt.engine.core.bll.GetVmByVmIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetVmByVmIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetVmByVmIdQuery.getParameters ( ) . isFiltered ( ) ) ; if ( vm != null ) { updateVMDetails ( vm ) ; org.ovirt.engine.core.bll.GetVmByVmIdQuery.getQueryReturnValue ( ) . setReturnValue ( vm ) ; } }
Source:
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 ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getPath ( ) ) ) ) { getPathChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; } else if ( ( ev.matchesDefinition ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getOverride ( ) ) ) ) { override_EntityChanged ( args ) ; } }

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 ( EntityModel.entityChangedEventDefinition ) ) && ( sender == ( getPath ( ) ) ) ) { getPathChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; } else if ( ( ev.matchesDefinition ( EntityModel.entityChangedEventDefinition ) ) && ( sender == ( getOverride ( ) ) ) ) { override_EntityChanged ( args ) ; } }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getDestroyCommand ( ) ) ) { return destroyConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getDestroyCommand ( ) ) ) { return destroyConfirmPopupProvider.get ( ) ; } else if ( lastExecutedCommand.getName ( ) . equals ( "OnSave" ) ) { return forceCreateConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.VDSGroup setUpVDSGroupExpectations ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = control.createMock ( org.ovirt.engine.core.common.businessentities.VDSGroup.class ) ; org.easymock.classextension.EasyMock.expect ( group.getId ( ) ) . andReturn ( id ) . anyTimes ( ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupByVdsGroupId , org.ovirt.engine.core.common.queries.GetVdsGroupByVdsGroupIdParameters.class , new java.lang.String [ ] { "VdsGroupId" } , new java.lang.Object [ ] { id } , group ) ; return group ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VDSGroup setUpVDSGroupExpectations ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = control.createMock ( org.ovirt.engine.core.common.businessentities.VDSGroup.class ) ; org.easymock.EasyMock.expect ( group.getId ( ) ) . andReturn ( id ) . anyTimes ( ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupByVdsGroupId , org.ovirt.engine.core.common.queries.GetVdsGroupByVdsGroupIdParameters.class , new java.lang.String [ ] { "VdsGroupId" } , new java.lang.Object [ ] { id } , group ) ; return group ; }