auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void isClusterEmpty ( 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.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getStorageDomainsWithAttachedStoragePoolGuid ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.StoragePool storagePool , java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { 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.StorageDomain > ( ) : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; } } ; org.ovirt.engine.core.common.queries.StorageDomainsAndStoragePoolIdQueryParameters parameters = new org.ovirt.engine.core.common.queries.StorageDomainsAndStoragePoolIdQueryParameters ( storageDomains , storagePool.getId ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsWithAttachedStoragePoolGuid , parameters , aQuery ) ; }
Source:
public boolean isManagementNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { final java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > networkClusters = getNetworkClusterDao ( ) . getAllForNetwork ( networkId ) ; final org.ovirt.engine.core.common.businessentities.network.NetworkCluster managementNetworkCluster = org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( networkClusters , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster ) { return networkCluster.isManagement ( ) ; } } ) ; return managementNetworkCluster != null ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.Network getManagementNetwork ( org.ovirt.engine.core.compat.Guid clusterId ) { return networkDao.getManagementNetwork ( clusterId ) ; }
Source:
void updateStyles ( java.lang.Boolean isNarrowStyle ) { java.lang.String editorStyle = style.editorContentNarrow ( ) ; updateEditorStyle ( diskAliasLabel , editorStyle ) ; updateEditorStyle ( diskAliasEditor , editorStyle ) ; updateEditorStyle ( diskSizeLabel , editorStyle ) ; updateEditorStyle ( sourceStorageLabel , editorStyle ) ; updateEditorStyle ( volumeTypeListEditor , editorStyle ) ; updateEditorStyle ( sourceStorageListEditor , editorStyle ) ; updateEditorStyle ( storageListEditor , editorStyle ) ; updateEditorStyle ( diskProfileListEditor , editorStyle ) ; updateEditorStyle ( quotaListEditor , editorStyle ) ; }

Target:
void updateStyles ( java.lang.Boolean isNarrowStyle ) { java.lang.String editorStyle = style.editorContentNarrow ( ) ; updateEditorStyle ( diskAliasLabel , editorStyle ) ; updateEditorStyle ( diskAliasEditor , editorStyle ) ; updateEditorStyle ( diskSizeLabel , editorStyle ) ; updateEditorStyle ( sourceStorageLabel , editorStyle ) ; updateEditorStyle ( volumeTypeListEditor , editorStyle ) ; updateEditorStyle ( volumeFormatListEditor , editorStyle ) ; updateEditorStyle ( sourceStorageListEditor , editorStyle ) ; updateEditorStyle ( storageListEditor , editorStyle ) ; updateEditorStyle ( diskProfileListEditor , editorStyle ) ; updateEditorStyle ( quotaListEditor , editorStyle ) ; }
Source:
protected boolean verifyAddVM ( ) { final java.util.List < java.lang.String > reasons = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ; final int nicsCount = ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ; final int priority = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getPriority ( ) ; return org.ovirt.engine.core.bll.VmHandler.verifyAddVm ( reasons , nicsCount , priority , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getMacPool ( ) ) ; }

Target:
protected boolean verifyAddVM ( ) { final java.util.List < java.lang.String > reasons = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getValidationMessages ( ) ; final int nicsCount = ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ; final int priority = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getPriority ( ) ; return org.ovirt.engine.core.bll.VmHandler.verifyAddVm ( reasons , nicsCount , priority , getMacPool ( ) ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetNicsExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmTemplateInterface , org.ovirt.engine.core.common.action.RemoveVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateNicResourceTest.TEMPLATE_ID , org.ovirt.engine.api.restapi.resource.BackendTemplateNicResourceTest.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 { setUpGetNicsExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmTemplateInterface , org.ovirt.engine.core.common.action.RemoveVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateNicResourceTest.TEMPLATE_ID , org.ovirt.engine.api.restapi.resource.BackendTemplateNicResourceTest.NIC_ID } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
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.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( id ) , aQuery ) ; }

