auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DataCenter dataCenter ) { validateParameters ( dataCenter , "name" ) ; if ( ! ( dataCenter.isSetLocal ( ) ) ) { validateParameters ( dataCenter , "local" ) ; } org.ovirt.engine.core.common.businessentities.StoragePool entity = map ( dataCenter ) ; return performCreate ( ActionType.AddEmptyStoragePool , new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetStoragePoolById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DataCenter dataCenter ) { validateParameters ( dataCenter , "name" ) ; if ( ! ( dataCenter.isSetLocal ( ) ) ) { validateParameters ( dataCenter , "local" ) ; } org.ovirt.engine.core.common.businessentities.StoragePool entity = map ( dataCenter ) ; return performCreate ( ActionType.AddEmptyStoragePool , new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.QueryType.GetStoragePoolById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public static java.lang.String map ( org.ovirt.engine.api.model.DisplayType type , java.lang.String incoming ) { switch ( type ) { case cirrus : return DisplayType.VNC.value ( ) ; case qxl : return DisplayType.SPICE.value ( ) ; default : return null ; } }

Target:
private static org.ovirt.engine.core.common.businessentities.GraphicsType deriveGraphicsType ( java.util.Map < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > graphicsInfos ) { if ( graphicsInfos != null ) { if ( graphicsInfos.containsKey ( GraphicsType.SPICE ) ) { return org.ovirt.engine.core.common.businessentities.GraphicsType.SPICE ; } if ( graphicsInfos.containsKey ( GraphicsType.VNC ) ) { return org.ovirt.engine.core.common.businessentities.GraphicsType.VNC ; } } return null ; }
Source:
protected org.ovirt.engine.api.model.Label addParents ( org.ovirt.engine.api.model.Label model ) { model.setHostNic ( new org.ovirt.engine.api.model.HostNic ( ) ) ; model.getHostNic ( ) . setId ( nicId.toString ( ) ) ; model.getHostNic ( ) . setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; model.getHostNic ( ) . getHost ( ) . setId ( hostId ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.NetworkLabel addParents ( org.ovirt.engine.api.model.NetworkLabel model ) { model.setHostNic ( new org.ovirt.engine.api.model.HostNic ( ) ) ; model.getHostNic ( ) . setId ( nicId.toString ( ) ) ; model.getHostNic ( ) . setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; model.getHostNic ( ) . getHost ( ) . setId ( hostId ) ; return model ; }
Source:
protected boolean canDoAction ( ) { return ! ( isDiskLun ( ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = org.ovirt.engine.core.bll.CopyImageGroupCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( disk != null ) { org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator = new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) ; return validate ( diskValidator.validateUnsupportedDiskStorageType ( DiskStorageType.LUN , DiskStorageType.CINDER ) ) ; } return false ; }
Source:
public org.ovirt.engine.core.common.businessentities.event_subscriber mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.event_subscriber entity = new org.ovirt.engine.core.common.businessentities.event_subscriber ( ) ; entity.setevent_up_name ( rs.getString ( "event_up_name" ) ) ; entity.setevent_notification_method ( org.ovirt.engine.core.common.EventNotificationMethods.valueOf ( rs.getString ( "notification_method" ) ) ) ; entity.setmethod_address ( rs.getString ( "method_address" ) ) ; entity.setsubscriber_id ( getGuidDefaultEmpty ( rs , "subscriber_id" ) ) ; entity.settag_name ( rs.getString ( "tag_name" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.event_subscriber mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.event_subscriber entity = new org.ovirt.engine.core.common.businessentities.event_subscriber ( ) ; entity.setevent_up_name ( rs.getString ( "event_up_name" ) ) ; entity.setevent_notification_method ( org.ovirt.engine.core.common.EventNotificationMethod.valueOf ( rs.getString ( "notification_method" ) ) ) ; entity.setmethod_address ( rs.getString ( "method_address" ) ) ; entity.setsubscriber_id ( getGuidDefaultEmpty ( rs , "subscriber_id" ) ) ; entity.settag_name ( rs.getString ( "tag_name" ) ) ; return entity ; }
Source:
private void updateDirectLunDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { if ( ( getDiskStorageType ( ) . getEntity ( ) ) != ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ) { return ; } boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.DirectLUNDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsDirectLunDiskAvaialable ( ) . setEntity ( isDirectLUNDiskkEnabled ) ; setMessage ( ( ! isDirectLUNDiskkEnabled ? org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.directLUNDiskNotSupported ( ) : "" ) ) ; }

Target:
private void updateDirectLunDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { if ( ( getDiskStorageType ( ) . getEntity ( ) ) != ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ) { return ; } boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.DirectLUNDiskEnabled , datacenter.getCompatibilityVersion ( ) . getValue ( ) ) ) ) ; getIsDirectLunDiskAvaialable ( ) . setEntity ( isDirectLUNDiskkEnabled ) ; setMessage ( ( ! isDirectLUNDiskkEnabled ? org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.directLUNDiskNotSupported ( ) : "" ) ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > object ) { if ( ( object.getFirst ( ) ) != null ) { return object.getFirst ( ) . getName ( ) ; } return null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getValue ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > object ) { if ( ( object.getFirst ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = object.getFirst ( ) ; return getDetailModel ( ) . isInterfaceAttachedByLabel ( nic ) ? templates.textImageLabels ( nic.getName ( ) , labelImage ) : com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( nic.getName ( ) ) ; } return null ; }
Source:
public static void getGlusterRebalanceStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity ) ( source ) ) ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters ( clusterId , volumeId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRebalanceStatus , parameters , aQuery ) ; }

Target:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
public void testAddHostedEngineStorageFails ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) . when ( command ) . getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( command ) . getAllLuns ( ) ; parameters.getStorageDomain ( ) . setStorageName ( StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME ) ; org.junit.Assert.assertFalse ( command.canAddDomain ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.assertCanDoActionMessages ( "Add self hosted engine storage domain succeeded where it should have failed" , command , VdcBllMessages.ACTION_TYPE_FAILED_HOSTED_ENGINE_STORAGE ) ; }

Target:
public void testAddHostedEngineStorageFails ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) . when ( command ) . getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( command ) . getAllLuns ( ) ; parameters.getStorageDomain ( ) . setStorageName ( StorageConstants.HOSTED_ENGINE_STORAGE_DOMAIN_NAME ) ; org.junit.Assert.assertFalse ( command.canAddDomain ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.assertCanDoActionMessages ( "Add self hosted engine storage domain succeeded where it should have failed" , command , EngineMessage.ACTION_TYPE_FAILED_HOSTED_ENGINE_STORAGE ) ; }
Source:
private void setUpGetEntityExpectations ( org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.common.businessentities.storage_domains entity ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetStorageDomainByIdAndStoragePoolId , org.ovirt.engine.core.common.queries.StorageDomainAndPoolQueryParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { entityId , GUIDS [ ( ( NAMES.length ) - 1 ) ] } , entity ) ; }

