auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setSharedMemory ( java.lang.Integer value ) { if ( ( ( sharedMemory ) == null ) && ( value == null ) ) { return ; } if ( ( ( sharedMemory ) == null ) || ( ! ( sharedMemory.equals ( value ) ) ) ) { sharedMemory = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "SharedMemory" ) ) ; } }

Target:
public void setActiveVms ( java.lang.Integer value ) { if ( ( ( activeVms ) == null ) && ( value == null ) ) { return ; } if ( ( ( activeVms ) == null ) || ( ! ( activeVms.equals ( value ) ) ) ) { activeVms = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "ActiveVms" ) ) ; } }
Source:
public void testGetDataAndSetDataWithFullSession ( ) { org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setHttpSessionId ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID ) ; org.junit.Assert.assertTrue ( "Set should fail with an empty session" , container.SetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE ) ) ; org.junit.Assert.assertEquals ( "Get should return null with an empty session" , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; org.junit.Assert.assertEquals ( "Get should return the value with a given session" , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; }

Target:
public void testGetDataAndSetDataWithFullSession ( ) { org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setHttpSessionId ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID ) ; org.junit.Assert.assertTrue ( "Set should fail with an empty session" , container.setData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE ) ) ; org.junit.Assert.assertEquals ( "Get should return null with an empty session" , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; org.junit.Assert.assertEquals ( "Get should return the value with a given session" , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; }
Source:
private void addAddress ( java.util.Map < java.lang.String , java.lang.Object > map , java.lang.String address ) { if ( org.apache.commons.lang.StringUtils.isNotBlank ( address ) ) { map.put ( VdsProperties.Address , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStringUtils.string2Map ( org.ovirt.engine.core.vdsbroker.vdsbroker.HotPlugNicVDSCommand.getParameters ( ) . getVmDevice ( ) . getAddress ( ) ) ) ; } }

Target:
private void addAddress ( java.util.Map < java.lang.String , java.lang.Object > map , java.lang.String address ) { if ( org.apache.commons.lang.StringUtils.isNotBlank ( address ) ) { map.put ( VdsProperties.Address , org.ovirt.engine.core.utils.StringMapUtils.string2Map ( org.ovirt.engine.core.vdsbroker.vdsbroker.HotPlugNicVDSCommand.getParameters ( ) . getVmDevice ( ) . getAddress ( ) ) ) ; } }
Source:
private void refreshVmStats ( ) { for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > pair : monitoredVms ) { if ( tryLockVmForUpdate ( pair ) ) { org.ovirt.engine.core.vdsbroker.VmAnalyzer vmAnalyzer = new org.ovirt.engine.core.vdsbroker.VmAnalyzer ( pair.getFirst ( ) , pair.getSecond ( ) , this , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirectorDelegator.getInstance ( ) ) ; vmAnalyzers.add ( vmAnalyzer ) ; vmAnalyzer.analyze ( ) ; } else { org.ovirt.engine.core.vdsbroker.VmsMonitoring.log.debug ( ( "skipping VM '{}' from this monitoring cycle" + " - the VM is locked by its VmManager " ) , getVmId ( pair ) ) ; } } }

Target:
protected org.ovirt.engine.core.vdsbroker.VmAnalyzer getVmAnalyzer ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > pair ) { return new org.ovirt.engine.core.vdsbroker.VmAnalyzer ( pair.getFirst ( ) , pair.getSecond ( ) , this , auditLogDirector ) ; }
Source:
public static void getMinimalVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VMMinMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.customPropertiesList = ( ( java.util.Map < org.ovirt.engine.core.compat.Version , java.util.Map < java.lang.String , java.lang.String > > ) ( returnValue ) ) ; }
Source:
public org.ovirt.engine.api.model.Group get ( ) { java.lang.String directory = parent.getDirectory ( ) . getName ( ) ; org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters parameters = new org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters ( directory , id ) ; return performGet ( VdcQueryType.GetDirectoryGroupById , parameters , org.ovirt.engine.api.model.BaseResource.class ) ; }