Target:
public static void GetLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters tempVar = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( ) ; tempVar.setVgId ( vgId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetLunsByVgId , tempVar , aQuery ) ; }
Source:
private java.lang.String getDiskIsBeingExportedMessage ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( EngineMessage.ACTION_TYPE_FAILED_DISK_IS_BEING_EXPORTED.name ( ) ) ; if ( ( getDiskImage ( ) ) != null ) { builder.append ( java.lang.String.format ( "$DiskAlias %1$s" , getDiskImage ( ) . getDiskAlias ( ) ) ) ; } return builder.toString ( ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImage ( ) ; if ( diskImage == null ) { return null ; } return java.util.Collections.singletonMap ( diskImage.getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.DISK , new org.ovirt.engine.core.bll.LockMessage ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_IS_BEING_EXPORTED ) . withOptional ( "DiskAlias" , ( ( getDiskImage ( ) ) != null ? getDiskImage ( ) . getDiskAlias ( ) : null ) ) ) ) ; }
Source:
protected void endSuccessfully ( ) { org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVmStaticDAO ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.endActionOnDisks ( ) ; if ( ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.unlockVm ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) , org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getCompensationContext ( ) ) ; restoreVmConfigFromSnapshot ( ) ; } else { org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "VmCommand::EndVmCommand: Vm is null - not performing EndAction on Vm" ) ; } org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.setSucceeded ( true ) ; }

Target:
protected void endSuccessfully ( ) { org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVmStaticDAO ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.endActionOnDisks ( ) ; if ( ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.unlockVm ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getVm ( ) , org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getCompensationContext ( ) ) ; restoreVmConfigFromSnapshot ( ) ; } else { org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "VmCommand::EndVmCommand: Vm is null - not performing endAction on Vm" ) ; } org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.setSucceeded ( true ) ; }
Source:
public static 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.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.GetVmsRunningOnOrMigratingToVdsParameters ( id ) , aQuery ) ; }

Target:
public static 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.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.GetVmsRunningOnOrMigratingToVdsParameters ( id ) , aQuery ) ; }
Source:
protected void init ( ) { super . init ( ) ; oldVmId = org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getVmId ( ) ; setVmName ( org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewName ( ) ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewVmGuid ( ) ) ) { setupParameters ( ) ; } else { setVmId ( org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewVmGuid ( ) ) ; } }

Target:
protected void init ( ) { super . init ( ) ; oldVmId = org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getVmId ( ) ; setVmName ( org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewName ( ) ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewVmGuid ( ) ) ) { setupParameters ( ) ; } else { setVmId ( org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewVmGuid ( ) ) ; } org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . setUseCinderCommandCallback ( ( ! ( getAdjustedDiskImagesFromConfiguration ( ) . isEmpty ( ) ) ) ) ; }
Source:
public final java.lang.Object getData ( java.lang.String key ) { java.lang.String sessionId = org.ovirt.engine.core.utils.ThreadLocalParamsContainer.getHttpSessionId ( ) ; if ( sessionId == null ) { return null ; } return getData ( sessionId , key , false ) ; }