Target:
private void setUpGetEntityExpectations ( org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.api.model.StorageDomain entity ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetStorageDomainByIdAndStoragePoolId , org.ovirt.engine.core.common.queries.StorageDomainAndPoolQueryParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { entityId , GUIDS [ ( ( NAMES.length ) - 1 ) ] } , entity ) ; }
Source:
public static void GetLowUtilizationForPowerSave ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.LowUtilizationForPowerSave , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , 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:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "SearchString" . equals ( pcArgs.propertyName ) ) { updateViewSearchString ( ) ; } else if ( "SearchStringPrefix" . equals ( pcArgs.propertyName ) ) { updateViewSearchStringPrefix ( ) ; } else if ( "HasSearchStringPrefix" . equals ( pcArgs.propertyName ) ) { updateViewHasSearchStringPrefix ( ) ; } else if ( "HasSelectedTags" . equals ( pcArgs.propertyName ) ) { updateViewHasSelectedTags ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "SearchString" . equals ( args.propertyName ) ) { updateViewSearchString ( ) ; } else if ( "SearchStringPrefix" . equals ( args.propertyName ) ) { updateViewSearchStringPrefix ( ) ; } else if ( "HasSearchStringPrefix" . equals ( args.propertyName ) ) { updateViewHasSearchStringPrefix ( ) ; } else if ( "HasSelectedTags" . equals ( args.propertyName ) ) { updateViewHasSelectedTags ( ) ; } }
Source:
private void mockCommandCall ( org.ovirt.engine.core.common.action.ActionType actionType , boolean withContext ) { if ( withContext ) { org.mockito.Mockito.doReturn ( successfulReturnValue ( ) ) . when ( backend ) . runInternalAction ( org.mockito.ArgumentMatchers.eq ( actionType ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.bll.context.CommandContext.class ) ) ; } else { org.mockito.Mockito.doReturn ( successfulReturnValue ( ) ) . when ( backend ) . runInternalAction ( org.mockito.ArgumentMatchers.eq ( actionType ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) ) ; } }