Target:
public org.ovirt.engine.api.model.Group get ( ) { java.lang.String directoryId ; try { directoryId = org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( id ) ; } catch ( java.lang.IllegalArgumentException exception ) { throw new javax.ws.rs.WebApplicationException ( Response.Status.NOT_FOUND ) ; } java.lang.String directory = parent.getDirectory ( ) . getName ( ) ; org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters parameters = new org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters ( directory , directoryId ) ; return performGet ( VdcQueryType.GetDirectoryGroupById , parameters , org.ovirt.engine.api.model.BaseResource.class ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.AuditLog auditLog = getAuditLog ( ) ; auditLogDao.remove ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getParameters ( ) . getAuditLogId ( ) ) ; setAuditLogDetails ( auditLog ) ; auditLog.setUserId ( Guid.Empty ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logableToClear = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( auditLog ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.EventFloodRegulator eventFloodRegulator = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.EventFloodRegulator ( logableToClear , auditLog.getLogType ( ) ) ; eventFloodRegulator.evict ( ) ; org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.AuditLog auditLog = getAuditLog ( ) ; auditLogDao.remove ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getParameters ( ) . getAuditLogId ( ) ) ; setAuditLogDetails ( auditLog ) ; auditLog.setUserId ( Guid.Empty ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable logableToClear = createAuditLogableImpl ( auditLog ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.EventFloodRegulator eventFloodRegulator = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.EventFloodRegulator ( logableToClear , auditLog.getLogType ( ) ) ; eventFloodRegulator.evict ( ) ; org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.setSucceeded ( true ) ; }
Source:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }

Target:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { org.ovirt.engine.core.common.businessentities.AuditLog event = auditLogDao.get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getParameters ( ) . getAuditLogId ( ) ) ; if ( AuditLogSeverity.ALERT.equals ( event.getSeverity ( ) ) ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.compat.Guid.SYSTEM , org.ovirt.engine.core.common.VdcObjectType.System , org.ovirt.engine.core.common.businessentities.ActionGroup.AUDIT_LOG_MANAGEMENT ) ) ; } return getPermissionList ( event ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { org.ovirt.engine.core.common.businessentities.AuditLog event = getAuditLog ( ) ; if ( AuditLogSeverity.ALERT.equals ( event.getSeverity ( ) ) ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.compat.Guid.SYSTEM , org.ovirt.engine.core.common.VdcObjectType.System , org.ovirt.engine.core.common.businessentities.ActionGroup.AUDIT_LOG_MANAGEMENT ) ) ; } return getPermissionList ( event ) ; }
Source:
public java.lang.String nextString ( int length , char [ ] chars ) { return org.apache.commons.lang.RandomStringUtils.random ( length , 0 , chars.length , false , false , chars , this ) ; }

Target:
public java.lang.String nextString ( int length , char [ ] chars ) { java.lang.Character [ ] characters = org.apache.commons.lang.ArrayUtils.toObject ( chars ) ; java.lang.StringBuilder sb = new java.lang.StringBuilder ( length ) ; for ( int i = 0 ; i < length ; ++ i ) { sb.append ( pickRandom ( characters ) ) ; } return sb.toString ( ) ; }
Source:
protected void initConnectionList ( boolean includeInactiveDomains ) { java.util.Set < org.ovirt.engine.core.common.businessentities.StorageDomainStatus > statuses ; statuses = ( includeInactiveDomains ) ? java.util.EnumSet.of ( StorageDomainStatus.Active , StorageDomainStatus.Unknown , StorageDomainStatus.Inactive ) : java.util.EnumSet.of ( StorageDomainStatus.Active , StorageDomainStatus.Unknown ) ; connections = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionDao ( ) . getStorageConnectionsByStorageTypeAndStatus ( org.ovirt.engine.core.bll.storage.pool.ConnectHostToStoragePoolServerCommandBase.getStoragePool ( ) . getId ( ) , null , statuses ) ; updateConnectionsTypeMap ( ) ; updateConnectionMapForFiberChannel ( statuses ) ; }