Target:
public final java.lang.Object getData ( java.lang.String sessionId , java.lang.String key , boolean refresh ) { if ( sessionId == null ) { return null ; } org.ovirt.engine.core.bll.session.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; java.lang.Object value = null ; if ( sessionInfo != null ) { if ( refresh ) { refresh ( sessionInfo ) ; } value = sessionInfo.contentOfSession.get ( key ) ; } return value ; }
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.getInstance ( ) . 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 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 ) ; }
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 ( getEnabled ( ) . equals ( sender ) ) { updateChangeability ( ) ; } }

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 ( getEnabled ( ) . equals ( sender ) ) { updateChangeability ( ) ; } else if ( this . equals ( sender ) ) { getEnabled ( ) . setIsChangable ( getIsChangable ( ) ) ; } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue currentVmsInPoolQuery = runInternalQuery ( QueryType.GetAllPoolVms , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.bll.UpdateVmPoolCommand.getVmPool ( ) . getVmPoolId ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > poolVmsBeforeAdd = ( currentVmsInPoolQuery.getSucceeded ( ) ) ? currentVmsInPoolQuery.getReturnValue ( ) : null ; super . executeCommand ( ) ; org.ovirt.engine.core.bll.UpdateVmPoolCommand.getCompensationContext ( ) . cleanupCompensationDataAfterSuccessfulCommand ( ) ; if ( ( org.ovirt.engine.core.bll.UpdateVmPoolCommand.getSucceeded ( ) ) && ( isUpdateVmRequired ( poolVmsBeforeAdd ) ) ) { updatePoolVms ( poolVmsBeforeAdd ) ; } vmPoolMonitor.triggerPoolMonitoringJob ( ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.queries.QueryReturnValue currentVmsInPoolQuery = runInternalQuery ( QueryType.GetAllPoolVms , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.bll.UpdateVmPoolCommand.getVmPool ( ) . getVmPoolId ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > poolVmsBeforeAdd = ( currentVmsInPoolQuery.getSucceeded ( ) ) ? currentVmsInPoolQuery.getReturnValue ( ) : null ; super . executeCommand ( ) ; org.ovirt.engine.core.bll.UpdateVmPoolCommand.getCompensationContext ( ) . cleanupCompensationDataAfterSuccessfulCommand ( ) ; if ( ( org.ovirt.engine.core.bll.UpdateVmPoolCommand.getSucceeded ( ) ) && ( isUpdateVmRequired ( poolVmsBeforeAdd ) ) ) { updatePoolVms ( poolVmsBeforeAdd ) ; } vmPoolMonitor.triggerPoolMonitoringJob ( ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult hostStatusLegalForSetupNetworks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSStatus > supportedStatuses = java.util.Arrays.asList ( VDSStatus.Maintenance , VDSStatus.Up , VDSStatus.NonOperational ) ; boolean hostStatusLegalForSetupNetworks = ( supportedStatuses.contains ( host.getStatus ( ) ) ) || ( ( ( host.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Installing ) ) && ( internalExecution ) ) ; if ( ! hostStatusLegalForSetupNetworks ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.network.host.HostValidator.VAR_HOST_STATUS , host.getStatus ( ) . name ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult hostStatusLegalForSetupNetworks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSStatus > supportedStatuses = java.util.Arrays.asList ( VDSStatus.Maintenance , VDSStatus.Up , VDSStatus.NonOperational ) ; boolean hostStatusLegalForSetupNetworks = ( supportedStatuses.contains ( host.getStatus ( ) ) ) || ( ( ( host.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Installing ) ) && ( internalExecution ) ) ; if ( ! hostStatusLegalForSetupNetworks ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( org.ovirt.engine.core.bll.network.host.HostValidator.VAR_HOST_STATUS , supportedStatuses , "," , supportedStatuses.size ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void testBootFromNetworkNoNetwork ( ) { org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , BootSequence.N , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , false , VdcBllMessages.VM_CANNOT_RUN_FROM_NETWORK_WITHOUT_NETWORK ) ; }

Target:
public void testBootFromNetworkNoNetwork ( ) { org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao.class ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) . when ( dao ) . getAllForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( dao ) . when ( runVmValidator ) . getVmNetworkInterfaceDao ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , BootSequence.N , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , false , VdcBllMessages.VM_CANNOT_RUN_FROM_NETWORK_WITHOUT_NETWORK ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc changeFloppy ( java.lang.String vmId , java.lang.String imageLocation ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.changeFloppy" ) . withParameter ( "vmID" , vmId ) . withParameter ( "driveSpec" , imageLocation ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.QemuImageInfoReturn getQemuImageInfo ( java.lang.String sdUUID , java.lang.String spUUID , java.lang.String imgUUID , java.lang.String volUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Volume.getQemuImageInfo" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imgUUID ) . withParameter ( "volumeID" , volUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.QemuImageInfoReturn ( response ) ; }
Source:
protected void UpdateTasksWithActionParameters ( ) { for ( org.ovirt.engine.core.compat.Guid taskID : getReturnValue ( ) . getTaskIdList ( ) ) { getAsyncTaskManager ( ) . UpdateTaskWithActionParameters ( taskID , getParameters ( ) ) ; } }

Target:
private org.ovirt.engine.core.common.asynctasks.AsyncTaskType internalGetTaskType ( ) { if ( hasTaskHandlers ( ) ) { if ( ( getParameters ( ) . getExecutionReason ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionParametersBase.CommandExecutionReason.REGULAR_FLOW ) ) { return getCurrentTaskHandler ( ) . getTaskType ( ) ; } return getCurrentTaskHandler ( ) . getRevertTaskType ( ) ; } return getTaskType ( ) ; }
Source:
protected static org.ovirt.engine.core.common.businessentities.VM buildVmOnNewTemplate ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VM tempVar = new org.ovirt.engine.core.common.businessentities.VM ( ) ; tempVar.setId ( vm.getId ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , tempVar.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonUnitToVmBaseBuilder < org.ovirt.engine.core.common.businessentities.VmStatic > ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( vm.getStaticData ( ) , tempVar.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.UsbPolicyVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CpuSharesVmBaseToVmBaseBuilder ( ) ) ; return tempVar ; }

Target:
protected static org.ovirt.engine.core.common.businessentities.VM buildVmOnNewTemplate ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VM tempVar = new org.ovirt.engine.core.common.businessentities.VM ( ) ; tempVar.setId ( vm.getId ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , tempVar.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonUnitToVmBaseBuilder < org.ovirt.engine.core.common.businessentities.VmStatic > ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( vm.getStaticData ( ) , tempVar.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.UsbPolicyVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CpuSharesVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.DedicatedVmForVdsVmBaseToVmBaseBuilder ( ) ) ; return tempVar ; }
Source:
public void edit ( ) { final org.ovirt.engine.core.common.businessentities.network.Network network = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( getSelectedItem ( ) ) ) ; if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel networkModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkModel ( network , this ) ; setWindow ( networkModel ) ; networkModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) ) ; networkModel.getDataCenters ( ) . setSelectedItem ( getEntity ( ) ) ; }

Target:
public void newNetwork ( ) { if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel networkModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.NewNetworkModel ( this ) ; setWindow ( networkModel ) ; networkModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) ) ; networkModel.getDataCenters ( ) . setSelectedItem ( getEntity ( ) ) ; }
Source:
public void writeData ( java.io.ObjectOutputStream dos ) { try { writeDate ( this . history_datetime , dos ) ; dos.writeObject ( this . storage_domain_id ) ; writeInteger ( this . available_disk_size_gb , dos ) ; writeInteger ( this . used_disk_size_gb , dos ) ; writeInteger ( this . storage_configuration_version , dos ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public void writeData ( java.io.ObjectOutputStream dos ) { try { writeDate ( this . history_datetime , dos ) ; dos.writeObject ( this . storage_domain_id ) ; dos.writeShort ( this . storage_domain_status ) ; dos.writeDouble ( this . minutes_in_status ) ; writeInteger ( this . available_disk_size_gb , dos ) ; writeInteger ( this . used_disk_size_gb , dos ) ; writeInteger ( this . storage_configuration_version , dos ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vds = org.ovirt.engine.core.bll.GetVdsByNameQuery.getDbFacade ( ) . getVdsDAO ( ) . getAllWithName ( org.ovirt.engine.core.bll.GetVdsByNameQuery.getParameters ( ) . getName ( ) ) ; if ( ( vds.size ( ) ) > 0 ) { org.ovirt.engine.core.bll.GetVdsByNameQuery.getQueryReturnValue ( ) . setReturnValue ( vds.get ( 0 ) ) ; } }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vds = org.ovirt.engine.core.bll.GetVdsByNameQuery.getDbFacade ( ) . getVdsDao ( ) . getAllWithName ( org.ovirt.engine.core.bll.GetVdsByNameQuery.getParameters ( ) . getName ( ) ) ; if ( ( vds.size ( ) ) > 0 ) { org.ovirt.engine.core.bll.GetVdsByNameQuery.getQueryReturnValue ( ) . setReturnValue ( vds.get ( 0 ) ) ; } }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; storageListModel.removeConnection = true ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setstorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; storageListModel.removeConnection = true ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; storageListModel.connection.setid ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }
Source:
public void shouldDetectSufficientMemory ( ) { vm.setNumaTuneMode ( NumaTuneMode.STRICT ) ; vmNumaNodes.get ( 0 ) . setMemTotal ( 1000 ) ; vdsNumaNodes.get ( 0 ) . setMemTotal ( 2000 ) ; org.junit.Assert.assertTrue ( underTest.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }

Target:
public void shouldDetectSufficientMemory ( ) { vm.setNumaTuneMode ( NumaTuneMode.STRICT ) ; vmNumaNodes.get ( 0 ) . setMemTotal ( 1000 ) ; vdsNumaNodes.get ( 0 ) . setMemTotal ( 2000 ) ; org.junit.jupiter.api.Assertions.assertTrue ( underTest.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }
Source:
public final boolean connect ( java.lang.String server , java.lang.String certPath , java.lang.String password ) { org.ovirt.engine.core.utils.hostinstall.Credentials creds = new org.ovirt.engine.core.utils.hostinstall.Credentials ( ) ; creds.setPassphrase ( password ) ; creds.setCertPath ( certPath ) ; creds.setUsername ( "root" ) ; return _doConnect ( server , creds ) ; }

Target:
public final boolean connect ( java.lang.String server , java.lang.String keyStore , java.lang.String keyStorePassword ) { return _doConnect ( server , "root" , null , keyStore , keyStorePassword ) ; }
Source:
protected void addVmPayload ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmPayload ( ) ; if ( payload != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmId ( ) ) , VmDeviceType.DISK , payload.getType ( ) , payload.getSpecParams ( ) , true , true ) ; } }

Target:
protected void addVmPayload ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmPayload ( ) ; if ( payload != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmId ( ) ) , VmDeviceGeneralType.DISK , payload.getType ( ) , payload.getSpecParams ( ) , true , true ) ; } }
Source:
private void testAllCpuProfileValuesEqualTo ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid cpuProfileId , boolean isAllNull ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > allByVdsGroup = dao.getAllByVdsGroup ( clusterId ) ; org.junit.Assert.assertNotNull ( allByVdsGroup ) ; org.junit.Assert.assertFalse ( allByVdsGroup.isEmpty ( ) ) ; boolean allValues = true ; for ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic : allByVdsGroup ) { allValues &= org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( vmStatic.getCpuProfileId ( ) , cpuProfileId ) ; } org.junit.Assert.assertEquals ( isAllNull , allValues ) ; }