Target:
private void mockCommandCall ( org.ovirt.engine.core.common.action.ActionType actionType , boolean withContext ) { if ( withContext ) { org.mockito.Mockito.doReturn ( successfulReturnValue ( ) ) . when ( backend ) . runInternalAction ( org.mockito.ArgumentMatchers.eq ( actionType ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.ActionParametersBase.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.bll.context.CommandContext.class ) ) ; } else { org.mockito.Mockito.doReturn ( successfulReturnValue ( ) ) . when ( backend ) . runInternalAction ( org.mockito.ArgumentMatchers.eq ( actionType ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.ActionParametersBase.class ) ) ; } }
Source:
public void diskImagesExist ( ) { org.mockito.Mockito.doReturn ( true ) . when ( baseDiskDao ) . exists ( disk1 ) ; org.mockito.Mockito.doReturn ( true ) . when ( baseDiskDao ) . exists ( disk2 ) ; org.junit.Assert.assertThat ( diskExistenceValidator.diskImagesNotExist ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void diskImagesExist ( ) { org.mockito.Mockito.doReturn ( true ) . when ( baseDiskDao ) . exists ( disk1 ) ; org.mockito.Mockito.doReturn ( true ) . when ( baseDiskDao ) . exists ( disk2 ) ; org.junit.Assert.assertThat ( diskExistenceValidator.disksNotExist ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testGetByClusterIdAndServiceType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > services = dao.getByClusterIdAndServiceType ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE1_TYPE ) ; org.junit.Assert.assertNotNull ( services ) ; org.junit.Assert.assertEquals ( 1 , services.size ( ) ) ; verifyServiceOnServer1 ( services.get ( 0 ) ) ; }

Target:
public void testGetByClusterIdAndServiceType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > services = dao.getByClusterIdAndServiceType ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE1_TYPE ) ; org.junit.jupiter.api.Assertions.assertNotNull ( services ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , services.size ( ) ) ; verifyServiceOnServer1 ( services.get ( 0 ) ) ; }
Source:
public void freeMacs ( java.util.List < java.lang.String > macs ) { lockObj.writeLock ( ) . lock ( ) ; try { checkIfInitialized ( ) ; for ( java.lang.String mac : macs ) { macsStorage.freeMac ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( mac ) ) ; } } finally { lockObj.writeLock ( ) . unlock ( ) ; } }

Target:
public void freeMacs ( java.util.List < java.lang.String > macs ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock l = new org.ovirt.engine.core.utils.lock.AutoCloseableLock ( lockObj.writeLock ( ) ) ) { checkIfInitialized ( ) ; for ( java.lang.String mac : macs ) { macsStorage.freeMac ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( mac ) ) ; } } }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getRemoveCommand ( ) ) ) { Remove ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnRemove" ) ) { OnRemove ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getRemoveCommand ( ) ) ) { Remove ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnRemove" ) ) { OnRemove ( ) ; } }
Source:
private void _validateDigest ( java.security.MessageDigest digest , java.lang.String actual ) throws java.io.IOException { try { if ( ! ( java.util.Arrays.equals ( digest.digest ( ) , javax.xml.bind.DatatypeConverter.parseHexBinary ( actual ) ) ) ) { throw new java.io.IOException ( "SSH copy failed, invalid localDigest" ) ; } } catch ( java.lang.IllegalArgumentException e ) { throw new java.io.IOException ( "SSH copy failed, invalid localDigest" ) ; } }