Target:
protected void initConnectionList ( boolean includeInactiveDomains ) { java.util.Set < org.ovirt.engine.core.common.businessentities.StorageDomainStatus > statuses ; statuses = ( includeInactiveDomains ) ? java.util.EnumSet.of ( StorageDomainStatus.Active , StorageDomainStatus.Unknown , StorageDomainStatus.Inactive ) : java.util.EnumSet.of ( StorageDomainStatus.Active , StorageDomainStatus.Unknown ) ; connections = storageServerConnectionDao.getStorageConnectionsByStorageTypeAndStatus ( org.ovirt.engine.core.bll.storage.pool.ConnectHostToStoragePoolServerCommandBase.getStoragePool ( ) . getId ( ) , null , statuses ) ; updateConnectionsTypeMap ( ) ; updateConnectionMapForFiberChannel ( statuses ) ; }
Source:
public java.lang.String getProperty ( java.lang.String key ) { java.lang.String value = values.get ( key ) ; if ( value == null ) { java.lang.String message = ( "The property \"" + key ) + "\" doesn\'t have a value." ; org.ovirt.engine.core.utils.LocalConfig.log.error ( message ) ; throw new java.lang.IllegalArgumentException ( message ) ; } return values.get ( key ) ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getProperties ( ) { return values ; }
Source:
private java.lang.Boolean getMigrateCompressed ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.migrationCompression ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) { if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getMigrateCompressed ( ) ) != null ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getMigrateCompressed ( ) ; } if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVdsGroup ( ) . getMigrateCompressed ( ) ) != null ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getVdsGroup ( ) . getMigrateCompressed ( ) ; } return org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.DefaultMigrationCompression ) ; } return null ; }

Target:
private java.lang.String findValidMigrationIpAddress ( org.ovirt.engine.core.common.businessentities.network.Network migrationNetwork , java.util.function.Function < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , java.lang.String > ipAddressGetter ) { final java.lang.String migrationSourceIpAddress = getMigrationNetworkAddress ( org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getId ( ) , migrationNetwork.getName ( ) , ipAddressGetter ) ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( migrationSourceIpAddress ) ) { final java.lang.String migrationDestinationIpAddress = getMigrationNetworkAddress ( getDestinationVds ( ) . getId ( ) , migrationNetwork.getName ( ) , ipAddressGetter ) ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( migrationDestinationIpAddress ) ) { return migrationDestinationIpAddress ; } } return null ; }
Source:
private void removeMemoryFromActiveSnapshot ( ) { java.lang.String memory = org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( memory ) ) { return ; } org.ovirt.engine.core.bll.RunVmCommand.getSnapshotDAO ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ; if ( ( org.ovirt.engine.core.bll.RunVmCommand.getSnapshotDAO ( ) . getNumOfSnapshotsByMemory ( memory ) ) == 0 ) { removeMemoryVolumes ( memory , org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) , true ) ; } }

Target:
private void removeMemoryFromActiveSnapshot ( ) { java.lang.String memory = org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( memory ) ) { return ; } org.ovirt.engine.core.bll.RunVmCommand.getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ; if ( ( org.ovirt.engine.core.bll.RunVmCommand.getSnapshotDao ( ) . getNumOfSnapshotsByMemory ( memory ) ) == 0 ) { removeMemoryVolumes ( memory , org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) , true ) ; } }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Step model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; assertTrue ( model.isExternal ( ) ) ; assertNotNull ( model.getJob ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Step model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; org.junit.Assert.assertTrue ( model.isExternal ( ) ) ; org.junit.Assert.assertNotNull ( model.getJob ( ) ) ; verifyLinks ( model ) ; }
Source:
protected static boolean doesStorageDomainHaveSpaceForRequest ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , long sizeRequested ) { return new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( storageDomain ) . isDomainHasSpaceForRequest ( sizeRequested ) . isValid ( ) ; }