Target:
private void testAllCpuProfileValuesEqualTo ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid cpuProfileId , boolean isAllNull ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > allByVdsGroup = dao.getAllByVdsGroup ( clusterId ) ; org.junit.Assert.assertNotNull ( allByVdsGroup ) ; org.junit.Assert.assertFalse ( allByVdsGroup.isEmpty ( ) ) ; boolean allValues = true ; for ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic : allByVdsGroup ) { allValues &= java.util.Objects.equals ( vmStatic.getCpuProfileId ( ) , cpuProfileId ) ; } org.junit.Assert.assertEquals ( isAllNull , allValues ) ; }
Source:
public java.util.List < org.ovirt.engine.core.compat.Guid > getAllStorageDomainsByImageGroup ( org.ovirt.engine.core.compat.Guid imageGroupId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domain_static > domains = staticDAO.getAllForImageGroup ( imageGroupId ) ; java.util.List < org.ovirt.engine.core.compat.Guid > result = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domain_static domain : domains ) { result.add ( domain.getId ( ) ) ; } return result ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > getAllStorageDomainsByImageId ( org.ovirt.engine.core.compat.Guid imageId ) { throw new org.ovirt.engine.core.compat.NotImplementedException ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc setVmTicket ( java.lang.String vmId , java.lang.String otp64 , java.lang.String sec , java.lang.String connectionAction , java.util.Map < java.lang.String , java.lang.String > params ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.setTicket" ) . withParameter ( "vmID" , vmId ) . withParameter ( "password" , otp64 ) . withParameter ( "ttl" , sec ) . withParameter ( "existingConnAction" , connectionAction ) . withParameter ( "params" , params ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc sparsifyVolume ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > volumeAddress ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.sparsify_volume" ) . withParameter ( "job_id" , jobId ) . withParameter ( "vol_info" , volumeAddress ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
protected boolean checkIfCpusSameManufacture ( org.ovirt.engine.core.common.businessentities.VDSGroup group ) { return org.ovirt.engine.core.bll.CpuFlagsManagerHandler.CheckIfCpusSameManufacture ( group.getcpu_name ( ) , org.ovirt.engine.core.bll.UpdateVdsGroupCommand.getVdsGroup ( ) . getcpu_name ( ) , org.ovirt.engine.core.bll.UpdateVdsGroupCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ; }

Target:
private boolean validateManagementNetworkAttachement ( ) { final org.ovirt.engine.core.common.businessentities.network.Network managementNetwork = getDefaultManagementNetworkFinder ( ) . findDefaultManagementNetwork ( org.ovirt.engine.core.bll.UpdateVdsGroupCommand.getVdsGroup ( ) . getStoragePoolId ( ) ) ; if ( managementNetwork == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEFAULT_MANAGEMENT_NETWORK_NOT_FOUND ) ; return false ; } managementNetworkCluster = createManagementNetworkCluster ( managementNetwork ) ; final org.ovirt.engine.core.bll.network.cluster.UpdateClusterNetworkClusterValidator networkClusterValidator = createManagementNetworkClusterValidator ( ) ; return validate ( networkClusterValidator.managementNetworkChange ( ) ) ; }
Source:
public void testCheckForIndex_Exists ( ) throws java.io.IOException , java.net.URISyntaxException { java.io.File file = new java.io.File ( this . getClass ( ) . getResource ( "filetest" ) . toURI ( ) ) ; org.mockito.Mockito.when ( mockRequest.getServletPath ( ) ) . thenReturn ( "/test/path" ) ; java.io.File indexFile = testServlet.checkForIndex ( mockRequest , mockResponse , file , null ) ; org.junit.Assert.assertNotNull ( "indexFile should not be null" , indexFile ) ; org.junit.Assert.assertTrue ( "indexFile should exist" , indexFile.exists ( ) ) ; org.mockito.Mockito.verify ( mockResponse ) . sendRedirect ( "/test/path/index.html" ) ; }

Target:
public void testCheckForIndex_Exists ( ) throws java.io.IOException , java.net.URISyntaxException { java.io.File file = new java.io.File ( this . getClass ( ) . getResource ( "filetest" ) . toURI ( ) ) ; org.mockito.Mockito.when ( mockRequest.getServletPath ( ) ) . thenReturn ( "/test/path" ) ; java.io.File indexFile = testServlet.checkForIndex ( mockRequest , mockResponse , file , null ) ; org.junit.jupiter.api.Assertions.assertNotNull ( indexFile , "indexFile should not be null" ) ; org.junit.jupiter.api.Assertions.assertTrue ( indexFile.exists ( ) , "indexFile should exist" ) ; org.mockito.Mockito.verify ( mockResponse ) . sendRedirect ( "/test/path/index.html" ) ; }
Source:
public static void updateConsoleDevice ( org.ovirt.engine.core.compat.Guid vmId , java.lang.Boolean consoleEnabled ) { if ( consoleEnabled == null ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > consoles = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.CONSOLE , VmDeviceType.CONSOLE.getName ( ) ) ; if ( consoleEnabled ) { if ( consoles.isEmpty ( ) ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addConsoleDevice ( vmId ) ; } } else { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : consoles ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( device.getId ( ) ) ; } } }

Target:
public static void updateConsoleDevice ( org.ovirt.engine.core.compat.Guid vmId , java.lang.Boolean consoleEnabled ) { if ( consoleEnabled == null ) { return ; } if ( consoleEnabled ) { if ( ! ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.hasConsoleDevice ( vmId ) ) ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addConsoleDevice ( vmId ) ; } } else { org.ovirt.engine.core.bll.utils.VmDeviceUtils.removeConsoleDevices ( vmId ) ; } }
Source:
private void initCdImage ( ) { getModel ( ) . getCdImage ( ) . setSelectedItem ( template.getIsoPath ( ) ) ; boolean hasCd = ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( template.getIsoPath ( ) ) ) ; getModel ( ) . getCdImage ( ) . setIsChangable ( hasCd ) ; getModel ( ) . getCdAttached ( ) . setEntity ( hasCd ) ; updateCdImage ( ) ; }