Target:
private void _validateDigest ( java.security.MessageDigest digest , java.lang.String actual ) throws java.io.IOException { try { if ( ! ( java.util.Arrays.equals ( digest.digest ( ) , org.apache.commons.codec.binary.Hex.decodeHex ( actual.toCharArray ( ) ) ) ) ) { throw new java.io.IOException ( "SSH copy failed, invalid localDigest" ) ; } } catch ( org.apache.commons.codec.DecoderException e ) { throw new java.io.IOException ( "SSH copy failed, invalid localDigest" ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.StorageDomain mockStorageDomain ( int availableSize , int usedSize , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.setavailable_disk_size ( availableSize ) ; sd.setused_disk_size ( usedSize ) ; sd.setstatus ( StorageDomainStatus.Active ) ; sd.setstorage_type ( storageType ) ; return sd ; }

Target:
private static org.ovirt.engine.core.common.businessentities.StorageDomain mockStorageDomain ( int availableSize , int usedSize , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.setAvailableDiskSize ( availableSize ) ; sd.setUsedDiskSize ( usedSize ) ; sd.setStatus ( StorageDomainStatus.Active ) ; sd.setStorageType ( storageType ) ; return sd ; }
Source:
private void init ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > byName = vmStaticDao.getAllByName ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.HostedEngineVmName ) ) ; if ( ( byName != null ) && ( ! ( byName.isEmpty ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = byName.get ( 0 ) ; hostedEngineVm = vmDao.get ( vmStatic.getId ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( hostedEngineVm ) ; } initHostedEngineStorageDomain ( ) ; }

Target:
private void init ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > byName = vmStaticDao.getAllByName ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.HostedEngineVmName ) ) ; if ( ( byName != null ) && ( ! ( byName.isEmpty ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = byName.get ( 0 ) ; hostedEngineVm = vmDao.get ( vmStatic.getId ( ) ) ; vmHandler.updateDisksFromDb ( hostedEngineVm ) ; } initHostedEngineStorageDomain ( ) ; }
Source:
private static synchronized org.ovirt.engine.sdk.utils.SerializationHelper.JAXBContextHolder getContext ( java.lang.Class < ? > clz ) throws javax.xml.bind.JAXBException { if ( ( org.ovirt.engine.sdk.utils.SerializationHelper.JAXB_CONTEXT ) == null ) { org.ovirt.engine.sdk.utils.SerializationHelper.JAXB_CONTEXT = javax.xml.bind.JAXBContext.newInstance ( org.ovirt.engine.sdk.utils.SerializationHelper.PACKAGE_CONTEXT ) ; } if ( ! ( org.ovirt.engine.sdk.utils.SerializationHelper.contexts.containsKey ( clz ) ) ) { org.ovirt.engine.sdk.utils.SerializationHelper.contexts.put ( clz , new org.ovirt.engine.sdk.utils.SerializationHelper.JAXBContextHolder ( org.ovirt.engine.sdk.utils.SerializationHelper.JAXB_CONTEXT ) ) ; } return org.ovirt.engine.sdk.utils.SerializationHelper.contexts.get ( clz ) ; }

Target:
private static synchronized org.ovirt.engine.sdk.utils.SerializationHelper.JAXBContextHolder getContext ( java.lang.Class < ? > clz ) throws javax.xml.bind.JAXBException { if ( ( org.ovirt.engine.sdk.utils.SerializationHelper.JAXB_CONTEXT ) == null ) { java.lang.ClassLoader cl = org.ovirt.engine.sdk.entities.ObjectFactory.class . getClassLoader ( ) ; org.ovirt.engine.sdk.utils.SerializationHelper.JAXB_CONTEXT = javax.xml.bind.JAXBContext.newInstance ( org.ovirt.engine.sdk.utils.SerializationHelper.PACKAGE_CONTEXT , cl ) ; } if ( ! ( org.ovirt.engine.sdk.utils.SerializationHelper.contexts.containsKey ( clz ) ) ) { org.ovirt.engine.sdk.utils.SerializationHelper.contexts.put ( clz , new org.ovirt.engine.sdk.utils.SerializationHelper.JAXBContextHolder ( org.ovirt.engine.sdk.utils.SerializationHelper.JAXB_CONTEXT ) ) ; } return org.ovirt.engine.sdk.utils.SerializationHelper.contexts.get ( clz ) ; }
Source:
public static void getGlusterRebalanceStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity ) ( source ) ) ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters ( clusterId , volumeId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRebalanceStatus , parameters , aQuery ) ; }

Target:
public static void getGlusterRemoveBricksStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity ) ( source ) ) ; } } ; org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters parameters = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters ( clusterId , volumeId , bricks ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRemoveBricksStatus , parameters , aQuery ) ; }
Source:
protected void removeNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . getAllForTemplate ( getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . remove ( iface.getId ( ) ) ; } }

Target:
protected void removeNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > list = getVmNicDao ( ) . getAllForTemplate ( getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : list ) { getVmNicDao ( ) . remove ( iface.getId ( ) ) ; } }
Source:
protected void init ( ) { }