Target:
private static boolean validateSpaceRequirements ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator = new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( storageDomain ) ; return ( storageDomainValidator.isDomainWithinThresholds ( ) . isValid ( ) ) && ( storageDomainValidator.hasSpaceForClonedDisks ( disksList ) . isValid ( ) ) ; }
Source:
public void testReportConfigurationsOnHostWhenSwitchTypeIsOutOfSync ( ) throws java.lang.Exception { cluster.setRequiredSwitchTypeForCluster ( SwitchType.OVS ) ; org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations reportedConfigurations = createTestedInstance ( ) . reportConfigurationsOnHost ( ) ; org.junit.Assert.assertThat ( reportedConfigurations.isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration > reportedConfigurationList = reportedConfigurations.getReportedConfigurationList ( ) ; org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration expectedReportedConfiguration = new org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration ( org.ovirt.engine.core.common.businessentities.network.ReportedConfigurationType.SWITCH_TYPE , org.ovirt.engine.core.common.network.SwitchType.LEGACY , org.ovirt.engine.core.common.network.SwitchType.OVS , false ) ; org.junit.Assert.assertThat ( reportedConfigurationList.contains ( expectedReportedConfiguration ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testReportConfigurationsOnHostWhenSwitchTypeIsOutOfSync ( ) { cluster.setRequiredSwitchTypeForCluster ( SwitchType.OVS ) ; org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations reportedConfigurations = createTestedInstance ( ) . reportConfigurationsOnHost ( ) ; org.hamcrest.MatcherAssert.assertThat ( reportedConfigurations.isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration > reportedConfigurationList = reportedConfigurations.getReportedConfigurationList ( ) ; org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration expectedReportedConfiguration = new org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration ( org.ovirt.engine.core.common.businessentities.network.ReportedConfigurationType.SWITCH_TYPE , org.ovirt.engine.core.common.network.SwitchType.LEGACY , org.ovirt.engine.core.common.network.SwitchType.OVS , false ) ; org.hamcrest.MatcherAssert.assertThat ( reportedConfigurationList.contains ( expectedReportedConfiguration ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
private java.util.Set < org.ovirt.engine.core.common.businessentities.VDS > fetchRemoteServers ( ) { java.util.Set < org.ovirt.engine.core.common.businessentities.VDS > remoteServers = new java.util.HashSet < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > slaveBricks = slaveVolume.getBricks ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity currentBrick : slaveBricks ) { remoteServers.add ( getVdsDao ( ) . get ( currentBrick.getServerId ( ) ) ) ; } return remoteServers ; }

Target:
private java.util.Set < org.ovirt.engine.core.common.businessentities.VDS > fetchRemoteServers ( ) { java.util.Set < org.ovirt.engine.core.common.businessentities.VDS > remoteServers = new java.util.HashSet < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > slaveBricks = slaveVolume.getBricks ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity currentBrick : slaveBricks ) { remoteServers.add ( vdsDao.get ( currentBrick.getServerId ( ) ) ) ; } return remoteServers ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult hotUpdateDoneWithInternalNetwork ( org.ovirt.engine.core.common.businessentities.network.Network oldNetwork , org.ovirt.engine.core.common.businessentities.network.Network newNetwork ) { return ( ( oldNetwork == null ) || ( ( oldNetwork.getProvidedBy ( ) ) == null ) ) && ( ( newNetwork == null ) || ( ( newNetwork.getProvidedBy ( ) ) == null ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_NETWORK_CANNOT_BE_REWIRED ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult hotUpdateDoneWithInternalNetwork ( org.ovirt.engine.core.common.businessentities.network.Network oldNetwork , org.ovirt.engine.core.common.businessentities.network.Network newNetwork ) { return ( ( oldNetwork == null ) || ( ! ( oldNetwork.isExternal ( ) ) ) ) && ( ( newNetwork == null ) || ( ! ( newNetwork.isExternal ( ) ) ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_NETWORK_CANNOT_BE_REWIRED ) ; }
Source:
public static org.ovirt.engine.core.common.users.VdcUser Login ( java.lang.String entity , java.lang.String entity2 , java.lang.String selectedItem ) { throw new org.ovirt.engine.core.compat.NotImplementedException ( "Login is not implemented!" ) ; }

Target:
private static void failureEventHandler ( java.lang.String description , java.util.ArrayList < java.lang.String > errorMessages ) { java.util.ArrayList < org.ovirt.engine.ui.frontend.Message > messages = new java.util.ArrayList < org.ovirt.engine.ui.frontend.Message > ( ) ; for ( java.lang.String errorMessage : errorMessages ) { messages.add ( new org.ovirt.engine.ui.frontend.Message ( description , errorMessage ) ) ; } org.ovirt.engine.ui.frontend.Frontend.frontendFailureEvent.raise ( org.ovirt.engine.ui.frontend.Frontend.class , new org.ovirt.engine.ui.frontend.FrontendFailureEventArgs ( messages ) ) ; }
Source:
public void testSetDetectEmulatedMachine ( ) { boolean preUpdate = existingCluster.isDetectEmulatedMachine ( ) ; boolean updateValue = false ; org.junit.Assert.assertNotSame ( preUpdate , updateValue ) ; dao.setEmulatedMachine ( existingCluster.getId ( ) , existingCluster.getEmulatedMachine ( ) , updateValue ) ; org.junit.Assert.assertEquals ( updateValue , dao.get ( existingCluster.getId ( ) ) . isDetectEmulatedMachine ( ) ) ; }

Target:
public void testSetDetectEmulatedMachine ( ) { boolean preUpdate = existingCluster.isDetectEmulatedMachine ( ) ; boolean updateValue = false ; org.junit.Assert.assertNotEquals ( updateValue , preUpdate ) ; dao.setEmulatedMachine ( existingCluster.getId ( ) , existingCluster.getEmulatedMachine ( ) , updateValue ) ; org.junit.Assert.assertEquals ( updateValue , dao.get ( existingCluster.getId ( ) ) . isDetectEmulatedMachine ( ) ) ; }
Source:
public void testAllDomainsExistAndActive ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getSnappableVmDisks ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST.name ( ) ) ) ; }

Target:
public void testAllDomainsExistAndActive ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ) . when ( multipleStorageDomainsValidator ) . allDomainsExistAndActive ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST.name ( ) ) ) ; }
Source:
public void initTable ( org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < java.lang.String > appNameColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String appName ) { return appName ; } } ; getTable ( ) . addColumn ( appNameColumn , constants.installedApp ( ) ) ; }

Target:
public void initTable ( ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < java.lang.String > appNameColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String appName ) { return appName ; } } ; getTable ( ) . addColumn ( appNameColumn , org.ovirt.engine.ui.common.widget.uicommon.vm.VmAppListModelTable.constants.installedApp ( ) ) ; }
Source:
public org.ovirt.api.metamodel.tool.JavaClassName getInterfaceName ( org.ovirt.api.metamodel.concepts.Service service ) { org.ovirt.api.metamodel.tool.JavaClassName name = new org.ovirt.api.metamodel.tool.JavaClassName ( ) ; java.lang.String packageName = javaPackages.getJaxrsPackageName ( service.getModule ( ) ) ; java.lang.String simpleName = ( javaNames.getJavaClassStyleName ( service.getName ( ) ) ) + ( org.ovirt.api.metamodel.tool.JaxrsNames.SUFFIX ) ; name.setPackageName ( packageName ) ; name.setSimpleName ( simpleName ) ; return name ; }