Target:
private void initCdImage ( ) { updateSelectedCdImage ( template ) ; updateCdImage ( ) ; }
Source:
public static < T extends java.lang.Object > void injectMembers ( T instance ) { javax.enterprise.inject.spi.AnnotatedType type = org.ovirt.engine.core.common.utils.Injector.injector.manager.createAnnotatedType ( instance.getClass ( ) ) ; javax.enterprise.inject.spi.InjectionTarget injectionTarget = org.ovirt.engine.core.common.utils.Injector.injector.manager.createInjectionTarget ( type ) ; injectionTarget.inject ( instance , org.ovirt.engine.core.common.utils.Injector.injector.manager.createCreationalContext ( null ) ) ; injectionTarget.postConstruct ( instance ) ; }

Target:
public static < T extends java.lang.Object > void injectMembers ( T instance ) { javax.enterprise.inject.spi.AnnotatedType type = org.ovirt.engine.core.bll.utils.Injector.injector.manager.createAnnotatedType ( instance.getClass ( ) ) ; javax.enterprise.inject.spi.InjectionTarget injectionTarget = org.ovirt.engine.core.bll.utils.Injector.injector.manager.createInjectionTarget ( type ) ; injectionTarget.inject ( instance , org.ovirt.engine.core.bll.utils.Injector.injector.manager.createCreationalContext ( null ) ) ; injectionTarget.postConstruct ( instance ) ; }
Source:
public static 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.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public static void getTemplateById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status , boolean updateDB ) { this . commandStatus = status ; if ( updateDB ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.updateCommandStatus ( getCommandId ( ) , getTaskType ( ) , commandStatus ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }

Target:
protected void removeCommand ( ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeCommand ( getCommandId ( ) ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }
Source:
public org.ovirt.engine.core.common.businessentities.NonOperationalReason persistAndEnforceNetworkCompliance ( org.ovirt.engine.core.common.businessentities.VDS host , boolean skipManagementNetwork , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > userConfiguredNics ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbIfaces = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getInterfaceDao ( ) . getAllInterfacesForVds ( host.getId ( ) ) ; persistTopology ( host.getInterfaces ( ) , dbIfaces , userConfiguredNics ) ; return enforceNetworkCompliance ( host , skipManagementNetwork , dbIfaces ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.NonOperationalReason persistAndEnforceNetworkCompliance ( org.ovirt.engine.core.common.businessentities.VDS host , boolean skipManagementNetwork , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > userConfiguredNics ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbIfaces = interfaceDao.getAllInterfacesForVds ( host.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks = networkDao.getAllForCluster ( host.getVdsGroupId ( ) ) ; persistTopology ( host.getInterfaces ( ) , dbIfaces , userConfiguredNics ) ; org.ovirt.engine.core.common.businessentities.NonOperationalReason nonOperationalReason = enforceNetworkCompliance ( host , skipManagementNetwork , clusterNetworks ) ; auditNetworkCompliance ( host , dbIfaces , clusterNetworks ) ; return nonOperationalReason ; }
Source:
protected boolean setAndValidateDiskProfiles ( ) { if ( ( ( diskInfoDestinationMap ) != null ) && ( ! ( diskInfoDestinationMap.isEmpty ( ) ) ) ) { java.util.Map < org.ovirt.engine.core.common.businessentities.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskInfoDestinationMap.values ( ) ) { map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.AddVmCommand.getStoragePool ( ) . getcompatibility_version ( ) ) ) ; } return true ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { if ( ( ( diskInfoDestinationMap ) != null ) && ( ! ( diskInfoDestinationMap.isEmpty ( ) ) ) ) { java.util.Map < org.ovirt.engine.core.common.businessentities.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskInfoDestinationMap.values ( ) ) { map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.AddVmCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ) ; } return true ; }
Source:
public void testGlusterCompatibilityOnLowVersion ( ) { storagePool.setcompatibility_version ( Version.v3_0 ) ; storageDomain.setStorageFormat ( StorageFormatType.V1 ) ; storageDomain.setStorageType ( StorageType.GLUSTERFS ) ; org.ovirt.engine.core.bll.ValidationResult attachGlusterToLowVersionResult = validator.validateDomainCanBeAttachedToPool ( ) ; org.junit.Assert.assertFalse ( "Attaching a GLUSTER domain succeeded while it should have failed" , attachGlusterToLowVersionResult.isValid ( ) ) ; assertFailingMessage ( "Attaching a GLUSTER domain failed failed with the wrong message" , attachGlusterToLowVersionResult , VdcBllMessages.DATA_CENTER_GLUSTER_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION ) ; }

Target:
public void testGlusterCompatibilityOnLowVersion ( ) { storagePool.setCompatibilityVersion ( Version.v3_0 ) ; storageDomain.setStorageFormat ( StorageFormatType.V1 ) ; storageDomain.setStorageType ( StorageType.GLUSTERFS ) ; org.ovirt.engine.core.bll.ValidationResult attachGlusterToLowVersionResult = validator.validateDomainCanBeAttachedToPool ( ) ; org.junit.Assert.assertFalse ( "Attaching a GLUSTER domain succeeded while it should have failed" , attachGlusterToLowVersionResult.isValid ( ) ) ; assertFailingMessage ( "Attaching a GLUSTER domain failed failed with the wrong message" , attachGlusterToLowVersionResult , VdcBllMessages.DATA_CENTER_GLUSTER_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION ) ; }