Target:
public void testVmWithDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > disks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; disks.add ( new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , null , disks ) , true , null ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult networksUniquelyConfiguredOnHost ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure ) { java.util.Set < org.ovirt.engine.core.compat.Guid > networkIds = new java.util.HashSet ( attachmentsToConfigure.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : attachmentsToConfigure ) { if ( networkIds.contains ( attachment.getNetworkId ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORKS_ALREADY_ATTACHED_TO_IFACES ) ; } else { networkIds.add ( attachment.getNetworkId ( ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult networksUniquelyConfiguredOnHost ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure ) { java.util.Set < org.ovirt.engine.core.compat.Guid > networkIds = new java.util.HashSet ( attachmentsToConfigure.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : attachmentsToConfigure ) { if ( networkIds.contains ( attachment.getNetworkId ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORKS_ALREADY_ATTACHED_TO_IFACES ) ; } else { networkIds.add ( attachment.getNetworkId ( ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private java.lang.String getMemoryVolumeFromActiveSnapshotInExportDomain ( ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; if ( activeSnapshot != null ) { return activeSnapshot.getMemoryVolume ( ) ; } return org.apache.commons.lang.StringUtils.EMPTY ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Snapshot addActiveSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; java.lang.String memoryVolume = ( ( activeSnapshot != null ) && ( ! ( getParameters ( ) . isImportAsNewEntity ( ) ) ) ) ? activeSnapshot.getMemoryVolume ( ) : org.apache.commons.lang.StringUtils.EMPTY ; return snapshotsManager.addActiveSnapshot ( snapshotId , getVm ( ) , memoryVolume , org.ovirt.engine.core.bll.ImportVmCommand.getCompensationContext ( ) ) ; }
Source:
public static void initOsArchitecture ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osArchitectures = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsArchitectures ) , callback ) ; }

Target:
private void initDisplayTypes ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { displayTypes = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDisplayTypes ) , callback ) ; }
Source:
private boolean containsVmCluster ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters ) { for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( ( cluster.getStoragePoolId ( ) ) != null ) { if ( vm.getVdsGroupId ( ) . equals ( cluster.getId ( ) ) ) { return true ; } } } return false ; }

Target:
private boolean containsVmCluster ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters ) { for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : clusters ) { if ( ( cluster.getStoragePoolId ( ) ) != null ) { if ( vm.getClusterId ( ) . equals ( cluster.getId ( ) ) ) { return true ; } } } return false ; }
Source:
void registerPluginEventHandlerObject ( java.lang.String pluginName , com.google.gwt.core.client.JavaScriptObject pluginEventHandlerObject ) { org.ovirt.engine.ui.webadmin.plugin.Plugin plugin = getPlugin ( pluginName ) ; if ( ( plugin != null ) && ( pluginEventHandlerObject != null ) ) { plugin.setEventHandlerObject ( pluginEventHandlerObject ) ; org.ovirt.engine.ui.webadmin.plugin.PluginManager.logger.info ( ( ( "Plugin [" + pluginName ) + "] has registered the event handler object" ) ) ; } }

Target:
void registerPluginEventHandlerObject ( java.lang.String pluginName , com.google.gwt.core.client.JavaScriptObject pluginEventHandlerObject ) { org.ovirt.engine.ui.webadmin.plugin.Plugin plugin = getPlugin ( pluginName ) ; if ( ( plugin == null ) || ( pluginEventHandlerObject == null ) ) { return ; } if ( ( plugin.getEventHandlerObject ( ) ) == null ) { plugin.setEventHandlerObject ( pluginEventHandlerObject ) ; org.ovirt.engine.ui.webadmin.plugin.PluginManager.logger.info ( ( ( "Plugin [" + pluginName ) + "] has registered the event handler object" ) ) ; } else { org.ovirt.engine.ui.webadmin.plugin.PluginManager.logger.warning ( ( ( "Plugin [" + pluginName ) + "] has already registered the event handler object" ) ) ; } }
Source:
public void validateCantLiveMigrateToBackupDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( srcStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; dstStorageDomain.setBackup ( true ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_DISKS_ON_BACKUP_STORAGE ) ; }

Target:
public void validateCantLiveMigrateToBackupDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; dstStorageDomain.setBackup ( true ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_DISKS_ON_BACKUP_STORAGE ) ; }
Source:
public void validateFailsWhenGlusterHostHasVolumes ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) , null ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }

Target:
public void validateFailsWhenGlusterMultipleHostHasVolumesWithForce ( ) throws java.lang.Exception { command.getParameters ( ) . setForceAction ( true ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockHasMultipleClusters ( true ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }
Source:
public void serializeVdsActionParameters ( ) { org.ovirt.engine.core.common.action.VdcActionParametersBase params = new org.ovirt.engine.core.common.action.VdcActionParametersBase ( ) ; params.setLockProperties ( org.ovirt.engine.core.common.action.LockProperties.create ( Scope.None ) . withWait ( true ) ) ; org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer serializer = new org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer ( ) ; org.junit.Assert.assertTrue ( ( ( serializer.serialize ( params ) . length ( ) ) > 0 ) ) ; }

Target:
public void serializeVdsActionParameters ( ) { org.ovirt.engine.core.common.action.ActionParametersBase params = new org.ovirt.engine.core.common.action.ActionParametersBase ( ) ; params.setLockProperties ( org.ovirt.engine.core.common.action.LockProperties.create ( Scope.None ) . withWait ( true ) ) ; org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer serializer = new org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer ( ) ; org.junit.Assert.assertTrue ( ( ( serializer.serialize ( params ) . length ( ) ) > 0 ) ) ; }
Source:
private void mockFenceVdsResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result1 , org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result2 ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal1 = createVdsReturnValue ( result1 ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal2 = ( result2 == null ) ? null : createVdsReturnValue ( result2 ) ; org.mockito.Mockito.when ( resourceManager.runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.FenceVds ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.FenceVdsVDSCommandParameters.class ) ) ) . thenReturn ( retVal1 ) . thenReturn ( retVal2 ) ; }

Target:
private void mockFenceVdsResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result1 , org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result2 ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal1 = createVdsReturnValue ( result1 ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal2 = ( result2 == null ) ? null : createVdsReturnValue ( result2 ) ; org.mockito.Mockito.when ( resourceManager.runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.FenceVds ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.FenceVdsVDSCommandParameters.class ) ) ) . thenReturn ( retVal1 ) . thenReturn ( retVal2 ) ; }
Source:
public void testWrongKey ( ) throws java.lang.Exception { java.security.KeyPairGenerator generator = java.security.KeyPairGenerator.getInstance ( "RSA" ) ; java.security.KeyPair badKeyPair = generator.generateKeyPair ( ) ; client.setKeyPair ( badKeyPair ) ; client.connect ( ) ; client.authenticate ( ) ; client.executeCommand ( org.ovirt.engine.core.uutils.ssh.BasicTest.hello_command , null , null , null ) ; }