Target:
public org.ovirt.api.metamodel.tool.JavaClassName getInterfaceName ( org.ovirt.api.metamodel.concepts.Service service ) { org.ovirt.api.metamodel.tool.JavaClassName name = new org.ovirt.api.metamodel.tool.JavaClassName ( ) ; java.lang.String packageName = javaPackages.getJaxrsPackageName ( service.getModule ( ) ) ; java.lang.String simpleName = ( javaNames.getJavaClassStyleName ( service.getName ( ) ) ) + ( org.ovirt.api.metamodel.tool.JaxrsNames.RESOURCE_SUFFIX ) ; name.setPackageName ( packageName ) ; name.setSimpleName ( simpleName ) ; return name ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterSnapshotScheduleOverride ( boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotScheduleOverride" ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn glusterSnapshotScheduleOverride ( boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotScheduleOverride" ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public void testIsFileDomain ( ) { org.junit.Assert.assertFalse ( StorageType.FCP.isFileDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.ISCSI.isFileDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.NFS.isFileDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.LOCALFS.isFileDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.POSIXFS.isFileDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.GLUSTERFS.isFileDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.GLANCE.isFileDomain ( ) ) ; }

Target:
public void testIsFileDomain ( ) { org.junit.Assert.assertFalse ( StorageType.FCP.isFileDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.ISCSI.isFileDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.NFS.isFileDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.LOCALFS.isFileDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.POSIXFS.isFileDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.GLUSTERFS.isFileDomain ( ) ) ; org.junit.Assert.assertTrue ( StorageType.GLANCE.isFileDomain ( ) ) ; org.junit.Assert.assertFalse ( StorageType.CINDER.isFileDomain ( ) ) ; }
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 void getExternalProviderHostGroupList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalHostGroup > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostGroupsFromExternalProvider , params , aQuery ) ; }
Source:
private boolean selectProxyHost ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > activeHosts = org.ovirt.engine.core.bll.ConvertVmCommand.getVdsDAO ( ) . getAllForStoragePoolAndStatus ( org.ovirt.engine.core.bll.ConvertVmCommand.getStoragePoolId ( ) , VDSStatus.Up ) ; if ( activeHosts.isEmpty ( ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VDS activeHost = activeHosts.get ( 0 ) ; setVds ( activeHost ) ; org.ovirt.engine.core.bll.ConvertVmCommand.getParameters ( ) . setProxyHostId ( activeHost.getId ( ) ) ; return true ; }

Target:
private boolean selectProxyHost ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > activeHosts = org.ovirt.engine.core.bll.ConvertVmCommand.getVdsDao ( ) . getAllForStoragePoolAndStatus ( org.ovirt.engine.core.bll.ConvertVmCommand.getStoragePoolId ( ) , VDSStatus.Up ) ; if ( activeHosts.isEmpty ( ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VDS activeHost = activeHosts.get ( 0 ) ; setVds ( activeHost ) ; org.ovirt.engine.core.bll.ConvertVmCommand.getParameters ( ) . setProxyHostId ( activeHost.getId ( ) ) ; return true ; }
Source:
public void setUsePatternFly ( final boolean use ) { super . setUsePatternFly ( use ) ; if ( use ) { getCheckboxWidgetLabel ( ) . getStyle ( ) . setPaddingLeft ( 10 , Unit.PX ) ; getCheckboxWidgetLabel ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; getContentWidgetElement ( ) . removeClassName ( Styles.FORM_CONTROL ) ; removeContentWidgetStyleName ( Styles.FORM_CONTROL ) ; } }

Target:
public void setUsePatternFly ( final boolean use ) { super . setUsePatternFly ( use ) ; if ( use ) { getCheckboxWidgetLabel ( ) . getStyle ( ) . setPaddingLeft ( 10 , Unit.PX ) ; getCheckboxWidgetLabel ( ) . getStyle ( ) . setPaddingRight ( 10 , Unit.PX ) ; getCheckboxWidgetLabel ( ) . getStyle ( ) . setPosition ( Position.RELATIVE ) ; noPaddingNoFixes ( ) ; org.ovirt.engine.ui.common.widget.editor.BaseEntityModelCheckboxEditor.removeWrapperStyleName ( org.ovirt.engine.ui.common.widget.editor.BaseEntityModelCheckboxEditor.CBE_RIGHT_OF_LABEL_PFLY_FIX ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { validateMemorySize ( getMemSize ( ) , ( ( java.lang.Integer ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) , _minMemSize ) ; if ( ! ( ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( model ) ) . getBehavior ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.vms.TemplateVmModelBehavior ) ) { validateMemorySize ( getMinAllocatedMemory ( ) , getMemSize ( ) . getEntity ( ) , 1 ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { updateWatchdogItems ( ( ( java.util.HashSet < org.ovirt.engine.core.common.businessentities.VmWatchdogType > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; }
Source:
protected boolean validateVdsCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > groups = getVdsGroupDAO ( ) . getAllForStoragePool ( getParameters ( ) . getStoragePoolId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup group : groups ) { if ( group.getId ( ) . equals ( getParameters ( ) . getVdsGroupId ( ) ) ) { return true ; } } return failCanDoAction ( VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID ) ; }

Target:
private java.util.Set < java.lang.String > getMemoryVolumesToBeImported ( ) { java.util.Set < java.lang.String > memories = new java.util.HashSet < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getVm ( ) . getSnapshots ( ) ) { memories.add ( snapshot.getMemoryVolume ( ) ) ; } memories.remove ( StringUtils.EMPTY ) ; return memories ; }
Source:
private void addNetworkToPool ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setName ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.DefaultManagementNetwork ) ) + "2" ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = new java.util.ArrayList < > ( ) ; networks.add ( network ) ; org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( networks ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network createNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( networkId ) ; return network ; }
Source:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( getDiskId ( ) , ImageStatus.ILLEGAL ) ; org.ovirt.engine.core.bll.storage.CloneSingleCinderDiskCommandCallback.getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; onFinish ( cmdId ) ; }

Target:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( getDiskId ( ) , ImageStatus.ILLEGAL ) ; org.ovirt.engine.core.bll.storage.CloneSingleCinderDiskCommandCallback.getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( org.ovirt.engine.core.bll.storage.CloneSingleCinderDiskCommandCallback.getCommand ( ) . getParameters ( ) . getImageId ( ) , ImageStatus.OK ) ; org.ovirt.engine.core.bll.storage.CloneSingleCinderDiskCommandCallback.getCommand ( ) . endAction ( ) ; }
Source:
public void isVirtioScsiEnabledDefaultedToTrue ( ) { cmd.getParameters ( ) . getVm ( ) . setClusterId ( cluster.getId ( ) ) ; cmd.initEffectiveCompatibilityVersion ( ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.ArgumentMatchers.any ( java.lang.Integer.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Collections.singletonList ( "VirtIO_SCSI" ) ) ) ; org.junit.Assert.assertTrue ( "isVirtioScsiEnabled hasn't been defaulted to true on cluster >= 3.3." , cmd.isVirtioScsiEnabled ( ) ) ; }

Target:
public void isVirtioScsiEnabledDefaultedToTrue ( ) { cmd.getParameters ( ) . getVm ( ) . setClusterId ( cluster.getId ( ) ) ; cmd.initEffectiveCompatibilityVersion ( ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Collections.singletonList ( "VirtIO_SCSI" ) ) ) ; org.junit.Assert.assertTrue ( "isVirtioScsiEnabled hasn't been defaulted to true on cluster >= 3.3." , cmd.isVirtioScsiEnabled ( ) ) ; }
Source:
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 ) , 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.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { setSucceeded ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DisconnectStorageServer , new org.ovirt.engine.core.common.vdscommands.ConnectStorageServerVDSCommandParameters ( org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getstorage_type ( ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections [ ] { org.ovirt.engine.core.bll.storage.RemoveStorageServerConnectionCommand.getConnection ( ) } ) ) ) ) . getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { setSucceeded ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DisconnectStorageServer , new org.ovirt.engine.core.common.vdscommands.ConnectStorageServerVDSCommandParameters ( org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getstorage_type ( ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections [ ] { org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getConnection ( ) } ) ) ) ) . getSucceeded ( ) ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , java.lang.String description , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { return createTaskImpl ( asyncTaskCreationInfo , parentCommand , description , entityType , entityIds ) ; } catch ( java.lang.RuntimeException ex ) { log.errorFormat ( "Error during CreateTask for command: {0}. Exception {1}" , getClass ( ) . getName ( ) , ex ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , java.lang.String description , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { return createTask ( taskId , asyncTaskCreationInfo , parentCommand , description , createEntitiesMapForSingleEntityType ( entityType , entityIds ) ) ; }
Source:
public boolean isStartupTimeoutPassed ( java.util.List < java.lang.String > messages ) { java.util.Date waitTo = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getStartedAt ( ) . addSeconds ( ( ( java.lang.Integer ) ( org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.DisableFenceAtStartupInSec ) ) ) ) ; java.util.Date now = new java.util.Date ( ) ; if ( ! ( ( waitTo.before ( now ) ) || ( waitTo.equals ( now ) ) ) ) { messages.add ( VdcBllMessages.VDS_FENCE_DISABLED_AT_SYSTEM_STARTUP_INTERVAL.name ( ) ) ; return false ; } else { return true ; } }

Target:
public boolean isStartupTimeoutPassed ( java.util.List < java.lang.String > messages ) { java.util.Date waitTo = getBackend ( ) . getStartedAt ( ) . addSeconds ( ( ( java.lang.Integer ) ( org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.DisableFenceAtStartupInSec ) ) ) ) ; java.util.Date now = new java.util.Date ( ) ; if ( ! ( ( waitTo.before ( now ) ) || ( waitTo.equals ( now ) ) ) ) { messages.add ( VdcBllMessages.VDS_FENCE_DISABLED_AT_SYSTEM_STARTUP_INTERVAL.name ( ) ) ; return false ; } else { return true ; } }
Source:
protected void init ( ) { T parameters = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) ; if ( ( parameters.isImportAsNewEntity ( ) ) && ( parameters.getVmId ( ) . equals ( parameters.getVm ( ) . getId ( ) ) ) ) { parameters.getVm ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } setStoragePoolId ( parameters.getStoragePoolId ( ) ) ; imageToDestinationDomainMap = parameters.getImageToDestinationDomainMap ( ) ; }

Target:
protected boolean validateVdsCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupDAO ( ) . get ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; return vdsGroup == null ? failCanDoAction ( VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID ) : ( vdsGroup.getArchitecture ( ) ) != ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getClusterArch ( ) ) ? failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_CANNOT_IMPORT_VM_ARCHITECTURE_NOT_SUPPORTED_BY_CLUSTER ) : true ; }