Target:
public void testWrongKey ( ) throws java.lang.Exception { java.security.KeyPairGenerator generator = java.security.KeyPairGenerator.getInstance ( "RSA" ) ; java.security.KeyPair badKeyPair = generator.generateKeyPair ( ) ; client.setKeyPair ( badKeyPair ) ; client.connect ( ) ; client.authenticate ( ) ; client.executeCommand ( org.ovirt.engine.core.uutils.ssh.BasicTest.helloCommand , null , null , null ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > retval = vmTemplateDao.getAll ( org.ovirt.engine.core.bll.GetAllTemplateBasedEntityQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllTemplateBasedEntityQuery.getParameters ( ) . isFiltered ( ) , entityType ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : retval ) { vmTemplateHandler.updateDisksFromDb ( template ) ; } org.ovirt.engine.core.bll.GetAllTemplateBasedEntityQuery.getQueryReturnValue ( ) . setReturnValue ( retval ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = vmTemplateDao.getAll ( org.ovirt.engine.core.bll.GetAllTemplateBasedEntityQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetAllTemplateBasedEntityQuery.getParameters ( ) . isFiltered ( ) , entityType ) ; templates.forEach ( vmTemplateHandler :: updateDisksFromDb ) ; org.ovirt.engine.core.bll.GetAllTemplateBasedEntityQuery.getQueryReturnValue ( ) . setReturnValue ( templates ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcActionType getImagesActionType ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Move ) ) { return org.ovirt.engine.core.common.action.VdcActionType.MoveImageGroup ; } return org.ovirt.engine.core.common.action.VdcActionType.CopyImageGroup ; }

Target:
private boolean validateVmSnapshotStatus ( ) { org.ovirt.engine.core.bll.snapshots.SnapshotsValidator snapshotsValidator = getSnapshotsValidator ( ) ; for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > pair : getVmsWithVmDeviceInfoForDiskId ( ) ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = pair.getSecond ( ) ; if ( ( vmDevice.getSnapshotId ( ) ) == null ) { org.ovirt.engine.core.common.businessentities.VM vm = pair.getFirst ( ) ; if ( ! ( validate ( snapshotsValidator.vmNotInPreview ( vm.getId ( ) ) ) ) ) { return false ; } } } return true ; }
Source:
public void testValidRemovedBondsWhenBondIsNotRequired ( ) throws java.lang.Exception { java.lang.String nicName = "nicName" ; bond.setName ( nicName ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setRemovedBonds ( java.util.Collections.singleton ( bond.getId ( ) ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( params , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > singletonList ( bond ) ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidRemovedBondsWhenBondIsNotRequired ( ) throws java.lang.Exception { java.lang.String nicName = "nicName" ; bond.setName ( nicName ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedBonds ( bond.getId ( ) ) ) . addExistingInterfaces ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > singletonList ( bond ) ) . build ( ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private void pollAndUpdateAsyncTasks ( ) { if ( logChangedMap ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.infoFormat ( "Polling and updating Async Tasks: {0} tasks, {1} tasks to poll now" , _tasks.size ( ) , numberOfTasksToPoll ( ) ) ; } java.util.Set < org.ovirt.engine.core.compat.Guid > poolsOfActiveTasks = getPoolIdsTasks ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > > poolsAllTasksMap = getSPMsTasksStatuses ( poolsOfActiveTasks ) ; updateTaskStatuses ( poolsAllTasksMap ) ; }

Target:
private void pollAndUpdateAsyncTasks ( ) { if ( logChangedMap ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.info ( "Polling and updating Async Tasks: tasks, tasks to poll now" , _tasks.size ( ) , numberOfTasksToPoll ( ) ) ; } java.util.Set < org.ovirt.engine.core.compat.Guid > poolsOfActiveTasks = getPoolIdsTasks ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > > poolsAllTasksMap = getSPMsTasksStatuses ( poolsOfActiveTasks ) ; updateTaskStatuses ( poolsAllTasksMap ) ; }
Source:
private void initInterface ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { if ( ( iface.getId ( ) ) == null ) { iface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } fillMacAddressIfMissing ( iface ) ; iface.setVmTemplateId ( null ) ; iface.setVmId ( getVmId ( ) ) ; iface.setVmName ( getVm ( ) . getName ( ) ) ; }

Target:
private java.lang.String getMemoryVolumeFromActiveSnapshotInExportDomain ( ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getVm ( ) . getSnapshots ( ) ) { if ( ( snapshot.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.ACTIVE ) ) return snapshot.getMemoryVolume ( ) ; } org.ovirt.engine.core.bll.ImportVmCommand.log.warnFormat ( "VM {0} doesn't have active snapshot in export domain" , getVmId ( ) ) ; return org.apache.commons.lang.StringUtils.EMPTY ; }
Source:
public void canDetectMissingRequiredHostNumaNodes ( ) { updatedNumaNodes = java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNodeWithId ( 0 , vdsNumaNodes , org.ovirt.engine.core.bll.numa.vm.UpdateVmNumaNodesCommandTest.NODE_ID_0 ) ) ; vm.setvNumaNodeList ( existingNumaNodes ) ; vdsNumaNodes.remove ( 0 ) ; final org.ovirt.engine.core.bll.numa.vm.UpdateVmNumaNodesCommand command = mockedCommandWithVmFromParams ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VM_NUMA_NODE_HOST_NODE_INVALID_INDEX ) ; }

Target:
public void canDetectMissingRequiredHostNumaNodes ( ) { updatedNumaNodes = java.util.Collections.singletonList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNodeWithId ( 0 , vdsNumaNodes , org.ovirt.engine.core.bll.numa.vm.UpdateVmNumaNodesCommandTest.NODE_ID_0 ) ) ; vm.setvNumaNodeList ( existingNumaNodes ) ; vdsNumaNodes.remove ( 0 ) ; final org.ovirt.engine.core.bll.numa.vm.UpdateVmNumaNodesCommand command = mockedCommandWithVmFromParams ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VM_NUMA_NODE_HOST_NODE_INVALID_INDEX ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > newItems = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; setItems ( newItems ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > newItems = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( newItems , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; setItems ( newItems ) ; }